@buildonspark/spark-sdk 0.1.43 → 0.1.45

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 (153) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-DEPd_fPO.d.ts} +43 -4
  3. package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-Du0z7Om7.d.cts} +43 -4
  4. package/dist/address/index.cjs +2 -2
  5. package/dist/address/index.d.cts +2 -2
  6. package/dist/address/index.d.ts +2 -2
  7. package/dist/address/index.js +2 -2
  8. package/dist/{chunk-IRW5TWMH.js → chunk-5FUB65LX.js} +7 -9
  9. package/dist/{chunk-BUTZWYBW.js → chunk-6264CGDM.js} +4 -4
  10. package/dist/{chunk-VFJQNBFX.js → chunk-7V6N75CC.js} +5 -2
  11. package/dist/{chunk-M6A4KFIG.js → chunk-BGGEVUJK.js} +1505 -445
  12. package/dist/{chunk-DQYKQJRZ.js → chunk-C2S227QR.js} +675 -52
  13. package/dist/{chunk-GYQR4B4P.js → chunk-GZ5IPPJ2.js} +2 -2
  14. package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
  15. package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
  16. package/dist/{chunk-WWOTVNPP.js → chunk-J2IE4Z7Y.js} +544 -431
  17. package/dist/{chunk-O4RYNJNB.js → chunk-KMUMFYFX.js} +3 -3
  18. package/dist/chunk-LHRD2WT6.js +2374 -0
  19. package/dist/{chunk-ABZA6R5S.js → chunk-NTFKFRQ2.js} +1 -1
  20. package/dist/{chunk-MIVX3GHD.js → chunk-OBFKIEMP.js} +1 -1
  21. package/dist/{chunk-HRQRRDSS.js → chunk-PQN3C2MF.js} +15 -15
  22. package/dist/{chunk-DOA6QXYQ.js → chunk-R5PXJZQS.js} +3 -1
  23. package/dist/{chunk-TIUBYNN5.js → chunk-YUPMXTCJ.js} +4 -4
  24. package/dist/graphql/objects/index.d.cts +6 -43
  25. package/dist/graphql/objects/index.d.ts +6 -43
  26. package/dist/graphql/objects/index.js +1 -1
  27. package/dist/index-B2AwKW5J.d.cts +214 -0
  28. package/dist/index-CJDi1HWc.d.ts +214 -0
  29. package/dist/index.cjs +4150 -1026
  30. package/dist/index.d.cts +764 -19
  31. package/dist/index.d.ts +764 -19
  32. package/dist/index.js +17 -21
  33. package/dist/index.node.cjs +4153 -1033
  34. package/dist/index.node.d.cts +10 -8
  35. package/dist/index.node.d.ts +10 -8
  36. package/dist/index.node.js +20 -28
  37. package/dist/native/index.cjs +4166 -1042
  38. package/dist/native/index.d.cts +369 -108
  39. package/dist/native/index.d.ts +369 -108
  40. package/dist/native/index.js +4138 -1015
  41. package/dist/{network-xkBSpaTn.d.ts → network-BTJl-Sul.d.ts} +1 -1
  42. package/dist/{network-D5lKssVl.d.cts → network-CqgsdUF2.d.cts} +1 -1
  43. package/dist/proto/lrc20.cjs +222 -19
  44. package/dist/proto/lrc20.d.cts +1 -1
  45. package/dist/proto/lrc20.d.ts +1 -1
  46. package/dist/proto/lrc20.js +2 -2
  47. package/dist/proto/spark.cjs +1502 -442
  48. package/dist/proto/spark.d.cts +1 -1
  49. package/dist/proto/spark.d.ts +1 -1
  50. package/dist/proto/spark.js +5 -5
  51. package/dist/proto/spark_token.cjs +1515 -56
  52. package/dist/proto/spark_token.d.cts +153 -15
  53. package/dist/proto/spark_token.d.ts +153 -15
  54. package/dist/proto/spark_token.js +40 -4
  55. package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-B0SwjolI.d.cts} +1 -1
  56. package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-Cc4l4kb1.d.ts} +1 -1
  57. package/dist/services/config.cjs +7 -3
  58. package/dist/services/config.d.cts +5 -4
  59. package/dist/services/config.d.ts +5 -4
  60. package/dist/services/config.js +6 -6
  61. package/dist/services/connection.cjs +2938 -646
  62. package/dist/services/connection.d.cts +5 -4
  63. package/dist/services/connection.d.ts +5 -4
  64. package/dist/services/connection.js +4 -4
  65. package/dist/services/index.cjs +6381 -3461
  66. package/dist/services/index.d.cts +7 -6
  67. package/dist/services/index.d.ts +7 -6
  68. package/dist/services/index.js +15 -13
  69. package/dist/services/lrc-connection.cjs +227 -21
  70. package/dist/services/lrc-connection.d.cts +5 -4
  71. package/dist/services/lrc-connection.d.ts +5 -4
  72. package/dist/services/lrc-connection.js +4 -4
  73. package/dist/services/token-transactions.cjs +868 -244
  74. package/dist/services/token-transactions.d.cts +25 -7
  75. package/dist/services/token-transactions.d.ts +25 -7
  76. package/dist/services/token-transactions.js +5 -4
  77. package/dist/services/wallet-config.cjs +4 -1
  78. package/dist/services/wallet-config.d.cts +7 -5
  79. package/dist/services/wallet-config.d.ts +7 -5
  80. package/dist/services/wallet-config.js +3 -1
  81. package/dist/signer/signer.cjs +5 -2
  82. package/dist/signer/signer.d.cts +3 -2
  83. package/dist/signer/signer.d.ts +3 -2
  84. package/dist/signer/signer.js +2 -2
  85. package/dist/{signer-wqesWifN.d.ts → signer-BocS_J6B.d.ts} +2 -6
  86. package/dist/{signer-IO3oMRNj.d.cts → signer-DKS0AJkw.d.cts} +2 -6
  87. package/dist/{spark-CDm4gqS6.d.cts → spark-dM7EYXYQ.d.cts} +138 -42
  88. package/dist/{spark-CDm4gqS6.d.ts → spark-dM7EYXYQ.d.ts} +138 -42
  89. package/dist/spark_bindings/native/index.cjs +183 -0
  90. package/dist/spark_bindings/native/index.d.cts +14 -0
  91. package/dist/spark_bindings/native/index.d.ts +14 -0
  92. package/dist/spark_bindings/native/index.js +141 -0
  93. package/dist/spark_bindings/wasm/index.cjs +1093 -0
  94. package/dist/spark_bindings/wasm/index.d.cts +47 -0
  95. package/dist/spark_bindings/wasm/index.d.ts +47 -0
  96. package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
  97. package/dist/types/index.cjs +1503 -443
  98. package/dist/types/index.d.cts +6 -5
  99. package/dist/types/index.d.ts +6 -5
  100. package/dist/types/index.js +3 -3
  101. package/dist/types-C-Rp0Oo7.d.cts +46 -0
  102. package/dist/types-C-Rp0Oo7.d.ts +46 -0
  103. package/dist/utils/index.cjs +358 -36
  104. package/dist/utils/index.d.cts +14 -134
  105. package/dist/utils/index.d.ts +14 -134
  106. package/dist/utils/index.js +8 -8
  107. package/package.json +21 -1
  108. package/src/constants.ts +5 -1
  109. package/src/graphql/client.ts +28 -0
  110. package/src/graphql/mutations/RequestCoopExit.ts +6 -0
  111. package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
  112. package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
  113. package/src/index.node.ts +0 -1
  114. package/src/index.ts +0 -1
  115. package/src/native/index.ts +1 -2
  116. package/src/proto/common.ts +5 -5
  117. package/src/proto/google/protobuf/descriptor.ts +34 -34
  118. package/src/proto/google/protobuf/duration.ts +2 -2
  119. package/src/proto/google/protobuf/empty.ts +2 -2
  120. package/src/proto/google/protobuf/timestamp.ts +2 -2
  121. package/src/proto/mock.ts +4 -4
  122. package/src/proto/spark.ts +1924 -525
  123. package/src/proto/spark_authn.ts +7 -7
  124. package/src/proto/spark_token.ts +1668 -105
  125. package/src/proto/validate/validate.ts +24 -24
  126. package/src/services/bolt11-spark.ts +62 -187
  127. package/src/services/coop-exit.ts +3 -0
  128. package/src/services/lrc20.ts +1 -1
  129. package/src/services/token-transactions.ts +209 -9
  130. package/src/services/transfer.ts +22 -3
  131. package/src/services/tree-creation.ts +13 -0
  132. package/src/services/wallet-config.ts +2 -1
  133. package/src/spark-wallet/spark-wallet.node.ts +3 -7
  134. package/src/spark-wallet/spark-wallet.ts +376 -232
  135. package/src/spark-wallet/types.ts +39 -3
  136. package/src/tests/bolt11-spark.test.ts +7 -15
  137. package/src/tests/integration/deposit.test.ts +16 -0
  138. package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
  139. package/src/tests/integration/ssp/swap.test.ts +47 -0
  140. package/src/tests/integration/swap.test.ts +453 -433
  141. package/src/tests/integration/transfer.test.ts +261 -248
  142. package/src/tests/token-identifier.test.ts +54 -0
  143. package/src/tests/tokens.test.ts +218 -22
  144. package/src/utils/token-hashing.ts +346 -52
  145. package/src/utils/token-identifier.ts +88 -0
  146. package/src/utils/token-transaction-validation.ts +350 -5
  147. package/src/utils/token-transactions.ts +12 -8
  148. package/src/utils/transaction.ts +2 -8
  149. package/dist/chunk-VA7MV4MZ.js +0 -1073
  150. package/dist/index-7RYRH5wc.d.ts +0 -815
  151. package/dist/index-BJOc8Ur-.d.cts +0 -815
  152. package/dist/wasm-7OWFHDMS.js +0 -21
  153. package/src/logger.ts +0 -3
