@buildonspark/spark-sdk 0.1.44 → 0.1.46

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 (143) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{RequestLightningSendInput-BxbCtwpV.d.cts → RequestLightningSendInput-2cSh_In4.d.cts} +1 -1
  3. package/dist/{RequestLightningSendInput-RGel43ks.d.ts → RequestLightningSendInput-CN6BNg_g.d.ts} +1 -1
  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-EKFD62HN.js → chunk-4EMV7HHW.js} +2 -1
  9. package/dist/{chunk-4Q2ZDYYU.js → chunk-BGGEVUJK.js} +1157 -208
  10. package/dist/{chunk-CIZNCBKE.js → chunk-C2S227QR.js} +648 -45
  11. package/dist/{chunk-WPTRVD2V.js → chunk-DXR2PXJU.js} +15 -15
  12. package/dist/{chunk-NBCNYDWJ.js → chunk-HHNQ3ZHC.js} +2 -2
  13. package/dist/{chunk-DAXGVPVM.js → chunk-HSCLBJEL.js} +2 -2
  14. package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
  15. package/dist/{chunk-A2ZLMH6I.js → chunk-JB64OQES.js} +259 -327
  16. package/dist/{chunk-KEKGSH7B.js → chunk-KMUMFYFX.js} +3 -3
  17. package/dist/chunk-LHRD2WT6.js +2374 -0
  18. package/dist/{chunk-HTMXTJRK.js → chunk-N5VZVCGJ.js} +4 -4
  19. package/dist/{chunk-SQKXGAIR.js → chunk-NTFKFRQ2.js} +1 -1
  20. package/dist/{chunk-K4BJARWM.js → chunk-OBFKIEMP.js} +1 -1
  21. package/dist/{chunk-UBT6EDVJ.js → chunk-OFCJFZ4I.js} +1 -1
  22. package/dist/{chunk-XX4RRWOX.js → chunk-UXDODSDT.js} +8 -10
  23. package/dist/graphql/objects/index.d.cts +5 -4
  24. package/dist/graphql/objects/index.d.ts +5 -4
  25. package/dist/index-CKL5DodV.d.cts +214 -0
  26. package/dist/index-COm59SPw.d.ts +214 -0
  27. package/dist/index.cjs +4026 -1315
  28. package/dist/index.d.cts +764 -19
  29. package/dist/index.d.ts +764 -19
  30. package/dist/index.js +23 -27
  31. package/dist/index.node.cjs +4026 -1319
  32. package/dist/index.node.d.cts +10 -8
  33. package/dist/index.node.d.ts +10 -8
  34. package/dist/index.node.js +23 -31
  35. package/dist/native/index.cjs +4027 -1316
  36. package/dist/native/index.d.cts +281 -85
  37. package/dist/native/index.d.ts +281 -85
  38. package/dist/native/index.js +4018 -1307
  39. package/dist/{network-CfxLnaot.d.cts → network-Css46DAz.d.cts} +1 -1
  40. package/dist/{network-CroCOQ0B.d.ts → network-hynb7iTZ.d.ts} +1 -1
  41. package/dist/proto/lrc20.cjs +222 -19
  42. package/dist/proto/lrc20.d.cts +1 -1
  43. package/dist/proto/lrc20.d.ts +1 -1
  44. package/dist/proto/lrc20.js +2 -2
  45. package/dist/proto/spark.cjs +1154 -205
  46. package/dist/proto/spark.d.cts +1 -1
  47. package/dist/proto/spark.d.ts +1 -1
  48. package/dist/proto/spark.js +3 -1
  49. package/dist/proto/spark_token.cjs +1377 -58
  50. package/dist/proto/spark_token.d.cts +153 -15
  51. package/dist/proto/spark_token.d.ts +153 -15
  52. package/dist/proto/spark_token.js +40 -4
  53. package/dist/{sdk-types-CTbTdDbE.d.ts → sdk-types-CKBsylfW.d.ts} +1 -1
  54. package/dist/{sdk-types-BeCBoozO.d.cts → sdk-types-Ct8xmN7l.d.cts} +1 -1
  55. package/dist/services/config.cjs +2 -2
  56. package/dist/services/config.d.cts +5 -4
  57. package/dist/services/config.d.ts +5 -4
  58. package/dist/services/config.js +6 -6
  59. package/dist/services/connection.cjs +2438 -262
  60. package/dist/services/connection.d.cts +5 -4
  61. package/dist/services/connection.d.ts +5 -4
  62. package/dist/services/connection.js +4 -4
  63. package/dist/services/index.cjs +5937 -3154
  64. package/dist/services/index.d.cts +7 -6
  65. package/dist/services/index.d.ts +7 -6
  66. package/dist/services/index.js +17 -15
  67. package/dist/services/lrc-connection.cjs +223 -20
  68. package/dist/services/lrc-connection.d.cts +5 -4
  69. package/dist/services/lrc-connection.d.ts +5 -4
  70. package/dist/services/lrc-connection.js +4 -4
  71. package/dist/services/token-transactions.cjs +840 -236
  72. package/dist/services/token-transactions.d.cts +25 -7
  73. package/dist/services/token-transactions.d.ts +25 -7
  74. package/dist/services/token-transactions.js +5 -4
  75. package/dist/services/wallet-config.cjs +3 -1
  76. package/dist/services/wallet-config.d.cts +7 -5
  77. package/dist/services/wallet-config.d.ts +7 -5
  78. package/dist/services/wallet-config.js +3 -1
  79. package/dist/signer/signer.cjs +1 -1
  80. package/dist/signer/signer.d.cts +3 -2
  81. package/dist/signer/signer.d.ts +3 -2
  82. package/dist/signer/signer.js +2 -2
  83. package/dist/{signer-D7vfYik9.d.ts → signer-BP6F__oR.d.cts} +2 -6
  84. package/dist/{signer-DaY8c60s.d.cts → signer-BVZJXcq7.d.ts} +2 -6
  85. package/dist/{spark-C4ZrsgjC.d.cts → spark-DbzGfse6.d.cts} +93 -15
  86. package/dist/{spark-C4ZrsgjC.d.ts → spark-DbzGfse6.d.ts} +93 -15
  87. package/dist/spark_bindings/native/index.cjs +183 -0
  88. package/dist/spark_bindings/native/index.d.cts +14 -0
  89. package/dist/spark_bindings/native/index.d.ts +14 -0
  90. package/dist/spark_bindings/native/index.js +141 -0
  91. package/dist/spark_bindings/wasm/index.cjs +1093 -0
  92. package/dist/spark_bindings/wasm/index.d.cts +47 -0
  93. package/dist/spark_bindings/wasm/index.d.ts +47 -0
  94. package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
  95. package/dist/types/index.cjs +1156 -208
  96. package/dist/types/index.d.cts +5 -4
  97. package/dist/types/index.d.ts +5 -4
  98. package/dist/types/index.js +2 -2
  99. package/dist/types-C-Rp0Oo7.d.cts +46 -0
  100. package/dist/types-C-Rp0Oo7.d.ts +46 -0
  101. package/dist/utils/index.cjs +65 -13
  102. package/dist/utils/index.d.cts +14 -134
  103. package/dist/utils/index.d.ts +14 -134
  104. package/dist/utils/index.js +13 -13
  105. package/package.json +22 -2
  106. package/src/index.node.ts +0 -1
  107. package/src/index.ts +0 -1
  108. package/src/native/index.ts +1 -2
  109. package/src/proto/common.ts +5 -5
  110. package/src/proto/google/protobuf/descriptor.ts +34 -34
  111. package/src/proto/google/protobuf/duration.ts +2 -2
  112. package/src/proto/google/protobuf/empty.ts +2 -2
  113. package/src/proto/google/protobuf/timestamp.ts +2 -2
  114. package/src/proto/mock.ts +4 -4
  115. package/src/proto/spark.ts +1452 -185
  116. package/src/proto/spark_authn.ts +7 -7
  117. package/src/proto/spark_token.ts +1668 -105
  118. package/src/proto/validate/validate.ts +24 -24
  119. package/src/services/bolt11-spark.ts +62 -187
  120. package/src/services/coop-exit.ts +3 -0
  121. package/src/services/lrc20.ts +1 -1
  122. package/src/services/token-transactions.ts +197 -9
  123. package/src/services/transfer.ts +22 -0
  124. package/src/services/tree-creation.ts +13 -0
  125. package/src/services/wallet-config.ts +2 -2
  126. package/src/spark-wallet/spark-wallet.node.ts +0 -4
  127. package/src/spark-wallet/spark-wallet.ts +76 -108
  128. package/src/spark-wallet/types.ts +39 -3
  129. package/src/tests/bolt11-spark.test.ts +7 -15
  130. package/src/tests/integration/ssp/coop-exit.test.ts +7 -7
  131. package/src/tests/integration/swap.test.ts +453 -433
  132. package/src/tests/integration/transfer.test.ts +261 -248
  133. package/src/tests/token-identifier.test.ts +54 -0
  134. package/src/tests/tokens.test.ts +218 -23
  135. package/src/utils/token-hashing.ts +320 -44
  136. package/src/utils/token-identifier.ts +88 -0
  137. package/src/utils/token-transaction-validation.ts +350 -5
  138. package/src/utils/token-transactions.ts +12 -8
  139. package/src/utils/transaction.ts +0 -6
  140. package/dist/chunk-B3AMIGJG.js +0 -1073
  141. package/dist/index-CZmDdSts.d.cts +0 -829
  142. package/dist/index-ClIRO_3y.d.ts +0 -829
  143. package/dist/wasm-7OWFHDMS.js +0 -21
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @buildonspark/spark-sdk
2
2
 
