@buildonspark/spark-sdk 0.1.43 → 0.1.44

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 (112) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-BxbCtwpV.d.cts} +43 -4
  3. package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-RGel43ks.d.ts} +43 -4
  4. package/dist/address/index.d.cts +2 -2
  5. package/dist/address/index.d.ts +2 -2
  6. package/dist/address/index.js +2 -2
  7. package/dist/{chunk-M6A4KFIG.js → chunk-4Q2ZDYYU.js} +332 -221
  8. package/dist/{chunk-WWOTVNPP.js → chunk-A2ZLMH6I.js} +323 -142
  9. package/dist/{chunk-VA7MV4MZ.js → chunk-B3AMIGJG.js} +1 -1
  10. package/dist/{chunk-DQYKQJRZ.js → chunk-CIZNCBKE.js} +29 -9
  11. package/dist/{chunk-BUTZWYBW.js → chunk-DAXGVPVM.js} +2 -2
  12. package/dist/{chunk-DOA6QXYQ.js → chunk-EKFD62HN.js} +2 -1
  13. package/dist/{chunk-TIUBYNN5.js → chunk-HTMXTJRK.js} +1 -1
  14. package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
  15. package/dist/{chunk-MIVX3GHD.js → chunk-K4BJARWM.js} +1 -1
  16. package/dist/{chunk-O4RYNJNB.js → chunk-KEKGSH7B.js} +1 -1
  17. package/dist/{chunk-GYQR4B4P.js → chunk-NBCNYDWJ.js} +2 -2
  18. package/dist/{chunk-ABZA6R5S.js → chunk-SQKXGAIR.js} +1 -1
  19. package/dist/{chunk-VFJQNBFX.js → chunk-UBT6EDVJ.js} +5 -2
  20. package/dist/{chunk-HRQRRDSS.js → chunk-WPTRVD2V.js} +3 -3
  21. package/dist/{chunk-IRW5TWMH.js → chunk-XX4RRWOX.js} +5 -5
  22. package/dist/graphql/objects/index.d.cts +5 -43
  23. package/dist/graphql/objects/index.d.ts +5 -43
  24. package/dist/graphql/objects/index.js +1 -1
  25. package/dist/{index-BJOc8Ur-.d.cts → index-CZmDdSts.d.cts} +24 -10
  26. package/dist/{index-7RYRH5wc.d.ts → index-ClIRO_3y.d.ts} +24 -10
  27. package/dist/index.cjs +827 -414
  28. package/dist/index.d.cts +6 -6
  29. package/dist/index.d.ts +6 -6
  30. package/dist/index.js +15 -15
  31. package/dist/index.node.cjs +830 -417
  32. package/dist/index.node.d.cts +7 -7
  33. package/dist/index.node.d.ts +7 -7
  34. package/dist/index.node.js +18 -18
  35. package/dist/native/index.cjs +827 -414
  36. package/dist/native/index.d.cts +88 -23
  37. package/dist/native/index.d.ts +88 -23
  38. package/dist/native/index.js +819 -407
  39. package/dist/{network-D5lKssVl.d.cts → network-CfxLnaot.d.cts} +1 -1
  40. package/dist/{network-xkBSpaTn.d.ts → network-CroCOQ0B.d.ts} +1 -1
  41. package/dist/proto/lrc20.d.cts +1 -1
  42. package/dist/proto/lrc20.d.ts +1 -1
  43. package/dist/proto/lrc20.js +2 -2
  44. package/dist/proto/spark.cjs +332 -221
  45. package/dist/proto/spark.d.cts +1 -1
  46. package/dist/proto/spark.d.ts +1 -1
  47. package/dist/proto/spark.js +3 -5
  48. package/dist/proto/spark_token.cjs +149 -9
  49. package/dist/proto/spark_token.d.cts +1 -1
  50. package/dist/proto/spark_token.d.ts +1 -1
  51. package/dist/proto/spark_token.js +2 -2
  52. package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-BeCBoozO.d.cts} +1 -1
  53. package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-CTbTdDbE.d.ts} +1 -1
  54. package/dist/services/config.cjs +7 -3
  55. package/dist/services/config.d.cts +4 -4
  56. package/dist/services/config.d.ts +4 -4
  57. package/dist/services/config.js +5 -5
  58. package/dist/services/connection.cjs +334 -218
  59. package/dist/services/connection.d.cts +4 -4
  60. package/dist/services/connection.d.ts +4 -4
  61. package/dist/services/connection.js +4 -4
  62. package/dist/services/index.cjs +364 -227
  63. package/dist/services/index.d.cts +4 -4
  64. package/dist/services/index.d.ts +4 -4
  65. package/dist/services/index.js +9 -9
  66. package/dist/services/lrc-connection.cjs +5 -2
  67. package/dist/services/lrc-connection.d.cts +4 -4
  68. package/dist/services/lrc-connection.d.ts +4 -4
  69. package/dist/services/lrc-connection.js +4 -4
  70. package/dist/services/token-transactions.cjs +28 -8
  71. package/dist/services/token-transactions.d.cts +4 -4
  72. package/dist/services/token-transactions.d.ts +4 -4
  73. package/dist/services/token-transactions.js +3 -3
  74. package/dist/services/wallet-config.cjs +2 -1
  75. package/dist/services/wallet-config.d.cts +4 -4
  76. package/dist/services/wallet-config.d.ts +4 -4
  77. package/dist/services/wallet-config.js +1 -1
  78. package/dist/signer/signer.cjs +5 -2
  79. package/dist/signer/signer.d.cts +2 -2
  80. package/dist/signer/signer.d.ts +2 -2
  81. package/dist/signer/signer.js +2 -2
  82. package/dist/{signer-wqesWifN.d.ts → signer-D7vfYik9.d.ts} +1 -1
  83. package/dist/{signer-IO3oMRNj.d.cts → signer-DaY8c60s.d.cts} +1 -1
  84. package/dist/{spark-CDm4gqS6.d.ts → spark-C4ZrsgjC.d.cts} +47 -29
  85. package/dist/{spark-CDm4gqS6.d.cts → spark-C4ZrsgjC.d.ts} +47 -29
  86. package/dist/types/index.cjs +331 -219
  87. package/dist/types/index.d.cts +5 -5
  88. package/dist/types/index.d.ts +5 -5
  89. package/dist/types/index.js +3 -3
  90. package/dist/utils/index.cjs +298 -28
  91. package/dist/utils/index.d.cts +5 -5
  92. package/dist/utils/index.d.ts +5 -5
  93. package/dist/utils/index.js +6 -6
  94. package/package.json +1 -1
  95. package/src/constants.ts +5 -1
  96. package/src/graphql/client.ts +28 -0
  97. package/src/graphql/mutations/RequestCoopExit.ts +6 -0
  98. package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
  99. package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
  100. package/src/proto/spark.ts +454 -322
  101. package/src/services/token-transactions.ts +12 -0
  102. package/src/services/transfer.ts +0 -3
  103. package/src/services/wallet-config.ts +1 -0
  104. package/src/spark-wallet/spark-wallet.node.ts +3 -3
  105. package/src/spark-wallet/spark-wallet.ts +301 -125
  106. package/src/tests/integration/deposit.test.ts +16 -0
  107. package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
  108. package/src/tests/integration/ssp/swap.test.ts +47 -0
  109. package/src/tests/tokens.test.ts +3 -2
  110. package/src/utils/token-hashing.ts +28 -10
  111. package/src/utils/transaction.ts +2 -2
  112. package/src/logger.ts +0 -3
