@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
|
@@ -192,6 +192,7 @@ var BASE_CONFIG = {
|
|
|
192
192
|
signingOperators: getLocalSigningOperators(),
|
|
193
193
|
tokenSignatures: "SCHNORR",
|
|
194
194
|
tokenTransactionVersion: "V0",
|
|
195
|
+
tokenValidityDurationSeconds: 180,
|
|
195
196
|
electrsUrl: getElectrsUrl("LOCAL"),
|
|
196
197
|
expectedWithdrawBondSats: 1e4,
|
|
197
198
|
expectedWithdrawRelativeBlockLocktime: 1e3,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
|
|
2
|
-
import { M as MayHaveSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-
|
|
3
|
-
import { a as NetworkType } from '../network-
|
|
2
|
+
import { M as MayHaveSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-Na1mHdWg.cjs';
|
|
3
|
+
import { a as NetworkType } from '../network-D5lKssVl.cjs';
|
|
4
4
|
import '@lightsparkdev/core';
|
|
5
5
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
6
|
-
import '../signer-
|
|
6
|
+
import '../signer-IO3oMRNj.cjs';
|
|
7
7
|
import '@scure/bip32';
|
|
8
|
-
import '../spark-
|
|
8
|
+
import '../spark-CDm4gqS6.cjs';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
11
|
import '@scure/btc-signer';
|
|
12
12
|
import 'bitcoinjs-lib';
|
|
13
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
13
14
|
|
|
14
15
|
declare const ELECTRS_CREDENTIALS: {
|
|
15
16
|
username: string;
|
|
@@ -35,6 +36,7 @@ type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
|
|
|
35
36
|
readonly lrc20Address?: string;
|
|
36
37
|
readonly threshold?: number;
|
|
37
38
|
readonly tokenSignatures?: "ECDSA" | "SCHNORR";
|
|
39
|
+
readonly tokenValidityDurationSeconds?: number;
|
|
38
40
|
readonly tokenTransactionVersion?: "V0" | "V1";
|
|
39
41
|
readonly electrsUrl?: string;
|
|
40
42
|
readonly lrc20ApiConfig?: LRC20WalletApiConfig;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
|
|
2
|
-
import { M as MayHaveSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-
|
|
3
|
-
import { a as NetworkType } from '../network-
|
|
2
|
+
import { M as MayHaveSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-D7fZdT4A.js';
|
|
3
|
+
import { a as NetworkType } from '../network-xkBSpaTn.js';
|
|
4
4
|
import '@lightsparkdev/core';
|
|
5
5
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
6
|
-
import '../signer-
|
|
6
|
+
import '../signer-wqesWifN.js';
|
|
7
7
|
import '@scure/bip32';
|
|
8
|
-
import '../spark-
|
|
8
|
+
import '../spark-CDm4gqS6.js';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
11
|
import '@scure/btc-signer';
|
|
12
12
|
import 'bitcoinjs-lib';
|
|
13
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
13
14
|
|
|
14
15
|
declare const ELECTRS_CREDENTIALS: {
|
|
15
16
|
username: string;
|
|
@@ -35,6 +36,7 @@ type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
|
|
|
35
36
|
readonly lrc20Address?: string;
|
|
36
37
|
readonly threshold?: number;
|
|
37
38
|
readonly tokenSignatures?: "ECDSA" | "SCHNORR";
|
|
39
|
+
readonly tokenValidityDurationSeconds?: number;
|
|
38
40
|
readonly tokenTransactionVersion?: "V0" | "V1";
|
|
39
41
|
readonly electrsUrl?: string;
|
|
40
42
|
readonly lrc20ApiConfig?: LRC20WalletApiConfig;
|
package/dist/signer/signer.cjs
CHANGED
|
@@ -1114,12 +1114,16 @@ var init_wasm = __esm({
|
|
|
1114
1114
|
var signer_exports = {};
|
|
1115
1115
|
__export(signer_exports, {
|
|
1116
1116
|
DefaultSparkSigner: () => DefaultSparkSigner,
|
|
1117
|
+
MultisigReceiptInput: () => import_types2.MultisigReceiptInput,
|
|
1118
|
+
PARITY: () => import_lrc20_sdk2.PARITY,
|
|
1119
|
+
Receipt: () => import_lrc20_sdk2.Receipt,
|
|
1117
1120
|
TaprootOutputKeysGenerator: () => TaprootOutputKeysGenerator,
|
|
1118
|
-
TaprootSparkSigner: () => TaprootSparkSigner
|
|
1121
|
+
TaprootSparkSigner: () => TaprootSparkSigner,
|
|
1122
|
+
fromPrivateKey: () => import_lrc20_sdk2.fromPrivateKey
|
|
1119
1123
|
});
|
|
1120
1124
|
module.exports = __toCommonJS(signer_exports);
|
|
1121
1125
|
init_buffer();
|
|
1122
|
-
var
|
|
1126
|
+
var import_utils5 = require("@noble/curves/abstract/utils");
|
|
1123
1127
|
var import_secp256k15 = require("@noble/curves/secp256k1");
|
|
1124
1128
|
var import_bip32 = require("@scure/bip32");
|
|
1125
1129
|
var import_bip39 = require("@scure/bip39");
|
|
@@ -1128,14 +1132,27 @@ var ecies = __toESM(require("eciesjs"), 1);
|
|
|
1128
1132
|
|
|
1129
1133
|
// src/constants.ts
|
|
1130
1134
|
init_buffer();
|
|
1135
|
+
var import_core = require("@lightsparkdev/core");
|
|
1131
1136
|
var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
1132
1137
|
var isBun = globalThis.Bun !== void 0;
|
|
1138
|
+
var packageVersion = true ? "0.1.43" : "unknown";
|
|
1139
|
+
var baseEnvStr = "unknown";
|
|
1140
|
+
if (import_core.isNode) {
|
|
1141
|
+
baseEnvStr = `node/${process.version}`;
|
|
1142
|
+
} else if (isReactNative) {
|
|
1143
|
+
baseEnvStr = "react-native";
|
|
1144
|
+
} else {
|
|
1145
|
+
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "unknown-user-agent";
|
|
1146
|
+
baseEnvStr = `browser/${userAgent}`;
|
|
1147
|
+
}
|
|
1148
|
+
var clientEnv = `js-spark-sdk/${packageVersion} ${baseEnvStr}`;
|
|
1133
1149
|
|
|
1134
1150
|
// src/errors/types.ts
|
|
1135
1151
|
init_buffer();
|
|
1136
1152
|
|
|
1137
1153
|
// src/errors/base.ts
|
|
1138
1154
|
init_buffer();
|
|
1155
|
+
var import_utils = require("@noble/hashes/utils");
|
|
1139
1156
|
var SparkSDKError = class extends Error {
|
|
1140
1157
|
context;
|
|
1141
1158
|
originalError;
|
|
@@ -1167,12 +1184,42 @@ var SparkSDKError = class extends Error {
|
|
|
1167
1184
|
}
|
|
1168
1185
|
};
|
|
1169
1186
|
function getMessage(message, context = {}, originalError) {
|
|
1170
|
-
const contextStr = Object.entries(context).map(([key, value]) => `${key}: ${
|
|
1187
|
+
const contextStr = Object.entries(context).map(([key, value]) => `${key}: ${safeStringify(value)}`).join(", ");
|
|
1171
1188
|
const originalErrorStr = originalError ? `
|
|
1172
1189
|
Original Error: ${originalError.message}` : "";
|
|
1173
1190
|
return `SparkSDKError: ${message}${contextStr ? `
|
|
1174
1191
|
Context: ${contextStr}` : ""}${originalErrorStr}`;
|
|
1175
1192
|
}
|
|
1193
|
+
function safeStringify(value) {
|
|
1194
|
+
const replacer = (_, v) => {
|
|
1195
|
+
if (typeof v === "bigint") {
|
|
1196
|
+
return v.toString();
|
|
1197
|
+
}
|
|
1198
|
+
if (v instanceof Uint8Array) {
|
|
1199
|
+
return formatUint8Array(v);
|
|
1200
|
+
}
|
|
1201
|
+
return v;
|
|
1202
|
+
};
|
|
1203
|
+
if (typeof value === "bigint") {
|
|
1204
|
+
return `"${value.toString()}"`;
|
|
1205
|
+
}
|
|
1206
|
+
if (value instanceof Uint8Array) {
|
|
1207
|
+
return `"${formatUint8Array(value)}"`;
|
|
1208
|
+
}
|
|
1209
|
+
try {
|
|
1210
|
+
const result = JSON.stringify(value, replacer);
|
|
1211
|
+
return result === void 0 ? String(value) : result;
|
|
1212
|
+
} catch {
|
|
1213
|
+
try {
|
|
1214
|
+
return String(value);
|
|
1215
|
+
} catch {
|
|
1216
|
+
return "[Unserializable]";
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
function formatUint8Array(arr) {
|
|
1221
|
+
return `Uint8Array(0x${(0, import_utils.bytesToHex)(arr)})`;
|
|
1222
|
+
}
|
|
1176
1223
|
|
|
1177
1224
|
// src/errors/types.ts
|
|
1178
1225
|
var ValidationError = class extends SparkSDKError {
|
|
@@ -1189,7 +1236,7 @@ var ConfigurationError = class extends SparkSDKError {
|
|
|
1189
1236
|
// src/utils/adaptor-signature.ts
|
|
1190
1237
|
init_buffer();
|
|
1191
1238
|
var import_modular = require("@noble/curves/abstract/modular");
|
|
1192
|
-
var
|
|
1239
|
+
var import_utils2 = require("@noble/curves/abstract/utils");
|
|
1193
1240
|
var import_secp256k1 = require("@noble/curves/secp256k1");
|
|
1194
1241
|
|
|
1195
1242
|
// src/errors/index.ts
|
|
@@ -1199,10 +1246,10 @@ init_buffer();
|
|
|
1199
1246
|
function generateAdaptorFromSignature(signature) {
|
|
1200
1247
|
const adaptorPrivateKey = import_secp256k1.secp256k1.utils.randomPrivateKey();
|
|
1201
1248
|
const { r, s } = parseSignature(signature);
|
|
1202
|
-
const sBigInt = (0,
|
|
1203
|
-
const tBigInt = (0,
|
|
1249
|
+
const sBigInt = (0, import_utils2.bytesToNumberBE)(s);
|
|
1250
|
+
const tBigInt = (0, import_utils2.bytesToNumberBE)(adaptorPrivateKey);
|
|
1204
1251
|
const newS = (0, import_modular.mod)(sBigInt - tBigInt, import_secp256k1.secp256k1.CURVE.n);
|
|
1205
|
-
const newSignature = new Uint8Array([...r, ...(0,
|
|
1252
|
+
const newSignature = new Uint8Array([...r, ...(0, import_utils2.numberToBytesBE)(newS, 32)]);
|
|
1206
1253
|
return {
|
|
1207
1254
|
adaptorSignature: newSignature,
|
|
1208
1255
|
adaptorPrivateKey
|
|
@@ -1223,15 +1270,15 @@ function parseSignature(signature) {
|
|
|
1223
1270
|
}
|
|
1224
1271
|
const r = signature.slice(0, 32);
|
|
1225
1272
|
const s = signature.slice(32, 64);
|
|
1226
|
-
if ((0,
|
|
1273
|
+
if ((0, import_utils2.bytesToNumberBE)(r) >= import_secp256k1.secp256k1.CURVE.Fp.ORDER) {
|
|
1227
1274
|
throw new ValidationError("Invalid signature: r >= field prime", {
|
|
1228
|
-
rValue: (0,
|
|
1275
|
+
rValue: (0, import_utils2.bytesToNumberBE)(r),
|
|
1229
1276
|
fieldPrime: import_secp256k1.secp256k1.CURVE.Fp.ORDER
|
|
1230
1277
|
});
|
|
1231
1278
|
}
|
|
1232
|
-
if ((0,
|
|
1279
|
+
if ((0, import_utils2.bytesToNumberBE)(s) >= import_secp256k1.secp256k1.CURVE.n) {
|
|
1233
1280
|
throw new ValidationError("Invalid signature: s >= group order", {
|
|
1234
|
-
sValue: (0,
|
|
1281
|
+
sValue: (0, import_utils2.bytesToNumberBE)(s),
|
|
1235
1282
|
groupOrder: import_secp256k1.secp256k1.CURVE.n
|
|
1236
1283
|
});
|
|
1237
1284
|
}
|
|
@@ -1240,7 +1287,7 @@ function parseSignature(signature) {
|
|
|
1240
1287
|
|
|
1241
1288
|
// src/utils/keys.ts
|
|
1242
1289
|
init_buffer();
|
|
1243
|
-
var
|
|
1290
|
+
var import_utils3 = require("@noble/curves/abstract/utils");
|
|
1244
1291
|
var import_secp256k12 = require("@noble/curves/secp256k1");
|
|
1245
1292
|
function subtractPrivateKeys(a, b) {
|
|
1246
1293
|
if (a.length !== 32 || b.length !== 32) {
|
|
@@ -1253,12 +1300,12 @@ function subtractPrivateKeys(a, b) {
|
|
|
1253
1300
|
const privA = import_secp256k12.secp256k1.utils.normPrivateKeyToScalar(a);
|
|
1254
1301
|
const privB = import_secp256k12.secp256k1.utils.normPrivateKeyToScalar(b);
|
|
1255
1302
|
const sum = (import_secp256k12.secp256k1.CURVE.n - privB + privA) % import_secp256k12.secp256k1.CURVE.n;
|
|
1256
|
-
return (0,
|
|
1303
|
+
return (0, import_utils3.numberToBytesBE)(sum, 32);
|
|
1257
1304
|
}
|
|
1258
1305
|
|
|
1259
1306
|
// src/utils/secret-sharing.ts
|
|
1260
1307
|
init_buffer();
|
|
1261
|
-
var
|
|
1308
|
+
var import_utils4 = require("@noble/curves/abstract/utils");
|
|
1262
1309
|
var import_secp256k13 = require("@noble/curves/secp256k1");
|
|
1263
1310
|
|
|
1264
1311
|
// src/utils/crypto.ts
|
|
@@ -1277,7 +1324,7 @@ function getRandomBigInt(max) {
|
|
|
1277
1324
|
const mask = (1n << BigInt(max.toString(2).length)) - 1n;
|
|
1278
1325
|
while (true) {
|
|
1279
1326
|
const randBytes = crypto.getRandomValues(new Uint8Array(byteLength + 1));
|
|
1280
|
-
const randValue = BigInt("0x" + (0,
|
|
1327
|
+
const randValue = BigInt("0x" + (0, import_utils4.bytesToHex)(randBytes)) & mask;
|
|
1281
1328
|
if (randValue < maxBigInt) {
|
|
1282
1329
|
return randValue;
|
|
1283
1330
|
}
|
|
@@ -1369,7 +1416,9 @@ function getSigningCommitmentFromNonce(nonce) {
|
|
|
1369
1416
|
var import_secp256k16 = require("@bitcoinerlab/secp256k1");
|
|
1370
1417
|
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1371
1418
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
1372
|
-
var
|
|
1419
|
+
var import_utils6 = require("@scure/btc-signer/utils");
|
|
1420
|
+
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
1421
|
+
var import_types2 = require("@buildonspark/lrc20-sdk/lrc/types");
|
|
1373
1422
|
var sparkFrostModule = void 0;
|
|
1374
1423
|
var getSparkFrostModule = async () => {
|
|
1375
1424
|
if (isReactNative) {
|
|
@@ -1439,7 +1488,7 @@ var TaprootOutputKeysGenerator = class {
|
|
|
1439
1488
|
}
|
|
1440
1489
|
const derivationPath = this.useAddressIndex ? `m/86'/0'/0'/0/${accountNumber}` : `m/86'/0'/${accountNumber}'/0/0`;
|
|
1441
1490
|
const taprootInternalKey = hdkey.derive(derivationPath);
|
|
1442
|
-
let tweakedPrivateKey = (0,
|
|
1491
|
+
let tweakedPrivateKey = (0, import_utils6.taprootTweakPrivKey)(taprootInternalKey.privateKey);
|
|
1443
1492
|
let tweakedPublicKey = import_secp256k15.secp256k1.getPublicKey(tweakedPrivateKey);
|
|
1444
1493
|
if (tweakedPublicKey[0] === 3) {
|
|
1445
1494
|
tweakedPrivateKey = (0, import_secp256k16.privateNegate)(tweakedPrivateKey);
|
|
@@ -1526,28 +1575,28 @@ var DefaultSparkSigner = class {
|
|
|
1526
1575
|
const privateKey = this.deriveSigningKey(hash);
|
|
1527
1576
|
const publicKey = import_secp256k15.secp256k1.getPublicKey(privateKey);
|
|
1528
1577
|
this.publicKeyToPrivateKeyMap.set(
|
|
1529
|
-
(0,
|
|
1530
|
-
(0,
|
|
1578
|
+
(0, import_utils5.bytesToHex)(publicKey),
|
|
1579
|
+
(0, import_utils5.bytesToHex)(privateKey)
|
|
1531
1580
|
);
|
|
1532
1581
|
}
|
|
1533
1582
|
}
|
|
1534
1583
|
async getSchnorrPublicKey(publicKey) {
|
|
1535
|
-
const privateKey = this.publicKeyToPrivateKeyMap.get((0,
|
|
1584
|
+
const privateKey = this.publicKeyToPrivateKeyMap.get((0, import_utils5.bytesToHex)(publicKey));
|
|
1536
1585
|
if (!privateKey) {
|
|
1537
1586
|
throw new ValidationError("Private key is not set", {
|
|
1538
1587
|
field: "privateKey"
|
|
1539
1588
|
});
|
|
1540
1589
|
}
|
|
1541
|
-
return import_secp256k15.schnorr.getPublicKey((0,
|
|
1590
|
+
return import_secp256k15.schnorr.getPublicKey((0, import_utils5.hexToBytes)(privateKey));
|
|
1542
1591
|
}
|
|
1543
1592
|
async signSchnorr(message, publicKey) {
|
|
1544
|
-
const privateKey = this.publicKeyToPrivateKeyMap.get((0,
|
|
1593
|
+
const privateKey = this.publicKeyToPrivateKeyMap.get((0, import_utils5.bytesToHex)(publicKey));
|
|
1545
1594
|
if (!privateKey) {
|
|
1546
1595
|
throw new ValidationError("Private key is not set", {
|
|
1547
1596
|
field: "privateKey"
|
|
1548
1597
|
});
|
|
1549
1598
|
}
|
|
1550
|
-
return import_secp256k15.schnorr.sign(message, (0,
|
|
1599
|
+
return import_secp256k15.schnorr.sign(message, (0, import_utils5.hexToBytes)(privateKey));
|
|
1551
1600
|
}
|
|
1552
1601
|
async signSchnorrWithIdentityKey(message) {
|
|
1553
1602
|
if (!this.identityKey?.privateKey) {
|
|
@@ -1589,8 +1638,8 @@ var DefaultSparkSigner = class {
|
|
|
1589
1638
|
);
|
|
1590
1639
|
this.staticDepositKeyMap.set(idx, staticDepositKey);
|
|
1591
1640
|
this.publicKeyToPrivateKeyMap.set(
|
|
1592
|
-
(0,
|
|
1593
|
-
(0,
|
|
1641
|
+
(0, import_utils5.bytesToHex)(staticDepositKey.publicKey),
|
|
1642
|
+
(0, import_utils5.bytesToHex)(staticDepositKey.privateKey)
|
|
1594
1643
|
);
|
|
1595
1644
|
return staticDepositKey.publicKey;
|
|
1596
1645
|
}
|
|
@@ -1635,7 +1684,7 @@ var DefaultSparkSigner = class {
|
|
|
1635
1684
|
return await (0, import_bip39.mnemonicToSeed)(mnemonic);
|
|
1636
1685
|
}
|
|
1637
1686
|
async getTrackedPublicKeys() {
|
|
1638
|
-
return Array.from(this.publicKeyToPrivateKeyMap.keys()).map(
|
|
1687
|
+
return Array.from(this.publicKeyToPrivateKeyMap.keys()).map(import_utils5.hexToBytes);
|
|
1639
1688
|
}
|
|
1640
1689
|
async generatePublicKey(hash) {
|
|
1641
1690
|
if (!this.signingKey) {
|
|
@@ -1655,31 +1704,31 @@ var DefaultSparkSigner = class {
|
|
|
1655
1704
|
});
|
|
1656
1705
|
}
|
|
1657
1706
|
const publicKey = import_secp256k15.secp256k1.getPublicKey(newPrivateKey);
|
|
1658
|
-
const pubKeyHex = (0,
|
|
1659
|
-
const privKeyHex = (0,
|
|
1707
|
+
const pubKeyHex = (0, import_utils5.bytesToHex)(publicKey);
|
|
1708
|
+
const privKeyHex = (0, import_utils5.bytesToHex)(newPrivateKey);
|
|
1660
1709
|
this.publicKeyToPrivateKeyMap.set(pubKeyHex, privKeyHex);
|
|
1661
1710
|
return publicKey;
|
|
1662
1711
|
}
|
|
1663
1712
|
async removePublicKey(publicKey) {
|
|
1664
|
-
this.publicKeyToPrivateKeyMap.delete((0,
|
|
1713
|
+
this.publicKeyToPrivateKeyMap.delete((0, import_utils5.bytesToHex)(publicKey));
|
|
1665
1714
|
}
|
|
1666
1715
|
async subtractPrivateKeysGivenPublicKeys(first, second) {
|
|
1667
|
-
const firstPubKeyHex = (0,
|
|
1668
|
-
const secondPubKeyHex = (0,
|
|
1716
|
+
const firstPubKeyHex = (0, import_utils5.bytesToHex)(first);
|
|
1717
|
+
const secondPubKeyHex = (0, import_utils5.bytesToHex)(second);
|
|
1669
1718
|
const firstPrivateKeyHex = this.publicKeyToPrivateKeyMap.get(firstPubKeyHex);
|
|
1670
1719
|
const secondPrivateKeyHex = this.publicKeyToPrivateKeyMap.get(secondPubKeyHex);
|
|
1671
1720
|
if (!firstPrivateKeyHex || !secondPrivateKeyHex) {
|
|
1672
1721
|
throw new Error("Private key is not set");
|
|
1673
1722
|
}
|
|
1674
|
-
const firstPrivateKey = (0,
|
|
1675
|
-
const secondPrivateKey = (0,
|
|
1723
|
+
const firstPrivateKey = (0, import_utils5.hexToBytes)(firstPrivateKeyHex);
|
|
1724
|
+
const secondPrivateKey = (0, import_utils5.hexToBytes)(secondPrivateKeyHex);
|
|
1676
1725
|
const resultPrivKey = subtractPrivateKeys(
|
|
1677
1726
|
firstPrivateKey,
|
|
1678
1727
|
secondPrivateKey
|
|
1679
1728
|
);
|
|
1680
1729
|
const resultPubKey = import_secp256k15.secp256k1.getPublicKey(resultPrivKey);
|
|
1681
|
-
const resultPrivKeyHex = (0,
|
|
1682
|
-
const resultPubKeyHex = (0,
|
|
1730
|
+
const resultPrivKeyHex = (0, import_utils5.bytesToHex)(resultPrivKey);
|
|
1731
|
+
const resultPubKeyHex = (0, import_utils5.bytesToHex)(resultPubKey);
|
|
1683
1732
|
this.publicKeyToPrivateKeyMap.set(resultPubKeyHex, resultPrivKeyHex);
|
|
1684
1733
|
return resultPubKey;
|
|
1685
1734
|
}
|
|
@@ -1691,14 +1740,14 @@ var DefaultSparkSigner = class {
|
|
|
1691
1740
|
isSecretPubkey = false
|
|
1692
1741
|
}) {
|
|
1693
1742
|
if (isSecretPubkey) {
|
|
1694
|
-
const pubKeyHex = (0,
|
|
1743
|
+
const pubKeyHex = (0, import_utils5.bytesToHex)(secret);
|
|
1695
1744
|
const privateKey = this.publicKeyToPrivateKeyMap.get(pubKeyHex);
|
|
1696
1745
|
if (!privateKey) {
|
|
1697
1746
|
throw new Error("Private key is not set");
|
|
1698
1747
|
}
|
|
1699
|
-
secret = (0,
|
|
1748
|
+
secret = (0, import_utils5.hexToBytes)(privateKey);
|
|
1700
1749
|
}
|
|
1701
|
-
const secretAsInt = (0,
|
|
1750
|
+
const secretAsInt = (0, import_utils5.bytesToNumberBE)(secret);
|
|
1702
1751
|
return splitSecretWithProofs(secretAsInt, curveOrder, threshold, numShares);
|
|
1703
1752
|
}
|
|
1704
1753
|
async signFrost({
|
|
@@ -1716,7 +1765,7 @@ var DefaultSparkSigner = class {
|
|
|
1716
1765
|
field: "SparkFrost"
|
|
1717
1766
|
});
|
|
1718
1767
|
}
|
|
1719
|
-
const privateAsPubKeyHex = (0,
|
|
1768
|
+
const privateAsPubKeyHex = (0, import_utils5.bytesToHex)(privateAsPubKey);
|
|
1720
1769
|
const signingPrivateKey = this.publicKeyToPrivateKeyMap.get(privateAsPubKeyHex);
|
|
1721
1770
|
if (!signingPrivateKey) {
|
|
1722
1771
|
throw new ValidationError("Private key not found for public key", {
|
|
@@ -1730,7 +1779,7 @@ var DefaultSparkSigner = class {
|
|
|
1730
1779
|
});
|
|
1731
1780
|
}
|
|
1732
1781
|
const keyPackage = {
|
|
1733
|
-
secretKey: (0,
|
|
1782
|
+
secretKey: (0, import_utils5.hexToBytes)(signingPrivateKey),
|
|
1734
1783
|
publicKey,
|
|
1735
1784
|
verifyingKey
|
|
1736
1785
|
};
|
|
@@ -1774,7 +1823,7 @@ var DefaultSparkSigner = class {
|
|
|
1774
1823
|
}
|
|
1775
1824
|
async createSparkWalletFromSeed(seed, accountNumber) {
|
|
1776
1825
|
if (typeof seed === "string") {
|
|
1777
|
-
seed = (0,
|
|
1826
|
+
seed = (0, import_utils5.hexToBytes)(seed);
|
|
1778
1827
|
}
|
|
1779
1828
|
const {
|
|
1780
1829
|
masterPublicKey,
|
|
@@ -1789,28 +1838,28 @@ var DefaultSparkSigner = class {
|
|
|
1789
1838
|
this.signingKey = signingKey.hdKey;
|
|
1790
1839
|
this.staticDepositKey = staticDepositKey.hdKey;
|
|
1791
1840
|
this.publicKeyToPrivateKeyMap.set(
|
|
1792
|
-
(0,
|
|
1793
|
-
(0,
|
|
1841
|
+
(0, import_utils5.bytesToHex)(identityKey.publicKey),
|
|
1842
|
+
(0, import_utils5.bytesToHex)(identityKey.privateKey)
|
|
1794
1843
|
);
|
|
1795
1844
|
this.publicKeyToPrivateKeyMap.set(
|
|
1796
|
-
(0,
|
|
1797
|
-
(0,
|
|
1845
|
+
(0, import_utils5.bytesToHex)(depositKey.publicKey),
|
|
1846
|
+
(0, import_utils5.bytesToHex)(depositKey.privateKey)
|
|
1798
1847
|
);
|
|
1799
1848
|
this.publicKeyToPrivateKeyMap.set(
|
|
1800
|
-
(0,
|
|
1801
|
-
(0,
|
|
1849
|
+
(0, import_utils5.bytesToHex)(staticDepositKey.publicKey),
|
|
1850
|
+
(0, import_utils5.bytesToHex)(staticDepositKey.privateKey)
|
|
1802
1851
|
);
|
|
1803
|
-
return (0,
|
|
1852
|
+
return (0, import_utils5.bytesToHex)(identityKey.publicKey);
|
|
1804
1853
|
}
|
|
1805
1854
|
async signMessageWithPublicKey(message, publicKey, compact) {
|
|
1806
|
-
const privateKey = this.publicKeyToPrivateKeyMap.get((0,
|
|
1855
|
+
const privateKey = this.publicKeyToPrivateKeyMap.get((0, import_utils5.bytesToHex)(publicKey));
|
|
1807
1856
|
if (!privateKey) {
|
|
1808
1857
|
throw new ValidationError("Private key not found for public key", {
|
|
1809
1858
|
field: "privateKey",
|
|
1810
|
-
value: (0,
|
|
1859
|
+
value: (0, import_utils5.bytesToHex)(publicKey)
|
|
1811
1860
|
});
|
|
1812
1861
|
}
|
|
1813
|
-
const signature = import_secp256k15.secp256k1.sign(message, (0,
|
|
1862
|
+
const signature = import_secp256k15.secp256k1.sign(message, (0, import_utils5.hexToBytes)(privateKey));
|
|
1814
1863
|
if (compact) {
|
|
1815
1864
|
return signature.toCompactRawBytes();
|
|
1816
1865
|
}
|
|
@@ -1829,12 +1878,12 @@ var DefaultSparkSigner = class {
|
|
|
1829
1878
|
return signature.toDERRawBytes();
|
|
1830
1879
|
}
|
|
1831
1880
|
async encryptLeafPrivateKeyEcies(receiverPublicKey, publicKey) {
|
|
1832
|
-
const publicKeyHex = (0,
|
|
1881
|
+
const publicKeyHex = (0, import_utils5.bytesToHex)(publicKey);
|
|
1833
1882
|
const privateKey = this.publicKeyToPrivateKeyMap.get(publicKeyHex);
|
|
1834
1883
|
if (!privateKey) {
|
|
1835
1884
|
throw new Error("Private key is not set");
|
|
1836
1885
|
}
|
|
1837
|
-
return ecies.encrypt(receiverPublicKey, (0,
|
|
1886
|
+
return ecies.encrypt(receiverPublicKey, (0, import_utils5.hexToBytes)(privateKey));
|
|
1838
1887
|
}
|
|
1839
1888
|
async decryptEcies(ciphertext) {
|
|
1840
1889
|
if (!this.identityKey?.privateKey) {
|
|
@@ -1843,12 +1892,12 @@ var DefaultSparkSigner = class {
|
|
|
1843
1892
|
});
|
|
1844
1893
|
}
|
|
1845
1894
|
const receiverEciesPrivKey = ecies.PrivateKey.fromHex(
|
|
1846
|
-
(0,
|
|
1895
|
+
(0, import_utils5.bytesToHex)(this.identityKey.privateKey)
|
|
1847
1896
|
);
|
|
1848
1897
|
const privateKey = ecies.decrypt(receiverEciesPrivKey.toHex(), ciphertext);
|
|
1849
1898
|
const publicKey = import_secp256k15.secp256k1.getPublicKey(privateKey);
|
|
1850
|
-
const publicKeyHex = (0,
|
|
1851
|
-
const privateKeyHex = (0,
|
|
1899
|
+
const publicKeyHex = (0, import_utils5.bytesToHex)(publicKey);
|
|
1900
|
+
const privateKeyHex = (0, import_utils5.bytesToHex)(privateKey);
|
|
1852
1901
|
this.publicKeyToPrivateKeyMap.set(publicKeyHex, privateKeyHex);
|
|
1853
1902
|
return publicKey;
|
|
1854
1903
|
}
|
|
@@ -1865,8 +1914,8 @@ var DefaultSparkSigner = class {
|
|
|
1865
1914
|
const adaptor = generateAdaptorFromSignature(signature);
|
|
1866
1915
|
const adaptorPublicKey = import_secp256k15.secp256k1.getPublicKey(adaptor.adaptorPrivateKey);
|
|
1867
1916
|
this.publicKeyToPrivateKeyMap.set(
|
|
1868
|
-
(0,
|
|
1869
|
-
(0,
|
|
1917
|
+
(0, import_utils5.bytesToHex)(adaptorPublicKey),
|
|
1918
|
+
(0, import_utils5.bytesToHex)(adaptor.adaptorPrivateKey)
|
|
1870
1919
|
);
|
|
1871
1920
|
return {
|
|
1872
1921
|
adaptorSignature: signature,
|
|
@@ -1917,19 +1966,19 @@ var DefaultSparkSigner = class {
|
|
|
1917
1966
|
}
|
|
1918
1967
|
signTransactionIndex(tx, index, publicKey) {
|
|
1919
1968
|
let privateKey;
|
|
1920
|
-
if ((0,
|
|
1969
|
+
if ((0, import_utils5.equalBytes)(publicKey, this.identityKey?.publicKey ?? new Uint8Array())) {
|
|
1921
1970
|
privateKey = this.identityKey?.privateKey;
|
|
1922
|
-
} else if ((0,
|
|
1971
|
+
} else if ((0, import_utils5.equalBytes)(publicKey, this.depositKey?.publicKey ?? new Uint8Array())) {
|
|
1923
1972
|
privateKey = this.depositKey?.privateKey;
|
|
1924
1973
|
} else {
|
|
1925
|
-
privateKey = (0,
|
|
1926
|
-
this.publicKeyToPrivateKeyMap.get((0,
|
|
1974
|
+
privateKey = (0, import_utils5.hexToBytes)(
|
|
1975
|
+
this.publicKeyToPrivateKeyMap.get((0, import_utils5.bytesToHex)(publicKey)) ?? ""
|
|
1927
1976
|
);
|
|
1928
1977
|
}
|
|
1929
1978
|
if (!privateKey) {
|
|
1930
1979
|
throw new ValidationError("Private key not found for public key", {
|
|
1931
1980
|
field: "privateKey",
|
|
1932
|
-
value: (0,
|
|
1981
|
+
value: (0, import_utils5.bytesToHex)(publicKey)
|
|
1933
1982
|
});
|
|
1934
1983
|
}
|
|
1935
1984
|
tx.signIdx(privateKey, index);
|
|
@@ -1943,6 +1992,10 @@ var TaprootSparkSigner = class extends DefaultSparkSigner {
|
|
|
1943
1992
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1944
1993
|
0 && (module.exports = {
|
|
1945
1994
|
DefaultSparkSigner,
|
|
1995
|
+
MultisigReceiptInput,
|
|
1996
|
+
PARITY,
|
|
1997
|
+
Receipt,
|
|
1946
1998
|
TaprootOutputKeysGenerator,
|
|
1947
|
-
TaprootSparkSigner
|
|
1999
|
+
TaprootSparkSigner,
|
|
2000
|
+
fromPrivateKey
|
|
1948
2001
|
});
|
package/dist/signer/signer.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import '@scure/bip32';
|
|
2
|
-
import '../spark-
|
|
3
|
-
export { A as AggregateFrostParams, D as DefaultSparkSigner, k as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, l as SplitSecretWithProofsParams, j as TaprootOutputKeysGenerator, T as TaprootSparkSigner } from '../signer-
|
|
4
|
-
|
|
2
|
+
import '../spark-CDm4gqS6.cjs';
|
|
3
|
+
export { A as AggregateFrostParams, D as DefaultSparkSigner, k as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, l as SplitSecretWithProofsParams, j as TaprootOutputKeysGenerator, T as TaprootSparkSigner } from '../signer-IO3oMRNj.cjs';
|
|
4
|
+
export { PARITY, Receipt, TokenSigner, fromPrivateKey } from '@buildonspark/lrc20-sdk';
|
|
5
5
|
import '@scure/btc-signer';
|
|
6
6
|
import 'bitcoinjs-lib';
|
|
7
|
+
export { MultisigReceiptInput } from '@buildonspark/lrc20-sdk/lrc/types';
|
|
7
8
|
import '@bufbuild/protobuf/wire';
|
|
8
9
|
import 'nice-grpc-common';
|
package/dist/signer/signer.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import '@scure/bip32';
|
|
2
|
-
import '../spark-
|
|
3
|
-
export { A as AggregateFrostParams, D as DefaultSparkSigner, k as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, l as SplitSecretWithProofsParams, j as TaprootOutputKeysGenerator, T as TaprootSparkSigner } from '../signer-
|
|
4
|
-
|
|
2
|
+
import '../spark-CDm4gqS6.js';
|
|
3
|
+
export { A as AggregateFrostParams, D as DefaultSparkSigner, k as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, l as SplitSecretWithProofsParams, j as TaprootOutputKeysGenerator, T as TaprootSparkSigner } from '../signer-wqesWifN.js';
|
|
4
|
+
export { PARITY, Receipt, TokenSigner, fromPrivateKey } from '@buildonspark/lrc20-sdk';
|
|
5
5
|
import '@scure/btc-signer';
|
|
6
6
|
import 'bitcoinjs-lib';
|
|
7
|
+
export { MultisigReceiptInput } from '@buildonspark/lrc20-sdk/lrc/types';
|
|
7
8
|
import '@bufbuild/protobuf/wire';
|
|
8
9
|
import 'nice-grpc-common';
|
package/dist/signer/signer.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DefaultSparkSigner,
|
|
3
|
+
MultisigReceiptInput,
|
|
4
|
+
PARITY,
|
|
5
|
+
Receipt,
|
|
3
6
|
TaprootOutputKeysGenerator,
|
|
4
|
-
TaprootSparkSigner
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
TaprootSparkSigner,
|
|
8
|
+
fromPrivateKey
|
|
9
|
+
} from "../chunk-TIUBYNN5.js";
|
|
10
|
+
import "../chunk-VFJQNBFX.js";
|
|
11
|
+
import "../chunk-NSJF5F5O.js";
|
|
12
|
+
import "../chunk-QNNSEJ4P.js";
|
|
9
13
|
import "../chunk-VTUGIIWI.js";
|
|
10
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-GSI4OLXZ.js";
|
|
11
15
|
import "../chunk-MVRQ5US7.js";
|
|
12
16
|
export {
|
|
13
17
|
DefaultSparkSigner,
|
|
18
|
+
MultisigReceiptInput,
|
|
19
|
+
PARITY,
|
|
20
|
+
Receipt,
|
|
14
21
|
TaprootOutputKeysGenerator,
|
|
15
|
-
TaprootSparkSigner
|
|
22
|
+
TaprootSparkSigner,
|
|
23
|
+
fromPrivateKey
|
|
16
24
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { HDKey } from '@scure/bip32';
|
|
2
|
-
import {
|
|
2
|
+
import { d as TreeNode } from './spark-CDm4gqS6.cjs';
|
|
3
3
|
import { TokenSigner, Receipt } from '@buildonspark/lrc20-sdk';
|
|
4
4
|
import { Transaction } from '@scure/btc-signer';
|
|
5
5
|
import { Psbt } from 'bitcoinjs-lib';
|
|
6
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
6
7
|
|
|
7
8
|
interface ISigningCommitment {
|
|
8
9
|
hiding: Uint8Array;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { HDKey } from '@scure/bip32';
|
|
2
|
-
import {
|
|
2
|
+
import { d as TreeNode } from './spark-CDm4gqS6.js';
|
|
3
3
|
import { TokenSigner, Receipt } from '@buildonspark/lrc20-sdk';
|
|
4
4
|
import { Transaction } from '@scure/btc-signer';
|
|
5
5
|
import { Psbt } from 'bitcoinjs-lib';
|
|
6
|
+
import '@buildonspark/lrc20-sdk/lrc/types';
|
|
6
7
|
|
|
7
8
|
interface ISigningCommitment {
|
|
8
9
|
hiding: Uint8Array;
|