@satora/swap 1.11.0 → 1.12.0

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 (58) hide show
  1. package/dist/{chunk-EYVSXWCA.cjs → chunk-EL4FUZJO.cjs} +565 -323
  2. package/dist/chunk-EL4FUZJO.cjs.map +1 -0
  3. package/dist/{chunk-ZAQ7YV6W.js → chunk-KECPPSZL.js} +5 -5
  4. package/dist/{chunk-ZAQ7YV6W.js.map → chunk-KECPPSZL.js.map} +1 -1
  5. package/dist/{chunk-M47Z35Z5.cjs → chunk-QJ4EK6UG.cjs} +5 -5
  6. package/dist/{chunk-M47Z35Z5.cjs.map → chunk-QJ4EK6UG.cjs.map} +1 -1
  7. package/dist/{chunk-BVTLZLT2.js → chunk-YBQPH7NH.js} +289 -47
  8. package/dist/chunk-YBQPH7NH.js.map +1 -0
  9. package/dist/delegate.cjs +2 -2
  10. package/dist/delegate.js +1 -1
  11. package/dist/dist-R6DUJG36.cjs +396 -0
  12. package/dist/{dist-RWCRSE4V.cjs.map → dist-R6DUJG36.cjs.map} +1 -1
  13. package/dist/{dist-INHW3D4S.js → dist-Y3ZVHXAJ.js} +5 -3
  14. package/dist/index.cjs +21 -13
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +14 -6
  17. package/dist/index.js.map +1 -1
  18. package/dist/types/cjs/pure/api/client.d.cts +1 -0
  19. package/dist/types/cjs/pure/client.d.cts +30 -3
  20. package/dist/types/cjs/pure/compose-quote.d.cts +14 -1
  21. package/dist/types/cjs/pure/create/index.d.cts +2 -1
  22. package/dist/types/cjs/pure/create/spark-to-evm.d.cts +7 -0
  23. package/dist/types/cjs/pure/create/types.d.cts +93 -2
  24. package/dist/types/cjs/pure/generated/api.d.cts +274 -2
  25. package/dist/types/cjs/pure/index.d.cts +3 -3
  26. package/dist/types/cjs/pure/redeem/arkade.d.cts +4 -1
  27. package/dist/types/cjs/pure/swap-verification.d.cts +3 -1
  28. package/dist/types/cjs/pure/tokens.d.cts +5 -0
  29. package/dist/types/cjs/pure/types/chain.d.cts +2 -2
  30. package/dist/types/cjs/pure/types/index.d.cts +1 -0
  31. package/dist/types/cjs/pure/types/promo-code.d.cts +15 -0
  32. package/dist/types/cjs/pure/types/quote.d.cts +7 -0
  33. package/dist/types/cjs/pure/types/referral-fee.d.cts +8 -0
  34. package/dist/types/cjs/pure/version.d.cts +4 -4
  35. package/dist/types/cjs/swap/client.d.cts +2 -0
  36. package/dist/types/esm/pure/api/client.d.ts +1 -0
  37. package/dist/types/esm/pure/client.d.ts +30 -3
  38. package/dist/types/esm/pure/compose-quote.d.ts +14 -1
  39. package/dist/types/esm/pure/create/index.d.ts +2 -1
  40. package/dist/types/esm/pure/create/spark-to-evm.d.ts +7 -0
  41. package/dist/types/esm/pure/create/types.d.ts +93 -2
  42. package/dist/types/esm/pure/generated/api.d.ts +274 -2
  43. package/dist/types/esm/pure/index.d.ts +3 -3
  44. package/dist/types/esm/pure/redeem/arkade.d.ts +4 -1
  45. package/dist/types/esm/pure/swap-verification.d.ts +3 -1
  46. package/dist/types/esm/pure/tokens.d.ts +5 -0
  47. package/dist/types/esm/pure/types/chain.d.ts +2 -2
  48. package/dist/types/esm/pure/types/index.d.ts +1 -0
  49. package/dist/types/esm/pure/types/promo-code.d.ts +15 -0
  50. package/dist/types/esm/pure/types/quote.d.ts +7 -0
  51. package/dist/types/esm/pure/types/referral-fee.d.ts +8 -0
  52. package/dist/types/esm/pure/version.d.ts +4 -4
  53. package/dist/types/esm/swap/client.d.ts +2 -0
  54. package/package.json +2 -2
  55. package/dist/chunk-BVTLZLT2.js.map +0 -1
  56. package/dist/chunk-EYVSXWCA.cjs.map +0 -1
  57. package/dist/dist-RWCRSE4V.cjs +0 -394
  58. /package/dist/{dist-INHW3D4S.js.map → dist-Y3ZVHXAJ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -93,6 +93,7 @@ import {
93
93
  isSolanaToken,
94
94
  isSonicToken,
95
95
  isSourceEvmChain,
96
+ isSpark,
96
97
  isTronToken,
97
98
  isValidArkadeAddress,
98
99
  isValidSolanaAddress,
@@ -120,7 +121,7 @@ import {
120
121
  tronAddressToBytes32,
121
122
  verifyHtlcAddress,
122
123
  wrapKernelErc1271Signature
123
- } from "./chunk-BVTLZLT2.js";
124
+ } from "./chunk-YBQPH7NH.js";
124
125
  import {
125
126
  electrumReader
126
127
  } from "./chunk-3ZMSZSAV.js";
@@ -192,7 +193,7 @@ import {
192
193
  SDK_VERSION,
193
194
  StrictVhtlcScript,
194
195
  protocolHeaderName
195
- } from "./chunk-ZAQ7YV6W.js";
196
+ } from "./chunk-KECPPSZL.js";
196
197
  import "./chunk-UM6TUP4E.js";
