@buildonspark/spark-sdk 0.1.45 → 0.1.47

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.
Files changed (146) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{chunk-I54FARY2.js → chunk-EAP3U3CW.js} +14 -14
  3. package/dist/chunk-GWFQ7EBA.js +3773 -0
  4. package/dist/{chunk-J2IE4Z7Y.js → chunk-NNX4OK44.js} +3487 -934
  5. package/dist/{RequestLightningSendInput-Du0z7Om7.d.cts → client-CvpTRpcw.d.cts} +422 -212
  6. package/dist/{RequestLightningSendInput-DEPd_fPO.d.ts → client-D7KgLN44.d.ts} +422 -212
  7. package/dist/graphql/objects/index.d.cts +5 -9
  8. package/dist/graphql/objects/index.d.ts +5 -9
  9. package/dist/graphql/objects/index.js +1 -1
  10. package/dist/index.cjs +20461 -23377
  11. package/dist/index.d.cts +15 -769
  12. package/dist/index.d.ts +15 -769
  13. package/dist/index.js +81 -71
  14. package/dist/index.node.cjs +21994 -25018
  15. package/dist/index.node.d.cts +312 -34
  16. package/dist/index.node.d.ts +312 -34
  17. package/dist/index.node.js +82 -176
  18. package/dist/native/index.cjs +22847 -25841
  19. package/dist/native/index.d.cts +974 -1138
  20. package/dist/native/index.d.ts +974 -1138
  21. package/dist/native/index.js +10604 -13592
  22. package/dist/proto/lrc20.d.cts +2 -2
  23. package/dist/proto/lrc20.d.ts +2 -2
  24. package/dist/proto/lrc20.js +3098 -46
  25. package/dist/proto/spark.d.cts +1 -1
  26. package/dist/proto/spark.d.ts +1 -1
  27. package/dist/proto/spark_token.d.cts +1 -1
  28. package/dist/proto/spark_token.d.ts +1 -1
  29. package/dist/{sdk-types-Cc4l4kb1.d.ts → sdk-types-BGCeea0G.d.ts} +1 -1
  30. package/dist/{sdk-types-B0SwjolI.d.cts → sdk-types-XUeQMLFP.d.cts} +1 -1
  31. package/dist/{spark-dM7EYXYQ.d.cts → spark-BbUrbvZz.d.cts} +1 -1
  32. package/dist/{spark-dM7EYXYQ.d.ts → spark-BbUrbvZz.d.ts} +1 -1
  33. package/dist/spark-wallet-BAFPpPtY.d.cts +923 -0
  34. package/dist/spark-wallet-CJkQW8pK.d.ts +923 -0
  35. package/dist/spark_bindings/native/index.d.cts +1 -1
  36. package/dist/spark_bindings/native/index.d.ts +1 -1
  37. package/dist/spark_bindings/wasm/index.d.cts +1 -1
  38. package/dist/spark_bindings/wasm/index.d.ts +1 -1
  39. package/dist/{services/index.cjs → tests/test-utils.cjs} +2512 -4380
  40. package/dist/tests/test-utils.d.cts +79 -0
  41. package/dist/tests/test-utils.d.ts +79 -0
  42. package/dist/tests/test-utils.js +85 -0
  43. package/dist/types/index.d.cts +5 -9
  44. package/dist/types/index.d.ts +5 -9
  45. package/dist/types/index.js +5 -5
  46. package/dist/{types-C-Rp0Oo7.d.cts → types-BADxR3bm.d.cts} +1 -1
  47. package/dist/{types-C-Rp0Oo7.d.ts → types-BADxR3bm.d.ts} +1 -1
  48. package/package.json +7 -35
  49. package/src/graphql/client.ts +59 -20
  50. package/src/index.node.ts +28 -2
  51. package/src/index.ts +31 -1
  52. package/src/native/index.ts +16 -2
  53. package/src/services/config.ts +4 -6
  54. package/src/services/connection.ts +131 -64
  55. package/src/services/lightning.ts +1 -2
  56. package/src/services/token-transactions.ts +7 -7
  57. package/src/services/transfer.ts +1 -1
  58. package/src/services/tree-creation.ts +1 -1
  59. package/src/services/wallet-config.ts +18 -10
  60. package/src/signer/signer.react-native.ts +2 -5
  61. package/src/signer/signer.ts +138 -64
  62. package/src/signer/types.ts +52 -0
  63. package/src/spark-wallet/spark-wallet.ts +79 -36
  64. package/src/spark-wallet/types.ts +4 -4
  65. package/src/tests/integration/coop-exit.test.ts +2 -1
  66. package/src/tests/integration/lightning.test.ts +2 -2
  67. package/src/tests/integration/swap.test.ts +1 -1
  68. package/src/tests/integration/transfer.test.ts +5 -5
  69. package/src/tests/integration/tree-creation.test.ts +1 -1
  70. package/src/tests/integration/wallet.test.ts +1 -0
  71. package/src/tests/isHermeticTest.ts +3 -24
  72. package/src/tests/{test-util.ts → test-utils.ts} +3 -7
  73. package/src/tests/wrapWithOtelSpan.test.ts +1 -1
  74. package/src/{address → utils}/address.ts +1 -1
  75. package/src/utils/crypto.ts +19 -9
  76. package/src/utils/index.ts +2 -0
  77. package/src/utils/network.ts +17 -0
  78. package/src/utils/secret-sharing.ts +1 -2
  79. package/src/utils/signing.ts +1 -1
  80. package/src/utils/token-transactions.ts +3 -3
  81. package/src/utils/unilateral-exit.ts +32 -0
  82. package/src/utils/xchain-address.ts +1 -1
  83. package/dist/BitcoinNetwork-TnABML0T.d.cts +0 -18
  84. package/dist/BitcoinNetwork-TnABML0T.d.ts +0 -18
  85. package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.cts +0 -10
  86. package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.ts +0 -10
  87. package/dist/address/index.cjs +0 -458
  88. package/dist/address/index.d.cts +0 -32
  89. package/dist/address/index.d.ts +0 -32
  90. package/dist/address/index.js +0 -17
  91. package/dist/chunk-5FUB65LX.js +0 -838
  92. package/dist/chunk-6264CGDM.js +0 -113
  93. package/dist/chunk-7V6N75CC.js +0 -24
  94. package/dist/chunk-C2S227QR.js +0 -2336
  95. package/dist/chunk-GSI4OLXZ.js +0 -117
  96. package/dist/chunk-GZ5IPPJ2.js +0 -170
  97. package/dist/chunk-HWJWKEIU.js +0 -75
  98. package/dist/chunk-KMUMFYFX.js +0 -137
  99. package/dist/chunk-L3EHBOUX.js +0 -0
  100. package/dist/chunk-NSJF5F5O.js +0 -325
  101. package/dist/chunk-NTFKFRQ2.js +0 -3146
  102. package/dist/chunk-PQN3C2MF.js +0 -1122
  103. package/dist/chunk-QNNSEJ4P.js +0 -232
  104. package/dist/chunk-R5PXJZQS.js +0 -277
  105. package/dist/chunk-VTUGIIWI.js +0 -0
  106. package/dist/chunk-YUPMXTCJ.js +0 -622
  107. package/dist/chunk-Z5HIAYFT.js +0 -84
  108. package/dist/index-B2AwKW5J.d.cts +0 -214
  109. package/dist/index-CJDi1HWc.d.ts +0 -214
  110. package/dist/network-BTJl-Sul.d.ts +0 -46
  111. package/dist/network-CqgsdUF2.d.cts +0 -46
  112. package/dist/services/config.cjs +0 -2354
  113. package/dist/services/config.d.cts +0 -42
  114. package/dist/services/config.d.ts +0 -42
  115. package/dist/services/config.js +0 -17
  116. package/dist/services/connection.cjs +0 -17691
  117. package/dist/services/connection.d.cts +0 -95
  118. package/dist/services/connection.d.ts +0 -95
  119. package/dist/services/connection.js +0 -11
  120. package/dist/services/index.d.cts +0 -21
  121. package/dist/services/index.d.ts +0 -21
  122. package/dist/services/index.js +0 -58
  123. package/dist/services/lrc-connection.cjs +0 -4713
  124. package/dist/services/lrc-connection.d.cts +0 -34
  125. package/dist/services/lrc-connection.d.ts +0 -34
  126. package/dist/services/lrc-connection.js +0 -11
  127. package/dist/services/token-transactions.cjs +0 -2877
  128. package/dist/services/token-transactions.d.cts +0 -75
  129. package/dist/services/token-transactions.d.ts +0 -75
  130. package/dist/services/token-transactions.js +0 -15
  131. package/dist/services/wallet-config.cjs +0 -340
  132. package/dist/services/wallet-config.d.cts +0 -56
  133. package/dist/services/wallet-config.d.ts +0 -56
  134. package/dist/services/wallet-config.js +0 -33
  135. package/dist/signer/signer.cjs +0 -2004
  136. package/dist/signer/signer.d.cts +0 -10
  137. package/dist/signer/signer.d.ts +0 -10
  138. package/dist/signer/signer.js +0 -24
  139. package/dist/signer-BocS_J6B.d.ts +0 -187
  140. package/dist/signer-DKS0AJkw.d.cts +0 -187
  141. package/dist/utils/index.cjs +0 -2947
  142. package/dist/utils/index.d.cts +0 -18
  143. package/dist/utils/index.d.ts +0 -18
  144. package/dist/utils/index.js +0 -157
  145. package/src/address/index.ts +0 -1
  146. package/src/services/lrc-connection.ts +0 -215
