Transfer

type TransferBuilder

type TransferBuilder struct {
	AccountId        AccountId
	ToAddress        ZkLinkAddress
	FromSubAccountId SubAccountId
	ToSubAccountId   SubAccountId
	Token            TokenId
	Amount           BigUint
	Fee              BigUint
	Nonce            Nonce
	Timestamp        TimeStamp
}

Builder is used to build Transfer transaction

type Transfer

Transfer transaction type, it's a opaque data type.

func NewTransfer(builder TransferBuilder)

func NewTransfer(builder TransferBuilder) *Transfer

Create a new Transfer transaction.

Get the signature in the Transfer transaction.

func (*Transfer) GetBytes

Get the encoded bytes used to create the L3 signature.

func (*Transfer) TxHash

Get the transaction hash of Transfer transaction.

func (*Transfer) JsonStr

Get the json string of the Transfer transaction.

func (*Transfer) IsValid

Check if all the fields in Withdraw are valid. For example, if the ChainId is exceeded the maximum ChainId, it will return false.

func (*Transfer) CreateSignedTx

Sign the Transfer transaction with the ZkLinkSigner, L1 signature and L3 signature will be created.

input:

func (*Transfer) GetSignature

func (*Transfer) IsSignatureValid

Check if the L3 signature in the transaction is valid or not.

func (*Transfer) GetEthSignMsg

Get the message that used to create the Ethereum signature.

func (*Transfer) EthSignature

Create Ethereum signature, returns a TxLayer1Signature

input:

  • ethSigner: EthSigner

  • tokenSymbol: the symbol string of the token, for example, USDT

func (*Transfer) SubmitterSignature

Create the submitter signature.

input:

func (*Transfer) ToZklinkTx

Change the transaction to the ZkLinkTx

Last updated

Was this helpful?