197
198
  import {
198
199
  SdkLogger,
@@ -236,7 +237,7 @@ function deriveSwapActions(input) {
236
237
  waitingOn: "client_payment",
237
238
  recommended: true,
238
239
  automation: "auto",
239
- reason: "Waiting for the Lightning payment to be locked in."
240
+ reason: "Waiting for the source payment to be locked in."
240
241
  };
241
242
  return { recommended: "wait", actions: [wait] };
242
243
  }
@@ -357,7 +358,7 @@ function deriveSwapActions(input) {
357
358
  outcome: "refunded",
358
359
  recommended: true,
359
360
  automation: "auto",
360
- reason: "The claim window passed \u2014 your Lightning payment will be refunded automatically."
361
+ reason: "The claim window passed \u2014 your source payment will be refunded automatically."
361
362
  };
362
363
  return { recommended: "none", actions: [done] };
363
364
  }
@@ -454,7 +455,7 @@ function deriveSwapActions(input) {
454
455
  outcome: "refunded",
455
456
  recommended: true,
456
457
  automation: "auto",
457
- reason: "The swap did not complete \u2014 your Lightning payment will be refunded automatically."
458
+ reason: "The swap did not complete \u2014 your source payment will be refunded automatically."
458
459
  };
459
460
  return { recommended: "none", actions: [done] };
460
461
  }
@@ -827,7 +828,7 @@ var BitcoinContractManager = class _BitcoinContractManager {
827
828
  if (config.electrumWsUrl) {
828
829
  const [{ electrumReader: electrumReader2 }, { ElectrumWsClient: ElectrumWsClient2 }] = await Promise.all([
829
830
  import("./bitcoin-reader-electrum-4PNSDHIA.js"),
830
- import("./dist-INHW3D4S.js")
831
+ import("./dist-Y3ZVHXAJ.js")
831
832
  ]);
832
833
  reader = electrumReader2(new ElectrumWsClient2(config.electrumWsUrl), {
833
834
  network: config.network,
@@ -2246,6 +2247,8 @@ function swapToTracked(stored) {
2246
2247
  // watch) and claims an on-chain HTLC. No client-funded leg — the client's
2247
2248
  // claim completes the swap; a hold invoice that never settles auto-unwinds.
2248
2249
  // Client pays the invoice, then claims the server's EVM HTLC.
2250
+ // Native Spark has the same EVM claim leg; the Spark wallet manages its HTLC.
2251
+ case "spark_to_evm":
2249
2252
  case "lightning_to_evm":
2250
2253
  return {
2251
2254
  swapId: r.id,
@@ -3056,6 +3059,10 @@ var Client2 = class {
3056
3059
  );
3057
3060
  }
3058
3061
  /** Delegated to the legacy client (migration checkpoint). */
3062
+ createSparkToEvmSwap(...args) {
3063
+ return this.#trackAfterCreate(this.#legacy.createSparkToEvmSwap(...args));
3064
+ }
3065
+ /** Delegated to the legacy client (migration checkpoint). */
3059
3066
  createLightningToBitcoinSwap(...args) {
3060
3067
  return this.#trackAfterCreate(
3061
3068
  this.#legacy.createLightningToBitcoinSwap(...args)
@@ -3834,6 +3841,7 @@ export {
3834
3841
  isSolanaToken,
3835
3842
  isSonicToken,
3836
3843
  isSourceEvmChain,
3844
+ isSpark,
3837
3845
  isTronToken,
3838
3846
  isUserRejection,
3839
3847
  isValidArkadeAddress,