@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
package/dist/index.js
CHANGED
|
@@ -31,7 +31,9 @@ import {
|
|
|
31
31
|
WalletClaimRequiredError,
|
|
32
32
|
addressToBytes32,
|
|
33
33
|
addressToScriptHash,
|
|
34
|
+
allocateBitcoinPayout,
|
|
34
35
|
approveAndBurn,
|
|
36
|
+
bitcoinNetworkOf,
|
|
35
37
|
buildArkadeClaim,
|
|
36
38
|
buildDomainSeparator,
|
|
37
39
|
buildOnchainClaimTransaction,
|
|
@@ -41,6 +43,7 @@ import {
|
|
|
41
43
|
calculateTargetAmount,
|
|
42
44
|
cctpFundSwap,
|
|
43
45
|
cctpMetaForChainId,
|
|
46
|
+
commitBitcoinPayment,
|
|
44
47
|
computeCctpFastFee,
|
|
45
48
|
computeExchangeRate,
|
|
46
49
|
computeHash160,
|
|
@@ -93,11 +96,13 @@ import {
|
|
|
93
96
|
isSolanaToken,
|
|
94
97
|
isSonicToken,
|
|
95
98
|
isSourceEvmChain,
|
|
99
|
+
isSpark,
|
|
96
100
|
isTronToken,
|
|
97
101
|
isValidArkadeAddress,
|
|
98
102
|
isValidSolanaAddress,
|
|
99
103
|
isValidTronAddress,
|
|
100
104
|
kernelErc1271Digest,
|
|
105
|
+
minimumBitcoinPayout,
|
|
101
106
|
needsBridge,
|
|
102
107
|
needsBridge2,
|
|
103
108
|
parseArkadeAddress,
|
|
@@ -118,18 +123,19 @@ import {
|
|
|
118
123
|
toChainName,
|
|
119
124
|
trackMessage,
|
|
120
125
|
tronAddressToBytes32,
|
|
126
|
+
validateBitcoinPayout,
|
|
121
127
|
verifyHtlcAddress,
|
|
122
128
|
wrapKernelErc1271Signature
|
|
123
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-34OYIFOU.js";
|
|
124
130
|
import {
|
|
125
131
|
electrumReader
|
|
126
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-I2NF63VZ.js";
|
|
127
133
|
import {
|
|
128
134
|
DEFAULT_ESPLORA_URLS,
|
|
129
135
|
esploraReader,
|
|
130
136
|
htlcFactsFromEsploraTxs,
|
|
131
137
|
resolveMinConfirmations
|
|
132
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-CUYLQTRF.js";
|
|
133
139
|
import {
|
|
134
140
|
NATIVE_TOKEN_ADDRESS,
|
|
135
141
|
PERMIT2_ADDRESS,
|
|
@@ -151,7 +157,7 @@ import {
|
|
|
151
157
|
simulateBatchCalls,
|
|
152
158
|
submitCctpInboundUserOp,
|
|
153
159
|
trackCctpMessage
|
|
154
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-K2Q4JWB6.js";
|
|
155
161
|
import "./chunk-5XYV6L5B.js";
|
|
156
162
|
import "./chunk-LSMKNYFR.js";
|
|
157
163
|
import {
|
|
@@ -192,7 +198,7 @@ import {
|
|
|
192
198
|
SDK_VERSION,
|
|
193
199
|
StrictVhtlcScript,
|
|
194
200
|
protocolHeaderName
|
|
195
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-KMBGRQS7.js";
|
|
196
202
|
import "./chunk-UM6TUP4E.js";
|
|
197
203
|
import {
|
|
198
204
|
SdkLogger,
|
|
@@ -236,7 +242,7 @@ function deriveSwapActions(input) {
|
|
|
236
242
|
waitingOn: "client_payment",
|
|
237
243
|
recommended: true,
|
|
238
244
|
automation: "auto",
|
|
239
|
-
reason: "Waiting for the
|
|
245
|
+
reason: "Waiting for the source payment to be locked in."
|
|
240
246
|
};
|
|
241
247
|
return { recommended: "wait", actions: [wait] };
|
|
242
248
|
}
|
|
@@ -357,7 +363,7 @@ function deriveSwapActions(input) {
|
|
|
357
363
|
outcome: "refunded",
|
|
358
364
|
recommended: true,
|
|
359
365
|
automation: "auto",
|
|
360
|
-
reason: "The claim window passed \u2014 your
|
|
366
|
+
reason: "The claim window passed \u2014 your source payment will be refunded automatically."
|
|
361
367
|
};
|
|
362
368
|
return { recommended: "none", actions: [done] };
|
|
363
369
|
}
|
|
@@ -454,7 +460,7 @@ function deriveSwapActions(input) {
|
|
|
454
460
|
outcome: "refunded",
|
|
455
461
|
recommended: true,
|
|
456
462
|
automation: "auto",
|
|
457
|
-
reason: "The swap did not complete \u2014 your
|
|
463
|
+
reason: "The swap did not complete \u2014 your source payment will be refunded automatically."
|
|
458
464
|
};
|
|
459
465
|
return { recommended: "none", actions: [done] };
|
|
460
466
|
}
|
|
@@ -818,7 +824,7 @@ var BitcoinContractManager = class _BitcoinContractManager {
|
|
|
818
824
|
return new _BitcoinContractManager(deps);
|
|
819
825
|
}
|
|
820
826
|
static async create(config) {
|
|
821
|
-
const { esploraReader: esploraReader2 } = await import("./bitcoin-reader-esplora-
|
|
827
|
+
const { esploraReader: esploraReader2 } = await import("./bitcoin-reader-esplora-LC673MQT.js");
|
|
822
828
|
let reader = esploraReader2(
|
|
823
829
|
config.esploraUrl,
|
|
824
830
|
void 0,
|
|
@@ -826,8 +832,8 @@ var BitcoinContractManager = class _BitcoinContractManager {
|
|
|
826
832
|
);
|
|
827
833
|
if (config.electrumWsUrl) {
|
|
828
834
|
const [{ electrumReader: electrumReader2 }, { ElectrumWsClient: ElectrumWsClient2 }] = await Promise.all([
|
|
829
|
-
import("./bitcoin-reader-electrum-
|
|
830
|
-
import("./dist-
|
|
835
|
+
import("./bitcoin-reader-electrum-VLYRII3T.js"),
|
|
836
|
+
import("./dist-3N76II5O.js")
|
|
831
837
|
]);
|
|
832
838
|
reader = electrumReader2(new ElectrumWsClient2(config.electrumWsUrl), {
|
|
833
839
|
network: config.network,
|
|
@@ -2246,6 +2252,8 @@ function swapToTracked(stored) {
|
|
|
2246
2252
|
// watch) and claims an on-chain HTLC. No client-funded leg — the client's
|
|
2247
2253
|
// claim completes the swap; a hold invoice that never settles auto-unwinds.
|
|
2248
2254
|
// Client pays the invoice, then claims the server's EVM HTLC.
|
|
2255
|
+
// Native Spark has the same EVM claim leg; the Spark wallet manages its HTLC.
|
|
2256
|
+
case "spark_to_evm":
|
|
2249
2257
|
case "lightning_to_evm":
|
|
2250
2258
|
return {
|
|
2251
2259
|
swapId: r.id,
|
|
@@ -3056,6 +3064,10 @@ var Client2 = class {
|
|
|
3056
3064
|
);
|
|
3057
3065
|
}
|
|
3058
3066
|
/** Delegated to the legacy client (migration checkpoint). */
|
|
3067
|
+
createSparkToEvmSwap(...args) {
|
|
3068
|
+
return this.#trackAfterCreate(this.#legacy.createSparkToEvmSwap(...args));
|
|
3069
|
+
}
|
|
3070
|
+
/** Delegated to the legacy client (migration checkpoint). */
|
|
3059
3071
|
createLightningToBitcoinSwap(...args) {
|
|
3060
3072
|
return this.#trackAfterCreate(
|
|
3061
3073
|
this.#legacy.createLightningToBitcoinSwap(...args)
|
|
@@ -3742,7 +3754,9 @@ export {
|
|
|
3742
3754
|
addressToBytes32,
|
|
3743
3755
|
addressToBytes32Hex,
|
|
3744
3756
|
addressToScriptHash,
|
|
3757
|
+
allocateBitcoinPayout,
|
|
3745
3758
|
approveAndBurn,
|
|
3759
|
+
bitcoinNetworkOf,
|
|
3746
3760
|
buildArkadeClaim,
|
|
3747
3761
|
buildArkadeVhtlcRef,
|
|
3748
3762
|
buildCctpInboundBatch,
|
|
@@ -3758,6 +3772,7 @@ export {
|
|
|
3758
3772
|
cctpFundSwap,
|
|
3759
3773
|
cctpMetaForChainId,
|
|
3760
3774
|
checkFundingPayload,
|
|
3775
|
+
commitBitcoinPayment,
|
|
3761
3776
|
computeCctpFastFee,
|
|
3762
3777
|
computeExchangeRate,
|
|
3763
3778
|
computeHash160,
|
|
@@ -3834,12 +3849,14 @@ export {
|
|
|
3834
3849
|
isSolanaToken,
|
|
3835
3850
|
isSonicToken,
|
|
3836
3851
|
isSourceEvmChain,
|
|
3852
|
+
isSpark,
|
|
3837
3853
|
isTronToken,
|
|
3838
3854
|
isUserRejection,
|
|
3839
3855
|
isValidArkadeAddress,
|
|
3840
3856
|
isValidSolanaAddress,
|
|
3841
3857
|
isValidTronAddress,
|
|
3842
3858
|
kernelErc1271Digest,
|
|
3859
|
+
minimumBitcoinPayout,
|
|
3843
3860
|
needsBridge,
|
|
3844
3861
|
noopLogger,
|
|
3845
3862
|
parseArkadeAddress,
|
|
@@ -3868,6 +3885,7 @@ export {
|
|
|
3868
3885
|
trackMessage as trackLzMessage,
|
|
3869
3886
|
tronAddressToBytes32,
|
|
3870
3887
|
needsBridge2 as usdt0NeedsBridge,
|
|
3888
|
+
validateBitcoinPayout,
|
|
3871
3889
|
verifyHtlcAddress,
|
|
3872
3890
|
wrapKernelErc1271Signature
|
|
3873
3891
|
};
|