@buildonspark/spark-sdk 0.2.10 → 0.2.11
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 +9 -1
- package/dist/bare/chunk-P6AVV7VD.js +34 -0
- package/dist/bare/index.cjs +337 -271
- package/dist/bare/index.d.cts +15 -2
- package/dist/bare/index.d.ts +15 -2
- package/dist/bare/index.js +51 -42
- package/dist/bare/{wasm-OPXXYRN5.js → wasm-F5QFVBNZ.js} +26 -0
- package/dist/bare/{xhr-transport-6GYJAFWU.js → xhr-transport-EEEC7FYA.js} +2 -2
- package/dist/{chunk-MWBK6QBF.js → chunk-3WBPICWC.js} +1 -1
- package/dist/chunk-NX5KPN5F.js +34 -0
- package/dist/{chunk-JXLWOQK5.js → chunk-QNYJGFPD.js} +49 -41
- package/dist/debug.cjs +333 -268
- package/dist/debug.d.cts +5 -2
- package/dist/debug.d.ts +5 -2
- package/dist/debug.js +2 -1
- package/dist/index.cjs +386 -319
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -2
- package/dist/index.node.cjs +386 -319
- package/dist/index.node.d.cts +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.js +7 -1
- package/dist/{xchain-address-CNQEwLjR.d.cts → logging-BOAzMqpM.d.cts} +15 -1
- package/dist/{xchain-address-BPwpnmuY.d.ts → logging-Bt_WdZbu.d.ts} +15 -1
- package/dist/native/chunk-D3SZRO65.js +36 -0
- package/dist/native/index.cjs +383 -316
- package/dist/native/index.d.cts +15 -2
- package/dist/native/index.d.ts +15 -2
- package/dist/native/index.js +143 -135
- package/dist/native/{wasm-2KV6XFEP.js → wasm-3YAXKQ7F.js} +25 -0
- package/dist/native/{xhr-transport-WHMS3FGG.js → xhr-transport-TNCG4HTW.js} +2 -2
- package/dist/spark_bindings/wasm/index.cjs +51 -0
- package/dist/spark_bindings/wasm/index.js +25 -0
- package/dist/tests/test-utils.cjs +229 -166
- package/dist/tests/test-utils.js +3 -2
- package/dist/{xhr-transport-RH6LDRXS.js → xhr-transport-IWJPYF7F.js} +2 -2
- package/package.json +1 -1
- package/src/services/deposit.ts +5 -1
- package/src/services/xhr-transport.ts +2 -2
- package/src/spark_bindings/wasm/index.ts +21 -0
- package/src/tests/integration/ssp/coop-exit-validation.test.ts +2 -2
- package/src/tests/integration/ssp/static_deposit.test.ts +0 -32
- package/src/tests/integration/watchtower.test.ts +2 -2
- package/src/utils/adaptor-signature.ts +11 -12
- package/src/utils/address.ts +10 -10
- package/src/utils/bitcoin.ts +6 -6
- package/src/utils/index.ts +1 -0
- package/src/utils/keys.ts +9 -9
- package/src/utils/logging.ts +40 -0
- package/src/utils/secret-sharing.ts +9 -11
package/dist/index.node.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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-CwhlOgIP.cjs';
|
|
2
2
|
export { B as Bech32mTokenIdentifier, r as Bech32mTokenIdentifierData, b as ConfigOptions, C as ConnectionManager, x as CreateLightningInvoiceParams, D as DecodedSparkAddressData, y as DepositParams, I as InitWalletResponse, L as LRC_WALLET_NETWORK, N as Network, m as NetworkToProto, l as NetworkType, P as PayLightningInvoiceParams, R as RawTokenIdentifierHex, c as SparkAddressData, S as SparkAddressFormat, G as SparkWalletEvents, F as SparkWalletProps, z as TokenBalanceMap, E as TokenMetadataMap, A as TokenOutputsMap, T as TransferParams, U as UserTokenMetadata, a as WalletConfig, W as WalletConfigService, k as bech32mDecode, u as decodeBech32mTokenIdentifier, f as decodeSparkAddress, s as encodeBech32mTokenIdentifier, e as encodeSparkAddress, d as encodeSparkAddressWithSignature, n as getNetwork, o as getNetworkFromAddress, w as getNetworkFromBech32mTokenIdentifier, j as getNetworkFromSparkAddress, q as getNetworkFromString, g as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, t as toProtoTimestamp, v as validateSparkInvoiceFields, h as validateSparkInvoiceSignature } from './spark-wallet-yc2KhsVY.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, a5 as LeafInfo, 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 './
|
|
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-BOAzMqpM.cjs';
|
|
4
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-B9CAWKWz.cjs';
|
|
5
5
|
export { I as IKeyPackage } from './types-B3hMoTYO.cjs';
|
|
6
6
|
export { S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-D0Qw5Wb4.cjs';
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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-0nmR9mQO.js';
|
|
2
2
|
export { B as Bech32mTokenIdentifier, r as Bech32mTokenIdentifierData, b as ConfigOptions, C as ConnectionManager, x as CreateLightningInvoiceParams, D as DecodedSparkAddressData, y as DepositParams, I as InitWalletResponse, L as LRC_WALLET_NETWORK, N as Network, m as NetworkToProto, l as NetworkType, P as PayLightningInvoiceParams, R as RawTokenIdentifierHex, c as SparkAddressData, S as SparkAddressFormat, G as SparkWalletEvents, F as SparkWalletProps, z as TokenBalanceMap, E as TokenMetadataMap, A as TokenOutputsMap, T as TransferParams, U as UserTokenMetadata, a as WalletConfig, W as WalletConfigService, k as bech32mDecode, u as decodeBech32mTokenIdentifier, f as decodeSparkAddress, s as encodeBech32mTokenIdentifier, e as encodeSparkAddress, d as encodeSparkAddressWithSignature, n as getNetwork, o as getNetworkFromAddress, w as getNetworkFromBech32mTokenIdentifier, j as getNetworkFromSparkAddress, q as getNetworkFromString, g as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, t as toProtoTimestamp, v as validateSparkInvoiceFields, h as validateSparkInvoiceSignature } from './spark-wallet-Cp3yv6cK.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, a5 as LeafInfo, 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 './
|
|
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-Bt_WdZbu.js';
|
|
4
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-Dd3QnxQu.js';
|
|
5
5
|
export { I as IKeyPackage } from './types-B3hMoTYO.js';
|
|
6
6
|
export { S as SparkWallet, i as initializeTracerEnv } from './spark-wallet.node-D4IovOHu.js';
|
package/dist/index.node.js
CHANGED
|
@@ -112,7 +112,11 @@ import {
|
|
|
112
112
|
validateShare,
|
|
113
113
|
validateSparkInvoiceFields,
|
|
114
114
|
validateSparkInvoiceSignature
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-QNYJGFPD.js";
|
|
116
|
+
import {
|
|
117
|
+
LOGGER_NAMES,
|
|
118
|
+
SparkSdkLogger
|
|
119
|
+
} from "./chunk-NX5KPN5F.js";
|
|
116
120
|
import "./chunk-6CMNEDBK.js";
|
|
117
121
|
import "./chunk-76SYPHOC.js";
|
|
118
122
|
import "./chunk-A5M55UR3.js";
|
|
@@ -195,6 +199,7 @@ export {
|
|
|
195
199
|
INITIAL_SEQUENCE,
|
|
196
200
|
InternalValidationError,
|
|
197
201
|
KeyDerivationType,
|
|
202
|
+
LOGGER_NAMES,
|
|
198
203
|
LRC_WALLET_NETWORK,
|
|
199
204
|
Network,
|
|
200
205
|
NetworkError,
|
|
@@ -202,6 +207,7 @@ export {
|
|
|
202
207
|
NotImplementedError,
|
|
203
208
|
RPCError,
|
|
204
209
|
SparkSDKError,
|
|
210
|
+
SparkSdkLogger,
|
|
205
211
|
SparkWalletNodeJS as SparkWallet,
|
|
206
212
|
TEST_UNILATERAL_DIRECT_SEQUENCE,
|
|
207
213
|
TEST_UNILATERAL_SEQUENCE,
|
|
@@ -4,6 +4,7 @@ import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
|
|
|
4
4
|
import { N as Network, A as TokenOutputsMap, B as Bech32mTokenIdentifier, z as TokenBalanceMap, S as SparkAddressFormat } from './spark-wallet-yc2KhsVY.cjs';
|
|
5
5
|
import { j as SigningNonce, k as SigningCommitment } from './client-B9CAWKWz.cjs';
|
|
6
6
|
import { O as OutputWithPreviousTransactionData, f as TransferPackage, c as SparkServiceClient } from './spark-CtGJPkx4.cjs';
|
|
7
|
+
import { Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
7
8
|
|
|
8
9
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
9
10
|
declare function generateAdaptorFromSignature(signature: Uint8Array): {
|
|
@@ -177,4 +178,17 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
177
178
|
|
|
178
179
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
declare const LOGGER_NAMES: {
|
|
182
|
+
readonly wasm: "wasm";
|
|
183
|
+
};
|
|
184
|
+
type LoggerName = (typeof LOGGER_NAMES)[keyof typeof LOGGER_NAMES];
|
|
185
|
+
declare class SparkSdkLogger {
|
|
186
|
+
private static loggers;
|
|
187
|
+
static get(name: LoggerName): Logger;
|
|
188
|
+
static setLevel(name: LoggerName, level: LoggingLevel): void;
|
|
189
|
+
static setAllLevels(level: LoggingLevel): void;
|
|
190
|
+
static setEnabled(name: LoggerName, enabled: boolean): void;
|
|
191
|
+
static setAllEnabled(enabled: boolean): void;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { getCurrentTimelock as $, getRandomSigningNonce as A, createSigningNonce as B, getSigningCommitmentFromNonce as C, encodeSigningNonceToBytes as D, decodeBytesToSigningNonce as E, createSigningCommitment as F, encodeSigningCommitmentToBytes as G, decodeBytesToSigningCommitment as H, sumAvailableTokens as I, checkIfSelectedOutputsAreAvailable as J, filterTokenBalanceForTokenIdentifier as K, getTransferPackageSigningPayload as L, DIRECT_TIMELOCK_OFFSET as M, INITIAL_SEQUENCE as N, INITIAL_DIRECT_SEQUENCE as O, TEST_UNILATERAL_DIRECT_SEQUENCE as P, DEFAULT_FEE_SATS as Q, maybeApplyFee as R, createRootTx as S, TEST_UNILATERAL_SEQUENCE as T, createSplitTx as U, createNodeTx as V, createNodeTxs as W, createLeafNodeTx as X, createRefundTx as Y, createRefundTxs as Z, createConnectorRefundTransactions as _, generateAdaptorFromSignature as a, getTransactionSequence as a0, checkIfValidSequence as a1, doesLeafNeedRefresh as a2, getNextTransactionSequence as a3, getEphemeralAnchorOutput as a4, type LeafInfo as a5, type Utxo as a6, type FeeRate as a7, type FeeBumpTxPackage as a8, type FeeBumpTxChain as a9, type TxChain as aa, type BroadcastConfig as ab, type BroadcastResult as ac, isEphemeralAnchorOutput as ad, constructUnilateralExitTxs as ae, constructUnilateralExitFeeBumpPackages as af, constructFeeBumpTx as ag, getSparkAddressFromTaproot as ah, LOGGER_NAMES as ai, type LoggerName as aj, SparkSdkLogger as ak, applyAdaptorToSignature as b, computeTaprootKeyNoScript as c, getP2TRScriptFromPublicKey as d, getP2TRAddressFromPublicKey as e, getP2TRAddressFromPkScript as f, generateSignatureFromExistingAdaptor as g, getP2WPKHAddressFromPublicKey as h, getTxFromRawTxHex as i, getTxFromRawTxBytes as j, getSigHashFromTx as k, getTxId as l, getTxIdNoReverse as m, getTxEstimatedVbytesSizeByNumberOfInputsOutputs as n, addPublicKeys as o, applyAdditiveTweakToPublicKey as p, addPrivateKeys as q, subtractPrivateKeys as r, subtractPublicKeys as s, sumOfPrivateKeys as t, lastKeyWithTarget as u, validateOutboundAdaptorSignature as v, getLatestDepositTxId as w, isTxBroadcast as x, proofOfPossessionMessageHashForDepositAddress as y, collectResponses as z };
|
|
@@ -4,6 +4,7 @@ import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
|
|
|
4
4
|
import { N as Network, A as TokenOutputsMap, B as Bech32mTokenIdentifier, z as TokenBalanceMap, S as SparkAddressFormat } from './spark-wallet-Cp3yv6cK.js';
|
|
5
5
|
import { j as SigningNonce, k as SigningCommitment } from './client-Dd3QnxQu.js';
|
|
6
6
|
import { O as OutputWithPreviousTransactionData, f as TransferPackage, c as SparkServiceClient } from './spark-CtGJPkx4.js';
|
|
7
|
+
import { Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
7
8
|
|
|
8
9
|
declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
|
|
9
10
|
declare function generateAdaptorFromSignature(signature: Uint8Array): {
|
|
@@ -177,4 +178,17 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
177
178
|
|
|
178
179
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
declare const LOGGER_NAMES: {
|
|
182
|
+
readonly wasm: "wasm";
|
|
183
|
+
};
|
|
184
|
+
type LoggerName = (typeof LOGGER_NAMES)[keyof typeof LOGGER_NAMES];
|
|
185
|
+
declare class SparkSdkLogger {
|
|
186
|
+
private static loggers;
|
|
187
|
+
static get(name: LoggerName): Logger;
|
|
188
|
+
static setLevel(name: LoggerName, level: LoggingLevel): void;
|
|
189
|
+
static setAllLevels(level: LoggingLevel): void;
|
|
190
|
+
static setEnabled(name: LoggerName, enabled: boolean): void;
|
|
191
|
+
static setAllEnabled(enabled: boolean): void;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { getCurrentTimelock as $, getRandomSigningNonce as A, createSigningNonce as B, getSigningCommitmentFromNonce as C, encodeSigningNonceToBytes as D, decodeBytesToSigningNonce as E, createSigningCommitment as F, encodeSigningCommitmentToBytes as G, decodeBytesToSigningCommitment as H, sumAvailableTokens as I, checkIfSelectedOutputsAreAvailable as J, filterTokenBalanceForTokenIdentifier as K, getTransferPackageSigningPayload as L, DIRECT_TIMELOCK_OFFSET as M, INITIAL_SEQUENCE as N, INITIAL_DIRECT_SEQUENCE as O, TEST_UNILATERAL_DIRECT_SEQUENCE as P, DEFAULT_FEE_SATS as Q, maybeApplyFee as R, createRootTx as S, TEST_UNILATERAL_SEQUENCE as T, createSplitTx as U, createNodeTx as V, createNodeTxs as W, createLeafNodeTx as X, createRefundTx as Y, createRefundTxs as Z, createConnectorRefundTransactions as _, generateAdaptorFromSignature as a, getTransactionSequence as a0, checkIfValidSequence as a1, doesLeafNeedRefresh as a2, getNextTransactionSequence as a3, getEphemeralAnchorOutput as a4, type LeafInfo as a5, type Utxo as a6, type FeeRate as a7, type FeeBumpTxPackage as a8, type FeeBumpTxChain as a9, type TxChain as aa, type BroadcastConfig as ab, type BroadcastResult as ac, isEphemeralAnchorOutput as ad, constructUnilateralExitTxs as ae, constructUnilateralExitFeeBumpPackages as af, constructFeeBumpTx as ag, getSparkAddressFromTaproot as ah, LOGGER_NAMES as ai, type LoggerName as aj, SparkSdkLogger as ak, applyAdaptorToSignature as b, computeTaprootKeyNoScript as c, getP2TRScriptFromPublicKey as d, getP2TRAddressFromPublicKey as e, getP2TRAddressFromPkScript as f, generateSignatureFromExistingAdaptor as g, getP2WPKHAddressFromPublicKey as h, getTxFromRawTxHex as i, getTxFromRawTxBytes as j, getSigHashFromTx as k, getTxId as l, getTxIdNoReverse as m, getTxEstimatedVbytesSizeByNumberOfInputsOutputs as n, addPublicKeys as o, applyAdditiveTweakToPublicKey as p, addPrivateKeys as q, subtractPrivateKeys as r, subtractPublicKeys as s, sumOfPrivateKeys as t, lastKeyWithTarget as u, validateOutboundAdaptorSignature as v, getLatestDepositTxId as w, isTxBroadcast as x, proofOfPossessionMessageHashForDepositAddress as y, collectResponses as z };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require("react-native-get-random-values");
|
|
2
|
+
|
|
3
|
+
// src/utils/logging.ts
|
|
4
|
+
import { Logger } from "@lightsparkdev/core";
|
|
5
|
+
var LOGGER_NAMES = {
|
|
6
|
+
wasm: "wasm"
|
|
7
|
+
};
|
|
8
|
+
var SparkSdkLogger = class {
|
|
9
|
+
static loggers = /* @__PURE__ */ new Map();
|
|
10
|
+
static get(name) {
|
|
11
|
+
if (!this.loggers.has(name)) {
|
|
12
|
+
this.loggers.set(name, new Logger(name));
|
|
13
|
+
}
|
|
14
|
+
return this.loggers.get(name);
|
|
15
|
+
}
|
|
16
|
+
static setLevel(name, level) {
|
|
17
|
+
this.get(name).setLevel(level);
|
|
18
|
+
}
|
|
19
|
+
static setAllLevels(level) {
|
|
20
|
+
this.loggers.forEach((logger) => logger.setLevel(level));
|
|
21
|
+
}
|
|
22
|
+
static setEnabled(name, enabled) {
|
|
23
|
+
this.get(name).setEnabled(enabled);
|
|
24
|
+
}
|
|
25
|
+
static setAllEnabled(enabled) {
|
|
26
|
+
this.loggers.forEach((logger) => logger.setEnabled(enabled));
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
Object.values(LOGGER_NAMES).forEach((name) => this.get(name));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
LOGGER_NAMES,
|
|
35
|
+
SparkSdkLogger
|
|
36
|
+
};
|