@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BitcoinNetwork,
|
|
1
|
+
import { B as BitcoinNetwork, ag as MayHaveSspClientOptions, ah as SspClientOptions, ai as HasSspClientOptions, S as SparkSigner, l as KeyDerivation, i as SigningCommitmentWithOptionalNonce, V as VerifiableSecretShare, P as LeavesSwapFeeEstimateOutput, ab as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, X as LightningReceiveRequest, a0 as LightningSendRequest, Z as LightningSendFeeEstimateInput, L as ExitSpeed, E as CoopExitFeeQuote, G as CoopExitRequest, ad as Transfer$1 } from './client-BF4cn8F4.js';
|
|
2
2
|
import { N as Network$1, E as Empty, g as SparkServiceClient, h as RequestedSigningCommitments, U as UserSignedTxSigningJob, d as TreeNode, f as Transfer, L as LeafRefundTxSigningResult, i as NodeSignatures, F as FinalizeNodeSignaturesResponse, Q as QueryTransfersResponse, P as PaymentIntentFields, j as OutputWithPreviousTransactionData } from './spark-B_7nZx6T.js';
|
|
3
3
|
import { NetworkType as NetworkType$1, MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig, HasLrc20WalletApiConfig, LRCWallet } from '@buildonspark/lrc20-sdk';
|
|
4
4
|
import * as btc from '@scure/btc-signer';
|
|
@@ -193,7 +193,12 @@ declare class ConnectionManager {
|
|
|
193
193
|
declare class SigningService {
|
|
194
194
|
private readonly config;
|
|
195
195
|
constructor(config: WalletConfigService);
|
|
196
|
-
|
|
196
|
+
private signRefundsInternal;
|
|
197
|
+
signRefunds(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, cpfpSigningCommitments: RequestedSigningCommitments[], directSigningCommitments: RequestedSigningCommitments[], directFromCpfpSigningCommitments: RequestedSigningCommitments[]): Promise<{
|
|
198
|
+
cpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
199
|
+
directLeafSigningJobs: UserSignedTxSigningJob[];
|
|
200
|
+
directFromCpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
201
|
+
}>;
|
|
197
202
|
}
|
|
198
203
|
|
|
199
204
|
type LeafKeyTweak = {
|
|
@@ -201,19 +206,17 @@ type LeafKeyTweak = {
|
|
|
201
206
|
keyDerivation: KeyDerivation;
|
|
202
207
|
newKeyDerivation: KeyDerivation;
|
|
203
208
|
};
|
|
204
|
-
type ClaimLeafData = {
|
|
205
|
-
keyDerivation: KeyDerivation;
|
|
206
|
-
tx?: Transaction;
|
|
207
|
-
refundTx?: Transaction;
|
|
208
|
-
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
209
|
-
vout?: number;
|
|
210
|
-
};
|
|
211
209
|
type LeafRefundSigningData = {
|
|
212
210
|
keyDerivation: KeyDerivation;
|
|
213
211
|
receivingPubkey: Uint8Array;
|
|
212
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
213
|
+
directSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
214
214
|
tx: Transaction;
|
|
215
|
+
directTx?: Transaction;
|
|
215
216
|
refundTx?: Transaction;
|
|
216
|
-
|
|
217
|
+
directRefundTx?: Transaction;
|
|
218
|
+
directFromCpfpRefundTx?: Transaction;
|
|
219
|
+
directFromCpfpRefundSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
217
220
|
vout: number;
|
|
218
221
|
};
|
|
219
222
|
declare class BaseTransferService {
|
|
@@ -221,12 +224,12 @@ declare class BaseTransferService {
|
|
|
221
224
|
protected readonly connectionManager: ConnectionManager;
|
|
222
225
|
protected readonly signingService: SigningService;
|
|
223
226
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
224
|
-
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[],
|
|
225
|
-
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[],
|
|
227
|
+
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
228
|
+
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
226
229
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer>;
|
|
227
230
|
private prepareTransferPackage;
|
|
228
231
|
private finalizeTransfer;
|
|
229
|
-
signRefunds(leafDataMap: Map<string,
|
|
232
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
230
233
|
private prepareSendTransferKeyTweaks;
|
|
231
234
|
private prepareSingleSendTransferKeyTweak;
|
|
232
235
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -247,22 +250,30 @@ declare class TransferService extends BaseTransferService {
|
|
|
247
250
|
sendTransferSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
248
251
|
transfer: Transfer;
|
|
249
252
|
signatureMap: Map<string, Uint8Array>;
|
|
253
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
254
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
250
255
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
251
256
|
}>;
|
|
252
257
|
startSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
253
258
|
transfer: Transfer;
|
|
254
259
|
signatureMap: Map<string, Uint8Array>;
|
|
260
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
261
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
255
262
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
256
263
|
}>;
|
|
257
|
-
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date,
|
|
264
|
+
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
258
265
|
transfer: Transfer;
|
|
259
266
|
signatureMap: Map<string, Uint8Array>;
|
|
267
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
268
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
260
269
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
261
270
|
signingResults: LeafRefundTxSigningResult[];
|
|
262
271
|
}>;
|
|
263
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean,
|
|
272
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
264
273
|
transfer: Transfer;
|
|
265
274
|
signatureMap: Map<string, Uint8Array>;
|
|
275
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
276
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
266
277
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
267
278
|
signingResults: LeafRefundTxSigningResult[];
|
|
268
279
|
}>;
|
|
@@ -274,9 +285,11 @@ declare class TransferService extends BaseTransferService {
|
|
|
274
285
|
private finalizeNodeSignatures;
|
|
275
286
|
cancelTransfer(transfer: Transfer, operatorAddress: string): Promise<Transfer | undefined>;
|
|
276
287
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
277
|
-
|
|
288
|
+
private refreshTimelockNodesInternal;
|
|
289
|
+
refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
278
290
|
extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
279
|
-
|
|
291
|
+
testonly_expireTimeLockNodeTx(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
292
|
+
testonly_expireTimeLockRefundtx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
280
293
|
}
|
|
281
294
|
|
|
282
295
|
declare const AddressNetwork: Record<NetworkType, string>;
|
|
@@ -922,13 +935,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
922
935
|
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
923
936
|
*/
|
|
924
937
|
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
925
|
-
/**
|
|
926
|
-
* Refresh the timelock of a specific node's refund transaction only.
|
|
927
|
-
*
|
|
928
|
-
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
929
|
-
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
930
|
-
*/
|
|
931
|
-
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
932
938
|
private cleanup;
|
|
933
939
|
cleanupConnections(): Promise<void>;
|
|
934
940
|
private startPeriodicClaimTransfers;
|
|
@@ -936,4 +942,4 @@ declare class SparkWallet extends EventEmitter {
|
|
|
936
942
|
private queryNodes;
|
|
937
943
|
}
|
|
938
944
|
|
|
939
|
-
export { type Bech32mTokenIdentifier as B,
|
|
945
|
+
export { type Bech32mTokenIdentifier as B, ConnectionManager as C, type DecodedSparkAddressData as D, type InitWalletResponse as I, LRC_WALLET_NETWORK as L, Network as N, type PayLightningInvoiceParams as P, type RawTokenIdentifierHex as R, type SparkAddressFormat as S, type TransferParams as T, type UserTokenMetadata as U, WalletConfigService as W, WalletConfig as a, type ConfigOptions as b, type SparkAddressData as c, decodeSparkAddress as d, encodeSparkAddress as e, isValidPublicKey as f, type NetworkType as g, NetworkToProto as h, isValidSparkAddress as i, getNetwork as j, LRC_WALLET_NETWORK_TYPE as k, getNetworkFromAddress as l, getNetworkFromString as m, type Bech32mTokenIdentifierData as n, encodeBech32mTokenIdentifier as o, protoToNetwork as p, decodeBech32mTokenIdentifier as q, type CreateLightningInvoiceParams as r, type DepositParams as s, type TokenBalanceMap as t, type TokenOutputsMap as u, type TokenMetadataMap as v, type SparkWalletProps as w, type SparkWalletEvents as x, SparkWallet as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BitcoinNetwork,
|
|
1
|
+
import { B as BitcoinNetwork, ag as MayHaveSspClientOptions, ah as SspClientOptions, ai as HasSspClientOptions, S as SparkSigner, l as KeyDerivation, i as SigningCommitmentWithOptionalNonce, V as VerifiableSecretShare, P as LeavesSwapFeeEstimateOutput, ab as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, X as LightningReceiveRequest, a0 as LightningSendRequest, Z as LightningSendFeeEstimateInput, L as ExitSpeed, E as CoopExitFeeQuote, G as CoopExitRequest, ad as Transfer$1 } from './client-KhNkrXz4.cjs';
|
|
2
2
|
import { N as Network$1, E as Empty, g as SparkServiceClient, h as RequestedSigningCommitments, U as UserSignedTxSigningJob, d as TreeNode, f as Transfer, L as LeafRefundTxSigningResult, i as NodeSignatures, F as FinalizeNodeSignaturesResponse, Q as QueryTransfersResponse, P as PaymentIntentFields, j as OutputWithPreviousTransactionData } from './spark-B_7nZx6T.cjs';
|
|
3
3
|
import { NetworkType as NetworkType$1, MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig, HasLrc20WalletApiConfig, LRCWallet } from '@buildonspark/lrc20-sdk';
|
|
4
4
|
import * as btc from '@scure/btc-signer';
|
|
@@ -193,7 +193,12 @@ declare class ConnectionManager {
|
|
|
193
193
|
declare class SigningService {
|
|
194
194
|
private readonly config;
|
|
195
195
|
constructor(config: WalletConfigService);
|
|
196
|
-
|
|
196
|
+
private signRefundsInternal;
|
|
197
|
+
signRefunds(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, cpfpSigningCommitments: RequestedSigningCommitments[], directSigningCommitments: RequestedSigningCommitments[], directFromCpfpSigningCommitments: RequestedSigningCommitments[]): Promise<{
|
|
198
|
+
cpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
199
|
+
directLeafSigningJobs: UserSignedTxSigningJob[];
|
|
200
|
+
directFromCpfpLeafSigningJobs: UserSignedTxSigningJob[];
|
|
201
|
+
}>;
|
|
197
202
|
}
|
|
198
203
|
|
|
199
204
|
type LeafKeyTweak = {
|
|
@@ -201,19 +206,17 @@ type LeafKeyTweak = {
|
|
|
201
206
|
keyDerivation: KeyDerivation;
|
|
202
207
|
newKeyDerivation: KeyDerivation;
|
|
203
208
|
};
|
|
204
|
-
type ClaimLeafData = {
|
|
205
|
-
keyDerivation: KeyDerivation;
|
|
206
|
-
tx?: Transaction;
|
|
207
|
-
refundTx?: Transaction;
|
|
208
|
-
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
209
|
-
vout?: number;
|
|
210
|
-
};
|
|
211
209
|
type LeafRefundSigningData = {
|
|
212
210
|
keyDerivation: KeyDerivation;
|
|
213
211
|
receivingPubkey: Uint8Array;
|
|
212
|
+
signingNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
213
|
+
directSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
214
214
|
tx: Transaction;
|
|
215
|
+
directTx?: Transaction;
|
|
215
216
|
refundTx?: Transaction;
|
|
216
|
-
|
|
217
|
+
directRefundTx?: Transaction;
|
|
218
|
+
directFromCpfpRefundTx?: Transaction;
|
|
219
|
+
directFromCpfpRefundSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
|
|
217
220
|
vout: number;
|
|
218
221
|
};
|
|
219
222
|
declare class BaseTransferService {
|
|
@@ -221,12 +224,12 @@ declare class BaseTransferService {
|
|
|
221
224
|
protected readonly connectionManager: ConnectionManager;
|
|
222
225
|
protected readonly signingService: SigningService;
|
|
223
226
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
224
|
-
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[],
|
|
225
|
-
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[],
|
|
227
|
+
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
228
|
+
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
226
229
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer>;
|
|
227
230
|
private prepareTransferPackage;
|
|
228
231
|
private finalizeTransfer;
|
|
229
|
-
signRefunds(leafDataMap: Map<string,
|
|
232
|
+
signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
|
|
230
233
|
private prepareSendTransferKeyTweaks;
|
|
231
234
|
private prepareSingleSendTransferKeyTweak;
|
|
232
235
|
protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
|
|
@@ -247,22 +250,30 @@ declare class TransferService extends BaseTransferService {
|
|
|
247
250
|
sendTransferSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
248
251
|
transfer: Transfer;
|
|
249
252
|
signatureMap: Map<string, Uint8Array>;
|
|
253
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
254
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
250
255
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
251
256
|
}>;
|
|
252
257
|
startSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
|
|
253
258
|
transfer: Transfer;
|
|
254
259
|
signatureMap: Map<string, Uint8Array>;
|
|
260
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
261
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
255
262
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
256
263
|
}>;
|
|
257
|
-
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date,
|
|
264
|
+
counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
258
265
|
transfer: Transfer;
|
|
259
266
|
signatureMap: Map<string, Uint8Array>;
|
|
267
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
268
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
260
269
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
261
270
|
signingResults: LeafRefundTxSigningResult[];
|
|
262
271
|
}>;
|
|
263
|
-
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean,
|
|
272
|
+
sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
|
|
264
273
|
transfer: Transfer;
|
|
265
274
|
signatureMap: Map<string, Uint8Array>;
|
|
275
|
+
directSignatureMap: Map<string, Uint8Array>;
|
|
276
|
+
directFromCpfpSignatureMap: Map<string, Uint8Array>;
|
|
266
277
|
leafDataMap: Map<string, LeafRefundSigningData>;
|
|
267
278
|
signingResults: LeafRefundTxSigningResult[];
|
|
268
279
|
}>;
|
|
@@ -274,9 +285,11 @@ declare class TransferService extends BaseTransferService {
|
|
|
274
285
|
private finalizeNodeSignatures;
|
|
275
286
|
cancelTransfer(transfer: Transfer, operatorAddress: string): Promise<Transfer | undefined>;
|
|
276
287
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
277
|
-
|
|
288
|
+
private refreshTimelockNodesInternal;
|
|
289
|
+
refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
278
290
|
extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
279
|
-
|
|
291
|
+
testonly_expireTimeLockNodeTx(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
292
|
+
testonly_expireTimeLockRefundtx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
|
|
280
293
|
}
|
|
281
294
|
|
|
282
295
|
declare const AddressNetwork: Record<NetworkType, string>;
|
|
@@ -922,13 +935,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
922
935
|
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
923
936
|
*/
|
|
924
937
|
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
925
|
-
/**
|
|
926
|
-
* Refresh the timelock of a specific node's refund transaction only.
|
|
927
|
-
*
|
|
928
|
-
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
929
|
-
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
930
|
-
*/
|
|
931
|
-
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
932
938
|
private cleanup;
|
|
933
939
|
cleanupConnections(): Promise<void>;
|
|
934
940
|
private startPeriodicClaimTransfers;
|
|
@@ -936,4 +942,4 @@ declare class SparkWallet extends EventEmitter {
|
|
|
936
942
|
private queryNodes;
|
|
937
943
|
}
|
|
938
944
|
|
|
939
|
-
export { type Bech32mTokenIdentifier as B,
|
|
945
|
+
export { type Bech32mTokenIdentifier as B, ConnectionManager as C, type DecodedSparkAddressData as D, type InitWalletResponse as I, LRC_WALLET_NETWORK as L, Network as N, type PayLightningInvoiceParams as P, type RawTokenIdentifierHex as R, type SparkAddressFormat as S, type TransferParams as T, type UserTokenMetadata as U, WalletConfigService as W, WalletConfig as a, type ConfigOptions as b, type SparkAddressData as c, decodeSparkAddress as d, encodeSparkAddress as e, isValidPublicKey as f, type NetworkType as g, NetworkToProto as h, isValidSparkAddress as i, getNetwork as j, LRC_WALLET_NETWORK_TYPE as k, getNetworkFromAddress as l, getNetworkFromString as m, type Bech32mTokenIdentifierData as n, encodeBech32mTokenIdentifier as o, protoToNetwork as p, decodeBech32mTokenIdentifier as q, type CreateLightningInvoiceParams as r, type DepositParams as s, type TokenBalanceMap as t, type TokenOutputsMap as u, type TokenMetadataMap as v, type SparkWalletProps as w, type SparkWalletEvents as x, SparkWallet as y };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { y as SparkWallet$1, I as InitWalletResponse } from './spark-wallet-C1Tr_VKI.js';
|
|
2
|
+
|
|
3
|
+
declare class SparkWallet extends SparkWallet$1 {
|
|
4
|
+
private tracer;
|
|
5
|
+
protected wrapWithOtelSpan<A extends unknown[], R>(name: string, fn: (...args: A) => Promise<R>): (...args: A) => Promise<R>;
|
|
6
|
+
protected initializeTracer(tracerName: string): Promise<void>;
|
|
7
|
+
private getTraceName;
|
|
8
|
+
private wrapPublicMethodsWithOtelSpan;
|
|
9
|
+
private wrapSparkWalletWithTracing;
|
|
10
|
+
protected initWallet(mnemonicOrSeed?: Uint8Array | string, accountNumber?: number): Promise<InitWalletResponse | undefined>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { SparkWallet as S };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { y as SparkWallet$1, I as InitWalletResponse } from './spark-wallet-DG3x2obf.cjs';
|
|
2
|
+
|
|
3
|
+
declare class SparkWallet extends SparkWallet$1 {
|
|
4
|
+
private tracer;
|
|
5
|
+
protected wrapWithOtelSpan<A extends unknown[], R>(name: string, fn: (...args: A) => Promise<R>): (...args: A) => Promise<R>;
|
|
6
|
+
protected initializeTracer(tracerName: string): Promise<void>;
|
|
7
|
+
private getTraceName;
|
|
8
|
+
private wrapPublicMethodsWithOtelSpan;
|
|
9
|
+
private wrapSparkWalletWithTracing;
|
|
10
|
+
protected initWallet(mnemonicOrSeed?: Uint8Array | string, accountNumber?: number): Promise<InitWalletResponse | undefined>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { SparkWallet as S };
|