@buildonspark/issuer-sdk 0.0.100 → 0.0.102
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @buildonspark/issuer-sdk
|
|
2
2
|
|
|
3
|
+
## 0.0.102
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @buildonspark/spark-sdk@0.3.9
|
|
9
|
+
|
|
10
|
+
## 0.0.101
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- - Lower target for RN to es2020
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @buildonspark/spark-sdk@0.3.8
|
|
17
|
+
|
|
3
18
|
## 0.0.100
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -4,6 +4,7 @@ var __defProp = Object.defineProperty;
|
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
9
|
for (var name in all)
|
|
9
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
18
|
return to;
|
|
18
19
|
};
|
|
19
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20
22
|
|
|
21
23
|
// src/index.react-native.ts
|
|
22
24
|
var index_react_native_exports = {};
|
|
@@ -108,9 +110,9 @@ function hashFreezeTokensPayload(payload) {
|
|
|
108
110
|
|
|
109
111
|
// src/services/freeze.ts
|
|
110
112
|
var TokenFreezeService = class {
|
|
111
|
-
config;
|
|
112
|
-
connectionManager;
|
|
113
113
|
constructor(config, connectionManager) {
|
|
114
|
+
__publicField(this, "config");
|
|
115
|
+
__publicField(this, "connectionManager");
|
|
114
116
|
this.config = config;
|
|
115
117
|
this.connectionManager = connectionManager;
|
|
116
118
|
}
|
|
@@ -296,15 +298,15 @@ function validateTokenParameters(tokenName, tokenTicker, decimals, maxSupply) {
|
|
|
296
298
|
// src/issuer-wallet/issuer-spark-wallet.ts
|
|
297
299
|
var BURN_ADDRESS = "02".repeat(33);
|
|
298
300
|
var IssuerSparkWallet = class extends import_spark_sdk5.SparkWallet {
|
|
299
|
-
issuerTokenTransactionService;
|
|
300
|
-
tokenFreezeService;
|
|
301
|
-
tracerId = "issuer-sdk";
|
|
302
301
|
/**
|
|
303
302
|
* Initializes a new IssuerSparkWallet instance.
|
|
304
303
|
* Inherits the generic static initialize from the base class.
|
|
305
304
|
*/
|
|
306
305
|
constructor(configOptions, signer) {
|
|
307
306
|
super(configOptions, signer);
|
|
307
|
+
__publicField(this, "issuerTokenTransactionService");
|
|
308
|
+
__publicField(this, "tokenFreezeService");
|
|
309
|
+
__publicField(this, "tracerId", "issuer-sdk");
|
|
308
310
|
this.issuerTokenTransactionService = new IssuerTokenTransactionService(
|
|
309
311
|
this.config,
|
|
310
312
|
this.connectionManager
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
require("react-native-get-random-values");
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2
5
|
|
|
3
6
|
// buffer.js
|
|
4
|
-
import { Buffer } from "buffer";
|
|
7
|
+
import { Buffer as Buffer2 } from "buffer";
|
|
5
8
|
if (typeof globalThis.Buffer === "undefined") {
|
|
6
|
-
globalThis.Buffer =
|
|
9
|
+
globalThis.Buffer = Buffer2;
|
|
7
10
|
}
|
|
8
11
|
if (typeof window !== "undefined") {
|
|
9
12
|
if (typeof window.global === "undefined") {
|
|
@@ -95,9 +98,9 @@ function hashFreezeTokensPayload(payload) {
|
|
|
95
98
|
|
|
96
99
|
// src/services/freeze.ts
|
|
97
100
|
var TokenFreezeService = class {
|
|
98
|
-
config;
|
|
99
|
-
connectionManager;
|
|
100
101
|
constructor(config, connectionManager) {
|
|
102
|
+
__publicField(this, "config");
|
|
103
|
+
__publicField(this, "connectionManager");
|
|
101
104
|
this.config = config;
|
|
102
105
|
this.connectionManager = connectionManager;
|
|
103
106
|
}
|
|
@@ -239,7 +242,7 @@ function validateTokenParameters(tokenName, tokenTicker, decimals, maxSupply) {
|
|
|
239
242
|
expected: "NFC normalised string"
|
|
240
243
|
});
|
|
241
244
|
}
|
|
242
|
-
const nameBytes =
|
|
245
|
+
const nameBytes = Buffer2.from(tokenName, "utf-8").length;
|
|
243
246
|
if (nameBytes < MIN_NAME_SIZE || nameBytes > MAX_NAME_SIZE) {
|
|
244
247
|
throw new ValidationError2(
|
|
245
248
|
`Token name must be between ${MIN_NAME_SIZE} and ${MAX_NAME_SIZE} bytes`,
|
|
@@ -251,7 +254,7 @@ function validateTokenParameters(tokenName, tokenTicker, decimals, maxSupply) {
|
|
|
251
254
|
}
|
|
252
255
|
);
|
|
253
256
|
}
|
|
254
|
-
const tickerBytes =
|
|
257
|
+
const tickerBytes = Buffer2.from(tokenTicker, "utf-8").length;
|
|
255
258
|
if (tickerBytes < MIN_SYMBOL_SIZE || tickerBytes > MAX_SYMBOL_SIZE) {
|
|
256
259
|
throw new ValidationError2(
|
|
257
260
|
`Token ticker must be between ${MIN_SYMBOL_SIZE} and ${MAX_SYMBOL_SIZE} bytes`,
|
|
@@ -285,15 +288,15 @@ function validateTokenParameters(tokenName, tokenTicker, decimals, maxSupply) {
|
|
|
285
288
|
// src/issuer-wallet/issuer-spark-wallet.ts
|
|
286
289
|
var BURN_ADDRESS = "02".repeat(33);
|
|
287
290
|
var IssuerSparkWallet = class extends SparkWallet {
|
|
288
|
-
issuerTokenTransactionService;
|
|
289
|
-
tokenFreezeService;
|
|
290
|
-
tracerId = "issuer-sdk";
|
|
291
291
|
/**
|
|
292
292
|
* Initializes a new IssuerSparkWallet instance.
|
|
293
293
|
* Inherits the generic static initialize from the base class.
|
|
294
294
|
*/
|
|
295
295
|
constructor(configOptions, signer) {
|
|
296
296
|
super(configOptions, signer);
|
|
297
|
+
__publicField(this, "issuerTokenTransactionService");
|
|
298
|
+
__publicField(this, "tokenFreezeService");
|
|
299
|
+
__publicField(this, "tracerId", "issuer-sdk");
|
|
297
300
|
this.issuerTokenTransactionService = new IssuerTokenTransactionService(
|
|
298
301
|
this.config,
|
|
299
302
|
this.connectionManager
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildonspark/issuer-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.102",
|
|
4
4
|
"description": "Spark Issuer SDK for token issuance",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
"postversion": "yarn build",
|
|
79
79
|
"test-cmd": "node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --detectOpenHandles --forceExit",
|
|
80
80
|
"test": "yarn test-cmd src/tests/*.test.ts",
|
|
81
|
-
"test:integration": "
|
|
81
|
+
"test:integration": "yarn test-cmd src/tests/integration/*.test.ts",
|
|
82
82
|
"test:stress": "yarn test-cmd src/tests/stress/*.test.ts",
|
|
83
83
|
"types:watch": "tsc-absolute --watch",
|
|
84
84
|
"types": "tsc"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@buildonspark/spark-sdk": "0.3.
|
|
87
|
+
"@buildonspark/spark-sdk": "0.3.9",
|
|
88
88
|
"@noble/curves": "^1.8.0",
|
|
89
89
|
"@scure/btc-signer": "^1.5.0",
|
|
90
90
|
"buffer": "^6.0.3"
|