@buildonspark/spark-sdk 0.2.11 → 0.2.13

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 (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bare/index.cjs +761 -243
  3. package/dist/bare/index.d.cts +70 -11
  4. package/dist/bare/index.d.ts +70 -11
  5. package/dist/bare/index.js +684 -170
  6. package/dist/{chunk-A5M55UR3.js → chunk-5VWGOHED.js} +499 -8
  7. package/dist/{chunk-3WBPICWC.js → chunk-CKHJFQUA.js} +1 -1
  8. package/dist/{chunk-QNYJGFPD.js → chunk-LX45BCZW.js} +207 -160
  9. package/dist/{chunk-76SYPHOC.js → chunk-TB7DG5CU.js} +2 -2
  10. package/dist/{chunk-6CMNEDBK.js → chunk-XXTWWW6L.js} +1 -1
  11. package/dist/{client-Dd3QnxQu.d.ts → client-D7KDa4Ih.d.ts} +1 -1
  12. package/dist/{client-B9CAWKWz.d.cts → client-DVuA5-7M.d.cts} +1 -1
  13. package/dist/debug.cjs +761 -243
  14. package/dist/debug.d.cts +4 -4
  15. package/dist/debug.d.ts +4 -4
  16. package/dist/debug.js +4 -4
  17. package/dist/graphql/objects/index.d.cts +3 -3
  18. package/dist/graphql/objects/index.d.ts +3 -3
  19. package/dist/index.cjs +783 -265
  20. package/dist/index.d.cts +6 -6
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +5 -5
  23. package/dist/index.node.cjs +783 -265
  24. package/dist/index.node.d.cts +6 -6
  25. package/dist/index.node.d.ts +6 -6
  26. package/dist/index.node.js +4 -4
  27. package/dist/{logging-BOAzMqpM.d.cts → logging-BfTyKwqb.d.cts} +3 -3
  28. package/dist/{logging-Bt_WdZbu.d.ts → logging-CaNpBgiE.d.ts} +3 -3
  29. package/dist/native/index.cjs +782 -264
  30. package/dist/native/index.d.cts +70 -11
  31. package/dist/native/index.d.ts +70 -11
  32. package/dist/native/index.js +686 -172
  33. package/dist/proto/spark.cjs +499 -8
  34. package/dist/proto/spark.d.cts +1 -1
  35. package/dist/proto/spark.d.ts +1 -1
  36. package/dist/proto/spark.js +17 -1
  37. package/dist/proto/spark_token.d.cts +1 -1
  38. package/dist/proto/spark_token.d.ts +1 -1
  39. package/dist/proto/spark_token.js +2 -2
  40. package/dist/{spark-CtGJPkx4.d.cts → spark-C7OG9mGJ.d.cts} +79 -2
  41. package/dist/{spark-CtGJPkx4.d.ts → spark-C7OG9mGJ.d.ts} +79 -2
  42. package/dist/{spark-wallet-Cp3yv6cK.d.ts → spark-wallet-D0Df_P_x.d.ts} +26 -13
  43. package/dist/{spark-wallet-yc2KhsVY.d.cts → spark-wallet-Dvh1BLP6.d.cts} +26 -13
  44. package/dist/{spark-wallet.node-D0Qw5Wb4.d.cts → spark-wallet.node-B3V8_fgw.d.cts} +1 -1
  45. package/dist/{spark-wallet.node-D4IovOHu.d.ts → spark-wallet.node-bGmy8-T8.d.ts} +1 -1
  46. package/dist/tests/test-utils.cjs +573 -66
  47. package/dist/tests/test-utils.d.cts +4 -4
  48. package/dist/tests/test-utils.d.ts +4 -4
  49. package/dist/tests/test-utils.js +5 -5
  50. package/dist/{token-transactions-CwhlOgIP.d.cts → token-transactions-D1ta-sHH.d.cts} +2 -2
  51. package/dist/{token-transactions-0nmR9mQO.d.ts → token-transactions-DINiKBzd.d.ts} +2 -2
  52. package/dist/types/index.cjs +492 -9
  53. package/dist/types/index.d.cts +2 -2
  54. package/dist/types/index.d.ts +2 -2
  55. package/dist/types/index.js +2 -2
  56. package/package.json +3 -3
  57. package/src/proto/common.ts +1 -1
  58. package/src/proto/google/protobuf/descriptor.ts +4 -10
  59. package/src/proto/google/protobuf/duration.ts +1 -1
  60. package/src/proto/google/protobuf/empty.ts +1 -1
  61. package/src/proto/google/protobuf/timestamp.ts +1 -1
  62. package/src/proto/mock.ts +1 -1
  63. package/src/proto/spark.ts +593 -3
  64. package/src/proto/spark_authn.ts +1 -1
  65. package/src/proto/spark_token.ts +1 -1
  66. package/src/proto/validate/validate.ts +27 -79
  67. package/src/services/deposit.ts +55 -3
  68. package/src/services/lightning.ts +2 -2
  69. package/src/services/signing.ts +1 -1
  70. package/src/services/token-transactions.ts +2 -5
  71. package/src/services/transfer.ts +2 -28
  72. package/src/signer/signer.ts +2 -2
  73. package/src/spark-wallet/proto-descriptors.ts +22 -0
  74. package/src/spark-wallet/proto-hash.ts +743 -0
  75. package/src/spark-wallet/proto-reflection.ts +193 -0
  76. package/src/spark-wallet/spark-wallet.ts +95 -57
  77. package/src/spark_descriptors.pb +0 -0
  78. package/src/tests/address.test.ts +10 -10
  79. package/src/tests/bitcoin.test.ts +2 -2
  80. package/src/tests/bufbuild-reflection.test.ts +151 -0
  81. package/src/tests/cross-language-hash.test.ts +79 -0
  82. package/src/tests/integration/address.test.ts +3 -12
  83. package/src/tests/integration/coop-exit.test.ts +1 -1
  84. package/src/tests/integration/lightning.test.ts +1 -1
  85. package/src/tests/integration/ssp/static_deposit.test.ts +128 -1
  86. package/src/tests/integration/static_deposit.test.ts +26 -0
  87. package/src/tests/integration/swap.test.ts +1 -1
  88. package/src/tests/integration/transfer.test.ts +1 -129
  89. package/src/tests/integration/wallet.test.ts +7 -7
  90. package/src/tests/integration/watchtower.test.ts +1 -1
  91. package/src/tests/token-hashing.test.ts +3 -6
  92. package/src/tests/token-outputs.test.ts +3 -3
  93. package/src/tests/utils/test-faucet.ts +2 -2
  94. package/src/types/sdk-types.ts +1 -1
  95. package/src/utils/adaptor-signature.ts +1 -1
  96. package/src/utils/address.ts +1 -1
  97. package/src/utils/bitcoin.ts +1 -5
  98. package/src/utils/keys.ts +1 -1
  99. package/src/utils/secret-sharing.ts +1 -1
  100. package/src/utils/token-transactions.ts +1 -2
  101. package/src/utils/transfer_package.ts +1 -1
  102. package/src/utils/unilateral-exit.ts +1 -1
@@ -1,6 +1,6 @@
1
- export { B as BitcoinNetwork, O as ClaimStaticDeposit, C as ClaimStaticDepositOutput, Q as ClaimStaticDepositStatus, R as CompleteCoopExitInput, X as CompleteLeavesSwapInput, Y as CoopExitFeeEstimate, Z as CoopExitFeeEstimatesInput, _ as CoopExitFeeEstimatesOutput, F as CoopExitFeeQuote, a0 as CoopExitFeeQuoteInput, G as CoopExitRequest, a2 as CurrencyAmount, a3 as CurrencyUnit, E as ExitSpeed, a4 as GetChallengeOutput, a5 as Invoice, a6 as Leaf, L as LeavesSwapFeeEstimateOutput, a8 as LeavesSwapRequest, x as LightningReceiveRequest, aa as LightningReceiveRequestStatus, z as LightningSendFeeEstimateInput, ab as LightningSendFeeEstimateOutput, y as LightningSendRequest, ad as LightningSendRequestStatus, P as PageInfo, ae as RequestCoopExitInput, af as RequestLeavesSwapInput, ag as RequestLightningReceiveInput, ah as RequestLightningSendInput, ai as SparkCoopExitRequestStatus, aj as SparkLeavesSwapRequestStatus, ak as SparkTransferToLeavesConnection, al as StaticDepositQuoteInput, u as StaticDepositQuoteOutput, am as SwapLeaf, an as Transfer, ar as TransferDirection, ao as UserLeafInput, as as UserRequestType, ap as VerifyChallengeOutput, W as WalletLeaf, w as WalletTransfer, at as WalletTransferLeaf, N as getClaimStaticDepositQuery, $ as getCoopExitFeeQuoteQuery, a1 as getCoopExitRequestQuery, a7 as getLeavesSwapRequestQuery, a9 as getLightningReceiveRequestQuery, ac as getLightningSendRequestQuery, au as mapTransferLeafToWalletTransferLeaf, av as mapTransferToWalletTransfer, aq as mapTreeNodeToWalletLeaf } from '../client-B9CAWKWz.cjs';
1
+ export { B as BitcoinNetwork, O as ClaimStaticDeposit, C as ClaimStaticDepositOutput, Q as ClaimStaticDepositStatus, R as CompleteCoopExitInput, X as CompleteLeavesSwapInput, Y as CoopExitFeeEstimate, Z as CoopExitFeeEstimatesInput, _ as CoopExitFeeEstimatesOutput, F as CoopExitFeeQuote, a0 as CoopExitFeeQuoteInput, G as CoopExitRequest, a2 as CurrencyAmount, a3 as CurrencyUnit, E as ExitSpeed, a4 as GetChallengeOutput, a5 as Invoice, a6 as Leaf, L as LeavesSwapFeeEstimateOutput, a8 as LeavesSwapRequest, x as LightningReceiveRequest, aa as LightningReceiveRequestStatus, z as LightningSendFeeEstimateInput, ab as LightningSendFeeEstimateOutput, y as LightningSendRequest, ad as LightningSendRequestStatus, P as PageInfo, ae as RequestCoopExitInput, af as RequestLeavesSwapInput, ag as RequestLightningReceiveInput, ah as RequestLightningSendInput, ai as SparkCoopExitRequestStatus, aj as SparkLeavesSwapRequestStatus, ak as SparkTransferToLeavesConnection, al as StaticDepositQuoteInput, u as StaticDepositQuoteOutput, am as SwapLeaf, an as Transfer, ar as TransferDirection, ao as UserLeafInput, as as UserRequestType, ap as VerifyChallengeOutput, W as WalletLeaf, w as WalletTransfer, at as WalletTransferLeaf, N as getClaimStaticDepositQuery, $ as getCoopExitFeeQuoteQuery, a1 as getCoopExitRequestQuery, a7 as getLeavesSwapRequestQuery, a9 as getLightningReceiveRequestQuery, ac as getLightningSendRequestQuery, au as mapTransferLeafToWalletTransferLeaf, av as mapTransferToWalletTransfer, aq as mapTreeNodeToWalletLeaf } from '../client-DVuA5-7M.cjs';
2
2
  export { ClaimStaticDepositInput, ClaimStaticDepositRequestType, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getUserRequestQuery } from '../graphql/objects/index.cjs';
3
- export { j as CommonProto, s as SparkProto } from '../spark-CtGJPkx4.cjs';
3
+ export { j as CommonProto, s as SparkProto } from '../spark-C7OG9mGJ.cjs';
4
4
  import '@lightsparkdev/core';
5
5
  import '@scure/btc-signer';
6
6
  import '@scure/bip32';
@@ -1,6 +1,6 @@
1
- export { B as BitcoinNetwork, O as ClaimStaticDeposit, C as ClaimStaticDepositOutput, Q as ClaimStaticDepositStatus, R as CompleteCoopExitInput, X as CompleteLeavesSwapInput, Y as CoopExitFeeEstimate, Z as CoopExitFeeEstimatesInput, _ as CoopExitFeeEstimatesOutput, F as CoopExitFeeQuote, a0 as CoopExitFeeQuoteInput, G as CoopExitRequest, a2 as CurrencyAmount, a3 as CurrencyUnit, E as ExitSpeed, a4 as GetChallengeOutput, a5 as Invoice, a6 as Leaf, L as LeavesSwapFeeEstimateOutput, a8 as LeavesSwapRequest, x as LightningReceiveRequest, aa as LightningReceiveRequestStatus, z as LightningSendFeeEstimateInput, ab as LightningSendFeeEstimateOutput, y as LightningSendRequest, ad as LightningSendRequestStatus, P as PageInfo, ae as RequestCoopExitInput, af as RequestLeavesSwapInput, ag as RequestLightningReceiveInput, ah as RequestLightningSendInput, ai as SparkCoopExitRequestStatus, aj as SparkLeavesSwapRequestStatus, ak as SparkTransferToLeavesConnection, al as StaticDepositQuoteInput, u as StaticDepositQuoteOutput, am as SwapLeaf, an as Transfer, ar as TransferDirection, ao as UserLeafInput, as as UserRequestType, ap as VerifyChallengeOutput, W as WalletLeaf, w as WalletTransfer, at as WalletTransferLeaf, N as getClaimStaticDepositQuery, $ as getCoopExitFeeQuoteQuery, a1 as getCoopExitRequestQuery, a7 as getLeavesSwapRequestQuery, a9 as getLightningReceiveRequestQuery, ac as getLightningSendRequestQuery, au as mapTransferLeafToWalletTransferLeaf, av as mapTransferToWalletTransfer, aq as mapTreeNodeToWalletLeaf } from '../client-Dd3QnxQu.js';
1
+ export { B as BitcoinNetwork, O as ClaimStaticDeposit, C as ClaimStaticDepositOutput, Q as ClaimStaticDepositStatus, R as CompleteCoopExitInput, X as CompleteLeavesSwapInput, Y as CoopExitFeeEstimate, Z as CoopExitFeeEstimatesInput, _ as CoopExitFeeEstimatesOutput, F as CoopExitFeeQuote, a0 as CoopExitFeeQuoteInput, G as CoopExitRequest, a2 as CurrencyAmount, a3 as CurrencyUnit, E as ExitSpeed, a4 as GetChallengeOutput, a5 as Invoice, a6 as Leaf, L as LeavesSwapFeeEstimateOutput, a8 as LeavesSwapRequest, x as LightningReceiveRequest, aa as LightningReceiveRequestStatus, z as LightningSendFeeEstimateInput, ab as LightningSendFeeEstimateOutput, y as LightningSendRequest, ad as LightningSendRequestStatus, P as PageInfo, ae as RequestCoopExitInput, af as RequestLeavesSwapInput, ag as RequestLightningReceiveInput, ah as RequestLightningSendInput, ai as SparkCoopExitRequestStatus, aj as SparkLeavesSwapRequestStatus, ak as SparkTransferToLeavesConnection, al as StaticDepositQuoteInput, u as StaticDepositQuoteOutput, am as SwapLeaf, an as Transfer, ar as TransferDirection, ao as UserLeafInput, as as UserRequestType, ap as VerifyChallengeOutput, W as WalletLeaf, w as WalletTransfer, at as WalletTransferLeaf, N as getClaimStaticDepositQuery, $ as getCoopExitFeeQuoteQuery, a1 as getCoopExitRequestQuery, a7 as getLeavesSwapRequestQuery, a9 as getLightningReceiveRequestQuery, ac as getLightningSendRequestQuery, au as mapTransferLeafToWalletTransferLeaf, av as mapTransferToWalletTransfer, aq as mapTreeNodeToWalletLeaf } from '../client-D7KDa4Ih.js';
2
2
  export { ClaimStaticDepositInput, ClaimStaticDepositRequestType, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getUserRequestQuery } from '../graphql/objects/index.js';
3
- export { j as CommonProto, s as SparkProto } from '../spark-CtGJPkx4.js';
3
+ export { j as CommonProto, s as SparkProto } from '../spark-C7OG9mGJ.js';
4
4
  import '@lightsparkdev/core';
5
5
  import '@scure/btc-signer';
6
6
  import '@scure/bip32';
@@ -3,11 +3,11 @@ import {
3
3
  mapTransferLeafToWalletTransferLeaf,
4
4
  mapTransferToWalletTransfer,
5
5
  mapTreeNodeToWalletLeaf
6
- } from "../chunk-76SYPHOC.js";
6
+ } from "../chunk-TB7DG5CU.js";
7
7
  import {
8
8
  common_exports,
9
9
  spark_exports
10
- } from "../chunk-A5M55UR3.js";
10
+ } from "../chunk-5VWGOHED.js";
11
11
  import {
12
12
  BitcoinNetwork_default,
13
13
  ClaimStaticDepositRequestType_default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildonspark/spark-sdk",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "author": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -110,7 +110,7 @@
110
110
  "types:watch": "tsc-absolute --watch",
111
111
  "types": "tsc",
112
112
  "patch-wasm": "node ./wasm/patch-wasm.mjs",
113
- "generate:proto": "PATH=\"$PATH:./node_modules/.bin\" protoc --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,useExactTypes=false,outputServices=generic-definitions,oneof=unions,importSuffix=.js --proto_path=../../../../protos spark.proto spark_token.proto mock.proto spark_authn.proto && yarn format:fix"
113
+ "generate:proto": "./generate-proto.sh"
114
114
  },
