@buildonspark/spark-sdk 0.3.2 → 0.3.4
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 +15 -0
- package/dist/bare/index.cjs +953 -1567
- package/dist/bare/index.d.cts +132 -29
- package/dist/bare/index.d.ts +132 -29
- package/dist/bare/index.js +948 -1565
- package/dist/{chunk-MGCUXELA.js → chunk-IC4IUEOS.js} +931 -125
- package/dist/{chunk-MH7BMOLL.js → chunk-J2P3KTQP.js} +1 -1
- package/dist/{chunk-JDQKNT7G.js → chunk-KIQTO4FX.js} +403 -1808
- package/dist/{chunk-73GJOG5R.js → chunk-XWLR6G5C.js} +1 -1
- package/dist/{chunk-4KGN75J4.js → chunk-YH7MDVTT.js} +1 -1
- package/dist/{client-DrjQwET9.d.ts → client-DBZ43pJT.d.ts} +1 -1
- package/dist/{client-DUFejFfn.d.cts → client-DWml6sjL.d.cts} +1 -1
- package/dist/debug.cjs +957 -1569
- package/dist/debug.d.cts +8 -5
- package/dist/debug.d.ts +8 -5
- package/dist/debug.js +4 -4
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/index.cjs +913 -1528
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +9 -5
- package/dist/index.node.cjs +913 -1528
- package/dist/index.node.d.cts +6 -6
- package/dist/index.node.d.ts +6 -6
- package/dist/index.node.js +8 -4
- package/dist/{logging-IsaT3wjW.d.ts → logging-BUpzk4Z6.d.cts} +5 -5
- package/dist/{logging-Bt2FNHFR.d.cts → logging-Dt2ooQiP.d.ts} +5 -5
- package/dist/native/index.cjs +913 -1528
- package/dist/native/index.d.cts +133 -44
- package/dist/native/index.d.ts +133 -44
- package/dist/native/index.js +912 -1529
- package/dist/proto/spark.cjs +931 -125
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +17 -1
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{spark-CLz4-Ln8.d.cts → spark-DasxuVfm.d.cts} +150 -5
- package/dist/{spark-CLz4-Ln8.d.ts → spark-DasxuVfm.d.ts} +150 -5
- package/dist/{spark-wallet-V03V4Tgm.d.cts → spark-wallet-BoMIOPWW.d.cts} +15 -26
- package/dist/{spark-wallet-KI68-_jO.d.ts → spark-wallet-jlC0XN5f.d.ts} +15 -26
- package/dist/{spark-wallet.node-Cuvw8Kvq.d.ts → spark-wallet.node-07PksUHH.d.cts} +1 -1
- package/dist/{spark-wallet.node-BtkqW5vn.d.cts → spark-wallet.node-CdWkKMSq.d.ts} +1 -1
- package/dist/tests/test-utils.cjs +951 -147
- package/dist/tests/test-utils.d.cts +4 -4
- package/dist/tests/test-utils.d.ts +4 -4
- package/dist/tests/test-utils.js +5 -5
- package/dist/{token-transactions-5XxBewhV.d.ts → token-transactions-BDzCrQSk.d.cts} +5 -19
- package/dist/{token-transactions-fTnCtBpp.d.cts → token-transactions-DscJaJOE.d.ts} +5 -19
- package/dist/types/index.cjs +923 -125
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/package.json +1 -1
- package/src/proto/spark.ts +1167 -103
- package/src/services/config.ts +0 -4
- package/src/services/token-transactions.ts +11 -703
- package/src/services/transfer.ts +2 -213
- package/src/services/wallet-config.ts +0 -2
- package/src/spark-wallet/proto-descriptors.ts +1 -1
- package/src/spark-wallet/spark-wallet.ts +47 -215
- package/src/spark_descriptors.pb +0 -0
- package/src/tests/address.test.ts +141 -0
- package/src/tests/integration/address.test.ts +4 -0
- package/src/tests/integration/lightning.test.ts +14 -9
- package/src/tests/integration/token-output.test.ts +0 -1
- package/src/tests/integration/transfer.test.ts +108 -2
- package/src/tests/token-hashing.test.ts +0 -247
- package/src/utils/address.ts +58 -35
- package/src/utils/token-hashing.ts +1 -420
- package/src/utils/token-transaction-validation.ts +0 -330
- package/src/utils/transaction.ts +8 -8
- package/src/tests/integration/swap.test.ts +0 -780
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Q as QueryTransfersResponse,
|
|
2
|
-
import { b as ConfigOptions,
|
|
3
|
-
import { S as SparkSigner, D as DefaultSparkSigner } from '../client-
|
|
4
|
-
import { S as SparkWalletNodeJS } from '../spark-wallet.node-
|
|
1
|
+
import { Q as QueryTransfersResponse, T as Transfer, b as TreeNode } from '../spark-DasxuVfm.cjs';
|
|
2
|
+
import { b as ConfigOptions, Y as SparkWalletProps } from '../spark-wallet-BoMIOPWW.cjs';
|
|
3
|
+
import { S as SparkSigner, D as DefaultSparkSigner } from '../client-DWml6sjL.cjs';
|
|
4
|
+
import { S as SparkWalletNodeJS } from '../spark-wallet.node-07PksUHH.cjs';
|
|
5
5
|
import { Transaction } from '@scure/btc-signer';
|
|
6
6
|
import { TransactionInput, TransactionOutput } from '@scure/btc-signer/psbt';
|
|
7
7
|
import '@bufbuild/protobuf/wire';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Q as QueryTransfersResponse,
|
|
2
|
-
import { b as ConfigOptions,
|
|
3
|
-
import { S as SparkSigner, D as DefaultSparkSigner } from '../client-
|
|
4
|
-
import { S as SparkWalletNodeJS } from '../spark-wallet.node-
|
|
1
|
+
import { Q as QueryTransfersResponse, T as Transfer, b as TreeNode } from '../spark-DasxuVfm.js';
|
|
2
|
+
import { b as ConfigOptions, Y as SparkWalletProps } from '../spark-wallet-jlC0XN5f.js';
|
|
3
|
+
import { S as SparkSigner, D as DefaultSparkSigner } from '../client-DBZ43pJT.js';
|
|
4
|
+
import { S as SparkWalletNodeJS } from '../spark-wallet.node-CdWkKMSq.js';
|
|
5
5
|
import { Transaction } from '@scure/btc-signer';
|
|
6
6
|
import { TransactionInput, TransactionOutput } from '@scure/btc-signer/psbt';
|
|
7
7
|
import '@bufbuild/protobuf/wire';
|
package/dist/tests/test-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-YH7MDVTT.js";
|
|
2
2
|
import {
|
|
3
3
|
BitcoinFaucet,
|
|
4
4
|
ConnectionManager,
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
WalletConfigService,
|
|
11
11
|
getNetwork,
|
|
12
12
|
getP2TRAddressFromPublicKey
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-KIQTO4FX.js";
|
|
14
14
|
import "../chunk-NX5KPN5F.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-XWLR6G5C.js";
|
|
16
|
+
import "../chunk-J2P3KTQP.js";
|
|
17
|
+
import "../chunk-IC4IUEOS.js";
|
|
18
18
|
import "../chunk-CQY5ML2A.js";
|
|
19
19
|
import "../chunk-MVRQ5US7.js";
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OutputWithPreviousTransactionData
|
|
2
|
-
import { TokenTransaction
|
|
3
|
-
import { W as WalletConfigService, C as ConnectionManager,
|
|
1
|
+
import { O as OutputWithPreviousTransactionData } from './spark-DasxuVfm.cjs';
|
|
2
|
+
import { TokenTransaction, QueryTokenTransactionsResponse } from './proto/spark_token.cjs';
|
|
3
|
+
import { W as WalletConfigService, C as ConnectionManager, Q as TokenOutputsMap, B as Bech32mTokenIdentifier, S as SparkAddressFormat } from './spark-wallet-BoMIOPWW.cjs';
|
|
4
4
|
|
|
5
5
|
declare class SparkSDKError extends Error {
|
|
6
6
|
readonly context: Record<string, unknown>;
|
|
@@ -155,34 +155,20 @@ declare class TokenTransactionService {
|
|
|
155
155
|
outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
|
|
156
156
|
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
157
157
|
}): Promise<string>;
|
|
158
|
-
constructTransferTokenTransactionV0(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
|
|
159
|
-
receiverPublicKey: Uint8Array;
|
|
160
|
-
tokenPublicKey: Uint8Array;
|
|
161
|
-
tokenAmount: bigint;
|
|
162
|
-
}>): Promise<TokenTransaction>;
|
|
163
158
|
constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
|
|
164
159
|
receiverPublicKey: Uint8Array;
|
|
165
160
|
rawTokenIdentifier: Uint8Array;
|
|
166
161
|
tokenAmount: bigint;
|
|
167
|
-
}>, sparkInvoices?: SparkAddressFormat[]): Promise<TokenTransaction
|
|
162
|
+
}>, sparkInvoices?: SparkAddressFormat[]): Promise<TokenTransaction>;
|
|
168
163
|
collectOperatorIdentityPublicKeys(): Uint8Array[];
|
|
169
|
-
broadcastTokenTransaction(tokenTransaction: TokenTransaction
|
|
170
|
-
private broadcastTokenTransactionV0;
|
|
171
|
-
private broadcastTokenTransactionV1;
|
|
172
|
-
private startTokenTransactionV0;
|
|
164
|
+
broadcastTokenTransaction(tokenTransaction: TokenTransaction, outputsToSpendSigningPublicKeys?: Uint8Array[], outputsToSpendCommitments?: Uint8Array[]): Promise<string>;
|
|
173
165
|
private startTokenTransaction;
|
|
174
|
-
private signTokenTransactionV0;
|
|
175
166
|
private signTokenTransaction;
|
|
176
167
|
fetchOwnedTokenOutputs(params: FetchOwnedTokenOutputsParams): Promise<OutputWithPreviousTransactionData[]>;
|
|
177
168
|
queryTokenTransactions(params: QueryTokenTransactionsParams): Promise<QueryTokenTransactionsResponse>;
|
|
178
|
-
private fetchOwnedTokenOutputsV0;
|
|
179
|
-
private fetchOwnedTokenOutputsV1;
|
|
180
|
-
private queryTokenTransactionsV0;
|
|
181
|
-
private queryTokenTransactionsV1;
|
|
182
169
|
selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData[];
|
|
183
170
|
private sortTokenOutputsByStrategy;
|
|
184
171
|
private signMessageWithKey;
|
|
185
|
-
private finalizeTokenTransaction;
|
|
186
172
|
private createSignaturesForOperators;
|
|
187
173
|
}
|
|
188
174
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OutputWithPreviousTransactionData
|
|
2
|
-
import { TokenTransaction
|
|
3
|
-
import { W as WalletConfigService, C as ConnectionManager,
|
|
1
|
+
import { O as OutputWithPreviousTransactionData } from './spark-DasxuVfm.js';
|
|
2
|
+
import { TokenTransaction, QueryTokenTransactionsResponse } from './proto/spark_token.js';
|
|
3
|
+
import { W as WalletConfigService, C as ConnectionManager, Q as TokenOutputsMap, B as Bech32mTokenIdentifier, S as SparkAddressFormat } from './spark-wallet-jlC0XN5f.js';
|
|
4
4
|
|
|
5
5
|
declare class SparkSDKError extends Error {
|
|
6
6
|
readonly context: Record<string, unknown>;
|
|
@@ -155,34 +155,20 @@ declare class TokenTransactionService {
|
|
|
155
155
|
outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
|
|
156
156
|
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
157
157
|
}): Promise<string>;
|
|
158
|
-
constructTransferTokenTransactionV0(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
|
|
159
|
-
receiverPublicKey: Uint8Array;
|
|
160
|
-
tokenPublicKey: Uint8Array;
|
|
161
|
-
tokenAmount: bigint;
|
|
162
|
-
}>): Promise<TokenTransaction>;
|
|
163
158
|
constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
|
|
164
159
|
receiverPublicKey: Uint8Array;
|
|
165
160
|
rawTokenIdentifier: Uint8Array;
|
|
166
161
|
tokenAmount: bigint;
|
|
167
|
-
}>, sparkInvoices?: SparkAddressFormat[]): Promise<TokenTransaction
|
|
162
|
+
}>, sparkInvoices?: SparkAddressFormat[]): Promise<TokenTransaction>;
|
|
168
163
|
collectOperatorIdentityPublicKeys(): Uint8Array[];
|
|
169
|
-
broadcastTokenTransaction(tokenTransaction: TokenTransaction
|
|
170
|
-
private broadcastTokenTransactionV0;
|
|
171
|
-
private broadcastTokenTransactionV1;
|
|
172
|
-
private startTokenTransactionV0;
|
|
164
|
+
broadcastTokenTransaction(tokenTransaction: TokenTransaction, outputsToSpendSigningPublicKeys?: Uint8Array[], outputsToSpendCommitments?: Uint8Array[]): Promise<string>;
|
|
173
165
|
private startTokenTransaction;
|
|
174
|
-
private signTokenTransactionV0;
|
|
175
166
|
private signTokenTransaction;
|
|
176
167
|
fetchOwnedTokenOutputs(params: FetchOwnedTokenOutputsParams): Promise<OutputWithPreviousTransactionData[]>;
|
|
177
168
|
queryTokenTransactions(params: QueryTokenTransactionsParams): Promise<QueryTokenTransactionsResponse>;
|
|
178
|
-
private fetchOwnedTokenOutputsV0;
|
|
179
|
-
private fetchOwnedTokenOutputsV1;
|
|
180
|
-
private queryTokenTransactionsV0;
|
|
181
|
-
private queryTokenTransactionsV1;
|
|
182
169
|
selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData[];
|
|
183
170
|
private sortTokenOutputsByStrategy;
|
|
184
171
|
private signMessageWithKey;
|
|
185
|
-
private finalizeTokenTransaction;
|
|
186
172
|
private createSignaturesForOperators;
|
|
187
173
|
}
|
|
188
174
|
|