@@ -1,20 +1,21 @@
1
1
  export { WalletConfigService } from './config.cjs';
2
- export { TokenTransactionService } from './token-transactions.cjs';
2
+ export { FetchOwnedTokenOutputsParams, QueryTokenTransactionsParams, TokenTransactionService } from './token-transactions.cjs';
3
3
  export { ConnectionManager } from './connection.cjs';
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';
4
+ export { BASE_CONFIG, 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-Na1mHdWg.cjs';
6
+ import '../RequestLightningSendInput-Du0z7Om7.cjs';
7
7
  import '@lightsparkdev/core';
8
8
  import '../BitcoinNetwork-TnABML0T.cjs';
9
- import '../signer-IO3oMRNj.cjs';
9
+ import '../signer-DKS0AJkw.cjs';
10
10
  import '@scure/bip32';
11
- import '../spark-CDm4gqS6.cjs';
11
+ import '../spark-dM7EYXYQ.cjs';
12
12
  import '@bufbuild/protobuf/wire';
13
13
  import 'nice-grpc-common';
14
+ import '../types-C-Rp0Oo7.cjs';
14
15
  import '@scure/btc-signer';
15
16
  import 'bitcoinjs-lib';
16
17
  import '@buildonspark/lrc20-sdk/lrc/types';
17
- import '../network-D5lKssVl.cjs';
18
+ import '../network-CqgsdUF2.cjs';
18
19
  import '../proto/spark_token.cjs';
19
20
  import 'nice-grpc';
20
21
  import 'nice-grpc-web';
@@ -1,20 +1,21 @@
1
1
  export { WalletConfigService } from './config.js';
2
- export { TokenTransactionService } from './token-transactions.js';
2
+ export { FetchOwnedTokenOutputsParams, QueryTokenTransactionsParams, TokenTransactionService } from './token-transactions.js';
3
3
  export { ConnectionManager } from './connection.js';
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';
4
+ export { BASE_CONFIG, 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-D7fZdT4A.js';
6
+ import '../RequestLightningSendInput-DEPd_fPO.js';
7
7
  import '@lightsparkdev/core';
8
8
  import '../BitcoinNetwork-TnABML0T.js';
9
- import '../signer-wqesWifN.js';
9
+ import '../signer-BocS_J6B.js';
10
10
  import '@scure/bip32';
11
- import '../spark-CDm4gqS6.js';
11
+ import '../spark-dM7EYXYQ.js';
12
12
  import '@bufbuild/protobuf/wire';
13
13
  import 'nice-grpc-common';
14
+ import '../types-C-Rp0Oo7.js';
14
15
  import '@scure/btc-signer';
15
16
  import 'bitcoinjs-lib';
16
17
  import '@buildonspark/lrc20-sdk/lrc/types';
17
- import '../network-xkBSpaTn.js';
18
+ import '../network-BTJl-Sul.js';
18
19
  import '../proto/spark_token.js';
19
20
  import 'nice-grpc';
20
21
  import 'nice-grpc-web';
@@ -1,18 +1,16 @@
1
- import {
2
- ConnectionManager
3
- } from "../chunk-HRQRRDSS.js";
4
1
  import {
5
2
  TokenTransactionService
6
- } from "../chunk-DQYKQJRZ.js";
7
- import "../chunk-6AFUC5M2.js";
3
+ } from "../chunk-C2S227QR.js";
4
+ import "../chunk-HWJWKEIU.js";
8
5
  import "../chunk-L3EHBOUX.js";
9
- import "../chunk-O4RYNJNB.js";
10
- import "../chunk-VA7MV4MZ.js";
6
+ import "../chunk-KMUMFYFX.js";
11
7
  import {
12
8
  WalletConfigService
13
- } from "../chunk-BUTZWYBW.js";
9
+ } from "../chunk-6264CGDM.js";
10
+ import "../chunk-YUPMXTCJ.js";
14
11
  import "../chunk-Z5HIAYFT.js";
