@satora/swap 1.11.1 → 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 (56) hide show
  1. package/dist/{chunk-4NVWIR74.cjs → chunk-EL4FUZJO.cjs} +538 -308
  2. package/dist/chunk-EL4FUZJO.cjs.map +1 -0
  3. package/dist/{chunk-TT3J2OOS.js → chunk-KECPPSZL.js} +5 -5
  4. package/dist/{chunk-TT3J2OOS.js.map → chunk-KECPPSZL.js.map} +1 -1
  5. package/dist/{chunk-Q4TOBBAN.cjs → chunk-QJ4EK6UG.cjs} +5 -5
  6. package/dist/{chunk-Q4TOBBAN.cjs.map → chunk-QJ4EK6UG.cjs.map} +1 -1
  7. package/dist/{chunk-WQMAL2VD.js → chunk-YBQPH7NH.js} +260 -30
  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-MHRQ5FFV.cjs.map → dist-R6DUJG36.cjs.map} +1 -1
  13. package/dist/{dist-SHY7I6SH.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/swap-verification.d.cts +3 -1
  27. package/dist/types/cjs/pure/tokens.d.cts +5 -0
  28. package/dist/types/cjs/pure/types/chain.d.cts +2 -2
  29. package/dist/types/cjs/pure/types/index.d.cts +1 -0
  30. package/dist/types/cjs/pure/types/promo-code.d.cts +15 -0
  31. package/dist/types/cjs/pure/types/quote.d.cts +7 -0
  32. package/dist/types/cjs/pure/types/referral-fee.d.cts +8 -0
  33. package/dist/types/cjs/pure/version.d.cts +4 -4
  34. package/dist/types/cjs/swap/client.d.cts +2 -0
  35. package/dist/types/esm/pure/api/client.d.ts +1 -0
  36. package/dist/types/esm/pure/client.d.ts +30 -3
  37. package/dist/types/esm/pure/compose-quote.d.ts +14 -1
  38. package/dist/types/esm/pure/create/index.d.ts +2 -1
  39. package/dist/types/esm/pure/create/spark-to-evm.d.ts +7 -0
  40. package/dist/types/esm/pure/create/types.d.ts +93 -2
  41. package/dist/types/esm/pure/generated/api.d.ts +274 -2
  42. package/dist/types/esm/pure/index.d.ts +3 -3
  43. package/dist/types/esm/pure/swap-verification.d.ts +3 -1
  44. package/dist/types/esm/pure/tokens.d.ts +5 -0
  45. package/dist/types/esm/pure/types/chain.d.ts +2 -2
  46. package/dist/types/esm/pure/types/index.d.ts +1 -0
  47. package/dist/types/esm/pure/types/promo-code.d.ts +15 -0
  48. package/dist/types/esm/pure/types/quote.d.ts +7 -0
  49. package/dist/types/esm/pure/types/referral-fee.d.ts +8 -0
  50. package/dist/types/esm/pure/version.d.ts +4 -4
  51. package/dist/types/esm/swap/client.d.ts +2 -0
  52. package/package.json +2 -2
  53. package/dist/chunk-4NVWIR74.cjs.map +0 -1
  54. package/dist/chunk-WQMAL2VD.js.map +0 -1
  55. package/dist/dist-MHRQ5FFV.cjs +0 -394
  56. /package/dist/{dist-SHY7I6SH.js.map → dist-Y3ZVHXAJ.js.map} +0 -0
@@ -823,6 +823,28 @@ export interface paths {
823
823
  patch?: never;
824
824
  trace?: never;
825
825
  };
826
+ "/swap/spark/evm": {
827
+ parameters: {
828
+ query?: never;
829
+ header?: never;
830
+ path?: never;
831
+ cookie?: never;
832
+ };
833
+ get?: never;
834
+ put?: never;
835
+ /**
836
+ * Create a native Spark swap. Pay the returned address with a BTC HTLC
837
+ * using the response's hash, amount and expiry duration. An ordinary Spark
838
+ * transfer cannot fund this swap. The client retains the preimage until its
839
+ * EVM claim; unused HTLCs return to the payer at their expiry.
840
+ */
841
+ post: operations["create_spark_evm_swap"];
842
+ delete?: never;
843
+ options?: never;
844
+ head?: never;
845
+ patch?: never;
846
+ trace?: never;
847
+ };
826
848
  "/swap/{id}": {
827
849
  parameters: {
828
850
  query?: never;
@@ -1241,6 +1263,26 @@ export interface components {
1241
1263
  entry_point: string;
1242
1264
  };
1243
1265
  AmountU256: string;
1266
+ /**
1267
+ * @description A promo code applied to a swap, as returned by `/quote` and
1268
+ * `/referral-fee` so the frontend can show what it gives.
1269
+ */
1270
+ AppliedPromo: {
1271
+ code: string;
1272
+ /**
1273
+ * Format: double
1274
+ * @description The promo's base fee as a decimal fraction (e.g. `0.001` = 0.1%). The
1275
+ * swap's base fee is the lower of it and the route's base fee; any extra
1276
+ * fee is added on top.
1277
+ */
1278
+ fee_rate: number;
1279
+ /**
1280
+ * Format: int64
1281
+ * @description Largest swap the code applies to, in sats, as the route's limit check
1282
+ * measures it. Lifts the route maximum when higher.
1283
+ */
1284
+ max_amount_sats: number;
1285
+ };
1244
1286
  /**
1245
1287
  * @description Chain-agnostic request for Arkade-to-EVM swaps.
1246
1288
  *
@@ -1305,6 +1347,11 @@ export interface components {
1305
1347
  gasless?: boolean;
1306
1348
  /** @description Hash lock provided by the client (32-byte hex string with 0x prefix). */
1307
1349
  hash_lock: string;
1350
+ /**
1351
+ * @description Optional promo code. Its rate replaces the base fee and its cap
1352
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
1353
+ */
1354
+ promo_code?: string | null;
1308
1355
  /** @description Optional referral code for tracking. */
1309
1356
  referral_code?: string | null;
1310
1357
  /** @description Refund public key used to generate the Arkade VHTLC. */
@@ -1420,6 +1467,11 @@ export interface components {
1420
1467
  * Mutually exclusive with the other destination fields.
1421
1468
  */
1422
1469
  lnurl?: string | null;
1470
+ /**
1471
+ * @description Optional promo code. Its rate replaces the base fee and its cap
1472
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
1473
+ */
1474
+ promo_code?: string | null;
1423
1475
  /** @description Optional referral code for fee exemption */
1424
1476
  referral_code?: string | null;
1425
1477
  /** @description User's refund public key for the Arkade VHTLC (sender role). */
@@ -1546,6 +1598,11 @@ export interface components {
1546
1598
  * Client will use the secret to claim the Arkade VHTLC later.
1547
1599
  */
1548
1600
  hash_lock: string;
1601
+ /**
1602
+ * @description Optional promo code. Its rate replaces the base fee and its cap
1603
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
1604
+ */
1605
+ promo_code?: string | null;
1549
1606
  /** @description Optional referral code for fee exemption */
1550
1607
  referral_code?: string | null;
1551
1608
  /** @description User's refund public key for the on-chain Bitcoin HTLC */
@@ -1630,6 +1687,11 @@ export interface components {
1630
1687
  gasless?: boolean;
1631
1688
  /** @description Hash lock provided by the client (32-byte hex string with 0x prefix). */
1632
1689
  hash_lock: string;
1690
+ /**
1691
+ * @description Optional promo code. Its rate replaces the base fee and its cap
1692
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
1693
+ */
1694
+ promo_code?: string | null;
1633
1695
  /** @description Optional referral code for tracking. */
1634
1696
  referral_code?: string | null;
1635
1697
  /** @description Refund public key used to generate the Bitcoin HTLC. */
@@ -1780,6 +1842,11 @@ export interface components {
1780
1842
  * Mutually exclusive with the other destination fields.
1781
1843
  */
1782
1844
  lnurl?: string | null;
1845
+ /**
1846
+ * @description Optional promo code. Its rate replaces the base fee and its cap
1847
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
1848
+ */
1849
+ promo_code?: string | null;
1783
1850
  /** @description Optional referral code for fee exemption */
1784
1851
  referral_code?: string | null;
1785
1852
  /** @description User's refund public key for the on-chain HTLC. */
@@ -2065,7 +2132,7 @@ export interface components {
2065
2132
  * @description Supported blockchain networks. EVM chains serialize to their chain ID as a string (e.g. "137" for Polygon). Rootstock is "30" on a mainnet daemon and "31" on a testnet daemon.
2066
2133
  * @enum {string}
2067
2134
  */
2068
- Chain: "Arkade" | "Lightning" | "Bitcoin" | "137" | "1" | "42161" | "30" | "31";
2135
+ Chain: "Arkade" | "Lightning" | "Spark" | "Bitcoin" | "137" | "1" | "42161" | "30" | "31";
2069
2136
  /**
2070
2137
  * @description Per-chain configuration. EVM chains only — Bitcoin / Lightning /
2071
2138
  * Arkade don't have a meaningful chain-config shape.
@@ -2776,6 +2843,11 @@ export interface components {
2776
2843
  gasless?: boolean;
2777
2844
  /** @description Hash lock (0x-prefixed 32-byte hex). Client generates secret, computes SHA256(secret). */
2778
2845
  hash_lock: string;
2846
+ /**
2847
+ * @description Optional promo code. Its rate replaces the base fee and its cap
2848
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
2849
+ */
2850
+ promo_code?: string | null;
2779
2851
  /** @description User's Arkade VHTLC claim key (receiver). */
2780
2852
  receiver_pk: string;
2781
2853
  /** @description Optional referral code for tracking. */
@@ -2948,6 +3020,11 @@ export interface components {
2948
3020
  gasless?: boolean;
2949
3021
  /** @description Hash lock (0x-prefixed 32-byte hex). Client generates secret, computes SHA256(secret). */
2950
3022
  hash_lock: string;
3023
+ /**
3024
+ * @description Optional promo code. Its rate replaces the base fee and its cap
3025
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
3026
+ */
3027
+ promo_code?: string | null;
2951
3028
  /** @description Optional referral code for tracking. */
2952
3029
  referral_code?: string | null;
2953
3030
  /** @description User's target BTC address to receive claimed funds. */
@@ -3139,6 +3216,11 @@ export interface components {
3139
3216
  * Mutually exclusive with the other destination fields.
3140
3217
  */
3141
3218
  lnurl?: string | null;
3219
+ /**
3220
+ * @description Optional promo code. Its rate replaces the base fee and its cap
3221
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
3222
+ */
3223
+ promo_code?: string | null;
3142
3224
  /** @description Optional referral code for fee exemption. */
3143
3225
  referral_code?: string | null;
3144
3226
  /**
@@ -3318,6 +3400,9 @@ export interface components {
3318
3400
  }) | (components["schemas"]["LightningToEvmSwapResponse"] & {
3319
3401
  /** @enum {string} */
3320
3402
  direction: "lightning_to_evm";
3403
+ }) | (components["schemas"]["SparkToEvmSwapResponse"] & {
3404
+ /** @enum {string} */
3405
+ direction: "spark_to_evm";
3321
3406
  }) | (components["schemas"]["BitcoinToEvmSwapResponse"] & {
3322
3407
  /** @enum {string} */
3323
3408
  direction: "bitcoin_to_evm";
@@ -3364,6 +3449,7 @@ export interface components {
3364
3449
  * surplus over invoice + fees).
3365
3450
  */
3366
3451
  network_fee_sats: number;
3452
+ promo?: null | components["schemas"]["AppliedPromo"];
3367
3453
  /**
3368
3454
  * Format: double
3369
3455
  * @description Protocol fee rate (as decimal, e.g. 0.003 = 0.30%).
@@ -3416,6 +3502,11 @@ export interface components {
3416
3502
  hash_lock: string;
3417
3503
  /** @description Optional BOLT11 invoice description (max 639 bytes). */
3418
3504
  invoice_description?: string | null;
3505
+ /**
3506
+ * @description Optional promo code. Its rate replaces the base fee and its cap
3507
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
3508
+ */
3509
+ promo_code?: string | null;
3419
3510
  /** @description Optional referral code for fee exemption */
3420
3511
  referral_code?: string | null;
3421
3512
  /**
@@ -3519,6 +3610,11 @@ export interface components {
3519
3610
  hash_lock: string;
3520
3611
  /** @description Shown in the payer's wallet; the server default applies when omitted. */
3521
3612
  invoice_description?: string | null;
3613
+ /**
3614
+ * @description Optional promo code. Its rate replaces the base fee and its cap
3615
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
3616
+ */
3617
+ promo_code?: string | null;
3522
3618
  referral_code?: string | null;
3523
3619
  /**
3524
3620
  * Format: int64
@@ -3665,6 +3761,11 @@ export interface components {
3665
3761
  * hold invoice.
3666
3762
  */
3667
3763
  invoice_description?: string | null;
3764
+ /**
3765
+ * @description Optional promo code. Its rate replaces the base fee and its cap
3766
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
3767
+ */
3768
+ promo_code?: string | null;
3668
3769
  /** @description Optional referral code for tracking. */
3669
3770
  referral_code?: string | null;
3670
3771
  /**
@@ -3929,6 +4030,7 @@ export interface components {
3929
4030
  * create/claim + BTC mining fee when applicable.
3930
4031
  */
3931
4032
  network_fee: number;
4033
+ promo?: null | components["schemas"]["AppliedPromo"];
3932
4034
  /**
3933
4035
  * Format: int64
3934
4036
  * @description Protocol fee (in satoshis)
@@ -4028,6 +4130,11 @@ export interface components {
4028
4130
  * key's `default_extra_fee_bps` applies.
4029
4131
  */
4030
4132
  extra_fees?: number | null;
4133
+ /**
4134
+ * @description Optional promo code. Its rate replaces the base fee and its cap
4135
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
4136
+ */
4137
+ promo_code?: string | null;
4031
4138
  /**
4032
4139
  * @description Referral code. When omitted/unknown/revoked the response is a zero
4033
4140
  * extra fee (the base fee applies unchanged).
@@ -4056,6 +4163,7 @@ export interface components {
4056
4163
  * converts once so the client never handles bps.
4057
4164
  */
4058
4165
  extra_fee_rate: number;
4166
+ promo?: null | components["schemas"]["AppliedPromo"];
4059
4167
  /**
4060
4168
  * @description Human-readable partner label for the referral code, when registered.
4061
4169
  * Informational (attribution / display) only.
@@ -4279,6 +4387,108 @@ export interface components {
4279
4387
  /** @description Commitment transaction ID from the batch settlement. */
4280
4388
  commitment_txid: string;
4281
4389
  };
4390
+ /** @description Immutable native Spark instructions and the selected transfer, once observed. */
4391
+ SparkFunding: {
4392
+ address: string;
4393
+ /** Format: int64 */
4394
+ expiry_duration_secs: number;
4395
+ payment_id?: string | null;
4396
+ };
4397
+ SparkToEvmSwapResponse: {
4398
+ /** @description CCTP bridge destination chain. When set, USDC is bridged cross-chain after the swap. */
4399
+ bridge_target_chain?: string | null;
4400
+ /** @description USDC address on the bridge destination chain. */
4401
+ bridge_target_token_address?: string | null;
4402
+ /**
4403
+ * @description Transaction that delivered the bridged payout on the destination
4404
+ * chain, once the server has minted it there. Absent while the transfer
4405
+ * is in flight, and for payouts Circle's Forwarding Service delivers
4406
+ * (Circle's API reports that transaction).
4407
+ */
4408
+ bridge_target_txid?: string | null;
4409
+ /** @description EVM chain name (e.g. "Polygon", "Ethereum", "Arbitrum") */
4410
+ chain: string;
4411
+ /** @description EVM address that will sign the HTLC claim (SDK-derived for gasless claims) */
4412
+ client_evm_address: string;
4413
+ /**
4414
+ * Format: date-time
4415
+ * @description Timestamp of when the swap was created
4416
+ */
4417
+ created_at: string;
4418
+ /**
4419
+ * Format: int64
4420
+ * @description Numeric EVM chain ID (e.g. 137, 1, 42161)
4421
+ */
4422
+ evm_chain_id: number;
4423
+ /** @description EVM HTLC claim transaction ID (user claim) */
4424
+ evm_claim_txid?: string | null;
4425
+ /** @description HTLCCoordinator contract address (for redeemAndExecute) */
4426
+ evm_coordinator_address: string;
4427
+ /**
4428
+ * @description Amount locked in the EVM HTLC, in token smallest units (WBTC sats,
4429
+ * or 18-decimal units for tBTC — hence U256, not i64)
4430
+ */
4431
+ evm_expected_sats: string;
4432
+ /** @description EVM HTLC fund transaction ID */
4433
+ evm_fund_txid?: string | null;
4434
+ /** @description EVM HTLC contract address */
4435
+ evm_htlc_address: string;
4436
+ /**
4437
+ * @description HTLC family of the lock: `erc20` (`HTLCErc20` + `HTLCCoordinator`) or
4438
+ * `native` (`HTLCNative` + `HTLCNativeCoordinator`). Selects the EIP-712
4439
+ * domain name and the claim call a client uses.
4440
+ */
4441
+ evm_htlc_kind: components["schemas"]["EvmHtlcKind"];
4442
+ /**
4443
+ * Format: int64
4444
+ * @description HTLCErc20 contract VERSION of the deployment this swap lives on —
4445
+ * the EIP-712 domain version string for redeem/refund signatures.
4446
+ */
4447
+ evm_htlc_version: number;
4448
+ /**
4449
+ * Format: int64
4450
+ * @description EVM HTLC refund locktime (unix timestamp)
4451
+ */
4452
+ evm_refund_locktime: number;
4453
+ /**
4454
+ * Format: int64
4455
+ * @description Protocol fee + network fee in satoshis
4456
+ */
4457
+ fee_sats: number;
4458
+ /**
4459
+ * @description Native Spark transfer instructions. The payment is held until the
4460
+ * user's EVM claim reveals the preimage.
4461
+ */
4462
+ funding: components["schemas"]["SparkFunding"];
4463
+ /**
4464
+ * Format: int64
4465
+ * @description Unix timestamp after which the funding instructions expire
4466
+ */
4467
+ funding_expires_at?: number | null;
4468
+ /**
4469
+ * @description Hash lock (32-byte hex, 0x-prefixed) — the native Spark HTLC's payment
4470
+ * hash and the EVM HTLC's lock. The client holds the preimage.
4471
+ */
4472
+ hash_lock: string;
4473
+ id: string;
4474
+ /** @description Bitcoin network */
4475
+ network: string;
4476
+ /** @description Server's EVM address */
4477
+ server_evm_address: string;
4478
+ /** @description Amount the user pays over Spark, in satoshis */
4479
+ source_amount: string;
4480
+ /** @description Source token info */
4481
+ source_token: components["schemas"]["TokenInfo"];
4482
+ status: components["schemas"]["SwapStatus"];
4483
+ /** @description How much the user will receive in the target token's smallest unit */
4484
+ target_amount: string;
4485
+ /** @description EVM address where tokens are swept after the claim (user's final destination) */
4486
+ target_evm_address?: string | null;
4487
+ /** @description Target token info */
4488
+ target_token: components["schemas"]["TokenInfo"];
4489
+ /** @description WBTC token contract address on the target EVM chain (the token locked in the HTLC) */
4490
+ wbtc_address: string;
4491
+ };
4282
4492
  /** @description Aggregated health of every external dependency. */
4283
4493
  StatusResponse: {
4284
4494
  /** @description True if every probed service is healthy. */
@@ -5346,6 +5556,11 @@ export interface operations {
5346
5556
  * Rejected with 400 if it exceeds the per-key cap.
5347
5557
  */
5348
5558
  extra_fees?: number | null;
5559
+ /**
5560
+ * @description Optional promo code. Its rate replaces the base fee and its cap
5561
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
5562
+ */
5563
+ promo_code?: string | null;
5349
5564
  };
5350
5565
  header?: never;
5351
5566
  path?: never;
@@ -5433,6 +5648,11 @@ export interface operations {
5433
5648
  * (0..=max_extra_fee_bps configured on the matching developer key).
5434
5649
  */
5435
5650
  extra_fees?: number | null;
5651
+ /**
5652
+ * @description Optional promo code. Its rate replaces the base fee and its cap
5653
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
5654
+ */
5655
+ promo_code?: string | null;
5436
5656
  };
5437
5657
  header?: never;
5438
5658
  path?: never;
@@ -5483,6 +5703,11 @@ export interface operations {
5483
5703
  * key's `default_extra_fee_bps` applies.
5484
5704
  */
5485
5705
  extra_fees?: number | null;
5706
+ /**
5707
+ * @description Optional promo code. Its rate replaces the base fee and its cap
5708
+ * may lift the route maximum (400 if unknown, expired, used up, or too large).
5709
+ */
5710
+ promo_code?: string | null;
5486
5711
  };
5487
5712
  header?: never;
5488
5713
  path?: never;
@@ -5499,7 +5724,7 @@ export interface operations {
5499
5724
  "application/json": components["schemas"]["ReferralFeeResponse"];
5500
5725
  };
5501
5726
  };
5502
- /** @description extra_fees exceeds the referral key's cap */
5727
+ /** @description extra_fees exceeds the referral key's cap, or the promo code is invalid */
5503
5728
  400: {
5504
5729
  headers: {
5505
5730
  [name: string]: unknown;
@@ -6287,6 +6512,53 @@ export interface operations {
6287
6512
  };
6288
6513
  };
6289
6514
  };
6515
+ create_spark_evm_swap: {
6516
+ parameters: {
6517
+ query?: never;
6518
+ header?: never;
6519
+ path?: never;
6520
+ cookie?: never;
6521
+ };
6522
+ requestBody: {
6523
+ content: {
6524
+ "application/json": components["schemas"]["LightningToEvmSwapRequest"];
6525
+ };
6526
+ };
6527
+ responses: {
6528
+ 200: {
6529
+ headers: {
6530
+ [name: string]: unknown;
6531
+ };
6532
+ content: {
6533
+ "application/json": components["schemas"]["SparkToEvmSwapResponse"];
6534
+ };
6535
+ };
6536
+ 400: {
6537
+ headers: {
6538
+ [name: string]: unknown;
6539
+ };
6540
+ content: {
6541
+ "application/json": components["schemas"]["ErrorResponse"];
6542
+ };
6543
+ };
6544
+ 409: {
6545
+ headers: {
6546
+ [name: string]: unknown;
6547
+ };
6548
+ content: {
6549
+ "application/json": components["schemas"]["ErrorResponse"];
6550
+ };
6551
+ };
6552
+ 503: {
6553
+ headers: {
6554
+ [name: string]: unknown;
6555
+ };
6556
+ content: {
6557
+ "application/json": components["schemas"]["ErrorResponse"];
6558
+ };
6559
+ };
6560
+ };
6561
+ };
6290
6562
  get_swap: {
6291
6563
  parameters: {
6292
6564
  query?: never;
@@ -5,7 +5,7 @@ export { isValidArkadeAddress, parseArkadeAddress, } from "./arkade-address.cjs"
5
5
  export { invoiceAmountMsat, invoicePaymentHash } from "./bolt11.cjs";
6
6
  export { type AttestationResponse, type AttestationResult, type AttestationStatus, addressToBytes32, type BridgeParams, type BurnResult, bytes32ToAddress, CCTP_DOMAINS, type CctpChainName, type CctpMessageResult, type CctpMessageStatus, computeCctpFastFee, EURC_ADDRESSES, type FetchAttestationOptions, type FetchCctpFeeOptions, FINALITY_FAST, FINALITY_STANDARD, FORWARDING_FEE_ETHEREUM, FORWARDING_FEE_OTHER, FORWARDING_SERVICE_HOOK_DATA, fetchAttestation, fetchCctpFee, getDomain, IRIS_API_MAINNET, IRIS_API_TESTNET, type IrisFeeEntry, type IrisForwardFeeTiers, isValidSolanaAddress, MESSAGE_TRANSMITTER_ADDRESSES, MESSAGE_TRANSMITTER_V2, type MintResult, needsBridge, solanaAddressToBytes32, TOKEN_MESSENGER_ADDRESSES, TOKEN_MESSENGER_V2, type TrackCctpMessageOptions, trackCctpMessage, USAT_ADDRESSES, USDC_ADDRESSES, } from "./cctp/index.cjs";
7
7
  export { type AaConfig, type ApproveAndBurnParams, type ApproveAndBurnResult, addressToBytes32Hex, approveAndBurn, type BatchCall, type BuildCctpInboundBatchParams, type BuiltBatch, buildCctpInboundBatch, buildDomainSeparator, CCTP_STANDARD_ONLY_CHAIN_IDS, CCTP_VIEM_CHAINS, type CctpFundSwapContext, type CctpFundSwapFromSolanaParams, type CctpFundSwapFromSolanaResult, type CctpFundSwapParams, type CctpFundSwapResult, CctpInboundClient, type CctpInboundClientConfig, type CctpProgressStep, CHAIN_ID_TO_CCTP_NAME, type CreateSwapSmartAccountClientParams, cctpFundSwap, cctpMetaForChainId, createSwapSmartAccountClient, type DepositForBurnParams, DIRECT_SOURCE_CHAIN_IDS, encodeDepositForBurn, finalityForChainId, getCctpViemChain, getCctpViemChainByName, isCctpOnlySource, MAX_UINT256, type RecoverCctpInboundContext, type RecoverCctpInboundParams, type RecoverCctpInboundResult, type RecoveryProgress, recoverCctpInbound, type SignEip2612Params, type SignedEip2612Permit, type SignedPermit2Witness, type SignPermit2Params, type SignTypedDataFn, type SimulateBatchCallsArgs, SOLANA_MESSAGE_TRANSMITTER_V2, SOLANA_TOKEN_MESSENGER_MINTER_V2, SOLANA_USDC_MINT, type SolanaCctpProgressStep, type SolanaSigner, type SubmitBalanceUserOpParams, type SubmitUserOpContext, type SubmitUserOpParams, type SubmitUserOpResult, signEip2612Permit, signPermit2Witness, simulateBatchCalls, submitCctpInboundUserOp, USDC_DOMAIN_FIELDS, type UseropCalldataResponse, } from "./cctp-inbound/index.cjs";
8
- export type { ArkadeClaimOptions, ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, ClaimGaslessResult, ClaimOptions, ClaimResult, ClientConfig, CollabRefundEvmParams, CollabRefundEvmPath, CollabRefundEvmResult, CollabRefundEvmSignature, ContinueRefundedEvmSwapInfo, ContinueRefundedEvmSwapResult, CreateSwapOptions, CreateSwapResult, EthereumClaimData, EvmChain, EvmFundingCallData, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, GetLightningSendQuoteParams, GetQuoteParams, LightningSendQuote, LightningSendSourceChain, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, OnchainRefundOptions, RecoverAllSwapsOptions, RecoverAllSwapsResult, RecoverAllSwapsStopReason, RecoverSwapsOptions, RecoverSwapsResult, RefundOptions, RefundResult, RehashEvmParams, RehashEvmSignature, RetrySwapWithInvoiceResult, SupportAgentInfo, UsdcBridgeParams, } from "./client.cjs";
8
+ export type { ArkadeClaimOptions, ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, ClaimGaslessResult, ClaimOptions, ClaimResult, ClientConfig, CollabRefundEvmParams, CollabRefundEvmPath, CollabRefundEvmResult, CollabRefundEvmSignature, ContinueRefundedEvmSwapInfo, ContinueRefundedEvmSwapResult, CreateSwapOptions, CreateSwapResult, EthereumClaimData, EvmChain, EvmFundingCallData, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, GetLightningSendQuoteParams, GetQuoteParams, LightningSendQuote, LightningSendSourceChain, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, OnchainRefundOptions, RecoverAllSwapsOptions, RecoverAllSwapsResult, RecoverAllSwapsStopReason, RecoverSwapsOptions, RecoverSwapsResult, RefundOptions, RefundResult, RehashEvmParams, RehashEvmSignature, RetrySwapWithInvoiceResult, SparkToEvmSwapOptions, SparkToEvmSwapResponse, SparkToEvmSwapResult, SupportAgentInfo, UsdcBridgeParams, } from "./client.cjs";
9
9
  export { Client, ClientBuilder, DEFAULT_ELECTRUM_WS_URLS, RehashNotRecordedError, rehashAuthorizationMessage, } from "./client.cjs";
10
10
  export { addressToScriptHash, type ElectrumNetwork, type ElectrumUnspent, ElectrumWsClient, electrumBroadcastTransaction, electrumFetchTransactionOutputs, electrumFindOutputByAddress, electrumWaitForOutputByAddress, } from "./electrum-ws.cjs";
11
11
  export { getArkTxid, type SignedEscrowDelegate, type SignedEscrowTx, signEscrowArkTx, signEscrowCheckpoints, signEscrowDelegate, } from "./escrow/index.cjs";
@@ -24,8 +24,8 @@ export type { StorageFactory, StoredSwap, SwapStorage, WalletStorage, } from "./
24
24
  export { InMemorySwapStorage, InMemoryWalletStorage, inMemoryStorageFactory, SWAP_STORAGE_VERSION, } from "./storage/index.cjs";
25
25
  export { ARKADE_HTLC_SCRIPT_VERSION_STRICT, BTC_HTLC_SCRIPT_VERSION_STRICT, type StrictVhtlcOptions, StrictVhtlcScript, } from "./strict-vhtlc.cjs";
26
26
  export { SwapVerificationError } from "./swap-verification.cjs";
27
- export { Asset, type BridgeTokenInfo, BTC_ARKADE, BTC_ARKADE_INFO, BTC_LIGHTNING, BTC_LIGHTNING_INFO, BTC_ONCHAIN, BTC_ONCHAIN_INFO, getBridgeTargetChain, getCctpBridgeTokens, getUsdt0BridgeTokens, isArbitrumToken, isArkade, isAvalancheToken, isBaseToken, isBridgedTarget, isBridgeOnlyChain, isBtc, isBtcOnchain, isBtcPegged, isCctpRoutedUsdcTarget, isCctpUsdc, isEthereumToken, isEvmSwapSource, isEvmToken, isLightning, isLineaToken, isNativeLockTarget, isOptimismToken, isPolygonToken, isSolanaToken, isSonicToken, isSourceEvmChain, isTronToken, type TokenInput, toChain, toChainName, } from "./tokens.cjs";
28
- export type { Chain, ChainConfigEntry, ChainConfigResponse, DexQuoteAmount, DexQuoteResponse, NetworkFee, NetworkFeePairEntry, NetworkFeesResponse, QuoteResponse, SwapPairInfo, SwapPairsResponse, Token, TokenAmount, TokenRef, } from "./types/index.cjs";
27
+ export { Asset, type BridgeTokenInfo, BTC_ARKADE, BTC_ARKADE_INFO, BTC_LIGHTNING, BTC_LIGHTNING_INFO, BTC_ONCHAIN, BTC_ONCHAIN_INFO, getBridgeTargetChain, getCctpBridgeTokens, getUsdt0BridgeTokens, isArbitrumToken, isArkade, isAvalancheToken, isBaseToken, isBridgedTarget, isBridgeOnlyChain, isBtc, isBtcOnchain, isBtcPegged, isCctpRoutedUsdcTarget, isCctpUsdc, isEthereumToken, isEvmSwapSource, isEvmToken, isLightning, isLineaToken, isNativeLockTarget, isOptimismToken, isPolygonToken, isSolanaToken, isSonicToken, isSourceEvmChain, isSpark, isTronToken, type TokenInput, toChain, toChainName, } from "./tokens.cjs";
28
+ export type { AppliedPromo, Chain, ChainConfigEntry, ChainConfigResponse, DexQuoteAmount, DexQuoteResponse, NetworkFee, NetworkFeePairEntry, NetworkFeesResponse, QuoteResponse, SwapPairInfo, SwapPairsResponse, Token, TokenAmount, TokenRef, } from "./types/index.cjs";
29
29
  export { type GetUsdPricesOptions, getUsdPrices } from "./usd-price.cjs";
30
30
  export { getEid, getLzExplorerUrl, getLzMessageStatus, type LayerZeroMessageResult, type LayerZeroMessageStatus, LZ_EIDS, needsBridge as usdt0NeedsBridge, type TrackLzMessageOptions, trackLzMessage, USDT0_ADDRESSES, type Usdt0ChainName, } from "./usdt0-bridge/index.cjs";
31
31
  export { isValidTronAddress, tronAddressToBytes32, } from "./usdt0-bridge/tron.cjs";
@@ -2,7 +2,7 @@
2
2
  * Checks that what the server says about a swap binds to what this client
3
3
  * holds, before the client stores it, shows it or pays into it.
4
4
  */
5
- import type { ArkadeToEvmSwapResponse, ArkadeToLightningSwapResponse, BitcoinToEvmSwapResponse, BitcoinToLightningSwapResponse, BtcToArkadeSwapResponse, GetSwapResponse } from "./api/client.cjs";
5
+ import type { ArkadeToEvmSwapResponse, ArkadeToLightningSwapResponse, BitcoinToEvmSwapResponse, BitcoinToLightningSwapResponse, BtcToArkadeSwapResponse, GetSwapResponse, SparkToEvmSwapResponse } from "./api/client.cjs";
6
6
  import { type SwapParams } from "./signer/index.cjs";
7
7
  import type { LightningPaymentHash, StoredSwap } from "./storage/types.cjs";
8
8
  /**
@@ -159,3 +159,5 @@ export declare function withStoredTerms(stored: StoredSwap, fresh: GetSwapRespon
159
159
  * moves their hash lock and invoice.
160
160
  */
161
161
  export declare function swapTermsChange(stored: StoredSwap, fresh: GetSwapResponse): SwapVerificationError | undefined;
162
+ /** Validate native funding terms before exposing them or restoring a swap. */
163
+ export declare function assertSparkFunding(data: SparkToEvmSwapResponse, ownHash: string): void;
@@ -38,6 +38,7 @@ export interface Asset {
38
38
  * ```
39
39
  */
40
40
  export declare const Asset: {
41
+ readonly BTC_SPARK: Asset;
41
42
  readonly BTC_LIGHTNING: Asset;
42
43
  readonly BTC_ARKADE: Asset;
43
44
  readonly BTC_ONCHAIN: Asset;
@@ -192,3 +193,7 @@ export declare function getCctpBridgeTokens(): BridgeTokenInfo[];
192
193
  * Excludes source chains (those already have USDT0 tokens from the backend).
193
194
  */
194
195
  export declare function getUsdt0BridgeTokens(): BridgeTokenInfo[];
196
+ /** Bitcoin on native Spark. */
197
+ export declare function isSpark(token: {
198
+ chain: string;
199
+ }): boolean;
@@ -12,7 +12,7 @@
12
12
  * Hand-written rather than re-exported from codegen so the SDK surface stays
13
13
  * decoupled; the union widens additively as new bridge chains land.
14
14
  */
15
- export type Chain = "Arkade" | "Lightning" | "Bitcoin" | "Solana" | "Tron" | "1" | "137" | "42161" | "30" | "31" | "10" | "8453" | "43114" | "130" | "59144" | "146" | "480" | "143" | "1329" | "50" | "999" | "57073";
15
+ export type Chain = "Arkade" | "Lightning" | "Spark" | "Bitcoin" | "Solana" | "Tron" | "1" | "137" | "42161" | "30" | "31" | "10" | "8453" | "43114" | "130" | "59144" | "146" | "480" | "143" | "1329" | "50" | "999" | "57073";
16
16
  /**
17
17
  * The chain identifiers the **server** actually speaks on the wire — mirrors
18
18
  * `crate::Chain` and the generated `components["schemas"]["Chain"]`. Bridge
@@ -20,4 +20,4 @@ export type Chain = "Arkade" | "Lightning" | "Bitcoin" | "Solana" | "Tron" | "1"
20
20
  * carried in `bridge_target_chain`. Use this for anything sent to / received
21
21
  * from the server; use {@link Chain} for the SDK's public surface.
22
22
  */
23
- export type WireChain = "Arkade" | "Lightning" | "Bitcoin" | "1" | "137" | "42161" | "30" | "31";
23
+ export type WireChain = "Arkade" | "Lightning" | "Spark" | "Bitcoin" | "1" | "137" | "42161" | "30" | "31";
@@ -10,6 +10,7 @@ export type { Chain, WireChain } from "./chain.cjs";
10
10
  export { type ChainConfigEntry, type ChainConfigResponse, fromWireChainConfigResponse, type TokenRef, type WireChainConfigResponse, } from "./chain-config.cjs";
11
11
  export { type BridgeRate, type BridgeRouter, type DexQuoteAmount, type DexQuoteResponse, fromWireDexQuoteResponse, type Token, type TokenAmount, type WireDexQuoteResponse, } from "./dex-quote.cjs";
12
12
  export { fromWireNetworkFeePairEntry, fromWireNetworkFeesResponse, type NetworkFee, type NetworkFeePairEntry, type NetworkFeesResponse, type WireNetworkFeesResponse, } from "./network-fees.cjs";
13
+ export type { AppliedPromo } from "./promo-code.cjs";
13
14
  export { fromWireQuoteResponse, type QuoteResponse, type WireQuoteResponse, } from "./quote.cjs";
14
15
  export { fromWireReferralFeeResponse, type ReferralFeeResponse, type WireReferralFeeResponse, } from "./referral-fee.cjs";
15
16
  export { fromWireSwapPairsResponse, type SwapPairInfo, type SwapPairsResponse, type WireSwapPairsResponse, } from "./swap-pairs.cjs";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The promo code a quote was priced with, on `QuoteResponse.promo` and
3
+ * `ReferralFeeResponse.promo`. The quote's `protocol_fee_rate` and
4
+ * `max_amount` already include it.
5
+ */
6
+ export interface AppliedPromo {
7
+ code: string;
8
+ /**
9
+ * The promo's base fee as a decimal fraction (`0.001` = 0.1%). The swap's
10
+ * base fee is the lower of it and the route's; any extra fee is added on top.
11
+ */
12
+ fee_rate: number;
13
+ /** Largest swap the code applies to, in sats. Lifts the route maximum when higher. */
14
+ max_amount_sats: number;
15
+ }
@@ -1,3 +1,4 @@
1
+ import type { AppliedPromo } from "./promo-code.cjs";
1
2
  /**
2
3
  * `QuoteResponse` — end-to-end pricing for a swap between BTC and an
3
4
  * EVM/Arkade/Lightning target.
@@ -57,6 +58,11 @@ export interface QuoteResponse {
57
58
  * request, or for inbound CCTP swaps.
58
59
  */
59
60
  bridge_fee?: number | null;
61
+ /**
62
+ * The promo code this quote was priced with, when `promoCode` was passed.
63
+ * `protocol_fee_rate` and `max_amount` already include it.
64
+ */
65
+ promo?: AppliedPromo;
60
66
  }
61
67
  /**
62
68
  * Wire payload shape for `GET /quote` — matches the OpenAPI-generated
@@ -75,6 +81,7 @@ export interface WireQuoteResponse {
75
81
  net_source_amount: string;
76
82
  net_target_amount: string;
77
83
  bridge_fee?: number | null;
84
+ promo?: AppliedPromo | null;
78
85
  }
79
86
  /**
80
87
  * Translate the wire payload into the SDK-facing type.
@@ -1,3 +1,4 @@
1
+ import type { AppliedPromo } from "./promo-code.cjs";
1
2
  /**
2
3
  * `ReferralFeeResponse` — the referral / extra-fee delta for a referral code.
3
4
  *
@@ -20,12 +21,19 @@ export interface ReferralFeeResponse {
20
21
  * means the pair fee applies.
21
22
  */
22
23
  base_fee_rate?: number;
24
+ /**
25
+ * The promo, when a `promoCode` was passed. The base fee is the **lower**
26
+ * of its `fee_rate` and `base_fee_rate ?? fee_percentage`; `extra_fee_rate`
27
+ * is still added on top.
28
+ */
29
+ promo?: AppliedPromo;
23
30
  /** Partner label for the referral code, when registered. Informational. */
24
31
  referral_label?: string;
25
32
  }
26
33
  export interface WireReferralFeeResponse {
27
34
  extra_fee_rate: number;
28
35
  base_fee_rate?: number | null;
36
+ promo?: AppliedPromo | null;
29
37
  referral_label?: string | null;
30
38
  }
31
39
  export declare function fromWireReferralFeeResponse(wire: WireReferralFeeResponse): ReferralFeeResponse;
@@ -1,8 +1,8 @@
1
1
  export declare const SDK_NAME = "swap";
2
- export declare const SDK_VERSION = "1.11.1";
3
- export declare const SDK_COMMIT_HASH = "082a5f12e1766f59a5ff63bef69e81ce27453535";
2
+ export declare const SDK_VERSION = "1.12.0";
3
+ export declare const SDK_COMMIT_HASH = "b879d66501467b20d1170fb57c7a3ad5fbd2aae6";
4
4
  /** @deprecated Retained for source compatibility; requests no longer send it. */
5
- export declare const SATORA_SERVER_VERSION = "0.3.29";
6
- export declare const CLIENT_AGENT = "swap/1.11.1";
5
+ export declare const SATORA_SERVER_VERSION = "0.3.30";
6
+ export declare const CLIENT_AGENT = "swap/1.12.0";
7
7
  export declare const DEFAULT_AA_BUNDLER_URL = "https://arb-mainnet.g.alchemy.com/v2/ZaG_75AoAHzPqzmys5jpD";
8
8
  export declare const DEFAULT_AA_POLICY_ID = "878b1c90-5b53-4c9c-8892-6d7659dd2e72";
@@ -225,6 +225,8 @@ export declare class Client {
225
225
  /** Delegated to the legacy client (migration checkpoint). */
226
226
  createLightningToEvmSwap(...args: Parameters<LegacyClient["createLightningToEvmSwap"]>): ReturnType<LegacyClient["createLightningToEvmSwap"]>;
227
227
  /** Delegated to the legacy client (migration checkpoint). */
228
+ createSparkToEvmSwap(...args: Parameters<LegacyClient["createSparkToEvmSwap"]>): ReturnType<LegacyClient["createSparkToEvmSwap"]>;
229
+ /** Delegated to the legacy client (migration checkpoint). */
228
230
  createLightningToBitcoinSwap(...args: Parameters<LegacyClient["createLightningToBitcoinSwap"]>): ReturnType<LegacyClient["createLightningToBitcoinSwap"]>;
229
231
  /** Delegated to the legacy client (migration checkpoint). */
230
232
  createBitcoinToLightningSwap(...args: Parameters<LegacyClient["createBitcoinToLightningSwap"]>): ReturnType<LegacyClient["createBitcoinToLightningSwap"]>;
@@ -37,3 +37,4 @@ export interface ApiClientOptions {
37
37
  defaultHeaders?: Record<string, string>;
38
38
  }
39
39
  export declare function createApiClient(options: ApiClientOptions): ApiClient;
40
+ export type SparkToEvmSwapResponse = components["schemas"]["SparkToEvmSwapResponse"];