@buildonspark/spark-sdk 0.1.38 → 0.1.40
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 +12 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86_64/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libuniffi_spark_frost.so +0 -0
- package/dist/{RequestLightningSendInput-B4JdzclX.d.ts → RequestLightningSendInput-CJtcHOnu.d.ts} +1 -1
- package/dist/{RequestLightningSendInput-39_zGri6.d.cts → RequestLightningSendInput-DfmfqzZo.d.cts} +1 -1
- package/dist/address/index.d.cts +1 -1
- package/dist/address/index.d.ts +1 -1
- package/dist/address/index.js +2 -2
- package/dist/{chunk-W3EC5XSA.js → chunk-5MNQB2T4.js} +2 -2
- package/dist/chunk-ED3ZAFDI.js +784 -0
- package/dist/{chunk-VJTDG4BQ.js → chunk-HK6LPV6Z.js} +10 -1
- package/dist/{chunk-7WRK6WNJ.js → chunk-LHT4QTFK.js} +556 -41
- package/dist/{chunk-RAPBVYJY.js → chunk-RFCXPGDM.js} +26 -4
- package/dist/{chunk-DI7QXUQJ.js → chunk-W2VXS35Y.js} +4 -4
- package/dist/graphql/objects/index.d.cts +5 -4
- package/dist/graphql/objects/index.d.ts +5 -4
- package/dist/{index-CxAi2L8y.d.ts → index-BDEYgYxP.d.ts} +42 -4
- package/dist/{index-Dm17Ggfe.d.cts → index-CLdtdMU4.d.cts} +42 -4
- package/dist/index.cjs +1069 -40
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +33 -17
- package/dist/index.node.cjs +1069 -40
- package/dist/index.node.d.cts +6 -6
- package/dist/index.node.d.ts +6 -6
- package/dist/index.node.js +33 -17
- package/dist/native/index.cjs +1069 -40
- package/dist/native/index.d.cts +108 -5
- package/dist/native/index.d.ts +108 -5
- package/dist/native/index.js +1065 -40
- package/dist/{network-GFGEHkS4.d.cts → network-B10hBoHp.d.cts} +8 -1
- package/dist/{network-DobHpaV6.d.ts → network-CCgyIsGl.d.ts} +8 -1
- package/dist/services/config.cjs +29 -12
- package/dist/services/config.d.cts +4 -4
- package/dist/services/config.d.ts +4 -4
- package/dist/services/config.js +5 -5
- package/dist/services/connection.d.cts +4 -4
- package/dist/services/connection.d.ts +4 -4
- package/dist/services/connection.js +2 -2
- package/dist/services/index.cjs +30 -13
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +8 -8
- package/dist/services/lrc-connection.d.cts +4 -4
- package/dist/services/lrc-connection.d.ts +4 -4
- package/dist/services/lrc-connection.js +1 -1
- package/dist/services/token-transactions.cjs +1 -1
- package/dist/services/token-transactions.d.cts +4 -4
- package/dist/services/token-transactions.d.ts +4 -4
- package/dist/services/token-transactions.js +3 -3
- package/dist/services/wallet-config.d.cts +4 -4
- package/dist/services/wallet-config.d.ts +4 -4
- package/dist/signer/signer.cjs +23 -6
- package/dist/signer/signer.d.cts +3 -2
- package/dist/signer/signer.d.ts +3 -2
- package/dist/signer/signer.js +1 -1
- package/dist/{signer-DFGw9RRp.d.ts → signer-C5h1DpjF.d.ts} +4 -1
- package/dist/{signer-C1t40Wus.d.cts → signer-CYwn7h9U.d.cts} +4 -1
- package/dist/types/index.d.cts +4 -3
- package/dist/types/index.d.ts +4 -3
- package/dist/utils/index.cjs +891 -2
- package/dist/utils/index.d.cts +62 -6
- package/dist/utils/index.d.ts +62 -6
- package/dist/utils/index.js +23 -7
- package/package.json +1 -1
- package/src/services/deposit.ts +23 -5
- package/src/services/token-transactions.ts +1 -1
- package/src/services/transfer.ts +218 -11
- package/src/services/tree-creation.ts +29 -14
- package/src/signer/signer.ts +47 -5
- package/src/spark-wallet/spark-wallet.ts +430 -4
- package/src/tests/integration/swap.test.ts +225 -0
- package/src/tests/integration/tree-creation.test.ts +5 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/mempool.ts +26 -1
- package/src/utils/network.ts +15 -0
- package/src/utils/transaction.ts +22 -2
- package/src/utils/unilateral-exit.ts +729 -0
- package/dist/chunk-E5SL7XTO.js +0 -301
- package/dist/{chunk-LIP2K6KR.js → chunk-2CDJZQN4.js} +3 -3
- package/dist/{chunk-RGWBSZIO.js → chunk-I4JI6TYN.js} +4 -4
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
bytesToHex,
|
|
24
24
|
bytesToNumberBE,
|
|
25
|
+
equalBytes,
|
|
25
26
|
hexToBytes
|
|
26
27
|
} from "@noble/curves/abstract/utils";
|
|
27
28
|
import { schnorr, secp256k1 } from "@noble/curves/secp256k1";
|
|
@@ -29,11 +30,13 @@ import { HDKey } from "@scure/bip32";
|
|
|
29
30
|
import { generateMnemonic, mnemonicToSeed } from "@scure/bip39";
|
|
30
31
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
|
31
32
|
import * as ecies from "eciesjs";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
33
|
+
import { privateAdd, privateNegate } from "@bitcoinerlab/secp256k1";
|
|
34
|
+
import {
|
|
35
|
+
fromPrivateKey,
|
|
36
|
+
PARITY,
|
|
37
|
+
Receipt
|
|
38
|
+
} from "@buildonspark/lrc20-sdk";
|
|
35
39
|
import { sha256 } from "@noble/hashes/sha2";
|
|
36
|
-
import { fromPrivateKey } from "@buildonspark/lrc20-sdk";
|
|
37
40
|
var sparkFrostModule = void 0;
|
|
38
41
|
var getSparkFrostModule = async () => {
|
|
39
42
|
if (isReactNative) {
|
|
@@ -519,6 +522,25 @@ var DefaultSparkSigner = class {
|
|
|
519
522
|
const receiptProof = privateAdd(privateKey, pxhPubkey);
|
|
520
523
|
return Buffer.from(receiptProof);
|
|
521
524
|
}
|
|
525
|
+
signTransactionIndex(tx, index, publicKey) {
|
|
526
|
+
let privateKey;
|
|
527
|
+
if (equalBytes(publicKey, this.identityKey?.publicKey ?? new Uint8Array())) {
|
|
528
|
+
privateKey = this.identityKey?.privateKey;
|
|
529
|
+
} else if (equalBytes(publicKey, this.depositKey?.publicKey ?? new Uint8Array())) {
|
|
530
|
+
privateKey = this.depositKey?.privateKey;
|
|
531
|
+
} else {
|
|
532
|
+
privateKey = hexToBytes(
|
|
533
|
+
this.publicKeyToPrivateKeyMap.get(bytesToHex(publicKey)) ?? ""
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
if (!privateKey) {
|
|
537
|
+
throw new ValidationError("Private key not found for public key", {
|
|
538
|
+
field: "privateKey",
|
|
539
|
+
value: bytesToHex(publicKey)
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
tx.signIdx(privateKey, index);
|
|
543
|
+
}
|
|
522
544
|
};
|
|
523
545
|
|
|
524
546
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultSparkSigner
|
|
3
|
+
} from "./chunk-RFCXPGDM.js";
|
|
1
4
|
import {
|
|
2
5
|
Network,
|
|
3
6
|
NetworkToProto
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HK6LPV6Z.js";
|
|
5
8
|
import {
|
|
6
9
|
LOCAL_WALLET_CONFIG,
|
|
7
10
|
MAINNET_WALLET_CONFIG,
|
|
8
11
|
REGTEST_WALLET_CONFIG
|
|
9
12
|
} from "./chunk-ZUVYYR5T.js";
|
|
10
|
-
import {
|
|
11
|
-
DefaultSparkSigner
|
|
12
|
-
} from "./chunk-RAPBVYJY.js";
|
|
13
13
|
import {
|
|
14
14
|
ConfigurationError
|
|
15
15
|
} from "./chunk-TWF35O6M.js";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { B as BitcoinNetwork } from '../../BitcoinNetwork-TnABML0T.cjs';
|
|
2
2
|
import { Query } from '@lightsparkdev/core';
|
|
3
|
-
import { h as CurrencyAmount, P as PageInfo, D as SspClient } from '../../RequestLightningSendInput-
|
|
4
|
-
export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../../RequestLightningSendInput-
|
|
3
|
+
import { h as CurrencyAmount, P as PageInfo, D as SspClient } from '../../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
4
|
+
export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
5
5
|
export { L as LightningSendFeeEstimateInput } from '../../LightningSendFeeEstimateInput-CJvPnCSB.cjs';
|
|
6
|
-
import '../../signer-
|
|
6
|
+
import '../../signer-CYwn7h9U.cjs';
|
|
7
7
|
import '@scure/bip32';
|
|
8
8
|
import '../../spark-DXYE9gMM.cjs';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
11
|
import '@buildonspark/lrc20-sdk';
|
|
12
|
+
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
13
14
|
|
|
14
15
|
declare enum ClaimStaticDepositStatus {
|
|
15
16
|
/**
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { B as BitcoinNetwork } from '../../BitcoinNetwork-TnABML0T.js';
|
|
2
2
|
import { Query } from '@lightsparkdev/core';
|
|
3
|
-
import { h as CurrencyAmount, P as PageInfo, D as SspClient } from '../../RequestLightningSendInput-
|
|
4
|
-
export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../../RequestLightningSendInput-
|
|
3
|
+
import { h as CurrencyAmount, P as PageInfo, D as SspClient } from '../../RequestLightningSendInput-CJtcHOnu.js';
|
|
4
|
+
export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../../RequestLightningSendInput-CJtcHOnu.js';
|
|
5
5
|
export { L as LightningSendFeeEstimateInput } from '../../LightningSendFeeEstimateInput-CJvPnCSB.js';
|
|
6
|
-
import '../../signer-
|
|
6
|
+
import '../../signer-C5h1DpjF.js';
|
|
7
7
|
import '@scure/bip32';
|
|
8
8
|
import '../../spark-DXYE9gMM.js';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
11
|
import '@buildonspark/lrc20-sdk';
|
|
12
|
+
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
13
14
|
|
|
14
15
|
declare enum ClaimStaticDepositStatus {
|
|
15
16
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as LeavesSwapFeeEstimateOutput, z as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, n as LightningReceiveRequest, r as LightningSendRequest, E as ExitSpeed, f as CoopExitRequest, e as CoopExitFeeEstimatesOutput } from './RequestLightningSendInput-
|
|
2
|
-
import { h as SigningCommitment, V as VerifiableSecretShare, S as SparkSigner } from './signer-
|
|
1
|
+
import { j as LeavesSwapFeeEstimateOutput, z as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, n as LightningReceiveRequest, r as LightningSendRequest, E as ExitSpeed, f as CoopExitRequest, e as CoopExitFeeEstimatesOutput } from './RequestLightningSendInput-CJtcHOnu.js';
|
|
2
|
+
import { h as SigningCommitment, V as VerifiableSecretShare, S as SparkSigner } from './signer-C5h1DpjF.js';
|
|
3
3
|
import { L as LightningSendFeeEstimateInput } from './LightningSendFeeEstimateInput-CJvPnCSB.js';
|
|
4
4
|
import { h as RequestedSigningCommitments, U as UserSignedTxSigningJob, d as TreeNode, f as Transfer, L as LeafRefundTxSigningResult, i as NodeSignatures, F as FinalizeNodeSignaturesResponse, Q as QueryTransfersResponse, j as OutputWithPreviousTransactionData, k as TokenTransactionWithStatus } from './spark-DXYE9gMM.js';
|
|
5
5
|
import { WalletConfigService } from './services/config.js';
|
|
@@ -12,7 +12,7 @@ import { EventEmitter } from 'eventemitter3';
|
|
|
12
12
|
import { SparkAddressFormat } from './address/index.js';
|
|
13
13
|
import { a as WalletTransfer, W as WalletLeaf } from './sdk-types-BeI6DM_M.js';
|
|
14
14
|
import './utils/index.js';
|
|
15
|
-
import './network-
|
|
15
|
+
import './network-CCgyIsGl.js';
|
|
16
16
|
|
|
17
17
|
declare class SparkSDKError extends Error {
|
|
18
18
|
readonly context: Record<string, unknown>;
|
|
@@ -171,6 +171,7 @@ declare class BaseTransferService {
|
|
|
171
171
|
protected readonly signingService: SigningService;
|
|
172
172
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
173
173
|
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
174
|
+
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
174
175
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer>;
|
|
175
176
|
private prepareTransferPackage;
|
|
176
177
|
private finalizeTransfer;
|
|
@@ -224,6 +225,7 @@ declare class TransferService extends BaseTransferService {
|
|
|
224
225
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
225
226
|
refreshTimelockNodes(nodes: TreeNode[], parentNode: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
226
227
|
extendTimelock(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
228
|
+
refreshTimelockRefundTx(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
type CreateLightningInvoiceParams = {
|
|
@@ -317,7 +319,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
317
319
|
private getSspClient;
|
|
318
320
|
private handleStreamEvent;
|
|
319
321
|
protected setupBackgroundStream(): Promise<void>;
|
|
320
|
-
|
|
322
|
+
getLeaves(isBalanceCheck?: boolean): Promise<TreeNode[]>;
|
|
321
323
|
private selectLeaves;
|
|
322
324
|
private selectLeavesForSwap;
|
|
323
325
|
private areLeavesInefficient;
|
|
@@ -715,6 +717,18 @@ declare class SparkWallet extends EventEmitter {
|
|
|
715
717
|
* @returns {Promise<boolean>} Whether the message is valid
|
|
716
718
|
*/
|
|
717
719
|
validateMessageWithIdentityKey(message: string, signature: string | Uint8Array): Promise<boolean>;
|
|
720
|
+
/**
|
|
721
|
+
* Signs a transaction with wallet keys.
|
|
722
|
+
*
|
|
723
|
+
* @param {string} txHex - The transaction hex to sign
|
|
724
|
+
* @param {string} keyType - The type of key to use for signing ("identity", "deposit", or "auto-detect")
|
|
725
|
+
* @returns {Promise<string>} The signed transaction hex
|
|
726
|
+
*/
|
|
727
|
+
signTransaction(txHex: string, keyType?: string): Promise<string>;
|
|
728
|
+
/**
|
|
729
|
+
* Helper method to auto-detect which key should be used for signing a transaction.
|
|
730
|
+
*/
|
|
731
|
+
private detectKeyForTransaction;
|
|
718
732
|
/**
|
|
719
733
|
* Get a Lightning receive request by ID.
|
|
720
734
|
*
|
|
@@ -736,6 +750,30 @@ declare class SparkWallet extends EventEmitter {
|
|
|
736
750
|
* @returns {Promise<CoopExitRequest | null>} The coop exit request
|
|
737
751
|
*/
|
|
738
752
|
getCoopExitRequest(id: string): Promise<CoopExitRequest | null>;
|
|
753
|
+
/**
|
|
754
|
+
* Check the remaining timelock on a given node.
|
|
755
|
+
*
|
|
756
|
+
* @param {string} nodeId - The ID of the node to check
|
|
757
|
+
* @returns {Promise<{nodeTimelock: number, refundTimelock: number}>} The remaining timelocks in blocks for both node and refund transactions
|
|
758
|
+
*/
|
|
759
|
+
checkTimelock(nodeId: string): Promise<{
|
|
760
|
+
nodeTimelock: number;
|
|
761
|
+
refundTimelock: number;
|
|
762
|
+
}>;
|
|
763
|
+
/**
|
|
764
|
+
* Refresh the timelock of a specific node.
|
|
765
|
+
*
|
|
766
|
+
* @param {string} nodeId - The ID of the node to refresh
|
|
767
|
+
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
768
|
+
*/
|
|
769
|
+
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
770
|
+
/**
|
|
771
|
+
* Refresh the timelock of a specific node's refund transaction only.
|
|
772
|
+
*
|
|
773
|
+
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
774
|
+
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
775
|
+
*/
|
|
776
|
+
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
739
777
|
private cleanup;
|
|
740
778
|
cleanupConnections(): Promise<void>;
|
|
741
779
|
private startPeriodicClaimTransfers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as LeavesSwapFeeEstimateOutput, z as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, n as LightningReceiveRequest, r as LightningSendRequest, E as ExitSpeed, f as CoopExitRequest, e as CoopExitFeeEstimatesOutput } from './RequestLightningSendInput-
|
|
2
|
-
import { h as SigningCommitment, V as VerifiableSecretShare, S as SparkSigner } from './signer-
|
|
1
|
+
import { j as LeavesSwapFeeEstimateOutput, z as StaticDepositQuoteOutput, C as ClaimStaticDepositOutput, n as LightningReceiveRequest, r as LightningSendRequest, E as ExitSpeed, f as CoopExitRequest, e as CoopExitFeeEstimatesOutput } from './RequestLightningSendInput-DfmfqzZo.cjs';
|
|
2
|
+
import { h as SigningCommitment, V as VerifiableSecretShare, S as SparkSigner } from './signer-CYwn7h9U.cjs';
|
|
3
3
|
import { L as LightningSendFeeEstimateInput } from './LightningSendFeeEstimateInput-CJvPnCSB.cjs';
|
|
4
4
|
import { h as RequestedSigningCommitments, U as UserSignedTxSigningJob, d as TreeNode, f as Transfer, L as LeafRefundTxSigningResult, i as NodeSignatures, F as FinalizeNodeSignaturesResponse, Q as QueryTransfersResponse, j as OutputWithPreviousTransactionData, k as TokenTransactionWithStatus } from './spark-DXYE9gMM.cjs';
|
|
5
5
|
import { WalletConfigService } from './services/config.cjs';
|
|
@@ -12,7 +12,7 @@ import { EventEmitter } from 'eventemitter3';
|
|
|
12
12
|
import { SparkAddressFormat } from './address/index.cjs';
|
|
13
13
|
import { a as WalletTransfer, W as WalletLeaf } from './sdk-types-BuVMn2rX.cjs';
|
|
14
14
|
import './utils/index.cjs';
|
|
15
|
-
import './network-
|
|
15
|
+
import './network-B10hBoHp.cjs';
|
|
16
16
|
|
|
17
17
|
declare class SparkSDKError extends Error {
|
|
18
18
|
readonly context: Record<string, unknown>;
|
|
@@ -171,6 +171,7 @@ declare class BaseTransferService {
|
|
|
171
171
|
protected readonly signingService: SigningService;
|
|
172
172
|
constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
|
|
173
173
|
sendTransferTweakKey(transfer: Transfer, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
174
|
+
deliverTransferPackage(transfer: Transfer, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer>;
|
|
174
175
|
sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer>;
|
|
175
176
|
private prepareTransferPackage;
|
|
176
177
|
private finalizeTransfer;
|
|
@@ -224,6 +225,7 @@ declare class TransferService extends BaseTransferService {
|
|
|
224
225
|
queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
|
|
225
226
|
refreshTimelockNodes(nodes: TreeNode[], parentNode: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
226
227
|
extendTimelock(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
228
|
+
refreshTimelockRefundTx(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
type CreateLightningInvoiceParams = {
|
|
@@ -317,7 +319,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
317
319
|
private getSspClient;
|
|
318
320
|
private handleStreamEvent;
|
|
319
321
|
protected setupBackgroundStream(): Promise<void>;
|
|
320
|
-
|
|
322
|
+
getLeaves(isBalanceCheck?: boolean): Promise<TreeNode[]>;
|
|
321
323
|
private selectLeaves;
|
|
322
324
|
private selectLeavesForSwap;
|
|
323
325
|
private areLeavesInefficient;
|
|
@@ -715,6 +717,18 @@ declare class SparkWallet extends EventEmitter {
|
|
|
715
717
|
* @returns {Promise<boolean>} Whether the message is valid
|
|
716
718
|
*/
|
|
717
719
|
validateMessageWithIdentityKey(message: string, signature: string | Uint8Array): Promise<boolean>;
|
|
720
|
+
/**
|
|
721
|
+
* Signs a transaction with wallet keys.
|
|
722
|
+
*
|
|
723
|
+
* @param {string} txHex - The transaction hex to sign
|
|
724
|
+
* @param {string} keyType - The type of key to use for signing ("identity", "deposit", or "auto-detect")
|
|
725
|
+
* @returns {Promise<string>} The signed transaction hex
|
|
726
|
+
*/
|
|
727
|
+
signTransaction(txHex: string, keyType?: string): Promise<string>;
|
|
728
|
+
/**
|
|
729
|
+
* Helper method to auto-detect which key should be used for signing a transaction.
|
|
730
|
+
*/
|
|
731
|
+
private detectKeyForTransaction;
|
|
718
732
|
/**
|
|
719
733
|
* Get a Lightning receive request by ID.
|
|
720
734
|
*
|
|
@@ -736,6 +750,30 @@ declare class SparkWallet extends EventEmitter {
|
|
|
736
750
|
* @returns {Promise<CoopExitRequest | null>} The coop exit request
|
|
737
751
|
*/
|
|
738
752
|
getCoopExitRequest(id: string): Promise<CoopExitRequest | null>;
|
|
753
|
+
/**
|
|
754
|
+
* Check the remaining timelock on a given node.
|
|
755
|
+
*
|
|
756
|
+
* @param {string} nodeId - The ID of the node to check
|
|
757
|
+
* @returns {Promise<{nodeTimelock: number, refundTimelock: number}>} The remaining timelocks in blocks for both node and refund transactions
|
|
758
|
+
*/
|
|
759
|
+
checkTimelock(nodeId: string): Promise<{
|
|
760
|
+
nodeTimelock: number;
|
|
761
|
+
refundTimelock: number;
|
|
762
|
+
}>;
|
|
763
|
+
/**
|
|
764
|
+
* Refresh the timelock of a specific node.
|
|
765
|
+
*
|
|
766
|
+
* @param {string} nodeId - The ID of the node to refresh
|
|
767
|
+
* @returns {Promise<void>} Promise that resolves when the timelock is refreshed
|
|
768
|
+
*/
|
|
769
|
+
testOnly_expireTimelock(nodeId: string): Promise<void>;
|
|
770
|
+
/**
|
|
771
|
+
* Refresh the timelock of a specific node's refund transaction only.
|
|
772
|
+
*
|
|
773
|
+
* @param {string} nodeId - The ID of the node whose refund transaction to refresh
|
|
774
|
+
* @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
|
|
775
|
+
*/
|
|
776
|
+
testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
|
|
739
777
|
private cleanup;
|
|
740
778
|
cleanupConnections(): Promise<void>;
|
|
741
779
|
private startPeriodicClaimTransfers;
|