@buildonspark/spark-sdk 0.1.46 → 0.2.0
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 +26 -0
- package/dist/{chunk-BGGEVUJK.js → chunk-2ENZX6LT.js} +241 -7
- package/dist/{chunk-LHRD2WT6.js → chunk-4JD4HIAN.js} +23 -3
- package/dist/{chunk-I54FARY2.js → chunk-CDLETEDT.js} +11 -3
- package/dist/{chunk-OBFKIEMP.js → chunk-TM6CHQXC.js} +1 -1
- package/dist/chunk-UDK3EBE5.js +13514 -0
- package/dist/chunk-XYTKKLCV.js +7 -0
- package/dist/{RequestLightningSendInput-2cSh_In4.d.cts → client-DKbwpcnl.d.ts} +434 -212
- package/dist/{RequestLightningSendInput-CN6BNg_g.d.ts → client-Drs5Lapg.d.cts} +434 -212
- package/dist/{services/config.cjs → debug.cjs} +31007 -1003
- package/dist/debug.d.cts +126 -0
- package/dist/debug.d.ts +126 -0
- package/dist/debug.js +21 -0
- package/dist/graphql/objects/index.d.cts +4 -11
- package/dist/graphql/objects/index.d.ts +4 -11
- package/dist/graphql/objects/index.js +2 -4
- package/dist/index.cjs +18219 -20818
- package/dist/index.d.cts +15 -768
- package/dist/index.d.ts +15 -768
- package/dist/index.js +82 -76
- package/dist/index.node.cjs +23831 -26538
- package/dist/index.node.d.cts +191 -33
- package/dist/index.node.d.ts +191 -33
- package/dist/index.node.js +87 -181
- package/dist/native/index.cjs +17835 -20519
- package/dist/native/index.d.cts +1466 -1546
- package/dist/native/index.d.ts +1466 -1546
- package/dist/native/index.js +22605 -25286
- package/dist/proto/lrc20.d.cts +2 -2
- package/dist/proto/lrc20.d.ts +2 -2
- package/dist/proto/lrc20.js +3098 -46
- package/dist/proto/spark.cjs +241 -7
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +5 -1
- package/dist/proto/spark_token.cjs +22 -2
- package/dist/proto/spark_token.d.cts +8 -1
- package/dist/proto/spark_token.d.ts +8 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{sdk-types-CKBsylfW.d.ts → sdk-types-DCIVdKUT.d.ts} +1 -1
- package/dist/{sdk-types-Ct8xmN7l.d.cts → sdk-types-DJ2ve9YY.d.cts} +1 -1
- package/dist/{spark-DbzGfse6.d.ts → spark-BUOx3U7Q.d.cts} +103 -5
- package/dist/{spark-DbzGfse6.d.cts → spark-BUOx3U7Q.d.ts} +103 -5
- package/dist/spark-wallet-CF8Oxjqs.d.ts +935 -0
- package/dist/spark-wallet-DOLSa3oF.d.cts +935 -0
- package/dist/spark_bindings/native/index.d.cts +1 -1
- package/dist/spark_bindings/native/index.d.ts +1 -1
- package/dist/spark_bindings/wasm/index.d.cts +1 -1
- package/dist/spark_bindings/wasm/index.d.ts +1 -1
- package/dist/{services/index.cjs → tests/test-utils.cjs} +9788 -10263
- package/dist/tests/test-utils.d.cts +79 -0
- package/dist/tests/test-utils.d.ts +79 -0
- package/dist/tests/test-utils.js +93 -0
- package/dist/types/index.cjs +239 -7
- package/dist/types/index.d.cts +5 -9
- package/dist/types/index.d.ts +5 -9
- package/dist/types/index.js +4 -6
- package/dist/{types-C-Rp0Oo7.d.ts → types-BADxR3bm.d.cts} +1 -1
- package/dist/{types-C-Rp0Oo7.d.cts → types-BADxR3bm.d.ts} +1 -1
- package/dist/{index-COm59SPw.d.ts → xchain-address-C2xMs9nz.d.cts} +6 -94
- package/dist/{index-CKL5DodV.d.cts → xchain-address-Ckto9oEz.d.ts} +6 -94
- package/package.json +9 -33
- package/src/debug.ts +13 -0
- package/src/graphql/client.ts +59 -20
- package/src/index.node.ts +28 -2
- package/src/index.ts +31 -1
- package/src/native/index.ts +16 -2
- package/src/proto/mock.ts +76 -0
- package/src/proto/spark.ts +354 -6
- package/src/proto/spark_token.ts +34 -2
- package/src/services/config.ts +4 -6
- package/src/services/connection.ts +131 -64
- package/src/services/coop-exit.ts +6 -3
- package/src/services/deposit.ts +9 -8
- package/src/services/lightning.ts +4 -3
- package/src/services/signing.ts +10 -6
- package/src/services/token-transactions.ts +100 -85
- package/src/services/transfer.ts +88 -60
- package/src/services/tree-creation.ts +17 -9
- package/src/services/wallet-config.ts +17 -9
- package/src/signer/signer.react-native.ts +5 -10
- package/src/signer/signer.ts +269 -339
- package/src/signer/types.ts +63 -0
- package/src/spark-wallet/spark-wallet.ts +226 -149
- package/src/spark-wallet/types.ts +22 -8
- package/src/tests/integration/adaptor-signature.test.ts +8 -9
- package/src/tests/integration/coop-exit.test.ts +214 -202
- package/src/tests/integration/lightning.test.ts +128 -103
- package/src/tests/integration/swap.test.ts +116 -84
- package/src/tests/integration/transfer.test.ts +291 -214
- package/src/tests/integration/tree-creation.test.ts +0 -5
- package/src/tests/integration/wallet.test.ts +1 -0
- package/src/tests/isHermeticTest.ts +3 -24
- package/src/tests/{test-util.ts → test-utils.ts} +13 -11
- package/src/tests/token-identifier.test.ts +6 -6
- package/src/tests/wrapWithOtelSpan.test.ts +1 -1
- package/src/{address → utils}/address.ts +1 -1
- package/src/utils/crypto.ts +19 -9
- package/src/utils/index.ts +2 -0
- package/src/utils/network.ts +17 -0
- package/src/utils/secret-sharing.ts +1 -2
- package/src/utils/signing.ts +1 -1
- package/src/utils/token-identifier.ts +27 -21
- package/src/utils/token-transaction-validation.ts +34 -0
- package/src/utils/token-transactions.ts +12 -8
- package/src/utils/unilateral-exit.ts +32 -0
- package/src/utils/xchain-address.ts +1 -1
- package/dist/BitcoinNetwork-TnABML0T.d.cts +0 -18
- package/dist/BitcoinNetwork-TnABML0T.d.ts +0 -18
- package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.cts +0 -10
- package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.ts +0 -10
- package/dist/address/index.cjs +0 -458
- package/dist/address/index.d.cts +0 -32
- package/dist/address/index.d.ts +0 -32
- package/dist/address/index.js +0 -17
- package/dist/chunk-4EMV7HHW.js +0 -277
- package/dist/chunk-C2S227QR.js +0 -2336
- package/dist/chunk-DXR2PXJU.js +0 -1122
- package/dist/chunk-GSI4OLXZ.js +0 -117
- package/dist/chunk-HHNQ3ZHC.js +0 -170
- package/dist/chunk-HMLOC6TE.js +0 -14
- package/dist/chunk-HSCLBJEL.js +0 -113
- package/dist/chunk-HWJWKEIU.js +0 -75
- package/dist/chunk-JB64OQES.js +0 -7095
- package/dist/chunk-KMUMFYFX.js +0 -137
- package/dist/chunk-N5VZVCGJ.js +0 -622
- package/dist/chunk-NSJF5F5O.js +0 -325
- package/dist/chunk-NTFKFRQ2.js +0 -3146
- package/dist/chunk-OFCJFZ4I.js +0 -24
- package/dist/chunk-QNNSEJ4P.js +0 -232
- package/dist/chunk-UXDODSDT.js +0 -838
- package/dist/chunk-VTUGIIWI.js +0 -0
- package/dist/chunk-Z5HIAYFT.js +0 -84
- package/dist/network-Css46DAz.d.cts +0 -46
- package/dist/network-hynb7iTZ.d.ts +0 -46
- package/dist/services/config.d.cts +0 -42
- package/dist/services/config.d.ts +0 -42
- package/dist/services/config.js +0 -17
- package/dist/services/connection.cjs +0 -17691
- package/dist/services/connection.d.cts +0 -95
- package/dist/services/connection.d.ts +0 -95
- package/dist/services/connection.js +0 -11
- package/dist/services/index.d.cts +0 -21
- package/dist/services/index.d.ts +0 -21
- package/dist/services/index.js +0 -58
- package/dist/services/lrc-connection.cjs +0 -4713
- package/dist/services/lrc-connection.d.cts +0 -34
- package/dist/services/lrc-connection.d.ts +0 -34
- package/dist/services/lrc-connection.js +0 -11
- package/dist/services/token-transactions.cjs +0 -2877
- package/dist/services/token-transactions.d.cts +0 -75
- package/dist/services/token-transactions.d.ts +0 -75
- package/dist/services/token-transactions.js +0 -15
- package/dist/services/wallet-config.cjs +0 -340
- package/dist/services/wallet-config.d.cts +0 -56
- package/dist/services/wallet-config.d.ts +0 -56
- package/dist/services/wallet-config.js +0 -33
- package/dist/signer/signer.cjs +0 -2004
- package/dist/signer/signer.d.cts +0 -10
- package/dist/signer/signer.d.ts +0 -10
- package/dist/signer/signer.js +0 -24
- package/dist/signer-BP6F__oR.d.cts +0 -187
- package/dist/signer-BVZJXcq7.d.ts +0 -187
- package/dist/utils/index.cjs +0 -2947
- package/dist/utils/index.d.cts +0 -18
- package/dist/utils/index.d.ts +0 -18
- package/dist/utils/index.js +0 -157
- package/ios/spark_frost.kt +0 -1900
- package/src/address/index.ts +0 -1
- package/src/services/lrc-connection.ts +0 -215
- /package/dist/{chunk-L3EHBOUX.js → chunk-BYXBJQAS.js} +0 -0
package/dist/index.node.js
CHANGED
|
@@ -1,23 +1,71 @@
|
|
|
1
|
+
import "./chunk-BYXBJQAS.js";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
AuthenticationError,
|
|
4
|
+
ConfigurationError,
|
|
5
5
|
DEFAULT_FEE_SATS,
|
|
6
|
+
DefaultSparkSigner,
|
|
7
|
+
InternalValidationError,
|
|
8
|
+
KeyDerivationType,
|
|
9
|
+
LRC_WALLET_NETWORK,
|
|
10
|
+
LRC_WALLET_NETWORK_TYPE,
|
|
11
|
+
MultisigReceiptInput,
|
|
12
|
+
Network,
|
|
13
|
+
NetworkError,
|
|
14
|
+
NetworkToProto,
|
|
15
|
+
NotImplementedError,
|
|
16
|
+
RPCError,
|
|
17
|
+
SparkSDKError,
|
|
18
|
+
SparkWallet,
|
|
19
|
+
TaprootOutputKeysGenerator,
|
|
20
|
+
TaprootSparkSigner,
|
|
21
|
+
TokenTransactionService,
|
|
22
|
+
ValidationError,
|
|
23
|
+
WalletConfig,
|
|
24
|
+
addPrivateKeys,
|
|
25
|
+
addPublicKeys,
|
|
26
|
+
applyAdaptorToSignature,
|
|
27
|
+
applyAdditiveTweakToPublicKey,
|
|
28
|
+
bigIntToPrivateKey,
|
|
29
|
+
checkIfSelectedOutputsAreAvailable,
|
|
6
30
|
checkIfValidSequence,
|
|
31
|
+
collectResponses,
|
|
7
32
|
computeTaprootKeyNoScript,
|
|
33
|
+
computerLagrangeCoefficients,
|
|
8
34
|
constructFeeBumpTx,
|
|
9
35
|
constructUnilateralExitFeeBumpPackages,
|
|
10
36
|
constructUnilateralExitTxs,
|
|
11
37
|
createRefundTx,
|
|
38
|
+
createSigningCommitment,
|
|
39
|
+
createSigningNonce,
|
|
40
|
+
decodeBech32mTokenIdentifier,
|
|
41
|
+
decodeBytesToSigningCommitment,
|
|
42
|
+
decodeBytesToSigningNonce,
|
|
43
|
+
decodeSparkAddress,
|
|
44
|
+
encodeBech32mTokenIdentifier,
|
|
45
|
+
encodeSigningCommitmentToBytes,
|
|
46
|
+
encodeSigningNonceToBytes,
|
|
47
|
+
encodeSparkAddress,
|
|
48
|
+
evaluatePolynomial,
|
|
49
|
+
fieldDiv,
|
|
50
|
+
filterTokenBalanceForTokenPublicKey,
|
|
51
|
+
generateAdaptorFromSignature,
|
|
52
|
+
generatePolynomialForSecretSharing,
|
|
53
|
+
generateSignatureFromExistingAdaptor,
|
|
12
54
|
getCurrentTimelock,
|
|
13
55
|
getEphemeralAnchorOutput,
|
|
14
56
|
getLatestDepositTxId,
|
|
57
|
+
getNetwork,
|
|
58
|
+
getNetworkFromAddress,
|
|
59
|
+
getNetworkFromString,
|
|
15
60
|
getNextTransactionSequence,
|
|
16
61
|
getP2TRAddressFromPkScript,
|
|
17
62
|
getP2TRAddressFromPublicKey,
|
|
18
63
|
getP2TRScriptFromPublicKey,
|
|
19
64
|
getP2WPKHAddressFromPublicKey,
|
|
65
|
+
getRandomBigInt,
|
|
66
|
+
getRandomSigningNonce,
|
|
20
67
|
getSigHashFromTx,
|
|
68
|
+
getSigningCommitmentFromNonce,
|
|
21
69
|
getSparkAddressFromTaproot,
|
|
22
70
|
getTransactionSequence,
|
|
23
71
|
getTransferPackageSigningPayload,
|
|
@@ -27,211 +75,61 @@ import {
|
|
|
27
75
|
getTxIdNoReverse,
|
|
28
76
|
isEphemeralAnchorOutput,
|
|
29
77
|
isTxBroadcast,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} from "./chunk-UXDODSDT.js";
|
|
33
|
-
import "./chunk-HSCLBJEL.js";
|
|
34
|
-
import {
|
|
35
|
-
LRC_WALLET_NETWORK,
|
|
36
|
-
LRC_WALLET_NETWORK_TYPE,
|
|
37
|
-
Network,
|
|
38
|
-
NetworkToProto,
|
|
39
|
-
getNetwork,
|
|
40
|
-
getNetworkFromAddress,
|
|
41
|
-
getNetworkFromString
|
|
42
|
-
} from "./chunk-Z5HIAYFT.js";
|
|
43
|
-
import "./chunk-DXR2PXJU.js";
|
|
44
|
-
import "./chunk-HHNQ3ZHC.js";
|
|
45
|
-
import "./chunk-C2S227QR.js";
|
|
46
|
-
import {
|
|
47
|
-
calculateAvailableTokenAmount,
|
|
48
|
-
checkIfSelectedOutputsAreAvailable,
|
|
49
|
-
collectResponses,
|
|
50
|
-
filterTokenBalanceForTokenPublicKey
|
|
51
|
-
} from "./chunk-HWJWKEIU.js";
|
|
52
|
-
import "./chunk-4EMV7HHW.js";
|
|
53
|
-
import "./chunk-L3EHBOUX.js";
|
|
54
|
-
import "./chunk-KMUMFYFX.js";
|
|
55
|
-
import "./chunk-NTFKFRQ2.js";
|
|
56
|
-
import "./chunk-LHRD2WT6.js";
|
|
57
|
-
import "./chunk-N5VZVCGJ.js";
|
|
58
|
-
import {
|
|
59
|
-
addPrivateKeys,
|
|
60
|
-
addPublicKeys,
|
|
61
|
-
applyAdaptorToSignature,
|
|
62
|
-
applyAdditiveTweakToPublicKey,
|
|
63
|
-
createSigningCommitment,
|
|
64
|
-
createSigningNonce,
|
|
65
|
-
decodeBytesToSigningCommitment,
|
|
66
|
-
decodeBytesToSigningNonce,
|
|
67
|
-
encodeSigningCommitmentToBytes,
|
|
68
|
-
encodeSigningNonceToBytes,
|
|
69
|
-
generateAdaptorFromSignature,
|
|
70
|
-
generateSignatureFromExistingAdaptor,
|
|
71
|
-
getRandomSigningNonce,
|
|
72
|
-
getSigningCommitmentFromNonce,
|
|
78
|
+
isValidPublicKey,
|
|
79
|
+
isValidSparkAddress,
|
|
73
80
|
lastKeyWithTarget,
|
|
74
|
-
|
|
75
|
-
subtractPublicKeys,
|
|
76
|
-
sumOfPrivateKeys,
|
|
77
|
-
validateOutboundAdaptorSignature
|
|
78
|
-
} from "./chunk-NSJF5F5O.js";
|
|
79
|
-
import "./chunk-OFCJFZ4I.js";
|
|
80
|
-
import {
|
|
81
|
-
bigIntToPrivateKey,
|
|
82
|
-
computerLagrangeCoefficients,
|
|
83
|
-
evaluatePolynomial,
|
|
84
|
-
fieldDiv,
|
|
85
|
-
generatePolynomialForSecretSharing,
|
|
86
|
-
getRandomBigInt,
|
|
81
|
+
maybeApplyFee,
|
|
87
82
|
modInverse,
|
|
83
|
+
proofOfPossessionMessageHashForDepositAddress,
|
|
84
|
+
protoToNetwork,
|
|
88
85
|
recoverSecret,
|
|
86
|
+
setCrypto,
|
|
89
87
|
splitSecret,
|
|
90
88
|
splitSecretWithProofs,
|
|
89
|
+
subtractPrivateKeys,
|
|
90
|
+
subtractPublicKeys,
|
|
91
|
+
sumAvailableTokens,
|
|
92
|
+
sumOfPrivateKeys,
|
|
93
|
+
validateOutboundAdaptorSignature,
|
|
91
94
|
validateShare
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import "./chunk-
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
InternalValidationError,
|
|
98
|
-
NetworkError,
|
|
99
|
-
NotImplementedError,
|
|
100
|
-
RPCError,
|
|
101
|
-
SparkSDKError,
|
|
102
|
-
ValidationError
|
|
103
|
-
} from "./chunk-GSI4OLXZ.js";
|
|
104
|
-
import "./chunk-OBFKIEMP.js";
|
|
105
|
-
import "./chunk-I54FARY2.js";
|
|
106
|
-
import "./chunk-HMLOC6TE.js";
|
|
107
|
-
import "./chunk-BGGEVUJK.js";
|
|
95
|
+
} from "./chunk-UDK3EBE5.js";
|
|
96
|
+
import "./chunk-4JD4HIAN.js";
|
|
97
|
+
import "./chunk-TM6CHQXC.js";
|
|
98
|
+
import "./chunk-CDLETEDT.js";
|
|
99
|
+
import "./chunk-2ENZX6LT.js";
|
|
108
100
|
import "./chunk-MVRQ5US7.js";
|
|
109
101
|
|
|
110
|
-
// src/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return async (...args) => {
|
|
115
|
-
if (!this.tracer) {
|
|
116
|
-
throw new Error("Tracer not initialized");
|
|
117
|
-
}
|
|
118
|
-
return await this.tracer.startActiveSpan(name, async (span) => {
|
|
119
|
-
const traceId = span.spanContext().traceId;
|
|
120
|
-
try {
|
|
121
|
-
return await fn(...args);
|
|
122
|
-
} catch (error) {
|
|
123
|
-
if (error instanceof Error) {
|
|
124
|
-
error.message += ` [traceId: ${traceId}]`;
|
|
125
|
-
} else if (typeof error === "object" && error !== null) {
|
|
126
|
-
error.traceId = traceId;
|
|
127
|
-
}
|
|
128
|
-
throw error;
|
|
129
|
-
} finally {
|
|
130
|
-
span.end();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
async initializeTracer(tracerName) {
|
|
136
|
-
const { trace, propagation, context } = await import("@opentelemetry/api");
|
|
137
|
-
const { W3CTraceContextPropagator } = await import("@opentelemetry/core");
|
|
138
|
-
const { AsyncLocalStorageContextManager } = await import("@opentelemetry/context-async-hooks");
|
|
139
|
-
const { BasicTracerProvider } = await import("@opentelemetry/sdk-trace-base");
|
|
140
|
-
trace.setGlobalTracerProvider(new BasicTracerProvider());
|
|
141
|
-
propagation.setGlobalPropagator(new W3CTraceContextPropagator());
|
|
142
|
-
context.setGlobalContextManager(new AsyncLocalStorageContextManager());
|
|
143
|
-
this.tracer = trace.getTracer(tracerName);
|
|
144
|
-
}
|
|
145
|
-
wrapSparkWalletWithTracing() {
|
|
146
|
-
this.getIdentityPublicKey = this.wrapWithOtelSpan(
|
|
147
|
-
"SparkWallet.getIdentityPublicKey",
|
|
148
|
-
this.getIdentityPublicKey.bind(this)
|
|
149
|
-
);
|
|
150
|
-
this.getSparkAddress = this.wrapWithOtelSpan(
|
|
151
|
-
"SparkWallet.getSparkAddress",
|
|
152
|
-
this.getSparkAddress.bind(this)
|
|
153
|
-
);
|
|
154
|
-
this.getSwapFeeEstimate = this.wrapWithOtelSpan(
|
|
155
|
-
"SparkWallet.getSwapFeeEstimate",
|
|
156
|
-
this.getSwapFeeEstimate.bind(this)
|
|
157
|
-
);
|
|
158
|
-
this.getTransfers = this.wrapWithOtelSpan(
|
|
159
|
-
"SparkWallet.getTransfers",
|
|
160
|
-
this.getTransfers.bind(this)
|
|
161
|
-
);
|
|
162
|
-
this.getBalance = this.wrapWithOtelSpan(
|
|
163
|
-
"SparkWallet.getBalance",
|
|
164
|
-
this.getBalance.bind(this)
|
|
165
|
-
);
|
|
166
|
-
this.getSingleUseDepositAddress = this.wrapWithOtelSpan(
|
|
167
|
-
"SparkWallet.getSingleUseDepositAddress",
|
|
168
|
-
this.getSingleUseDepositAddress.bind(this)
|
|
169
|
-
);
|
|
170
|
-
this.getUnusedDepositAddresses = this.wrapWithOtelSpan(
|
|
171
|
-
"SparkWallet.getUnusedDepositAddresses",
|
|
172
|
-
this.getUnusedDepositAddresses.bind(this)
|
|
173
|
-
);
|
|
174
|
-
this.claimDeposit = this.wrapWithOtelSpan(
|
|
175
|
-
"SparkWallet.claimDeposit",
|
|
176
|
-
this.claimDeposit.bind(this)
|
|
177
|
-
);
|
|
178
|
-
this.advancedDeposit = this.wrapWithOtelSpan(
|
|
179
|
-
"SparkWallet.advancedDeposit",
|
|
180
|
-
this.advancedDeposit.bind(this)
|
|
181
|
-
);
|
|
182
|
-
this.transfer = this.wrapWithOtelSpan(
|
|
183
|
-
"SparkWallet.transfer",
|
|
184
|
-
this.transfer.bind(this)
|
|
185
|
-
);
|
|
186
|
-
this.createLightningInvoice = this.wrapWithOtelSpan(
|
|
187
|
-
"SparkWallet.createLightningInvoice",
|
|
188
|
-
this.createLightningInvoice.bind(this)
|
|
189
|
-
);
|
|
190
|
-
this.payLightningInvoice = this.wrapWithOtelSpan(
|
|
191
|
-
"SparkWallet.payLightningInvoice",
|
|
192
|
-
this.payLightningInvoice.bind(this)
|
|
193
|
-
);
|
|
194
|
-
this.getLightningSendFeeEstimate = this.wrapWithOtelSpan(
|
|
195
|
-
"SparkWallet.getLightningSendFeeEstimate",
|
|
196
|
-
this.getLightningSendFeeEstimate.bind(this)
|
|
197
|
-
);
|
|
198
|
-
this.withdraw = this.wrapWithOtelSpan(
|
|
199
|
-
"SparkWallet.withdraw",
|
|
200
|
-
this.withdraw.bind(this)
|
|
201
|
-
);
|
|
202
|
-
this.getWithdrawalFeeQuote = this.wrapWithOtelSpan(
|
|
203
|
-
"SparkWallet.getWithdrawalFeeQuote",
|
|
204
|
-
this.getWithdrawalFeeQuote.bind(this)
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
async initWallet(mnemonicOrSeed, accountNumber) {
|
|
208
|
-
const res = super.initWallet(mnemonicOrSeed, accountNumber);
|
|
209
|
-
await this.initializeTracer(this.tracerId);
|
|
210
|
-
this.wrapSparkWalletWithTracing();
|
|
211
|
-
return res;
|
|
212
|
-
}
|
|
213
|
-
};
|
|
102
|
+
// src/index.node.ts
|
|
103
|
+
import nodeCrypto from "crypto";
|
|
104
|
+
var cryptoImpl = typeof global !== "undefined" && global.crypto ? global.crypto : nodeCrypto;
|
|
105
|
+
setCrypto(cryptoImpl);
|
|
214
106
|
export {
|
|
215
107
|
AuthenticationError,
|
|
216
108
|
ConfigurationError,
|
|
217
109
|
DEFAULT_FEE_SATS,
|
|
110
|
+
DefaultSparkSigner,
|
|
218
111
|
InternalValidationError,
|
|
112
|
+
KeyDerivationType,
|
|
219
113
|
LRC_WALLET_NETWORK,
|
|
220
114
|
LRC_WALLET_NETWORK_TYPE,
|
|
115
|
+
MultisigReceiptInput,
|
|
221
116
|
Network,
|
|
222
117
|
NetworkError,
|
|
223
118
|
NetworkToProto,
|
|
224
119
|
NotImplementedError,
|
|
225
120
|
RPCError,
|
|
226
121
|
SparkSDKError,
|
|
227
|
-
|
|
122
|
+
SparkWallet,
|
|
123
|
+
TaprootOutputKeysGenerator,
|
|
124
|
+
TaprootSparkSigner,
|
|
125
|
+
TokenTransactionService,
|
|
228
126
|
ValidationError,
|
|
127
|
+
WalletConfig,
|
|
229
128
|
addPrivateKeys,
|
|
230
129
|
addPublicKeys,
|
|
231
130
|
applyAdaptorToSignature,
|
|
232
131
|
applyAdditiveTweakToPublicKey,
|
|
233
132
|
bigIntToPrivateKey,
|
|
234
|
-
calculateAvailableTokenAmount,
|
|
235
133
|
checkIfSelectedOutputsAreAvailable,
|
|
236
134
|
checkIfValidSequence,
|
|
237
135
|
collectResponses,
|
|
@@ -243,10 +141,14 @@ export {
|
|
|
243
141
|
createRefundTx,
|
|
244
142
|
createSigningCommitment,
|
|
245
143
|
createSigningNonce,
|
|
144
|
+
decodeBech32mTokenIdentifier,
|
|
246
145
|
decodeBytesToSigningCommitment,
|
|
247
146
|
decodeBytesToSigningNonce,
|
|
147
|
+
decodeSparkAddress,
|
|
148
|
+
encodeBech32mTokenIdentifier,
|
|
248
149
|
encodeSigningCommitmentToBytes,
|
|
249
150
|
encodeSigningNonceToBytes,
|
|
151
|
+
encodeSparkAddress,
|
|
250
152
|
evaluatePolynomial,
|
|
251
153
|
fieldDiv,
|
|
252
154
|
filterTokenBalanceForTokenPublicKey,
|
|
@@ -277,15 +179,19 @@ export {
|
|
|
277
179
|
getTxIdNoReverse,
|
|
278
180
|
isEphemeralAnchorOutput,
|
|
279
181
|
isTxBroadcast,
|
|
182
|
+
isValidPublicKey,
|
|
183
|
+
isValidSparkAddress,
|
|
280
184
|
lastKeyWithTarget,
|
|
281
185
|
maybeApplyFee,
|
|
282
186
|
modInverse,
|
|
283
187
|
proofOfPossessionMessageHashForDepositAddress,
|
|
188
|
+
protoToNetwork,
|
|
284
189
|
recoverSecret,
|
|
285
190
|
splitSecret,
|
|
286
191
|
splitSecretWithProofs,
|
|
287
192
|
subtractPrivateKeys,
|
|
288
193
|
subtractPublicKeys,
|
|
194
|
+
sumAvailableTokens,
|
|
289
195
|
sumOfPrivateKeys,
|
|
290
196
|
validateOutboundAdaptorSignature,
|
|
291
197
|
validateShare
|