115
115
  "devDependencies": {
116
116
  "@arethetypeswrong/cli": "^0.17.4",
@@ -133,7 +133,7 @@
133
133
  "dependencies": {
134
134
  "@bitcoinerlab/secp256k1": "^1.1.1",
135
135
  "@bufbuild/protobuf": "^2.2.5",
136
- "@lightsparkdev/core": "^1.4.3",
136
+ "@lightsparkdev/core": "^1.4.4",
137
137
  "@noble/curves": "^1.8.0",
138
138
  "@noble/hashes": "^1.7.0",
139
139
  "@opentelemetry/api": "^1.9.0",
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: common.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: google/protobuf/descriptor.proto
6
6
 
@@ -2141,16 +2141,12 @@ export const FileDescriptorProto: MessageFns<FileDescriptorProto> = {
2141
2141
  for (const v of message.dependency) {
2142
2142
  writer.uint32(26).string(v!);
2143
2143
  }
2144
- writer.uint32(82).fork();
2145
2144
  for (const v of message.publicDependency) {
2146
- writer.int32(v);
2145
+ writer.uint32(80).int32(v!);
2147
2146
  }
2148
- writer.join();
2149
- writer.uint32(90).fork();
2150
2147
  for (const v of message.weakDependency) {
2151
- writer.int32(v);
2148
+ writer.uint32(88).int32(v!);
2152
2149
  }
2153
- writer.join();
2154
2150
  for (const v of message.messageType) {
2155
2151
  DescriptorProto.encode(v!, writer.uint32(34).fork()).join();
2156
2152
  }
@@ -4557,11 +4553,9 @@ export const FieldOptions: MessageFns<FieldOptions> = {
4557
4553
  if (message.retention !== undefined && message.retention !== 0) {
4558
4554
  writer.uint32(136).int32(message.retention);
4559
4555
  }
4560
- writer.uint32(154).fork();
4561
4556
  for (const v of message.targets) {
4562
- writer.int32(v);
4557
+ writer.uint32(152).int32(v!);
4563
4558
  }
4564
- writer.join();
4565
4559
  for (const v of message.editionDefaults) {
4566
4560
  FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).join();
4567
4561
  }
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: google/protobuf/duration.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: google/protobuf/empty.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
package/src/proto/mock.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.7.5
3
+ // protoc-gen-ts_proto v2.7.7
4
4
  // protoc v5.29.3
5
5
  // source: mock.proto
6
6