Asset transfers

Asset transfers

A user might want to transfer their asset from one wallet to another for various reasons, ie. sending the asset as a gift.

πŸ“GUIDES

  • Core SDK

  • Link SDK

Core SDK​

1. Initialize the Core SDK​

In order to use the Core SDK, you need to initialize it.

2. Generate signers​

Transferring an asset requires a user's signature, so your application will need to generate signers.

3. Set the transfer params​

The transfer request requires:

  1. ETH and Stark signers (see previous step)

  2. Token type, and token amount/details to be transferred

  3. Address of receiving account

Token types that can be transferred and details required:​

  • ETH - amount

  • ERC20 - amount, tokenAddress

  • ERC721 - tokenAddress, tokenId

Param
Description

amount

The amount of the token required. If token is ETH, the amount is denominated in wei

tokenAddress

The address of the smart contract from which the token originates

tokenId

The token ID of a non-fungible token (only for ERC721 token types)

  • Typescript Core SDK

πŸ“šSDK REFERENCE

  • unsignedTransferRequest

Example request params for the different token types:

ETH

ERC20

ERC721

  • Kotlin (JVM) Core SDK

πŸ“šSDK REFERENCE

  • AssetModel

    • Erc20Asset

    • Erc721Asset

    • EthAsset

Example request params for the different token types:

ETH

ERC20

ERC721

  • Swift Core SDK

πŸ“šSDK REFERENCE

  • createTransferRequest

  • Golang Core SDK

πŸ“šSDK REFERENCE

  • GetSignableTransferRequestV1

  • Token type models:

    • SignableETHToken

    • SignableERC20Token

    • SignableERC721Token

See also:​

πŸ’»EXAMPLE

  • Transfer

4. Create the transfer​

  • Typescript Core SDK

πŸ“šSDK REFERENCE

  • transfer

Example response:​

  • Kotlin (JVM) Core SDK

πŸ“šSDK REFERENCE

  • transfer

Example response:​

  • Swift Core SDK

πŸ“šSDK REFERENCE

  • createTransfer

  • Golang Core SDK

πŸ“šSDK REFERENCE

  • Transfer

Example response:​

See also:​

πŸ’»EXAMPLE

  • Transfer

Last updated