8. Asset Deposits
Last updated
Was this helpful?
Last updated
Was this helpful?
Users are able to deposit assets from L1 to L2 in Zecrey.
You will need to initialize the SDK in order to use it.
Parameters needed:
Parameter
Parameter usage and meaning
Requirement
accountName
The account name used to initialize the client
✅
seed
The user's L2 seed used to initialize the client
✅
privateKey
Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction
✅
nftL1Address
The corresponding L1 address of the NFT
✅
nftIndex
The unique ID of NFT in L1
✅
Example
Deposit the NFT with nftIndex
= 511
Initialize client
Deposit the NFT with nftIndex
= 511
Example Result
Parameters needed:
Parameter
Parameter usage and meaning
Requirement
accountName
The account name used to initialize the client
✅
seed
The user's L2 seed used to initialize the client
✅
privateKey
Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction
✅
AssetId
Token ID
✅
Token information
Token
Token ID
Parameter
BNB
0
sdk.BNBAssetId
LEG
1
sdk.LEGAssetId
REY
2
sdk.REYAssetId
Example
Deposit 10000 BNB to L2
Initialize client
Deposit
For BEP20 token, you need to import the token address
Example result