@buildonspark/issuer-sdk 0.0.35 → 0.0.37
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 +2 -3
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -6
- package/package.json +3 -3
- package/src/issuer-spark-wallet.ts +6 -8
- package/src/proto/spark.ts +1673 -768
- package/src/tests/integration/spark.test.ts +216 -192
- package/src/tests/utils/issuer-test-wallet.ts +31 -0
- package/src/tests/utils/spark-testing-wallet.ts +64 -0
package/dist/index.cjs
CHANGED
|
@@ -321,7 +321,6 @@ function convertTokenActivityToHexEncoded(rawTransactions) {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// src/issuer-spark-wallet.ts
|
|
324
|
-
var import_address2 = require("@buildonspark/spark-sdk/address");
|
|
325
324
|
var BURN_ADDRESS = "02".repeat(33);
|
|
326
325
|
var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk.SparkWallet {
|
|
327
326
|
issuerTokenTransactionService;
|
|
@@ -397,7 +396,7 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk.SparkW
|
|
|
397
396
|
async freezeTokens(sparkAddress) {
|
|
398
397
|
await this.syncTokenOutputs();
|
|
399
398
|
const tokenPublicKey = await super.getIdentityPublicKey();
|
|
400
|
-
const decodedOwnerPubkey = (0,
|
|
399
|
+
const decodedOwnerPubkey = (0, import_address.decodeSparkAddress)(
|
|
401
400
|
sparkAddress,
|
|
402
401
|
this.config.getNetworkType()
|
|
403
402
|
);
|
|
@@ -414,7 +413,7 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk.SparkW
|
|
|
414
413
|
async unfreezeTokens(sparkAddress) {
|
|
415
414
|
await this.syncTokenOutputs();
|
|
416
415
|
const tokenPublicKey = await super.getIdentityPublicKey();
|
|
417
|
-
const decodedOwnerPubkey = (0,
|
|
416
|
+
const decodedOwnerPubkey = (0, import_address.decodeSparkAddress)(
|
|
418
417
|
sparkAddress,
|
|
419
418
|
this.config.getNetworkType()
|
|
420
419
|
);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ListAllTokenTransactionsCursor, OperationType } from '@buildonspark/lrc20-sdk/proto/rpc/v1/types';
|
|
2
2
|
import { SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
|
|
3
3
|
import { OutputWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto/spark';
|
|
4
|
+
import { ConfigOptions } from '@buildonspark/spark-sdk/services/wallet-config';
|
|
4
5
|
import { GetTokenActivityResponse, TokenDistribution } from './types.cjs';
|
|
5
6
|
|
|
6
7
|
type IssuerTokenInfo = {
|
|
@@ -18,7 +19,7 @@ declare class IssuerSparkWallet extends SparkWallet {
|
|
|
18
19
|
mnemonic?: string | undefined;
|
|
19
20
|
wallet: IssuerSparkWallet;
|
|
20
21
|
}>;
|
|
21
|
-
|
|
22
|
+
protected constructor(configOptions?: ConfigOptions);
|
|
22
23
|
getIssuerTokenBalance(): Promise<{
|
|
23
24
|
balance: bigint;
|
|
24
25
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ListAllTokenTransactionsCursor, OperationType } from '@buildonspark/lrc20-sdk/proto/rpc/v1/types';
|
|
2
2
|
import { SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
|
|
3
3
|
import { OutputWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto/spark';
|
|
4
|
+
import { ConfigOptions } from '@buildonspark/spark-sdk/services/wallet-config';
|
|
4
5
|
import { GetTokenActivityResponse, TokenDistribution } from './types.js';
|
|
5
6
|
|
|
6
7
|
type IssuerTokenInfo = {
|
|
@@ -18,7 +19,7 @@ declare class IssuerSparkWallet extends SparkWallet {
|
|
|
18
19
|
mnemonic?: string | undefined;
|
|
19
20
|
wallet: IssuerSparkWallet;
|
|
20
21
|
}>;
|
|
21
|
-
|
|
22
|
+
protected constructor(configOptions?: ConfigOptions);
|
|
22
23
|
getIssuerTokenBalance(): Promise<{
|
|
23
24
|
balance: bigint;
|
|
24
25
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./chunk-GB7N6I5O.js";
|
|
2
2
|
|
|
3
3
|
// src/issuer-spark-wallet.ts
|
|
4
|
-
import {
|
|
5
|
-
TokenPubkey,
|
|
6
|
-
TokenPubkeyAnnouncement
|
|
7
|
-
} from "@buildonspark/lrc20-sdk";
|
|
4
|
+
import { TokenPubkey, TokenPubkeyAnnouncement } from "@buildonspark/lrc20-sdk";
|
|
8
5
|
import { SparkWallet } from "@buildonspark/spark-sdk";
|
|
9
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
decodeSparkAddress,
|
|
8
|
+
encodeSparkAddress
|
|
9
|
+
} from "@buildonspark/spark-sdk/address";
|
|
10
10
|
import {
|
|
11
11
|
bytesToHex as bytesToHex2,
|
|
12
12
|
bytesToNumberBE as bytesToNumberBE2,
|
|
@@ -295,7 +295,6 @@ function convertTokenActivityToHexEncoded(rawTransactions) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// src/issuer-spark-wallet.ts
|
|
298
|
-
import { decodeSparkAddress } from "@buildonspark/spark-sdk/address";
|
|
299
298
|
var BURN_ADDRESS = "02".repeat(33);
|
|
300
299
|
var IssuerSparkWallet = class _IssuerSparkWallet extends SparkWallet {
|
|
301
300
|
issuerTokenTransactionService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildonspark/issuer-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
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.
|
|
58
|
-
"@buildonspark/spark-sdk": "0.1.
|
|
57
|
+
"@buildonspark/lrc20-sdk": "0.0.34",
|
|
58
|
+
"@buildonspark/spark-sdk": "0.1.6",
|
|
59
59
|
"@noble/curves": "^1.8.0",
|
|
60
60
|
"@scure/btc-signer": "^1.5.0",
|
|
61
61
|
"bitcoinjs-lib": "^6.1.5",
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TokenPubkey,
|
|
3
|
-
TokenPubkeyAnnouncement,
|
|
4
|
-
TokenPubkeyInfo,
|
|
5
|
-
} from "@buildonspark/lrc20-sdk";
|
|
1
|
+
import { TokenPubkey, TokenPubkeyAnnouncement } from "@buildonspark/lrc20-sdk";
|
|
6
2
|
import {
|
|
7
3
|
ListAllTokenTransactionsCursor,
|
|
8
4
|
OperationType,
|
|
9
5
|
} from "@buildonspark/lrc20-sdk/proto/rpc/v1/types";
|
|
10
6
|
import { SparkWallet, SparkWalletProps } from "@buildonspark/spark-sdk";
|
|
11
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
decodeSparkAddress,
|
|
9
|
+
encodeSparkAddress,
|
|
10
|
+
} from "@buildonspark/spark-sdk/address";
|
|
12
11
|
import { OutputWithPreviousTransactionData } from "@buildonspark/spark-sdk/proto/spark";
|
|
13
12
|
import { ConfigOptions } from "@buildonspark/spark-sdk/services/wallet-config";
|
|
14
13
|
import {
|
|
@@ -20,7 +19,6 @@ import { TokenFreezeService } from "./services/freeze.js";
|
|
|
20
19
|
import { IssuerTokenTransactionService } from "./services/token-transactions.js";
|
|
21
20
|
import { GetTokenActivityResponse, TokenDistribution } from "./types.js";
|
|
22
21
|
import { convertTokenActivityToHexEncoded } from "./utils/type-mappers.js";
|
|
23
|
-
import { decodeSparkAddress } from "@buildonspark/spark-sdk/address";
|
|
24
22
|
|
|
25
23
|
const BURN_ADDRESS = "02".repeat(33);
|
|
26
24
|
|
|
@@ -47,7 +45,7 @@ export class IssuerSparkWallet extends SparkWallet {
|
|
|
47
45
|
};
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
protected constructor(configOptions?: ConfigOptions) {
|
|
51
49
|
super(configOptions);
|
|
52
50
|
this.issuerTokenTransactionService = new IssuerTokenTransactionService(
|
|
53
51
|
this.config,
|