Skip to content

Commit 7cec668

Browse files
committed
readme fixes
1 parent a8a418b commit 7cec668

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const secret = crypto.getRandomValues(new Uint8Array(128)); // User secret key
4040
const tokenId = TokenId.create(crypto.getRandomValues(new Uint8Array(32))); // Chosen ID
4141
const tokenType = TokenType.create(crypto.getRandomValues(new Uint8Array(32))); // Token type
4242
const 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 */]);
4444
const salt = crypto.getRandomValues(new Uint8Array(32)); /* Your random salt bytes */
4545
const stateData = new Uint8Array()/* Your state data bytes */;
4646

@@ -173,8 +173,8 @@ const maskedPredicate = await MaskedPredicate.create(
173173
```typescript
174174
const 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
316316
const tokenId = TokenId.create(crypto.getRandomValues(new Uint8Array(32))); // Chosen ID
317317
const tokenType = TokenType.create(crypto.getRandomValues(new Uint8Array(32))); // Token type
318318
const 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 */]);
320320
const salt = crypto.getRandomValues(new Uint8Array(32)); /* Your random salt bytes */
321321
const 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

Comments
 (0)