zkLink X Documentaion
HomeGitHubBlogExplorer
  • 🙂Welcome
    • Introduction
  • ⚖️Architecture
    • Overview
    • Settlement Layer
      • Working Principal of A Multi-Chain ZK-Rollup
      • Nexus: Settlement on ETH L2s
      • Origin: Settlement on ETH and Alt-L1s
      • Multi-Chain State Synchronization
        • In-Detail: Nexus Multi-Chain State Synchronization
      • Supported Networks of zkLink Nexus and Origin
      • Security Assumptions of zkLink Nexus and Origin
    • Execution Layer
      • TS-zkVM for App Rollup
    • Sequencing Layer
    • DA Layer
  • 🛠️Developer
    • Developer Overview
    • Get Started
    • Examples
      • Base Demo
    • JSON RPC & Websocket & Kafka
      • JSON-RPC API
      • JSON-RPC Errors
      • Websocket
      • Kafka
    • Transactions
      • Basic Types
      • State Update
      • Transaction
        • Deposit
        • FullExit
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • AutoDeleveraging
        • ContractMatching
        • Funding
        • Liquidation
        • UpdateGlobalVar
      • Private Key & Signature
        • Algorithm
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • ContractMatching
        • Funding
        • Liquidation
        • AutoDeleveraging
        • UpdateGlobalVar
    • SDK
      • Go
        • Types
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Js
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Dart
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
  • ⚙️Network Information
    • Connected Networks
      • Mainnet
      • Testnet
    • DApps & Deployment Addresses
      • Mainnet
      • Testnet
  • Wallet & User Fund Streamline
    • Withdraw
    • Wallet Integration & AA Wallet
    • Deposit
  • Integration Cases
    • Heavyweight Integration (Multi-Chain Derivatives & Spot Exchange)
    • Simple Integration (Multi-Chain Spot Exchange)
  • Appendix
    • Audits
    • FAQ
    • glossary
Powered by GitBook
On this page
  • type TransferBuilder
  • type Transfer

Was this helpful?

  1. Developer
  2. SDK
  3. Go
  4. Transactions

Transfer

PreviousWithdrawNextForcedExit

Last updated 1 year ago

Was this helpful?

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 transaction

type Transfer

transaction type, it's a opaque data type.

func NewTransfer(builder TransferBuilder)

func NewTransfer(builder TransferBuilder) *Transfer

Create a new transaction.

func (*Transfer) GetBytes

func (*Transfer) GetBytes() []uint8

Get the encoded bytes used to create the L3 signature.

func (*Transfer) TxHash

func (*Transfer) TxHash() []uint8

func (*Transfer) JsonStr

func (*Transfer) JsonStr() string

func (*Transfer) IsValid

func (*Transfer) IsValid() bool

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

func (*Transfer) CreateSignedTx(signer *ZkLinkSigner) (*Transfer, error)

input:

func (*Transfer) GetSignature

func (*Transfer) GetSignature() ZkLinkSignature

func (*Transfer) IsSignatureValid

func (*Transfer) IsSignatureValid() bool

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

func (*Transfer) GetEthSignMsg

func (*Transfer) GetEthSignMsg(tokenSymbol string) string

Get the message that used to create the Ethereum signature.

func (*Transfer) EthSignature

func (*Transfer) EthSignature(ethSigner *EthSigner, tokenSymbol string) (TxLayer1Signature, error)

input:

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

func (*Transfer) SubmitterSignature

func (*Transfer) SubmitterSignature(signer *ZkLinkSigner) (ZkLinkSignature, error)

Create the submitter signature.

input:

func (*Transfer) ToZklinkTx

func (*Withdraw) ToZklinkTx() ZkLinkTx

Get the signature in the transaction.

Get the transaction hash of transaction.

Get the json string of the transaction.

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

signer:

Create Ethereum signature, returns a

ethSigner:

signer:

Change the transaction to the

🛠️
Transfer
Transfer
Transfer
Transfer
Transfer
Transfer
ZkLinkSigner
ZkLinkSigner
EthSigner
ZkLinkSigner
TxLayer1Signature
ZkLinkTx