@buildonspark/spark-sdk 0.1.43 → 0.1.44
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 +7 -0
- package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-BxbCtwpV.d.cts} +43 -4
- package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-RGel43ks.d.ts} +43 -4
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +2 -2
- package/dist/{chunk-M6A4KFIG.js → chunk-4Q2ZDYYU.js} +332 -221
- package/dist/{chunk-WWOTVNPP.js → chunk-A2ZLMH6I.js} +323 -142
- package/dist/{chunk-VA7MV4MZ.js → chunk-B3AMIGJG.js} +1 -1
- package/dist/{chunk-DQYKQJRZ.js → chunk-CIZNCBKE.js} +29 -9
- package/dist/{chunk-BUTZWYBW.js → chunk-DAXGVPVM.js} +2 -2
- package/dist/{chunk-DOA6QXYQ.js → chunk-EKFD62HN.js} +2 -1
- package/dist/{chunk-TIUBYNN5.js → chunk-HTMXTJRK.js} +1 -1
- package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
- package/dist/{chunk-MIVX3GHD.js → chunk-K4BJARWM.js} +1 -1
- package/dist/{chunk-O4RYNJNB.js → chunk-KEKGSH7B.js} +1 -1
- package/dist/{chunk-GYQR4B4P.js → chunk-NBCNYDWJ.js} +2 -2
- package/dist/{chunk-ABZA6R5S.js → chunk-SQKXGAIR.js} +1 -1
- package/dist/{chunk-VFJQNBFX.js → chunk-UBT6EDVJ.js} +5 -2
- package/dist/{chunk-HRQRRDSS.js → chunk-WPTRVD2V.js} +3 -3
- package/dist/{chunk-IRW5TWMH.js → chunk-XX4RRWOX.js} +5 -5
- package/dist/graphql/objects/index.d.cts +5 -43
- package/dist/graphql/objects/index.d.ts +5 -43
- package/dist/graphql/objects/index.js +1 -1
- package/dist/{index-BJOc8Ur-.d.cts → index-CZmDdSts.d.cts} +24 -10
- package/dist/{index-7RYRH5wc.d.ts → index-ClIRO_3y.d.ts} +24 -10
- package/dist/index.cjs +827 -414
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +15 -15
- package/dist/index.node.cjs +830 -417
- package/dist/index.node.d.cts +7 -7
- package/dist/index.node.d.ts +7 -7
- package/dist/index.node.js +18 -18
- package/dist/native/index.cjs +827 -414
- package/dist/native/index.d.cts +88 -23
- package/dist/native/index.d.ts +88 -23
- package/dist/native/index.js +819 -407
- package/dist/{network-D5lKssVl.d.cts → network-CfxLnaot.d.cts} +1 -1
- package/dist/{network-xkBSpaTn.d.ts → network-CroCOQ0B.d.ts} +1 -1
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +2 -2
- package/dist/proto/spark.cjs +332 -221
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +3 -5
- package/dist/proto/spark_token.cjs +149 -9
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-BeCBoozO.d.cts} +1 -1
- package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-CTbTdDbE.d.ts} +1 -1
- package/dist/services/config.cjs +7 -3
- 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.cjs +334 -218
- package/dist/services/connection.d.cts +4 -4
- package/dist/services/connection.d.ts +4 -4
- package/dist/services/connection.js +4 -4
- package/dist/services/index.cjs +364 -227
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +9 -9
- package/dist/services/lrc-connection.cjs +5 -2
- package/dist/services/lrc-connection.d.cts +4 -4
- package/dist/services/lrc-connection.d.ts +4 -4
- package/dist/services/lrc-connection.js +4 -4
- package/dist/services/token-transactions.cjs +28 -8
- 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.cjs +2 -1
- package/dist/services/wallet-config.d.cts +4 -4
- package/dist/services/wallet-config.d.ts +4 -4
- package/dist/services/wallet-config.js +1 -1
- package/dist/signer/signer.cjs +5 -2
- package/dist/signer/signer.d.cts +2 -2
- package/dist/signer/signer.d.ts +2 -2
- package/dist/signer/signer.js +2 -2
- package/dist/{signer-wqesWifN.d.ts → signer-D7vfYik9.d.ts} +1 -1
- package/dist/{signer-IO3oMRNj.d.cts → signer-DaY8c60s.d.cts} +1 -1
- package/dist/{spark-CDm4gqS6.d.ts → spark-C4ZrsgjC.d.cts} +47 -29
- package/dist/{spark-CDm4gqS6.d.cts → spark-C4ZrsgjC.d.ts} +47 -29
- package/dist/types/index.cjs +331 -219
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +3 -3
- package/dist/utils/index.cjs +298 -28
- package/dist/utils/index.d.cts +5 -5
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +6 -6
- package/package.json +1 -1
- package/src/constants.ts +5 -1
- package/src/graphql/client.ts +28 -0
- package/src/graphql/mutations/RequestCoopExit.ts +6 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
- package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
- package/src/proto/spark.ts +454 -322
- package/src/services/token-transactions.ts +12 -0
- package/src/services/transfer.ts +0 -3
- package/src/services/wallet-config.ts +1 -0
- package/src/spark-wallet/spark-wallet.node.ts +3 -3
- package/src/spark-wallet/spark-wallet.ts +301 -125
- package/src/tests/integration/deposit.test.ts +16 -0
- package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
- package/src/tests/integration/ssp/swap.test.ts +47 -0
- package/src/tests/tokens.test.ts +3 -2
- package/src/utils/token-hashing.ts +28 -10
- package/src/utils/transaction.ts +2 -2
- package/src/logger.ts +0 -3
package/dist/index.node.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { S as SparkWallet$1, I as InitWalletResponse } from './index-
|
|
2
|
-
export { A as AuthenticationError, C as ConfigurationError, e as CreateLightningInvoiceParams, D as DepositParams, b as InternalValidationError, N as NetworkError, d as NotImplementedError, P as PayLightningInvoiceParams, R as RPCError, a as SparkSDKError, h as SparkWalletEvents, g as SparkWalletProps, f as TokenInfo, T as TransferParams, V as ValidationError, c as createDummyTx } from './index-
|
|
1
|
+
import { S as SparkWallet$1, I as InitWalletResponse } from './index-CZmDdSts.cjs';
|
|
2
|
+
export { A as AuthenticationError, C as ConfigurationError, e as CreateLightningInvoiceParams, D as DepositParams, b as InternalValidationError, N as NetworkError, d as NotImplementedError, P as PayLightningInvoiceParams, R as RPCError, a as SparkSDKError, h as SparkWalletEvents, g as SparkWalletProps, f as TokenInfo, T as TransferParams, V as ValidationError, c as createDummyTx } from './index-CZmDdSts.cjs';
|
|
3
3
|
export { BroadcastConfig, BroadcastResult, DEFAULT_FEE_SATS, FeeBumpTxChain, FeeBumpTxPackage, FeeRate, LeafInfo, TxChain, Utxo, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, lastKeyWithTarget, maybeApplyFee, proofOfPossessionMessageHashForDepositAddress, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature } from './utils/index.cjs';
|
|
4
|
-
export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from './network-
|
|
5
|
-
export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-
|
|
6
|
-
import './RequestLightningSendInput-
|
|
4
|
+
export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from './network-CfxLnaot.cjs';
|
|
5
|
+
export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-DaY8c60s.cjs';
|
|
6
|
+
import './RequestLightningSendInput-BxbCtwpV.cjs';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import './BitcoinNetwork-TnABML0T.cjs';
|
|
9
9
|
import './LightningSendFeeEstimateInput-BgOhEAI-.cjs';
|
|
10
|
-
import './spark-
|
|
10
|
+
import './spark-C4ZrsgjC.cjs';
|
|
11
11
|
import '@bufbuild/protobuf/wire';
|
|
12
12
|
import 'nice-grpc-common';
|
|
13
13
|
import './services/config.cjs';
|
|
@@ -22,7 +22,7 @@ import './proto/lrc20.cjs';
|
|
|
22
22
|
import '@scure/btc-signer';
|
|
23
23
|
import 'eventemitter3';
|
|
24
24
|
import './address/index.cjs';
|
|
25
|
-
import './sdk-types-
|
|
25
|
+
import './sdk-types-BeCBoozO.cjs';
|
|
26
26
|
import '@scure/btc-signer/psbt';
|
|
27
27
|
import 'bitcoinjs-lib';
|
|
28
28
|
import '@scure/bip32';
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { S as SparkWallet$1, I as InitWalletResponse } from './index-
|
|
2
|
-
export { A as AuthenticationError, C as ConfigurationError, e as CreateLightningInvoiceParams, D as DepositParams, b as InternalValidationError, N as NetworkError, d as NotImplementedError, P as PayLightningInvoiceParams, R as RPCError, a as SparkSDKError, h as SparkWalletEvents, g as SparkWalletProps, f as TokenInfo, T as TransferParams, V as ValidationError, c as createDummyTx } from './index-
|
|
1
|
+
import { S as SparkWallet$1, I as InitWalletResponse } from './index-ClIRO_3y.js';
|
|
2
|
+
export { A as AuthenticationError, C as ConfigurationError, e as CreateLightningInvoiceParams, D as DepositParams, b as InternalValidationError, N as NetworkError, d as NotImplementedError, P as PayLightningInvoiceParams, R as RPCError, a as SparkSDKError, h as SparkWalletEvents, g as SparkWalletProps, f as TokenInfo, T as TransferParams, V as ValidationError, c as createDummyTx } from './index-ClIRO_3y.js';
|
|
3
3
|
export { BroadcastConfig, BroadcastResult, DEFAULT_FEE_SATS, FeeBumpTxChain, FeeBumpTxPackage, FeeRate, LeafInfo, TxChain, Utxo, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, lastKeyWithTarget, maybeApplyFee, proofOfPossessionMessageHashForDepositAddress, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature } from './utils/index.js';
|
|
4
|
-
export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from './network-
|
|
5
|
-
export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-
|
|
6
|
-
import './RequestLightningSendInput-
|
|
4
|
+
export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, N as Network, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from './network-CroCOQ0B.js';
|
|
5
|
+
export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from './signer-D7vfYik9.js';
|
|
6
|
+
import './RequestLightningSendInput-RGel43ks.js';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import './BitcoinNetwork-TnABML0T.js';
|
|
9
9
|
import './LightningSendFeeEstimateInput-BgOhEAI-.js';
|
|
10
|
-
import './spark-
|
|
10
|
+
import './spark-C4ZrsgjC.js';
|
|
11
11
|
import '@bufbuild/protobuf/wire';
|
|
12
12
|
import 'nice-grpc-common';
|
|
13
13
|
import './services/config.js';
|
|
@@ -22,7 +22,7 @@ import './proto/lrc20.js';
|
|
|
22
22
|
import '@scure/btc-signer';
|
|
23
23
|
import 'eventemitter3';
|
|
24
24
|
import './address/index.js';
|
|
25
|
-
import './sdk-types-
|
|
25
|
+
import './sdk-types-CTbTdDbE.js';
|
|
26
26
|
import '@scure/btc-signer/psbt';
|
|
27
27
|
import 'bitcoinjs-lib';
|
|
28
28
|
import '@scure/bip32';
|
package/dist/index.node.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SparkWallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A2ZLMH6I.js";
|
|
4
4
|
import {
|
|
5
5
|
createDummyTx
|
|
6
6
|
} from "./chunk-K4C4W5FC.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-WPTRVD2V.js";
|
|
8
|
+
import "./chunk-NBCNYDWJ.js";
|
|
9
|
+
import "./chunk-CIZNCBKE.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_FEE_SATS,
|
|
12
12
|
checkIfValidSequence,
|
|
@@ -35,20 +35,20 @@ import {
|
|
|
35
35
|
isTxBroadcast,
|
|
36
36
|
maybeApplyFee,
|
|
37
37
|
proofOfPossessionMessageHashForDepositAddress
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-XX4RRWOX.js";
|
|
39
39
|
import {
|
|
40
40
|
calculateAvailableTokenAmount,
|
|
41
41
|
checkIfSelectedOutputsAreAvailable,
|
|
42
42
|
collectResponses,
|
|
43
43
|
filterTokenBalanceForTokenPublicKey
|
|
44
44
|
} from "./chunk-6AFUC5M2.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-K4BJARWM.js";
|
|
46
|
+
import "./chunk-I54FARY2.js";
|
|
47
47
|
import "./chunk-L3EHBOUX.js";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-KEKGSH7B.js";
|
|
49
|
+
import "./chunk-SQKXGAIR.js";
|
|
50
|
+
import "./chunk-B3AMIGJG.js";
|
|
51
|
+
import "./chunk-DAXGVPVM.js";
|
|
52
52
|
import {
|
|
53
53
|
LRC_WALLET_NETWORK,
|
|
54
54
|
LRC_WALLET_NETWORK_TYPE,
|
|
@@ -58,11 +58,11 @@ import {
|
|
|
58
58
|
getNetworkFromAddress,
|
|
59
59
|
getNetworkFromString
|
|
60
60
|
} from "./chunk-Z5HIAYFT.js";
|
|
61
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-EKFD62HN.js";
|
|
62
62
|
import "./chunk-HMLOC6TE.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-4Q2ZDYYU.js";
|
|
64
|
+
import "./chunk-HTMXTJRK.js";
|
|
65
|
+
import "./chunk-UBT6EDVJ.js";
|
|
66
66
|
import {
|
|
67
67
|
addPrivateKeys,
|
|
68
68
|
addPublicKeys,
|
|
@@ -206,9 +206,9 @@ var SparkWallet2 = class extends SparkWallet {
|
|
|
206
206
|
"SparkWallet.withdraw",
|
|
207
207
|
this.withdraw.bind(this)
|
|
208
208
|
);
|
|
209
|
-
this.
|
|
210
|
-
"SparkWallet.
|
|
211
|
-
this.
|
|
209
|
+
this.getWithdrawalFeeQuote = this.wrapWithOtelSpan(
|
|
210
|
+
"SparkWallet.getWithdrawalFeeQuote",
|
|
211
|
+
this.getWithdrawalFeeQuote.bind(this)
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
214
|
async initWallet(mnemonicOrSeed, accountNumber) {
|