@buildonspark/issuer-sdk 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -125,7 +125,7 @@ var TokenFreezeService = class {
125
125
  };
126
126
  })
127
127
  );
128
- const successfulResponses = (0, import_utils2.validateResponses)(freezeResponses);
128
+ const successfulResponses = (0, import_utils2.collectResponses)(freezeResponses);
129
129
  return successfulResponses[0].response;
130
130
  }
131
131
  };
@@ -368,7 +368,7 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk.SparkW
368
368
  tokenSymbol: info.announcement.symbol,
369
369
  tokenDecimals: Number((0, import_utils5.bytesToNumberBE)(info.announcement.decimal)),
370
370
  isFreezable: info.announcement.isFreezable,
371
- maxSupply: (0, import_utils5.bytesToNumberBE)(info.totalSupply)
371
+ maxSupply: (0, import_utils5.bytesToNumberBE)(info.announcement.maxSupply)
372
372
  };
373
373
  }
374
374
  async mintTokens(tokenAmount) {
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  } from "@noble/curves/abstract/utils";
15
15
 
16
16
  // src/services/freeze.ts
17
- import { validateResponses } from "@buildonspark/spark-sdk/utils";
17
+ import { collectResponses } from "@buildonspark/spark-sdk/utils";
18
18
 
19
19
  // src/utils/token-hashing.ts
20
20
  import { sha256 } from "@scure/btc-signer/utils";
@@ -99,7 +99,7 @@ var TokenFreezeService = class {
99
99
  };
100
100
  })
101
101
  );
102
- const successfulResponses = validateResponses(freezeResponses);
102
+ const successfulResponses = collectResponses(freezeResponses);
103
103
  return successfulResponses[0].response;
104
104
  }
105
105
  };
@@ -342,7 +342,7 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends SparkWallet {
342
342
  tokenSymbol: info.announcement.symbol,
343
343
  tokenDecimals: Number(bytesToNumberBE2(info.announcement.decimal)),
344
344
  isFreezable: info.announcement.isFreezable,
345
- maxSupply: bytesToNumberBE2(info.totalSupply)
345
+ maxSupply: bytesToNumberBE2(info.announcement.maxSupply)
346
346
  };
347
347
  }
348
348
  async mintTokens(tokenAmount) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildonspark/issuer-sdk",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "Spark Issuer SDK for token issuance",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.js",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@bufbuild/protobuf": "^2.2.5",
57
- "@buildonspark/lrc20-sdk": "0.0.34",
58
- "@buildonspark/spark-sdk": "0.1.6",
57
+ "@buildonspark/lrc20-sdk": "0.0.36",
58
+ "@buildonspark/spark-sdk": "0.1.8",
59
59
  "@noble/curves": "^1.8.0",
60
60
  "@scure/btc-signer": "^1.5.0",
61
61
  "bitcoinjs-lib": "^6.1.5",
@@ -87,7 +87,7 @@ export class IssuerSparkWallet extends SparkWallet {
87
87
  tokenSymbol: info.announcement!.symbol,
88
88
  tokenDecimals: Number(bytesToNumberBE(info.announcement!.decimal)),
89
89
  isFreezable: info.announcement!.isFreezable,
90
- maxSupply: bytesToNumberBE(info.totalSupply),
90
+ maxSupply: bytesToNumberBE(info.announcement!.maxSupply),
91
91
  };
92
92
  }
93
93
 
@@ -4,7 +4,7 @@ import {
4
4
  FreezeTokensPayload,
5
5
  FreezeTokensResponse,
6
6
  } from "@buildonspark/spark-sdk/proto/spark";
7
- import { validateResponses } from "@buildonspark/spark-sdk/utils";
7
+ import { collectResponses } from "@buildonspark/spark-sdk/utils";
8
8
  import { hashFreezeTokensPayload } from "../utils/token-hashing.js";
9
9
 
10
10
  export class TokenFreezeService {
@@ -72,7 +72,7 @@ export class TokenFreezeService {
72
72
  }),
73
73
  );
74
74
 
75
- const successfulResponses = validateResponses(freezeResponses);
75
+ const successfulResponses = collectResponses(freezeResponses);
76
76
 
77
77
  return successfulResponses[0].response;
78
78
  }
@@ -77,7 +77,7 @@ describe("token integration test", () => {
77
77
  expect(publicKeyInfo?.tokenName).toEqual("TestToken1");
78
78
  expect(publicKeyInfo?.tokenSymbol).toEqual("TT1");
79
79
  expect(publicKeyInfo?.tokenDecimals).toEqual(0);
80
- expect(publicKeyInfo?.maxSupply).toEqual(0);
80
+ expect(publicKeyInfo?.maxSupply).toEqual(0n);
81
81
  expect(publicKeyInfo?.isFreezable).toEqual(false);
82
82
 
83
83
  // Compare the public key using bytesToHex