3
+ ## 0.1.46
4
+
5
+ ### Patch Changes
6
+
7
+ - Upgrades to token transfers
8
+ - Updated dependencies
9
+ - @buildonspark/lrc20-sdk@0.0.59
10
+
11
+ ## 0.1.45
12
+
13
+ ### Patch Changes
14
+
15
+ - - Update parsing of spark address from fallback_adress to route_hints
16
+ - Update sdk checks on transactions
17
+ - Add token features
18
+ - Improve stability and cleanup
19
+
3
20
  ## 0.1.44
4
21
 
5
22
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import { Query } from '@lightsparkdev/core';
2
2
  import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.cjs';
3
- import { S as SparkSigner } from './signer-DaY8c60s.cjs';
3
+ import { S as SparkSigner } from './signer-BP6F__oR.cjs';
4
4
 
5
5
  /** This enum identifies the unit of currency associated with a CurrencyAmount. **/
6
6
  declare enum CurrencyUnit {
@@ -1,6 +1,6 @@
1
1
  import { Query } from '@lightsparkdev/core';
2
2
  import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.js';
3
- import { S as SparkSigner } from './signer-D7vfYik9.js';
3
+ import { S as SparkSigner } from './signer-BVZJXcq7.js';
4
4
 
5
5
  /** This enum identifies the unit of currency associated with a CurrencyAmount. **/
6
6
  declare enum CurrencyUnit {
@@ -74,7 +74,7 @@ var SparkAddress = {
74
74
  },
75
75
  decode(input, length) {
76
76
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
77
- let end = length === void 0 ? reader.len : reader.pos + length;
77
+ const end = length === void 0 ? reader.len : reader.pos + length;
78
78
  const message = createBaseSparkAddress();
79
79
  while (reader.pos < end) {
80
80
  const tag = reader.uint32();
@@ -148,7 +148,7 @@ var PaymentIntentFields = {
148
148
  },
149
149
  decode(input, length) {
150
150
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
151
- let end = length === void 0 ? reader.len : reader.pos + length;
151
+ const end = length === void 0 ? reader.len : reader.pos + length;
152
152
  const message = createBasePaymentIntentFields();
153
153
  while (reader.pos < end) {
154
154
  const tag = reader.uint32();
@@ -1,5 +1,5 @@
1
- import { P as PaymentIntentFields } from '../spark-C4ZrsgjC.cjs';
2
- import { a as NetworkType } from '../network-CfxLnaot.cjs';
1
+ import { P as PaymentIntentFields } from '../spark-DbzGfse6.cjs';
2
+ import { a as NetworkType } from '../network-Css46DAz.cjs';
3
3
  import '@bufbuild/protobuf/wire';
4
4
  import 'nice-grpc-common';
5
5
  import '@buildonspark/lrc20-sdk';
@@ -1,5 +1,5 @@
1
- import { P as PaymentIntentFields } from '../spark-C4ZrsgjC.js';
2
- import { a as NetworkType } from '../network-CroCOQ0B.js';
1
+ import { P as PaymentIntentFields } from '../spark-DbzGfse6.js';
2
+ import { a as NetworkType } from '../network-hynb7iTZ.js';
3
3
  import '@bufbuild/protobuf/wire';
4
4
  import 'nice-grpc-common';
5
5
  import '@buildonspark/lrc20-sdk';
@@ -4,10 +4,10 @@ import {
4
4
  encodeSparkAddress,
5
5
  isValidPublicKey,
6
6
  isValidSparkAddress
7
- } from "../chunk-KEKGSH7B.js";
8
- import "../chunk-4Q2ZDYYU.js";
7
+ } from "../chunk-KMUMFYFX.js";
9
8
  import "../chunk-VTUGIIWI.js";
10
9
  import "../chunk-GSI4OLXZ.js";
10
+ import "../chunk-BGGEVUJK.js";
11
11
  import "../chunk-MVRQ5US7.js";
12
12
  export {
13
13
  decodeSparkAddress,
@@ -129,7 +129,7 @@ var BASE_CONFIG = {
129
129
  threshold: 2,
130
130
  signingOperators: getLocalSigningOperators(),
131
131
  tokenSignatures: "SCHNORR",
132
- tokenTransactionVersion: "V0",
132
+ tokenTransactionVersion: "V1",
133
133
  tokenValidityDurationSeconds: 180,
134
134
  electrsUrl: getElectrsUrl("LOCAL"),
135
135
  expectedWithdrawBondSats: 1e4,
@@ -267,6 +267,7 @@ export {
267
267
  getSspIdentityPublicKey,
268
268
  getSspUrl,
269
269
  getSspSchemaEndpoint,
270
+ BASE_CONFIG,
270
271
  LOCAL_WALLET_CONFIG,
271
272
  LOCAL_WALLET_CONFIG_SCHNORR,
272
273
  LOCAL_WALLET_CONFIG_ECDSA,