@@ -1,11 +1,11 @@
1
1
  export { B as BitcoinNetwork } from '../BitcoinNetwork-TnABML0T.cjs';
2
- export { ClaimStaticDeposit, ClaimStaticDepositInput, ClaimStaticDepositRequestType, ClaimStaticDepositStatus, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuote, CoopExitFeeQuoteInput, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getClaimStaticDepositQuery, getCoopExitFeeQuoteQuery, getUserRequestQuery } from '../graphql/objects/index.cjs';
3
- export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, h as CurrencyAmount, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, P as PageInfo, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../RequestLightningSendInput-Na1mHdWg.cjs';
2
+ export { ClaimStaticDeposit, ClaimStaticDepositInput, ClaimStaticDepositRequestType, ClaimStaticDepositStatus, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getClaimStaticDepositQuery, getUserRequestQuery } from '../graphql/objects/index.cjs';
3
+ export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitFeeQuote, h as CoopExitFeeQuoteInput, i as CoopExitRequest, k as CurrencyAmount, l as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, m as LeavesSwapFeeEstimateOutput, o as LeavesSwapRequest, q as LightningReceiveRequest, r as LightningReceiveRequestStatus, s as LightningSendFeeEstimateOutput, u as LightningSendRequest, v as LightningSendRequestStatus, P as PageInfo, R as RequestCoopExitInput, w as RequestLeavesSwapInput, x as RequestLightningReceiveInput, y as RequestLightningSendInput, S as SparkCoopExitRequestStatus, z as SparkLeavesSwapRequestStatus, A as SparkTransferToLeavesConnection, B as StaticDepositQuoteInput, D as StaticDepositQuoteOutput, F as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitFeeQuoteQuery, j as getCoopExitRequestQuery, n as getLeavesSwapRequestQuery, p as getLightningReceiveRequestQuery, t as getLightningSendRequestQuery } from '../RequestLightningSendInput-BxbCtwpV.cjs';
4
4
  export { L as LightningSendFeeEstimateInput } from '../LightningSendFeeEstimateInput-BgOhEAI-.cjs';
5
- export { c as CommonProto, s as SparkProto } from '../spark-CDm4gqS6.cjs';
6
- export { T as TransferDirection, W as WalletLeaf, a as WalletTransfer, b as WalletTransferLeaf, c as mapTransferLeafToWalletTransferLeaf, d as mapTransferToWalletTransfer, m as mapTreeNodeToWalletLeaf } from '../sdk-types-B-q9py_P.cjs';
5
+ export { c as CommonProto, s as SparkProto } from '../spark-C4ZrsgjC.cjs';
6
+ export { T as TransferDirection, W as WalletLeaf, a as WalletTransfer, b as WalletTransferLeaf, c as mapTransferLeafToWalletTransferLeaf, d as mapTransferToWalletTransfer, m as mapTreeNodeToWalletLeaf } from '../sdk-types-BeCBoozO.cjs';
7
7
  import '@lightsparkdev/core';
8
- import '../signer-IO3oMRNj.cjs';
8
+ import '../signer-DaY8c60s.cjs';
9
9
  import '@scure/bip32';
10
10
  import '@buildonspark/lrc20-sdk';
11
11
  import '@scure/btc-signer';
