@satora/swap 1.11.1 → 1.13.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.
- package/dist/bitcoin-reader-electrum-2N4LJCGD.cjs +9 -0
- package/dist/{bitcoin-reader-electrum-VCQ5TQ44.cjs.map → bitcoin-reader-electrum-2N4LJCGD.cjs.map} +1 -1
- package/dist/bitcoin-reader-electrum-VLYRII3T.js +9 -0
- package/dist/bitcoin-reader-esplora-CAR4P52J.cjs +16 -0
- package/dist/bitcoin-reader-esplora-CAR4P52J.cjs.map +1 -0
- package/dist/{bitcoin-reader-esplora-CGPF4H5Y.js → bitcoin-reader-esplora-LC673MQT.js} +4 -2
- package/dist/{chunk-WQMAL2VD.js → chunk-34OYIFOU.js} +764 -141
- package/dist/chunk-34OYIFOU.js.map +1 -0
- package/dist/{chunk-4NVWIR74.cjs → chunk-3633KDTW.cjs} +1128 -505
- package/dist/chunk-3633KDTW.cjs.map +1 -0
- package/dist/{chunk-LSCRTQOS.js → chunk-CUYLQTRF.js} +15 -20
- package/dist/chunk-CUYLQTRF.js.map +1 -0
- package/dist/{chunk-INHFP222.cjs → chunk-CY5M5X6S.cjs} +28 -30
- package/dist/chunk-CY5M5X6S.cjs.map +1 -0
- package/dist/{chunk-JZTF4JNH.cjs → chunk-EI5ILLQ3.cjs} +2 -2
- package/dist/{chunk-JZTF4JNH.cjs.map → chunk-EI5ILLQ3.cjs.map} +1 -1
- package/dist/{chunk-5DQHR3RO.cjs → chunk-FJS6RGUR.cjs} +16 -21
- package/dist/chunk-FJS6RGUR.cjs.map +1 -0
- package/dist/{chunk-3ZMSZSAV.js → chunk-I2NF63VZ.js} +27 -29
- package/dist/chunk-I2NF63VZ.js.map +1 -0
- package/dist/{chunk-JHZHRY7S.js → chunk-K2Q4JWB6.js} +2 -2
- package/dist/{chunk-JHZHRY7S.js.map → chunk-K2Q4JWB6.js.map} +1 -1
- package/dist/{chunk-TT3J2OOS.js → chunk-KMBGRQS7.js} +5 -5
- package/dist/{chunk-TT3J2OOS.js.map → chunk-KMBGRQS7.js.map} +1 -1
- package/dist/{chunk-Q4TOBBAN.cjs → chunk-LZQZYSOZ.cjs} +5 -5
- package/dist/{chunk-Q4TOBBAN.cjs.map → chunk-LZQZYSOZ.cjs.map} +1 -1
- package/dist/delegate.cjs +2 -2
- package/dist/delegate.js +1 -1
- package/dist/{dist-SHY7I6SH.js → dist-3N76II5O.js} +16 -4
- package/dist/dist-KQINAMDC.cjs +406 -0
- package/dist/{dist-MHRQ5FFV.cjs.map → dist-KQINAMDC.cjs.map} +1 -1
- package/dist/{fundSwap-UBCHMUP4-BEMQNSFQ.cjs → fundSwap-2D4IPYU4-4NELKB3Q.cjs} +7 -7
- package/dist/{fundSwap-UBCHMUP4-BEMQNSFQ.cjs.map → fundSwap-2D4IPYU4-4NELKB3Q.cjs.map} +1 -1
- package/dist/{fundSwap-UBCHMUP4-WBLYE6MC.js → fundSwap-2D4IPYU4-CDM3WRUF.js} +3 -3
- package/dist/index.cjs +41 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -11
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +26 -5
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +26 -5
- package/dist/node.js.map +1 -1
- package/dist/types/cjs/pure/api/client.d.cts +1 -0
- package/dist/types/cjs/pure/client.d.cts +44 -12
- package/dist/types/cjs/pure/compose-quote.d.cts +14 -1
- package/dist/types/cjs/pure/create/bitcoin-payout.d.cts +17 -0
- package/dist/types/cjs/pure/create/evm-to-arkade.d.cts +0 -5
- package/dist/types/cjs/pure/create/evm-to-lightning.d.cts +0 -8
- package/dist/types/cjs/pure/create/funding-terms.d.cts +2 -1
- package/dist/types/cjs/pure/create/index.d.cts +2 -1
- package/dist/types/cjs/pure/create/payment-safety.d.cts +2 -0
- package/dist/types/cjs/pure/create/payout-slippage.d.cts +29 -0
- package/dist/types/cjs/pure/create/spark-to-evm.d.cts +7 -0
- package/dist/types/cjs/pure/create/types.d.cts +102 -3
- package/dist/types/cjs/pure/esplora.d.cts +2 -0
- package/dist/types/cjs/pure/evm/funding-pins.d.cts +2 -0
- package/dist/types/cjs/pure/generated/api.d.cts +352 -2
- package/dist/types/cjs/pure/index.d.cts +6 -4
- package/dist/types/cjs/pure/refund/onchain.d.cts +4 -0
- package/dist/types/cjs/pure/storage/index.d.cts +1 -1
- package/dist/types/cjs/pure/storage/types.d.cts +22 -0
- package/dist/types/cjs/pure/swap-verification.d.cts +3 -1
- package/dist/types/cjs/pure/tokens.d.cts +5 -0
- package/dist/types/cjs/pure/types/chain.d.cts +2 -2
- package/dist/types/cjs/pure/types/index.d.cts +1 -0
- package/dist/types/cjs/pure/types/promo-code.d.cts +15 -0
- package/dist/types/cjs/pure/types/quote.d.cts +7 -0
- package/dist/types/cjs/pure/types/referral-fee.d.cts +8 -0
- package/dist/types/cjs/pure/version.d.cts +4 -4
- package/dist/types/cjs/swap/client.d.cts +2 -0
- package/dist/types/cjs/swap/contracts/bitcoin-reader-esplora.d.cts +5 -0
- package/dist/types/esm/pure/api/client.d.ts +1 -0
- package/dist/types/esm/pure/client.d.ts +44 -12
- package/dist/types/esm/pure/compose-quote.d.ts +14 -1
- package/dist/types/esm/pure/create/bitcoin-payout.d.ts +17 -0
- package/dist/types/esm/pure/create/evm-to-arkade.d.ts +0 -5
- package/dist/types/esm/pure/create/evm-to-lightning.d.ts +0 -8
- package/dist/types/esm/pure/create/funding-terms.d.ts +2 -1
- package/dist/types/esm/pure/create/index.d.ts +2 -1
- package/dist/types/esm/pure/create/payment-safety.d.ts +2 -0
- package/dist/types/esm/pure/create/payout-slippage.d.ts +29 -0
- package/dist/types/esm/pure/create/spark-to-evm.d.ts +7 -0
- package/dist/types/esm/pure/create/types.d.ts +102 -3
- package/dist/types/esm/pure/esplora.d.ts +2 -0
- package/dist/types/esm/pure/evm/funding-pins.d.ts +2 -0
- package/dist/types/esm/pure/generated/api.d.ts +352 -2
- package/dist/types/esm/pure/index.d.ts +6 -4
- package/dist/types/esm/pure/refund/onchain.d.ts +4 -0
- package/dist/types/esm/pure/storage/index.d.ts +1 -1
- package/dist/types/esm/pure/storage/types.d.ts +22 -0
- package/dist/types/esm/pure/swap-verification.d.ts +3 -1
- package/dist/types/esm/pure/tokens.d.ts +5 -0
- package/dist/types/esm/pure/types/chain.d.ts +2 -2
- package/dist/types/esm/pure/types/index.d.ts +1 -0
- package/dist/types/esm/pure/types/promo-code.d.ts +15 -0
- package/dist/types/esm/pure/types/quote.d.ts +7 -0
- package/dist/types/esm/pure/types/referral-fee.d.ts +8 -0
- package/dist/types/esm/pure/version.d.ts +4 -4
- package/dist/types/esm/swap/client.d.ts +2 -0
- package/dist/types/esm/swap/contracts/bitcoin-reader-esplora.d.ts +5 -0
- package/package.json +2 -2
- package/dist/bitcoin-reader-electrum-4PNSDHIA.js +0 -9
- package/dist/bitcoin-reader-electrum-VCQ5TQ44.cjs +0 -9
- package/dist/bitcoin-reader-esplora-6RH7S4BR.cjs +0 -14
- package/dist/bitcoin-reader-esplora-6RH7S4BR.cjs.map +0 -1
- package/dist/chunk-3ZMSZSAV.js.map +0 -1
- package/dist/chunk-4NVWIR74.cjs.map +0 -1
- package/dist/chunk-5DQHR3RO.cjs.map +0 -1
- package/dist/chunk-INHFP222.cjs.map +0 -1
- package/dist/chunk-LSCRTQOS.js.map +0 -1
- package/dist/chunk-WQMAL2VD.js.map +0 -1
- package/dist/dist-MHRQ5FFV.cjs +0 -394
- /package/dist/{bitcoin-reader-electrum-4PNSDHIA.js.map → bitcoin-reader-electrum-VLYRII3T.js.map} +0 -0
- /package/dist/{bitcoin-reader-esplora-CGPF4H5Y.js.map → bitcoin-reader-esplora-LC673MQT.js.map} +0 -0
- /package/dist/{dist-SHY7I6SH.js.map → dist-3N76II5O.js.map} +0 -0
- /package/dist/{fundSwap-UBCHMUP4-WBLYE6MC.js.map → fundSwap-2D4IPYU4-CDM3WRUF.js.map} +0 -0
|
@@ -170,6 +170,22 @@ export interface paths {
|
|
|
170
170
|
patch?: never;
|
|
171
171
|
trace?: never;
|
|
172
172
|
};
|
|
173
|
+
"/api/swap/{id}/refund-evm-gasless": {
|
|
174
|
+
parameters: {
|
|
175
|
+
query?: never;
|
|
176
|
+
header?: never;
|
|
177
|
+
path?: never;
|
|
178
|
+
cookie?: never;
|
|
179
|
+
};
|
|
180
|
+
get?: never;
|
|
181
|
+
put?: never;
|
|
182
|
+
post: operations["refund_evm_gasless"];
|
|
183
|
+
delete?: never;
|
|
184
|
+
options?: never;
|
|
185
|
+
head?: never;
|
|
186
|
+
patch?: never;
|
|
187
|
+
trace?: never;
|
|
188
|
+
};
|
|
173
189
|
"/api/swap/{id}/rehash-evm": {
|
|
174
190
|
parameters: {
|
|
175
191
|
query?: never;
|
|
@@ -823,6 +839,28 @@ export interface paths {
|
|
|
823
839
|
patch?: never;
|
|
824
840
|
trace?: never;
|
|
825
841
|
};
|
|
842
|
+
"/swap/spark/evm": {
|
|
843
|
+
parameters: {
|
|
844
|
+
query?: never;
|
|
845
|
+
header?: never;
|
|
846
|
+
path?: never;
|
|
847
|
+
cookie?: never;
|
|
848
|
+
};
|
|
849
|
+
get?: never;
|
|
850
|
+
put?: never;
|
|
851
|
+
/**
|
|
852
|
+
* Create a native Spark swap. Pay the returned address with a BTC HTLC
|
|
853
|
+
* using the response's hash, amount and expiry duration. An ordinary Spark
|
|
854
|
+
* transfer cannot fund this swap. The client retains the preimage until its
|
|
855
|
+
* EVM claim; unused HTLCs return to the payer at their expiry.
|
|
856
|
+
*/
|
|
857
|
+
post: operations["create_spark_evm_swap"];
|
|
858
|
+
delete?: never;
|
|
859
|
+
options?: never;
|
|
860
|
+
head?: never;
|
|
861
|
+
patch?: never;
|
|
862
|
+
trace?: never;
|
|
863
|
+
};
|
|
826
864
|
"/swap/{id}": {
|
|
827
865
|
parameters: {
|
|
828
866
|
query?: never;
|
|
@@ -1241,6 +1279,26 @@ export interface components {
|
|
|
1241
1279
|
entry_point: string;
|
|
1242
1280
|
};
|
|
1243
1281
|
AmountU256: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* @description A promo code applied to a swap, as returned by `/quote` and
|
|
1284
|
+
* `/referral-fee` so the frontend can show what it gives.
|
|
1285
|
+
*/
|
|
1286
|
+
AppliedPromo: {
|
|
1287
|
+
code: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* Format: double
|
|
1290
|
+
* @description The promo's base fee as a decimal fraction (e.g. `0.001` = 0.1%). The
|
|
1291
|
+
* swap's base fee is the lower of it and the route's base fee; any extra
|
|
1292
|
+
* fee is added on top.
|
|
1293
|
+
*/
|
|
1294
|
+
fee_rate: number;
|
|
1295
|
+
/**
|
|
1296
|
+
* Format: int64
|
|
1297
|
+
* @description Largest swap the code applies to, in sats, as the route's limit check
|
|
1298
|
+
* measures it. Lifts the route maximum when higher.
|
|
1299
|
+
*/
|
|
1300
|
+
max_amount_sats: number;
|
|
1301
|
+
};
|
|
1244
1302
|
/**
|
|
1245
1303
|
* @description Chain-agnostic request for Arkade-to-EVM swaps.
|
|
1246
1304
|
*
|
|
@@ -1305,6 +1363,11 @@ export interface components {
|
|
|
1305
1363
|
gasless?: boolean;
|
|
1306
1364
|
/** @description Hash lock provided by the client (32-byte hex string with 0x prefix). */
|
|
1307
1365
|
hash_lock: string;
|
|
1366
|
+
/**
|
|
1367
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
1368
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
1369
|
+
*/
|
|
1370
|
+
promo_code?: string | null;
|
|
1308
1371
|
/** @description Optional referral code for tracking. */
|
|
1309
1372
|
referral_code?: string | null;
|
|
1310
1373
|
/** @description Refund public key used to generate the Arkade VHTLC. */
|
|
@@ -1420,6 +1483,11 @@ export interface components {
|
|
|
1420
1483
|
* Mutually exclusive with the other destination fields.
|
|
1421
1484
|
*/
|
|
1422
1485
|
lnurl?: string | null;
|
|
1486
|
+
/**
|
|
1487
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
1488
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
1489
|
+
*/
|
|
1490
|
+
promo_code?: string | null;
|
|
1423
1491
|
/** @description Optional referral code for fee exemption */
|
|
1424
1492
|
referral_code?: string | null;
|
|
1425
1493
|
/** @description User's refund public key for the Arkade VHTLC (sender role). */
|
|
@@ -1546,6 +1614,11 @@ export interface components {
|
|
|
1546
1614
|
* Client will use the secret to claim the Arkade VHTLC later.
|
|
1547
1615
|
*/
|
|
1548
1616
|
hash_lock: string;
|
|
1617
|
+
/**
|
|
1618
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
1619
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
1620
|
+
*/
|
|
1621
|
+
promo_code?: string | null;
|
|
1549
1622
|
/** @description Optional referral code for fee exemption */
|
|
1550
1623
|
referral_code?: string | null;
|
|
1551
1624
|
/** @description User's refund public key for the on-chain Bitcoin HTLC */
|
|
@@ -1630,6 +1703,11 @@ export interface components {
|
|
|
1630
1703
|
gasless?: boolean;
|
|
1631
1704
|
/** @description Hash lock provided by the client (32-byte hex string with 0x prefix). */
|
|
1632
1705
|
hash_lock: string;
|
|
1706
|
+
/**
|
|
1707
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
1708
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
1709
|
+
*/
|
|
1710
|
+
promo_code?: string | null;
|
|
1633
1711
|
/** @description Optional referral code for tracking. */
|
|
1634
1712
|
referral_code?: string | null;
|
|
1635
1713
|
/** @description Refund public key used to generate the Bitcoin HTLC. */
|
|
@@ -1780,6 +1858,11 @@ export interface components {
|
|
|
1780
1858
|
* Mutually exclusive with the other destination fields.
|
|
1781
1859
|
*/
|
|
1782
1860
|
lnurl?: string | null;
|
|
1861
|
+
/**
|
|
1862
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
1863
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
1864
|
+
*/
|
|
1865
|
+
promo_code?: string | null;
|
|
1783
1866
|
/** @description Optional referral code for fee exemption */
|
|
1784
1867
|
referral_code?: string | null;
|
|
1785
1868
|
/** @description User's refund public key for the on-chain HTLC. */
|
|
@@ -2065,7 +2148,7 @@ export interface components {
|
|
|
2065
2148
|
* @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
2149
|
* @enum {string}
|
|
2067
2150
|
*/
|
|
2068
|
-
Chain: "Arkade" | "Lightning" | "Bitcoin" | "137" | "1" | "42161" | "30" | "31";
|
|
2151
|
+
Chain: "Arkade" | "Lightning" | "Spark" | "Bitcoin" | "137" | "1" | "42161" | "30" | "31";
|
|
2069
2152
|
/**
|
|
2070
2153
|
* @description Per-chain configuration. EVM chains only — Bitcoin / Lightning /
|
|
2071
2154
|
* Arkade don't have a meaningful chain-config shape.
|
|
@@ -2776,6 +2859,11 @@ export interface components {
|
|
|
2776
2859
|
gasless?: boolean;
|
|
2777
2860
|
/** @description Hash lock (0x-prefixed 32-byte hex). Client generates secret, computes SHA256(secret). */
|
|
2778
2861
|
hash_lock: string;
|
|
2862
|
+
/**
|
|
2863
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
2864
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
2865
|
+
*/
|
|
2866
|
+
promo_code?: string | null;
|
|
2779
2867
|
/** @description User's Arkade VHTLC claim key (receiver). */
|
|
2780
2868
|
receiver_pk: string;
|
|
2781
2869
|
/** @description Optional referral code for tracking. */
|
|
@@ -2948,6 +3036,17 @@ export interface components {
|
|
|
2948
3036
|
gasless?: boolean;
|
|
2949
3037
|
/** @description Hash lock (0x-prefixed 32-byte hex). Client generates secret, computes SHA256(secret). */
|
|
2950
3038
|
hash_lock: string;
|
|
3039
|
+
/**
|
|
3040
|
+
* Format: int64
|
|
3041
|
+
* @description Minimum net Bitcoin payout, including the client claim fee. Requires amount_out.
|
|
3042
|
+
* At most 1% below amount_out; fees are added to this floor before DEX execution.
|
|
3043
|
+
*/
|
|
3044
|
+
minimum_payout_sats?: number | null;
|
|
3045
|
+
/**
|
|
3046
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3047
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
3048
|
+
*/
|
|
3049
|
+
promo_code?: string | null;
|
|
2951
3050
|
/** @description Optional referral code for tracking. */
|
|
2952
3051
|
referral_code?: string | null;
|
|
2953
3052
|
/** @description User's target BTC address to receive claimed funds. */
|
|
@@ -3139,6 +3238,11 @@ export interface components {
|
|
|
3139
3238
|
* Mutually exclusive with the other destination fields.
|
|
3140
3239
|
*/
|
|
3141
3240
|
lnurl?: string | null;
|
|
3241
|
+
/**
|
|
3242
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3243
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
3244
|
+
*/
|
|
3245
|
+
promo_code?: string | null;
|
|
3142
3246
|
/** @description Optional referral code for fee exemption. */
|
|
3143
3247
|
referral_code?: string | null;
|
|
3144
3248
|
/**
|
|
@@ -3318,6 +3422,9 @@ export interface components {
|
|
|
3318
3422
|
}) | (components["schemas"]["LightningToEvmSwapResponse"] & {
|
|
3319
3423
|
/** @enum {string} */
|
|
3320
3424
|
direction: "lightning_to_evm";
|
|
3425
|
+
}) | (components["schemas"]["SparkToEvmSwapResponse"] & {
|
|
3426
|
+
/** @enum {string} */
|
|
3427
|
+
direction: "spark_to_evm";
|
|
3321
3428
|
}) | (components["schemas"]["BitcoinToEvmSwapResponse"] & {
|
|
3322
3429
|
/** @enum {string} */
|
|
3323
3430
|
direction: "bitcoin_to_evm";
|
|
@@ -3364,6 +3471,7 @@ export interface components {
|
|
|
3364
3471
|
* surplus over invoice + fees).
|
|
3365
3472
|
*/
|
|
3366
3473
|
network_fee_sats: number;
|
|
3474
|
+
promo?: null | components["schemas"]["AppliedPromo"];
|
|
3367
3475
|
/**
|
|
3368
3476
|
* Format: double
|
|
3369
3477
|
* @description Protocol fee rate (as decimal, e.g. 0.003 = 0.30%).
|
|
@@ -3416,6 +3524,11 @@ export interface components {
|
|
|
3416
3524
|
hash_lock: string;
|
|
3417
3525
|
/** @description Optional BOLT11 invoice description (max 639 bytes). */
|
|
3418
3526
|
invoice_description?: string | null;
|
|
3527
|
+
/**
|
|
3528
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3529
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
3530
|
+
*/
|
|
3531
|
+
promo_code?: string | null;
|
|
3419
3532
|
/** @description Optional referral code for fee exemption */
|
|
3420
3533
|
referral_code?: string | null;
|
|
3421
3534
|
/**
|
|
@@ -3519,6 +3632,11 @@ export interface components {
|
|
|
3519
3632
|
hash_lock: string;
|
|
3520
3633
|
/** @description Shown in the payer's wallet; the server default applies when omitted. */
|
|
3521
3634
|
invoice_description?: string | null;
|
|
3635
|
+
/**
|
|
3636
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3637
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
3638
|
+
*/
|
|
3639
|
+
promo_code?: string | null;
|
|
3522
3640
|
referral_code?: string | null;
|
|
3523
3641
|
/**
|
|
3524
3642
|
* Format: int64
|
|
@@ -3665,6 +3783,11 @@ export interface components {
|
|
|
3665
3783
|
* hold invoice.
|
|
3666
3784
|
*/
|
|
3667
3785
|
invoice_description?: string | null;
|
|
3786
|
+
/**
|
|
3787
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3788
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
3789
|
+
*/
|
|
3790
|
+
promo_code?: string | null;
|
|
3668
3791
|
/** @description Optional referral code for tracking. */
|
|
3669
3792
|
referral_code?: string | null;
|
|
3670
3793
|
/**
|
|
@@ -3929,6 +4052,7 @@ export interface components {
|
|
|
3929
4052
|
* create/claim + BTC mining fee when applicable.
|
|
3930
4053
|
*/
|
|
3931
4054
|
network_fee: number;
|
|
4055
|
+
promo?: null | components["schemas"]["AppliedPromo"];
|
|
3932
4056
|
/**
|
|
3933
4057
|
* Format: int64
|
|
3934
4058
|
* @description Protocol fee (in satoshis)
|
|
@@ -4028,6 +4152,11 @@ export interface components {
|
|
|
4028
4152
|
* key's `default_extra_fee_bps` applies.
|
|
4029
4153
|
*/
|
|
4030
4154
|
extra_fees?: number | null;
|
|
4155
|
+
/**
|
|
4156
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
4157
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
4158
|
+
*/
|
|
4159
|
+
promo_code?: string | null;
|
|
4031
4160
|
/**
|
|
4032
4161
|
* @description Referral code. When omitted/unknown/revoked the response is a zero
|
|
4033
4162
|
* extra fee (the base fee applies unchanged).
|
|
@@ -4056,6 +4185,7 @@ export interface components {
|
|
|
4056
4185
|
* converts once so the client never handles bps.
|
|
4057
4186
|
*/
|
|
4058
4187
|
extra_fee_rate: number;
|
|
4188
|
+
promo?: null | components["schemas"]["AppliedPromo"];
|
|
4059
4189
|
/**
|
|
4060
4190
|
* @description Human-readable partner label for the referral code, when registered.
|
|
4061
4191
|
* Informational (attribution / display) only.
|
|
@@ -4073,6 +4203,11 @@ export interface components {
|
|
|
4073
4203
|
*/
|
|
4074
4204
|
coordinator_address: string;
|
|
4075
4205
|
};
|
|
4206
|
+
RefundEvmGaslessResponse: {
|
|
4207
|
+
/** @description False means broadcast, confirmation not yet established. */
|
|
4208
|
+
confirmed: boolean;
|
|
4209
|
+
tx_hash: string;
|
|
4210
|
+
};
|
|
4076
4211
|
/** @description The lock a rehash would move, and the terms it would move to. */
|
|
4077
4212
|
RehashEvmParams: {
|
|
4078
4213
|
/** @description Locked amount (decimal string) */
|
|
@@ -4279,6 +4414,108 @@ export interface components {
|
|
|
4279
4414
|
/** @description Commitment transaction ID from the batch settlement. */
|
|
4280
4415
|
commitment_txid: string;
|
|
4281
4416
|
};
|
|
4417
|
+
/** @description Immutable native Spark instructions and the selected transfer, once observed. */
|
|
4418
|
+
SparkFunding: {
|
|
4419
|
+
address: string;
|
|
4420
|
+
/** Format: int64 */
|
|
4421
|
+
expiry_duration_secs: number;
|
|
4422
|
+
payment_id?: string | null;
|
|
4423
|
+
};
|
|
4424
|
+
SparkToEvmSwapResponse: {
|
|
4425
|
+
/** @description CCTP bridge destination chain. When set, USDC is bridged cross-chain after the swap. */
|
|
4426
|
+
bridge_target_chain?: string | null;
|
|
4427
|
+
/** @description USDC address on the bridge destination chain. */
|
|
4428
|
+
bridge_target_token_address?: string | null;
|
|
4429
|
+
/**
|
|
4430
|
+
* @description Transaction that delivered the bridged payout on the destination
|
|
4431
|
+
* chain, once the server has minted it there. Absent while the transfer
|
|
4432
|
+
* is in flight, and for payouts Circle's Forwarding Service delivers
|
|
4433
|
+
* (Circle's API reports that transaction).
|
|
4434
|
+
*/
|
|
4435
|
+
bridge_target_txid?: string | null;
|
|
4436
|
+
/** @description EVM chain name (e.g. "Polygon", "Ethereum", "Arbitrum") */
|
|
4437
|
+
chain: string;
|
|
4438
|
+
/** @description EVM address that will sign the HTLC claim (SDK-derived for gasless claims) */
|
|
4439
|
+
client_evm_address: string;
|
|
4440
|
+
/**
|
|
4441
|
+
* Format: date-time
|
|
4442
|
+
* @description Timestamp of when the swap was created
|
|
4443
|
+
*/
|
|
4444
|
+
created_at: string;
|
|
4445
|
+
/**
|
|
4446
|
+
* Format: int64
|
|
4447
|
+
* @description Numeric EVM chain ID (e.g. 137, 1, 42161)
|
|
4448
|
+
*/
|
|
4449
|
+
evm_chain_id: number;
|
|
4450
|
+
/** @description EVM HTLC claim transaction ID (user claim) */
|
|
4451
|
+
evm_claim_txid?: string | null;
|
|
4452
|
+
/** @description HTLCCoordinator contract address (for redeemAndExecute) */
|
|
4453
|
+
evm_coordinator_address: string;
|
|
4454
|
+
/**
|
|
4455
|
+
* @description Amount locked in the EVM HTLC, in token smallest units (WBTC sats,
|
|
4456
|
+
* or 18-decimal units for tBTC — hence U256, not i64)
|
|
4457
|
+
*/
|
|
4458
|
+
evm_expected_sats: string;
|
|
4459
|
+
/** @description EVM HTLC fund transaction ID */
|
|
4460
|
+
evm_fund_txid?: string | null;
|
|
4461
|
+
/** @description EVM HTLC contract address */
|
|
4462
|
+
evm_htlc_address: string;
|
|
4463
|
+
/**
|
|
4464
|
+
* @description HTLC family of the lock: `erc20` (`HTLCErc20` + `HTLCCoordinator`) or
|
|
4465
|
+
* `native` (`HTLCNative` + `HTLCNativeCoordinator`). Selects the EIP-712
|
|
4466
|
+
* domain name and the claim call a client uses.
|
|
4467
|
+
*/
|
|
4468
|
+
evm_htlc_kind: components["schemas"]["EvmHtlcKind"];
|
|
4469
|
+
/**
|
|
4470
|
+
* Format: int64
|
|
4471
|
+
* @description HTLCErc20 contract VERSION of the deployment this swap lives on —
|
|
4472
|
+
* the EIP-712 domain version string for redeem/refund signatures.
|
|
4473
|
+
*/
|
|
4474
|
+
evm_htlc_version: number;
|
|
4475
|
+
/**
|
|
4476
|
+
* Format: int64
|
|
4477
|
+
* @description EVM HTLC refund locktime (unix timestamp)
|
|
4478
|
+
*/
|
|
4479
|
+
evm_refund_locktime: number;
|
|
4480
|
+
/**
|
|
4481
|
+
* Format: int64
|
|
4482
|
+
* @description Protocol fee + network fee in satoshis
|
|
4483
|
+
*/
|
|
4484
|
+
fee_sats: number;
|
|
4485
|
+
/**
|
|
4486
|
+
* @description Native Spark transfer instructions. The payment is held until the
|
|
4487
|
+
* user's EVM claim reveals the preimage.
|
|
4488
|
+
*/
|
|
4489
|
+
funding: components["schemas"]["SparkFunding"];
|
|
4490
|
+
/**
|
|
4491
|
+
* Format: int64
|
|
4492
|
+
* @description Unix timestamp after which the funding instructions expire
|
|
4493
|
+
*/
|
|
4494
|
+
funding_expires_at?: number | null;
|
|
4495
|
+
/**
|
|
4496
|
+
* @description Hash lock (32-byte hex, 0x-prefixed) — the native Spark HTLC's payment
|
|
4497
|
+
* hash and the EVM HTLC's lock. The client holds the preimage.
|
|
4498
|
+
*/
|
|
4499
|
+
hash_lock: string;
|
|
4500
|
+
id: string;
|
|
4501
|
+
/** @description Bitcoin network */
|
|
4502
|
+
network: string;
|
|
4503
|
+
/** @description Server's EVM address */
|
|
4504
|
+
server_evm_address: string;
|
|
4505
|
+
/** @description Amount the user pays over Spark, in satoshis */
|
|
4506
|
+
source_amount: string;
|
|
4507
|
+
/** @description Source token info */
|
|
4508
|
+
source_token: components["schemas"]["TokenInfo"];
|
|
4509
|
+
status: components["schemas"]["SwapStatus"];
|
|
4510
|
+
/** @description How much the user will receive in the target token's smallest unit */
|
|
4511
|
+
target_amount: string;
|
|
4512
|
+
/** @description EVM address where tokens are swept after the claim (user's final destination) */
|
|
4513
|
+
target_evm_address?: string | null;
|
|
4514
|
+
/** @description Target token info */
|
|
4515
|
+
target_token: components["schemas"]["TokenInfo"];
|
|
4516
|
+
/** @description WBTC token contract address on the target EVM chain (the token locked in the HTLC) */
|
|
4517
|
+
wbtc_address: string;
|
|
4518
|
+
};
|
|
4282
4519
|
/** @description Aggregated health of every external dependency. */
|
|
4283
4520
|
StatusResponse: {
|
|
4284
4521
|
/** @description True if every probed service is healthy. */
|
|
@@ -4455,6 +4692,7 @@ export interface components {
|
|
|
4455
4692
|
token_id: components["schemas"]["TokenId"];
|
|
4456
4693
|
};
|
|
4457
4694
|
TokenInfos: {
|
|
4695
|
+
bitcoin_network: string;
|
|
4458
4696
|
btc_tokens: components["schemas"]["TokenInfo"][];
|
|
4459
4697
|
evm_tokens: components["schemas"]["TokenInfo"][];
|
|
4460
4698
|
};
|
|
@@ -4874,6 +5112,56 @@ export interface operations {
|
|
|
4874
5112
|
};
|
|
4875
5113
|
};
|
|
4876
5114
|
};
|
|
5115
|
+
refund_evm_gasless: {
|
|
5116
|
+
parameters: {
|
|
5117
|
+
query?: never;
|
|
5118
|
+
header?: never;
|
|
5119
|
+
path: {
|
|
5120
|
+
/** @description Swap ID */
|
|
5121
|
+
id: string;
|
|
5122
|
+
};
|
|
5123
|
+
cookie?: never;
|
|
5124
|
+
};
|
|
5125
|
+
requestBody?: never;
|
|
5126
|
+
responses: {
|
|
5127
|
+
/** @description Refund transaction broadcast; confirmed indicates whether a successful receipt was observed */
|
|
5128
|
+
200: {
|
|
5129
|
+
headers: {
|
|
5130
|
+
[name: string]: unknown;
|
|
5131
|
+
};
|
|
5132
|
+
content: {
|
|
5133
|
+
"application/json": components["schemas"]["RefundEvmGaslessResponse"];
|
|
5134
|
+
};
|
|
5135
|
+
};
|
|
5136
|
+
/** @description Unsupported, unfunded, not expired, or already in progress */
|
|
5137
|
+
400: {
|
|
5138
|
+
headers: {
|
|
5139
|
+
[name: string]: unknown;
|
|
5140
|
+
};
|
|
5141
|
+
content: {
|
|
5142
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
5143
|
+
};
|
|
5144
|
+
};
|
|
5145
|
+
/** @description Unsafe swap state */
|
|
5146
|
+
403: {
|
|
5147
|
+
headers: {
|
|
5148
|
+
[name: string]: unknown;
|
|
5149
|
+
};
|
|
5150
|
+
content: {
|
|
5151
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
5152
|
+
};
|
|
5153
|
+
};
|
|
5154
|
+
/** @description Relay rate limit */
|
|
5155
|
+
429: {
|
|
5156
|
+
headers: {
|
|
5157
|
+
[name: string]: unknown;
|
|
5158
|
+
};
|
|
5159
|
+
content: {
|
|
5160
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
5161
|
+
};
|
|
5162
|
+
};
|
|
5163
|
+
};
|
|
5164
|
+
};
|
|
4877
5165
|
rehash_evm: {
|
|
4878
5166
|
parameters: {
|
|
4879
5167
|
query?: never;
|
|
@@ -5346,6 +5634,11 @@ export interface operations {
|
|
|
5346
5634
|
* Rejected with 400 if it exceeds the per-key cap.
|
|
5347
5635
|
*/
|
|
5348
5636
|
extra_fees?: number | null;
|
|
5637
|
+
/**
|
|
5638
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
5639
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
5640
|
+
*/
|
|
5641
|
+
promo_code?: string | null;
|
|
5349
5642
|
};
|
|
5350
5643
|
header?: never;
|
|
5351
5644
|
path?: never;
|
|
@@ -5433,6 +5726,11 @@ export interface operations {
|
|
|
5433
5726
|
* (0..=max_extra_fee_bps configured on the matching developer key).
|
|
5434
5727
|
*/
|
|
5435
5728
|
extra_fees?: number | null;
|
|
5729
|
+
/**
|
|
5730
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
5731
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
5732
|
+
*/
|
|
5733
|
+
promo_code?: string | null;
|
|
5436
5734
|
};
|
|
5437
5735
|
header?: never;
|
|
5438
5736
|
path?: never;
|
|
@@ -5483,6 +5781,11 @@ export interface operations {
|
|
|
5483
5781
|
* key's `default_extra_fee_bps` applies.
|
|
5484
5782
|
*/
|
|
5485
5783
|
extra_fees?: number | null;
|
|
5784
|
+
/**
|
|
5785
|
+
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
5786
|
+
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
5787
|
+
*/
|
|
5788
|
+
promo_code?: string | null;
|
|
5486
5789
|
};
|
|
5487
5790
|
header?: never;
|
|
5488
5791
|
path?: never;
|
|
@@ -5499,7 +5802,7 @@ export interface operations {
|
|
|
5499
5802
|
"application/json": components["schemas"]["ReferralFeeResponse"];
|
|
5500
5803
|
};
|
|
5501
5804
|
};
|
|
5502
|
-
/** @description extra_fees exceeds the referral key's cap */
|
|
5805
|
+
/** @description extra_fees exceeds the referral key's cap, or the promo code is invalid */
|
|
5503
5806
|
400: {
|
|
5504
5807
|
headers: {
|
|
5505
5808
|
[name: string]: unknown;
|
|
@@ -6287,6 +6590,53 @@ export interface operations {
|
|
|
6287
6590
|
};
|
|
6288
6591
|
};
|
|
6289
6592
|
};
|
|
6593
|
+
create_spark_evm_swap: {
|
|
6594
|
+
parameters: {
|
|
6595
|
+
query?: never;
|
|
6596
|
+
header?: never;
|
|
6597
|
+
path?: never;
|
|
6598
|
+
cookie?: never;
|
|
6599
|
+
};
|
|
6600
|
+
requestBody: {
|
|
6601
|
+
content: {
|
|
6602
|
+
"application/json": components["schemas"]["LightningToEvmSwapRequest"];
|
|
6603
|
+
};
|
|
6604
|
+
};
|
|
6605
|
+
responses: {
|
|
6606
|
+
200: {
|
|
6607
|
+
headers: {
|
|
6608
|
+
[name: string]: unknown;
|
|
6609
|
+
};
|
|
6610
|
+
content: {
|
|
6611
|
+
"application/json": components["schemas"]["SparkToEvmSwapResponse"];
|
|
6612
|
+
};
|
|
6613
|
+
};
|
|
6614
|
+
400: {
|
|
6615
|
+
headers: {
|
|
6616
|
+
[name: string]: unknown;
|
|
6617
|
+
};
|
|
6618
|
+
content: {
|
|
6619
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6620
|
+
};
|
|
6621
|
+
};
|
|
6622
|
+
409: {
|
|
6623
|
+
headers: {
|
|
6624
|
+
[name: string]: unknown;
|
|
6625
|
+
};
|
|
6626
|
+
content: {
|
|
6627
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6628
|
+
};
|
|
6629
|
+
};
|
|
6630
|
+
503: {
|
|
6631
|
+
headers: {
|
|
6632
|
+
[name: string]: unknown;
|
|
6633
|
+
};
|
|
6634
|
+
content: {
|
|
6635
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6636
|
+
};
|
|
6637
|
+
};
|
|
6638
|
+
};
|
|
6639
|
+
};
|
|
6290
6640
|
get_swap: {
|
|
6291
6641
|
parameters: {
|
|
6292
6642
|
query?: never;
|
|
@@ -5,8 +5,10 @@ export { isValidArkadeAddress, parseArkadeAddress, } from "./arkade-address.js";
|
|
|
5
5
|
export { invoiceAmountMsat, invoicePaymentHash } from "./bolt11.js";
|
|
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.js";
|
|
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.js";
|
|
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.js";
|
|
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.js";
|
|
9
9
|
export { Client, ClientBuilder, DEFAULT_ELECTRUM_WS_URLS, RehashNotRecordedError, rehashAuthorizationMessage, } from "./client.js";
|
|
10
|
+
export { allocateBitcoinPayout, validateBitcoinPayout, } from "./create/bitcoin-payout.js";
|
|
11
|
+
export { type BitcoinPaymentRequest, bitcoinNetworkOf, commitBitcoinPayment, minimumBitcoinPayout, } from "./create/payout-slippage.js";
|
|
10
12
|
export { addressToScriptHash, type ElectrumNetwork, type ElectrumUnspent, ElectrumWsClient, electrumBroadcastTransaction, electrumFetchTransactionOutputs, electrumFindOutputByAddress, electrumWaitForOutputByAddress, } from "./electrum-ws.js";
|
|
11
13
|
export { getArkTxid, type SignedEscrowDelegate, type SignedEscrowTx, signEscrowArkTx, signEscrowCheckpoints, signEscrowDelegate, } from "./escrow/index.js";
|
|
12
14
|
export { type CheckedFunding, checkFundingPayload, type EvmFundingTerms, type ExpectedFunding, type FundingPayload, type FundingPins, } from "./evm/funding-pins.js";
|
|
@@ -20,12 +22,12 @@ export { type BitcoinNetwork, buildOnchainClaimTransaction, buildOnchainRefundTr
|
|
|
20
22
|
export type { SwapParams } from "./signer/index.js";
|
|
21
23
|
export { bytesToHex, hexToBytes, Signer } from "./signer/index.js";
|
|
22
24
|
export { IdbSwapStorage, IdbWalletStorage, idbStorageFactory, } from "./storage/idb.js";
|
|
23
|
-
export type { StorageFactory, StoredSwap, SwapStorage, WalletStorage, } from "./storage/index.js";
|
|
25
|
+
export type { BitcoinPayout, StorageFactory, StoredSwap, SwapStorage, WalletStorage, } from "./storage/index.js";
|
|
24
26
|
export { InMemorySwapStorage, InMemoryWalletStorage, inMemoryStorageFactory, SWAP_STORAGE_VERSION, } from "./storage/index.js";
|
|
25
27
|
export { ARKADE_HTLC_SCRIPT_VERSION_STRICT, BTC_HTLC_SCRIPT_VERSION_STRICT, type StrictVhtlcOptions, StrictVhtlcScript, } from "./strict-vhtlc.js";
|
|
26
28
|
export { SwapVerificationError } from "./swap-verification.js";
|
|
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.js";
|
|
28
|
-
export type { Chain, ChainConfigEntry, ChainConfigResponse, DexQuoteAmount, DexQuoteResponse, NetworkFee, NetworkFeePairEntry, NetworkFeesResponse, QuoteResponse, SwapPairInfo, SwapPairsResponse, Token, TokenAmount, TokenRef, } from "./types/index.js";
|
|
29
|
+
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.js";
|
|
30
|
+
export type { AppliedPromo, Chain, ChainConfigEntry, ChainConfigResponse, DexQuoteAmount, DexQuoteResponse, NetworkFee, NetworkFeePairEntry, NetworkFeesResponse, QuoteResponse, SwapPairInfo, SwapPairsResponse, Token, TokenAmount, TokenRef, } from "./types/index.js";
|
|
29
31
|
export { type GetUsdPricesOptions, getUsdPrices } from "./usd-price.js";
|
|
30
32
|
export { getEid, getLzExplorerUrl, getLzMessageStatus, type LayerZeroMessageResult, type LayerZeroMessageStatus, LZ_EIDS, needsBridge as usdt0NeedsBridge, type TrackLzMessageOptions, trackLzMessage, USDT0_ADDRESSES, type Usdt0ChainName, } from "./usdt0-bridge/index.js";
|
|
31
33
|
export { isValidTronAddress, tronAddressToBytes32, } from "./usdt0-bridge/tron.js";
|
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
* - Hashlock script path: server claims with preimage
|
|
11
11
|
* - Timelock script path: user refunds after locktime
|
|
12
12
|
*/
|
|
13
|
+
import type { BitcoinPayout } from "../storage/types.js";
|
|
13
14
|
/** Bitcoin network type */
|
|
14
15
|
export type BitcoinNetwork = "mainnet" | "testnet" | "signet" | "regtest";
|
|
15
16
|
/** Parameters needed to build a claim transaction for an on-chain Taproot HTLC */
|
|
16
17
|
export interface OnchainClaimParams {
|
|
18
|
+
/** Committed recipient minimums. Surplus is split in proportion to them; shortfalls reject. */
|
|
19
|
+
bitcoinPayout?: BitcoinPayout;
|
|
17
20
|
/** The funding transaction ID (hex, no 0x prefix) */
|
|
18
21
|
fundingTxId: string;
|
|
19
22
|
/** The output index in the funding transaction */
|
|
@@ -43,6 +46,7 @@ export interface OnchainClaimParams {
|
|
|
43
46
|
}
|
|
44
47
|
/** Result of building a claim transaction */
|
|
45
48
|
export interface OnchainClaimResult {
|
|
49
|
+
vsize: number;
|
|
46
50
|
/** The signed transaction hex (ready to broadcast) */
|
|
47
51
|
txHex: string;
|
|
48
52
|
/** Transaction ID (hash) */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { GetSwapResponse } from "../api/client.js";
|
|
8
8
|
import type { StoredSwap } from "./types.js";
|
|
9
|
-
export type { EvmRehashRecord, LightningPaymentHash, StoredSwap, } from "./types.js";
|
|
9
|
+
export type { BitcoinPayout, EvmRehashRecord, LightningPaymentHash, StoredSwap, } from "./types.js";
|
|
10
10
|
export { SWAP_STORAGE_VERSION } from "./types.js";
|
|
11
11
|
/**
|
|
12
12
|
* Storage interface for wallet data (mnemonic, key index).
|
|
@@ -65,6 +65,19 @@ export interface LightningPaymentHash {
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
export interface StoredSwap {
|
|
68
|
+
/** Locally committed recipient outputs, retained in full backups. */
|
|
69
|
+
bitcoinPayout?: BitcoinPayout;
|
|
70
|
+
/** Last claim submitted to a broadcaster; its preimage may be public. */
|
|
71
|
+
bitcoinClaimBroadcast?: string;
|
|
72
|
+
/** Optional Pay display metadata; never used to authorize payouts. */
|
|
73
|
+
payRecipientNames?: string[];
|
|
74
|
+
/** Optional Pay display metadata: the nominal amounts requested, before the payout tolerance. Never used to authorize payouts. */
|
|
75
|
+
payRequestedAmounts?: string[];
|
|
76
|
+
payUsdRate?: number;
|
|
77
|
+
/** Original SDK depositor key retained across refund continuations. */
|
|
78
|
+
evmDepositorKeyIndex?: number;
|
|
79
|
+
/** Verified original depositor key; private like secretKey, independent of wallet root. */
|
|
80
|
+
evmDepositorSecretKey?: string;
|
|
68
81
|
/** Schema version for migrations */
|
|
69
82
|
version: number;
|
|
70
83
|
/** The swap ID (primary key) */
|
|
@@ -159,3 +172,12 @@ export interface StoredSwap {
|
|
|
159
172
|
*/
|
|
160
173
|
cctpBurnLastValidBlockHeight?: number;
|
|
161
174
|
}
|
|
175
|
+
/** Minimum recipient commitments; surplus is split in proportion to them. */
|
|
176
|
+
export interface BitcoinPayout {
|
|
177
|
+
recipients: {
|
|
178
|
+
address: string;
|
|
179
|
+
amountSats: string;
|
|
180
|
+
}[];
|
|
181
|
+
/** Minimum miner fee; claims raise it out of surplus to meet the fee rate, never out of recipient commitments. */
|
|
182
|
+
feeSats: string;
|
|
183
|
+
}
|
|
@@ -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.js";
|
|
5
|
+
import type { ArkadeToEvmSwapResponse, ArkadeToLightningSwapResponse, BitcoinToEvmSwapResponse, BitcoinToLightningSwapResponse, BtcToArkadeSwapResponse, GetSwapResponse, SparkToEvmSwapResponse } from "./api/client.js";
|
|
6
6
|
import { type SwapParams } from "./signer/index.js";
|
|
7
7
|
import type { LightningPaymentHash, StoredSwap } from "./storage/types.js";
|
|
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;
|