January 2020
Intermediate to advanced
530 pages
11h 11m
English
Creating an asset object on the Stellar network is an easy affair. You simply need to use the Asset method of the Stellar SDK. The Asset method has two input parameters—asset code and issuer account. The asset code is an alphanumeric code, used to refer to the asset. The issuer account is the account used to create the asset. The code is shown in the following code snippet:
Asset = new StellarSdk.Asset(<Code>,<Issuing Account>)
We'll use this to create all three of our assets, as part of our Nodejs utility, by running the following code:
var USD = new StellarSdk.8520Asset('USD', 'GBUM3XRJKUVEQA4UF63CUCS3P72C5AZTRYI2VKELS7T7DVCCLV3DODNE');var GBP = new StellarSdk.Asset('GBP', 'GBUM3XRJKUVEQA4UF63CUCS3P72C5AZTRYI2VKELS7T7DVCCLV3DODNE'); ...Read now
Unlock full access