@buildonspark/spark-sdk 0.3.4 → 0.3.6
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/dist/bare/index.cjs +547 -1238
- package/dist/bare/index.d.cts +676 -79
- package/dist/bare/index.d.ts +676 -79
- package/dist/bare/index.js +543 -1058
- package/dist/chunk-EHKP3Y65.js +140 -0
- package/dist/chunk-FJ7LTA2O.js +605 -0
- package/dist/chunk-LIZFXQWK.js +7 -0
- package/dist/{chunk-KIQTO4FX.js → chunk-XPHYQ2L6.js} +8128 -8727
- package/dist/{client-DWml6sjL.d.cts → client-AHn11NHe.d.cts} +1 -1
- package/dist/{client-DBZ43pJT.d.ts → client-GOlkXliC.d.ts} +1 -1
- package/dist/debug.cjs +581 -1222
- package/dist/debug.d.cts +8 -8
- package/dist/debug.d.ts +8 -8
- package/dist/debug.js +5 -3
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/index.cjs +531 -1231
- package/dist/index.d.cts +7 -18
- package/dist/index.d.ts +7 -18
- package/dist/index.js +5 -4
- package/dist/index.node.cjs +1200 -1441
- package/dist/index.node.d.cts +6 -7
- package/dist/index.node.d.ts +6 -7
- package/dist/index.node.js +7 -66
- package/dist/{logging-BUpzk4Z6.d.cts → logging-CW3kwBaM.d.cts} +3 -3
- package/dist/{logging-Dt2ooQiP.d.ts → logging-D7ukPwRA.d.ts} +3 -3
- package/dist/native/{chunk-D3SZRO65.js → chunk-X2QXUON7.js} +15 -0
- package/dist/native/index.cjs +702 -1214
- package/dist/native/index.d.cts +1077 -477
- package/dist/native/index.d.ts +1077 -477
- package/dist/native/index.js +700 -1042
- package/dist/native/{wasm-KT5NZXRN.js → wasm-GKEDPGTM.js} +1 -2
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/{spark-DasxuVfm.d.cts → spark-WA_4wcBr.d.cts} +1 -1
- package/dist/{spark-DasxuVfm.d.ts → spark-WA_4wcBr.d.ts} +1 -1
- package/dist/{spark-wallet-jlC0XN5f.d.ts → spark-wallet-NxG55m7K.d.cts} +105 -74
- package/dist/{spark-wallet-BoMIOPWW.d.cts → spark-wallet-jwNvWvpK.d.ts} +105 -74
- package/dist/spark-wallet.browser-Cg4fB-Nm.d.ts +26 -0
- package/dist/spark-wallet.browser-Db7Y95Kt.d.cts +26 -0
- package/dist/spark-wallet.node-DB3ZqtJG.d.ts +90 -0
- package/dist/spark-wallet.node-HEG2ahNd.d.cts +90 -0
- package/dist/tests/test-utils.cjs +17560 -7615
- package/dist/tests/test-utils.d.cts +7 -21
- package/dist/tests/test-utils.d.ts +7 -21
- package/dist/tests/test-utils.js +30 -4
- package/dist/{token-transactions-DscJaJOE.d.ts → token-transactions-B2-BO7Oz.d.ts} +2 -2
- package/dist/{token-transactions-BDzCrQSk.d.cts → token-transactions-BAN68xwg.d.cts} +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +7 -13
- package/src/bare/index.ts +1 -1
- package/src/debug.ts +1 -1
- package/src/index.node.ts +2 -1
- package/src/index.ts +2 -1
- package/src/native/index.ts +3 -2
- package/src/services/connection/connection.browser.ts +130 -0
- package/src/services/connection/connection.node.ts +158 -0
- package/src/services/{connection.ts → connection/connection.ts} +48 -259
- package/src/services/coop-exit.ts +3 -3
- package/src/services/deposit.ts +1 -1
- package/src/services/index.ts +1 -1
- package/src/services/lightning.ts +1 -1
- package/src/services/token-transactions.ts +1 -1
- package/src/services/transfer.ts +1 -1
- package/src/spark-wallet/spark-wallet.bare.ts +12 -0
- package/src/spark-wallet/spark-wallet.browser.ts +10 -24
- package/src/spark-wallet/spark-wallet.node.ts +4 -24
- package/src/spark-wallet/spark-wallet.react-native.ts +15 -0
- package/src/spark-wallet/spark-wallet.ts +87 -75
- package/src/spark-wallet/types.ts +4 -2
- package/src/tests/integration/coop-exit.test.ts +3 -3
- package/src/tests/integration/lightning.test.ts +4 -4
- package/src/tests/integration/ssp/coop-exit-validation.test.ts +3 -5
- package/src/tests/integration/ssp/coop-exit.test.ts +3 -5
- package/src/tests/integration/ssp/lightning.test.ts +1 -1
- package/src/tests/integration/ssp/static-deposit-validation.test.ts +2 -2
- package/src/tests/integration/ssp/static_deposit.test.ts +49 -66
- package/src/tests/integration/ssp/swap.test.ts +4 -5
- package/src/tests/integration/ssp/transfers.test.ts +10 -11
- package/src/tests/integration/static_deposit.test.ts +4 -4
- package/src/tests/integration/token-output.test.ts +2 -2
- package/src/tests/integration/transfer.test.ts +30 -26
- package/src/tests/integration/watchtower.test.ts +3 -3
- package/src/tests/spark-wallet/queryNodes.test.ts +1 -2
- package/src/tests/test-utils.ts +3 -3
- package/src/tests/token-outputs.test.ts +1 -1
- package/src/tests/utils/spark-testing-wallet.ts +18 -58
- package/src/tests/utils/utils.ts +63 -0
- package/src/tests/wrapWithOtelSpan.test.ts +7 -0
- package/src/utils/network.ts +11 -10
- package/dist/bare/xhr-transport-EEEC7FYA.js +0 -165
- package/dist/chunk-YH7MDVTT.js +0 -70
- package/dist/native/chunk-C3WN3D4O.js +0 -19
- package/dist/native/xhr-transport-TNCG4HTW.js +0 -168
- package/dist/spark-wallet.node-07PksUHH.d.cts +0 -12
- package/dist/spark-wallet.node-CdWkKMSq.d.ts +0 -12
- package/dist/xhr-transport-IWJPYF7F.js +0 -167
package/dist/index.node.d.cts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
export { A as AuthenticationError, C as ConfigurationError, I as InternalValidationError, N as NetworkError, a as NotImplementedError, R as RPCError, S as SparkSDKError, T as TokenTransactionService, V as ValidationError } from './token-transactions-
|
|
2
|
-
export { B as Bech32mTokenIdentifier,
|
|
3
|
-
export { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, ai as LOGGER_NAMES, a5 as LeafInfo, aj as LoggerName, ak as SparkSdkLogger, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenIdentifier, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './logging-
|
|
4
|
-
export { A as AggregateFrostParams, D as DefaultSparkSigner, p as DerivedHDKey, l as KeyDerivation, K as KeyDerivationType, q as KeyPair, n as SignFrostParams, k as SigningCommitment, i as SigningCommitmentWithOptionalNonce, j as SigningNonce, S as SparkSigner, o as SplitSecretWithProofsParams, T as TaprootOutputKeysGenerator, a as TaprootSparkSigner, U as UnsafeStatelessSparkSigner, V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-
|
|
1
|
+
export { A as AuthenticationError, C as ConfigurationError, I as InternalValidationError, N as NetworkError, a as NotImplementedError, R as RPCError, S as SparkSDKError, T as TokenTransactionService, V as ValidationError } from './token-transactions-BAN68xwg.cjs';
|
|
2
|
+
export { C as BaseConnectionManager, B as Bech32mTokenIdentifier, w as Bech32mTokenIdentifierData, b as ConfigOptions, A as CreateLightningInvoiceParams, D as DecodedSparkAddressData, K as DepositParams, G as FulfillSparkInvoiceResponse, J as GroupSparkInvoicesResult, V as InitWalletResponse, I as InvalidInvoice, L as LegacySparkAddressFormat, N as Network, p as NetworkToProto, o as NetworkType, P as PayLightningInvoiceParams, R as RawTokenIdentifierHex, c as SparkAddressData, S as SparkAddressFormat, Y as SparkWalletEvent, Z as SparkWalletEventType, _ as SparkWalletEvents, X as SparkWalletProps, M as TokenBalanceMap, H as TokenInvoice, Q as TokenMetadataMap, O as TokenOutputsMap, T as TransferParams, F as TransferWithInvoiceOutcome, E as TransferWithInvoiceParams, U as UserTokenMetadata, a as WalletConfig, W as WalletConfigService, l as assertBech32, m as bech32mDecode, y as decodeBech32mTokenIdentifier, f as decodeSparkAddress, x as encodeBech32mTokenIdentifier, e as encodeSparkAddress, d as encodeSparkAddressWithSignature, r as getNetwork, s as getNetworkFromAddress, z as getNetworkFromBech32mTokenIdentifier, g as getNetworkFromSparkAddress, u as getNetworkFromString, i as isLegacySparkAddress, n as isSafeForNumber, j as isValidPublicKey, h as isValidSparkAddress, q as protoToNetwork, t as toProtoTimestamp, v as validateSparkInvoiceFields, k as validateSparkInvoiceSignature } from './spark-wallet-NxG55m7K.cjs';
|
|
3
|
+
export { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, ai as LOGGER_NAMES, a5 as LeafInfo, aj as LoggerName, ak as SparkSdkLogger, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenIdentifier, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './logging-CW3kwBaM.cjs';
|
|
4
|
+
export { A as AggregateFrostParams, D as DefaultSparkSigner, p as DerivedHDKey, l as KeyDerivation, K as KeyDerivationType, q as KeyPair, n as SignFrostParams, k as SigningCommitment, i as SigningCommitmentWithOptionalNonce, j as SigningNonce, S as SparkSigner, o as SplitSecretWithProofsParams, T as TaprootOutputKeysGenerator, a as TaprootSparkSigner, U as UnsafeStatelessSparkSigner, V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-AHn11NHe.cjs';
|
|
5
5
|
export { I as IKeyPackage } from './types-B3hMoTYO.cjs';
|
|
6
|
-
export { S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-
|
|
7
|
-
import './spark-
|
|
6
|
+
export { C as ConnectionManager, S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-HEG2ahNd.cjs';
|
|
7
|
+
import './spark-WA_4wcBr.cjs';
|
|
8
8
|
import '@bufbuild/protobuf/wire';
|
|
9
9
|
import 'nice-grpc-common';
|
|
10
10
|
import './proto/spark_token.cjs';
|
|
11
11
|
import '@scure/btc-signer';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
12
|
import 'nice-grpc';
|
|
14
13
|
import 'nice-grpc-web';
|
|
15
14
|
import '@scure/base';
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
export { A as AuthenticationError, C as ConfigurationError, I as InternalValidationError, N as NetworkError, a as NotImplementedError, R as RPCError, S as SparkSDKError, T as TokenTransactionService, V as ValidationError } from './token-transactions-
|
|
2
|
-
export { B as Bech32mTokenIdentifier,
|
|
3
|
-
export { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, ai as LOGGER_NAMES, a5 as LeafInfo, aj as LoggerName, ak as SparkSdkLogger, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenIdentifier, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './logging-
|
|
4
|
-
export { A as AggregateFrostParams, D as DefaultSparkSigner, p as DerivedHDKey, l as KeyDerivation, K as KeyDerivationType, q as KeyPair, n as SignFrostParams, k as SigningCommitment, i as SigningCommitmentWithOptionalNonce, j as SigningNonce, S as SparkSigner, o as SplitSecretWithProofsParams, T as TaprootOutputKeysGenerator, a as TaprootSparkSigner, U as UnsafeStatelessSparkSigner, V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-
|
|
1
|
+
export { A as AuthenticationError, C as ConfigurationError, I as InternalValidationError, N as NetworkError, a as NotImplementedError, R as RPCError, S as SparkSDKError, T as TokenTransactionService, V as ValidationError } from './token-transactions-B2-BO7Oz.js';
|
|
2
|
+
export { C as BaseConnectionManager, B as Bech32mTokenIdentifier, w as Bech32mTokenIdentifierData, b as ConfigOptions, A as CreateLightningInvoiceParams, D as DecodedSparkAddressData, K as DepositParams, G as FulfillSparkInvoiceResponse, J as GroupSparkInvoicesResult, V as InitWalletResponse, I as InvalidInvoice, L as LegacySparkAddressFormat, N as Network, p as NetworkToProto, o as NetworkType, P as PayLightningInvoiceParams, R as RawTokenIdentifierHex, c as SparkAddressData, S as SparkAddressFormat, Y as SparkWalletEvent, Z as SparkWalletEventType, _ as SparkWalletEvents, X as SparkWalletProps, M as TokenBalanceMap, H as TokenInvoice, Q as TokenMetadataMap, O as TokenOutputsMap, T as TransferParams, F as TransferWithInvoiceOutcome, E as TransferWithInvoiceParams, U as UserTokenMetadata, a as WalletConfig, W as WalletConfigService, l as assertBech32, m as bech32mDecode, y as decodeBech32mTokenIdentifier, f as decodeSparkAddress, x as encodeBech32mTokenIdentifier, e as encodeSparkAddress, d as encodeSparkAddressWithSignature, r as getNetwork, s as getNetworkFromAddress, z as getNetworkFromBech32mTokenIdentifier, g as getNetworkFromSparkAddress, u as getNetworkFromString, i as isLegacySparkAddress, n as isSafeForNumber, j as isValidPublicKey, h as isValidSparkAddress, q as protoToNetwork, t as toProtoTimestamp, v as validateSparkInvoiceFields, k as validateSparkInvoiceSignature } from './spark-wallet-jwNvWvpK.js';
|
|
3
|
+
export { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, ai as LOGGER_NAMES, a5 as LeafInfo, aj as LoggerName, ak as SparkSdkLogger, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenIdentifier, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './logging-D7ukPwRA.js';
|
|
4
|
+
export { A as AggregateFrostParams, D as DefaultSparkSigner, p as DerivedHDKey, l as KeyDerivation, K as KeyDerivationType, q as KeyPair, n as SignFrostParams, k as SigningCommitment, i as SigningCommitmentWithOptionalNonce, j as SigningNonce, S as SparkSigner, o as SplitSecretWithProofsParams, T as TaprootOutputKeysGenerator, a as TaprootSparkSigner, U as UnsafeStatelessSparkSigner, V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-GOlkXliC.js';
|
|
5
5
|
export { I as IKeyPackage } from './types-B3hMoTYO.js';
|
|
6
|
-
export { S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-
|
|
7
|
-
import './spark-
|
|
6
|
+
export { C as ConnectionManager, S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-DB3ZqtJG.js';
|
|
7
|
+
import './spark-WA_4wcBr.js';
|
|
8
8
|
import '@bufbuild/protobuf/wire';
|
|
9
9
|
import 'nice-grpc-common';
|
|
10
10
|
import './proto/spark_token.js';
|
|
11
11
|
import '@scure/btc-signer';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
12
|
import 'nice-grpc';
|
|
14
13
|
import 'nice-grpc-web';
|
|
15
14
|
import '@scure/base';
|
package/dist/index.node.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConnectionManagerNodeJS,
|
|
3
|
+
SparkWalletNodeJS,
|
|
4
|
+
initializeTracerEnvNodeJS
|
|
5
|
+
} from "./chunk-FJ7LTA2O.js";
|
|
1
6
|
import {
|
|
2
7
|
AuthenticationError,
|
|
3
8
|
ConfigurationError,
|
|
@@ -8,14 +13,12 @@ import {
|
|
|
8
13
|
INITIAL_SEQUENCE,
|
|
9
14
|
InternalValidationError,
|
|
10
15
|
KeyDerivationType,
|
|
11
|
-
LRC_WALLET_NETWORK,
|
|
12
16
|
Network,
|
|
13
17
|
NetworkError,
|
|
14
18
|
NetworkToProto,
|
|
15
19
|
NotImplementedError,
|
|
16
20
|
RPCError,
|
|
17
21
|
SparkSDKError,
|
|
18
|
-
SparkWallet,
|
|
19
22
|
SparkWalletEvent,
|
|
20
23
|
TEST_UNILATERAL_DIRECT_SEQUENCE,
|
|
21
24
|
TEST_UNILATERAL_SEQUENCE,
|
|
@@ -115,7 +118,7 @@ import {
|
|
|
115
118
|
validateShare,
|
|
116
119
|
validateSparkInvoiceFields,
|
|
117
120
|
validateSparkInvoiceSignature
|
|
118
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-XPHYQ2L6.js";
|
|
119
122
|
import {
|
|
120
123
|
LOGGER_NAMES,
|
|
121
124
|
SparkSdkLogger
|
|
@@ -128,73 +131,12 @@ import "./chunk-MVRQ5US7.js";
|
|
|
128
131
|
|
|
129
132
|
// src/index.node.ts
|
|
130
133
|
import nodeCrypto from "crypto";
|
|
131
|
-
|
|
132
|
-
// src/spark-wallet/spark-wallet.node.ts
|
|
133
|
-
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
134
|
-
import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
|
|
135
|
-
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
136
|
-
import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
137
|
-
import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici";
|
|
138
|
-
var SparkWalletNodeJS = class _SparkWalletNodeJS extends SparkWallet {
|
|
139
|
-
static async initialize({
|
|
140
|
-
mnemonicOrSeed,
|
|
141
|
-
accountNumber,
|
|
142
|
-
signer,
|
|
143
|
-
options
|
|
144
|
-
}) {
|
|
145
|
-
const wallet = new _SparkWalletNodeJS(options, signer);
|
|
146
|
-
wallet.initializeTracer(wallet);
|
|
147
|
-
if (options && options.signerWithPreExistingKeys) {
|
|
148
|
-
await wallet.initWalletWithoutSeed();
|
|
149
|
-
return {
|
|
150
|
-
wallet
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
|
|
154
|
-
return {
|
|
155
|
-
wallet,
|
|
156
|
-
...initResponse
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
initializeTracerEnv({
|
|
160
|
-
spanProcessors,
|
|
161
|
-
traceUrls
|
|
162
|
-
}) {
|
|
163
|
-
initializeTracerEnvNodeJS({ spanProcessors, traceUrls });
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
function initializeTracerEnvNodeJS({
|
|
167
|
-
spanProcessors,
|
|
168
|
-
traceUrls
|
|
169
|
-
}) {
|
|
170
|
-
const provider = new NodeTracerProvider({ spanProcessors });
|
|
171
|
-
provider.register({
|
|
172
|
-
contextManager: new AsyncLocalStorageContextManager(),
|
|
173
|
-
propagator: new W3CTraceContextPropagator()
|
|
174
|
-
});
|
|
175
|
-
registerInstrumentations({
|
|
176
|
-
instrumentations: [
|
|
177
|
-
new UndiciInstrumentation({
|
|
178
|
-
ignoreRequestHook: (request) => {
|
|
179
|
-
try {
|
|
180
|
-
return !traceUrls.some(
|
|
181
|
-
(prefix) => request.origin.startsWith(prefix)
|
|
182
|
-
);
|
|
183
|
-
} catch {
|
|
184
|
-
return true;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/index.node.ts
|
|
193
134
|
var cryptoImpl = typeof global !== "undefined" && global.crypto ? global.crypto : nodeCrypto;
|
|
194
135
|
setCrypto(cryptoImpl);
|
|
195
136
|
export {
|
|
196
137
|
AuthenticationError,
|
|
197
138
|
ConfigurationError,
|
|
139
|
+
ConnectionManagerNodeJS as ConnectionManager,
|
|
198
140
|
DEFAULT_FEE_SATS,
|
|
199
141
|
DIRECT_TIMELOCK_OFFSET,
|
|
200
142
|
DefaultSparkSigner,
|
|
@@ -203,7 +145,6 @@ export {
|
|
|
203
145
|
InternalValidationError,
|
|
204
146
|
KeyDerivationType,
|
|
205
147
|
LOGGER_NAMES,
|
|
206
|
-
LRC_WALLET_NETWORK,
|
|
207
148
|
Network,
|
|
208
149
|
NetworkError,
|
|
209
150
|
NetworkToProto,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as btc from '@scure/btc-signer';
|
|
2
2
|
import { Transaction } from '@scure/btc-signer';
|
|
3
3
|
import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
|
|
4
|
-
import { N as Network,
|
|
5
|
-
import { j as SigningNonce, k as SigningCommitment } from './client-
|
|
6
|
-
import { O as OutputWithPreviousTransactionData,
|
|
4
|
+
import { N as Network, O as TokenOutputsMap, B as Bech32mTokenIdentifier, M as TokenBalanceMap, S as SparkAddressFormat } from './spark-wallet-NxG55m7K.cjs';
|
|
5
|
+
import { j as SigningNonce, k as SigningCommitment } from './client-AHn11NHe.cjs';
|
|
6
|
+
import { O as OutputWithPreviousTransactionData, h as TransferPackage, d as SparkServiceClient } from './spark-WA_4wcBr.cjs';
|
|
7
7
|
import { Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
8
8
|
|
|
9
9
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as btc from '@scure/btc-signer';
|
|
2
2
|
import { Transaction } from '@scure/btc-signer';
|
|
3
3
|
import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
|
|
4
|
-
import { N as Network,
|
|
5
|
-
import { j as SigningNonce, k as SigningCommitment } from './client-
|
|
6
|
-
import { O as OutputWithPreviousTransactionData,
|
|
4
|
+
import { N as Network, O as TokenOutputsMap, B as Bech32mTokenIdentifier, M as TokenBalanceMap, S as SparkAddressFormat } from './spark-wallet-jwNvWvpK.js';
|
|
5
|
+
import { j as SigningNonce, k as SigningCommitment } from './client-GOlkXliC.js';
|
|
6
|
+
import { O as OutputWithPreviousTransactionData, h as TransferPackage, d as SparkServiceClient } from './spark-WA_4wcBr.js';
|
|
7
7
|
import { Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
8
8
|
|
|
9
9
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
require("react-native-get-random-values");
|
|
2
2
|
|
|
3
|
+
// buffer.js
|
|
4
|
+
import { Buffer } from "buffer";
|
|
5
|
+
if (typeof globalThis.Buffer === "undefined") {
|
|
6
|
+
globalThis.Buffer = Buffer;
|
|
7
|
+
}
|
|
8
|
+
if (typeof window !== "undefined") {
|
|
9
|
+
if (typeof window.global === "undefined") {
|
|
10
|
+
window.global = window;
|
|
11
|
+
}
|
|
12
|
+
if (typeof window.globalThis === "undefined") {
|
|
13
|
+
window.globalThis = window;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
3
17
|
// src/utils/logging.ts
|
|
4
18
|
import { Logger } from "@lightsparkdev/core";
|
|
5
19
|
var LOGGER_NAMES = {
|
|
@@ -31,6 +45,7 @@ var SparkSdkLogger = class {
|
|
|
31
45
|
};
|
|
32
46
|
|
|
33
47
|
export {
|
|
48
|
+
Buffer,
|
|
34
49
|
LOGGER_NAMES,
|
|
35
50
|
SparkSdkLogger
|
|
36
51
|
};
|