@buildonspark/spark-sdk 0.1.41 → 0.1.43
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 +15 -0
- package/android/src/main/jniLibs/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/src/main/jniLibs/x86/libuniffi_spark_frost.so +0 -0
- package/android/src/main/jniLibs/x86_64/libuniffi_spark_frost.so +0 -0
- package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.cts +10 -0
- package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.ts +10 -0
- package/dist/{RequestLightningSendInput-mXUWn_cp.d.ts → RequestLightningSendInput-D7fZdT4A.d.ts} +35 -16
- package/dist/{RequestLightningSendInput-DXcLoiCe.d.cts → RequestLightningSendInput-Na1mHdWg.d.cts} +35 -16
- package/dist/address/index.cjs +38 -7
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +3 -3
- package/dist/{chunk-ATEHMLKP.js → chunk-6AFUC5M2.js} +1 -1
- package/dist/{chunk-ZXDE2XMU.js → chunk-BUTZWYBW.js} +9 -6
- package/dist/{chunk-7EFSUADA.js → chunk-DOA6QXYQ.js} +1 -0
- package/dist/{chunk-J5W5Q2ZP.js → chunk-DQYKQJRZ.js} +291 -7
- package/dist/{chunk-TWF35O6M.js → chunk-GSI4OLXZ.js} +32 -1
- package/dist/{chunk-2ZXXLPG2.js → chunk-GYQR4B4P.js} +5 -4
- package/dist/{chunk-ROKY5KS4.js → chunk-HRQRRDSS.js} +53 -15
- package/dist/{chunk-YEZDPUFY.js → chunk-IRW5TWMH.js} +8 -8
- package/dist/{chunk-7VMYMQLF.js → chunk-NSJF5F5O.js} +1 -1
- package/dist/{chunk-TM4TOEOX.js → chunk-O4RYNJNB.js} +3 -3
- package/dist/{chunk-MGPRLH6Q.js → chunk-QNNSEJ4P.js} +1 -1
- package/dist/{chunk-UKT6OFLO.js → chunk-TIUBYNN5.js} +13 -7
- package/dist/{chunk-6YVPOQ2A.js → chunk-TOSP3INR.js} +235 -143
- package/dist/chunk-VFJQNBFX.js +21 -0
- package/dist/{chunk-KKSU7OZO.js → chunk-WWOTVNPP.js} +195 -67
- package/dist/{chunk-HK6LPV6Z.js → chunk-Z5HIAYFT.js} +1 -1
- package/dist/graphql/objects/index.cjs +229 -135
- package/dist/graphql/objects/index.d.cts +54 -9
- package/dist/graphql/objects/index.d.ts +54 -9
- package/dist/graphql/objects/index.js +3 -3
- package/dist/{index-OSDtPMmC.d.ts → index-7RYRH5wc.d.ts} +10 -8
- package/dist/{index-CFh4uWzi.d.cts → index-BJOc8Ur-.d.cts} +10 -8
- package/dist/index.cjs +790 -315
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +26 -26
- package/dist/index.node.cjs +790 -315
- package/dist/index.node.d.cts +9 -8
- package/dist/index.node.d.ts +9 -8
- package/dist/index.node.js +26 -26
- package/dist/native/index.cjs +812 -332
- package/dist/native/index.d.cts +53 -18
- package/dist/native/index.d.ts +53 -18
- package/dist/native/index.js +659 -181
- package/dist/{network-BiwBmoOg.d.cts → network-D5lKssVl.d.cts} +1 -1
- package/dist/{network-BF2GYPye.d.ts → network-xkBSpaTn.d.ts} +1 -1
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- 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/{sdk-types-CfhdFnsA.d.cts → sdk-types-B-q9py_P.d.cts} +1 -1
- package/dist/{sdk-types-MnQrHolg.d.ts → sdk-types-BPoPgzda.d.ts} +1 -1
- package/dist/services/config.cjs +118 -69
- package/dist/services/config.d.cts +6 -4
- package/dist/services/config.d.ts +6 -4
- package/dist/services/config.js +9 -9
- package/dist/services/connection.cjs +95 -15
- package/dist/services/connection.d.cts +6 -4
- package/dist/services/connection.d.ts +6 -4
- package/dist/services/connection.js +3 -3
- package/dist/services/index.cjs +487 -117
- package/dist/services/index.d.cts +5 -4
- package/dist/services/index.d.ts +5 -4
- package/dist/services/index.js +19 -19
- package/dist/services/lrc-connection.cjs +50 -7
- package/dist/services/lrc-connection.d.cts +5 -4
- package/dist/services/lrc-connection.d.ts +5 -4
- package/dist/services/lrc-connection.js +3 -3
- package/dist/services/token-transactions.cjs +351 -36
- package/dist/services/token-transactions.d.cts +5 -4
- package/dist/services/token-transactions.d.ts +5 -4
- package/dist/services/token-transactions.js +6 -6
- package/dist/services/wallet-config.cjs +1 -0
- package/dist/services/wallet-config.d.cts +6 -4
- package/dist/services/wallet-config.d.ts +6 -4
- package/dist/services/wallet-config.js +1 -1
- package/dist/signer/signer.cjs +117 -64
- package/dist/signer/signer.d.cts +4 -3
- package/dist/signer/signer.d.ts +4 -3
- package/dist/signer/signer.js +15 -7
- package/dist/{signer-CylxIujU.d.ts → signer-IO3oMRNj.d.cts} +2 -1
- package/dist/{signer-BhLS7SYR.d.cts → signer-wqesWifN.d.ts} +2 -1
- package/dist/{spark-DjR1b3TC.d.cts → spark-CDm4gqS6.d.cts} +1 -1
- package/dist/{spark-DjR1b3TC.d.ts → spark-CDm4gqS6.d.ts} +1 -1
- package/dist/types/index.cjs +282 -188
- package/dist/types/index.d.cts +7 -6
- package/dist/types/index.d.ts +7 -6
- package/dist/types/index.js +3 -3
- package/dist/utils/index.cjs +90 -58
- package/dist/utils/index.d.cts +6 -5
- package/dist/utils/index.d.ts +6 -5
- package/dist/utils/index.js +16 -16
- package/ios/spark_frostFFI.xcframework/ios-arm64/SparkFrost +0 -0
- package/ios/spark_frostFFI.xcframework/ios-arm64/spark_frostFFI.framework/spark_frostFFI +0 -0
- package/ios/spark_frostFFI.xcframework/ios-arm64_x86_64-simulator/SparkFrost +0 -0
- package/ios/spark_frostFFI.xcframework/ios-arm64_x86_64-simulator/spark_frostFFI.framework/spark_frostFFI +0 -0
- package/ios/spark_frostFFI.xcframework/macos-arm64_x86_64/spark_frostFFI.framework/spark_frostFFI +0 -0
- package/package.json +4 -4
- package/src/constants.ts +21 -0
- package/src/errors/base.ts +43 -1
- package/src/graphql/client.ts +4 -0
- package/src/graphql/mutations/RequestLightningSend.ts +2 -0
- package/src/graphql/objects/ClaimStaticDepositInput.ts +1 -1
- package/src/graphql/objects/ClaimStaticDepositStatus.ts +4 -2
- package/src/graphql/objects/Connection.ts +7 -7
- package/src/graphql/objects/CoopExitFeeEstimate.ts +1 -1
- package/src/graphql/objects/CoopExitFeeQuote.ts +202 -0
- package/src/graphql/objects/CoopExitFeeQuoteInput.ts +41 -0
- package/src/graphql/objects/CoopExitFeeQuoteOutput.ts +45 -0
- package/src/graphql/objects/CoopExitRequest.ts +21 -0
- package/src/graphql/objects/CurrencyUnit.ts +26 -28
- package/src/graphql/objects/Entity.ts +84 -0
- package/src/graphql/objects/Invoice.ts +2 -2
- package/src/graphql/objects/Leaf.ts +1 -1
- package/src/graphql/objects/LeavesSwapFeeEstimateOutput.ts +1 -1
- package/src/graphql/objects/LeavesSwapRequest.ts +6 -0
- package/src/graphql/objects/LightningReceiveRequest.ts +11 -0
- package/src/graphql/objects/LightningSendFeeEstimateInput.ts +8 -0
- package/src/graphql/objects/LightningSendFeeEstimateOutput.ts +1 -1
- package/src/graphql/objects/LightningSendRequest.ts +3 -0
- package/src/graphql/objects/RequestCoopExitInput.ts +8 -0
- package/src/graphql/objects/RequestLeavesSwapInput.ts +5 -1
- package/src/graphql/objects/RequestLightningReceiveInput.ts +9 -2
- package/src/graphql/objects/RequestLightningSendInput.ts +8 -0
- package/src/graphql/objects/SparkCoopExitRequestStatus.ts +2 -0
- package/src/graphql/objects/SparkUserRequestType.ts +2 -0
- package/src/graphql/objects/SparkWalletUser.ts +20 -0
- package/src/graphql/objects/UserRequest.ts +32 -0
- package/src/graphql/objects/VerifyChallengeInput.ts +1 -1
- package/src/graphql/objects/index.ts +12 -3
- package/src/graphql/queries/LightningSendFeeEstimate.ts +2 -0
- package/src/logger.ts +3 -0
- package/src/native/index.ts +1 -0
- package/src/services/config.ts +4 -0
- package/src/services/connection.ts +68 -29
- package/src/services/coop-exit.ts +1 -1
- package/src/services/lightning.ts +25 -1
- package/src/services/lrc-connection.ts +3 -3
- package/src/services/token-transactions.ts +6 -2
- package/src/services/wallet-config.ts +2 -0
- package/src/signer/signer.ts +4 -1
- package/src/spark-wallet/spark-wallet.ts +51 -15
- package/src/spark-wallet/types.ts +1 -0
- package/src/tests/errors.test.ts +58 -0
- package/src/tests/integration/lightning.test.ts +184 -0
- package/src/tests/integration/ssp/static_deposit.test.ts +1 -2
- package/src/tests/tokens.test.ts +52 -3
- package/src/utils/token-hashing.ts +335 -1
- package/dist/LightningSendFeeEstimateInput-CJvPnCSB.d.cts +0 -5
- package/dist/LightningSendFeeEstimateInput-CJvPnCSB.d.ts +0 -5
- package/dist/chunk-HKAKEKCE.js +0 -8
|
@@ -49,13 +49,14 @@ if (typeof window !== "undefined") {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// src/services/token-transactions.ts
|
|
52
|
-
var
|
|
52
|
+
var import_utils6 = require("@noble/curves/abstract/utils");
|
|
53
53
|
var import_secp256k14 = require("@noble/curves/secp256k1");
|
|
54
54
|
|
|
55
55
|
// src/utils/token-hashing.ts
|
|
56
56
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
57
57
|
|
|
58
58
|
// src/errors/base.ts
|
|
59
|
+
var import_utils = require("@noble/hashes/utils");
|
|
59
60
|
var SparkSDKError = class extends Error {
|
|
60
61
|
context;
|
|
61
62
|
originalError;
|
|
@@ -87,12 +88,42 @@ var SparkSDKError = class extends Error {
|
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
90
|
function getMessage(message, context = {}, originalError) {
|
|
90
|
-
const contextStr = Object.entries(context).map(([key, value]) => `${key}: ${
|
|
91
|
+
const contextStr = Object.entries(context).map(([key, value]) => `${key}: ${safeStringify(value)}`).join(", ");
|
|
91
92
|
const originalErrorStr = originalError ? `
|
|
92
93
|
Original Error: ${originalError.message}` : "";
|
|
93
94
|
return `SparkSDKError: ${message}${contextStr ? `
|
|
94
95
|
Context: ${contextStr}` : ""}${originalErrorStr}`;
|
|
95
96
|
}
|
|
97
|
+
function safeStringify(value) {
|
|
98
|
+
const replacer = (_, v) => {
|
|
99
|
+
if (typeof v === "bigint") {
|
|
100
|
+
return v.toString();
|
|
101
|
+
}
|
|
102
|
+
if (v instanceof Uint8Array) {
|
|
103
|
+
return formatUint8Array(v);
|
|
104
|
+
}
|
|
105
|
+
return v;
|
|
106
|
+
};
|
|
107
|
+
if (typeof value === "bigint") {
|
|
108
|
+
return `"${value.toString()}"`;
|
|
109
|
+
}
|
|
110
|
+
if (value instanceof Uint8Array) {
|
|
111
|
+
return `"${formatUint8Array(value)}"`;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const result = JSON.stringify(value, replacer);
|
|
115
|
+
return result === void 0 ? String(value) : result;
|
|
116
|
+
} catch {
|
|
117
|
+
try {
|
|
118
|
+
return String(value);
|
|
119
|
+
} catch {
|
|
120
|
+
return "[Unserializable]";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function formatUint8Array(arr) {
|
|
125
|
+
return `Uint8Array(0x${(0, import_utils.bytesToHex)(arr)})`;
|
|
126
|
+
}
|
|
96
127
|
|
|
97
128
|
// src/errors/types.ts
|
|
98
129
|
var NetworkError = class extends SparkSDKError {
|
|
@@ -113,6 +144,19 @@ var InternalValidationError = class extends SparkSDKError {
|
|
|
113
144
|
|
|
114
145
|
// src/utils/token-hashing.ts
|
|
115
146
|
function hashTokenTransaction(tokenTransaction, partialHash = false) {
|
|
147
|
+
switch (tokenTransaction.version) {
|
|
148
|
+
case 0:
|
|
149
|
+
return hashTokenTransactionV0(tokenTransaction, partialHash);
|
|
150
|
+
case 1:
|
|
151
|
+
return hashTokenTransactionV1(tokenTransaction, partialHash);
|
|
152
|
+
default:
|
|
153
|
+
throw new ValidationError("invalid token transaction version", {
|
|
154
|
+
field: "tokenTransaction.version",
|
|
155
|
+
value: tokenTransaction.version
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function hashTokenTransactionV0(tokenTransaction, partialHash = false) {
|
|
116
160
|
if (!tokenTransaction) {
|
|
117
161
|
throw new ValidationError("token transaction cannot be nil", {
|
|
118
162
|
field: "tokenTransaction"
|
|
@@ -360,6 +404,275 @@ function hashTokenTransaction(tokenTransaction, partialHash = false) {
|
|
|
360
404
|
finalHashObj.update(concatenatedHashes);
|
|
361
405
|
return finalHashObj.digest();
|
|
362
406
|
}
|
|
407
|
+
function hashTokenTransactionV1(tokenTransaction, partialHash = false) {
|
|
408
|
+
if (!tokenTransaction) {
|
|
409
|
+
throw new ValidationError("token transaction cannot be nil", {
|
|
410
|
+
field: "tokenTransaction"
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
let allHashes = [];
|
|
414
|
+
const versionHashObj = import_sha2.sha256.create();
|
|
415
|
+
const versionBytes = new Uint8Array(4);
|
|
416
|
+
new DataView(versionBytes.buffer).setUint32(
|
|
417
|
+
0,
|
|
418
|
+
tokenTransaction.version,
|
|
419
|
+
false
|
|
420
|
+
// false for big-endian
|
|
421
|
+
);
|
|
422
|
+
versionHashObj.update(versionBytes);
|
|
423
|
+
allHashes.push(versionHashObj.digest());
|
|
424
|
+
if (tokenTransaction.tokenInputs?.$case === "transferInput") {
|
|
425
|
+
if (!tokenTransaction.tokenInputs.transferInput.outputsToSpend) {
|
|
426
|
+
throw new ValidationError("outputs to spend cannot be null", {
|
|
427
|
+
field: "tokenInputs.transferInput.outputsToSpend"
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
if (tokenTransaction.tokenInputs.transferInput.outputsToSpend.length === 0) {
|
|
431
|
+
throw new ValidationError("outputs to spend cannot be empty", {
|
|
432
|
+
field: "tokenInputs.transferInput.outputsToSpend"
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
for (const [
|
|
436
|
+
i,
|
|
437
|
+
output
|
|
438
|
+
] of tokenTransaction.tokenInputs.transferInput.outputsToSpend.entries()) {
|
|
439
|
+
if (!output) {
|
|
440
|
+
throw new ValidationError(`output cannot be null at index ${i}`, {
|
|
441
|
+
field: `tokenInputs.transferInput.outputsToSpend[${i}]`,
|
|
442
|
+
index: i
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
const hashObj2 = import_sha2.sha256.create();
|
|
446
|
+
if (output.prevTokenTransactionHash) {
|
|
447
|
+
const prevHash = output.prevTokenTransactionHash;
|
|
448
|
+
if (output.prevTokenTransactionHash.length !== 32) {
|
|
449
|
+
throw new ValidationError(
|
|
450
|
+
`invalid previous transaction hash length at index ${i}`,
|
|
451
|
+
{
|
|
452
|
+
field: `tokenInputs.transferInput.outputsToSpend[${i}].prevTokenTransactionHash`,
|
|
453
|
+
value: prevHash,
|
|
454
|
+
expectedLength: 32,
|
|
455
|
+
actualLength: prevHash.length,
|
|
456
|
+
index: i
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
hashObj2.update(output.prevTokenTransactionHash);
|
|
461
|
+
}
|
|
462
|
+
const voutBytes = new Uint8Array(4);
|
|
463
|
+
new DataView(voutBytes.buffer).setUint32(
|
|
464
|
+
0,
|
|
465
|
+
output.prevTokenTransactionVout,
|
|
466
|
+
false
|
|
467
|
+
);
|
|
468
|
+
hashObj2.update(voutBytes);
|
|
469
|
+
allHashes.push(hashObj2.digest());
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (tokenTransaction.tokenInputs?.$case === "mintInput") {
|
|
473
|
+
const hashObj2 = import_sha2.sha256.create();
|
|
474
|
+
if (tokenTransaction.tokenInputs.mintInput.issuerPublicKey) {
|
|
475
|
+
const issuerPubKey = tokenTransaction.tokenInputs.mintInput.issuerPublicKey;
|
|
476
|
+
if (issuerPubKey.length === 0) {
|
|
477
|
+
throw new ValidationError("issuer public key cannot be empty", {
|
|
478
|
+
field: "tokenInputs.mintInput.issuerPublicKey",
|
|
479
|
+
value: issuerPubKey,
|
|
480
|
+
expectedLength: 1,
|
|
481
|
+
actualLength: 0
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
hashObj2.update(issuerPubKey);
|
|
485
|
+
if (tokenTransaction.tokenInputs.mintInput.issuerProvidedTimestamp != 0) {
|
|
486
|
+
const timestampBytes = new Uint8Array(8);
|
|
487
|
+
new DataView(timestampBytes.buffer).setBigUint64(
|
|
488
|
+
0,
|
|
489
|
+
BigInt(
|
|
490
|
+
tokenTransaction.tokenInputs.mintInput.issuerProvidedTimestamp
|
|
491
|
+
),
|
|
492
|
+
true
|
|
493
|
+
// true for little-endian to match Go implementation
|
|
494
|
+
);
|
|
495
|
+
hashObj2.update(timestampBytes);
|
|
496
|
+
}
|
|
497
|
+
allHashes.push(hashObj2.digest());
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (!tokenTransaction.tokenOutputs) {
|
|
501
|
+
throw new ValidationError("token outputs cannot be null", {
|
|
502
|
+
field: "tokenOutputs"
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
if (tokenTransaction.tokenOutputs.length === 0) {
|
|
506
|
+
throw new ValidationError("token outputs cannot be empty", {
|
|
507
|
+
field: "tokenOutputs"
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
for (const [i, output] of tokenTransaction.tokenOutputs.entries()) {
|
|
511
|
+
if (!output) {
|
|
512
|
+
throw new ValidationError(`output cannot be null at index ${i}`, {
|
|
513
|
+
field: `tokenOutputs[${i}]`,
|
|
514
|
+
index: i
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
const hashObj2 = import_sha2.sha256.create();
|
|
518
|
+
if (output.id && !partialHash) {
|
|
519
|
+
if (output.id.length === 0) {
|
|
520
|
+
throw new ValidationError(`output ID at index ${i} cannot be empty`, {
|
|
521
|
+
field: `tokenOutputs[${i}].id`,
|
|
522
|
+
index: i
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
hashObj2.update(new TextEncoder().encode(output.id));
|
|
526
|
+
}
|
|
527
|
+
if (output.ownerPublicKey) {
|
|
528
|
+
if (output.ownerPublicKey.length === 0) {
|
|
529
|
+
throw new ValidationError(
|
|
530
|
+
`owner public key at index ${i} cannot be empty`,
|
|
531
|
+
{
|
|
532
|
+
field: `tokenOutputs[${i}].ownerPublicKey`,
|
|
533
|
+
index: i
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
hashObj2.update(output.ownerPublicKey);
|
|
538
|
+
}
|
|
539
|
+
if (!partialHash) {
|
|
540
|
+
const revPubKey = output.revocationCommitment;
|
|
541
|
+
if (revPubKey) {
|
|
542
|
+
if (revPubKey.length === 0) {
|
|
543
|
+
throw new ValidationError(
|
|
544
|
+
`revocation commitment at index ${i} cannot be empty`,
|
|
545
|
+
{
|
|
546
|
+
field: `tokenOutputs[${i}].revocationCommitment`,
|
|
547
|
+
index: i
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
hashObj2.update(revPubKey);
|
|
552
|
+
}
|
|
553
|
+
const bondBytes = new Uint8Array(8);
|
|
554
|
+
new DataView(bondBytes.buffer).setBigUint64(
|
|
555
|
+
0,
|
|
556
|
+
BigInt(output.withdrawBondSats),
|
|
557
|
+
false
|
|
558
|
+
);
|
|
559
|
+
hashObj2.update(bondBytes);
|
|
560
|
+
const locktimeBytes = new Uint8Array(8);
|
|
561
|
+
new DataView(locktimeBytes.buffer).setBigUint64(
|
|
562
|
+
0,
|
|
563
|
+
BigInt(output.withdrawRelativeBlockLocktime),
|
|
564
|
+
false
|
|
565
|
+
);
|
|
566
|
+
hashObj2.update(locktimeBytes);
|
|
567
|
+
}
|
|
568
|
+
if (output.tokenPublicKey) {
|
|
569
|
+
if (output.tokenPublicKey.length === 0) {
|
|
570
|
+
throw new ValidationError(
|
|
571
|
+
`token public key at index ${i} cannot be empty`,
|
|
572
|
+
{
|
|
573
|
+
field: `tokenOutputs[${i}].tokenPublicKey`,
|
|
574
|
+
index: i
|
|
575
|
+
}
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
hashObj2.update(output.tokenPublicKey);
|
|
579
|
+
}
|
|
580
|
+
if (output.tokenAmount) {
|
|
581
|
+
if (output.tokenAmount.length === 0) {
|
|
582
|
+
throw new ValidationError(
|
|
583
|
+
`token amount at index ${i} cannot be empty`,
|
|
584
|
+
{
|
|
585
|
+
field: `tokenOutputs[${i}].tokenAmount`,
|
|
586
|
+
index: i
|
|
587
|
+
}
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
if (output.tokenAmount.length > 16) {
|
|
591
|
+
throw new ValidationError(
|
|
592
|
+
`token amount at index ${i} exceeds maximum length`,
|
|
593
|
+
{
|
|
594
|
+
field: `tokenOutputs[${i}].tokenAmount`,
|
|
595
|
+
value: output.tokenAmount,
|
|
596
|
+
expectedLength: 16,
|
|
597
|
+
actualLength: output.tokenAmount.length,
|
|
598
|
+
index: i
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
hashObj2.update(output.tokenAmount);
|
|
603
|
+
}
|
|
604
|
+
allHashes.push(hashObj2.digest());
|
|
605
|
+
}
|
|
606
|
+
if (!tokenTransaction.sparkOperatorIdentityPublicKeys) {
|
|
607
|
+
throw new ValidationError(
|
|
608
|
+
"spark operator identity public keys cannot be null",
|
|
609
|
+
{}
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
const sortedPubKeys = [
|
|
613
|
+
...tokenTransaction.sparkOperatorIdentityPublicKeys || []
|
|
614
|
+
].sort((a, b) => {
|
|
615
|
+
for (let i = 0; i < a.length && i < b.length; i++) {
|
|
616
|
+
if (a[i] !== b[i]) return a[i] - b[i];
|
|
617
|
+
}
|
|
618
|
+
return a.length - b.length;
|
|
619
|
+
});
|
|
620
|
+
for (const [i, pubKey] of sortedPubKeys.entries()) {
|
|
621
|
+
if (!pubKey) {
|
|
622
|
+
throw new ValidationError(
|
|
623
|
+
`operator public key at index ${i} cannot be null`,
|
|
624
|
+
{
|
|
625
|
+
field: `sparkOperatorIdentityPublicKeys[${i}]`,
|
|
626
|
+
index: i
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
if (pubKey.length === 0) {
|
|
631
|
+
throw new ValidationError(
|
|
632
|
+
`operator public key at index ${i} cannot be empty`,
|
|
633
|
+
{
|
|
634
|
+
field: `sparkOperatorIdentityPublicKeys[${i}]`,
|
|
635
|
+
index: i
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
const hashObj2 = import_sha2.sha256.create();
|
|
640
|
+
hashObj2.update(pubKey);
|
|
641
|
+
allHashes.push(hashObj2.digest());
|
|
642
|
+
}
|
|
643
|
+
const hashObj = import_sha2.sha256.create();
|
|
644
|
+
let networkBytes = new Uint8Array(4);
|
|
645
|
+
new DataView(networkBytes.buffer).setUint32(
|
|
646
|
+
0,
|
|
647
|
+
tokenTransaction.network.valueOf(),
|
|
648
|
+
false
|
|
649
|
+
// false for big-endian
|
|
650
|
+
);
|
|
651
|
+
hashObj.update(networkBytes);
|
|
652
|
+
allHashes.push(hashObj.digest());
|
|
653
|
+
const expiryHashObj = import_sha2.sha256.create();
|
|
654
|
+
const validityDurationBytes = new Uint8Array(8);
|
|
655
|
+
const expiryUnixTime = tokenTransaction.expiryTime ? Math.floor(tokenTransaction.expiryTime.getTime() / 1e3) : 0;
|
|
656
|
+
new DataView(validityDurationBytes.buffer).setBigUint64(
|
|
657
|
+
0,
|
|
658
|
+
BigInt(expiryUnixTime),
|
|
659
|
+
false
|
|
660
|
+
// false for big-endian
|
|
661
|
+
);
|
|
662
|
+
expiryHashObj.update(validityDurationBytes);
|
|
663
|
+
allHashes.push(expiryHashObj.digest());
|
|
664
|
+
const finalHashObj = import_sha2.sha256.create();
|
|
665
|
+
const concatenatedHashes = new Uint8Array(
|
|
666
|
+
allHashes.reduce((sum, hash) => sum + hash.length, 0)
|
|
667
|
+
);
|
|
668
|
+
let offset = 0;
|
|
669
|
+
for (const hash of allHashes) {
|
|
670
|
+
concatenatedHashes.set(hash, offset);
|
|
671
|
+
offset += hash.length;
|
|
672
|
+
}
|
|
673
|
+
finalHashObj.update(concatenatedHashes);
|
|
674
|
+
return finalHashObj.digest();
|
|
675
|
+
}
|
|
363
676
|
function hashOperatorSpecificTokenTransactionSignablePayload(payload) {
|
|
364
677
|
if (!payload) {
|
|
365
678
|
throw new ValidationError(
|
|
@@ -410,15 +723,15 @@ function hashOperatorSpecificTokenTransactionSignablePayload(payload) {
|
|
|
410
723
|
}
|
|
411
724
|
|
|
412
725
|
// src/utils/token-transactions.ts
|
|
413
|
-
var
|
|
726
|
+
var import_utils2 = require("@noble/curves/abstract/utils");
|
|
414
727
|
function calculateAvailableTokenAmount(outputLeaves) {
|
|
415
728
|
return outputLeaves.reduce(
|
|
416
|
-
(sum, output) => sum + BigInt((0,
|
|
729
|
+
(sum, output) => sum + BigInt((0, import_utils2.bytesToNumberBE)(output.output.tokenAmount)),
|
|
417
730
|
BigInt(0)
|
|
418
731
|
);
|
|
419
732
|
}
|
|
420
733
|
function checkIfSelectedOutputsAreAvailable(selectedOutputs, tokenOutputs, tokenPublicKey) {
|
|
421
|
-
const tokenPubKeyHex = (0,
|
|
734
|
+
const tokenPubKeyHex = (0, import_utils2.bytesToHex)(tokenPublicKey);
|
|
422
735
|
const tokenOutputsAvailable = tokenOutputs.get(tokenPubKeyHex);
|
|
423
736
|
if (!tokenOutputsAvailable) {
|
|
424
737
|
return false;
|
|
@@ -693,11 +1006,11 @@ function validateTokenTransaction(finalTokenTransaction, partialTokenTransaction
|
|
|
693
1006
|
}
|
|
694
1007
|
|
|
695
1008
|
// src/services/token-transactions.ts
|
|
696
|
-
var
|
|
1009
|
+
var import_utils7 = require("@noble/hashes/utils");
|
|
697
1010
|
|
|
698
1011
|
// src/address/address.ts
|
|
699
1012
|
var import_secp256k1 = require("@noble/curves/secp256k1");
|
|
700
|
-
var
|
|
1013
|
+
var import_utils3 = require("@noble/hashes/utils");
|
|
701
1014
|
var import_base2 = require("@scure/base");
|
|
702
1015
|
|
|
703
1016
|
// src/proto/spark.ts
|
|
@@ -908,7 +1221,7 @@ function isSet(value) {
|
|
|
908
1221
|
|
|
909
1222
|
// src/address/address.ts
|
|
910
1223
|
var import_uuidv7 = require("uuidv7");
|
|
911
|
-
var
|
|
1224
|
+
var import_utils4 = require("@noble/curves/abstract/utils");
|
|
912
1225
|
var AddressNetwork = {
|
|
913
1226
|
MAINNET: "sp",
|
|
914
1227
|
TESTNET: "spt",
|
|
@@ -927,7 +1240,7 @@ function decodeSparkAddress(address, network) {
|
|
|
927
1240
|
});
|
|
928
1241
|
}
|
|
929
1242
|
const payload = SparkAddress.decode(import_base2.bech32m.fromWords(decoded.words));
|
|
930
|
-
const publicKey = (0,
|
|
1243
|
+
const publicKey = (0, import_utils3.bytesToHex)(payload.identityPublicKey);
|
|
931
1244
|
isValidPublicKey(publicKey);
|
|
932
1245
|
const paymentIntentFields = payload.paymentIntentFields;
|
|
933
1246
|
return {
|
|
@@ -935,8 +1248,8 @@ function decodeSparkAddress(address, network) {
|
|
|
935
1248
|
network,
|
|
936
1249
|
paymentIntentFields: paymentIntentFields && {
|
|
937
1250
|
id: import_uuidv7.UUID.ofInner(paymentIntentFields.id).toString(),
|
|
938
|
-
assetIdentifier: paymentIntentFields.assetIdentifier ? (0,
|
|
939
|
-
assetAmount: (0,
|
|
1251
|
+
assetIdentifier: paymentIntentFields.assetIdentifier ? (0, import_utils3.bytesToHex)(paymentIntentFields.assetIdentifier) : void 0,
|
|
1252
|
+
assetAmount: (0, import_utils4.bytesToNumberBE)(paymentIntentFields.assetAmount),
|
|
940
1253
|
memo: paymentIntentFields.memo
|
|
941
1254
|
}
|
|
942
1255
|
};
|
|
@@ -995,7 +1308,7 @@ function collectResponses(responses) {
|
|
|
995
1308
|
var import_secp256k13 = require("@noble/curves/secp256k1");
|
|
996
1309
|
|
|
997
1310
|
// src/utils/secret-sharing.ts
|
|
998
|
-
var
|
|
1311
|
+
var import_utils5 = require("@noble/curves/abstract/utils");
|
|
999
1312
|
var import_secp256k12 = require("@noble/curves/secp256k1");
|
|
1000
1313
|
|
|
1001
1314
|
// src/utils/crypto.ts
|
|
@@ -1137,7 +1450,7 @@ var TokenTransactionService = class {
|
|
|
1137
1450
|
if (!checkIfSelectedOutputsAreAvailable(
|
|
1138
1451
|
outputsToUse,
|
|
1139
1452
|
tokenOutputs,
|
|
1140
|
-
(0,
|
|
1453
|
+
(0, import_utils7.hexToBytes)(receiverOutputs[0].tokenPublicKey)
|
|
1141
1454
|
)) {
|
|
1142
1455
|
throw new ValidationError(
|
|
1143
1456
|
"One or more selected TTXOs are not available",
|
|
@@ -1178,8 +1491,8 @@ var TokenTransactionService = class {
|
|
|
1178
1491
|
this.config.getNetworkType()
|
|
1179
1492
|
);
|
|
1180
1493
|
return {
|
|
1181
|
-
receiverSparkAddress: (0,
|
|
1182
|
-
tokenPublicKey: (0,
|
|
1494
|
+
receiverSparkAddress: (0, import_utils7.hexToBytes)(receiverAddress.identityPublicKey),
|
|
1495
|
+
tokenPublicKey: (0, import_utils7.hexToBytes)(transfer.tokenPublicKey),
|
|
1183
1496
|
tokenAmount: transfer.tokenAmount
|
|
1184
1497
|
};
|
|
1185
1498
|
});
|
|
@@ -1211,7 +1524,7 @@ var TokenTransactionService = class {
|
|
|
1211
1524
|
const tokenOutputs = tokenOutputData.map((output) => ({
|
|
1212
1525
|
ownerPublicKey: output.receiverSparkAddress,
|
|
1213
1526
|
tokenPublicKey: output.tokenPublicKey,
|
|
1214
|
-
tokenAmount: (0,
|
|
1527
|
+
tokenAmount: (0, import_utils6.numberToBytesBE)(output.tokenAmount, 16)
|
|
1215
1528
|
}));
|
|
1216
1529
|
if (availableTokenAmount > totalRequestedAmount) {
|
|
1217
1530
|
const changeAmount = availableTokenAmount - totalRequestedAmount;
|
|
@@ -1219,7 +1532,7 @@ var TokenTransactionService = class {
|
|
|
1219
1532
|
tokenOutputs.push({
|
|
1220
1533
|
ownerPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
1221
1534
|
tokenPublicKey: firstTokenPublicKey,
|
|
1222
|
-
tokenAmount: (0,
|
|
1535
|
+
tokenAmount: (0, import_utils6.numberToBytesBE)(changeAmount, 16)
|
|
1223
1536
|
});
|
|
1224
1537
|
}
|
|
1225
1538
|
return {
|
|
@@ -1246,7 +1559,7 @@ var TokenTransactionService = class {
|
|
|
1246
1559
|
const tokenOutputs = tokenOutputData.map((output) => ({
|
|
1247
1560
|
ownerPublicKey: output.receiverSparkAddress,
|
|
1248
1561
|
tokenPublicKey: output.tokenPublicKey,
|
|
1249
|
-
tokenAmount: (0,
|
|
1562
|
+
tokenAmount: (0, import_utils6.numberToBytesBE)(output.tokenAmount, 16)
|
|
1250
1563
|
}));
|
|
1251
1564
|
if (availableTokenAmount > totalRequestedAmount) {
|
|
1252
1565
|
const changeAmount = availableTokenAmount - totalRequestedAmount;
|
|
@@ -1254,7 +1567,7 @@ var TokenTransactionService = class {
|
|
|
1254
1567
|
tokenOutputs.push({
|
|
1255
1568
|
ownerPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
1256
1569
|
tokenPublicKey: firstTokenPublicKey,
|
|
1257
|
-
tokenAmount: (0,
|
|
1570
|
+
tokenAmount: (0, import_utils6.numberToBytesBE)(changeAmount, 16)
|
|
1258
1571
|
});
|
|
1259
1572
|
}
|
|
1260
1573
|
return {
|
|
@@ -1279,7 +1592,7 @@ var TokenTransactionService = class {
|
|
|
1279
1592
|
for (const [_, operator] of Object.entries(
|
|
1280
1593
|
this.config.getSigningOperators()
|
|
1281
1594
|
)) {
|
|
1282
|
-
operatorKeys.push((0,
|
|
1595
|
+
operatorKeys.push((0, import_utils7.hexToBytes)(operator.identityPublicKey));
|
|
1283
1596
|
}
|
|
1284
1597
|
return operatorKeys;
|
|
1285
1598
|
}
|
|
@@ -1363,7 +1676,7 @@ var TokenTransactionService = class {
|
|
|
1363
1676
|
{
|
|
1364
1677
|
field: "revocationCommitment",
|
|
1365
1678
|
value: derivedRevocationCommitment,
|
|
1366
|
-
expected: (0,
|
|
1679
|
+
expected: (0, import_utils6.bytesToHex)(outputsToSpendCommitments[outputIndex]),
|
|
1367
1680
|
outputIndex
|
|
1368
1681
|
}
|
|
1369
1682
|
)
|
|
@@ -1389,7 +1702,7 @@ var TokenTransactionService = class {
|
|
|
1389
1702
|
threshold
|
|
1390
1703
|
);
|
|
1391
1704
|
}
|
|
1392
|
-
return (0,
|
|
1705
|
+
return (0, import_utils6.bytesToHex)(finalTokenTransactionHash);
|
|
1393
1706
|
}
|
|
1394
1707
|
async broadcastTokenTransactionV1(tokenTransaction, signingOperators, outputsToSpendSigningPublicKeys, outputsToSpendCommitments) {
|
|
1395
1708
|
const { finalTokenTransaction, finalTokenTransactionHash, threshold } = await this.startTokenTransaction(
|
|
@@ -1403,13 +1716,13 @@ var TokenTransactionService = class {
|
|
|
1403
1716
|
finalTokenTransactionHash,
|
|
1404
1717
|
signingOperators
|
|
1405
1718
|
);
|
|
1406
|
-
return (0,
|
|
1719
|
+
return (0, import_utils6.bytesToHex)(finalTokenTransactionHash);
|
|
1407
1720
|
}
|
|
1408
1721
|
async startTokenTransactionV0(tokenTransaction, signingOperators, outputsToSpendSigningPublicKeys, outputsToSpendCommitments) {
|
|
1409
1722
|
const sparkClient = await this.connectionManager.createSparkClient(
|
|
1410
1723
|
this.config.getCoordinatorAddress()
|
|
1411
1724
|
);
|
|
1412
|
-
const partialTokenTransactionHash =
|
|
1725
|
+
const partialTokenTransactionHash = hashTokenTransactionV0(
|
|
1413
1726
|
tokenTransaction,
|
|
1414
1727
|
true
|
|
1415
1728
|
);
|
|
@@ -1490,7 +1803,7 @@ var TokenTransactionService = class {
|
|
|
1490
1803
|
this.config.getThreshold()
|
|
1491
1804
|
);
|
|
1492
1805
|
const finalTokenTransaction = startResponse.finalTokenTransaction;
|
|
1493
|
-
const finalTokenTransactionHash =
|
|
1806
|
+
const finalTokenTransactionHash = hashTokenTransactionV0(
|
|
1494
1807
|
finalTokenTransaction,
|
|
1495
1808
|
false
|
|
1496
1809
|
);
|
|
@@ -1558,7 +1871,9 @@ var TokenTransactionService = class {
|
|
|
1558
1871
|
const startResponse = await sparkClient.start_transaction(
|
|
1559
1872
|
{
|
|
1560
1873
|
identityPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
1561
|
-
partialTokenTransaction: tokenTransaction
|
|
1874
|
+
partialTokenTransaction: tokenTransaction,
|
|
1875
|
+
validityDurationSeconds: await this.config.getTokenValidityDurationSeconds(),
|
|
1876
|
+
partialTokenTransactionOwnerSignatures: ownerSignaturesWithIndex
|
|
1562
1877
|
},
|
|
1563
1878
|
{
|
|
1564
1879
|
retry: true,
|
|
@@ -1600,7 +1915,7 @@ var TokenTransactionService = class {
|
|
|
1600
1915
|
const identityPublicKey = await this.config.signer.getIdentityPublicKey();
|
|
1601
1916
|
const payload = {
|
|
1602
1917
|
finalTokenTransactionHash,
|
|
1603
|
-
operatorIdentityPublicKey: (0,
|
|
1918
|
+
operatorIdentityPublicKey: (0, import_utils7.hexToBytes)(operator.identityPublicKey)
|
|
1604
1919
|
};
|
|
1605
1920
|
const payloadHash = await hashOperatorSpecificTokenTransactionSignablePayload(payload);
|
|
1606
1921
|
let operatorSpecificSignatures = [];
|
|
@@ -1757,7 +2072,7 @@ var TokenTransactionService = class {
|
|
|
1757
2072
|
[]
|
|
1758
2073
|
);
|
|
1759
2074
|
unsortedTokenOutputs.forEach((output) => {
|
|
1760
|
-
const tokenKey = (0,
|
|
2075
|
+
const tokenKey = (0, import_utils6.bytesToHex)(output.output.tokenPublicKey);
|
|
1761
2076
|
const index = output.previousTransactionVout;
|
|
1762
2077
|
tokenOutputs.set(tokenKey, [
|
|
1763
2078
|
{ ...output, previousTransactionVout: index }
|
|
@@ -1773,7 +2088,7 @@ var TokenTransactionService = class {
|
|
|
1773
2088
|
});
|
|
1774
2089
|
}
|
|
1775
2090
|
const exactMatch = tokenOutputs.find(
|
|
1776
|
-
(item) => (0,
|
|
2091
|
+
(item) => (0, import_utils6.bytesToNumberBE)(item.output.tokenAmount) === tokenAmount
|
|
1777
2092
|
);
|
|
1778
2093
|
if (exactMatch) {
|
|
1779
2094
|
return [exactMatch];
|
|
@@ -1784,7 +2099,7 @@ var TokenTransactionService = class {
|
|
|
1784
2099
|
for (const outputWithPreviousTransactionData of tokenOutputs) {
|
|
1785
2100
|
if (remainingAmount <= 0n) break;
|
|
1786
2101
|
selectedOutputs.push(outputWithPreviousTransactionData);
|
|
1787
|
-
remainingAmount -= (0,
|
|
2102
|
+
remainingAmount -= (0, import_utils6.bytesToNumberBE)(
|
|
1788
2103
|
outputWithPreviousTransactionData.output.tokenAmount
|
|
1789
2104
|
);
|
|
1790
2105
|
}
|
|
@@ -1800,13 +2115,13 @@ var TokenTransactionService = class {
|
|
|
1800
2115
|
if (strategy === "SMALL_FIRST") {
|
|
1801
2116
|
tokenOutputs.sort((a, b) => {
|
|
1802
2117
|
return Number(
|
|
1803
|
-
(0,
|
|
2118
|
+
(0, import_utils6.bytesToNumberBE)(a.output.tokenAmount) - (0, import_utils6.bytesToNumberBE)(b.output.tokenAmount)
|
|
1804
2119
|
);
|
|
1805
2120
|
});
|
|
1806
2121
|
} else {
|
|
1807
2122
|
tokenOutputs.sort((a, b) => {
|
|
1808
2123
|
return Number(
|
|
1809
|
-
(0,
|
|
2124
|
+
(0, import_utils6.bytesToNumberBE)(b.output.tokenAmount) - (0, import_utils6.bytesToNumberBE)(a.output.tokenAmount)
|
|
1810
2125
|
);
|
|
1811
2126
|
});
|
|
1812
2127
|
}
|
|
@@ -1814,7 +2129,7 @@ var TokenTransactionService = class {
|
|
|
1814
2129
|
// Helper function for deciding if the signer public key is the identity public key
|
|
1815
2130
|
async signMessageWithKey(message, publicKey) {
|
|
1816
2131
|
const tokenSignatures = this.config.getTokenSignatures();
|
|
1817
|
-
if ((0,
|
|
2132
|
+
if ((0, import_utils6.bytesToHex)(publicKey) === (0, import_utils6.bytesToHex)(await this.config.signer.getIdentityPublicKey())) {
|
|
1818
2133
|
if (tokenSignatures === "SCHNORR") {
|
|
1819
2134
|
return await this.config.signer.signSchnorrWithIdentityKey(message);
|
|
1820
2135
|
} else {
|
|
@@ -1890,7 +2205,7 @@ var TokenTransactionService = class {
|
|
|
1890
2205
|
}
|
|
1891
2206
|
const payload = {
|
|
1892
2207
|
finalTokenTransactionHash,
|
|
1893
|
-
operatorIdentityPublicKey: (0,
|
|
2208
|
+
operatorIdentityPublicKey: (0, import_utils7.hexToBytes)(operator.identityPublicKey)
|
|
1894
2209
|
};
|
|
1895
2210
|
const payloadHash = await hashOperatorSpecificTokenTransactionSignablePayload(payload);
|
|
1896
2211
|
const ownerSignature = await this.signMessageWithKey(
|
|
@@ -1906,7 +2221,7 @@ var TokenTransactionService = class {
|
|
|
1906
2221
|
for (let i = 0; i < transferInput.outputsToSpend.length; i++) {
|
|
1907
2222
|
const payload = {
|
|
1908
2223
|
finalTokenTransactionHash,
|
|
1909
|
-
operatorIdentityPublicKey: (0,
|
|
2224
|
+
operatorIdentityPublicKey: (0, import_utils7.hexToBytes)(operator.identityPublicKey)
|
|
1910
2225
|
};
|
|
1911
2226
|
const payloadHash = await hashOperatorSpecificTokenTransactionSignablePayload(payload);
|
|
1912
2227
|
let ownerSignature;
|
|
@@ -1923,7 +2238,7 @@ var TokenTransactionService = class {
|
|
|
1923
2238
|
}
|
|
1924
2239
|
inputTtxoSignaturesPerOperator.push({
|
|
1925
2240
|
ttxoSignatures,
|
|
1926
|
-
operatorIdentityPublicKey: (0,
|
|
2241
|
+
operatorIdentityPublicKey: (0, import_utils7.hexToBytes)(operator.identityPublicKey)
|
|
1927
2242
|
});
|
|
1928
2243
|
}
|
|
1929
2244
|
return inputTtxoSignaturesPerOperator;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { WalletConfigService } from './config.cjs';
|
|
2
|
-
import { j as OutputWithPreviousTransactionData,
|
|
2
|
+
import { j as OutputWithPreviousTransactionData, T as TokenTransaction } from '../spark-CDm4gqS6.cjs';
|
|
3
3
|
import { ConnectionManager } from './connection.cjs';
|
|
4
4
|
import { TokenTransaction as TokenTransaction$1 } from '../proto/spark_token.cjs';
|
|
5
5
|
import './wallet-config.cjs';
|
|
6
6
|
import '@buildonspark/lrc20-sdk';
|
|
7
|
-
import '../RequestLightningSendInput-
|
|
7
|
+
import '../RequestLightningSendInput-Na1mHdWg.cjs';
|
|
8
8
|
import '@lightsparkdev/core';
|
|
9
9
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
10
|
-
import '../signer-
|
|
10
|
+
import '../signer-IO3oMRNj.cjs';
|
|
11
11
|
import '@scure/bip32';
|
|
12
12
|
import '@scure/btc-signer';
|
|
13
13
|
import 'bitcoinjs-lib';
|
|
14
|
-
import '
|
|
14
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
15
|
+
import '../network-D5lKssVl.cjs';
|
|
15
16
|
import '@bufbuild/protobuf/wire';
|
|
16
17
|
import 'nice-grpc-common';
|
|
17
18
|
import 'nice-grpc';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { WalletConfigService } from './config.js';
|
|
2
|
-
import { j as OutputWithPreviousTransactionData,
|
|
2
|
+
import { j as OutputWithPreviousTransactionData, T as TokenTransaction } from '../spark-CDm4gqS6.js';
|
|
3
3
|
import { ConnectionManager } from './connection.js';
|
|
4
4
|
import { TokenTransaction as TokenTransaction$1 } from '../proto/spark_token.js';
|
|
5
5
|
import './wallet-config.js';
|
|
6
6
|
import '@buildonspark/lrc20-sdk';
|
|
7
|
-
import '../RequestLightningSendInput-
|
|
7
|
+
import '../RequestLightningSendInput-D7fZdT4A.js';
|
|
8
8
|
import '@lightsparkdev/core';
|
|
9
9
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
10
|
-
import '../signer-
|
|
10
|
+
import '../signer-wqesWifN.js';
|
|
11
11
|
import '@scure/bip32';
|
|
12
12
|
import '@scure/btc-signer';
|
|
13
13
|
import 'bitcoinjs-lib';
|
|
14
|
-
import '
|
|
14
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
15
|
+
import '../network-xkBSpaTn.js';
|
|
15
16
|
import '@bufbuild/protobuf/wire';
|
|
16
17
|
import 'nice-grpc-common';
|
|
17
18
|
import 'nice-grpc';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TokenTransactionService
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-DQYKQJRZ.js";
|
|
4
|
+
import "../chunk-6AFUC5M2.js";
|
|
5
5
|
import "../chunk-L3EHBOUX.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-MGPRLH6Q.js";
|
|
8
|
-
import "../chunk-VTUGIIWI.js";
|
|
9
|
-
import "../chunk-TWF35O6M.js";
|
|
6
|
+
import "../chunk-O4RYNJNB.js";
|
|
10
7
|
import "../chunk-M6A4KFIG.js";
|
|
8
|
+
import "../chunk-QNNSEJ4P.js";
|
|
9
|
+
import "../chunk-VTUGIIWI.js";
|
|
10
|
+
import "../chunk-GSI4OLXZ.js";
|
|
11
11
|
import "../chunk-MVRQ5US7.js";
|
|
12
12
|
export {
|
|
13
13
|
TokenTransactionService
|