@@ -1,11 +1,11 @@
1
1
  export { B as BitcoinNetwork } from '../BitcoinNetwork-TnABML0T.js';
2
- export { ClaimStaticDeposit, ClaimStaticDepositInput, ClaimStaticDepositRequestType, ClaimStaticDepositStatus, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuote, CoopExitFeeQuoteInput, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getClaimStaticDepositQuery, getCoopExitFeeQuoteQuery, getUserRequestQuery } from '../graphql/objects/index.js';
3
- export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitRequest, h as CurrencyAmount, i as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, j as LeavesSwapFeeEstimateOutput, l as LeavesSwapRequest, n as LightningReceiveRequest, o as LightningReceiveRequestStatus, p as LightningSendFeeEstimateOutput, r as LightningSendRequest, s as LightningSendRequestStatus, P as PageInfo, R as RequestCoopExitInput, t as RequestLeavesSwapInput, u as RequestLightningReceiveInput, v as RequestLightningSendInput, S as SparkCoopExitRequestStatus, w as SparkLeavesSwapRequestStatus, x as SparkTransferToLeavesConnection, y as StaticDepositQuoteInput, z as StaticDepositQuoteOutput, A as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitRequestQuery, k as getLeavesSwapRequestQuery, m as getLightningReceiveRequestQuery, q as getLightningSendRequestQuery } from '../RequestLightningSendInput-D7fZdT4A.js';
2
+ export { ClaimStaticDeposit, ClaimStaticDepositInput, ClaimStaticDepositRequestType, ClaimStaticDepositStatus, CompleteCoopExitOutput, CompleteLeavesSwapOutput, CompleteSeedReleaseInput, CompleteSeedReleaseOutput, Connection, CoopExitFeeQuoteOutput, Entity, GetChallengeInput, LeavesSwapFeeEstimateInput, NotifyReceiverTransferInput, Provider, RequestCoopExitOutput, RequestLeavesSwapOutput, RequestLightningReceiveOutput, RequestLightningSendOutput, SparkUserRequestStatus, SparkUserRequestType, SparkWalletUser, SparkWalletUserToUserRequestsConnection, StartSeedReleaseInput, UserRequest, VerifyChallengeInput, WalletUserIdentityPublicKeyInput, WalletUserIdentityPublicKeyOutput, getClaimStaticDepositQuery, getUserRequestQuery } from '../graphql/objects/index.js';
3
+ export { C as ClaimStaticDepositOutput, a as CompleteCoopExitInput, b as CompleteLeavesSwapInput, c as CoopExitFeeEstimate, d as CoopExitFeeEstimatesInput, e as CoopExitFeeEstimatesOutput, f as CoopExitFeeQuote, h as CoopExitFeeQuoteInput, i as CoopExitRequest, k as CurrencyAmount, l as CurrencyUnit, E as ExitSpeed, G as GetChallengeOutput, I as Invoice, L as Leaf, m as LeavesSwapFeeEstimateOutput, o as LeavesSwapRequest, q as LightningReceiveRequest, r as LightningReceiveRequestStatus, s as LightningSendFeeEstimateOutput, u as LightningSendRequest, v as LightningSendRequestStatus, P as PageInfo, R as RequestCoopExitInput, w as RequestLeavesSwapInput, x as RequestLightningReceiveInput, y as RequestLightningSendInput, S as SparkCoopExitRequestStatus, z as SparkLeavesSwapRequestStatus, A as SparkTransferToLeavesConnection, B as StaticDepositQuoteInput, D as StaticDepositQuoteOutput, F as SwapLeaf, T as Transfer, U as UserLeafInput, V as VerifyChallengeOutput, g as getCoopExitFeeQuoteQuery, j as getCoopExitRequestQuery, n as getLeavesSwapRequestQuery, p as getLightningReceiveRequestQuery, t as getLightningSendRequestQuery } from '../RequestLightningSendInput-RGel43ks.js';
4
4
  export { L as LightningSendFeeEstimateInput } from '../LightningSendFeeEstimateInput-BgOhEAI-.js';
5
- export { c as CommonProto, s as SparkProto } from '../spark-CDm4gqS6.js';
6
- export { T as TransferDirection, W as WalletLeaf, a as WalletTransfer, b as WalletTransferLeaf, c as mapTransferLeafToWalletTransferLeaf, d as mapTransferToWalletTransfer, m as mapTreeNodeToWalletLeaf } from '../sdk-types-BPoPgzda.js';
5
+ export { c as CommonProto, s as SparkProto } from '../spark-C4ZrsgjC.js';
6
+ export { T as TransferDirection, W as WalletLeaf, a as WalletTransfer, b as WalletTransferLeaf, c as mapTransferLeafToWalletTransferLeaf, d as mapTransferToWalletTransfer, m as mapTreeNodeToWalletLeaf } from '../sdk-types-CTbTdDbE.js';
7
7
  import '@lightsparkdev/core';
8
- import '../signer-wqesWifN.js';
8
+ import '../signer-D7vfYik9.js';
9
9
  import '@scure/bip32';
10
10
  import '@buildonspark/lrc20-sdk';
11
11
  import '@scure/btc-signer';
