@@ -40,7 +40,7 @@ const secret = crypto.getRandomValues(new Uint8Array(128)); // User secret key
4040const tokenId = TokenId .create (crypto .getRandomValues (new Uint8Array (32 ))); // Chosen ID
4141const tokenType = TokenType .create (crypto .getRandomValues (new Uint8Array (32 ))); // Token type
4242const tokenData = new Uint8Array (0 ); /* Your own token data object with ISerializable attributes */
43- const coinData = new TokenCoinData ([/* [CoinId, value] elements to have coins in token */ ]);
43+ const coinData = TokenCoinData . create ([/* [CoinId, value] elements to have coins in token */ ]);
4444const salt = crypto .getRandomValues (new Uint8Array (32 )); /* Your random salt bytes */
4545const stateData = new Uint8Array ()/* Your state data bytes */ ;
4646
@@ -173,8 +173,8 @@ const maskedPredicate = await MaskedPredicate.create(
173173``` typescript
174174const textEncoder = new TextEncoder ();
175175
176- const tokenData = new TokenCoinData ([
177- { coinId: new CoinId (textEncoder .encode (' ALPHA_COIN' )), value: BigInt (1000 ) }
176+ const tokenData = TokenCoinData . create ([
177+ [ new CoinId (textEncoder .encode (' ALPHA_COIN' )), BigInt (1000 )]
178178]);
179179```
180180
@@ -316,7 +316,7 @@ const secret = crypto.getRandomValues(new Uint8Array(128)); // User secret key
316316const tokenId = TokenId .create (crypto .getRandomValues (new Uint8Array (32 ))); // Chosen ID
317317const tokenType = TokenType .create (crypto .getRandomValues (new Uint8Array (32 ))); // Token type
318318const tokenData = new Uint8Array (0 ); /* Your own token data object with ISerializable attributes */
319- const coinData = new TokenCoinData ([/* [CoinId, value] elements to have coins in token */ ]);
319+ const coinData = TokenCoinData . create ([/* [CoinId, value] elements to have coins in token */ ]);
320320const salt = crypto .getRandomValues (new Uint8Array (32 )); /* Your random salt bytes */
321321const stateData = new Uint8Array ()/* Your state data bytes */ ;
322322
@@ -502,7 +502,9 @@ const updateToken = await client.finishTransaction(
502502### Checking Token Status
503503
504504``` typescript
505- const status = await client .getTokenStatus (token );
505+ // You need the public key of the current owner to check token status
506+ const publicKey = signingService .getPublicKey ();
507+ const status = await client .getTokenStatus (token , publicKey );
506508/*
507509 status InclusionProofVerificationStatus.OK is spent
508510 status InclusionProofVerificationStatus.PATH_NOT_INCLUDED is unspent
0 commit comments