15
12
  import {
13
+ BASE_CONFIG,
16
14
  ELECTRS_CREDENTIALS,
17
15
  LOCAL_WALLET_CONFIG,
18
16
  LOCAL_WALLET_CONFIG_ECDSA,
@@ -26,17 +24,21 @@ import {
26
24
  getSspIdentityPublicKey,
27
25
  getSspSchemaEndpoint,
28
26
  getSspUrl
29
- } from "../chunk-DOA6QXYQ.js";
30
- import "../chunk-HMLOC6TE.js";
31
- import "../chunk-M6A4KFIG.js";
32
- import "../chunk-TIUBYNN5.js";
33
- import "../chunk-VFJQNBFX.js";
27
+ } from "../chunk-R5PXJZQS.js";
34
28
  import "../chunk-NSJF5F5O.js";
35
29
  import "../chunk-QNNSEJ4P.js";
30
+ import "../chunk-HMLOC6TE.js";
36
31
  import "../chunk-VTUGIIWI.js";
32
+ import {
33
+ ConnectionManager
34
+ } from "../chunk-PQN3C2MF.js";
35
+ import "../chunk-LHRD2WT6.js";
36
+ import "../chunk-7V6N75CC.js";
37
37
  import "../chunk-GSI4OLXZ.js";
38
+ import "../chunk-BGGEVUJK.js";
38
39
  import "../chunk-MVRQ5US7.js";
