@buildonspark/spark-sdk 0.1.38 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_jni_libs/debug/mergeDebugJniLibFolders/out/x86_64/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libuniffi_spark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libspark_frost.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libuniffi_spark_frost.so +0 -0
- package/dist/{RequestLightningSendInput-B4JdzclX.d.ts → RequestLightningSendInput-CJtcHOnu.d.ts} +1 -1
- package/dist/{RequestLightningSendInput-39_zGri6.d.cts → RequestLightningSendInput-DfmfqzZo.d.cts} +1 -1
- package/dist/address/index.d.cts +1 -1
- package/dist/address/index.d.ts +1 -1
- package/dist/address/index.js +2 -2
- package/dist/{chunk-W3EC5XSA.js → chunk-5MNQB2T4.js} +2 -2
- package/dist/chunk-ED3ZAFDI.js +784 -0
- package/dist/{chunk-VJTDG4BQ.js → chunk-HK6LPV6Z.js} +10 -1
- package/dist/{chunk-7WRK6WNJ.js → chunk-LHT4QTFK.js} +556 -41
- package/dist/{chunk-RAPBVYJY.js → chunk-RFCXPGDM.js} +26 -4
- package/dist/{chunk-DI7QXUQJ.js → chunk-W2VXS35Y.js} +4 -4
- package/dist/graphql/objects/index.d.cts +5 -4
- package/dist/graphql/objects/index.d.ts +5 -4
- package/dist/{index-CxAi2L8y.d.ts → index-BDEYgYxP.d.ts} +42 -4
- package/dist/{index-Dm17Ggfe.d.cts → index-CLdtdMU4.d.cts} +42 -4
- package/dist/index.cjs +1069 -40
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +33 -17
- package/dist/index.node.cjs +1069 -40
- package/dist/index.node.d.cts +6 -6
- package/dist/index.node.d.ts +6 -6
- package/dist/index.node.js +33 -17
- package/dist/native/index.cjs +1069 -40
- package/dist/native/index.d.cts +108 -5
- package/dist/native/index.d.ts +108 -5
- package/dist/native/index.js +1065 -40
- package/dist/{network-GFGEHkS4.d.cts → network-B10hBoHp.d.cts} +8 -1
- package/dist/{network-DobHpaV6.d.ts → network-CCgyIsGl.d.ts} +8 -1
- package/dist/services/config.cjs +29 -12
- package/dist/services/config.d.cts +4 -4
- package/dist/services/config.d.ts +4 -4
- package/dist/services/config.js +5 -5
- package/dist/services/connection.d.cts +4 -4
- package/dist/services/connection.d.ts +4 -4
- package/dist/services/connection.js +2 -2
- package/dist/services/index.cjs +30 -13
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +8 -8
- package/dist/services/lrc-connection.d.cts +4 -4
- package/dist/services/lrc-connection.d.ts +4 -4
- package/dist/services/lrc-connection.js +1 -1
- package/dist/services/token-transactions.cjs +1 -1
- package/dist/services/token-transactions.d.cts +4 -4
- package/dist/services/token-transactions.d.ts +4 -4
- package/dist/services/token-transactions.js +3 -3
- package/dist/services/wallet-config.d.cts +4 -4
- package/dist/services/wallet-config.d.ts +4 -4
- package/dist/signer/signer.cjs +23 -6
- package/dist/signer/signer.d.cts +3 -2
- package/dist/signer/signer.d.ts +3 -2
- package/dist/signer/signer.js +1 -1
- package/dist/{signer-DFGw9RRp.d.ts → signer-C5h1DpjF.d.ts} +4 -1
- package/dist/{signer-C1t40Wus.d.cts → signer-CYwn7h9U.d.cts} +4 -1
- package/dist/types/index.d.cts +4 -3
- package/dist/types/index.d.ts +4 -3
- package/dist/utils/index.cjs +891 -2
- package/dist/utils/index.d.cts +62 -6
- package/dist/utils/index.d.ts +62 -6
- package/dist/utils/index.js +23 -7
- package/package.json +1 -1
- package/src/services/deposit.ts +23 -5
- package/src/services/token-transactions.ts +1 -1
- package/src/services/transfer.ts +218 -11
- package/src/services/tree-creation.ts +29 -14
- package/src/signer/signer.ts +47 -5
- package/src/spark-wallet/spark-wallet.ts +430 -4
- package/src/tests/integration/swap.test.ts +225 -0
- package/src/tests/integration/tree-creation.test.ts +5 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/mempool.ts +26 -1
- package/src/utils/network.ts +15 -0
- package/src/utils/transaction.ts +22 -2
- package/src/utils/unilateral-exit.ts +729 -0
- package/dist/chunk-E5SL7XTO.js +0 -301
- package/dist/{chunk-LIP2K6KR.js → chunk-2CDJZQN4.js} +3 -3
- package/dist/{chunk-RGWBSZIO.js → chunk-I4JI6TYN.js} +4 -4
|
@@ -35,5 +35,12 @@ declare const LRC_WALLET_NETWORK_TYPE: Readonly<{
|
|
|
35
35
|
* @returns {BitcoinNetwork | null} The detected network or null if not detected
|
|
36
36
|
*/
|
|
37
37
|
declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
|
|
38
|
+
/**
|
|
39
|
+
* Utility function to get the network enum value from a string.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} network - The Bitcoin network to turn into an enum value
|
|
42
|
+
* @returns {Network} The enum value matching the string
|
|
43
|
+
*/
|
|
44
|
+
declare function getNetworkFromString(network?: string): Network;
|
|
38
45
|
|
|
39
|
-
export { LRC_WALLET_NETWORK as L, Network as N, type NetworkType as a, NetworkToProto as b, LRC_WALLET_NETWORK_TYPE as c, getNetworkFromAddress as d, getNetwork as g };
|
|
46
|
+
export { LRC_WALLET_NETWORK as L, Network as N, type NetworkType as a, NetworkToProto as b, LRC_WALLET_NETWORK_TYPE as c, getNetworkFromAddress as d, getNetworkFromString as e, getNetwork as g };
|
|
@@ -35,5 +35,12 @@ declare const LRC_WALLET_NETWORK_TYPE: Readonly<{
|
|
|
35
35
|
* @returns {BitcoinNetwork | null} The detected network or null if not detected
|
|
36
36
|
*/
|
|
37
37
|
declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
|
|
38
|
+
/**
|
|
39
|
+
* Utility function to get the network enum value from a string.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} network - The Bitcoin network to turn into an enum value
|
|
42
|
+
* @returns {Network} The enum value matching the string
|
|
43
|
+
*/
|
|
44
|
+
declare function getNetworkFromString(network?: string): Network;
|
|
38
45
|
|
|
39
|
-
export { LRC_WALLET_NETWORK as L, Network as N, type NetworkType as a, NetworkToProto as b, LRC_WALLET_NETWORK_TYPE as c, getNetworkFromAddress as d, getNetwork as g };
|
|
46
|
+
export { LRC_WALLET_NETWORK as L, Network as N, type NetworkType as a, NetworkToProto as b, LRC_WALLET_NETWORK_TYPE as c, getNetworkFromAddress as d, getNetworkFromString as e, getNetwork as g };
|
package/dist/services/config.cjs
CHANGED
|
@@ -1370,11 +1370,9 @@ function getSigningCommitmentFromNonce(nonce) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
|
|
1372
1372
|
// src/signer/signer.ts
|
|
1373
|
-
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1374
|
-
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
1375
1373
|
var import_secp256k16 = require("@bitcoinerlab/secp256k1");
|
|
1374
|
+
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1376
1375
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
1377
|
-
var import_lrc20_sdk3 = require("@buildonspark/lrc20-sdk");
|
|
1378
1376
|
var sparkFrostModule = void 0;
|
|
1379
1377
|
var getSparkFrostModule = async () => {
|
|
1380
1378
|
if (isReactNative) {
|
|
@@ -1840,16 +1838,16 @@ var DefaultSparkSigner = class {
|
|
|
1840
1838
|
}
|
|
1841
1839
|
if (receipt) {
|
|
1842
1840
|
const receiptPrivateKey = this.getReceiptPrivateKey(receipt);
|
|
1843
|
-
const tweakedKeyPair = (0,
|
|
1841
|
+
const tweakedKeyPair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(receiptPrivateKey));
|
|
1844
1842
|
psbt.signInput(input, tweakedKeyPair, sighashTypes);
|
|
1845
1843
|
return psbt;
|
|
1846
1844
|
}
|
|
1847
|
-
const keypair = (0,
|
|
1845
|
+
const keypair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(this.identityKey.privateKey));
|
|
1848
1846
|
psbt.signInput(input, keypair, sighashTypes);
|
|
1849
1847
|
return psbt;
|
|
1850
1848
|
}
|
|
1851
1849
|
getReceiptPrivateKey(receipt) {
|
|
1852
|
-
const pxh =
|
|
1850
|
+
const pxh = import_lrc20_sdk.Receipt.receiptHash(receipt);
|
|
1853
1851
|
let innerKey = this.identityKey.publicKey;
|
|
1854
1852
|
let privateKey = this.identityKey.privateKey;
|
|
1855
1853
|
if (innerKey[0] === 3) {
|
|
@@ -1860,11 +1858,30 @@ var DefaultSparkSigner = class {
|
|
|
1860
1858
|
const receiptProof = (0, import_secp256k16.privateAdd)(privateKey, pxhPubkey);
|
|
1861
1859
|
return import_buffer.Buffer.from(receiptProof);
|
|
1862
1860
|
}
|
|
1861
|
+
signTransactionIndex(tx, index, publicKey) {
|
|
1862
|
+
let privateKey;
|
|
1863
|
+
if ((0, import_utils4.equalBytes)(publicKey, this.identityKey?.publicKey ?? new Uint8Array())) {
|
|
1864
|
+
privateKey = this.identityKey?.privateKey;
|
|
1865
|
+
} else if ((0, import_utils4.equalBytes)(publicKey, this.depositKey?.publicKey ?? new Uint8Array())) {
|
|
1866
|
+
privateKey = this.depositKey?.privateKey;
|
|
1867
|
+
} else {
|
|
1868
|
+
privateKey = (0, import_utils4.hexToBytes)(
|
|
1869
|
+
this.publicKeyToPrivateKeyMap.get((0, import_utils4.bytesToHex)(publicKey)) ?? ""
|
|
1870
|
+
);
|
|
1871
|
+
}
|
|
1872
|
+
if (!privateKey) {
|
|
1873
|
+
throw new ValidationError("Private key not found for public key", {
|
|
1874
|
+
field: "privateKey",
|
|
1875
|
+
value: (0, import_utils4.bytesToHex)(publicKey)
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
tx.signIdx(privateKey, index);
|
|
1879
|
+
}
|
|
1863
1880
|
};
|
|
1864
1881
|
|
|
1865
1882
|
// src/utils/network.ts
|
|
1866
1883
|
init_buffer();
|
|
1867
|
-
var
|
|
1884
|
+
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
1868
1885
|
var btc = __toESM(require("@scure/btc-signer"), 1);
|
|
1869
1886
|
var bitcoin = __toESM(require("bitcoinjs-lib"), 1);
|
|
1870
1887
|
|
|
@@ -1915,11 +1932,11 @@ var LRC_WALLET_NETWORK = Object.freeze({
|
|
|
1915
1932
|
[4 /* LOCAL */]: bitcoin.networks.regtest
|
|
1916
1933
|
});
|
|
1917
1934
|
var LRC_WALLET_NETWORK_TYPE = Object.freeze({
|
|
1918
|
-
[0 /* MAINNET */]:
|
|
1919
|
-
[1 /* TESTNET */]:
|
|
1920
|
-
[2 /* SIGNET */]:
|
|
1921
|
-
[3 /* REGTEST */]:
|
|
1922
|
-
[4 /* LOCAL */]:
|
|
1935
|
+
[0 /* MAINNET */]: import_lrc20_sdk2.NetworkType.MAINNET,
|
|
1936
|
+
[1 /* TESTNET */]: import_lrc20_sdk2.NetworkType.TESTNET,
|
|
1937
|
+
[2 /* SIGNET */]: import_lrc20_sdk2.NetworkType.TESTNET,
|
|
1938
|
+
[3 /* REGTEST */]: import_lrc20_sdk2.NetworkType.REGTEST,
|
|
1939
|
+
[4 /* LOCAL */]: import_lrc20_sdk2.NetworkType.LOCAL
|
|
1923
1940
|
});
|
|
1924
1941
|
|
|
1925
1942
|
// src/services/wallet-config.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HasLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
|
|
2
|
-
import { H as HasSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-
|
|
2
|
+
import { H as HasSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
3
3
|
import { B as BitcoinNetwork } from '../BitcoinNetwork-TnABML0T.cjs';
|
|
4
|
-
import { S as SparkSigner } from '../signer-
|
|
5
|
-
import { N as Network, a as NetworkType } from '../network-
|
|
4
|
+
import { S as SparkSigner } from '../signer-CYwn7h9U.cjs';
|
|
5
|
+
import { N as Network, a as NetworkType } from '../network-B10hBoHp.cjs';
|
|
6
6
|
import { ConfigOptions, SigningOperator } from './wallet-config.cjs';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '@scure/bip32';
|
|
9
9
|
import '../spark-DXYE9gMM.cjs';
|
|
10
10
|
import '@bufbuild/protobuf/wire';
|
|
11
11
|
import 'nice-grpc-common';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
12
|
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
14
14
|
|
|
15
15
|
declare class WalletConfigService implements HasLrc20WalletApiConfig, HasSspClientOptions {
|
|
16
16
|
private readonly config;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HasLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
|
|
2
|
-
import { H as HasSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-
|
|
2
|
+
import { H as HasSspClientOptions, B as SspClientOptions } from '../RequestLightningSendInput-CJtcHOnu.js';
|
|
3
3
|
import { B as BitcoinNetwork } from '../BitcoinNetwork-TnABML0T.js';
|
|
4
|
-
import { S as SparkSigner } from '../signer-
|
|
5
|
-
import { N as Network, a as NetworkType } from '../network-
|
|
4
|
+
import { S as SparkSigner } from '../signer-C5h1DpjF.js';
|
|
5
|
+
import { N as Network, a as NetworkType } from '../network-CCgyIsGl.js';
|
|
6
6
|
import { ConfigOptions, SigningOperator } from './wallet-config.js';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '@scure/bip32';
|
|
9
9
|
import '../spark-DXYE9gMM.js';
|
|
10
10
|
import '@bufbuild/protobuf/wire';
|
|
11
11
|
import 'nice-grpc-common';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
12
|
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
14
14
|
|
|
15
15
|
declare class WalletConfigService implements HasLrc20WalletApiConfig, HasSspClientOptions {
|
|
16
16
|
private readonly config;
|
package/dist/services/config.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WalletConfigService
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-W2VXS35Y.js";
|
|
4
|
+
import "../chunk-RFCXPGDM.js";
|
|
5
|
+
import "../chunk-HK6LPV6Z.js";
|
|
5
6
|
import "../chunk-ZUVYYR5T.js";
|
|
6
|
-
import "../chunk-HMLOC6TE.js";
|
|
7
|
-
import "../chunk-RAPBVYJY.js";
|
|
8
7
|
import "../chunk-7VMYMQLF.js";
|
|
9
8
|
import "../chunk-MGPRLH6Q.js";
|
|
9
|
+
import "../chunk-HMLOC6TE.js";
|
|
10
10
|
import "../chunk-VTUGIIWI.js";
|
|
11
|
-
import "../chunk-C5LTJBI7.js";
|
|
12
11
|
import "../chunk-HKAKEKCE.js";
|
|
13
12
|
import "../chunk-TWF35O6M.js";
|
|
13
|
+
import "../chunk-C5LTJBI7.js";
|
|
14
14
|
import "../chunk-MVRQ5US7.js";
|
|
15
15
|
export {
|
|
16
16
|
WalletConfigService
|
|
@@ -5,14 +5,14 @@ import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
|
5
5
|
import { CallOptions } from 'nice-grpc-common';
|
|
6
6
|
import { WalletConfigService } from './config.cjs';
|
|
7
7
|
import '@buildonspark/lrc20-sdk';
|
|
8
|
-
import '../RequestLightningSendInput-
|
|
8
|
+
import '../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
9
9
|
import '@lightsparkdev/core';
|
|
10
10
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
11
|
-
import '../signer-
|
|
11
|
+
import '../signer-CYwn7h9U.cjs';
|
|
12
12
|
import '@scure/bip32';
|
|
13
|
-
import 'bitcoinjs-lib';
|
|
14
|
-
import '../network-GFGEHkS4.cjs';
|
|
15
13
|
import '@scure/btc-signer';
|
|
14
|
+
import 'bitcoinjs-lib';
|
|
15
|
+
import '../network-B10hBoHp.cjs';
|
|
16
16
|
import './wallet-config.cjs';
|
|
17
17
|
|
|
18
18
|
declare enum InterruptTransferRequest_InterruptTransferAction {
|
|
@@ -5,14 +5,14 @@ import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
|
5
5
|
import { CallOptions } from 'nice-grpc-common';
|
|
6
6
|
import { WalletConfigService } from './config.js';
|
|
7
7
|
import '@buildonspark/lrc20-sdk';
|
|
8
|
-
import '../RequestLightningSendInput-
|
|
8
|
+
import '../RequestLightningSendInput-CJtcHOnu.js';
|
|
9
9
|
import '@lightsparkdev/core';
|
|
10
10
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
11
|
-
import '../signer-
|
|
11
|
+
import '../signer-C5h1DpjF.js';
|
|
12
12
|
import '@scure/bip32';
|
|
13
|
-
import 'bitcoinjs-lib';
|
|
14
|
-
import '../network-DobHpaV6.js';
|
|
15
13
|
import '@scure/btc-signer';
|
|
14
|
+
import 'bitcoinjs-lib';
|
|
15
|
+
import '../network-CCgyIsGl.js';
|
|
16
16
|
import './wallet-config.js';
|
|
17
17
|
|
|
18
18
|
declare enum InterruptTransferRequest_InterruptTransferAction {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionManager
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-C5LTJBI7.js";
|
|
3
|
+
} from "../chunk-I4JI6TYN.js";
|
|
5
4
|
import "../chunk-HKAKEKCE.js";
|
|
6
5
|
import "../chunk-TWF35O6M.js";
|
|
6
|
+
import "../chunk-C5LTJBI7.js";
|
|
7
7
|
import "../chunk-MVRQ5US7.js";
|
|
8
8
|
export {
|
|
9
9
|
ConnectionManager
|
package/dist/services/index.cjs
CHANGED
|
@@ -1663,11 +1663,9 @@ function getSigningCommitmentFromNonce(nonce) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
|
|
1665
1665
|
// src/signer/signer.ts
|
|
1666
|
-
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1667
|
-
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
1668
1666
|
var import_secp256k16 = require("@bitcoinerlab/secp256k1");
|
|
1667
|
+
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1669
1668
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
1670
|
-
var import_lrc20_sdk3 = require("@buildonspark/lrc20-sdk");
|
|
1671
1669
|
var sparkFrostModule = void 0;
|
|
1672
1670
|
var getSparkFrostModule = async () => {
|
|
1673
1671
|
if (isReactNative) {
|
|
@@ -2133,16 +2131,16 @@ var DefaultSparkSigner = class {
|
|
|
2133
2131
|
}
|
|
2134
2132
|
if (receipt) {
|
|
2135
2133
|
const receiptPrivateKey = this.getReceiptPrivateKey(receipt);
|
|
2136
|
-
const tweakedKeyPair = (0,
|
|
2134
|
+
const tweakedKeyPair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(receiptPrivateKey));
|
|
2137
2135
|
psbt.signInput(input, tweakedKeyPair, sighashTypes);
|
|
2138
2136
|
return psbt;
|
|
2139
2137
|
}
|
|
2140
|
-
const keypair = (0,
|
|
2138
|
+
const keypair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(this.identityKey.privateKey));
|
|
2141
2139
|
psbt.signInput(input, keypair, sighashTypes);
|
|
2142
2140
|
return psbt;
|
|
2143
2141
|
}
|
|
2144
2142
|
getReceiptPrivateKey(receipt) {
|
|
2145
|
-
const pxh =
|
|
2143
|
+
const pxh = import_lrc20_sdk.Receipt.receiptHash(receipt);
|
|
2146
2144
|
let innerKey = this.identityKey.publicKey;
|
|
2147
2145
|
let privateKey = this.identityKey.privateKey;
|
|
2148
2146
|
if (innerKey[0] === 3) {
|
|
@@ -2153,11 +2151,30 @@ var DefaultSparkSigner = class {
|
|
|
2153
2151
|
const receiptProof = (0, import_secp256k16.privateAdd)(privateKey, pxhPubkey);
|
|
2154
2152
|
return import_buffer.Buffer.from(receiptProof);
|
|
2155
2153
|
}
|
|
2154
|
+
signTransactionIndex(tx, index, publicKey) {
|
|
2155
|
+
let privateKey;
|
|
2156
|
+
if ((0, import_utils4.equalBytes)(publicKey, this.identityKey?.publicKey ?? new Uint8Array())) {
|
|
2157
|
+
privateKey = this.identityKey?.privateKey;
|
|
2158
|
+
} else if ((0, import_utils4.equalBytes)(publicKey, this.depositKey?.publicKey ?? new Uint8Array())) {
|
|
2159
|
+
privateKey = this.depositKey?.privateKey;
|
|
2160
|
+
} else {
|
|
2161
|
+
privateKey = (0, import_utils4.hexToBytes)(
|
|
2162
|
+
this.publicKeyToPrivateKeyMap.get((0, import_utils4.bytesToHex)(publicKey)) ?? ""
|
|
2163
|
+
);
|
|
2164
|
+
}
|
|
2165
|
+
if (!privateKey) {
|
|
2166
|
+
throw new ValidationError("Private key not found for public key", {
|
|
2167
|
+
field: "privateKey",
|
|
2168
|
+
value: (0, import_utils4.bytesToHex)(publicKey)
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
tx.signIdx(privateKey, index);
|
|
2172
|
+
}
|
|
2156
2173
|
};
|
|
2157
2174
|
|
|
2158
2175
|
// src/utils/network.ts
|
|
2159
2176
|
init_buffer();
|
|
2160
|
-
var
|
|
2177
|
+
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
2161
2178
|
var btc = __toESM(require("@scure/btc-signer"), 1);
|
|
2162
2179
|
var bitcoin = __toESM(require("bitcoinjs-lib"), 1);
|
|
2163
2180
|
|
|
@@ -15415,11 +15432,11 @@ var LRC_WALLET_NETWORK = Object.freeze({
|
|
|
15415
15432
|
[4 /* LOCAL */]: bitcoin.networks.regtest
|
|
15416
15433
|
});
|
|
15417
15434
|
var LRC_WALLET_NETWORK_TYPE = Object.freeze({
|
|
15418
|
-
[0 /* MAINNET */]:
|
|
15419
|
-
[1 /* TESTNET */]:
|
|
15420
|
-
[2 /* SIGNET */]:
|
|
15421
|
-
[3 /* REGTEST */]:
|
|
15422
|
-
[4 /* LOCAL */]:
|
|
15435
|
+
[0 /* MAINNET */]: import_lrc20_sdk2.NetworkType.MAINNET,
|
|
15436
|
+
[1 /* TESTNET */]: import_lrc20_sdk2.NetworkType.TESTNET,
|
|
15437
|
+
[2 /* SIGNET */]: import_lrc20_sdk2.NetworkType.TESTNET,
|
|
15438
|
+
[3 /* REGTEST */]: import_lrc20_sdk2.NetworkType.REGTEST,
|
|
15439
|
+
[4 /* LOCAL */]: import_lrc20_sdk2.NetworkType.LOCAL
|
|
15423
15440
|
});
|
|
15424
15441
|
|
|
15425
15442
|
// src/services/wallet-config.ts
|
|
@@ -16465,7 +16482,7 @@ function isValidPublicKey(publicKey) {
|
|
|
16465
16482
|
}
|
|
16466
16483
|
|
|
16467
16484
|
// src/services/token-transactions.ts
|
|
16468
|
-
var MAX_TOKEN_OUTPUTS =
|
|
16485
|
+
var MAX_TOKEN_OUTPUTS = 500;
|
|
16469
16486
|
var TokenTransactionService = class {
|
|
16470
16487
|
config;
|
|
16471
16488
|
connectionManager;
|
|
@@ -3,16 +3,16 @@ export { TokenTransactionService } from './token-transactions.cjs';
|
|
|
3
3
|
export { ConnectionManager } from './connection.cjs';
|
|
4
4
|
export { ConfigOptions, ELECTRS_CREDENTIALS, LOCAL_WALLET_CONFIG, LOCAL_WALLET_CONFIG_ECDSA, LOCAL_WALLET_CONFIG_SCHNORR, MAINNET_WALLET_CONFIG, REGTEST_WALLET_CONFIG, SigningOperator, getElectrsUrl, getLocalSigningOperators, getLrc20NodeUrl, getLrc20Url, getSspIdentityPublicKey, getSspSchemaEndpoint, getSspUrl } from './wallet-config.cjs';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
|
6
|
-
import '../RequestLightningSendInput-
|
|
6
|
+
import '../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
9
|
-
import '../signer-
|
|
9
|
+
import '../signer-CYwn7h9U.cjs';
|
|
10
10
|
import '@scure/bip32';
|
|
11
11
|
import '../spark-DXYE9gMM.cjs';
|
|
12
12
|
import '@bufbuild/protobuf/wire';
|
|
13
13
|
import 'nice-grpc-common';
|
|
14
|
-
import 'bitcoinjs-lib';
|
|
15
|
-
import '../network-GFGEHkS4.cjs';
|
|
16
14
|
import '@scure/btc-signer';
|
|
15
|
+
import 'bitcoinjs-lib';
|
|
16
|
+
import '../network-B10hBoHp.cjs';
|
|
17
17
|
import 'nice-grpc';
|
|
18
18
|
import 'nice-grpc-web';
|
package/dist/services/index.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ export { TokenTransactionService } from './token-transactions.js';
|
|
|
3
3
|
export { ConnectionManager } from './connection.js';
|
|
4
4
|
export { ConfigOptions, ELECTRS_CREDENTIALS, LOCAL_WALLET_CONFIG, LOCAL_WALLET_CONFIG_ECDSA, LOCAL_WALLET_CONFIG_SCHNORR, MAINNET_WALLET_CONFIG, REGTEST_WALLET_CONFIG, SigningOperator, getElectrsUrl, getLocalSigningOperators, getLrc20NodeUrl, getLrc20Url, getSspIdentityPublicKey, getSspSchemaEndpoint, getSspUrl } from './wallet-config.js';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
|
6
|
-
import '../RequestLightningSendInput-
|
|
6
|
+
import '../RequestLightningSendInput-CJtcHOnu.js';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
9
|
-
import '../signer-
|
|
9
|
+
import '../signer-C5h1DpjF.js';
|
|
10
10
|
import '@scure/bip32';
|
|
11
11
|
import '../spark-DXYE9gMM.js';
|
|
12
12
|
import '@bufbuild/protobuf/wire';
|
|
13
13
|
import 'nice-grpc-common';
|
|
14
|
-
import 'bitcoinjs-lib';
|
|
15
|
-
import '../network-DobHpaV6.js';
|
|
16
14
|
import '@scure/btc-signer';
|
|
15
|
+
import 'bitcoinjs-lib';
|
|
16
|
+
import '../network-CCgyIsGl.js';
|
|
17
17
|
import 'nice-grpc';
|
|
18
18
|
import 'nice-grpc-web';
|
package/dist/services/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TokenTransactionService
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5MNQB2T4.js";
|
|
4
4
|
import "../chunk-57XLH3ZR.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-2CDJZQN4.js";
|
|
6
6
|
import {
|
|
7
7
|
WalletConfigService
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-W2VXS35Y.js";
|
|
9
|
+
import "../chunk-RFCXPGDM.js";
|
|
10
|
+
import "../chunk-HK6LPV6Z.js";
|
|
10
11
|
import {
|
|
11
12
|
ELECTRS_CREDENTIALS,
|
|
12
13
|
LOCAL_WALLET_CONFIG,
|
|
@@ -22,17 +23,16 @@ import {
|
|
|
22
23
|
getSspSchemaEndpoint,
|
|
23
24
|
getSspUrl
|
|
24
25
|
} from "../chunk-ZUVYYR5T.js";
|
|
25
|
-
import "../chunk-HMLOC6TE.js";
|
|
26
|
-
import "../chunk-RAPBVYJY.js";
|
|
27
26
|
import "../chunk-7VMYMQLF.js";
|
|
28
27
|
import "../chunk-MGPRLH6Q.js";
|
|
28
|
+
import "../chunk-HMLOC6TE.js";
|
|
29
29
|
import "../chunk-VTUGIIWI.js";
|
|
30
30
|
import {
|
|
31
31
|
ConnectionManager
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-C5LTJBI7.js";
|
|
32
|
+
} from "../chunk-I4JI6TYN.js";
|
|
34
33
|
import "../chunk-HKAKEKCE.js";
|
|
35
34
|
import "../chunk-TWF35O6M.js";
|
|
35
|
+
import "../chunk-C5LTJBI7.js";
|
|
36
36
|
import "../chunk-MVRQ5US7.js";
|
|
37
37
|
export {
|
|
38
38
|
ConnectionManager,
|
|
@@ -4,14 +4,14 @@ import '../spark-DXYE9gMM.cjs';
|
|
|
4
4
|
import '@bufbuild/protobuf/wire';
|
|
5
5
|
import 'nice-grpc-common';
|
|
6
6
|
import '@buildonspark/lrc20-sdk';
|
|
7
|
-
import '../RequestLightningSendInput-
|
|
7
|
+
import '../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
8
8
|
import '@lightsparkdev/core';
|
|
9
9
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
10
|
-
import '../signer-
|
|
10
|
+
import '../signer-CYwn7h9U.cjs';
|
|
11
11
|
import '@scure/bip32';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
|
-
import '../network-GFGEHkS4.cjs';
|
|
14
12
|
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
14
|
+
import '../network-B10hBoHp.cjs';
|
|
15
15
|
import './wallet-config.cjs';
|
|
16
16
|
|
|
17
17
|
declare class Lrc20ConnectionManager {
|
|
@@ -4,14 +4,14 @@ import '../spark-DXYE9gMM.js';
|
|
|
4
4
|
import '@bufbuild/protobuf/wire';
|
|
5
5
|
import 'nice-grpc-common';
|
|
6
6
|
import '@buildonspark/lrc20-sdk';
|
|
7
|
-
import '../RequestLightningSendInput-
|
|
7
|
+
import '../RequestLightningSendInput-CJtcHOnu.js';
|
|
8
8
|
import '@lightsparkdev/core';
|
|
9
9
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
10
|
-
import '../signer-
|
|
10
|
+
import '../signer-C5h1DpjF.js';
|
|
11
11
|
import '@scure/bip32';
|
|
12
|
-
import 'bitcoinjs-lib';
|
|
13
|
-
import '../network-DobHpaV6.js';
|
|
14
12
|
import '@scure/btc-signer';
|
|
13
|
+
import 'bitcoinjs-lib';
|
|
14
|
+
import '../network-CCgyIsGl.js';
|
|
15
15
|
import './wallet-config.js';
|
|
16
16
|
|
|
17
17
|
declare class Lrc20ConnectionManager {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
Lrc20ConnectionManager
|
|
3
3
|
} from "../chunk-FWQPAPXK.js";
|
|
4
4
|
import "../chunk-NS4UZRQ7.js";
|
|
5
|
-
import "../chunk-C5LTJBI7.js";
|
|
6
5
|
import "../chunk-HKAKEKCE.js";
|
|
7
6
|
import "../chunk-TWF35O6M.js";
|
|
7
|
+
import "../chunk-C5LTJBI7.js";
|
|
8
8
|
import "../chunk-MVRQ5US7.js";
|
|
9
9
|
export {
|
|
10
10
|
Lrc20ConnectionManager
|
|
@@ -3,14 +3,14 @@ import { j as OutputWithPreviousTransactionData, T as TokenTransaction, R as Rev
|
|
|
3
3
|
import { ConnectionManager } from './connection.cjs';
|
|
4
4
|
import './wallet-config.cjs';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
|
6
|
-
import '../RequestLightningSendInput-
|
|
6
|
+
import '../RequestLightningSendInput-DfmfqzZo.cjs';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
9
|
-
import '../signer-
|
|
9
|
+
import '../signer-CYwn7h9U.cjs';
|
|
10
10
|
import '@scure/bip32';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
|
-
import '../network-GFGEHkS4.cjs';
|
|
13
11
|
import '@scure/btc-signer';
|
|
12
|
+
import 'bitcoinjs-lib';
|
|
13
|
+
import '../network-B10hBoHp.cjs';
|
|
14
14
|
import '@bufbuild/protobuf/wire';
|
|
15
15
|
import 'nice-grpc-common';
|
|
16
16
|
import 'nice-grpc';
|
|
@@ -3,14 +3,14 @@ import { j as OutputWithPreviousTransactionData, T as TokenTransaction, R as Rev
|
|
|
3
3
|
import { ConnectionManager } from './connection.js';
|
|
4
4
|
import './wallet-config.js';
|
|
5
5
|
import '@buildonspark/lrc20-sdk';
|
|
6
|
-
import '../RequestLightningSendInput-
|
|
6
|
+
import '../RequestLightningSendInput-CJtcHOnu.js';
|
|
7
7
|
import '@lightsparkdev/core';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
9
|
-
import '../signer-
|
|
9
|
+
import '../signer-C5h1DpjF.js';
|
|
10
10
|
import '@scure/bip32';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
|
-
import '../network-DobHpaV6.js';
|
|
13
11
|
import '@scure/btc-signer';
|
|
12
|
+
import 'bitcoinjs-lib';
|
|
13
|
+
import '../network-CCgyIsGl.js';
|
|
14
14
|
import '@bufbuild/protobuf/wire';
|
|
15
15
|
import 'nice-grpc-common';
|
|
16
16
|
import 'nice-grpc';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TokenTransactionService
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5MNQB2T4.js";
|
|
4
4
|
import "../chunk-57XLH3ZR.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-2CDJZQN4.js";
|
|
6
6
|
import "../chunk-MGPRLH6Q.js";
|
|
7
7
|
import "../chunk-VTUGIIWI.js";
|
|
8
|
-
import "../chunk-C5LTJBI7.js";
|
|
9
8
|
import "../chunk-TWF35O6M.js";
|
|
9
|
+
import "../chunk-C5LTJBI7.js";
|
|
10
10
|
import "../chunk-MVRQ5US7.js";
|
|
11
11
|
export {
|
|
12
12
|
TokenTransactionService
|
|
@@ -1,15 +1,15 @@
|
|
|
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-DfmfqzZo.cjs';
|
|
3
|
+
import { a as NetworkType } from '../network-B10hBoHp.cjs';
|
|
4
4
|
import '@lightsparkdev/core';
|
|
5
5
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
|
6
|
-
import '../signer-
|
|
6
|
+
import '../signer-CYwn7h9U.cjs';
|
|
7
7
|
import '@scure/bip32';
|
|
8
8
|
import '../spark-DXYE9gMM.cjs';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
11
|
import '@scure/btc-signer';
|
|
12
|
+
import 'bitcoinjs-lib';
|
|
13
13
|
|
|
14
14
|
declare const ELECTRS_CREDENTIALS: {
|
|
15
15
|
username: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
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-CJtcHOnu.js';
|
|
3
|
+
import { a as NetworkType } from '../network-CCgyIsGl.js';
|
|
4
4
|
import '@lightsparkdev/core';
|
|
5
5
|
import '../BitcoinNetwork-TnABML0T.js';
|
|
6
|
-
import '../signer-
|
|
6
|
+
import '../signer-C5h1DpjF.js';
|
|
7
7
|
import '@scure/bip32';
|
|
8
8
|
import '../spark-DXYE9gMM.js';
|
|
9
9
|
import '@bufbuild/protobuf/wire';
|
|
10
10
|
import 'nice-grpc-common';
|
|
11
|
-
import 'bitcoinjs-lib';
|
|
12
11
|
import '@scure/btc-signer';
|
|
12
|
+
import 'bitcoinjs-lib';
|
|
13
13
|
|
|
14
14
|
declare const ELECTRS_CREDENTIALS: {
|
|
15
15
|
username: string;
|
package/dist/signer/signer.cjs
CHANGED
|
@@ -1364,11 +1364,9 @@ function getSigningCommitmentFromNonce(nonce) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
|
|
1366
1366
|
// src/signer/signer.ts
|
|
1367
|
-
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1368
|
-
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
1369
1367
|
var import_secp256k16 = require("@bitcoinerlab/secp256k1");
|
|
1368
|
+
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
1370
1369
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
1371
|
-
var import_lrc20_sdk3 = require("@buildonspark/lrc20-sdk");
|
|
1372
1370
|
var sparkFrostModule = void 0;
|
|
1373
1371
|
var getSparkFrostModule = async () => {
|
|
1374
1372
|
if (isReactNative) {
|
|
@@ -1834,16 +1832,16 @@ var DefaultSparkSigner = class {
|
|
|
1834
1832
|
}
|
|
1835
1833
|
if (receipt) {
|
|
1836
1834
|
const receiptPrivateKey = this.getReceiptPrivateKey(receipt);
|
|
1837
|
-
const tweakedKeyPair = (0,
|
|
1835
|
+
const tweakedKeyPair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(receiptPrivateKey));
|
|
1838
1836
|
psbt.signInput(input, tweakedKeyPair, sighashTypes);
|
|
1839
1837
|
return psbt;
|
|
1840
1838
|
}
|
|
1841
|
-
const keypair = (0,
|
|
1839
|
+
const keypair = (0, import_lrc20_sdk.fromPrivateKey)(import_buffer.Buffer.from(this.identityKey.privateKey));
|
|
1842
1840
|
psbt.signInput(input, keypair, sighashTypes);
|
|
1843
1841
|
return psbt;
|
|
1844
1842
|
}
|
|
1845
1843
|
getReceiptPrivateKey(receipt) {
|
|
1846
|
-
const pxh =
|
|
1844
|
+
const pxh = import_lrc20_sdk.Receipt.receiptHash(receipt);
|
|
1847
1845
|
let innerKey = this.identityKey.publicKey;
|
|
1848
1846
|
let privateKey = this.identityKey.privateKey;
|
|
1849
1847
|
if (innerKey[0] === 3) {
|
|
@@ -1854,6 +1852,25 @@ var DefaultSparkSigner = class {
|
|
|
1854
1852
|
const receiptProof = (0, import_secp256k16.privateAdd)(privateKey, pxhPubkey);
|
|
1855
1853
|
return import_buffer.Buffer.from(receiptProof);
|
|
1856
1854
|
}
|
|
1855
|
+
signTransactionIndex(tx, index, publicKey) {
|
|
1856
|
+
let privateKey;
|
|
1857
|
+
if ((0, import_utils4.equalBytes)(publicKey, this.identityKey?.publicKey ?? new Uint8Array())) {
|
|
1858
|
+
privateKey = this.identityKey?.privateKey;
|
|
1859
|
+
} else if ((0, import_utils4.equalBytes)(publicKey, this.depositKey?.publicKey ?? new Uint8Array())) {
|
|
1860
|
+
privateKey = this.depositKey?.privateKey;
|
|
1861
|
+
} else {
|
|
1862
|
+
privateKey = (0, import_utils4.hexToBytes)(
|
|
1863
|
+
this.publicKeyToPrivateKeyMap.get((0, import_utils4.bytesToHex)(publicKey)) ?? ""
|
|
1864
|
+
);
|
|
1865
|
+
}
|
|
1866
|
+
if (!privateKey) {
|
|
1867
|
+
throw new ValidationError("Private key not found for public key", {
|
|
1868
|
+
field: "privateKey",
|
|
1869
|
+
value: (0, import_utils4.bytesToHex)(publicKey)
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
tx.signIdx(privateKey, index);
|
|
1873
|
+
}
|
|
1857
1874
|
};
|
|
1858
1875
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1859
1876
|
0 && (module.exports = {
|
package/dist/signer/signer.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@scure/bip32';
|
|
2
2
|
import '../spark-DXYE9gMM.cjs';
|
|
3
|
-
export { A as AggregateFrostParams, D as DefaultSparkSigner, j as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, k as SplitSecretWithProofsParams } from '../signer-
|
|
4
|
-
import 'bitcoinjs-lib';
|
|
3
|
+
export { A as AggregateFrostParams, D as DefaultSparkSigner, j as SignFrostParams, h as SigningCommitment, i as SigningNonce, S as SparkSigner, k as SplitSecretWithProofsParams } from '../signer-CYwn7h9U.cjs';
|
|
5
4
|
import '@buildonspark/lrc20-sdk';
|
|
5
|
+
import '@scure/btc-signer';
|
|
6
|
+
import 'bitcoinjs-lib';
|
|
6
7
|
import '@bufbuild/protobuf/wire';
|
|
7
8
|
import 'nice-grpc-common';
|