@satora/swap 1.12.0 → 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-YBQPH7NH.js → chunk-34OYIFOU.js} +506 -113
- package/dist/chunk-34OYIFOU.js.map +1 -0
- package/dist/{chunk-EL4FUZJO.cjs → chunk-3633KDTW.cjs} +879 -486
- 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-KECPPSZL.js → chunk-KMBGRQS7.js} +5 -5
- package/dist/{chunk-KECPPSZL.js.map → chunk-KMBGRQS7.js.map} +1 -1
- package/dist/{chunk-QJ4EK6UG.cjs → chunk-LZQZYSOZ.cjs} +5 -5
- package/dist/{chunk-QJ4EK6UG.cjs.map → chunk-LZQZYSOZ.cjs.map} +1 -1
- package/dist/delegate.cjs +2 -2
- package/dist/delegate.js +1 -1
- package/dist/{dist-Y3ZVHXAJ.js → dist-3N76II5O.js} +14 -4
- package/dist/dist-KQINAMDC.cjs +406 -0
- package/dist/{dist-R6DUJG36.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 +30 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -8
- 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/client.d.cts +14 -9
- 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/payment-safety.d.cts +2 -0
- package/dist/types/cjs/pure/create/payout-slippage.d.cts +29 -0
- package/dist/types/cjs/pure/create/types.d.cts +9 -1
- 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 +78 -0
- package/dist/types/cjs/pure/index.d.cts +3 -1
- 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/version.d.cts +4 -4
- package/dist/types/cjs/swap/contracts/bitcoin-reader-esplora.d.cts +5 -0
- package/dist/types/esm/pure/client.d.ts +14 -9
- 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/payment-safety.d.ts +2 -0
- package/dist/types/esm/pure/create/payout-slippage.d.ts +29 -0
- package/dist/types/esm/pure/create/types.d.ts +9 -1
- 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 +78 -0
- package/dist/types/esm/pure/index.d.ts +3 -1
- 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/version.d.ts +4 -4
- package/dist/types/esm/swap/contracts/bitcoin-reader-esplora.d.ts +5 -0
- package/package.json +1 -1
- 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-5DQHR3RO.cjs.map +0 -1
- package/dist/chunk-EL4FUZJO.cjs.map +0 -1
- package/dist/chunk-INHFP222.cjs.map +0 -1
- package/dist/chunk-LSCRTQOS.js.map +0 -1
- package/dist/chunk-YBQPH7NH.js.map +0 -1
- package/dist/dist-R6DUJG36.cjs +0 -396
- /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-Y3ZVHXAJ.js.map → dist-3N76II5O.js.map} +0 -0
- /package/dist/{fundSwap-UBCHMUP4-WBLYE6MC.js.map → fundSwap-2D4IPYU4-CDM3WRUF.js.map} +0 -0
|
@@ -7,6 +7,8 @@ export { type AttestationResponse, type AttestationResult, type AttestationStatu
|
|
|
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
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
|
+
export { allocateBitcoinPayout, validateBitcoinPayout, } from "./create/bitcoin-payout.cjs";
|
|
11
|
+
export { type BitcoinPaymentRequest, bitcoinNetworkOf, commitBitcoinPayment, minimumBitcoinPayout, } from "./create/payout-slippage.cjs";
|
|
10
12
|
export { addressToScriptHash, type ElectrumNetwork, type ElectrumUnspent, ElectrumWsClient, electrumBroadcastTransaction, electrumFetchTransactionOutputs, electrumFindOutputByAddress, electrumWaitForOutputByAddress, } from "./electrum-ws.cjs";
|
|
11
13
|
export { getArkTxid, type SignedEscrowDelegate, type SignedEscrowTx, signEscrowArkTx, signEscrowCheckpoints, signEscrowDelegate, } from "./escrow/index.cjs";
|
|
12
14
|
export { type CheckedFunding, checkFundingPayload, type EvmFundingTerms, type ExpectedFunding, type FundingPayload, type FundingPins, } from "./evm/funding-pins.cjs";
|
|
@@ -20,7 +22,7 @@ export { type BitcoinNetwork, buildOnchainClaimTransaction, buildOnchainRefundTr
|
|
|
20
22
|
export type { SwapParams } from "./signer/index.cjs";
|
|
21
23
|
export { bytesToHex, hexToBytes, Signer } from "./signer/index.cjs";
|
|
22
24
|
export { IdbSwapStorage, IdbWalletStorage, idbStorageFactory, } from "./storage/idb.cjs";
|
|
23
|
-
export type { StorageFactory, StoredSwap, SwapStorage, WalletStorage, } from "./storage/index.cjs";
|
|
25
|
+
export type { BitcoinPayout, StorageFactory, StoredSwap, SwapStorage, WalletStorage, } from "./storage/index.cjs";
|
|
24
26
|
export { InMemorySwapStorage, InMemoryWalletStorage, inMemoryStorageFactory, SWAP_STORAGE_VERSION, } from "./storage/index.cjs";
|
|
25
27
|
export { ARKADE_HTLC_SCRIPT_VERSION_STRICT, BTC_HTLC_SCRIPT_VERSION_STRICT, type StrictVhtlcOptions, StrictVhtlcScript, } from "./strict-vhtlc.cjs";
|
|
26
28
|
export { SwapVerificationError } from "./swap-verification.cjs";
|
|
@@ -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.cjs";
|
|
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.cjs";
|
|
8
8
|
import type { StoredSwap } from "./types.cjs";
|
|
9
|
-
export type { EvmRehashRecord, LightningPaymentHash, StoredSwap, } from "./types.cjs";
|
|
9
|
+
export type { BitcoinPayout, EvmRehashRecord, LightningPaymentHash, StoredSwap, } from "./types.cjs";
|
|
10
10
|
export { SWAP_STORAGE_VERSION } from "./types.cjs";
|
|
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
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const SDK_NAME = "swap";
|
|
2
|
-
export declare const SDK_VERSION = "1.
|
|
3
|
-
export declare const SDK_COMMIT_HASH = "
|
|
2
|
+
export declare const SDK_VERSION = "1.13.0";
|
|
3
|
+
export declare const SDK_COMMIT_HASH = "2a9d67ccaf674a45dad1053243942d6043b9c0f0";
|
|
4
4
|
/** @deprecated Retained for source compatibility; requests no longer send it. */
|
|
5
|
-
export declare const SATORA_SERVER_VERSION = "0.3.
|
|
6
|
-
export declare const CLIENT_AGENT = "swap/1.
|
|
5
|
+
export declare const SATORA_SERVER_VERSION = "0.3.31";
|
|
6
|
+
export declare const CLIENT_AGENT = "swap/1.13.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";
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { BitcoinHtlcFacts } from "./bitcoin.cjs";
|
|
11
11
|
import type { BitcoinChainReader } from "./bitcoin-manager.cjs";
|
|
12
|
+
/**
|
|
13
|
+
* Most outputs a client's funding is counted from, as the server's on-chain
|
|
14
|
+
* HTLC watcher counts it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_FUNDING_OUTPUTS = 2;
|
|
12
17
|
/** The slice of esplora's tx JSON we read. */
|
|
13
18
|
type EsploraTx = {
|
|
14
19
|
vin: Array<{
|
|
@@ -342,13 +342,18 @@ export interface ClaimOptions {
|
|
|
342
342
|
/**
|
|
343
343
|
* Bitcoin destination address for on-chain claims (evm_to_bitcoin and
|
|
344
344
|
* lightning_to_bitcoin); falls back to the address the swap was created with.
|
|
345
|
+
* Not allowed when the swap stores Bitcoin payout recipients: those are paid.
|
|
345
346
|
*/
|
|
346
347
|
destinationAddress?: string;
|
|
347
348
|
/**
|
|
348
349
|
* Fee rate in sat/vB for on-chain Bitcoin claims (default: the explorer's
|
|
349
|
-
* two-block estimate, at least 2)
|
|
350
|
+
* two-block estimate, at least 2). For a swap with stored payout recipients
|
|
351
|
+
* it must be above zero; the committed fee is raised out of surplus to meet
|
|
352
|
+
* it, up to the 100,000-sat payout fee cap.
|
|
350
353
|
*/
|
|
351
354
|
feeRateSatPerVb?: number;
|
|
355
|
+
/** Relay policy supplied by an operator when the explorer does not expose it. */
|
|
356
|
+
minimumRelayFeeRateSatPerVb?: number;
|
|
352
357
|
/**
|
|
353
358
|
* For EVM-to-Bitcoin claims: if the funding (HTLC) output has not been
|
|
354
359
|
* indexed by the block explorer yet, keep polling for up to this many
|
|
@@ -904,8 +909,8 @@ export declare class Client {
|
|
|
904
909
|
/**
|
|
905
910
|
* Get the deterministic EVM address for this SDK key.
|
|
906
911
|
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
912
|
+
* Legacy wallet-level address. New gasless swaps use their own deposit
|
|
913
|
+
* address; read it from the swap response or getSwapDepositorKey(swapId).
|
|
909
914
|
*
|
|
910
915
|
* @returns Checksummed EVM address (0x-prefixed).
|
|
911
916
|
*/
|
|
@@ -2019,10 +2024,9 @@ export declare class Client {
|
|
|
2019
2024
|
* address, an Arkade address, or for Lightning a BOLT11 invoice (its amount
|
|
2020
2025
|
* must be covered by the refund), a Lightning address or an LNURL.
|
|
2021
2026
|
* @param options.target - The payout type; defaults to the old swap's.
|
|
2022
|
-
* @param options.signer - A signer for
|
|
2023
|
-
*
|
|
2024
|
-
*
|
|
2025
|
-
* paymaster only sponsors funding from the depositor's account.
|
|
2027
|
+
* @param options.signer - A signer for the refunded deposit account. Defaults
|
|
2028
|
+
* to its SDK key. The continuation explicitly reuses that funded account
|
|
2029
|
+
* instead of allocating a new deposit address.
|
|
2026
2030
|
*/
|
|
2027
2031
|
continueRefundedEvmSwap(oldSwapId: string, options: {
|
|
2028
2032
|
targetAddress: string;
|
|
@@ -2128,14 +2132,15 @@ export declare class Client {
|
|
|
2128
2132
|
getSwapDepositorKey(swapId: string): Promise<{
|
|
2129
2133
|
privateKey: string;
|
|
2130
2134
|
address: string;
|
|
2135
|
+
keyIndex?: number;
|
|
2131
2136
|
}>;
|
|
2132
2137
|
/**
|
|
2133
2138
|
* Wallet-level variant of {@link getSwapDepositorKey} — returns the
|
|
2134
2139
|
* deterministic EVM signing key for this wallet without requiring a
|
|
2135
2140
|
* specific swap to be stored locally.
|
|
2136
2141
|
*
|
|
2137
|
-
*
|
|
2138
|
-
* per-swap
|
|
2142
|
+
* Only for legacy wallet-level deposits (`m/44'/60'/0'/0/0`).
|
|
2143
|
+
* Use getSwapDepositorKey for per-swap deposits. Intended for recovery tools
|
|
2139
2144
|
* where the user supplies the burn details manually and a per-swap
|
|
2140
2145
|
* record may no longer exist (e.g. fresh device, cleared site data).
|
|
2141
2146
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as btc from "@scure/btc-signer";
|
|
2
|
+
import type { BitcoinPayout } from "../storage/types.js";
|
|
3
|
+
/** Upper bound for a payout claim fee, committed or raised to meet a fee rate. */
|
|
4
|
+
export declare const MAX_PAYOUT_FEE_SATS = 100000n;
|
|
5
|
+
/** Validate exact recipient commitments before signing. Duplicate addresses stay separate. */
|
|
6
|
+
export declare function validateBitcoinPayout(payout: BitcoinPayout, network: typeof btc.NETWORK): {
|
|
7
|
+
total: bigint;
|
|
8
|
+
fee: bigint;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The recipient amounts a claim of `funded` sats pays: each commitment plus a
|
|
12
|
+
* share of the surplus in proportion to it, rounding leftovers one sat each in
|
|
13
|
+
* list order. `fee` defaults to the committed fee; a claim that raises its fee
|
|
14
|
+
* to meet a fee rate pays from the surplus, so pass the actual fee to match it.
|
|
15
|
+
* Throws if the funding cannot cover the commitments and fee.
|
|
16
|
+
*/
|
|
17
|
+
export declare function allocateBitcoinPayout(payout: BitcoinPayout, funded: bigint, fee?: bigint): BitcoinPayout;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EVM to Arkade swap creation.
|
|
3
|
-
*
|
|
4
|
-
* Supports swapping tokens from Polygon, Arbitrum, or Ethereum to BTC on Arkade.
|
|
5
|
-
*/
|
|
6
1
|
import type { CreateSwapContext, EvmToArkadeSwapGenericOptions, EvmToArkadeSwapGenericResult } from "./types.js";
|
|
7
2
|
/**
|
|
8
3
|
* Creates a new EVM-to-Arkade swap via the generic endpoint.
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EVM to Lightning swap creation.
|
|
3
|
-
*
|
|
4
|
-
* The user locks an ERC-20 token on an EVM chain in an HTLCErc20 (via the
|
|
5
|
-
* coordinator) whose hash lock is the payment hash of the Lightning
|
|
6
|
-
* invoice they want paid; the server pays the invoice and claims the HTLC
|
|
7
|
-
* with the revealed preimage.
|
|
8
|
-
*/
|
|
9
1
|
import type { CreateSwapContext, EvmToLightningSwapOptions, EvmToLightningSwapResult } from "./types.js";
|
|
10
2
|
/**
|
|
11
3
|
* Creates a new EVM to Lightning swap.
|
|
@@ -6,6 +6,7 @@ import type { EvmFundingTerms } from "../evm/funding-pins.js";
|
|
|
6
6
|
* tokens and input are what every later funding payload must match.
|
|
7
7
|
*/
|
|
8
8
|
export declare function fundingTermsOf(data: {
|
|
9
|
+
client_evm_address?: string | null;
|
|
9
10
|
evm_chain_id?: number | null;
|
|
10
11
|
evm_coordinator_address?: string | null;
|
|
11
12
|
evm_htlc_address?: string | null;
|
|
@@ -18,4 +19,4 @@ export declare function fundingTermsOf(data: {
|
|
|
18
19
|
token_id?: string | null;
|
|
19
20
|
} | null;
|
|
20
21
|
evm_htlc_token?: string | null;
|
|
21
|
-
}): EvmFundingTerms | undefined;
|
|
22
|
+
}, depositor?: string): EvmFundingTerms | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as btc from "@scure/btc-signer";
|
|
2
|
+
import type { BitcoinPayout } from "../storage/types.js";
|
|
3
|
+
/** A requested payment: nominal recipient amounts, the claim fee and how far below them DEX execution may land. */
|
|
4
|
+
export interface BitcoinPaymentRequest {
|
|
5
|
+
recipients: {
|
|
6
|
+
address: string;
|
|
7
|
+
amountSats: string;
|
|
8
|
+
}[];
|
|
9
|
+
feeSats: string;
|
|
10
|
+
/** Maximum reduction per recipient, in basis points (0–100). Default 0. */
|
|
11
|
+
maxSlippageBps?: number;
|
|
12
|
+
}
|
|
13
|
+
/** The network of a Bitcoin address, so recipients can be checked against the recovery address. */
|
|
14
|
+
export declare function bitcoinNetworkOf(address: string): typeof btc.NETWORK;
|
|
15
|
+
/**
|
|
16
|
+
* Turn a payment request into the recipient commitments a claim enforces.
|
|
17
|
+
*
|
|
18
|
+
* Each recipient commits to its floor (nominal less the tolerance). The claim
|
|
19
|
+
* splits any surplus in proportion to the floors, so a payment funded at its
|
|
20
|
+
* nominal total pays roughly the nominal amounts. `minimumPayoutSats` is the
|
|
21
|
+
* floor total plus the fee: the least the server may fund the HTLC with.
|
|
22
|
+
*/
|
|
23
|
+
export declare function commitBitcoinPayment(request: BitcoinPaymentRequest, network: typeof btc.NETWORK): {
|
|
24
|
+
payout: BitcoinPayout;
|
|
25
|
+
minimumPayoutSats: bigint;
|
|
26
|
+
nominalSats: bigint;
|
|
27
|
+
};
|
|
28
|
+
/** Minimum HTLC funding for a payment request: floors plus the fee. */
|
|
29
|
+
export declare function minimumBitcoinPayout(request: BitcoinPaymentRequest, network: typeof btc.NETWORK): bigint;
|
|
@@ -248,6 +248,10 @@ export interface EvmToArkadeSwapGenericResult {
|
|
|
248
248
|
}
|
|
249
249
|
/** Options for creating an EVM-to-Bitcoin (on-chain) swap via the generic endpoint */
|
|
250
250
|
export interface EvmToBitcoinSwapOptions {
|
|
251
|
+
/** Operator-supplied relay floor for explorers without a relay-policy endpoint. */
|
|
252
|
+
minimumRelayFeeRateSatPerVb?: number;
|
|
253
|
+
/** Pay several Bitcoin recipients from this swap; amounts are nominal, see {@link BitcoinPaymentRequest}. */
|
|
254
|
+
bitcoinPayout?: import("./payout-slippage.js").BitcoinPaymentRequest;
|
|
251
255
|
/** ERC-20 contract address of the source token on the EVM chain */
|
|
252
256
|
tokenAddress: string;
|
|
253
257
|
/** Numeric EVM chain ID: 1 (Ethereum), 137 (Polygon), 42161 (Arbitrum) */
|
|
@@ -347,6 +351,9 @@ export interface ArkadeToEvmSwapResult {
|
|
|
347
351
|
* ```
|
|
348
352
|
*/
|
|
349
353
|
export interface CreateSwapOptions {
|
|
354
|
+
minimumRelayFeeRateSatPerVb?: number;
|
|
355
|
+
/** Pay several Bitcoin recipients (EVM to Bitcoin only); amounts are nominal. */
|
|
356
|
+
bitcoinPayout?: import("./payout-slippage.js").BitcoinPaymentRequest;
|
|
350
357
|
/** Source asset (preferred). Takes priority over `sourceAsset`. */
|
|
351
358
|
source?: Asset;
|
|
352
359
|
/** Target asset (preferred). Takes priority over `targetAsset`. */
|
|
@@ -593,7 +600,7 @@ export interface CreateSwapContext {
|
|
|
593
600
|
baseUrl: string;
|
|
594
601
|
/** Function to derive swap parameters (auto-increments key index) */
|
|
595
602
|
deriveSwapParams: () => Promise<SwapParams>;
|
|
596
|
-
/**
|
|
603
|
+
/** Legacy wallet-level EVM address; new gasless deposits use the derived swap key. */
|
|
597
604
|
evmAddress: string;
|
|
598
605
|
/** Jump the key index forward by `n` (used to skip past reused indices). */
|
|
599
606
|
skipKeyIndices?: (n: number) => Promise<void>;
|
|
@@ -614,6 +621,7 @@ export interface CreateSwapContext {
|
|
|
614
621
|
}, commitments?: {
|
|
615
622
|
lightningPaymentHash?: LightningPaymentHash;
|
|
616
623
|
evmFundingTerms?: EvmFundingTerms;
|
|
624
|
+
bitcoinPayout?: import("../storage/types.js").BitcoinPayout;
|
|
617
625
|
}) => Promise<void>;
|
|
618
626
|
}
|
|
619
627
|
/** Native Spark BTC funding; invoice descriptions do not apply. */
|
|
@@ -102,3 +102,5 @@ export declare function broadcastTransaction(esploraUrls: EsploraUrls, txHex: st
|
|
|
102
102
|
* @returns The transaction ID on success
|
|
103
103
|
*/
|
|
104
104
|
export declare function broadcastTransactionWithRetry(esploraUrls: EsploraUrls, txHex: string, retries?: number): Promise<string>;
|
|
105
|
+
/** Mempool-compatible explorers expose current relay policy separately from confirmation estimates. */
|
|
106
|
+
export declare function fetchMinimumRelayFeeRate(esploraUrls: EsploraUrls): Promise<number | undefined>;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* response and never updated from a later server answer.
|
|
17
17
|
*/
|
|
18
18
|
export interface EvmFundingTerms {
|
|
19
|
+
/** Depositor requested locally and verified at creation; never refreshed. */
|
|
20
|
+
depositor?: string;
|
|
19
21
|
chainId: number;
|
|
20
22
|
/** The coordinator: the Permit2 spender. */
|
|
21
23
|
coordinator: string;
|
|
@@ -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;
|
|
@@ -3020,6 +3036,12 @@ export interface components {
|
|
|
3020
3036
|
gasless?: boolean;
|
|
3021
3037
|
/** @description Hash lock (0x-prefixed 32-byte hex). Client generates secret, computes SHA256(secret). */
|
|
3022
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;
|
|
3023
3045
|
/**
|
|
3024
3046
|
* @description Optional promo code. Its rate replaces the base fee and its cap
|
|
3025
3047
|
* may lift the route maximum (400 if unknown, expired, used up, or too large).
|
|
@@ -4181,6 +4203,11 @@ export interface components {
|
|
|
4181
4203
|
*/
|
|
4182
4204
|
coordinator_address: string;
|
|
4183
4205
|
};
|
|
4206
|
+
RefundEvmGaslessResponse: {
|
|
4207
|
+
/** @description False means broadcast, confirmation not yet established. */
|
|
4208
|
+
confirmed: boolean;
|
|
4209
|
+
tx_hash: string;
|
|
4210
|
+
};
|
|
4184
4211
|
/** @description The lock a rehash would move, and the terms it would move to. */
|
|
4185
4212
|
RehashEvmParams: {
|
|
4186
4213
|
/** @description Locked amount (decimal string) */
|
|
@@ -4665,6 +4692,7 @@ export interface components {
|
|
|
4665
4692
|
token_id: components["schemas"]["TokenId"];
|
|
4666
4693
|
};
|
|
4667
4694
|
TokenInfos: {
|
|
4695
|
+
bitcoin_network: string;
|
|
4668
4696
|
btc_tokens: components["schemas"]["TokenInfo"][];
|
|
4669
4697
|
evm_tokens: components["schemas"]["TokenInfo"][];
|
|
4670
4698
|
};
|
|
@@ -5084,6 +5112,56 @@ export interface operations {
|
|
|
5084
5112
|
};
|
|
5085
5113
|
};
|
|
5086
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
|
+
};
|
|
5087
5165
|
rehash_evm: {
|
|
5088
5166
|
parameters: {
|
|
5089
5167
|
query?: never;
|
|
@@ -7,6 +7,8 @@ export { type AttestationResponse, type AttestationResult, type AttestationStatu
|
|
|
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
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,7 +22,7 @@ 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";
|
|
@@ -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
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const SDK_NAME = "swap";
|
|
2
|
-
export declare const SDK_VERSION = "1.
|
|
3
|
-
export declare const SDK_COMMIT_HASH = "
|
|
2
|
+
export declare const SDK_VERSION = "1.13.0";
|
|
3
|
+
export declare const SDK_COMMIT_HASH = "2a9d67ccaf674a45dad1053243942d6043b9c0f0";
|
|
4
4
|
/** @deprecated Retained for source compatibility; requests no longer send it. */
|
|
5
|
-
export declare const SATORA_SERVER_VERSION = "0.3.
|
|
6
|
-
export declare const CLIENT_AGENT = "swap/1.
|
|
5
|
+
export declare const SATORA_SERVER_VERSION = "0.3.31";
|
|
6
|
+
export declare const CLIENT_AGENT = "swap/1.13.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";
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { BitcoinHtlcFacts } from "./bitcoin.js";
|
|
11
11
|
import type { BitcoinChainReader } from "./bitcoin-manager.js";
|
|
12
|
+
/**
|
|
13
|
+
* Most outputs a client's funding is counted from, as the server's on-chain
|
|
14
|
+
* HTLC watcher counts it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_FUNDING_OUTPUTS = 2;
|
|
12
17
|
/** The slice of esplora's tx JSON we read. */
|
|
13
18
|
type EsploraTx = {
|
|
14
19
|
vin: Array<{
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkINHFP222cjs = require('./chunk-INHFP222.cjs');
|
|
4
|
-
require('./chunk-5DQHR3RO.cjs');
|
|
5
|
-
require('./chunk-JEQ2X3Z6.cjs');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.electrumReader = _chunkINHFP222cjs.electrumReader;
|
|
9
|
-
//# sourceMappingURL=bitcoin-reader-electrum-VCQ5TQ44.cjs.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk5DQHR3ROcjs = require('./chunk-5DQHR3RO.cjs');
|
|
7
|
-
require('./chunk-JEQ2X3Z6.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.DEFAULT_ESPLORA_URLS = _chunk5DQHR3ROcjs.DEFAULT_ESPLORA_URLS; exports.esploraReader = _chunk5DQHR3ROcjs.esploraReader; exports.htlcFactsFromEsploraTxs = _chunk5DQHR3ROcjs.htlcFactsFromEsploraTxs; exports.resolveMinConfirmations = _chunk5DQHR3ROcjs.resolveMinConfirmations;
|
|
14
|
-
//# sourceMappingURL=bitcoin-reader-esplora-6RH7S4BR.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/swap/swap/client-sdk/ts-sdk/packages/swap/dist/bitcoin-reader-esplora-6RH7S4BR.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,yRAAC","file":"/home/runner/work/swap/swap/client-sdk/ts-sdk/packages/swap/dist/bitcoin-reader-esplora-6RH7S4BR.cjs"}
|