🧪
The Soroban's Token Playground
  • README
  • Index
    • 1: Introduction & Motivation.
    • 2 : Basic Concepts
    • 3 : Environment preparation
    • 4 : Issue and Mint Asset in Stellar.
    • 5: Get info about a token in Classic.
    • 6 : Wrap a token from Stellar Classic to Soroban.
    • 7 : Mint from a wrapped token in Soroban.
    • 8 : Use the native Stellar Lumens (XLM) the classic way.
    • 9 : Read the native token (XLM) using soroban-cli.
    • 10 : Write the native token (XLM) using soroban-cli.
    • 11 : Use the native token (XLM) inside a smart contract.
    • 12 : Identify a Stellar Classic Asset using stellar-sdk.
    • 13 : Wrap an asset using stellar-sdk.
Powered by GitBook
On this page
  • Calculate the contract ID
  • See if the contract exist
Edit on GitHub
  1. Index

13 : Wrap an asset using stellar-sdk.

In a frontend we would like to help the user to wrap a Stellar Classic Asset in order to later, use it in a Soroban Smart Contract

Calculate the contract ID

We can calculate the wrapped contract ID, even if the asset does not yet exist:

bash quickstart.sh standalone
bash run.sh
#node src/friendbot.js
node src/chapter13/checkAssetWrappedID.js ABC GAM5XOXRUWPMKENBGOEAKMLRQ4ENHLHDSU2L2J7TVJ34ZI7S6PHMYIGI

See if the contract exist

We might call to a "balance" function and see if this fails?

Previous12 : Identify a Stellar Classic Asset using stellar-sdk.

Last updated 1 year ago