@@ -1,75 +0,0 @@
1
- import { WalletConfigService } from './config.cjs';
2
- import { j as OutputWithPreviousTransactionData, T as TokenTransaction, k as TokenTransactionWithStatus } from '../spark-dM7EYXYQ.cjs';
3
- import { ConnectionManager } from './connection.cjs';
4
- import { TokenTransaction as TokenTransaction$1, TokenTransactionWithStatus as TokenTransactionWithStatus$1 } from '../proto/spark_token.cjs';
5
- import './wallet-config.cjs';
6
- import '@buildonspark/lrc20-sdk';
7
- import '../RequestLightningSendInput-Du0z7Om7.cjs';
8
- import '@lightsparkdev/core';
9
- import '../BitcoinNetwork-TnABML0T.cjs';
10
- import '../signer-DKS0AJkw.cjs';
11
- import '@scure/bip32';
12
- import '../types-C-Rp0Oo7.cjs';
13
- import '@scure/btc-signer';
14
- import 'bitcoinjs-lib';
15
- import '@buildonspark/lrc20-sdk/lrc/types';
16
- import '../network-CqgsdUF2.cjs';
17
- import '@bufbuild/protobuf/wire';
18
- import 'nice-grpc-common';
19
- import 'nice-grpc';
20
- import 'nice-grpc-web';
21
-
22
- interface FetchOwnedTokenOutputsParams {
23
- ownerPublicKeys: Uint8Array[];
24
- issuerPublicKeys?: Uint8Array[];
25
- tokenIdentifiers?: Uint8Array[];
26
- }
27
- interface QueryTokenTransactionsParams {
28
- ownerPublicKeys?: string[];
29
- issuerPublicKeys?: string[];
30
- tokenTransactionHashes?: string[];
31
- tokenIdentifiers?: string[];
32
- outputIds?: string[];
33
- }
34
- declare class TokenTransactionService {
35
- protected readonly config: WalletConfigService;
36
- protected readonly connectionManager: ConnectionManager;
37
- constructor(config: WalletConfigService, connectionManager: ConnectionManager);
38
- tokenTransfer(tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>, receiverOutputs: {
39
- tokenPublicKey: string;
40
- tokenAmount: bigint;
41
- receiverSparkAddress: string;
42
- }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
43
- constructTransferTokenTransactionV0(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
44
- receiverSparkAddress: Uint8Array;
45
- tokenPublicKey: Uint8Array;
46
- tokenAmount: bigint;
47
- }>): Promise<TokenTransaction>;
48
- constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
49
- receiverSparkAddress: Uint8Array;
50
- tokenPublicKey: Uint8Array;
51
- tokenAmount: bigint;
52
- }>): Promise<TokenTransaction$1>;
53
- collectOperatorIdentityPublicKeys(): Uint8Array[];
54
- broadcastTokenTransaction(tokenTransaction: TokenTransaction | TokenTransaction$1, outputsToSpendSigningPublicKeys?: Uint8Array[], outputsToSpendCommitments?: Uint8Array[]): Promise<string>;
55
- private broadcastTokenTransactionV0;
56
- private broadcastTokenTransactionV1;
57
- private startTokenTransactionV0;
58
- private startTokenTransaction;
59
- private signTokenTransactionV0;
60
- private signTokenTransaction;
61
- fetchOwnedTokenOutputs(params: FetchOwnedTokenOutputsParams): Promise<OutputWithPreviousTransactionData[]>;
62
- queryTokenTransactions(params: QueryTokenTransactionsParams): Promise<TokenTransactionWithStatus[] | TokenTransactionWithStatus$1[]>;
63
- private fetchOwnedTokenOutputsV0;
64
- private fetchOwnedTokenOutputsV1;
65
- private queryTokenTransactionsV0;
66
- private queryTokenTransactionsV1;
67
- syncTokenOutputs(tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>): Promise<void>;
68
- selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData[];
69
- private sortTokenOutputsByStrategy;
70
- private signMessageWithKey;
71
- private finalizeTokenTransaction;
72
- private createSignaturesForOperators;
73
- }
74
-
75
- export { type FetchOwnedTokenOutputsParams, type QueryTokenTransactionsParams, TokenTransactionService };
@@ -1,75 +0,0 @@
1
- import { WalletConfigService } from './config.js';
2
- import { j as OutputWithPreviousTransactionData, T as TokenTransaction, k as TokenTransactionWithStatus } from '../spark-dM7EYXYQ.js';
3
- import { ConnectionManager } from './connection.js';
4
- import { TokenTransaction as TokenTransaction$1, TokenTransactionWithStatus as TokenTransactionWithStatus$1 } from '../proto/spark_token.js';
5
- import './wallet-config.js';
6
- import '@buildonspark/lrc20-sdk';
7
- import '../RequestLightningSendInput-DEPd_fPO.js';
8
- import '@lightsparkdev/core';
9
- import '../BitcoinNetwork-TnABML0T.js';
10
- import '../signer-BocS_J6B.js';
11
- import '@scure/bip32';
12
- import '../types-C-Rp0Oo7.js';
13
- import '@scure/btc-signer';
14
- import 'bitcoinjs-lib';
15
- import '@buildonspark/lrc20-sdk/lrc/types';
16
- import '../network-BTJl-Sul.js';
17
- import '@bufbuild/protobuf/wire';
18
- import 'nice-grpc-common';
19
- import 'nice-grpc';
20
- import 'nice-grpc-web';
21
-
22
- interface FetchOwnedTokenOutputsParams {
23
- ownerPublicKeys: Uint8Array[];
24
- issuerPublicKeys?: Uint8Array[];
25
- tokenIdentifiers?: Uint8Array[];
26
- }
27
- interface QueryTokenTransactionsParams {
28
- ownerPublicKeys?: string[];
29
- issuerPublicKeys?: string[];
30
- tokenTransactionHashes?: string[];
31
- tokenIdentifiers?: string[];
32
- outputIds?: string[];
33
- }
34
- declare class TokenTransactionService {
35
- protected readonly config: WalletConfigService;
36
- protected readonly connectionManager: ConnectionManager;
37
- constructor(config: WalletConfigService, connectionManager: ConnectionManager);
38
- tokenTransfer(tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>, receiverOutputs: {
39
- tokenPublicKey: string;
40
- tokenAmount: bigint;
41
- receiverSparkAddress: string;
42
- }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
43
- constructTransferTokenTransactionV0(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
44
- receiverSparkAddress: Uint8Array;
45
- tokenPublicKey: Uint8Array;
46
- tokenAmount: bigint;
47
- }>): Promise<TokenTransaction>;
48
- constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData[], tokenOutputData: Array<{
49
- receiverSparkAddress: Uint8Array;
50
- tokenPublicKey: Uint8Array;
51
- tokenAmount: bigint;
52
- }>): Promise<TokenTransaction$1>;
53
- collectOperatorIdentityPublicKeys(): Uint8Array[];
54
- broadcastTokenTransaction(tokenTransaction: TokenTransaction | TokenTransaction$1, outputsToSpendSigningPublicKeys?: Uint8Array[], outputsToSpendCommitments?: Uint8Array[]): Promise<string>;
55
- private broadcastTokenTransactionV0;
56
- private broadcastTokenTransactionV1;
57
- private startTokenTransactionV0;
58
- private startTokenTransaction;
59
- private signTokenTransactionV0;
60
- private signTokenTransaction;
61
- fetchOwnedTokenOutputs(params: FetchOwnedTokenOutputsParams): Promise<OutputWithPreviousTransactionData[]>;
62
- queryTokenTransactions(params: QueryTokenTransactionsParams): Promise<TokenTransactionWithStatus[] | TokenTransactionWithStatus$1[]>;
63
- private fetchOwnedTokenOutputsV0;
64
- private fetchOwnedTokenOutputsV1;
65
- private queryTokenTransactionsV0;
66
- private queryTokenTransactionsV1;
67
- syncTokenOutputs(tokenOutputs: Map<string, OutputWithPreviousTransactionData[]>): Promise<void>;
68
- selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData[];
69
- private sortTokenOutputsByStrategy;
70
- private signMessageWithKey;
71
- private finalizeTokenTransaction;
72
- private createSignaturesForOperators;
73
- }
74
-
75
- export { type FetchOwnedTokenOutputsParams, type QueryTokenTransactionsParams, TokenTransactionService };
@@ -1,15 +0,0 @@
1
- import {
2
- TokenTransactionService
3
- } from "../chunk-C2S227QR.js";
4
- import "../chunk-HWJWKEIU.js";
5
- import "../chunk-L3EHBOUX.js";
6
- import "../chunk-KMUMFYFX.js";
7
- import "../chunk-QNNSEJ4P.js";
8
- import "../chunk-VTUGIIWI.js";
9
- import "../chunk-LHRD2WT6.js";
10
- import "../chunk-GSI4OLXZ.js";
11
- import "../chunk-BGGEVUJK.js";
12
- import "../chunk-MVRQ5US7.js";
13
- export {
14
- TokenTransactionService
15
- };
@@ -1,340 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/services/wallet-config.ts
31
- var wallet_config_exports = {};
32
- __export(wallet_config_exports, {
33
- BASE_CONFIG: () => BASE_CONFIG,
34
- ELECTRS_CREDENTIALS: () => ELECTRS_CREDENTIALS,
35
- LOCAL_WALLET_CONFIG: () => LOCAL_WALLET_CONFIG,
36
- LOCAL_WALLET_CONFIG_ECDSA: () => LOCAL_WALLET_CONFIG_ECDSA,
37
- LOCAL_WALLET_CONFIG_SCHNORR: () => LOCAL_WALLET_CONFIG_SCHNORR,
38
- MAINNET_WALLET_CONFIG: () => MAINNET_WALLET_CONFIG,
39
- REGTEST_WALLET_CONFIG: () => REGTEST_WALLET_CONFIG,
40
- getElectrsUrl: () => getElectrsUrl,
41
- getLocalSigningOperators: () => getLocalSigningOperators,
42
- getLrc20NodeUrl: () => getLrc20NodeUrl,
43
- getLrc20Url: () => getLrc20Url,
44
- getSspIdentityPublicKey: () => getSspIdentityPublicKey,
45
- getSspSchemaEndpoint: () => getSspSchemaEndpoint,
46
- getSspUrl: () => getSspUrl
47
- });
48
- module.exports = __toCommonJS(wallet_config_exports);
49
-
50
- // buffer.js
51
- var import_buffer = require("buffer");
52
- if (typeof globalThis.Buffer === "undefined") {
53
- globalThis.Buffer = import_buffer.Buffer;
54
- }
55
- if (typeof window !== "undefined") {
56
- if (typeof window.global === "undefined") {
57
- window.global = window;
58
- }
59
- if (typeof window.globalThis === "undefined") {
60
- window.globalThis = window;
61
- }
62
- }
63
-
64
- // src/tests/isHermeticTest.ts
65
- var import_core = require("@lightsparkdev/core");
66
- var import_fs = __toESM(require("fs"), 1);
67
- function isHermeticTest() {
68
- if (import_core.isNode) {
69
- return (import_fs.default?.existsSync?.("/tmp/spark_hermetic") ?? false) || process.env.HERMETIC_TEST === "true";
70
- }
71
- return typeof process !== "undefined" && process.env?.HERMETIC_TEST === "true" || false;
72
- }
73
-
74
- // src/services/wallet-config.ts
75
- var SSP_IDENTITY_PUBLIC_KEYS = {
76
- LOCAL: "028c094a432d46a0ac95349d792c2e3730bd60c29188db716f56a99e39b95338b4",
77
- REGTEST: {
78
- PROD: "022bf283544b16c0622daecb79422007d167eca6ce9f0c98c0c49833b1f7170bfe"
79
- },
80
- MAINNET: {
81
- PROD: "023e33e2920326f64ea31058d44777442d97d7d5cbfcf54e3060bc1695e5261c93"
82
- }
83
- };
84
- var URL_CONFIG = {
85
- LOCAL: {
86
- SSP: "http://127.0.0.1:5000",
87
- ELECTRS: "http://127.0.0.1:30000",
88
- LRC20: "http://127.0.0.1:18530",
89
- LRC20_NODE: "http://127.0.0.1:18332"
90
- },
91
- REGTEST: {
92
- PROD: {
93
- SSP: "https://api.lightspark.com",
94
- ELECTRS: "https://regtest-mempool.us-west-2.sparkinfra.net/api",
95
- LRC20: "https://regtest.lrc20.lightspark.com:443",
96
- LRC20_NODE: "https://regtest.lrc20.lightspark.com"
97
- }
98
- },
99
- MAINNET: {
100
- PROD: {
101
- SSP: "https://api.lightspark.com",
102
- ELECTRS: "https://mempool.space/api",
103
- LRC20: "https://mainnet.lrc20.lightspark.com:443",
104
- LRC20_NODE: "https://mainnet.lrc20.lightspark.com"
105
- }
106
- }
107
- };
108
- var ELECTRS_CREDENTIALS = {
109
- username: "spark-sdk",
110
- password: "mCMk1JqlBNtetUNy"
111
- };
112
- function getElectrsUrl(network) {
113
- switch (network) {
114
- case "LOCAL":
115
- return isHermeticTest() ? "http://mempool.minikube.local/api" : URL_CONFIG.LOCAL.ELECTRS;
116
- case "REGTEST":
117
- return URL_CONFIG.REGTEST.PROD.ELECTRS;
118
- case "MAINNET":
119
- return URL_CONFIG.MAINNET.PROD.ELECTRS;
120
- default:
121
- return URL_CONFIG.LOCAL.ELECTRS;
122
- }
123
- }
124
- function getLrc20Url(network) {
125
- switch (network) {
126
- case "LOCAL":
127
- return URL_CONFIG.LOCAL.LRC20;
128
- case "REGTEST":
129
- return URL_CONFIG.REGTEST.PROD.LRC20;
130
- case "MAINNET":
131
- return URL_CONFIG.MAINNET.PROD.LRC20;
132
- default:
133
- return URL_CONFIG.LOCAL.LRC20;
134
- }
135
- }
136
- function getLrc20NodeUrl(network) {
137
- switch (network) {
138
- case "LOCAL":
139
- return URL_CONFIG.LOCAL.LRC20_NODE;
140
- case "REGTEST":
141
- return URL_CONFIG.REGTEST.PROD.LRC20_NODE;
142
- case "MAINNET":
143
- return URL_CONFIG.MAINNET.PROD.LRC20_NODE;
144
- default:
145
- return URL_CONFIG.LOCAL.LRC20_NODE;
146
- }
147
- }
148
- function getSspIdentityPublicKey(network) {
149
- switch (network) {
150
- case "LOCAL":
151
- return SSP_IDENTITY_PUBLIC_KEYS.LOCAL;
152
- case "REGTEST":
153
- return SSP_IDENTITY_PUBLIC_KEYS.REGTEST.PROD;
154
- case "MAINNET":
155
- return SSP_IDENTITY_PUBLIC_KEYS.MAINNET.PROD;
156
- default:
157
- return SSP_IDENTITY_PUBLIC_KEYS.LOCAL;
158
- }
159
- }
160
- function getSspUrl(network) {
161
- switch (network) {
162
- case "LOCAL":
163
- return isHermeticTest() ? "http://app.minikube.local" : URL_CONFIG.LOCAL.SSP;
164
- case "REGTEST":
165
- return URL_CONFIG.REGTEST.PROD.SSP;
166
- case "MAINNET":
167
- return URL_CONFIG.MAINNET.PROD.SSP;
168
- default:
169
- return URL_CONFIG.LOCAL.SSP;
170
- }
171
- }
172
- function getSspSchemaEndpoint(network) {
173
- switch (network) {
174
- case "LOCAL":
175
- return "graphql/spark/rc";
176
- }
177
- return;
178
- }
179
- var PROD_PUBKEYS = [
180
- "03dfbdff4b6332c220f8fa2ba8ed496c698ceada563fa01b67d9983bfc5c95e763",
181
- "03e625e9768651c9be268e287245cc33f96a68ce9141b0b4769205db027ee8ed77",
182
- "022eda13465a59205413086130a65dc0ed1b8f8e51937043161f8be0c369b1a410"
183
- ];
184
- function getLocalFrostSignerAddress() {
185
- return isHermeticTest() ? "localhost:9999" : "unix:///tmp/frost_0.sock";
186
- }
187
- var BASE_CONFIG = {
188
- network: "LOCAL",
189
- lrc20Address: getLrc20Url("LOCAL"),
190
- coodinatorIdentifier: "0000000000000000000000000000000000000000000000000000000000000001",
191
- frostSignerAddress: getLocalFrostSignerAddress(),
192
- threshold: 2,
193
- signingOperators: getLocalSigningOperators(),
194
- tokenSignatures: "SCHNORR",
195
- tokenTransactionVersion: "V0",
196
- tokenValidityDurationSeconds: 180,
197
- electrsUrl: getElectrsUrl("LOCAL"),
198
- expectedWithdrawBondSats: 1e4,
199
- expectedWithdrawRelativeBlockLocktime: 1e3,
200
- lrc20ApiConfig: {
201
- electrsUrl: getElectrsUrl("LOCAL"),
202
- lrc20NodeUrl: getLrc20NodeUrl("LOCAL"),
203
- electrsCredentials: ELECTRS_CREDENTIALS
204
- },
205
- sspClientOptions: {
206
- baseUrl: getSspUrl("LOCAL"),
207
- identityPublicKey: getSspIdentityPublicKey("LOCAL"),
208
- schemaEndpoint: getSspSchemaEndpoint("LOCAL")
209
- }
210
- };
211
- var LOCAL_WALLET_CONFIG = {
212
- ...BASE_CONFIG,
213
- threshold: 3
214
- };
215
- var LOCAL_WALLET_CONFIG_SCHNORR = {
216
- ...LOCAL_WALLET_CONFIG,
217
- threshold: 3
218
- // 3 for issuance tests.
219
- };
220
- var LOCAL_WALLET_CONFIG_ECDSA = {
221
- ...LOCAL_WALLET_CONFIG,
222
- tokenSignatures: "ECDSA",
223
- threshold: 3
224
- // 3 for issuance tests.
225
- };
226
- var REGTEST_WALLET_CONFIG = {
227
- ...BASE_CONFIG,
228
- network: "REGTEST",
229
- lrc20Address: getLrc20Url("REGTEST"),
230
- signingOperators: getSigningOperators(),
231
- electrsUrl: getElectrsUrl("REGTEST"),
232
- lrc20ApiConfig: {
233
- electrsUrl: getElectrsUrl("REGTEST"),
234
- lrc20NodeUrl: getLrc20NodeUrl("REGTEST"),
235
- electrsCredentials: ELECTRS_CREDENTIALS
236
- },
237
- expectedWithdrawBondSats: 1e4,
238
- expectedWithdrawRelativeBlockLocktime: 1e3,
239
- sspClientOptions: {
240
- baseUrl: getSspUrl("REGTEST"),
241
- identityPublicKey: getSspIdentityPublicKey("REGTEST")
242
- }
243
- };
244
- var MAINNET_WALLET_CONFIG = {
245
- ...BASE_CONFIG,
246
- network: "MAINNET",
247
- lrc20Address: getLrc20Url("MAINNET"),
248
- signingOperators: getSigningOperators(),
249
- electrsUrl: getElectrsUrl("MAINNET"),
250
- lrc20ApiConfig: {
251
- electrsUrl: getElectrsUrl("MAINNET"),
252
- lrc20NodeUrl: getLrc20NodeUrl("MAINNET")
253
- },
254
- expectedWithdrawBondSats: 1e4,
255
- expectedWithdrawRelativeBlockLocktime: 1e3,
256
- sspClientOptions: {
257
- baseUrl: getSspUrl("MAINNET"),
258
- identityPublicKey: getSspIdentityPublicKey("MAINNET")
259
- }
260
- };
261
- function getSigningOperators() {
262
- return {
263
- "0000000000000000000000000000000000000000000000000000000000000001": {
264
- id: 0,
265
- identifier: "0000000000000000000000000000000000000000000000000000000000000001",
266
- address: "https://0.spark.lightspark.com",
267
- identityPublicKey: PROD_PUBKEYS[0]
268
- },
269
- "0000000000000000000000000000000000000000000000000000000000000002": {
270
- id: 1,
271
- identifier: "0000000000000000000000000000000000000000000000000000000000000002",
272
- address: "https://1.spark.lightspark.com",
273
- identityPublicKey: PROD_PUBKEYS[1]
274
- },
275
- "0000000000000000000000000000000000000000000000000000000000000003": {
276
- id: 2,
277
- identifier: "0000000000000000000000000000000000000000000000000000000000000003",
278
- address: "https://2.spark.flashnet.xyz",
279
- identityPublicKey: PROD_PUBKEYS[2]
280
- }
281
- };
282
- }
283
- function getLocalSigningOperators() {
284
- const pubkeys = [
285
- "0322ca18fc489ae25418a0e768273c2c61cabb823edfb14feb891e9bec62016510",
286
- "0341727a6c41b168f07eb50865ab8c397a53c7eef628ac1020956b705e43b6cb27",
287
- "0305ab8d485cc752394de4981f8a5ae004f2becfea6f432c9a59d5022d8764f0a6",
288
- "0352aef4d49439dedd798ac4aef1e7ebef95f569545b647a25338398c1247ffdea",
289
- "02c05c88cc8fc181b1ba30006df6a4b0597de6490e24514fbdd0266d2b9cd3d0ba"
290
- ];
291
- return {
292
- "0000000000000000000000000000000000000000000000000000000000000001": {
293
- id: 0,
294
- identifier: "0000000000000000000000000000000000000000000000000000000000000001",
295
- address: "https://localhost:8535",
296
- identityPublicKey: pubkeys[0]
297
- },
298
- "0000000000000000000000000000000000000000000000000000000000000002": {
299
- id: 1,
300
- identifier: "0000000000000000000000000000000000000000000000000000000000000002",
301
- address: "https://localhost:8536",
302
- identityPublicKey: pubkeys[1]
303
- },
304
- "0000000000000000000000000000000000000000000000000000000000000003": {
305
- id: 2,
306
- identifier: "0000000000000000000000000000000000000000000000000000000000000003",
307
- address: "https://localhost:8537",
308
- identityPublicKey: pubkeys[2]
309
- },
310
- "0000000000000000000000000000000000000000000000000000000000000004": {
311
- id: 3,
312
- identifier: "0000000000000000000000000000000000000000000000000000000000000004",
313
- address: "https://localhost:8538",
314
- identityPublicKey: pubkeys[3]
315
- },
316
- "0000000000000000000000000000000000000000000000000000000000000005": {
317
- id: 4,
318
- identifier: "0000000000000000000000000000000000000000000000000000000000000005",
319
- address: "https://localhost:8539",
320
- identityPublicKey: pubkeys[4]
321
- }
322
- };
323
- }
324
- // Annotate the CommonJS export names for ESM import in node:
325
- 0 && (module.exports = {
326
- BASE_CONFIG,
327
- ELECTRS_CREDENTIALS,
328
- LOCAL_WALLET_CONFIG,
329
- LOCAL_WALLET_CONFIG_ECDSA,
330
- LOCAL_WALLET_CONFIG_SCHNORR,
331
- MAINNET_WALLET_CONFIG,
332
- REGTEST_WALLET_CONFIG,
333
- getElectrsUrl,
334
- getLocalSigningOperators,
335
- getLrc20NodeUrl,
336
- getLrc20Url,
337
- getSspIdentityPublicKey,
338
- getSspSchemaEndpoint,
339
- getSspUrl
340
- });
@@ -1,56 +0,0 @@
1
- import { MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
2
- import { M as MayHaveSspClientOptions, J as SspClientOptions } from '../RequestLightningSendInput-Du0z7Om7.cjs';
3
- import { a as NetworkType } from '../network-CqgsdUF2.cjs';
4
- import '@lightsparkdev/core';
5
- import '../BitcoinNetwork-TnABML0T.cjs';
6
- import '../signer-DKS0AJkw.cjs';
7
- import '@scure/bip32';
8
- import '../spark-dM7EYXYQ.cjs';
9
- import '@bufbuild/protobuf/wire';
10
- import 'nice-grpc-common';
11
- import '../types-C-Rp0Oo7.cjs';
12
- import '@scure/btc-signer';
13
- import 'bitcoinjs-lib';
14
- import '@buildonspark/lrc20-sdk/lrc/types';
15
-
16
- declare const ELECTRS_CREDENTIALS: {
17
- username: string;
18
- password: string;
19
- };
20
- declare function getElectrsUrl(network: NetworkType): string;
21
- declare function getLrc20Url(network: NetworkType): string;
22
- declare function getLrc20NodeUrl(network: NetworkType): string;
23
- declare function getSspIdentityPublicKey(network: NetworkType): string;
24
- declare function getSspUrl(network: NetworkType): string;
25
- declare function getSspSchemaEndpoint(network: NetworkType): string | undefined;
26
- type SigningOperator = {
27
- readonly id: number;
28
- readonly identifier: string;
29
- readonly address: string;
30
- readonly identityPublicKey: string;
31
- };
32
- type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
33
- readonly network?: NetworkType;
34
- readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
35
- readonly coodinatorIdentifier?: string;
36
- readonly frostSignerAddress?: string;
37
- readonly lrc20Address?: string;
38
- readonly threshold?: number;
39
- readonly tokenSignatures?: "ECDSA" | "SCHNORR";
40
- readonly tokenValidityDurationSeconds?: number;
41
- readonly tokenTransactionVersion?: "V0" | "V1";
42
- readonly electrsUrl?: string;
43
- readonly lrc20ApiConfig?: LRC20WalletApiConfig;
44
- readonly sspClientOptions?: SspClientOptions;
45
- readonly expectedWithdrawBondSats?: number;
46
- readonly expectedWithdrawRelativeBlockLocktime?: number;
47
- };
48
- declare const BASE_CONFIG: Required<ConfigOptions>;
49
- declare const LOCAL_WALLET_CONFIG: Required<ConfigOptions>;
50
- declare const LOCAL_WALLET_CONFIG_SCHNORR: Required<ConfigOptions>;
51
- declare const LOCAL_WALLET_CONFIG_ECDSA: Required<ConfigOptions>;
52
- declare const REGTEST_WALLET_CONFIG: Required<ConfigOptions>;
53
- declare const MAINNET_WALLET_CONFIG: Required<ConfigOptions>;
54
- declare function getLocalSigningOperators(): Record<string, SigningOperator>;
55
-
56
- export { BASE_CONFIG, type ConfigOptions, ELECTRS_CREDENTIALS, LOCAL_WALLET_CONFIG, LOCAL_WALLET_CONFIG_ECDSA, LOCAL_WALLET_CONFIG_SCHNORR, MAINNET_WALLET_CONFIG, REGTEST_WALLET_CONFIG, type SigningOperator, getElectrsUrl, getLocalSigningOperators, getLrc20NodeUrl, getLrc20Url, getSspIdentityPublicKey, getSspSchemaEndpoint, getSspUrl };
@@ -1,56 +0,0 @@
1
- import { MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig } from '@buildonspark/lrc20-sdk';
2
- import { M as MayHaveSspClientOptions, J as SspClientOptions } from '../RequestLightningSendInput-DEPd_fPO.js';
3
- import { a as NetworkType } from '../network-BTJl-Sul.js';
4
- import '@lightsparkdev/core';
5
- import '../BitcoinNetwork-TnABML0T.js';
6
- import '../signer-BocS_J6B.js';
7
- import '@scure/bip32';
8
- import '../spark-dM7EYXYQ.js';
9
- import '@bufbuild/protobuf/wire';
10
- import 'nice-grpc-common';
11
- import '../types-C-Rp0Oo7.js';
12
- import '@scure/btc-signer';
13
- import 'bitcoinjs-lib';
14
- import '@buildonspark/lrc20-sdk/lrc/types';
15
-
16
- declare const ELECTRS_CREDENTIALS: {
17
- username: string;
18
- password: string;
19
- };
20
- declare function getElectrsUrl(network: NetworkType): string;
21
- declare function getLrc20Url(network: NetworkType): string;
22
- declare function getLrc20NodeUrl(network: NetworkType): string;
23
- declare function getSspIdentityPublicKey(network: NetworkType): string;
24
- declare function getSspUrl(network: NetworkType): string;
25
- declare function getSspSchemaEndpoint(network: NetworkType): string | undefined;
26
- type SigningOperator = {
27
- readonly id: number;
28
- readonly identifier: string;
29
- readonly address: string;
30
- readonly identityPublicKey: string;
31
- };
32
- type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
33
- readonly network?: NetworkType;
34
- readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
35
- readonly coodinatorIdentifier?: string;
36
- readonly frostSignerAddress?: string;
37
- readonly lrc20Address?: string;
38
- readonly threshold?: number;
39
- readonly tokenSignatures?: "ECDSA" | "SCHNORR";
40
- readonly tokenValidityDurationSeconds?: number;
41
- readonly tokenTransactionVersion?: "V0" | "V1";
42
- readonly electrsUrl?: string;
43
- readonly lrc20ApiConfig?: LRC20WalletApiConfig;
44
- readonly sspClientOptions?: SspClientOptions;
45
- readonly expectedWithdrawBondSats?: number;
46
- readonly expectedWithdrawRelativeBlockLocktime?: number;
47
- };
48
- declare const BASE_CONFIG: Required<ConfigOptions>;
49
- declare const LOCAL_WALLET_CONFIG: Required<ConfigOptions>;
50
- declare const LOCAL_WALLET_CONFIG_SCHNORR: Required<ConfigOptions>;
51
- declare const LOCAL_WALLET_CONFIG_ECDSA: Required<ConfigOptions>;
52
- declare const REGTEST_WALLET_CONFIG: Required<ConfigOptions>;
53
- declare const MAINNET_WALLET_CONFIG: Required<ConfigOptions>;
54
- declare function getLocalSigningOperators(): Record<string, SigningOperator>;
55
-
56
- export { BASE_CONFIG, type ConfigOptions, ELECTRS_CREDENTIALS, LOCAL_WALLET_CONFIG, LOCAL_WALLET_CONFIG_ECDSA, LOCAL_WALLET_CONFIG_SCHNORR, MAINNET_WALLET_CONFIG, REGTEST_WALLET_CONFIG, type SigningOperator, getElectrsUrl, getLocalSigningOperators, getLrc20NodeUrl, getLrc20Url, getSspIdentityPublicKey, getSspSchemaEndpoint, getSspUrl };
@@ -1,33 +0,0 @@
1
- import {
2
- BASE_CONFIG,
3
- ELECTRS_CREDENTIALS,
4
- LOCAL_WALLET_CONFIG,
5
- LOCAL_WALLET_CONFIG_ECDSA,
6
- LOCAL_WALLET_CONFIG_SCHNORR,
7
- MAINNET_WALLET_CONFIG,
8
- REGTEST_WALLET_CONFIG,
9
- getElectrsUrl,
10
- getLocalSigningOperators,
11
- getLrc20NodeUrl,
12
- getLrc20Url,
13
- getSspIdentityPublicKey,
14
- getSspSchemaEndpoint,
15
- getSspUrl
16
- } from "../chunk-R5PXJZQS.js";
17
- import "../chunk-MVRQ5US7.js";
18
- export {
19
- BASE_CONFIG,
20
- ELECTRS_CREDENTIALS,
21
- LOCAL_WALLET_CONFIG,
22
- LOCAL_WALLET_CONFIG_ECDSA,
23
- LOCAL_WALLET_CONFIG_SCHNORR,
24
- MAINNET_WALLET_CONFIG,
25
- REGTEST_WALLET_CONFIG,
26
- getElectrsUrl,
27
- getLocalSigningOperators,
28
- getLrc20NodeUrl,
29
- getLrc20Url,
30
- getSspIdentityPublicKey,
31
- getSspSchemaEndpoint,
32
- getSspUrl
33
- };