@@ -3,7 +3,7 @@ import {
3
3
  mapTransferLeafToWalletTransferLeaf,
4
4
  mapTransferToWalletTransfer,
5
5
  mapTreeNodeToWalletLeaf
6
- } from "../chunk-MIVX3GHD.js";
6
+ } from "../chunk-K4BJARWM.js";
7
7
  import {
8
8
  ClaimStaticDepositRequestType_default,
9
9
  ClaimStaticDepositStatus_default,
@@ -23,14 +23,14 @@ import {
23
23
  getLightningReceiveRequestQuery,
24
24
  getLightningSendRequestQuery,
25
25
  getUserRequestQuery
26
- } from "../chunk-TOSP3INR.js";
26
+ } from "../chunk-I54FARY2.js";
27
27
  import {
28
28
  BitcoinNetwork_default
29
29
  } from "../chunk-HMLOC6TE.js";
30
30
  import {
31
31
  common_exports,
32
32
  spark_exports
33
- } from "../chunk-M6A4KFIG.js";
33
+ } from "../chunk-4Q2ZDYYU.js";
34
34
  import "../chunk-MVRQ5US7.js";
35
35
  export {
36
36
  BitcoinNetwork_default as BitcoinNetwork,
@@ -342,6 +342,87 @@ var import_wire2 = require("@bufbuild/protobuf/wire");
342
342
 
343
343
  // src/proto/google/protobuf/timestamp.ts
344
344
  var import_wire3 = require("@bufbuild/protobuf/wire");
345
+ function createBaseTimestamp() {
346
+ return { seconds: 0, nanos: 0 };
347
+ }
348
+ var Timestamp = {
349
+ encode(message, writer = new import_wire3.BinaryWriter()) {
350
+ if (message.seconds !== 0) {
351
+ writer.uint32(8).int64(message.seconds);
352
+ }
353
+ if (message.nanos !== 0) {
354
+ writer.uint32(16).int32(message.nanos);
355
+ }
356
+ return writer;
357
+ },
358
+ decode(input, length) {
359
+ const reader = input instanceof import_wire3.BinaryReader ? input : new import_wire3.BinaryReader(input);
360
+ let end = length === void 0 ? reader.len : reader.pos + length;
361
+ const message = createBaseTimestamp();
362
+ while (reader.pos < end) {
363
+ const tag = reader.uint32();
364
+ switch (tag >>> 3) {
365
+ case 1: {
366
+ if (tag !== 8) {
367
+ break;
368
+ }
369
+ message.seconds = longToNumber(reader.int64());
370
+ continue;
371
+ }
372
+ case 2: {
373
+ if (tag !== 16) {
374
+ break;
375
+ }
376
+ message.nanos = reader.int32();
377
+ continue;
378
+ }
379
+ }
380
+ if ((tag & 7) === 4 || tag === 0) {
381
+ break;
382
+ }
383
+ reader.skip(tag & 7);
384
+ }
385
+ return message;
386
+ },
387
+ fromJSON(object) {
388
+ return {
389
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
390
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0
391
+ };
392
+ },
393
+ toJSON(message) {
394
+ const obj = {};
395
+ if (message.seconds !== 0) {
396
+ obj.seconds = Math.round(message.seconds);
397
+ }
398
+ if (message.nanos !== 0) {
399
+ obj.nanos = Math.round(message.nanos);
400
+ }
401
+ return obj;
402
+ },
403
+ create(base) {
404
+ return Timestamp.fromPartial(base ?? {});
405
+ },
406
+ fromPartial(object) {
407
+ const message = createBaseTimestamp();
408
+ message.seconds = object.seconds ?? 0;
409
+ message.nanos = object.nanos ?? 0;
410
+ return message;
411
+ }
412
+ };
413
+ function longToNumber(int64) {
414
+ const num = globalThis.Number(int64.toString());
415
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
416
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
417
+ }
418
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
419
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
420
+ }
421
+ return num;
422
+ }
423
+ function isSet(value) {
424
+ return value !== null && value !== void 0;
425
+ }
345
426
 
346
427
  // src/proto/spark.ts
347
428
  function networkFromJSON(object) {
@@ -385,7 +466,7 @@ function networkToJSON(object) {
385
466
  }
386
467
  }
387
468
  function createBaseSigningKeyshare() {
388
- return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0) };
469
+ return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0), publicShares: {}, updatedTime: void 0 };
389
470
  }