39
40
  export {
41
+ BASE_CONFIG,
40
42
  ConnectionManager,
41
43
  ELECTRS_CREDENTIALS,
42
44
  LOCAL_WALLET_CONFIG,
@@ -240,9 +240,12 @@ init_buffer();
240
240
  var import_core = require("@lightsparkdev/core");
241
241
  var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
242
242
  var isBun = globalThis.Bun !== void 0;
243
- var packageVersion = true ? "0.1.43" : "unknown";
243
+ var packageVersion = true ? "0.1.45" : "unknown";
244
244
  var baseEnvStr = "unknown";
245
- if (import_core.isNode) {
245
+ if (isBun) {
246
+ const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
247
+ baseEnvStr = `bun/${bunVersion}`;
248
+ } else if (import_core.isNode) {
246
249
  baseEnvStr = `node/${process.version}`;
247
250
  } else if (isReactNative) {
248
251
  baseEnvStr = "react-native";
@@ -349,7 +352,7 @@ var Empty = {
349
352
  },
350
353
  decode(input, length) {
351
354
  const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
352
- let end = length === void 0 ? reader.len : reader.pos + length;
355
+ const end = length === void 0 ? reader.len : reader.pos + length;
353
356
  const message = createBaseEmpty();
354
357
  while (reader.pos < end) {
355
358
  const tag = reader.uint32();
@@ -396,7 +399,7 @@ var Timestamp = {
396
399
  },
397
400
  decode(input, length) {
398
401
  const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
399
- let end = length === void 0 ? reader.len : reader.pos + length;
402
+ const end = length === void 0 ? reader.len : reader.pos + length;
400
403
  const message = createBaseTimestamp();
401
404
  while (reader.pos < end) {
402
405
  const tag = reader.uint32();
@@ -527,7 +530,7 @@ var TokenOutputToSpend = {
527
530
  },
528
531
  decode(input, length) {
529
532
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
530
- let end = length === void 0 ? reader.len : reader.pos + length;
533
+ const end = length === void 0 ? reader.len : reader.pos + length;
531
534
  const message = createBaseTokenOutputToSpend();
532
535
  while (reader.pos < end) {
533
536
  const tag = reader.uint32();
@@ -592,7 +595,7 @@ var TokenTransferInput = {
592
595
  },
593
596
  decode(input, length) {
594
597
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
595
- let end = length === void 0 ? reader.len : reader.pos + length;
598
+ const end = length === void 0 ? reader.len : reader.pos + length;
596
599
  const message = createBaseTokenTransferInput();
597
600
  while (reader.pos < end) {
598
601
  const tag = reader.uint32();
@@ -634,7 +637,7 @@ var TokenTransferInput = {
634
637
  }
635
638
  };
636
639
  function createBaseTokenMintInput() {
637
- return { issuerPublicKey: new Uint8Array(0), issuerProvidedTimestamp: 0 };
640
+ return { issuerPublicKey: new Uint8Array(0), issuerProvidedTimestamp: 0, tokenIdentifier: void 0 };
638
641
  }
639
642
  var TokenMintInput = {
640
643
  encode(message, writer = new import_wire4.BinaryWriter()) {
@@ -644,11 +647,14 @@ var TokenMintInput = {
644
647
  if (message.issuerProvidedTimestamp !== 0) {
645
648
  writer.uint32(16).uint64(message.issuerProvidedTimestamp);
646
649
  }
650
+ if (message.tokenIdentifier !== void 0) {
651
+ writer.uint32(26).bytes(message.tokenIdentifier);
652
+ }
647
653
  return writer;
648
654
  },
649
655
  decode(input, length) {
650
656
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
651
- let end = length === void 0 ? reader.len : reader.pos + length;
657
+ const end = length === void 0 ? reader.len : reader.pos + length;
652
658
  const message = createBaseTokenMintInput();
653
659
  while (reader.pos < end) {
654
660
  const tag = reader.uint32();
@@ -667,6 +673,13 @@ var TokenMintInput = {
667
673
  message.issuerProvidedTimestamp = longToNumber2(reader.uint64());
668
674
  continue;
669
675
  }
676
+ case 3: {
677
+ if (tag !== 26) {
678
+ break;
679
+ }
680
+ message.tokenIdentifier = reader.bytes();
681
+ continue;
682
+ }
670
683
  }
671
684
  if ((tag & 7) === 4 || tag === 0) {
672
685
  break;
@@ -678,7 +691,8 @@ var TokenMintInput = {
678
691
  fromJSON(object) {
679
692
  return {
680
693
  issuerPublicKey: isSet2(object.issuerPublicKey) ? bytesFromBase64(object.issuerPublicKey) : new Uint8Array(0),
681
- issuerProvidedTimestamp: isSet2(object.issuerProvidedTimestamp) ? globalThis.Number(object.issuerProvidedTimestamp) : 0
694
+ issuerProvidedTimestamp: isSet2(object.issuerProvidedTimestamp) ? globalThis.Number(object.issuerProvidedTimestamp) : 0,
695
+ tokenIdentifier: isSet2(object.tokenIdentifier) ? bytesFromBase64(object.tokenIdentifier) : void 0
682
696
  };
683
697
  },
684
698
  toJSON(message) {
@@ -689,6 +703,9 @@ var TokenMintInput = {
689
703
  if (message.issuerProvidedTimestamp !== 0) {
690
704
  obj.issuerProvidedTimestamp = Math.round(message.issuerProvidedTimestamp);
691
705
  }
706
+ if (message.tokenIdentifier !== void 0) {
707
+ obj.tokenIdentifier = base64FromBytes(message.tokenIdentifier);
708
+ }
692
709
  return obj;
693
710
  },
694
711
  create(base) {
@@ -698,6 +715,158 @@ var TokenMintInput = {
698
715
  const message = createBaseTokenMintInput();
699
716
  message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
700
717
  message.issuerProvidedTimestamp = object.issuerProvidedTimestamp ?? 0;
718
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
719
+ return message;
720
+ }
721
+ };
722
+ function createBaseTokenCreateInput() {
723
+ return {
724
+ issuerPublicKey: new Uint8Array(0),
725
+ tokenName: "",
726
+ tokenTicker: "",
727
+ decimals: 0,
728
+ maxSupply: new Uint8Array(0),
729
+ isFreezable: false,
730
+ creationEntityPublicKey: void 0
731
+ };
732
+ }
733
+ var TokenCreateInput = {
734
+ encode(message, writer = new import_wire4.BinaryWriter()) {
735
+ if (message.issuerPublicKey.length !== 0) {
736
+ writer.uint32(10).bytes(message.issuerPublicKey);
737
+ }
738
+ if (message.tokenName !== "") {
739
+ writer.uint32(18).string(message.tokenName);
740
+ }
741
+ if (message.tokenTicker !== "") {
742
+ writer.uint32(26).string(message.tokenTicker);
743
+ }
744
+ if (message.decimals !== 0) {
745
+ writer.uint32(32).uint32(message.decimals);
746
+ }
747
+ if (message.maxSupply.length !== 0) {
748
+ writer.uint32(42).bytes(message.maxSupply);
749
+ }
750
+ if (message.isFreezable !== false) {
751
+ writer.uint32(48).bool(message.isFreezable);
752
+ }
753
+ if (message.creationEntityPublicKey !== void 0) {
754
+ writer.uint32(58).bytes(message.creationEntityPublicKey);
755
+ }
756
+ return writer;
757
+ },
758
+ decode(input, length) {
759
+ const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
760
+ const end = length === void 0 ? reader.len : reader.pos + length;
761
+ const message = createBaseTokenCreateInput();
762
+ while (reader.pos < end) {
763
+ const tag = reader.uint32();
764
+ switch (tag >>> 3) {
765
+ case 1: {
766
+ if (tag !== 10) {
767
+ break;
768
+ }
769
+ message.issuerPublicKey = reader.bytes();
770
+ continue;
771
+ }
772
+ case 2: {
773
+ if (tag !== 18) {
774
+ break;
775
+ }
776
+ message.tokenName = reader.string();
777
+ continue;
778
+ }
779
+ case 3: {
780
+ if (tag !== 26) {
781
+ break;
782
+ }
783
+ message.tokenTicker = reader.string();
784
+ continue;
785
+ }
786
+ case 4: {
787
+ if (tag !== 32) {
788
+ break;
789
+ }
790
+ message.decimals = reader.uint32();
791
+ continue;
792
+ }
793
+ case 5: {
794
+ if (tag !== 42) {
795
+ break;
796
+ }
797
+ message.maxSupply = reader.bytes();
798
+ continue;
799
+ }
800
+ case 6: {
801
+ if (tag !== 48) {
802
+ break;
803
+ }
804
+ message.isFreezable = reader.bool();
805
+ continue;
806
+ }
807
+ case 7: {
808
+ if (tag !== 58) {
809
+ break;
810
+ }
811
+ message.creationEntityPublicKey = reader.bytes();
812
+ continue;
813
+ }
814
+ }
815
+ if ((tag & 7) === 4 || tag === 0) {
816
+ break;
817
+ }
818
+ reader.skip(tag & 7);
819
+ }
820
+ return message;
821
+ },
822
+ fromJSON(object) {
823
+ return {
824
+ issuerPublicKey: isSet2(object.issuerPublicKey) ? bytesFromBase64(object.issuerPublicKey) : new Uint8Array(0),
825
+ tokenName: isSet2(object.tokenName) ? globalThis.String(object.tokenName) : "",
826
+ tokenTicker: isSet2(object.tokenTicker) ? globalThis.String(object.tokenTicker) : "",
827
+ decimals: isSet2(object.decimals) ? globalThis.Number(object.decimals) : 0,
828
+ maxSupply: isSet2(object.maxSupply) ? bytesFromBase64(object.maxSupply) : new Uint8Array(0),
829
+ isFreezable: isSet2(object.isFreezable) ? globalThis.Boolean(object.isFreezable) : false,
830
+ creationEntityPublicKey: isSet2(object.creationEntityPublicKey) ? bytesFromBase64(object.creationEntityPublicKey) : void 0
831
+ };
832
+ },
833
+ toJSON(message) {
834
+ const obj = {};
835
+ if (message.issuerPublicKey.length !== 0) {
836
+ obj.issuerPublicKey = base64FromBytes(message.issuerPublicKey);
837
+ }
838
+ if (message.tokenName !== "") {
839
+ obj.tokenName = message.tokenName;
840
+ }
841
+ if (message.tokenTicker !== "") {
842
+ obj.tokenTicker = message.tokenTicker;
843
+ }
844
+ if (message.decimals !== 0) {
845
+ obj.decimals = Math.round(message.decimals);
846
+ }
847
+ if (message.maxSupply.length !== 0) {
848
+ obj.maxSupply = base64FromBytes(message.maxSupply);
849
+ }
850
+ if (message.isFreezable !== false) {
851
+ obj.isFreezable = message.isFreezable;
852
+ }
853
+ if (message.creationEntityPublicKey !== void 0) {
854
+ obj.creationEntityPublicKey = base64FromBytes(message.creationEntityPublicKey);
855
+ }
856
+ return obj;
857
+ },
858
+ create(base) {
859
+ return TokenCreateInput.fromPartial(base ?? {});
860
+ },
861
+ fromPartial(object) {
862
+ const message = createBaseTokenCreateInput();
863
+ message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
864
+ message.tokenName = object.tokenName ?? "";
865
+ message.tokenTicker = object.tokenTicker ?? "";
866
+ message.decimals = object.decimals ?? 0;
867
+ message.maxSupply = object.maxSupply ?? new Uint8Array(0);
868
+ message.isFreezable = object.isFreezable ?? false;
869
+ message.creationEntityPublicKey = object.creationEntityPublicKey ?? void 0;
701
870
  return message;
702
871
  }
703
872
  };
@@ -708,7 +877,8 @@ function createBaseTokenOutput() {
708
877
  revocationCommitment: void 0,
709
878
  withdrawBondSats: void 0,
710
879
  withdrawRelativeBlockLocktime: void 0,
711
- tokenPublicKey: new Uint8Array(0),
880
+ tokenPublicKey: void 0,
881
+ tokenIdentifier: void 0,
712
882
  tokenAmount: new Uint8Array(0)
713
883
  };
714
884
  }
@@ -729,9 +899,12 @@ var TokenOutput = {
729
899
  if (message.withdrawRelativeBlockLocktime !== void 0) {
730
900
  writer.uint32(40).uint64(message.withdrawRelativeBlockLocktime);
731
901
  }
732
- if (message.tokenPublicKey.length !== 0) {
902
+ if (message.tokenPublicKey !== void 0) {
733
903
  writer.uint32(50).bytes(message.tokenPublicKey);
734
904
  }
905
+ if (message.tokenIdentifier !== void 0) {
906
+ writer.uint32(66).bytes(message.tokenIdentifier);
907
+ }
735
908
  if (message.tokenAmount.length !== 0) {
736
909
  writer.uint32(58).bytes(message.tokenAmount);
737
910
  }
@@ -739,7 +912,7 @@ var TokenOutput = {
739
912
  },
740
913
  decode(input, length) {
741
914
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
742
- let end = length === void 0 ? reader.len : reader.pos + length;
915
+ const end = length === void 0 ? reader.len : reader.pos + length;
743
916
  const message = createBaseTokenOutput();
744
917
  while (reader.pos < end) {
745
918
  const tag = reader.uint32();
@@ -786,6 +959,13 @@ var TokenOutput = {
786
959
  message.tokenPublicKey = reader.bytes();
787
960
  continue;
788
961
  }
962
+ case 8: {
963
+ if (tag !== 66) {
964
+ break;
965
+ }
966
+ message.tokenIdentifier = reader.bytes();
967
+ continue;
968
+ }
789
969
  case 7: {
790
970
  if (tag !== 58) {
791
971
  break;
@@ -808,7 +988,8 @@ var TokenOutput = {
808
988
  revocationCommitment: isSet2(object.revocationCommitment) ? bytesFromBase64(object.revocationCommitment) : void 0,
809
989
  withdrawBondSats: isSet2(object.withdrawBondSats) ? globalThis.Number(object.withdrawBondSats) : void 0,
810
990
  withdrawRelativeBlockLocktime: isSet2(object.withdrawRelativeBlockLocktime) ? globalThis.Number(object.withdrawRelativeBlockLocktime) : void 0,
811
- tokenPublicKey: isSet2(object.tokenPublicKey) ? bytesFromBase64(object.tokenPublicKey) : new Uint8Array(0),
991
+ tokenPublicKey: isSet2(object.tokenPublicKey) ? bytesFromBase64(object.tokenPublicKey) : void 0,
992
+ tokenIdentifier: isSet2(object.tokenIdentifier) ? bytesFromBase64(object.tokenIdentifier) : void 0,
812
993
  tokenAmount: isSet2(object.tokenAmount) ? bytesFromBase64(object.tokenAmount) : new Uint8Array(0)
813
994
  };
814
995
  },
@@ -829,9 +1010,12 @@ var TokenOutput = {
829
1010
  if (message.withdrawRelativeBlockLocktime !== void 0) {
830
1011
  obj.withdrawRelativeBlockLocktime = Math.round(message.withdrawRelativeBlockLocktime);
831
1012
  }
832
- if (message.tokenPublicKey.length !== 0) {
1013
+ if (message.tokenPublicKey !== void 0) {
833
1014
  obj.tokenPublicKey = base64FromBytes(message.tokenPublicKey);
834
1015
  }
1016
+ if (message.tokenIdentifier !== void 0) {
1017
+ obj.tokenIdentifier = base64FromBytes(message.tokenIdentifier);
1018
+ }
835
1019
  if (message.tokenAmount.length !== 0) {
836
1020
  obj.tokenAmount = base64FromBytes(message.tokenAmount);
837
1021
  }
@@ -847,7 +1031,8 @@ var TokenOutput = {
847
1031
  message.revocationCommitment = object.revocationCommitment ?? void 0;
848
1032
  message.withdrawBondSats = object.withdrawBondSats ?? void 0;
849
1033
  message.withdrawRelativeBlockLocktime = object.withdrawRelativeBlockLocktime ?? void 0;
850
- message.tokenPublicKey = object.tokenPublicKey ?? new Uint8Array(0);
1034
+ message.tokenPublicKey = object.tokenPublicKey ?? void 0;
1035
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
851
1036
  message.tokenAmount = object.tokenAmount ?? new Uint8Array(0);
852
1037
  return message;
853
1038
  }
@@ -864,6 +1049,9 @@ var TokenTransaction = {
864
1049
  case "transferInput":
865
1050
  TokenTransferInput.encode(message.tokenInputs.transferInput, writer.uint32(18).fork()).join();
866
1051
  break;
1052
+ case "createInput":
1053
+ TokenCreateInput.encode(message.tokenInputs.createInput, writer.uint32(42).fork()).join();
1054
+ break;
867
1055
  }
868
1056
  for (const v of message.tokenOutputs) {
869
1057
  TokenOutput.encode(v, writer.uint32(26).fork()).join();
@@ -878,7 +1066,7 @@ var TokenTransaction = {
878
1066
  },
879
1067
  decode(input, length) {
880
1068
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
881
- let end = length === void 0 ? reader.len : reader.pos + length;
1069
+ const end = length === void 0 ? reader.len : reader.pos + length;
882
1070
  const message = createBaseTokenTransaction();
883
1071
  while (reader.pos < end) {
884
1072
  const tag = reader.uint32();
@@ -900,6 +1088,13 @@ var TokenTransaction = {
900
1088
  };
901
1089
  continue;
902
1090
  }
1091
+ case 5: {
1092
+ if (tag !== 42) {
1093
+ break;
1094
+ }
1095
+ message.tokenInputs = { $case: "createInput", createInput: TokenCreateInput.decode(reader, reader.uint32()) };
1096
+ continue;
1097
+ }
903
1098
  case 3: {
904
1099
  if (tag !== 26) {
905
1100
  break;
@@ -931,7 +1126,7 @@ var TokenTransaction = {
931
1126
  },
932
1127
  fromJSON(object) {
933
1128
  return {
934
- tokenInputs: isSet2(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet2(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : void 0,
1129
+ tokenInputs: isSet2(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet2(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : isSet2(object.createInput) ? { $case: "createInput", createInput: TokenCreateInput.fromJSON(object.createInput) } : void 0,
935
1130
  tokenOutputs: globalThis.Array.isArray(object?.tokenOutputs) ? object.tokenOutputs.map((e) => TokenOutput.fromJSON(e)) : [],
936
1131
  sparkOperatorIdentityPublicKeys: globalThis.Array.isArray(object?.sparkOperatorIdentityPublicKeys) ? object.sparkOperatorIdentityPublicKeys.map((e) => bytesFromBase64(e)) : [],
937
1132
  network: isSet2(object.network) ? networkFromJSON(object.network) : 0
@@ -943,6 +1138,8 @@ var TokenTransaction = {
943
1138
  obj.mintInput = TokenMintInput.toJSON(message.tokenInputs.mintInput);
944
1139
  } else if (message.tokenInputs?.$case === "transferInput") {
945
1140
  obj.transferInput = TokenTransferInput.toJSON(message.tokenInputs.transferInput);
1141
+ } else if (message.tokenInputs?.$case === "createInput") {
1142
+ obj.createInput = TokenCreateInput.toJSON(message.tokenInputs.createInput);
946
1143
  }
947
1144
  if (message.tokenOutputs?.length) {
948
1145
  obj.tokenOutputs = message.tokenOutputs.map((e) => TokenOutput.toJSON(e));
@@ -979,6 +1176,15 @@ var TokenTransaction = {
979
1176
  }
980
1177
  break;
981
1178
  }
1179
+ case "createInput": {
1180
+ if (object.tokenInputs?.createInput !== void 0 && object.tokenInputs?.createInput !== null) {
1181
+ message.tokenInputs = {
1182
+ $case: "createInput",
1183
+ createInput: TokenCreateInput.fromPartial(object.tokenInputs.createInput)
1184
+ };
1185
+ }
1186
+ break;
1187
+ }
982
1188
  }
983
1189
  message.tokenOutputs = object.tokenOutputs?.map((e) => TokenOutput.fromPartial(e)) || [];
984
1190
  message.sparkOperatorIdentityPublicKeys = object.sparkOperatorIdentityPublicKeys?.map((e) => e) || [];
@@ -1001,7 +1207,7 @@ var SignatureWithIndex = {
1001
1207
  },
1002
1208
  decode(input, length) {
1003
1209
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
1004
- let end = length === void 0 ? reader.len : reader.pos + length;
1210
+ const end = length === void 0 ? reader.len : reader.pos + length;
1005
1211
  const message = createBaseSignatureWithIndex();
1006
1212
  while (reader.pos < end) {
1007
1213
  const tag = reader.uint32();
@@ -1069,7 +1275,7 @@ var OperatorSpecificTokenTransactionSignablePayload = {
1069
1275
  },
1070
1276
  decode(input, length) {
1071
1277
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
1072
- let end = length === void 0 ? reader.len : reader.pos + length;
1278
+ const end = length === void 0 ? reader.len : reader.pos + length;
1073
1279
  const message = createBaseOperatorSpecificTokenTransactionSignablePayload();
1074
1280
  while (reader.pos < end) {
1075
1281
  const tag = reader.uint32();
@@ -1137,7 +1343,7 @@ var OperatorSpecificOwnerSignature = {
1137
1343
  },
1138
1344
  decode(input, length) {
1139
1345
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
1140
- let end = length === void 0 ? reader.len : reader.pos + length;
1346
+ const end = length === void 0 ? reader.len : reader.pos + length;
1141
1347
  const message = createBaseOperatorSpecificOwnerSignature();
1142
1348
  while (reader.pos < end) {
1143
1349
  const tag = reader.uint32();
@@ -1205,7 +1411,7 @@ var RevocationSecretWithIndex = {
1205
1411
  },
1206
1412
  decode(input, length) {
1207
1413
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
1208
- let end = length === void 0 ? reader.len : reader.pos + length;
1414
+ const end = length === void 0 ? reader.len : reader.pos + length;
1209
1415
  const message = createBaseRevocationSecretWithIndex();
1210
1416
  while (reader.pos < end) {
1211
1417
  const tag = reader.uint32();
@@ -1,18 +1,19 @@
1
1
  import { SparkServiceClient } from '../proto/lrc20.cjs';
2
2
  import { WalletConfigService } from './config.cjs';
3
- import '../spark-CDm4gqS6.cjs';
3
+ import '../spark-dM7EYXYQ.cjs';
4
4
  import '@bufbuild/protobuf/wire';
5
5
  import 'nice-grpc-common';
6
6
  import '@buildonspark/lrc20-sdk';
7
- import '../RequestLightningSendInput-Na1mHdWg.cjs';
7
+ import '../RequestLightningSendInput-Du0z7Om7.cjs';
8
8
  import '@lightsparkdev/core';
9
9
  import '../BitcoinNetwork-TnABML0T.cjs';
10
- import '../signer-IO3oMRNj.cjs';
10
+ import '../signer-DKS0AJkw.cjs';
11
11
  import '@scure/bip32';
12
+ import '../types-C-Rp0Oo7.cjs';
12
13
  import '@scure/btc-signer';
13
14
  import 'bitcoinjs-lib';
14
15
  import '@buildonspark/lrc20-sdk/lrc/types';
15
- import '../network-D5lKssVl.cjs';
16
+ import '../network-CqgsdUF2.cjs';
16
17
  import './wallet-config.cjs';
17
18
 
18
19
  declare class Lrc20ConnectionManager {
@@ -1,18 +1,19 @@
1
1
  import { SparkServiceClient } from '../proto/lrc20.js';
2
2
  import { WalletConfigService } from './config.js';
3
- import '../spark-CDm4gqS6.js';
3
+ import '../spark-dM7EYXYQ.js';
4
4
  import '@bufbuild/protobuf/wire';
5
5
  import 'nice-grpc-common';
6
6
  import '@buildonspark/lrc20-sdk';
7
- import '../RequestLightningSendInput-D7fZdT4A.js';
7
+ import '../RequestLightningSendInput-DEPd_fPO.js';
8
8
  import '@lightsparkdev/core';
9
9
  import '../BitcoinNetwork-TnABML0T.js';
10
- import '../signer-wqesWifN.js';
10
+ import '../signer-BocS_J6B.js';
11
11
  import '@scure/bip32';
12
+ import '../types-C-Rp0Oo7.js';
12
13
  import '@scure/btc-signer';
13
14
  import 'bitcoinjs-lib';
14
15
  import '@buildonspark/lrc20-sdk/lrc/types';
15
- import '../network-xkBSpaTn.js';
16
+ import '../network-BTJl-Sul.js';
16
17
  import './wallet-config.js';
17
18
 
18
19
  declare class Lrc20ConnectionManager {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Lrc20ConnectionManager
3
- } from "../chunk-GYQR4B4P.js";
4
- import "../chunk-ABZA6R5S.js";
5
- import "../chunk-M6A4KFIG.js";
6
- import "../chunk-VFJQNBFX.js";
3
+ } from "../chunk-GZ5IPPJ2.js";
4
+ import "../chunk-NTFKFRQ2.js";
5
+ import "../chunk-7V6N75CC.js";
7
6
  import "../chunk-GSI4OLXZ.js";
7
+ import "../chunk-BGGEVUJK.js";
8
8
  import "../chunk-MVRQ5US7.js";
9
9
  export {
10
10
  Lrc20ConnectionManager