@buildonspark/spark-sdk 0.2.1 → 0.2.3
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 +13 -0
- package/dist/{chunk-TM6CHQXC.js → chunk-3SEOTO43.js} +1 -1
- package/dist/{chunk-2ENZX6LT.js → chunk-AAZWSPUK.js} +84 -8
- package/dist/{chunk-4JD4HIAN.js → chunk-G4MSZ6DE.js} +299 -1
- package/dist/{chunk-KFDVDUIS.js → chunk-PLLJIZC3.js} +138 -35
- package/dist/{chunk-N4JAOOIN.js → chunk-PTRXJS7Q.js} +1 -1
- package/dist/{client-DKbwpcnl.d.ts → client-CGTRS23n.d.ts} +21 -4
- package/dist/{client-Drs5Lapg.d.cts → client-CcYzmpmj.d.cts} +21 -4
- package/dist/debug.cjs +455 -40
- package/dist/debug.d.cts +5 -5
- package/dist/debug.d.ts +5 -5
- package/dist/debug.js +4 -4
- package/dist/graphql/objects/index.d.cts +2 -2
- package/dist/graphql/objects/index.d.ts +2 -2
- package/dist/index.cjs +515 -40
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -5
- package/dist/index.node.cjs +517 -44
- package/dist/index.node.d.cts +8 -6
- package/dist/index.node.d.ts +8 -6
- package/dist/index.node.js +6 -4
- package/dist/native/index.cjs +459 -43
- package/dist/native/index.d.cts +62 -15
- package/dist/native/index.d.ts +62 -15
- package/dist/native/index.js +459 -43
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +1 -1
- package/dist/proto/spark.cjs +84 -8
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +1 -1
- package/dist/proto/spark_token.cjs +301 -0
- package/dist/proto/spark_token.d.cts +35 -2
- package/dist/proto/spark_token.d.ts +35 -2
- package/dist/proto/spark_token.js +8 -2
- package/dist/{sdk-types-DJ2ve9YY.d.cts → sdk-types-CB9HrW5O.d.cts} +1 -1
- package/dist/{sdk-types-DCIVdKUT.d.ts → sdk-types-CkRNraXT.d.ts} +1 -1
- package/dist/{spark-BUOx3U7Q.d.cts → spark-B_7nZx6T.d.cts} +112 -10
- package/dist/{spark-BUOx3U7Q.d.ts → spark-B_7nZx6T.d.ts} +112 -10
- package/dist/{spark-wallet-DbCjWOfP.d.ts → spark-wallet-CxcGPXRB.d.ts} +10 -6
- package/dist/{spark-wallet-BslnB-4H.d.cts → spark-wallet-DJJm19BP.d.cts} +10 -6
- package/dist/tests/test-utils.cjs +455 -17
- package/dist/tests/test-utils.d.cts +9 -5
- package/dist/tests/test-utils.d.ts +9 -5
- package/dist/tests/test-utils.js +13 -6
- package/dist/types/index.cjs +84 -8
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +2 -2
- package/dist/{xchain-address-BIcYZU3K.d.ts → xchain-address-Bh9w1SeC.d.ts} +3 -3
- package/dist/{xchain-address-C3B-Jfk5.d.cts → xchain-address-SZ7dkVUE.d.cts} +3 -3
- package/package.json +1 -1
- package/src/index.node.ts +6 -6
- package/src/index.ts +5 -5
- package/src/proto/spark.ts +172 -16
- package/src/proto/spark_token.ts +369 -0
- package/src/services/connection.ts +3 -3
- package/src/services/coop-exit.ts +1 -1
- package/src/services/deposit.ts +2 -2
- package/src/services/signing.ts +1 -1
- package/src/services/token-transactions.ts +6 -2
- package/src/services/transfer.ts +25 -9
- package/src/services/tree-creation.ts +10 -7
- package/src/signer/signer.react-native.ts +4 -3
- package/src/signer/signer.ts +84 -6
- package/src/signer/types.ts +7 -1
- package/src/spark-wallet/spark-wallet.ts +56 -15
- package/src/tests/integration/coop-exit.test.ts +5 -3
- package/src/tests/integration/deposit.test.ts +20 -10
- package/src/tests/integration/lightning.test.ts +13 -7
- package/src/tests/integration/message-signing.test.ts +10 -7
- package/src/tests/integration/swap.test.ts +8 -4
- package/src/tests/integration/transfer.test.ts +25 -11
- package/src/tests/integration/wallet.test.ts +9 -4
- package/src/tests/test-utils.ts +10 -1
package/dist/native/index.d.cts
CHANGED
|
@@ -694,7 +694,7 @@ interface FinalizeTokenTransactionRequest {
|
|
|
694
694
|
sparkPaymentIntent: string;
|
|
695
695
|
}
|
|
696
696
|
declare const FinalizeTokenTransactionRequest: MessageFns$2<FinalizeTokenTransactionRequest>;
|
|
697
|
-
interface FreezeTokensPayload {
|
|
697
|
+
interface FreezeTokensPayload$1 {
|
|
698
698
|
ownerPublicKey: Uint8Array;
|
|
699
699
|
tokenPublicKey: Uint8Array;
|
|
700
700
|
issuerProvidedTimestamp: number;
|
|
@@ -703,19 +703,19 @@ interface FreezeTokensPayload {
|
|
|
703
703
|
shouldUnfreeze: boolean;
|
|
704
704
|
tokenIdentifier?: Uint8Array | undefined;
|
|
705
705
|
}
|
|
706
|
-
declare const FreezeTokensPayload: MessageFns$2<FreezeTokensPayload>;
|
|
707
|
-
interface FreezeTokensRequest {
|
|
708
|
-
freezeTokensPayload: FreezeTokensPayload | undefined;
|
|
706
|
+
declare const FreezeTokensPayload$1: MessageFns$2<FreezeTokensPayload$1>;
|
|
707
|
+
interface FreezeTokensRequest$1 {
|
|
708
|
+
freezeTokensPayload: FreezeTokensPayload$1 | undefined;
|
|
709
709
|
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
710
710
|
issuerSignature: Uint8Array;
|
|
711
711
|
}
|
|
712
|
-
declare const FreezeTokensRequest: MessageFns$2<FreezeTokensRequest>;
|
|
713
|
-
interface FreezeTokensResponse {
|
|
712
|
+
declare const FreezeTokensRequest$1: MessageFns$2<FreezeTokensRequest$1>;
|
|
713
|
+
interface FreezeTokensResponse$1 {
|
|
714
714
|
impactedOutputIds: string[];
|
|
715
715
|
/** Decoded uint128 */
|
|
716
716
|
impactedTokenAmount: Uint8Array;
|
|
717
717
|
}
|
|
718
|
-
declare const FreezeTokensResponse: MessageFns$2<FreezeTokensResponse>;
|
|
718
|
+
declare const FreezeTokensResponse$1: MessageFns$2<FreezeTokensResponse$1>;
|
|
719
719
|
interface QueryTokenOutputsRequest$1 {
|
|
720
720
|
ownerPublicKeys: Uint8Array[];
|
|
721
721
|
/** Optionally provide token public keys. If not set return leaves for all tokens. */
|
|
@@ -1486,7 +1486,6 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1486
1486
|
extend_leaf(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
|
|
1487
1487
|
prepare_tree_address(request: DeepPartial$2<PrepareTreeAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<PrepareTreeAddressResponse>;
|
|
1488
1488
|
create_tree(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1489
|
-
create_tree_v2(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1490
1489
|
get_signing_operator_list(request: DeepPartial$2<Empty>, options?: CallOptions & CallOptionsExt): Promise<GetSigningOperatorListResponse>;
|
|
1491
1490
|
query_nodes(request: DeepPartial$2<QueryNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesResponse>;
|
|
1492
1491
|
query_nodes_distribution(request: DeepPartial$2<QueryNodesDistributionRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesDistributionResponse>;
|
|
@@ -1497,7 +1496,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1497
1496
|
start_token_transaction(request: DeepPartial$2<StartTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTokenTransactionResponse>;
|
|
1498
1497
|
sign_token_transaction(request: DeepPartial$2<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
|
|
1499
1498
|
finalize_token_transaction(request: DeepPartial$2<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1500
|
-
freeze_tokens(request: DeepPartial$2<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
|
|
1499
|
+
freeze_tokens(request: DeepPartial$2<FreezeTokensRequest$1>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse$1>;
|
|
1501
1500
|
query_token_outputs(request: DeepPartial$2<QueryTokenOutputsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse$1>;
|
|
1502
1501
|
query_token_transactions(request: DeepPartial$2<QueryTokenTransactionsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse$1>;
|
|
1503
1502
|
return_lightning_payment(request: DeepPartial$2<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
@@ -1521,6 +1520,20 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1521
1520
|
*/
|
|
1522
1521
|
initiate_utxo_swap(request: DeepPartial$2<InitiateUtxoSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateUtxoSwapResponse>;
|
|
1523
1522
|
exit_single_node_trees(request: DeepPartial$2<ExitSingleNodeTreesRequest>, options?: CallOptions & CallOptionsExt): Promise<ExitSingleNodeTreesResponse>;
|
|
1523
|
+
/**
|
|
1524
|
+
* The following endpoints enforce inclusion of Direct Transactions used
|
|
1525
|
+
* for unilateral exits
|
|
1526
|
+
*/
|
|
1527
|
+
create_tree_v2(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1528
|
+
cooperative_exit_v2(request: DeepPartial$2<CooperativeExitRequest>, options?: CallOptions & CallOptionsExt): Promise<CooperativeExitResponse>;
|
|
1529
|
+
extend_leaf_v2(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
|
|
1530
|
+
claim_transfer_sign_refunds_v2(request: DeepPartial$2<ClaimTransferSignRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<ClaimTransferSignRefundsResponse>;
|
|
1531
|
+
finalize_node_signatures_v2(request: DeepPartial$2<FinalizeNodeSignaturesRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeNodeSignaturesResponse>;
|
|
1532
|
+
initiate_preimage_swap_v2(request: DeepPartial$2<InitiatePreimageSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiatePreimageSwapResponse>;
|
|
1533
|
+
start_leaf_swap_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
1534
|
+
counter_leaf_swap_v2(request: DeepPartial$2<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
|
|
1535
|
+
start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
1536
|
+
refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
|
|
1524
1537
|
}
|
|
1525
1538
|
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1526
1539
|
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
|
|
@@ -1685,6 +1698,10 @@ interface ISigningCommitment {
|
|
|
1685
1698
|
binding: Uint8Array;
|
|
1686
1699
|
}
|
|
1687
1700
|
|
|
1701
|
+
type SigningCommitmentWithOptionalNonce = {
|
|
1702
|
+
commitment: SigningCommitment;
|
|
1703
|
+
nonce?: SigningNonce;
|
|
1704
|
+
};
|
|
1688
1705
|
type SigningNonce = {
|
|
1689
1706
|
binding: Uint8Array;
|
|
1690
1707
|
hiding: Uint8Array;
|
|
@@ -1719,7 +1736,7 @@ type SignFrostParams = {
|
|
|
1719
1736
|
keyDerivation: KeyDerivation;
|
|
1720
1737
|
publicKey: Uint8Array;
|
|
1721
1738
|
verifyingKey: Uint8Array;
|
|
1722
|
-
selfCommitment:
|
|
1739
|
+
selfCommitment: SigningCommitmentWithOptionalNonce;
|
|
1723
1740
|
statechainCommitments?: {
|
|
1724
1741
|
[key: string]: ISigningCommitment;
|
|
1725
1742
|
} | undefined;
|
|
@@ -2000,6 +2017,29 @@ interface TokenTransactionWithStatus {
|
|
|
2000
2017
|
tokenTransactionHash: Uint8Array;
|
|
2001
2018
|
}
|
|
2002
2019
|
declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
|
|
2020
|
+
interface FreezeTokensPayload {
|
|
2021
|
+
version: number;
|
|
2022
|
+
ownerPublicKey: Uint8Array;
|
|
2023
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
2024
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2025
|
+
issuerProvidedTimestamp: number;
|
|
2026
|
+
operatorIdentityPublicKey: Uint8Array;
|
|
2027
|
+
/** Set to false when requesting a freeze. */
|
|
2028
|
+
shouldUnfreeze: boolean;
|
|
2029
|
+
}
|
|
2030
|
+
declare const FreezeTokensPayload: MessageFns$1<FreezeTokensPayload>;
|
|
2031
|
+
interface FreezeTokensRequest {
|
|
2032
|
+
freezeTokensPayload: FreezeTokensPayload | undefined;
|
|
2033
|
+
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
2034
|
+
issuerSignature: Uint8Array;
|
|
2035
|
+
}
|
|
2036
|
+
declare const FreezeTokensRequest: MessageFns$1<FreezeTokensRequest>;
|
|
2037
|
+
interface FreezeTokensResponse {
|
|
2038
|
+
impactedOutputIds: string[];
|
|
2039
|
+
/** Decoded uint128 */
|
|
2040
|
+
impactedTokenAmount: Uint8Array;
|
|
2041
|
+
}
|
|
2042
|
+
declare const FreezeTokensResponse: MessageFns$1<FreezeTokensResponse>;
|
|
2003
2043
|
interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
2004
2044
|
/**
|
|
2005
2045
|
* Start process to create final token transaction with all inputs required
|
|
@@ -2014,6 +2054,7 @@ interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
|
2014
2054
|
query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
|
|
2015
2055
|
query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
|
|
2016
2056
|
query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
|
|
2057
|
+
freeze_tokens(request: DeepPartial$1<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
|
|
2017
2058
|
}
|
|
2018
2059
|
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2019
2060
|
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
|
|
@@ -2072,7 +2113,7 @@ interface SparkSigner extends TokenSigner {
|
|
|
2072
2113
|
validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
2073
2114
|
signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
|
|
2074
2115
|
decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
2075
|
-
getRandomSigningCommitment(): Promise<
|
|
2116
|
+
getRandomSigningCommitment(): Promise<SigningCommitmentWithOptionalNonce>;
|
|
2076
2117
|
getDepositSigningKey(): Promise<Uint8Array>;
|
|
2077
2118
|
}
|
|
2078
2119
|
declare class DefaultSparkSigner implements SparkSigner {
|
|
@@ -2115,7 +2156,7 @@ declare class DefaultSparkSigner implements SparkSigner {
|
|
|
2115
2156
|
createSparkWalletFromSeed(seed: Uint8Array | string, accountNumber?: number): Promise<string>;
|
|
2116
2157
|
signMessageWithIdentityKey(message: Uint8Array, compact?: boolean): Promise<Uint8Array>;
|
|
2117
2158
|
decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
2118
|
-
getRandomSigningCommitment(): Promise<
|
|
2159
|
+
getRandomSigningCommitment(): Promise<SigningCommitmentWithOptionalNonce>;
|
|
2119
2160
|
validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
2120
2161
|
signPsbt(psbt: Psbt, input: number, sighashTypes?: number[], receipt?: Receipt): Promise<Psbt>;
|
|
2121
2162
|
private getReceiptPrivateKey;
|
|
@@ -2998,7 +3039,7 @@ type ClaimLeafData = {
|
|
|
2998
3039
|
keyDerivation: KeyDerivation;
|
|
2999
3040
|
tx?: Transaction;
|
|
3000
3041
|
refundTx?: Transaction;
|
|
3001
|
-
signingNonceCommitment:
|
|
3042
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3002
3043
|
vout?: number;
|
|
3003
3044
|
};
|
|
3004
3045
|
type LeafRefundSigningData = {
|
|
@@ -3006,7 +3047,7 @@ type LeafRefundSigningData = {
|
|
|
3006
3047
|
receivingPubkey: Uint8Array;
|
|
3007
3048
|
tx: Transaction;
|
|
3008
3049
|
refundTx?: Transaction;
|
|
3009
|
-
signingNonceCommitment:
|
|
3050
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3010
3051
|
vout: number;
|
|
3011
3052
|
};
|
|
3012
3053
|
declare class BaseTransferService {
|
|
@@ -3150,6 +3191,8 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3150
3191
|
private handleStreamEvent;
|
|
3151
3192
|
protected setupBackgroundStream(): Promise<void>;
|
|
3152
3193
|
getLeaves(isBalanceCheck?: boolean): Promise<TreeNode[]>;
|
|
3194
|
+
private checkExtendLeaves;
|
|
3195
|
+
private verifyKey;
|
|
3153
3196
|
private selectLeaves;
|
|
3154
3197
|
private selectLeavesForSwap;
|
|
3155
3198
|
private areLeavesInefficient;
|
|
@@ -3556,12 +3599,14 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3556
3599
|
* @param outputIds - Optional array of output IDs to filter by
|
|
3557
3600
|
* @returns Promise resolving to array of token transactions with their current status
|
|
3558
3601
|
*/
|
|
3559
|
-
queryTokenTransactions({ ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, outputIds, }: {
|
|
3602
|
+
queryTokenTransactions({ ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, outputIds, pageSize, offset, }: {
|
|
3560
3603
|
ownerPublicKeys?: string[];
|
|
3561
3604
|
issuerPublicKeys?: string[];
|
|
3562
3605
|
tokenTransactionHashes?: string[];
|
|
3563
3606
|
tokenIdentifiers?: string[];
|
|
3564
3607
|
outputIds?: string[];
|
|
3608
|
+
pageSize?: number;
|
|
3609
|
+
offset?: number;
|
|
3565
3610
|
}): Promise<TokenTransactionWithStatus[]>;
|
|
3566
3611
|
getTokenL1Address(): Promise<string>;
|
|
3567
3612
|
/**
|
|
@@ -3655,6 +3700,8 @@ interface QueryTokenTransactionsParams {
|
|
|
3655
3700
|
tokenTransactionHashes?: string[];
|
|
3656
3701
|
tokenIdentifiers?: string[];
|
|
3657
3702
|
outputIds?: string[];
|
|
3703
|
+
pageSize: number;
|
|
3704
|
+
offset: number;
|
|
3658
3705
|
}
|
|
3659
3706
|
declare class TokenTransactionService {
|
|
3660
3707
|
protected readonly config: WalletConfigService;
|
package/dist/native/index.d.ts
CHANGED
|
@@ -694,7 +694,7 @@ interface FinalizeTokenTransactionRequest {
|
|
|
694
694
|
sparkPaymentIntent: string;
|
|
695
695
|
}
|
|
696
696
|
declare const FinalizeTokenTransactionRequest: MessageFns$2<FinalizeTokenTransactionRequest>;
|
|
697
|
-
interface FreezeTokensPayload {
|
|
697
|
+
interface FreezeTokensPayload$1 {
|
|
698
698
|
ownerPublicKey: Uint8Array;
|
|
699
699
|
tokenPublicKey: Uint8Array;
|
|
700
700
|
issuerProvidedTimestamp: number;
|
|
@@ -703,19 +703,19 @@ interface FreezeTokensPayload {
|
|
|
703
703
|
shouldUnfreeze: boolean;
|
|
704
704
|
tokenIdentifier?: Uint8Array | undefined;
|
|
705
705
|
}
|
|
706
|
-
declare const FreezeTokensPayload: MessageFns$2<FreezeTokensPayload>;
|
|
707
|
-
interface FreezeTokensRequest {
|
|
708
|
-
freezeTokensPayload: FreezeTokensPayload | undefined;
|
|
706
|
+
declare const FreezeTokensPayload$1: MessageFns$2<FreezeTokensPayload$1>;
|
|
707
|
+
interface FreezeTokensRequest$1 {
|
|
708
|
+
freezeTokensPayload: FreezeTokensPayload$1 | undefined;
|
|
709
709
|
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
710
710
|
issuerSignature: Uint8Array;
|
|
711
711
|
}
|
|
712
|
-
declare const FreezeTokensRequest: MessageFns$2<FreezeTokensRequest>;
|
|
713
|
-
interface FreezeTokensResponse {
|
|
712
|
+
declare const FreezeTokensRequest$1: MessageFns$2<FreezeTokensRequest$1>;
|
|
713
|
+
interface FreezeTokensResponse$1 {
|
|
714
714
|
impactedOutputIds: string[];
|
|
715
715
|
/** Decoded uint128 */
|
|
716
716
|
impactedTokenAmount: Uint8Array;
|
|
717
717
|
}
|
|
718
|
-
declare const FreezeTokensResponse: MessageFns$2<FreezeTokensResponse>;
|
|
718
|
+
declare const FreezeTokensResponse$1: MessageFns$2<FreezeTokensResponse$1>;
|
|
719
719
|
interface QueryTokenOutputsRequest$1 {
|
|
720
720
|
ownerPublicKeys: Uint8Array[];
|
|
721
721
|
/** Optionally provide token public keys. If not set return leaves for all tokens. */
|
|
@@ -1486,7 +1486,6 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1486
1486
|
extend_leaf(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
|
|
1487
1487
|
prepare_tree_address(request: DeepPartial$2<PrepareTreeAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<PrepareTreeAddressResponse>;
|
|
1488
1488
|
create_tree(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1489
|
-
create_tree_v2(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1490
1489
|
get_signing_operator_list(request: DeepPartial$2<Empty>, options?: CallOptions & CallOptionsExt): Promise<GetSigningOperatorListResponse>;
|
|
1491
1490
|
query_nodes(request: DeepPartial$2<QueryNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesResponse>;
|
|
1492
1491
|
query_nodes_distribution(request: DeepPartial$2<QueryNodesDistributionRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesDistributionResponse>;
|
|
@@ -1497,7 +1496,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1497
1496
|
start_token_transaction(request: DeepPartial$2<StartTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTokenTransactionResponse>;
|
|
1498
1497
|
sign_token_transaction(request: DeepPartial$2<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
|
|
1499
1498
|
finalize_token_transaction(request: DeepPartial$2<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
1500
|
-
freeze_tokens(request: DeepPartial$2<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
|
|
1499
|
+
freeze_tokens(request: DeepPartial$2<FreezeTokensRequest$1>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse$1>;
|
|
1501
1500
|
query_token_outputs(request: DeepPartial$2<QueryTokenOutputsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse$1>;
|
|
1502
1501
|
query_token_transactions(request: DeepPartial$2<QueryTokenTransactionsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse$1>;
|
|
1503
1502
|
return_lightning_payment(request: DeepPartial$2<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
@@ -1521,6 +1520,20 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
1521
1520
|
*/
|
|
1522
1521
|
initiate_utxo_swap(request: DeepPartial$2<InitiateUtxoSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateUtxoSwapResponse>;
|
|
1523
1522
|
exit_single_node_trees(request: DeepPartial$2<ExitSingleNodeTreesRequest>, options?: CallOptions & CallOptionsExt): Promise<ExitSingleNodeTreesResponse>;
|
|
1523
|
+
/**
|
|
1524
|
+
* The following endpoints enforce inclusion of Direct Transactions used
|
|
1525
|
+
* for unilateral exits
|
|
1526
|
+
*/
|
|
1527
|
+
create_tree_v2(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
|
|
1528
|
+
cooperative_exit_v2(request: DeepPartial$2<CooperativeExitRequest>, options?: CallOptions & CallOptionsExt): Promise<CooperativeExitResponse>;
|
|
1529
|
+
extend_leaf_v2(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
|
|
1530
|
+
claim_transfer_sign_refunds_v2(request: DeepPartial$2<ClaimTransferSignRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<ClaimTransferSignRefundsResponse>;
|
|
1531
|
+
finalize_node_signatures_v2(request: DeepPartial$2<FinalizeNodeSignaturesRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeNodeSignaturesResponse>;
|
|
1532
|
+
initiate_preimage_swap_v2(request: DeepPartial$2<InitiatePreimageSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiatePreimageSwapResponse>;
|
|
1533
|
+
start_leaf_swap_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
1534
|
+
counter_leaf_swap_v2(request: DeepPartial$2<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
|
|
1535
|
+
start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
1536
|
+
refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
|
|
1524
1537
|
}
|
|
1525
1538
|
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1526
1539
|
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
|
|
@@ -1685,6 +1698,10 @@ interface ISigningCommitment {
|
|
|
1685
1698
|
binding: Uint8Array;
|
|
1686
1699
|
}
|
|
1687
1700
|
|
|
1701
|
+
type SigningCommitmentWithOptionalNonce = {
|
|
1702
|
+
commitment: SigningCommitment;
|
|
1703
|
+
nonce?: SigningNonce;
|
|
1704
|
+
};
|
|
1688
1705
|
type SigningNonce = {
|
|
1689
1706
|
binding: Uint8Array;
|
|
1690
1707
|
hiding: Uint8Array;
|
|
@@ -1719,7 +1736,7 @@ type SignFrostParams = {
|
|
|
1719
1736
|
keyDerivation: KeyDerivation;
|
|
1720
1737
|
publicKey: Uint8Array;
|
|
1721
1738
|
verifyingKey: Uint8Array;
|
|
1722
|
-
selfCommitment:
|
|
1739
|
+
selfCommitment: SigningCommitmentWithOptionalNonce;
|
|
1723
1740
|
statechainCommitments?: {
|
|
1724
1741
|
[key: string]: ISigningCommitment;
|
|
1725
1742
|
} | undefined;
|
|
@@ -2000,6 +2017,29 @@ interface TokenTransactionWithStatus {
|
|
|
2000
2017
|
tokenTransactionHash: Uint8Array;
|
|
2001
2018
|
}
|
|
2002
2019
|
declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
|
|
2020
|
+
interface FreezeTokensPayload {
|
|
2021
|
+
version: number;
|
|
2022
|
+
ownerPublicKey: Uint8Array;
|
|
2023
|
+
tokenPublicKey?: Uint8Array | undefined;
|
|
2024
|
+
tokenIdentifier?: Uint8Array | undefined;
|
|
2025
|
+
issuerProvidedTimestamp: number;
|
|
2026
|
+
operatorIdentityPublicKey: Uint8Array;
|
|
2027
|
+
/** Set to false when requesting a freeze. */
|
|
2028
|
+
shouldUnfreeze: boolean;
|
|
2029
|
+
}
|
|
2030
|
+
declare const FreezeTokensPayload: MessageFns$1<FreezeTokensPayload>;
|
|
2031
|
+
interface FreezeTokensRequest {
|
|
2032
|
+
freezeTokensPayload: FreezeTokensPayload | undefined;
|
|
2033
|
+
/** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
|
|
2034
|
+
issuerSignature: Uint8Array;
|
|
2035
|
+
}
|
|
2036
|
+
declare const FreezeTokensRequest: MessageFns$1<FreezeTokensRequest>;
|
|
2037
|
+
interface FreezeTokensResponse {
|
|
2038
|
+
impactedOutputIds: string[];
|
|
2039
|
+
/** Decoded uint128 */
|
|
2040
|
+
impactedTokenAmount: Uint8Array;
|
|
2041
|
+
}
|
|
2042
|
+
declare const FreezeTokensResponse: MessageFns$1<FreezeTokensResponse>;
|
|
2003
2043
|
interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
2004
2044
|
/**
|
|
2005
2045
|
* Start process to create final token transaction with all inputs required
|
|
@@ -2014,6 +2054,7 @@ interface SparkTokenServiceClient<CallOptionsExt = {}> {
|
|
|
2014
2054
|
query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
|
|
2015
2055
|
query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
|
|
2016
2056
|
query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
|
|
2057
|
+
freeze_tokens(request: DeepPartial$1<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
|
|
2017
2058
|
}
|
|
2018
2059
|
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2019
2060
|
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
|
|
@@ -2072,7 +2113,7 @@ interface SparkSigner extends TokenSigner {
|
|
|
2072
2113
|
validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
2073
2114
|
signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
|
|
2074
2115
|
decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
2075
|
-
getRandomSigningCommitment(): Promise<
|
|
2116
|
+
getRandomSigningCommitment(): Promise<SigningCommitmentWithOptionalNonce>;
|
|
2076
2117
|
getDepositSigningKey(): Promise<Uint8Array>;
|
|
2077
2118
|
}
|
|
2078
2119
|
declare class DefaultSparkSigner implements SparkSigner {
|
|
@@ -2115,7 +2156,7 @@ declare class DefaultSparkSigner implements SparkSigner {
|
|
|
2115
2156
|
createSparkWalletFromSeed(seed: Uint8Array | string, accountNumber?: number): Promise<string>;
|
|
2116
2157
|
signMessageWithIdentityKey(message: Uint8Array, compact?: boolean): Promise<Uint8Array>;
|
|
2117
2158
|
decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
2118
|
-
getRandomSigningCommitment(): Promise<
|
|
2159
|
+
getRandomSigningCommitment(): Promise<SigningCommitmentWithOptionalNonce>;
|
|
2119
2160
|
validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
2120
2161
|
signPsbt(psbt: Psbt, input: number, sighashTypes?: number[], receipt?: Receipt): Promise<Psbt>;
|
|
2121
2162
|
private getReceiptPrivateKey;
|
|
@@ -2998,7 +3039,7 @@ type ClaimLeafData = {
|
|
|
2998
3039
|
keyDerivation: KeyDerivation;
|
|
2999
3040
|
tx?: Transaction;
|
|
3000
3041
|
refundTx?: Transaction;
|
|
3001
|
-
signingNonceCommitment:
|
|
3042
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3002
3043
|
vout?: number;
|
|
3003
3044
|
};
|
|
3004
3045
|
type LeafRefundSigningData = {
|
|
@@ -3006,7 +3047,7 @@ type LeafRefundSigningData = {
|
|
|
3006
3047
|
receivingPubkey: Uint8Array;
|
|
3007
3048
|
tx: Transaction;
|
|
3008
3049
|
refundTx?: Transaction;
|
|
3009
|
-
signingNonceCommitment:
|
|
3050
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3010
3051
|
vout: number;
|
|
3011
3052
|
};
|
|
3012
3053
|
declare class BaseTransferService {
|
|
@@ -3150,6 +3191,8 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3150
3191
|
private handleStreamEvent;
|
|
3151
3192
|
protected setupBackgroundStream(): Promise<void>;
|
|
3152
3193
|
getLeaves(isBalanceCheck?: boolean): Promise<TreeNode[]>;
|
|
3194
|
+
private checkExtendLeaves;
|
|
3195
|
+
private verifyKey;
|
|
3153
3196
|
private selectLeaves;
|
|
3154
3197
|
private selectLeavesForSwap;
|
|
3155
3198
|
private areLeavesInefficient;
|
|
@@ -3556,12 +3599,14 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3556
3599
|
* @param outputIds - Optional array of output IDs to filter by
|
|
3557
3600
|
* @returns Promise resolving to array of token transactions with their current status
|
|
3558
3601
|
*/
|
|
3559
|
-
queryTokenTransactions({ ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, outputIds, }: {
|
|
3602
|
+
queryTokenTransactions({ ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, outputIds, pageSize, offset, }: {
|
|
3560
3603
|
ownerPublicKeys?: string[];
|
|
3561
3604
|
issuerPublicKeys?: string[];
|
|
3562
3605
|
tokenTransactionHashes?: string[];
|
|
3563
3606
|
tokenIdentifiers?: string[];
|
|
3564
3607
|
outputIds?: string[];
|
|
3608
|
+
pageSize?: number;
|
|
3609
|
+
offset?: number;
|
|
3565
3610
|
}): Promise<TokenTransactionWithStatus[]>;
|
|
3566
3611
|
getTokenL1Address(): Promise<string>;
|
|
3567
3612
|
/**
|
|
@@ -3655,6 +3700,8 @@ interface QueryTokenTransactionsParams {
|
|
|
3655
3700
|
tokenTransactionHashes?: string[];
|
|
3656
3701
|
tokenIdentifiers?: string[];
|
|
3657
3702
|
outputIds?: string[];
|
|
3703
|
+
pageSize: number;
|
|
3704
|
+
offset: number;
|
|
3658
3705
|
}
|
|
3659
3706
|
declare class TokenTransactionService {
|
|
3660
3707
|
protected readonly config: WalletConfigService;
|