390
471
  var SigningKeyshare = {
391
472
  encode(message, writer = new import_wire4.BinaryWriter()) {
@@ -398,6 +479,12 @@ var SigningKeyshare = {
398
479
  if (message.publicKey.length !== 0) {
399
480
  writer.uint32(26).bytes(message.publicKey);
400
481
  }
482
+ Object.entries(message.publicShares).forEach(([key, value]) => {
483
+ SigningKeyshare_PublicSharesEntry.encode({ key, value }, writer.uint32(34).fork()).join();
484
+ });
485
+ if (message.updatedTime !== void 0) {
486
+ Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(42).fork()).join();
487
+ }
401
488
  return writer;
402
489
  },
403
490
  decode(input, length) {
@@ -428,6 +515,23 @@ var SigningKeyshare = {
428
515
  message.publicKey = reader.bytes();
429
516
  continue;
430
517
  }
518
+ case 4: {
519
+ if (tag !== 34) {
520
+ break;
521
+ }
522
+ const entry4 = SigningKeyshare_PublicSharesEntry.decode(reader, reader.uint32());
523
+ if (entry4.value !== void 0) {
524
+ message.publicShares[entry4.key] = entry4.value;
525
+ }
526
+ continue;
527
+ }
528
+ case 5: {
529
+ if (tag !== 42) {
530
+ break;
531
+ }
532
+ message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
533
+ continue;
534
+ }
431
535
  }
432
536
  if ((tag & 7) === 4 || tag === 0) {
433
537
  break;
@@ -439,8 +543,13 @@ var SigningKeyshare = {
439
543
  fromJSON(object) {
440
544
  return {
441
545
  ownerIdentifiers: globalThis.Array.isArray(object?.ownerIdentifiers) ? object.ownerIdentifiers.map((e) => globalThis.String(e)) : [],
442
- threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
443
- publicKey: isSet(object.publicKey) ? bytesFromBase64(object.publicKey) : new Uint8Array(0)
546
+ threshold: isSet2(object.threshold) ? globalThis.Number(object.threshold) : 0,
547
+ publicKey: isSet2(object.publicKey) ? bytesFromBase64(object.publicKey) : new Uint8Array(0),
548
+ publicShares: isObject(object.publicShares) ? Object.entries(object.publicShares).reduce((acc, [key, value]) => {
549
+ acc[key] = bytesFromBase64(value);
550
+ return acc;
551
+ }, {}) : {},
552
+ updatedTime: isSet2(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : void 0
444
553
  };
445
554
  },
446
555
  toJSON(message) {
@@ -454,6 +563,18 @@ var SigningKeyshare = {
454
563
  if (message.publicKey.length !== 0) {
455
564
  obj.publicKey = base64FromBytes(message.publicKey);
456
565
  }
566
+ if (message.publicShares) {
567
+ const entries = Object.entries(message.publicShares);
568
+ if (entries.length > 0) {
569
+ obj.publicShares = {};
570
+ entries.forEach(([k, v]) => {
571
+ obj.publicShares[k] = base64FromBytes(v);
572
+ });
573
+ }
574
+ }
575
+ if (message.updatedTime !== void 0) {
576
+ obj.updatedTime = message.updatedTime.toISOString();
577
+ }
457
578
  return obj;
458
579
  },
459
580
  create(base) {
@@ -464,6 +585,84 @@ var SigningKeyshare = {
464
585
  message.ownerIdentifiers = object.ownerIdentifiers?.map((e) => e) || [];
465
586
  message.threshold = object.threshold ?? 0;
466
587
  message.publicKey = object.publicKey ?? new Uint8Array(0);
588
+ message.publicShares = Object.entries(object.publicShares ?? {}).reduce(
589
+ (acc, [key, value]) => {
590
+ if (value !== void 0) {
591
+ acc[key] = value;
592
+ }
593
+ return acc;
594
+ },
595
+ {}
596
+ );
597
+ message.updatedTime = object.updatedTime ?? void 0;
598
+ return message;
599
+ }
600
+ };
601
+ function createBaseSigningKeyshare_PublicSharesEntry() {
602
+ return { key: "", value: new Uint8Array(0) };
603
+ }
604
+ var SigningKeyshare_PublicSharesEntry = {
605
+ encode(message, writer = new import_wire4.BinaryWriter()) {
606
+ if (message.key !== "") {
607
+ writer.uint32(10).string(message.key);
608
+ }
609
+ if (message.value.length !== 0) {
610
+ writer.uint32(18).bytes(message.value);
611
+ }
612
+ return writer;
613
+ },
614
+ decode(input, length) {
615
+ const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
616
+ let end = length === void 0 ? reader.len : reader.pos + length;
617
+ const message = createBaseSigningKeyshare_PublicSharesEntry();
618
+ while (reader.pos < end) {
619
+ const tag = reader.uint32();
620
+ switch (tag >>> 3) {
621
+ case 1: {
622
+ if (tag !== 10) {
623
+ break;
624
+ }
625
+ message.key = reader.string();
626
+ continue;
627
+ }
628
+ case 2: {
629
+ if (tag !== 18) {
630
+ break;
631
+ }
632
+ message.value = reader.bytes();
633
+ continue;
634
+ }
635
+ }
636
+ if ((tag & 7) === 4 || tag === 0) {
637
+ break;
638
+ }
639
+ reader.skip(tag & 7);
640
+ }
641
+ return message;
642
+ },
643
+ fromJSON(object) {
644
+ return {
645
+ key: isSet2(object.key) ? globalThis.String(object.key) : "",
646
+ value: isSet2(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0)
647
+ };
648
+ },
649
+ toJSON(message) {
650
+ const obj = {};
651
+ if (message.key !== "") {
652
+ obj.key = message.key;
653
+ }
654
+ if (message.value.length !== 0) {
655
+ obj.value = base64FromBytes(message.value);
656
+ }
657
+ return obj;
658
+ },
659
+ create(base) {
660
+ return SigningKeyshare_PublicSharesEntry.fromPartial(base ?? {});
661
+ },
662
+ fromPartial(object) {
663
+ const message = createBaseSigningKeyshare_PublicSharesEntry();
664
+ message.key = object.key ?? "";
665
+ message.value = object.value ?? new Uint8Array(0);
467
666
  return message;
468
667
  }
469
668
  };
@@ -480,7 +679,10 @@ function createBaseTreeNode() {
480
679
  ownerIdentityPublicKey: new Uint8Array(0),
481
680
  signingKeyshare: void 0,
482
681
  status: "",
483
- network: 0
682
+ network: 0,
683
+ createdTime: void 0,
684
+ updatedTime: void 0,
685
+ ownerSigningPublicKey: new Uint8Array(0)
484
686
  };
485
687
  }
486
688
  var TreeNode = {
@@ -521,6 +723,15 @@ var TreeNode = {
521
723
  if (message.network !== 0) {
522
724
  writer.uint32(96).int32(message.network);
523
725
  }
726
+ if (message.createdTime !== void 0) {
727
+ Timestamp.encode(toTimestamp(message.createdTime), writer.uint32(106).fork()).join();
728
+ }
729
+ if (message.updatedTime !== void 0) {
730
+ Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(114).fork()).join();
731
+ }
732
+ if (message.ownerSigningPublicKey.length !== 0) {
733
+ writer.uint32(122).bytes(message.ownerSigningPublicKey);
734
+ }
524
735
  return writer;
525
736
  },
526
737
  decode(input, length) {
@@ -548,7 +759,7 @@ var TreeNode = {
548
759
  if (tag !== 24) {
549
760
  break;
550
761
  }
551
- message.value = longToNumber(reader.uint64());
762
+ message.value = longToNumber2(reader.uint64());
552
763
  continue;
553
764
  }
554
765
  case 4: {
@@ -614,6 +825,27 @@ var TreeNode = {
614
825
  message.network = reader.int32();
615
826
  continue;
616
827
  }
828
+ case 13: {
829
+ if (tag !== 106) {
830
+ break;
831
+ }
832
+ message.createdTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
833
+ continue;
834
+ }
835
+ case 14: {
836
+ if (tag !== 114) {
837
+ break;
838
+ }
839
+ message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
840
+ continue;
841
+ }
842
+ case 15: {
843
+ if (tag !== 122) {
844
+ break;
845
+ }
846
+ message.ownerSigningPublicKey = reader.bytes();
847
+ continue;
848
+ }
617
849
  }
618
850
  if ((tag & 7) === 4 || tag === 0) {
619
851
  break;
@@ -624,18 +856,21 @@ var TreeNode = {
624
856
  },
625
857
  fromJSON(object) {
626
858
  return {
627
- id: isSet(object.id) ? globalThis.String(object.id) : "",
628
- treeId: isSet(object.treeId) ? globalThis.String(object.treeId) : "",
629
- value: isSet(object.value) ? globalThis.Number(object.value) : 0,
630
- parentNodeId: isSet(object.parentNodeId) ? globalThis.String(object.parentNodeId) : void 0,
631
- nodeTx: isSet(object.nodeTx) ? bytesFromBase64(object.nodeTx) : new Uint8Array(0),
632
- refundTx: isSet(object.refundTx) ? bytesFromBase64(object.refundTx) : new Uint8Array(0),
633
- vout: isSet(object.vout) ? globalThis.Number(object.vout) : 0,
634
- verifyingPublicKey: isSet(object.verifyingPublicKey) ? bytesFromBase64(object.verifyingPublicKey) : new Uint8Array(0),
635
- ownerIdentityPublicKey: isSet(object.ownerIdentityPublicKey) ? bytesFromBase64(object.ownerIdentityPublicKey) : new Uint8Array(0),
636
- signingKeyshare: isSet(object.signingKeyshare) ? SigningKeyshare.fromJSON(object.signingKeyshare) : void 0,
637
- status: isSet(object.status) ? globalThis.String(object.status) : "",
638
- network: isSet(object.network) ? networkFromJSON(object.network) : 0
859
+ id: isSet2(object.id) ? globalThis.String(object.id) : "",
860
+ treeId: isSet2(object.treeId) ? globalThis.String(object.treeId) : "",
861
+ value: isSet2(object.value) ? globalThis.Number(object.value) : 0,
862
+ parentNodeId: isSet2(object.parentNodeId) ? globalThis.String(object.parentNodeId) : void 0,
863
+ nodeTx: isSet2(object.nodeTx) ? bytesFromBase64(object.nodeTx) : new Uint8Array(0),
864
+ refundTx: isSet2(object.refundTx) ? bytesFromBase64(object.refundTx) : new Uint8Array(0),
865
+ vout: isSet2(object.vout) ? globalThis.Number(object.vout) : 0,
866
+ verifyingPublicKey: isSet2(object.verifyingPublicKey) ? bytesFromBase64(object.verifyingPublicKey) : new Uint8Array(0),
867
+ ownerIdentityPublicKey: isSet2(object.ownerIdentityPublicKey) ? bytesFromBase64(object.ownerIdentityPublicKey) : new Uint8Array(0),
868
+ signingKeyshare: isSet2(object.signingKeyshare) ? SigningKeyshare.fromJSON(object.signingKeyshare) : void 0,
869
+ status: isSet2(object.status) ? globalThis.String(object.status) : "",
870
+ network: isSet2(object.network) ? networkFromJSON(object.network) : 0,
871
+ createdTime: isSet2(object.createdTime) ? fromJsonTimestamp(object.createdTime) : void 0,
872
+ updatedTime: isSet2(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : void 0,
873
+ ownerSigningPublicKey: isSet2(object.ownerSigningPublicKey) ? bytesFromBase64(object.ownerSigningPublicKey) : new Uint8Array(0)
639
874
  };
640
875
  },
641
876
  toJSON(message) {
@@ -676,6 +911,15 @@ var TreeNode = {
676
911
  if (message.network !== 0) {
677
912
  obj.network = networkToJSON(message.network);
678
913
  }
914
+ if (message.createdTime !== void 0) {
915
+ obj.createdTime = message.createdTime.toISOString();
916
+ }
917
+ if (message.updatedTime !== void 0) {
918
+ obj.updatedTime = message.updatedTime.toISOString();
919
+ }
920
+ if (message.ownerSigningPublicKey.length !== 0) {
921
+ obj.ownerSigningPublicKey = base64FromBytes(message.ownerSigningPublicKey);
922
+ }
679
923
  return obj;
680
924
  },
681
925
  create(base) {
@@ -695,6 +939,9 @@ var TreeNode = {
695
939
  message.signingKeyshare = object.signingKeyshare !== void 0 && object.signingKeyshare !== null ? SigningKeyshare.fromPartial(object.signingKeyshare) : void 0;
696
940
  message.status = object.status ?? "";
697
941
  message.network = object.network ?? 0;
942
+ message.createdTime = object.createdTime ?? void 0;
943
+ message.updatedTime = object.updatedTime ?? void 0;
944
+ message.ownerSigningPublicKey = object.ownerSigningPublicKey ?? new Uint8Array(0);
698
945
  return message;
699
946
  }
700
947
  };
@@ -742,8 +989,8 @@ var SparkAddress = {
742
989
  },
743
990
  fromJSON(object) {
744
991
  return {
745
- identityPublicKey: isSet(object.identityPublicKey) ? bytesFromBase64(object.identityPublicKey) : new Uint8Array(0),
746
- paymentIntentFields: isSet(object.paymentIntentFields) ? PaymentIntentFields.fromJSON(object.paymentIntentFields) : void 0
992
+ identityPublicKey: isSet2(object.identityPublicKey) ? bytesFromBase64(object.identityPublicKey) : new Uint8Array(0),
993
+ paymentIntentFields: isSet2(object.paymentIntentFields) ? PaymentIntentFields.fromJSON(object.paymentIntentFields) : void 0
747
994
  };
748
995
  },
749
996
  toJSON(message) {
@@ -830,10 +1077,10 @@ var PaymentIntentFields = {
830
1077
  },
831
1078
  fromJSON(object) {
832
1079
  return {
833
- id: isSet(object.id) ? bytesFromBase64(object.id) : new Uint8Array(0),
834
- assetIdentifier: isSet(object.assetIdentifier) ? bytesFromBase64(object.assetIdentifier) : void 0,
835
- assetAmount: isSet(object.assetAmount) ? bytesFromBase64(object.assetAmount) : new Uint8Array(0),
836
- memo: isSet(object.memo) ? globalThis.String(object.memo) : void 0
1080
+ id: isSet2(object.id) ? bytesFromBase64(object.id) : new Uint8Array(0),
1081
+ assetIdentifier: isSet2(object.assetIdentifier) ? bytesFromBase64(object.assetIdentifier) : void 0,
1082
+ assetAmount: isSet2(object.assetAmount) ? bytesFromBase64(object.assetAmount) : new Uint8Array(0),
1083
+ memo: isSet2(object.memo) ? globalThis.String(object.memo) : void 0
837
1084
  };
838
1085
  },
839
1086
  toJSON(message) {
@@ -887,7 +1134,26 @@ function base64FromBytes(arr) {
887
1134
  return globalThis.btoa(bin.join(""));
888
1135
  }
889
1136
  }
890
- function longToNumber(int64) {
1137
+ function toTimestamp(date) {
1138
+ const seconds = Math.trunc(date.getTime() / 1e3);
1139
+ const nanos = date.getTime() % 1e3 * 1e6;
1140
+ return { seconds, nanos };
1141
+ }
1142
+ function fromTimestamp(t) {
1143
+ let millis = (t.seconds || 0) * 1e3;
1144
+ millis += (t.nanos || 0) / 1e6;
1145
+ return new globalThis.Date(millis);
1146
+ }
1147
+ function fromJsonTimestamp(o) {
1148
+ if (o instanceof globalThis.Date) {
1149
+ return o;
1150
+ } else if (typeof o === "string") {
1151
+ return new globalThis.Date(o);
1152
+ } else {
1153
+ return fromTimestamp(Timestamp.fromJSON(o));
1154
+ }
1155
+ }
1156
+ function longToNumber2(int64) {
891
1157
  const num = globalThis.Number(int64.toString());
892
1158
  if (num > globalThis.Number.MAX_SAFE_INTEGER) {
893
1159
  throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
@@ -897,7 +1163,10 @@ function longToNumber(int64) {
897
1163
  }
898
1164
  return num;
899
1165
  }
900
- function isSet(value) {
1166
+ function isObject(value) {
1167
+ return typeof value === "object" && value !== null;
1168
+ }
1169
+ function isSet2(value) {
901
1170
  return value !== null && value !== void 0;
902
1171
  }
903
1172
 
@@ -1367,7 +1636,8 @@ var BASE_CONFIG = {
1367
1636
  }
1368
1637
  };
1369
1638
  var LOCAL_WALLET_CONFIG = {
1370
- ...BASE_CONFIG
1639
+ ...BASE_CONFIG,
1640
+ threshold: 3
1371
1641
  };
1372
1642
  var LOCAL_WALLET_CONFIG_SCHNORR = {
1373
1643
  ...LOCAL_WALLET_CONFIG,
@@ -2002,8 +2272,8 @@ function getNextTransactionSequence(currSequence, forRefresh) {
2002
2272
  needRefresh: true
2003
2273
  };
2004
2274
  }
2005
- if (nextTimelock < 100) {
2006
- throw new ValidationError("timelock interval is less than 100", {
2275
+ if (nextTimelock < 0) {
2276
+ throw new ValidationError("timelock interval is less than 0", {
2007
2277
  field: "nextTimelock",
2008
2278
  value: nextTimelock
2009
2279
  });
@@ -1,11 +1,11 @@
1
1
  import * as btc from '@scure/btc-signer';
2
2
  import { Transaction } from '@scure/btc-signer';
3
3
  import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
4
- import { N as Network } from '../network-D5lKssVl.cjs';
5
- export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from '../network-D5lKssVl.cjs';
6
- import { i as SigningNonce, h as SigningCommitment } from '../signer-IO3oMRNj.cjs';
7
- export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from '../signer-IO3oMRNj.cjs';
8
- import { j as OutputWithPreviousTransactionData, l as TransferPackage, g as SparkServiceClient } from '../spark-CDm4gqS6.cjs';
4
+ import { N as Network } from '../network-CfxLnaot.cjs';
5
+ export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from '../network-CfxLnaot.cjs';
6
+ import { i as SigningNonce, h as SigningCommitment } from '../signer-DaY8c60s.cjs';
7
+ export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from '../signer-DaY8c60s.cjs';
8
+ import { j as OutputWithPreviousTransactionData, l as TransferPackage, g as SparkServiceClient } from '../spark-C4ZrsgjC.cjs';
9
9
  import { SparkAddressFormat } from '../address/index.cjs';
10
10
  import '@buildonspark/lrc20-sdk';
11
11
  import 'bitcoinjs-lib';
@@ -1,11 +1,11 @@
1
1
  import * as btc from '@scure/btc-signer';
2
2
  import { Transaction } from '@scure/btc-signer';
3
3
  import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
4
- import { N as Network } from '../network-xkBSpaTn.js';
5
- export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from '../network-xkBSpaTn.js';
6
- import { i as SigningNonce, h as SigningCommitment } from '../signer-wqesWifN.js';
7
- export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from '../signer-wqesWifN.js';
8
- import { j as OutputWithPreviousTransactionData, l as TransferPackage, g as SparkServiceClient } from '../spark-CDm4gqS6.js';
4
+ import { N as Network } from '../network-CroCOQ0B.js';
5
+ export { L as LRC_WALLET_NETWORK, c as LRC_WALLET_NETWORK_TYPE, b as NetworkToProto, a as NetworkType, g as getNetwork, d as getNetworkFromAddress, e as getNetworkFromString } from '../network-CroCOQ0B.js';
6
+ import { i as SigningNonce, h as SigningCommitment } from '../signer-D7vfYik9.js';
7
+ export { V as VerifiableSecretShare, d as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, a as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, b as splitSecretWithProofs, v as validateShare } from '../signer-D7vfYik9.js';
8
+ import { j as OutputWithPreviousTransactionData, l as TransferPackage, g as SparkServiceClient } from '../spark-C4ZrsgjC.js';
9
9
  import { SparkAddressFormat } from '../address/index.js';
10
10
  import '@buildonspark/lrc20-sdk';
11
11
  import 'bitcoinjs-lib';
@@ -26,16 +26,16 @@ import {
26
26
  isTxBroadcast,
27
27
  maybeApplyFee,
28
28
  proofOfPossessionMessageHashForDepositAddress
29
- } from "../chunk-IRW5TWMH.js";
29
+ } from "../chunk-XX4RRWOX.js";
30
30
  import {
31
31
  calculateAvailableTokenAmount,
32
32
  checkIfSelectedOutputsAreAvailable,
33
33
  collectResponses,
34
34
  filterTokenBalanceForTokenPublicKey
35
35
  } from "../chunk-6AFUC5M2.js";
36
- import "../chunk-MIVX3GHD.js";
37
- import "../chunk-TOSP3INR.js";
38
- import "../chunk-O4RYNJNB.js";
36
+ import "../chunk-K4BJARWM.js";
37
+ import "../chunk-I54FARY2.js";
38
+ import "../chunk-KEKGSH7B.js";
39
39
  import {
40
40
  LRC_WALLET_NETWORK,
41
41
  LRC_WALLET_NETWORK_TYPE,
@@ -45,9 +45,9 @@ import {
45
45
  getNetworkFromAddress,
46
46
  getNetworkFromString
47
47
  } from "../chunk-Z5HIAYFT.js";
48
- import "../chunk-DOA6QXYQ.js";
48
+ import "../chunk-EKFD62HN.js";
49
49
  import "../chunk-HMLOC6TE.js";
50
- import "../chunk-M6A4KFIG.js";
50
+ import "../chunk-4Q2ZDYYU.js";
51
51
  import {
52
52
  addPrivateKeys,
53
53
  addPublicKeys,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildonspark/spark-sdk",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "author": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
package/src/constants.ts CHANGED
@@ -11,7 +11,11 @@ export const packageVersion =
11
11
  typeof __PACKAGE_VERSION__ !== "undefined" ? __PACKAGE_VERSION__ : "unknown";
12
12
 
13
13
  let baseEnvStr = "unknown";
14
- if (isNode) {
14
+ if (isBun) {
15
+ const bunVersion =
16
+ "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
17
+ baseEnvStr = `bun/${bunVersion}`;
18
+ } else if (isNode) {
15
19
  baseEnvStr = `node/${process.version}`;
16
20
  } else if (isReactNative) {
17
21
  baseEnvStr = "react-native";