@buildonspark/spark-sdk 0.2.3 → 0.2.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 +8 -0
- package/dist/{chunk-PTRXJS7Q.js → chunk-TVUMSHWA.js} +1 -1
- package/dist/{chunk-PLLJIZC3.js → chunk-W4ZRBSWM.js} +2298 -778
- package/dist/{chunk-CDLETEDT.js → chunk-WAQKYSDI.js} +13 -1
- package/dist/{client-CGTRS23n.d.ts → client-BF4cn8F4.d.ts} +15 -3
- package/dist/{client-CcYzmpmj.d.cts → client-KhNkrXz4.d.cts} +15 -3
- package/dist/debug.cjs +2282 -762
- package/dist/debug.d.cts +17 -4
- package/dist/debug.d.ts +17 -4
- package/dist/debug.js +2 -2
- package/dist/graphql/objects/index.cjs +13 -1
- package/dist/graphql/objects/index.d.cts +2 -2
- package/dist/graphql/objects/index.d.ts +2 -2
- package/dist/graphql/objects/index.js +1 -1
- package/dist/index.cjs +2283 -752
- package/dist/index.d.cts +189 -8
- package/dist/index.d.ts +189 -8
- package/dist/index.js +29 -3
- package/dist/index.node.cjs +2387 -753
- package/dist/index.node.d.cts +9 -189
- package/dist/index.node.d.ts +9 -189
- package/dist/index.node.js +131 -3
- package/dist/native/index.cjs +2283 -752
- package/dist/native/index.d.cts +95 -30
- package/dist/native/index.d.ts +95 -30
- package/dist/native/index.js +2284 -767
- package/dist/{spark-wallet-CxcGPXRB.d.ts → spark-wallet-C1Tr_VKI.d.ts} +31 -25
- package/dist/{spark-wallet-DJJm19BP.d.cts → spark-wallet-DG3x2obf.d.cts} +31 -25
- package/dist/spark-wallet.node-CGxoeCpH.d.ts +13 -0
- package/dist/spark-wallet.node-CN9LoB_O.d.cts +13 -0
- package/dist/tests/test-utils.cjs +570 -73
- package/dist/tests/test-utils.d.cts +11 -11
- package/dist/tests/test-utils.d.ts +11 -11
- package/dist/tests/test-utils.js +53 -16
- package/dist/types/index.cjs +13 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/{xchain-address-Bh9w1SeC.d.ts → xchain-address-BHu6CpZC.d.ts} +54 -7
- package/dist/{xchain-address-SZ7dkVUE.d.cts → xchain-address-HBr6isnc.d.cts} +54 -7
- package/package.json +1 -1
- package/src/graphql/client.ts +8 -0
- package/src/graphql/mutations/CompleteLeavesSwap.ts +9 -1
- package/src/graphql/mutations/RequestSwapLeaves.ts +4 -0
- package/src/graphql/objects/CompleteLeavesSwapInput.ts +34 -34
- package/src/graphql/objects/LeavesSwapRequest.ts +4 -0
- package/src/graphql/objects/RequestLeavesSwapInput.ts +48 -47
- package/src/graphql/objects/SwapLeaf.ts +40 -32
- package/src/graphql/objects/UserLeafInput.ts +24 -0
- package/src/graphql/objects/UserRequest.ts +4 -0
- package/src/index.node.ts +1 -1
- package/src/native/index.ts +4 -5
- package/src/services/coop-exit.ts +171 -36
- package/src/services/deposit.ts +471 -74
- package/src/services/lightning.ts +18 -5
- package/src/services/signing.ts +162 -50
- package/src/services/transfer.ts +950 -384
- package/src/services/tree-creation.ts +342 -121
- package/src/spark-wallet/spark-wallet.node.ts +71 -66
- package/src/spark-wallet/spark-wallet.ts +405 -153
- package/src/tests/integration/coop-exit.test.ts +3 -8
- package/src/tests/integration/deposit.test.ts +3 -3
- package/src/tests/integration/lightning.test.ts +521 -466
- package/src/tests/integration/swap.test.ts +559 -307
- package/src/tests/integration/transfer.test.ts +625 -623
- package/src/tests/integration/wallet.test.ts +2 -2
- package/src/tests/integration/watchtower.test.ts +211 -0
- package/src/tests/test-utils.ts +63 -14
- package/src/tests/utils/test-faucet.ts +4 -2
- package/src/utils/adaptor-signature.ts +15 -5
- package/src/utils/fetch.ts +75 -0
- package/src/utils/mempool.ts +9 -4
- package/src/utils/transaction.ts +388 -26
package/dist/native/index.d.cts
CHANGED
|
@@ -2341,6 +2341,8 @@ interface CompleteCoopExitInput {
|
|
|
2341
2341
|
|
|
2342
2342
|
interface CompleteLeavesSwapInput {
|
|
2343
2343
|
adaptorSecretKey: string;
|
|
2344
|
+
directAdaptorSecretKey: string;
|
|
2345
|
+
directFromCpfpAdaptorSecretKey: string;
|
|
2344
2346
|
userOutboundTransferExternalId: string;
|
|
2345
2347
|
leavesSwapRequestId: string;
|
|
2346
2348
|
}
|
|
@@ -2436,6 +2438,10 @@ interface SwapLeaf {
|
|
|
2436
2438
|
leafId: string;
|
|
2437
2439
|
rawUnsignedRefundTransaction: string;
|
|
2438
2440
|
adaptorSignedSignature: string;
|
|
2441
|
+
directRawUnsignedRefundTransaction?: string;
|
|
2442
|
+
directAdaptorSignedSignature?: string;
|
|
2443
|
+
directFromCpfpRawUnsignedRefundTransaction?: string;
|
|
2444
|
+
directFromCpfpAdaptorSignedSignature?: string;
|
|
2439
2445
|
}
|
|
2440
2446
|
|
|
2441
2447
|
interface LeavesSwapRequest {
|
|
@@ -2583,11 +2589,17 @@ interface RequestCoopExitInput {
|
|
|
2583
2589
|
interface UserLeafInput {
|
|
2584
2590
|
leaf_id: string;
|
|
2585
2591
|
raw_unsigned_refund_transaction: string;
|
|
2592
|
+
direct_raw_unsigned_refund_transaction: string;
|
|
2593
|
+
direct_from_cpfp_raw_unsigned_refund_transaction: string;
|
|
2586
2594
|
adaptor_added_signature: string;
|
|
2595
|
+
direct_adaptor_added_signature: string;
|
|
2596
|
+
direct_from_cpfp_adaptor_added_signature: string;
|
|
2587
2597
|
}
|
|
2588
2598
|
|
|
2589
2599
|
interface RequestLeavesSwapInput {
|
|
2590
2600
|
adaptorPubkey: string;
|
|
2601
|
+
directAdaptorPubkey?: string;
|
|
2602
|
+
directFromCpfpAdaptorPubkey?: string;
|
|
2591
2603
|
totalAmountSats: number;
|
|
2592
2604
|
targetAmountSats: number;
|
|
2593
2605
|
feeSats: number;
|
|
@@ -2694,8 +2706,8 @@ declare class SspClient {
|
|
|
2694
2706
|
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
2695
2707
|
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
2696
2708
|
requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
2697
|
-
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2698
|
-
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2709
|
+
requestLeaveSwap({ adaptorPubkey, directAdaptorPubkey, directFromCpfpAdaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2710
|
+
completeLeaveSwap({ adaptorSecretKey, directAdaptorSecretKey, directFromCpfpAdaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2699
2711
|
getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
|
|
2700
2712
|
getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
|
|
2701
2713
|
getLeaveSwapRequest(id: string): Promise<LeavesSwapRequest | null>;
|
|
@@ -2844,19 +2856,66 @@ declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalance
|
|
|
2844
2856
|
|
|
2845
2857
|
declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
|
|
2846
2858
|
|
|
2859
|
+
declare const DIRECT_TIMELOCK_OFFSET = 50;
|
|
2860
|
+
declare const INITIAL_SEQUENCE: number;
|
|
2861
|
+
declare const INITIAL_DIRECT_SEQUENCE: number;
|
|
2862
|
+
declare const TEST_UNILATERAL_SEQUENCE: number;
|
|
2863
|
+
declare const TEST_UNILATERAL_DIRECT_SEQUENCE: number;
|
|
2847
2864
|
declare const DEFAULT_FEE_SATS: number;
|
|
2848
2865
|
/**
|
|
2849
2866
|
* Subtracts the default fee from the amount if it's greater than the fee.
|
|
2850
2867
|
* Returns the original amount if it's less than or equal to the fee.
|
|
2851
2868
|
*/
|
|
2852
2869
|
declare function maybeApplyFee(amount: bigint): bigint;
|
|
2853
|
-
declare function
|
|
2870
|
+
declare function createRootTx(depositOutPoint: TransactionInput, depositTxOut: TransactionOutput): [Transaction, Transaction];
|
|
2871
|
+
declare function createSplitTx(parentOutPoint: TransactionInput, childTxOuts: TransactionOutput[]): [Transaction, Transaction];
|
|
2872
|
+
interface CreateNodeTxInput {
|
|
2873
|
+
txOut: TransactionOutput;
|
|
2874
|
+
parentOutPoint: TransactionInput;
|
|
2875
|
+
applyFee?: boolean;
|
|
2876
|
+
includeAnchor?: boolean;
|
|
2877
|
+
}
|
|
2878
|
+
declare function createNodeTx({ txOut, parentOutPoint, applyFee, includeAnchor, }: CreateNodeTxInput): Transaction;
|
|
2879
|
+
declare function createNodeTxs(txOut: TransactionOutput, txIn: TransactionInput, directTxIn?: TransactionInput): {
|
|
2880
|
+
cpfpNodeTx: Transaction;
|
|
2881
|
+
directNodeTx?: Transaction;
|
|
2882
|
+
};
|
|
2883
|
+
declare function createLeafNodeTx(sequence: number, directSequence: number, parentOutPoint: TransactionInput, txOut: TransactionOutput, shouldCalculateFee: boolean): [Transaction, Transaction];
|
|
2884
|
+
interface CreateRefundTxInput {
|
|
2885
|
+
sequence: number;
|
|
2886
|
+
input: TransactionInput;
|
|
2887
|
+
amountSats: bigint;
|
|
2888
|
+
receivingPubkey: Uint8Array;
|
|
2889
|
+
network: Network;
|
|
2890
|
+
shouldCalculateFee: boolean;
|
|
2891
|
+
includeAnchor: boolean;
|
|
2892
|
+
}
|
|
2893
|
+
declare function createRefundTx({ sequence, input, amountSats, receivingPubkey, network, shouldCalculateFee, includeAnchor, }: CreateRefundTxInput): Transaction;
|
|
2894
|
+
interface CreateRefundTxsInput {
|
|
2895
|
+
sequence: number;
|
|
2896
|
+
directSequence?: number;
|
|
2897
|
+
input: TransactionInput;
|
|
2898
|
+
directInput?: TransactionInput;
|
|
2899
|
+
amountSats: bigint;
|
|
2900
|
+
receivingPubkey: Uint8Array;
|
|
2901
|
+
network: Network;
|
|
2902
|
+
}
|
|
2903
|
+
declare function createRefundTxs({ sequence, directSequence, input, directInput, amountSats, receivingPubkey, network, }: CreateRefundTxsInput): {
|
|
2904
|
+
cpfpRefundTx: Transaction;
|
|
2905
|
+
directRefundTx?: Transaction;
|
|
2906
|
+
directFromCpfpRefundTx?: Transaction;
|
|
2907
|
+
};
|
|
2908
|
+
declare function createConnectorRefundTransactions(sequence: number, cpfpNodeOutPoint: TransactionInput, directNodeOutPoint: TransactionInput, connectorOutput: TransactionInput, amountSats: bigint, receiverPubKey: Uint8Array, network: Network, shouldCalculateFee: boolean): [Transaction, Transaction, Transaction];
|
|
2854
2909
|
declare function getCurrentTimelock(currSequence?: number): number;
|
|
2855
|
-
declare function getTransactionSequence(currSequence?: number):
|
|
2910
|
+
declare function getTransactionSequence(currSequence?: number): {
|
|
2911
|
+
nextSequence: number;
|
|
2912
|
+
nextDirectSequence: number;
|
|
2913
|
+
};
|
|
2856
2914
|
declare function checkIfValidSequence(currSequence?: number): void;
|
|
2857
|
-
declare function
|
|
2915
|
+
declare function doesLeafNeedRefresh(currSequence: number, isNodeTx?: boolean): boolean;
|
|
2916
|
+
declare function getNextTransactionSequence(currSequence: number, isNodeTx?: boolean): {
|
|
2858
2917
|
nextSequence: number;
|
|
2859
|
-
|
|
2918
|
+
nextDirectSequence: number;
|
|
2860
2919
|
};
|
|
2861
2920
|
declare function getEphemeralAnchorOutput(): TransactionOutput;
|
|
2862
2921
|
|
|
@@ -3027,7 +3086,12 @@ declare class ConnectionManager {
|
|
|
3027
3086
|
declare class SigningService {
|
|
3028
3087
|
private readonly config;
|
|
3029
3088
|
constructor(config: WalletConfigService);
|
|
3030
|
-
|
|
3089
|
+
private signRefundsInternal;
|
|
3090
|
+
signRefunds(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, cpfpSigningCommitments: RequestedSigningCommitments[], directSigningCommitments: RequestedSigningCommitments[], directFromCpfpSigningCommitments: RequestedSigningCommitments[]): Promise<{
|
|
3091
|
+
cpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3092
|
+
directLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3093
|
+
directFromCpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3094
|
+
}>;
|
|
3031
3095
|
}
|
|
3032
3096
|
|
|
3033
3097
|
type LeafKeyTweak = {
|
|
@@ -3035,19 +3099,17 @@ type LeafKeyTweak = {
|
|
|
3035
3099
|
keyDerivation: KeyDerivation;
|
|
3036
3100
|
newKeyDerivation: KeyDerivation;
|
|
3037
3101
|
};
|
|
3038
|
-
type ClaimLeafData = {
|
|
3039
|
-
keyDerivation: KeyDerivation;
|
|
3040
|
-
tx?: Transaction;
|
|
3041
|
-
refundTx?: Transaction;
|
|
3042
|
-
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3043
|
-
vout?: number;
|
|
3044
|
-
};
|
|
3045
3102
|
type LeafRefundSigningData = {
|
|
3046
3103
|
keyDerivation: KeyDerivation;
|
|
3047
3104
|
receivingPubkey: Uint8Array;
|
|
3105
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3106
|
+
directSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3048
3107
|
tx: Transaction;
|
|
3108
|
+
directTx?: Transaction;
|
|
3049
3109
|
refundTx?: Transaction;
|
|
3050
|
-
|
|
3110
|
+
directRefundTx?: Transaction;
|
|
3111
|
+
directFromCpfpRefundTx?: Transaction;
|
|
3112
|
+
directFromCpfpRefundSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3051
3113
|
vout: number;
|
|
3052
3114
|
};
|
|
3053
3115
|
declare class BaseTransferService {
|
|
@@ -3055,12 +3117,12 @@ declare class BaseTransferService {
|
|
|
3055
3117
|
protected readonly connectionManager: ConnectionManager;
|
|
3056
3118
|
protected readonly signingService: SigningService;
|
|
3057
3119
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3058
|
-
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[],
|
|
3059
|
-
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[],
|
|
3120
|
+
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3121
|
+
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3060
3122
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer$1>;
|
|
3061
3123
|
private prepareTransferPackage;
|
|
3062
3124
|
private finalizeTransfer;
|
|
3063
|
-
signRefunds(leafDataMap: Map<string,
|
|
3125
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
3064
3126
|
private prepareSendTransferKeyTweaks;
|
|
3065
3127
|
private prepareSingleSendTransferKeyTweak;
|
|
3066
3128
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -3081,22 +3143,30 @@ declare class TransferService extends BaseTransferService {
|
|
|
3081
3143
|
sendTransferSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
3082
3144
|
transfer: Transfer$1;
|
|
3083
3145
|
signatureMap: Map<string, Uint8Array>;
|
|
3146
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3147
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3084
3148
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3085
3149
|
}>;
|
|
3086
3150
|
startSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
3087
3151
|
transfer: Transfer$1;
|
|
3088
3152
|
signatureMap: Map<string, Uint8Array>;
|
|
3153
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3154
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3089
3155
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3090
3156
|
}>;
|
|
3091
|
-
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date,
|
|
3157
|
+
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3092
3158
|
transfer: Transfer$1;
|
|
3093
3159
|
signatureMap: Map<string, Uint8Array>;
|
|
3160
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3161
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3094
3162
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3095
3163
|
signingResults: LeafRefundTxSigningResult[];
|
|
3096
3164
|
}>;
|
|
3097
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean,
|
|
3165
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3098
3166
|
transfer: Transfer$1;
|
|
3099
3167
|
signatureMap: Map<string, Uint8Array>;
|
|
3168
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3169
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3100
3170
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3101
3171
|
signingResults: LeafRefundTxSigningResult[];
|
|
3102
3172
|
}>;
|
|
@@ -3108,9 +3178,11 @@ declare class TransferService extends BaseTransferService {
|
|
|
3108
3178
|
private finalizeNodeSignatures;
|
|
3109
3179
|
cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
|
|
3110
3180
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
3111
|
-
|
|
3181
|
+
private refreshTimelockNodesInternal;
|
|
3182
|
+
refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3112
3183
|
extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3113
|
-
|
|
3184
|
+
testonly_expireTimeLockNodeTx(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3185
|
+
testonly_expireTimeLockRefundtx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3114
3186
|
}
|
|
3115
3187
|
|
|
3116
3188
|
interface WalletLeaf {
|
|
@@ -3675,13 +3747,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3675
3747
|
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
3676
3748
|
*/
|
|
3677
3749
|
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
3678
|
-
/**
|
|
3679
|
-
* Refresh the timelock of a specific node's refund transaction only.
|
|
3680
|
-
*
|
|
3681
|
-
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
3682
|
-
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
3683
|
-
*/
|
|
3684
|
-
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
3685
3750
|
private cleanup;
|
|
3686
3751
|
cleanupConnections(): Promise<void>;
|
|
3687
3752
|
private startPeriodicClaimTransfers;
|
|
@@ -3743,4 +3808,4 @@ declare class TokenTransactionService {
|
|
|
3743
3808
|
private createSignaturesForOperators;
|
|
3744
3809
|
}
|
|
3745
3810
|
|
|
3746
|
-
export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
|
|
3811
|
+
export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, DIRECT_TIMELOCK_OFFSET, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, INITIAL_DIRECT_SEQUENCE, INITIAL_SEQUENCE, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, TEST_UNILATERAL_DIRECT_SEQUENCE, TEST_UNILATERAL_SEQUENCE, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createConnectorRefundTransactions, createLeafNodeTx, createNodeTx, createNodeTxs, createRefundTx, createRefundTxs, createRootTx, createSigningCommitment, createSigningNonce, createSplitTx, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, doesLeafNeedRefresh, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
|
package/dist/native/index.d.ts
CHANGED
|
@@ -2341,6 +2341,8 @@ interface CompleteCoopExitInput {
|
|
|
2341
2341
|
|
|
2342
2342
|
interface CompleteLeavesSwapInput {
|
|
2343
2343
|
adaptorSecretKey: string;
|
|
2344
|
+
directAdaptorSecretKey: string;
|
|
2345
|
+
directFromCpfpAdaptorSecretKey: string;
|
|
2344
2346
|
userOutboundTransferExternalId: string;
|
|
2345
2347
|
leavesSwapRequestId: string;
|
|
2346
2348
|
}
|
|
@@ -2436,6 +2438,10 @@ interface SwapLeaf {
|
|
|
2436
2438
|
leafId: string;
|
|
2437
2439
|
rawUnsignedRefundTransaction: string;
|
|
2438
2440
|
adaptorSignedSignature: string;
|
|
2441
|
+
directRawUnsignedRefundTransaction?: string;
|
|
2442
|
+
directAdaptorSignedSignature?: string;
|
|
2443
|
+
directFromCpfpRawUnsignedRefundTransaction?: string;
|
|
2444
|
+
directFromCpfpAdaptorSignedSignature?: string;
|
|
2439
2445
|
}
|
|
2440
2446
|
|
|
2441
2447
|
interface LeavesSwapRequest {
|
|
@@ -2583,11 +2589,17 @@ interface RequestCoopExitInput {
|
|
|
2583
2589
|
interface UserLeafInput {
|
|
2584
2590
|
leaf_id: string;
|
|
2585
2591
|
raw_unsigned_refund_transaction: string;
|
|
2592
|
+
direct_raw_unsigned_refund_transaction: string;
|
|
2593
|
+
direct_from_cpfp_raw_unsigned_refund_transaction: string;
|
|
2586
2594
|
adaptor_added_signature: string;
|
|
2595
|
+
direct_adaptor_added_signature: string;
|
|
2596
|
+
direct_from_cpfp_adaptor_added_signature: string;
|
|
2587
2597
|
}
|
|
2588
2598
|
|
|
2589
2599
|
interface RequestLeavesSwapInput {
|
|
2590
2600
|
adaptorPubkey: string;
|
|
2601
|
+
directAdaptorPubkey?: string;
|
|
2602
|
+
directFromCpfpAdaptorPubkey?: string;
|
|
2591
2603
|
totalAmountSats: number;
|
|
2592
2604
|
targetAmountSats: number;
|
|
2593
2605
|
feeSats: number;
|
|
@@ -2694,8 +2706,8 @@ declare class SspClient {
|
|
|
2694
2706
|
requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
|
|
2695
2707
|
requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
|
|
2696
2708
|
requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
|
|
2697
|
-
requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2698
|
-
completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2709
|
+
requestLeaveSwap({ adaptorPubkey, directAdaptorPubkey, directFromCpfpAdaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2710
|
+
completeLeaveSwap({ adaptorSecretKey, directAdaptorSecretKey, directFromCpfpAdaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
|
|
2699
2711
|
getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
|
|
2700
2712
|
getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
|
|
2701
2713
|
getLeaveSwapRequest(id: string): Promise<LeavesSwapRequest | null>;
|
|
@@ -2844,19 +2856,66 @@ declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalance
|
|
|
2844
2856
|
|
|
2845
2857
|
declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
|
|
2846
2858
|
|
|
2859
|
+
declare const DIRECT_TIMELOCK_OFFSET = 50;
|
|
2860
|
+
declare const INITIAL_SEQUENCE: number;
|
|
2861
|
+
declare const INITIAL_DIRECT_SEQUENCE: number;
|
|
2862
|
+
declare const TEST_UNILATERAL_SEQUENCE: number;
|
|
2863
|
+
declare const TEST_UNILATERAL_DIRECT_SEQUENCE: number;
|
|
2847
2864
|
declare const DEFAULT_FEE_SATS: number;
|
|
2848
2865
|
/**
|
|
2849
2866
|
* Subtracts the default fee from the amount if it's greater than the fee.
|
|
2850
2867
|
* Returns the original amount if it's less than or equal to the fee.
|
|
2851
2868
|
*/
|
|
2852
2869
|
declare function maybeApplyFee(amount: bigint): bigint;
|
|
2853
|
-
declare function
|
|
2870
|
+
declare function createRootTx(depositOutPoint: TransactionInput, depositTxOut: TransactionOutput): [Transaction, Transaction];
|
|
2871
|
+
declare function createSplitTx(parentOutPoint: TransactionInput, childTxOuts: TransactionOutput[]): [Transaction, Transaction];
|
|
2872
|
+
interface CreateNodeTxInput {
|
|
2873
|
+
txOut: TransactionOutput;
|
|
2874
|
+
parentOutPoint: TransactionInput;
|
|
2875
|
+
applyFee?: boolean;
|
|
2876
|
+
includeAnchor?: boolean;
|
|
2877
|
+
}
|
|
2878
|
+
declare function createNodeTx({ txOut, parentOutPoint, applyFee, includeAnchor, }: CreateNodeTxInput): Transaction;
|
|
2879
|
+
declare function createNodeTxs(txOut: TransactionOutput, txIn: TransactionInput, directTxIn?: TransactionInput): {
|
|
2880
|
+
cpfpNodeTx: Transaction;
|
|
2881
|
+
directNodeTx?: Transaction;
|
|
2882
|
+
};
|
|
2883
|
+
declare function createLeafNodeTx(sequence: number, directSequence: number, parentOutPoint: TransactionInput, txOut: TransactionOutput, shouldCalculateFee: boolean): [Transaction, Transaction];
|
|
2884
|
+
interface CreateRefundTxInput {
|
|
2885
|
+
sequence: number;
|
|
2886
|
+
input: TransactionInput;
|
|
2887
|
+
amountSats: bigint;
|
|
2888
|
+
receivingPubkey: Uint8Array;
|
|
2889
|
+
network: Network;
|
|
2890
|
+
shouldCalculateFee: boolean;
|
|
2891
|
+
includeAnchor: boolean;
|
|
2892
|
+
}
|
|
2893
|
+
declare function createRefundTx({ sequence, input, amountSats, receivingPubkey, network, shouldCalculateFee, includeAnchor, }: CreateRefundTxInput): Transaction;
|
|
2894
|
+
interface CreateRefundTxsInput {
|
|
2895
|
+
sequence: number;
|
|
2896
|
+
directSequence?: number;
|
|
2897
|
+
input: TransactionInput;
|
|
2898
|
+
directInput?: TransactionInput;
|
|
2899
|
+
amountSats: bigint;
|
|
2900
|
+
receivingPubkey: Uint8Array;
|
|
2901
|
+
network: Network;
|
|
2902
|
+
}
|
|
2903
|
+
declare function createRefundTxs({ sequence, directSequence, input, directInput, amountSats, receivingPubkey, network, }: CreateRefundTxsInput): {
|
|
2904
|
+
cpfpRefundTx: Transaction;
|
|
2905
|
+
directRefundTx?: Transaction;
|
|
2906
|
+
directFromCpfpRefundTx?: Transaction;
|
|
2907
|
+
};
|
|
2908
|
+
declare function createConnectorRefundTransactions(sequence: number, cpfpNodeOutPoint: TransactionInput, directNodeOutPoint: TransactionInput, connectorOutput: TransactionInput, amountSats: bigint, receiverPubKey: Uint8Array, network: Network, shouldCalculateFee: boolean): [Transaction, Transaction, Transaction];
|
|
2854
2909
|
declare function getCurrentTimelock(currSequence?: number): number;
|
|
2855
|
-
declare function getTransactionSequence(currSequence?: number):
|
|
2910
|
+
declare function getTransactionSequence(currSequence?: number): {
|
|
2911
|
+
nextSequence: number;
|
|
2912
|
+
nextDirectSequence: number;
|
|
2913
|
+
};
|
|
2856
2914
|
declare function checkIfValidSequence(currSequence?: number): void;
|
|
2857
|
-
declare function
|
|
2915
|
+
declare function doesLeafNeedRefresh(currSequence: number, isNodeTx?: boolean): boolean;
|
|
2916
|
+
declare function getNextTransactionSequence(currSequence: number, isNodeTx?: boolean): {
|
|
2858
2917
|
nextSequence: number;
|
|
2859
|
-
|
|
2918
|
+
nextDirectSequence: number;
|
|
2860
2919
|
};
|
|
2861
2920
|
declare function getEphemeralAnchorOutput(): TransactionOutput;
|
|
2862
2921
|
|
|
@@ -3027,7 +3086,12 @@ declare class ConnectionManager {
|
|
|
3027
3086
|
declare class SigningService {
|
|
3028
3087
|
private readonly config;
|
|
3029
3088
|
constructor(config: WalletConfigService);
|
|
3030
|
-
|
|
3089
|
+
private signRefundsInternal;
|
|
3090
|
+
signRefunds(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, cpfpSigningCommitments: RequestedSigningCommitments[], directSigningCommitments: RequestedSigningCommitments[], directFromCpfpSigningCommitments: RequestedSigningCommitments[]): Promise<{
|
|
3091
|
+
cpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3092
|
+
directLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3093
|
+
directFromCpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
3094
|
+
}>;
|
|
3031
3095
|
}
|
|
3032
3096
|
|
|
3033
3097
|
type LeafKeyTweak = {
|
|
@@ -3035,19 +3099,17 @@ type LeafKeyTweak = {
|
|
|
3035
3099
|
keyDerivation: KeyDerivation;
|
|
3036
3100
|
newKeyDerivation: KeyDerivation;
|
|
3037
3101
|
};
|
|
3038
|
-
type ClaimLeafData = {
|
|
3039
|
-
keyDerivation: KeyDerivation;
|
|
3040
|
-
tx?: Transaction;
|
|
3041
|
-
refundTx?: Transaction;
|
|
3042
|
-
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3043
|
-
vout?: number;
|
|
3044
|
-
};
|
|
3045
3102
|
type LeafRefundSigningData = {
|
|
3046
3103
|
keyDerivation: KeyDerivation;
|
|
3047
3104
|
receivingPubkey: Uint8Array;
|
|
3105
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3106
|
+
directSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3048
3107
|
tx: Transaction;
|
|
3108
|
+
directTx?: Transaction;
|
|
3049
3109
|
refundTx?: Transaction;
|
|
3050
|
-
|
|
3110
|
+
directRefundTx?: Transaction;
|
|
3111
|
+
directFromCpfpRefundTx?: Transaction;
|
|
3112
|
+
directFromCpfpRefundSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
3051
3113
|
vout: number;
|
|
3052
3114
|
};
|
|
3053
3115
|
declare class BaseTransferService {
|
|
@@ -3055,12 +3117,12 @@ declare class BaseTransferService {
|
|
|
3055
3117
|
protected readonly connectionManager: ConnectionManager;
|
|
3056
3118
|
protected readonly signingService: SigningService;
|
|
3057
3119
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
3058
|
-
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[],
|
|
3059
|
-
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[],
|
|
3120
|
+
sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3121
|
+
deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
|
|
3060
3122
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer$1>;
|
|
3061
3123
|
private prepareTransferPackage;
|
|
3062
3124
|
private finalizeTransfer;
|
|
3063
|
-
signRefunds(leafDataMap: Map<string,
|
|
3125
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
3064
3126
|
private prepareSendTransferKeyTweaks;
|
|
3065
3127
|
private prepareSingleSendTransferKeyTweak;
|
|
3066
3128
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -3081,22 +3143,30 @@ declare class TransferService extends BaseTransferService {
|
|
|
3081
3143
|
sendTransferSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
3082
3144
|
transfer: Transfer$1;
|
|
3083
3145
|
signatureMap: Map<string, Uint8Array>;
|
|
3146
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3147
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3084
3148
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3085
3149
|
}>;
|
|
3086
3150
|
startSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
3087
3151
|
transfer: Transfer$1;
|
|
3088
3152
|
signatureMap: Map<string, Uint8Array>;
|
|
3153
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3154
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3089
3155
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3090
3156
|
}>;
|
|
3091
|
-
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date,
|
|
3157
|
+
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3092
3158
|
transfer: Transfer$1;
|
|
3093
3159
|
signatureMap: Map<string, Uint8Array>;
|
|
3160
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3161
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3094
3162
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3095
3163
|
signingResults: LeafRefundTxSigningResult[];
|
|
3096
3164
|
}>;
|
|
3097
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean,
|
|
3165
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
3098
3166
|
transfer: Transfer$1;
|
|
3099
3167
|
signatureMap: Map<string, Uint8Array>;
|
|
3168
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
3169
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
3100
3170
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
3101
3171
|
signingResults: LeafRefundTxSigningResult[];
|
|
3102
3172
|
}>;
|
|
@@ -3108,9 +3178,11 @@ declare class TransferService extends BaseTransferService {
|
|
|
3108
3178
|
private finalizeNodeSignatures;
|
|
3109
3179
|
cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
|
|
3110
3180
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
3111
|
-
|
|
3181
|
+
private refreshTimelockNodesInternal;
|
|
3182
|
+
refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3112
3183
|
extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3113
|
-
|
|
3184
|
+
testonly_expireTimeLockNodeTx(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3185
|
+
testonly_expireTimeLockRefundtx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
3114
3186
|
}
|
|
3115
3187
|
|
|
3116
3188
|
interface WalletLeaf {
|
|
@@ -3675,13 +3747,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3675
3747
|
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
3676
3748
|
*/
|
|
3677
3749
|
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
3678
|
-
/**
|
|
3679
|
-
* Refresh the timelock of a specific node's refund transaction only.
|
|
3680
|
-
*
|
|
3681
|
-
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
3682
|
-
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
3683
|
-
*/
|
|
3684
|
-
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
3685
3750
|
private cleanup;
|
|
3686
3751
|
cleanupConnections(): Promise<void>;
|
|
3687
3752
|
private startPeriodicClaimTransfers;
|
|
@@ -3743,4 +3808,4 @@ declare class TokenTransactionService {
|
|
|
3743
3808
|
private createSignaturesForOperators;
|
|
3744
3809
|
}
|
|
3745
3810
|
|
|
3746
|
-
export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
|
|
3811
|
+
export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, DIRECT_TIMELOCK_OFFSET, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, INITIAL_DIRECT_SEQUENCE, INITIAL_SEQUENCE, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, TEST_UNILATERAL_DIRECT_SEQUENCE, TEST_UNILATERAL_SEQUENCE, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createConnectorRefundTransactions, createLeafNodeTx, createNodeTx, createNodeTxs, createRefundTx, createRefundTxs, createRootTx, createSigningCommitment, createSigningNonce, createSplitTx, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, doesLeafNeedRefresh, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
|