@arkade-os/swap 0.0.3 → 0.0.5
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/README.md +189 -54
- package/dist/{chunk-HLMMA3LJ.js → chunk-Q4FAYBXS.js} +60 -247
- package/dist/index.cjs +212 -301
- package/dist/index.d.cts +283 -10
- package/dist/index.d.ts +283 -10
- package/dist/index.js +150 -69
- package/dist/nostr.cjs +21 -14
- package/dist/nostr.d.cts +14 -3
- package/dist/nostr.d.ts +14 -3
- package/dist/nostr.js +10 -2
- package/dist/{rfq-CCAFoFtR.d.cts → rfq-BH2yvo3O.d.cts} +50 -335
- package/dist/{rfq-CCAFoFtR.d.ts → rfq-BH2yvo3O.d.ts} +50 -335
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { IWallet, ProvisionedKey, ProvisionedClaimSecret, asset, arkade, RestIndexerProvider, Transaction, IContractManager, RestArkProvider, VHTLC, Identity } from '@arkade-os/sdk';
|
|
2
|
+
import { DiscoveredMarket, Network, LocalCardInput, Side, OfferPlan } from '@arkade-os/solver-discovery';
|
|
3
|
+
import { R as RfqStatus, a as RfqTransport, O as OnchainHtlc, C as ChainSource, b as ChainUtxo, c as OnchainHtlcPhase } from './rfq-BH2yvo3O.js';
|
|
4
|
+
export { A as ARKADE_ASSET, d as ARKADE_BTC, e as AddressMismatch, H as HtlcUtxo, I as InvoiceFacts, L as LIGHTNING_BTC, f as LIGHTNING_RECEIVE_PAIR, g as LIGHTNING_SEND_PAIR, M as MAX_MIN_CONFIRMATIONS, h as MIN_CLAIM_WINDOW_SECONDS, i as MIN_HEADROOM_SECONDS, j as ONCHAIN_BTC, k as ONCHAIN_CLAIM_MARGIN_SECONDS, l as ONCHAIN_DUST_SATS, m as ONCHAIN_ORDER_MARGIN_SECONDS, n as ONCHAIN_RECEIVE_PAIR, o as ONCHAIN_SECONDS_PER_BLOCK, p as ONCHAIN_SEND_PAIR, q as OnchainHtlcParams, r as OnchainNetwork, s as RFQ_TERMINAL_STATES, t as RelaySocket, u as RfqQuote, v as RfqRefusalReason, S as SOLO_REFUND_HEADROOM_SECONDS, w as SwapRefusal, x as arkadeSwapRequest, y as assertFundable, z as assertReceivable, B as awaitOnchainFill, D as buildHtlcClaim, E as buildHtlcRefund, F as claimOnchainFill, G as classifyOnchainHtlc, J as deriveLightningReceive, K as deriveOnchainReceive, N as deriveOnchainSend, P as extractPreimage, Q as httpTransport, T as lightningReceiveRequest, U as lightningSendRequest, V as lightningSendVtxoScript, W as newPreimage, X as newRfqId, Y as offerTermsFromQuote, Z as onchainHtlcScript, _ as onchainReceiveRequest, $ as onchainSendRequest, a0 as paymentHashOf, a1 as receiveVtxoScript, a2 as relayTransport, a3 as requestLightningReceive, a4 as requestLightningSend, a5 as requestOnchainReceive, a6 as requestOnchainSend, a7 as rfqPair, a8 as unilateralClaimDelay, a9 as unilateralRefundDelay, aa as unilateralRefundWithoutReceiverDelay, ab as verifyLockupAddress, ac as verifyReceiveInvoice } from './rfq-BH2yvo3O.js';
|
|
5
|
+
|
|
6
|
+
type AssetSwapStatus = "pending" | "cancelling" | "fulfilled" | "cancelled" | "recoverable" | "awaiting_fill" | "claimable" | "claimed" | "refunded_l1";
|
|
7
|
+
/** The sentinel asset id for BTC itself, as opposed to a 68-hex asset id.
|
|
8
|
+
* Lives here with the {@link AssetSwap} fields it describes so the market and
|
|
9
|
+
* restore layers share one spelling instead of re-typing the literal. */
|
|
10
|
+
declare const BTC_ASSET_ID = "btc";
|
|
11
|
+
/**
|
|
12
|
+
* The record fields a wallet-provisioned secret becomes — what
|
|
13
|
+
* {@link swapSecretsToRecord} emits, and what every record type carrying swap
|
|
14
|
+
* secrets embeds.
|
|
15
|
+
*
|
|
16
|
+
* A named type rather than four fields restated per record: the mapper and the
|
|
17
|
+
* records it feeds must agree exactly, and a record that silently omits one of
|
|
18
|
+
* these round-trips a swap whose preimage cannot be re-derived. Embedding makes
|
|
19
|
+
* the omission a compile error instead.
|
|
20
|
+
*
|
|
21
|
+
* **Only `preimageHex` is secret.** `signingDescriptor` and `preimageSaltHex`
|
|
22
|
+
* are public derivation inputs — they must survive a field-mapped backend, but
|
|
23
|
+
* they leak nothing without the seed.
|
|
24
|
+
*/
|
|
25
|
+
interface SwapSecretsProjection {
|
|
26
|
+
/**
|
|
27
|
+
* The wallet descriptor this swap's sender key comes from — a fresh HD
|
|
28
|
+
* child, or a static wallet's `tr(pubkey)`. Public — the signer
|
|
29
|
+
* re-derives from the wallet, so the record carries no key material.
|
|
30
|
+
*/
|
|
31
|
+
signingDescriptor?: string;
|
|
32
|
+
/** P, hex, when it cannot be re-derived from the seed at all: the user
|
|
33
|
+
* supplied it, or the signer cannot sign deterministically. The swap's only
|
|
34
|
+
* claim secret when present. */
|
|
35
|
+
preimageHex?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The salt P derives from, hex, on the salted arm — what a static wallet
|
|
38
|
+
* gets instead of storing P. **Public**, and unlike every other field here
|
|
39
|
+
* it is minted per swap: it is what stops one repeating key from handing
|
|
40
|
+
* every swap the same preimage.
|
|
41
|
+
*/
|
|
42
|
+
preimageSaltHex?: string;
|
|
43
|
+
}
|
|
44
|
+
interface AssetSwap extends SwapSecretsProjection {
|
|
45
|
+
/** Funding txid — the swap's identity. */
|
|
46
|
+
id: string;
|
|
47
|
+
/** 'btc' or a 68-hex asset id. */
|
|
48
|
+
fromAsset: string;
|
|
49
|
+
toAsset: string;
|
|
50
|
+
/** Atomic amounts as strings (bigint is not JSON-safe). */
|
|
51
|
+
fromAmount: string;
|
|
52
|
+
/** The covenant wantAmount — a floor, the fill pays >= this. */
|
|
53
|
+
toAmount: string;
|
|
54
|
+
swapAddress: string;
|
|
55
|
+
/** Hex pkScript of the swap contract — the indexer monitoring key. */
|
|
56
|
+
swapPkScript: string;
|
|
57
|
+
/** TLV offer — needed to rebuild the contract for cancel. */
|
|
58
|
+
offerHex: string;
|
|
59
|
+
fundingTxid: string;
|
|
60
|
+
spentTxid?: string;
|
|
61
|
+
status: AssetSwapStatus;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
completedAt?: number;
|
|
64
|
+
/** RFQ pair string, e.g. `arkade:BTC->onchain:BTC`. */
|
|
65
|
+
pair?: string;
|
|
66
|
+
/** `sha256(P)`, hex. Public, and how a restore confirms a candidate
|
|
67
|
+
* derivation is the right one. */
|
|
68
|
+
paymentHash?: string;
|
|
69
|
+
/** The L1 HTLC's pkScript, hex — the chain-watch key. */
|
|
70
|
+
htlcPkScriptHex?: string;
|
|
71
|
+
htlcLocktime?: number;
|
|
72
|
+
/** The L1 funding txid, once observed. */
|
|
73
|
+
l1Txid?: string;
|
|
74
|
+
}
|
|
75
|
+
/** All swaps, newest-first. Insertion order is not chronological — the restore
|
|
76
|
+
* scan rebuilds records in tx-scan order — so sort at read to keep
|
|
77
|
+
* newest-first canonical for every consumer. */
|
|
78
|
+
declare const getAssetSwapsOrThrow: (repository: AssetSwapRepository) => Promise<AssetSwap[]>;
|
|
79
|
+
/** The consumer read: a broken backend reads as no swaps rather than crashing
|
|
80
|
+
* a history view. Mutations must use {@link getAssetSwapsOrThrow} instead —
|
|
81
|
+
* swallowing the read there would let "the backend is gone" masquerade as "no
|
|
82
|
+
* such swap" and skip the write silently. */
|
|
83
|
+
declare const getAssetSwaps: (repository: AssetSwapRepository) => Promise<AssetSwap[]>;
|
|
84
|
+
/** Add a swap; no-op if the id is already stored. Returns the updated list.
|
|
85
|
+
* THROWS on a failed write — nothing irreversible may happen until this record
|
|
86
|
+
* is durable, so the caller must not fund on a failure. */
|
|
87
|
+
declare const addAssetSwap: (repository: AssetSwapRepository, swap: AssetSwap) => Promise<AssetSwap[]>;
|
|
88
|
+
/** Merge changes into a swap by id. Returns the updated list.
|
|
89
|
+
* THROWS on a failed read or write, like {@link addAssetSwap} — use this for a
|
|
90
|
+
* write that gates something irreversible. Transitions written *after* the
|
|
91
|
+
* irreversible act belong on {@link updateAssetSwapBestEffort}. */
|
|
92
|
+
declare const updateAssetSwap: (repository: AssetSwapRepository, id: string, changes: Partial<Omit<AssetSwap, "id">>) => Promise<AssetSwap[]>;
|
|
93
|
+
/**
|
|
94
|
+
* {@link updateAssetSwap} for transitions that follow an irreversible action (a
|
|
95
|
+
* broadcast claim, a spent lockup): failing the caller there would report as
|
|
96
|
+
* failed a swap whose funds already moved, and a stale status is recoverable —
|
|
97
|
+
* crash recovery re-derives the true state from the chain
|
|
98
|
+
* (`classifyOnchainHtlc`).
|
|
99
|
+
*
|
|
100
|
+
* `persisted` is the part that must not be hidden: a caller that notifies on a
|
|
101
|
+
* change, or treats one as terminal, has to know the store did not agree.
|
|
102
|
+
*/
|
|
103
|
+
declare const updateAssetSwapBestEffort: (repository: AssetSwapRepository, id: string, changes: Partial<Omit<AssetSwap, "id">>) => Promise<{
|
|
104
|
+
swaps: AssetSwap[];
|
|
105
|
+
persisted: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* The record fields a wallet-provisioned secret becomes.
|
|
109
|
+
*
|
|
110
|
+
* `signingDescriptor` is public and always stored — it is what recovers the
|
|
111
|
+
* signer. Then at most one of: `preimageHex`, when the wallet says it cannot
|
|
112
|
+
* re-derive P and it becomes the swap's only claim secret; or
|
|
113
|
+
* `preimageSaltHex`, the public input a derivable-but-repeating key needs.
|
|
114
|
+
*/
|
|
115
|
+
declare const swapSecretsToRecord: (secrets: ProvisionedKey | ProvisionedClaimSecret) => SwapSecretsProjection & {
|
|
116
|
+
signingDescriptor: string;
|
|
117
|
+
};
|
|
118
|
+
/** Why a wallet cannot produce a swap's preimage. */
|
|
119
|
+
type PreimageBlockedReason =
|
|
120
|
+
/** The record carries no `signingDescriptor`. */
|
|
121
|
+
"no-secrets"
|
|
122
|
+
/** `preimageHex` or `preimageSaltHex` is present but not 32 bytes of hex. */
|
|
123
|
+
| "malformed-record"
|
|
124
|
+
/**
|
|
125
|
+
* Nothing to derive from: a descriptor that repeats across swaps, with
|
|
126
|
+
* neither a stored preimage nor a salt — or one this wallet holds no key
|
|
127
|
+
* for. Merged deliberately: `contractSigner` reports a key it does not
|
|
128
|
+
* hold as a plain `Error` for static wallets and a `ForeignDescriptorError`
|
|
129
|
+
* for HD ones, so splitting the two here would mean matching on message
|
|
130
|
+
* text, which is the thing this type exists to avoid. The `cause` carries
|
|
131
|
+
* whichever it was.
|
|
132
|
+
*/
|
|
133
|
+
| "not-derivable"
|
|
134
|
+
/** Derived, but it does not hash to the record's `paymentHash`. */
|
|
135
|
+
| "hash-mismatch";
|
|
136
|
+
/**
|
|
137
|
+
* The wallet cannot produce this swap's preimage, and which of the four ways
|
|
138
|
+
* is `reason`.
|
|
139
|
+
*
|
|
140
|
+
* Deliberately **not** {@link RefundNotLocallyPossibleError}: that one means
|
|
141
|
+
* "no local refund is possible", and `RfqSwapManager` acts on it by reporting
|
|
142
|
+
* `needs_counterparty`. A claim-path read failure is a different verdict, and
|
|
143
|
+
* borrowing the refund error would have the manager announce one for the
|
|
144
|
+
* other.
|
|
145
|
+
*/
|
|
146
|
+
declare class PreimageNotRecoverableError extends Error {
|
|
147
|
+
readonly reason: PreimageBlockedReason;
|
|
148
|
+
readonly name = "PreimageNotRecoverableError";
|
|
149
|
+
constructor(reason: PreimageBlockedReason, message: string, options?: {
|
|
150
|
+
cause?: unknown;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The preimage a swap record claims with — stored, or re-derived from the
|
|
155
|
+
* wallet.
|
|
156
|
+
*
|
|
157
|
+
* The record-shaped inverse of {@link swapSecretsToRecord}, and the one place
|
|
158
|
+
* that knows which of a record's fields `contractPreimage` needs. Wire claim
|
|
159
|
+
* paths here rather than composing it by hand: a caller that forgets to pass
|
|
160
|
+
* `preimageSaltHex` gets a *wrong* preimage from a wallet that can derive,
|
|
161
|
+
* not an error.
|
|
162
|
+
*
|
|
163
|
+
* Verifies the result against `paymentHash` when the record carries one. The
|
|
164
|
+
* salted arm has two inputs that can be wrong — the key and the salt — where
|
|
165
|
+
* the HD arm had one, and a wrong P otherwise surfaces as an opaque script
|
|
166
|
+
* failure at claim time, long after the mistake.
|
|
167
|
+
*
|
|
168
|
+
* Every refusal is a {@link PreimageNotRecoverableError} carrying a `reason`,
|
|
169
|
+
* so a caller can tell "this record predates the descriptor" from "the salt is
|
|
170
|
+
* corrupt" without reading message text.
|
|
171
|
+
*/
|
|
172
|
+
declare const preimageForSwapRecord: (wallet: IWallet, record: SwapSecretsProjection & {
|
|
173
|
+
paymentHash?: string;
|
|
174
|
+
}) => Promise<Uint8Array>;
|
|
175
|
+
|
|
176
|
+
/** A registry discovery result held for reuse. Refetchable — unlike a swap
|
|
177
|
+
* record, losing it costs one network round trip — but it must survive a cold
|
|
178
|
+
* boot: serving it stale is what keeps quoting alive while a registry is down. */
|
|
179
|
+
interface MarketsCacheEntry {
|
|
180
|
+
markets: DiscoveredMarket[];
|
|
181
|
+
fetchedAt: number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Everything the package persists, following the monorepo repository
|
|
185
|
+
* convention (versioned interface, AsyncDisposable, one backend per
|
|
186
|
+
* platform — see the Boltz plugin's SwapRepository). Consumers construct
|
|
187
|
+
* exactly one of these; there is no second storage seam.
|
|
188
|
+
*
|
|
189
|
+
* Durable records (swaps) and rebuildable state (the restore scan's txid
|
|
190
|
+
* cursor, the markets cache) live side by side because they share a
|
|
191
|
+
* lifetime: all three belong to one wallet on one device, and a consumer
|
|
192
|
+
* that wipes one wants all three gone.
|
|
193
|
+
*
|
|
194
|
+
* ponytail: no query filters — every consumer reads all swaps and filters
|
|
195
|
+
* in memory; mirror the Boltz plugin's GetSwapsFilter when a consumer needs
|
|
196
|
+
* subset queries.
|
|
197
|
+
*/
|
|
198
|
+
interface AssetSwapRepository extends AsyncDisposable {
|
|
199
|
+
readonly version: 2;
|
|
200
|
+
/** Insert or replace a swap by id. Store the record whole: `preimageHex`
|
|
201
|
+
* and `preimageSaltHex` both leave the swap unclaimable if a field-mapped
|
|
202
|
+
* backend drops them — the first is the only claim secret of a swap whose
|
|
203
|
+
* signer cannot derive, the second the public input every other static
|
|
204
|
+
* wallet's preimage derives from. */
|
|
205
|
+
saveSwap(swap: AssetSwap): Promise<void>;
|
|
206
|
+
/** All stored swaps, in no particular order — `getAssetSwaps` is the
|
|
207
|
+
* canonical newest-first read. */
|
|
208
|
+
getAllSwaps(): Promise<AssetSwap[]>;
|
|
209
|
+
/** Sent txids already checked for offer packets (see restore.ts). */
|
|
210
|
+
getScannedTxids(): Promise<Set<string>>;
|
|
211
|
+
markTxidsScanned(txids: Iterable<string>): Promise<void>;
|
|
212
|
+
/** Cached registry markets, or undefined on a miss. */
|
|
213
|
+
getCachedMarkets(network: string, registry: string): Promise<MarketsCacheEntry | undefined>;
|
|
214
|
+
saveCachedMarkets(network: string, registry: string, entry: MarketsCacheEntry): Promise<void>;
|
|
215
|
+
clear(): Promise<void>;
|
|
216
|
+
}
|
|
217
|
+
declare class InMemoryAssetSwapRepository implements AssetSwapRepository {
|
|
218
|
+
readonly version: 2;
|
|
219
|
+
private readonly swaps;
|
|
220
|
+
private readonly scanned;
|
|
221
|
+
private readonly markets;
|
|
222
|
+
saveSwap(swap: AssetSwap): Promise<void>;
|
|
223
|
+
getAllSwaps(): Promise<AssetSwap[]>;
|
|
224
|
+
getScannedTxids(): Promise<Set<string>>;
|
|
225
|
+
markTxidsScanned(txids: Iterable<string>): Promise<void>;
|
|
226
|
+
getCachedMarkets(network: string, registry: string): Promise<MarketsCacheEntry | undefined>;
|
|
227
|
+
saveCachedMarkets(network: string, registry: string, entry: MarketsCacheEntry): Promise<void>;
|
|
228
|
+
clear(): Promise<void>;
|
|
229
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
230
|
+
}
|
|
5
231
|
|
|
6
232
|
/** The contracts — pure data, shared verbatim with any other implementation. */
|
|
7
233
|
declare const swapPrograms: Record<"wantAsset" | "wantBtc", ReturnType<typeof arkade.parseArtifact>>;
|
|
@@ -218,7 +444,7 @@ declare const validatePlan: (plan: OfferPlan, giveBalance: bigint, dust: bigint)
|
|
|
218
444
|
* infrastructure the wallet already uses for its Boltz swap repository. */
|
|
219
445
|
declare class IndexedDbAssetSwapRepository implements AssetSwapRepository {
|
|
220
446
|
private readonly dbName;
|
|
221
|
-
readonly version:
|
|
447
|
+
readonly version: 2;
|
|
222
448
|
private dbPromise;
|
|
223
449
|
constructor(dbName?: string);
|
|
224
450
|
private ensureDb;
|
|
@@ -738,9 +964,12 @@ declare function readLockupFate(indexer: LockupSpendIndexer, input: {
|
|
|
738
964
|
*/
|
|
739
965
|
declare function pushRefundWithoutReceiver(ark: RefundArkProvider, input: {
|
|
740
966
|
script: InstanceType<typeof VHTLC.ScriptV2>;
|
|
741
|
-
/** The `sender` signer. Build it from the swap
|
|
742
|
-
*
|
|
743
|
-
* the seed, with no stored key bytes anywhere
|
|
967
|
+
/** The `sender` signer. Build it from the swap record with
|
|
968
|
+
* {@link senderIdentityForSwapRecord} — on an HD wallet that resolves
|
|
969
|
+
* from the seed, with no stored key bytes anywhere, and every way the
|
|
970
|
+
* wallet can fail to produce it arrives as one typed
|
|
971
|
+
* {@link RefundNotLocallyPossibleError} the manager reads as permanent
|
|
972
|
+
* rather than retrying for the rest of the refund window. */
|
|
744
973
|
sender: Identity;
|
|
745
974
|
vtxos: readonly LockupVtxo[];
|
|
746
975
|
/** Defaults to the contract's own committed refund destination. */
|
|
@@ -887,7 +1116,7 @@ declare function pushClaim(ark: ClaimArkProvider, input: {
|
|
|
887
1116
|
/** The receive-direction covenant (see `receiveVtxoScript`). */
|
|
888
1117
|
script: InstanceType<typeof VHTLC.ScriptV2>;
|
|
889
1118
|
/** The trader's `receiver` signer. Build it from the swap's `secrets`
|
|
890
|
-
* with `
|
|
1119
|
+
* with `contractSigner` — on an HD wallet that resolves
|
|
891
1120
|
* from the seed, with no stored key bytes anywhere. */
|
|
892
1121
|
receiver: Identity;
|
|
893
1122
|
/** `P`, 32 bytes — the trader generated it at request time. */
|
|
@@ -942,6 +1171,50 @@ declare function claimReceiveLockup(indexer: RefundIndexer, ark: ClaimArkProvide
|
|
|
942
1171
|
amount: number;
|
|
943
1172
|
}>;
|
|
944
1173
|
|
|
1174
|
+
/**
|
|
1175
|
+
* Why a wallet cannot produce a swap's spending key.
|
|
1176
|
+
*
|
|
1177
|
+
* A swap-lifecycle concern, not a key-provisioning one — which is why it
|
|
1178
|
+
* lives here and not in the SDK: `RfqSwapManager` reads it to decide a refund
|
|
1179
|
+
* is impossible rather than merely failing, and stops grinding against a push
|
|
1180
|
+
* that can never work for the whole refund window.
|
|
1181
|
+
*/
|
|
1182
|
+
|
|
1183
|
+
type RefundBlockedReason =
|
|
1184
|
+
/** The record carries no `signingDescriptor`. */
|
|
1185
|
+
"no-secrets"
|
|
1186
|
+
/** The descriptor belongs to another wallet's key. */
|
|
1187
|
+
| "foreign-descriptor"
|
|
1188
|
+
/**
|
|
1189
|
+
* This wallet holds the key but cannot sign with it — a watch-only
|
|
1190
|
+
* identity, or a remote signer that is not attached. Unlike the other two
|
|
1191
|
+
* this can stop being true without changing wallets, so it is worth
|
|
1192
|
+
* telling apart: "attach your signer", not "restore the other wallet".
|
|
1193
|
+
*/
|
|
1194
|
+
| "unsignable-wallet";
|
|
1195
|
+
/**
|
|
1196
|
+
* The wallet cannot produce this swap's spending key, so no local refund is
|
|
1197
|
+
* possible: not a failure to retry, a capability this wallet does not have.
|
|
1198
|
+
*/
|
|
1199
|
+
declare class RefundNotLocallyPossibleError extends Error {
|
|
1200
|
+
readonly reason: RefundBlockedReason;
|
|
1201
|
+
readonly name = "RefundNotLocallyPossibleError";
|
|
1202
|
+
constructor(reason: RefundBlockedReason, message: string, options?: {
|
|
1203
|
+
cause?: unknown;
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* The signer for a swap record's `signingDescriptor`, or a typed refusal.
|
|
1208
|
+
*
|
|
1209
|
+
* **Wire `refundArkade` here, not to `contractSigner` directly.** The SDK
|
|
1210
|
+
* answers about a descriptor; only this knows that a record without one is a
|
|
1211
|
+
* permanent refusal rather than a `TypeError` at the push site — which the
|
|
1212
|
+
* manager would treat as retryable.
|
|
1213
|
+
*/
|
|
1214
|
+
declare function senderIdentityForSwapRecord(wallet: IWallet, record: {
|
|
1215
|
+
signingDescriptor?: string;
|
|
1216
|
+
}): Promise<Identity>;
|
|
1217
|
+
|
|
945
1218
|
/** The contract type a swap lockup registers under. `@arkade-os/sdk`'s handler
|
|
946
1219
|
* for `VHTLC.ScriptV2` — the covenant script this corridor builds. */
|
|
947
1220
|
declare const SWAP_LOCKUP_CONTRACT_TYPE = "vhtlc-v2";
|
|
@@ -1737,4 +2010,4 @@ interface RfqSwapOutcome {
|
|
|
1737
2010
|
txid?: string;
|
|
1738
2011
|
}
|
|
1739
2012
|
|
|
1740
|
-
export { type ArkadeRefundResult, AssetSwap, AssetSwapRepository, ChainSource, ChainUtxo, type ClaimArkProvider, type ClaimPacketInput, type DiscoverMarketsOptions, IndexedDbAssetSwapRepository, type LightningReceiveSwap, type LightningSendSwap, LockupAmountMismatchError, type LockupContractWriter, type LockupFate, LockupNeedsRecoveryError, LockupRegistrationFailed, type LockupSpendIndexer, type LockupVtxo, MarketsCacheEntry, OFFER_PACKET_TYPE, type Offer, type OfferContractRetirer, type OfferSwapWatcher, OnchainHtlc, OnchainHtlcPhase, type OnchainSendAction, type OnchainSendSwap, type PlanError, QUOTE_OPTIONS, REFUND_MTP_LAG_SECONDS, RFQ_RESOLVED_STATES, RFQ_SWAP_TERMINAL_STATES, type RefundArkProvider, type RefundIndexer, type RefundOutcome, type RestoreIndexer, RfqStatus, type RfqSwap, type RfqSwapActionName, type RfqSwapLockup, RfqSwapManager, type RfqSwapManagerCallbacks, type RfqSwapManagerConfig, type RfqSwapManagerDeps, type RfqSwapManagerEvents, type RfqSwapOutcome, type RfqSwapState, RfqTransport, SWAP_LOCKUP_CONTRACT_KIND, SWAP_LOCKUP_CONTRACT_LABEL, SWAP_LOCKUP_CONTRACT_TYPE, type SealedClaimPacket, type SpendKind, type SwapContractRegistry, type Tx, type WatchOfferSwapsParams, awaitLockupFunding, awaitRfqResolution, cancelOffer, claimReceiveLockup, classifyDepositSpend, classifySpend, createOffer, decodeOffer, discoverMarkets, encodeOffer, findLockupVtxos, findMarket, isRfqSwapTerminal, isRfqTerminal, makeCachedFeedFetch, nextOnchainAction, offerVtxoScript, pushClaim, pushRefundWithoutReceiver, readLockupFate, refundIfUnresolved, registerLockupContract, restoreAssetSwaps, retireSettledOfferContracts, sealClaimPacket, spendTxidsOf, spendUpdate, swapPrograms, validatePlan, watchOfferSwaps };
|
|
2013
|
+
export { type ArkadeRefundResult, type AssetSwap, type AssetSwapRepository, type AssetSwapStatus, BTC_ASSET_ID, ChainSource, ChainUtxo, type ClaimArkProvider, type ClaimPacketInput, type DiscoverMarketsOptions, InMemoryAssetSwapRepository, IndexedDbAssetSwapRepository, type LightningReceiveSwap, type LightningSendSwap, LockupAmountMismatchError, type LockupContractWriter, type LockupFate, LockupNeedsRecoveryError, LockupRegistrationFailed, type LockupSpendIndexer, type LockupVtxo, type MarketsCacheEntry, OFFER_PACKET_TYPE, type Offer, type OfferContractRetirer, type OfferSwapWatcher, OnchainHtlc, OnchainHtlcPhase, type OnchainSendAction, type OnchainSendSwap, type PlanError, type PreimageBlockedReason, PreimageNotRecoverableError, QUOTE_OPTIONS, REFUND_MTP_LAG_SECONDS, RFQ_RESOLVED_STATES, RFQ_SWAP_TERMINAL_STATES, type RefundArkProvider, type RefundBlockedReason, type RefundIndexer, RefundNotLocallyPossibleError, type RefundOutcome, type RestoreIndexer, RfqStatus, type RfqSwap, type RfqSwapActionName, type RfqSwapLockup, RfqSwapManager, type RfqSwapManagerCallbacks, type RfqSwapManagerConfig, type RfqSwapManagerDeps, type RfqSwapManagerEvents, type RfqSwapOutcome, type RfqSwapState, RfqTransport, SWAP_LOCKUP_CONTRACT_KIND, SWAP_LOCKUP_CONTRACT_LABEL, SWAP_LOCKUP_CONTRACT_TYPE, type SealedClaimPacket, type SpendKind, type SwapContractRegistry, type SwapSecretsProjection, type Tx, type WatchOfferSwapsParams, addAssetSwap, awaitLockupFunding, awaitRfqResolution, cancelOffer, claimReceiveLockup, classifyDepositSpend, classifySpend, createOffer, decodeOffer, discoverMarkets, encodeOffer, findLockupVtxos, findMarket, getAssetSwaps, getAssetSwapsOrThrow, isRfqSwapTerminal, isRfqTerminal, makeCachedFeedFetch, nextOnchainAction, offerVtxoScript, preimageForSwapRecord, pushClaim, pushRefundWithoutReceiver, readLockupFate, refundIfUnresolved, registerLockupContract, restoreAssetSwaps, retireSettledOfferContracts, sealClaimPacket, senderIdentityForSwapRecord, spendTxidsOf, spendUpdate, swapPrograms, swapSecretsToRecord, updateAssetSwap, updateAssetSwapBestEffort, validatePlan, watchOfferSwaps };
|