SUN Network DAppChain Developer Documents: Asset Deposit

TRON Foundation
Aug 25 · 2 min read

depositTrx

deposit trx from main-chain to side-chain

// Format
sunWeb.depostiTrx(callValue, feeLimit, options);
// example
sunWeb.depositTrx(100000000, 1000000);

Arguments

depositTrc10

deposit TRC10 token from main-chain to side-chain

// format
sunWeb.depositTrc10(tokenId, tokenValue, feeLimit, options);
// example
sunWeb.depositTrc10(100059, 10000000, 100000);

Arguments

depositTrc20

deposit TRC20 token from main-chain to side-chain

Note: You have to mapping TRC20 contract to side-chain with the mappingTrc20 function provided by SunWeb. Then you also have to use the approveTrc20 function. Only done with the two steps before, you can depositTrc20 from main-chain to side-chain.

// format
sunWeb.depositTrc10(num, feeLimit, contractAddress, options);
// example
sunWeb.depositTrc10(1000000, 1000000, 'TD9Jrm546pGkzRu7K5nitMxk8nn75wXNkQ');

Arguments

depositTrc721

deposit TRC721 token from main-chain to side-chain

Note: You have to use mappingTrc721 and approveTrc721 before depositTrc721 like depositTrc20.

// format
sunWeb.depositTrc721(id, feeLimit, contractAddress, options);
// example
sunWeb.depositTrc10(1000000, 1000000, 'TCLRqK6aP2xsCZWhE2smkYzdRHf9uvyz5P');

Arguments

TRON

TRON Foundation

Written by

The official Medium of Tron Foundation. Learn more: https://tron.network

TRON

TRON

TRON

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade