@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
@@ -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"];
@@ -7,7 +7,7 @@ import type { CctpFundSwapFromSolanaResult, SolanaCctpProgressStep } from "./cct
7
7
  import type { SolanaSigner } from "./cctp-inbound/solana/types.cjs";
8
8
  import type { AaConfig } from "./cctp-inbound/types.cjs";
9
9
  import { type ComposeQuoteParams } from "./compose-quote.cjs";
10
- import { type ArkadeToEvmSwapOptions, type ArkadeToEvmSwapResult, type ArkadeToLightningSwapOptions, type ArkadeToLightningSwapResult, type BitcoinToArkadeSwapOptions, type BitcoinToArkadeSwapResult, type BitcoinToEvmSwapOptions, type BitcoinToEvmSwapResult, type BitcoinToLightningSwapOptions, type BitcoinToLightningSwapResult, type CreateSwapOptions, type CreateSwapResult, type EvmToArkadeSwapGenericOptions, type EvmToArkadeSwapGenericResult, type EvmToBitcoinSwapOptions, type EvmToBitcoinSwapResult, type EvmToLightningSwapOptions, type EvmToLightningSwapResult, type LightningToArkadeSwapOptions, type LightningToArkadeSwapResult, type LightningToBitcoinSwapOptions, type LightningToBitcoinSwapResult, type LightningToEvmSwapOptions, type LightningToEvmSwapResult } from "./create/index.cjs";
10
+ import { type ArkadeToEvmSwapOptions, type ArkadeToEvmSwapResult, type ArkadeToLightningSwapOptions, type ArkadeToLightningSwapResult, type BitcoinToArkadeSwapOptions, type BitcoinToArkadeSwapResult, type BitcoinToEvmSwapOptions, type BitcoinToEvmSwapResult, type BitcoinToLightningSwapOptions, type BitcoinToLightningSwapResult, type CreateSwapOptions, type CreateSwapResult, type EvmToArkadeSwapGenericOptions, type EvmToArkadeSwapGenericResult, type EvmToBitcoinSwapOptions, type EvmToBitcoinSwapResult, type EvmToLightningSwapOptions, type EvmToLightningSwapResult, type LightningToArkadeSwapOptions, type LightningToArkadeSwapResult, type LightningToBitcoinSwapOptions, type LightningToBitcoinSwapResult, type LightningToEvmSwapOptions, type LightningToEvmSwapResult, type SparkToEvmSwapOptions, type SparkToEvmSwapResult } from "./create/index.cjs";
11
11
  import { type ExpectedFunding, type FundingPins } from "./evm/funding-pins.cjs";
12
12
  import { type CollabRefundEvmTypedData, type Permit2SignedFundingCallData, type UnsignedPermit2FundingData } from "./evm/index.cjs";
13
13
  import { type EvmSigner } from "./evm/wallet.cjs";
@@ -16,9 +16,9 @@ import { type ClaimGaslessResult, type ClaimResult } from "./redeem/index.cjs";
16
16
  import { type RifRelayConfig } from "./redeem/rif-relay.cjs";
17
17
  import { Signer, type SwapParams } from "./signer/index.cjs";
18
18
  import { type EvmRehashRecord, type StoredSwap, type SwapStorage, type WalletStorage } from "./storage/index.cjs";
19
- import { type Chain, type ChainConfigResponse, type DexQuoteAmount, type DexQuoteResponse, type NetworkFeesResponse, type QuoteResponse, type ReferralFeeResponse, type SwapPairsResponse, type Token } from "./types/index.cjs";
19
+ import { type AppliedPromo, type Chain, type ChainConfigResponse, type DexQuoteAmount, type DexQuoteResponse, type NetworkFeesResponse, type QuoteResponse, type ReferralFeeResponse, type SwapPairsResponse, type Token } from "./types/index.cjs";
20
20
  import { type SwapStatusHandler } from "./ws.cjs";
21
- export type { ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, CreateSwapOptions, CreateSwapResult, EvmChain, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, UsdcBridgeParams, } from "./create/index.cjs";
21
+ export type { ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, CreateSwapOptions, CreateSwapResult, EvmChain, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, SparkToEvmSwapOptions, SparkToEvmSwapResponse, SparkToEvmSwapResult, UsdcBridgeParams, } from "./create/index.cjs";
22
22
  export { buildCollabRefundEvmDigest, buildCollabRefundEvmTypedData, buildEip2612PermitDigest, buildPermit2FundingDigest, buildRedeemCalls, buildRedeemDigest, type CollabRefundEvmDigestParams, type CollabRefundEvmTypedData, type CoordinatorCall, type Eip2612PermitParams, type ExecuteAndCreateWithPermit2Params, encodeExecuteAndCreateWithPermit2, encodeRedeemAndExecute, encodeRefundTo, PERMIT2_ADDRESS, type Permit2FundingParams, type Permit2SignedFundingCallData, type RedeemAndExecuteCallData, type RedeemAndExecuteParams, type RedeemDigestParams, type RefundToParams, } from "./evm/index.cjs";
23
23
  export type { ClaimGaslessResult, ClaimResult, CoordinatorClaimData, EthereumClaimData, } from "./redeem/index.cjs";
24
24
  /** A support agent's Nostr identity */
@@ -425,6 +425,13 @@ export interface GetQuoteParams {
425
425
  * so the quoted fee matches what's charged.
426
426
  */
427
427
  extraFees?: number;
428
+ /**
429
+ * Optional promo code. Its rate replaces the base fee, and
430
+ * its cap may lift the route maximum. Pass it identically on the quote
431
+ * and the create. Rejected (400) when unknown, expired, used up, or the
432
+ * swap is larger than it allows.
433
+ */
434
+ promoCode?: string;
428
435
  /**
429
436
  * Optional Lightning destination (BOLT11 invoice, lightning address or
430
437
  * LNURL) for Arkade/EVM → Lightning quotes. When set, the quote is served
@@ -497,6 +504,13 @@ export interface GetLightningSendQuoteParams {
497
504
  * Must be passed identically on the corresponding createSwap.
498
505
  */
499
506
  extraFees?: number;
507
+ /**
508
+ * Optional promo code. Its rate replaces the base fee, and
509
+ * its cap may lift the route maximum. Pass it identically on the quote
510
+ * and the create. Rejected (400) when unknown, expired, used up, or the
511
+ * swap is larger than it allows.
512
+ */
513
+ promoCode?: string;
500
514
  }
501
515
  /**
502
516
  * Exact quote for a swap paying out over Lightning. Amounts in sats unless
@@ -534,6 +548,11 @@ export interface LightningSendQuote {
534
548
  * already sats.
535
549
  */
536
550
  exchangeRate: string;
551
+ /**
552
+ * The promo code this quote was priced with, when `promoCode` was passed.
553
+ * `protocolFeeRate` and `maxAmountSats` already include it.
554
+ */
555
+ promo?: AppliedPromo;
537
556
  }
538
557
  /**
539
558
  * Default Electrum WebSocket endpoints by network — Satora's own Fulcrum for
@@ -978,6 +997,13 @@ export declare class Client {
978
997
  getReferralFee(params: {
979
998
  referralCode?: string;
980
999
  extraFees?: number;
1000
+ /**
1001
+ * Optional promo code. Its rate replaces the base fee, and
1002
+ * its cap may lift the route maximum. Pass it identically on the quote
1003
+ * and the create. Rejected (400) when unknown, expired, used up, or the
1004
+ * swap is larger than it allows.
1005
+ */
1006
+ promoCode?: string;
981
1007
  }): Promise<ReferralFeeResponse>;
982
1008
  /**
983
1009
  * Per-pair network-fee estimates in sats at current gas/mining prices.
@@ -1595,6 +1621,7 @@ export declare class Client {
1595
1621
  * ```
1596
1622
  */
1597
1623
  createLightningToEvmSwap(options: LightningToEvmSwapOptions): Promise<LightningToEvmSwapResult>;
1624
+ createSparkToEvmSwap(options: SparkToEvmSwapOptions): Promise<SparkToEvmSwapResult>;
1598
1625
  /**
1599
1626
  * Creates a new Arkade to Lightning swap.
1600
1627
  *
@@ -25,7 +25,7 @@
25
25
  * Foreign-target EVM↔EVM (neither side BTC) is not supported and throws
26
26
  * `UnsupportedComposeQuotePath`.
27
27
  */
28
- import type { Chain, ChainConfigResponse, DexQuoteResponse, NetworkFeesResponse, QuoteResponse, SwapPairsResponse, Token } from "./types/index.cjs";
28
+ import type { AppliedPromo, Chain, ChainConfigResponse, DexQuoteResponse, NetworkFeesResponse, QuoteResponse, SwapPairsResponse, Token } from "./types/index.cjs";
29
29
  export declare class UnsupportedComposeQuotePath extends Error {
30
30
  constructor(message: string);
31
31
  }
@@ -43,6 +43,13 @@ export interface ComposeQuoteParams {
43
43
  referralCode?: string;
44
44
  /** Per-swap extra-fee surcharge (bps), capped per referral key. */
45
45
  extraFees?: number;
46
+ /**
47
+ * Optional promo code. Its rate replaces the base fee, and
48
+ * its cap may lift the route maximum. Pass it identically on the quote
49
+ * and the create. Rejected (400) when unknown, expired, used up, or the
50
+ * swap is larger than it allows.
51
+ */
52
+ promoCode?: string;
46
53
  /**
47
54
  * `true` when a Solana CCTP recipient has no USDC ATA yet — folds the higher
48
55
  * ATA-setup bridge fee. Only meaningful for Solana targets.
@@ -72,6 +79,12 @@ export interface ComposeQuoteDeps {
72
79
  * added. Omitted for keys without a partner rate.
73
80
  */
74
81
  referralBaseFeeRate?: number;
82
+ /**
83
+ * Promo from `/referral-fee`. The base fee is the lower of its `fee_rate`
84
+ * and `referralBaseFeeRate ?? fee_percentage`, and its `max_amount_sats`
85
+ * lifts the pair maximum, mirroring the server's `with_promo`.
86
+ */
87
+ referralPromo?: AppliedPromo;
75
88
  /**
76
89
  * DEX-leg quote primitive — `Client.getDexQuote` once bound to the
77
90
  * underlying HTTP client.
@@ -20,4 +20,5 @@ export { createLightningToArkadeSwap } from "./lightning-to-arkade.cjs";
20
20
  export { createLightningToBitcoinSwap } from "./lightning-to-bitcoin.cjs";
21
21
  export { createLightningToEvmSwap } from "./lightning-to-evm.cjs";
22
22
  export { DuplicateInvoiceError } from "./retry.cjs";
23
- export type { ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, CreateSwapContext, CreateSwapOptions, CreateSwapResult, EvmChain, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, LightningToArkadeSwapOptions, LightningToArkadeSwapResult, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, UsdcBridgeParams, } from "./types.cjs";
23
+ export { createSparkToEvmSwap } from "./spark-to-evm.cjs";
24
+ export type { ArkadeToEvmSwapOptions, ArkadeToEvmSwapResult, ArkadeToLightningSwapOptions, ArkadeToLightningSwapResult, BitcoinToArkadeSwapOptions, BitcoinToArkadeSwapResult, BitcoinToEvmSwapOptions, BitcoinToEvmSwapResponse, BitcoinToEvmSwapResult, BitcoinToLightningSwapOptions, BitcoinToLightningSwapResult, BtcToEvmSwapOptions, CreateSwapContext, CreateSwapOptions, CreateSwapResult, EvmChain, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult, EvmToArkadeSwapOptions, EvmToArkadeSwapResult, EvmToBitcoinSwapOptions, EvmToBitcoinSwapResult, EvmToLightningSwapOptions, EvmToLightningSwapResult, LightningToArkadeSwapOptions, LightningToArkadeSwapResult, LightningToBitcoinSwapOptions, LightningToBitcoinSwapResult, LightningToEvmSwapOptions, LightningToEvmSwapResponse, LightningToEvmSwapResult, SparkToEvmSwapOptions, SparkToEvmSwapResponse, SparkToEvmSwapResult, UsdcBridgeParams, } from "./types.cjs";
@@ -0,0 +1,7 @@
1
+ import type { CreateSwapContext, SparkToEvmSwapOptions, SparkToEvmSwapResult } from "./types.cjs";
2
+ export declare function createSparkToEvmSwap(options: SparkToEvmSwapOptions, ctx: CreateSwapContext,
3
+ /**
4
+ * The lock's claim address when it is not this swap's own key: the
5
+ * recipient's RIF Relay smart wallet on a chain that claims through RIF.
6
+ */
7
+ claimingAddressOverride?: string): Promise<SparkToEvmSwapResult>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types for swap creation operations.
3
3
  */
4
- import type { BitcoinToEvmSwapResponse as ApiBitcoinToEvmSwapResponse, ApiClient, EvmToBitcoinSwapResponse as ApiEvmToBitcoinSwapResponse, LightningToEvmSwapResponse as ApiLightningToEvmSwapResponse, ArkadeToEvmSwapResponse, ArkadeToLightningSwapResponse, BitcoinToLightningSwapResponse, BtcToArkadeSwapResponse, EvmToArkadeSwapResponse, EvmToLightningSwapResponse, LightningToArkadeSwapResponse, LightningToBitcoinSwapResponse, TokenId, TokenInfo } from "../api/client.cjs";
4
+ import type { BitcoinToEvmSwapResponse as ApiBitcoinToEvmSwapResponse, ApiClient, EvmToBitcoinSwapResponse as ApiEvmToBitcoinSwapResponse, LightningToEvmSwapResponse as ApiLightningToEvmSwapResponse, SparkToEvmSwapResponse as ApiSparkToEvmSwapResponse, ArkadeToEvmSwapResponse, ArkadeToLightningSwapResponse, BitcoinToLightningSwapResponse, BtcToArkadeSwapResponse, EvmToArkadeSwapResponse, EvmToLightningSwapResponse, LightningToArkadeSwapResponse, LightningToBitcoinSwapResponse, TokenId, TokenInfo } from "../api/client.cjs";
5
5
  import type { EvmFundingTerms } from "../evm/funding-pins.cjs";
6
6
  import type { Logger, LogLevel } from "../logging.cjs";
7
7
  import type { SwapParams } from "../signer/index.cjs";
@@ -69,6 +69,13 @@ export interface BtcToEvmSwapOptions {
69
69
  referralCode?: string;
70
70
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
71
71
  extraFees?: number;
72
+ /**
73
+ * Optional promo code. Its rate replaces the base fee, and
74
+ * its cap may lift the route maximum. Pass it identically on the quote
75
+ * and the create. Rejected (400) when unknown, expired, used up, or the
76
+ * swap is larger than it allows.
77
+ */
78
+ promoCode?: string;
72
79
  }
73
80
  /** Options for creating a Bitcoin (on-chain) to EVM swap via the generic endpoint */
74
81
  export interface BitcoinToEvmSwapOptions {
@@ -86,6 +93,13 @@ export interface BitcoinToEvmSwapOptions {
86
93
  referralCode?: string;
87
94
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
88
95
  extraFees?: number;
96
+ /**
97
+ * Optional promo code. Its rate replaces the base fee, and
98
+ * its cap may lift the route maximum. Pass it identically on the quote
99
+ * and the create. Rejected (400) when unknown, expired, used up, or the
100
+ * swap is larger than it allows.
101
+ */
102
+ promoCode?: string;
89
103
  /** Whether the server should execute the DEX swap on behalf of the user (gasless claim). Defaults to true. */
90
104
  gasless?: boolean;
91
105
  /** Optional: when set, USDC is bridged via CCTP to the destination chain after the DEX swap. */
@@ -113,6 +127,13 @@ export interface LightningToEvmSwapOptions {
113
127
  referralCode?: string;
114
128
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
115
129
  extraFees?: number;
130
+ /**
131
+ * Optional promo code. Its rate replaces the base fee, and
132
+ * its cap may lift the route maximum. Pass it identically on the quote
133
+ * and the create. Rejected (400) when unknown, expired, used up, or the
134
+ * swap is larger than it allows.
135
+ */
136
+ promoCode?: string;
116
137
  /** Whether the server should execute the DEX swap on behalf of the user (gasless claim). Defaults to true. */
117
138
  gasless?: boolean;
118
139
  /** Optional: when set, the DEX output is bridged to the destination chain after the claim. */
@@ -142,6 +163,13 @@ export interface BitcoinToArkadeSwapOptions {
142
163
  referralCode?: string;
143
164
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
144
165
  extraFees?: number;
166
+ /**
167
+ * Optional promo code. Its rate replaces the base fee, and
168
+ * its cap may lift the route maximum. Pass it identically on the quote
169
+ * and the create. Rejected (400) when unknown, expired, used up, or the
170
+ * swap is larger than it allows.
171
+ */
172
+ promoCode?: string;
145
173
  }
146
174
  /** Result of creating a Bitcoin (on-chain) to Arkade swap */
147
175
  export interface BitcoinToArkadeSwapResult {
@@ -166,6 +194,13 @@ export interface EvmToArkadeSwapOptions {
166
194
  referralCode?: string;
167
195
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
168
196
  extraFees?: number;
197
+ /**
198
+ * Optional promo code. Its rate replaces the base fee, and
199
+ * its cap may lift the route maximum. Pass it identically on the quote
200
+ * and the create. Rejected (400) when unknown, expired, used up, or the
201
+ * swap is larger than it allows.
202
+ */
203
+ promoCode?: string;
169
204
  }
170
205
  /** Result of creating an EVM to Arkade swap */
171
206
  export interface EvmToArkadeSwapResult {
@@ -192,6 +227,13 @@ export interface EvmToArkadeSwapGenericOptions {
192
227
  referralCode?: string;
193
228
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
194
229
  extraFees?: number;
230
+ /**
231
+ * Optional promo code. Its rate replaces the base fee, and
232
+ * its cap may lift the route maximum. Pass it identically on the quote
233
+ * and the create. Rejected (400) when unknown, expired, used up, or the
234
+ * swap is larger than it allows.
235
+ */
236
+ promoCode?: string;
195
237
  /** Use gasless relay. When true, userAddress is auto-derived from the SDK EVM key. */
196
238
  gasless?: boolean;
197
239
  /** Optional: when set, source USDC originates on another CCTP chain and hops to Arbitrum via CCTPv2. */
@@ -222,6 +264,13 @@ export interface EvmToBitcoinSwapOptions {
222
264
  referralCode?: string;
223
265
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
224
266
  extraFees?: number;
267
+ /**
268
+ * Optional promo code. Its rate replaces the base fee, and
269
+ * its cap may lift the route maximum. Pass it identically on the quote
270
+ * and the create. Rejected (400) when unknown, expired, used up, or the
271
+ * swap is larger than it allows.
272
+ */
273
+ promoCode?: string;
225
274
  /** Use gasless relay. When true, userAddress is auto-derived from the SDK EVM key. */
226
275
  gasless?: boolean;
227
276
  /** Optional: when set, source USDC originates on another CCTP chain and hops to Arbitrum via CCTPv2. */
@@ -253,6 +302,13 @@ export interface ArkadeToEvmSwapOptions {
253
302
  referralCode?: string;
254
303
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
255
304
  extraFees?: number;
305
+ /**
306
+ * Optional promo code. Its rate replaces the base fee, and
307
+ * its cap may lift the route maximum. Pass it identically on the quote
308
+ * and the create. Rejected (400) when unknown, expired, used up, or the
309
+ * swap is larger than it allows.
310
+ */
311
+ promoCode?: string;
256
312
  /** Whether the server should execute the DEX swap on behalf of the user (gasless claim). Defaults to true. */
257
313
  gasless?: boolean;
258
314
  /** Optional: when set, USDC is bridged via CCTP to the destination chain after the DEX swap. */
@@ -308,6 +364,13 @@ export interface CreateSwapOptions {
308
364
  referralCode?: string;
309
365
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
310
366
  extraFees?: number;
367
+ /**
368
+ * Optional promo code. Its rate replaces the base fee, and
369
+ * its cap may lift the route maximum. Pass it identically on the quote
370
+ * and the create. Rejected (400) when unknown, expired, used up, or the
371
+ * swap is larger than it allows.
372
+ */
373
+ promoCode?: string;
311
374
  /** Whether to use gasless relay for EVM funding (no wallet needed). When true, the SDK-derived EVM address is used as the depositor. */
312
375
  gasless?: boolean;
313
376
  /** Optional: when set, USDC is bridged via CCTP to the destination chain after the DEX swap. */
@@ -343,6 +406,13 @@ export type LightningToArkadeSwapOptions = {
343
406
  referralCode?: string;
344
407
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
345
408
  extraFees?: number;
409
+ /**
410
+ * Optional promo code. Its rate replaces the base fee, and
411
+ * its cap may lift the route maximum. Pass it identically on the quote
412
+ * and the create. Rejected (400) when unknown, expired, used up, or the
413
+ * swap is larger than it allows.
414
+ */
415
+ promoCode?: string;
346
416
  /**
347
417
  * Optional description shown in the payer's wallet when they open the Lightning
348
418
  * invoice. When omitted, the server uses a default. An empty string is honored
@@ -379,6 +449,13 @@ export type ArkadeToLightningSwapOptions = {
379
449
  referralCode?: string;
380
450
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
381
451
  extraFees?: number;
452
+ /**
453
+ * Optional promo code. Its rate replaces the base fee, and
454
+ * its cap may lift the route maximum. Pass it identically on the quote
455
+ * and the create. Rejected (400) when unknown, expired, used up, or the
456
+ * swap is larger than it allows.
457
+ */
458
+ promoCode?: string;
382
459
  } & ({
383
460
  /**
384
461
  * BOLT11 invoice to pay. Its amount pins the payout; an optional
@@ -435,6 +512,13 @@ export type EvmToLightningSwapOptions = {
435
512
  referralCode?: string;
436
513
  /** Optional per-swap fee surcharge in basis points (0..=max_extra_fee_bps configured on the matching developer key). */
437
514
  extraFees?: number;
515
+ /**
516
+ * Optional promo code. Its rate replaces the base fee, and
517
+ * its cap may lift the route maximum. Pass it identically on the quote
518
+ * and the create. Rejected (400) when unknown, expired, used up, or the
519
+ * swap is larger than it allows.
520
+ */
521
+ promoCode?: string;
438
522
  /** Use gasless relay. When true, userAddress is auto-derived from the SDK EVM key. */
439
523
  gasless?: boolean;
440
524
  /** Optional: when set, source USDC originates on another CCTP chain and hops to Arbitrum via CCTPv2. */
@@ -497,7 +581,7 @@ export interface LightningToArkadeSwapResult {
497
581
  swapParams: SwapParams;
498
582
  }
499
583
  /** Union of all swap creation results returned by `createSwap`. */
500
- export type CreateSwapResult = ArkadeToEvmSwapResult | ArkadeToLightningSwapResult | BitcoinToEvmSwapResult | BitcoinToLightningSwapResult | BitcoinToArkadeSwapResult | LightningToArkadeSwapResult | LightningToBitcoinSwapResult | LightningToEvmSwapResult | EvmToArkadeSwapGenericResult | EvmToBitcoinSwapResult | EvmToLightningSwapResult;
584
+ export type CreateSwapResult = ArkadeToEvmSwapResult | ArkadeToLightningSwapResult | BitcoinToEvmSwapResult | BitcoinToLightningSwapResult | BitcoinToArkadeSwapResult | LightningToArkadeSwapResult | LightningToBitcoinSwapResult | LightningToEvmSwapResult | SparkToEvmSwapResult | EvmToArkadeSwapGenericResult | EvmToBitcoinSwapResult | EvmToLightningSwapResult;
501
585
  /**
502
586
  * Context passed to swap creation functions.
503
587
  * Contains the dependencies needed from the client.
@@ -532,4 +616,11 @@ export interface CreateSwapContext {
532
616
  evmFundingTerms?: EvmFundingTerms;
533
617
  }) => Promise<void>;
534
618
  }
619
+ /** Native Spark BTC funding; invoice descriptions do not apply. */
620
+ export type SparkToEvmSwapOptions = Omit<LightningToEvmSwapOptions, "invoiceDescription">;
621
+ export type SparkToEvmSwapResponse = ApiSparkToEvmSwapResponse;
622
+ export interface SparkToEvmSwapResult {
623
+ response: SparkToEvmSwapResponse;
624
+ swapParams: SwapParams;
625
+ }
535
626
  export {};