@arkade-os/swap 0.1.10 → 0.1.12
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 +58 -0
- package/dist/advanced.cjs +1058 -414
- package/dist/advanced.d.cts +7 -64
- package/dist/advanced.d.ts +7 -64
- package/dist/advanced.js +29 -5
- package/dist/{chunk-AUJDREZN.js → chunk-CIDVLDDM.js} +1 -1
- package/dist/{chunk-FWRDAL73.js → chunk-F3BGKWIB.js} +758 -104
- package/dist/{chunk-LCO6AJOS.js → chunk-ISKJIONJ.js} +58 -285
- package/dist/{chunk-2HQZLIVX.js → chunk-JBTU7Y6M.js} +1 -1
- package/dist/chunk-UXK7YDA4.js +568 -0
- package/dist/{chunk-6RJVT65W.js → chunk-VPVSSBY2.js} +2 -4
- package/dist/index.cjs +1045 -414
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +15 -5
- package/dist/{lockupContract-BTTRVwOt.d.cts → lockupContract-B1mr672c.d.cts} +1 -1
- package/dist/{lockupContract-aFarhlxj.d.ts → lockupContract-BRpk0NxT.d.ts} +1 -1
- package/dist/node/index.d.cts +18 -18
- package/dist/node/index.d.ts +18 -18
- package/dist/nostr.cjs +276 -302
- package/dist/nostr.d.cts +20 -2
- package/dist/nostr.d.ts +20 -2
- package/dist/nostr.js +21 -357
- package/dist/{offerFillPlan-CJC5tnEd.d.ts → offerFillPlan-BMZXiVMB.d.ts} +213 -28
- package/dist/{offerFillPlan-FmyaQoYT.d.cts → offerFillPlan-CqJerwXd.d.cts} +213 -28
- package/dist/openRfq-Dx-vxOzl.d.cts +32 -0
- package/dist/openRfq-Dx-vxOzl.d.ts +32 -0
- package/dist/openRfqTransport-MQZ7JWYN.js +9 -0
- package/dist/protocol.cjs +301 -322
- package/dist/protocol.d.cts +5 -5
- package/dist/protocol.d.ts +5 -5
- package/dist/protocol.js +6 -8
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/{repository-CwwhIAEd.d.cts → repository-CFC0fHAy.d.cts} +26 -26
- package/dist/{repository-DO6QKxBx.d.ts → repository-suGldzOK.d.ts} +26 -26
- package/dist/rfq-contract.cjs +3 -6
- package/dist/rfq-contract.d.cts +3 -4
- package/dist/rfq-contract.d.ts +3 -4
- package/dist/rfq-contract.js +3 -5
- package/dist/transportErrors-DZuZqnF4.d.cts +8 -0
- package/dist/transportErrors-DZuZqnF4.d.ts +8 -0
- package/dist/{verify-ENO36VPK.js → verify-HU5COTNO.js} +3 -3
- package/dist/{watch-_fZSgx_l.d.ts → watch-C2z6Onak.d.ts} +1 -1
- package/dist/{watch-DpDSP2tu.d.cts → watch-CpYjItYX.d.cts} +1 -1
- package/package.json +3 -3
package/dist/advanced.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps
|
|
2
|
-
export {
|
|
1
|
+
import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps } from './offerFillPlan-CqJerwXd.cjs';
|
|
2
|
+
export { b as AcceptConflict, c as AcceptInput, d as AcceptOptions, e as AmbiguousDestination, f as AmountEncodingUnsupported, g as AmountMismatch, h as AssetRfqPreparation, B as BuildOfferFillPlanOpts, i as CORRIDOR_FACTORIES, j as CancelInput, k as CancelOutcome, l as ClaimedDestination, m as ClientDisposed, n as CorridorBase, o as CorridorClaim, p as CorridorCovenant, q as CorridorDeadline, r as CorridorDeps, s as CorridorDepsByCorridor, t as CorridorDrive, u as CorridorLockup, v as CorridorModule, w as CorridorOverrides, x as CorridorPass, y as CorridorRfqPreparation, z as CorridorSet, D as DEFAULT_MAX_REFUND_WINDOW_SECONDS, E as DEFAULT_OPEN_RFQ_RELAYS, F as DiscoveryConfig, G as DiscoveryIndex, H as DiscoveryIndexInput, I as DiscoveryLeg, J as DiscoverySnapshot, K as DiscoverySnapshotUnavailable, M as DriveMode, N as DriveRefusal, P as ExchangeOptions, Q as FEED_TTL_MS, R as FeeCeiling, S as FeedFetch, T as FeedQuoteInput, U as FillSponsor, V as FillSponsorFare, W as INDEXED_NETWORKS, X as InconsistentRoute, Y as InsufficientFunds, Z as JointGraph, _ as LockupOwner, $ as Market, a0 as MarketCandidate, a1 as MarketLeg, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OpenRfqAuction, ad as OpenRfqOffer, ae as OpenRfqOptions, af as OperatorUnreachable, ag as ParsedRfqQuote, ah as PayOptions, ai as PayResult, aj as QuoteCheck, ak as QuoteExpired, al as QuotePreparation, am as QuoteVerificationFailed, an as REGISTRY_URL, ao as ReceiveArtifact, ap as ReceiveOptions, aq as ReceiveRequest, ar as RecoveryResult, as as RegisteredAsset, at as ResolveDeps, au as ResolvedRoute, av as RfqAuctionPolicy, aw as RfqPreparation, ax as RfqQuoteInput, ay as RouteSide, az as SWAP_ERROR_NAMES, aA as SolverCandidate, aB as SolverHealth, aC as SolverHealthEntry, aD as SolverHealthScope, aE as SolverHealthStorage, aF as SolverRoutesUnavailable, aG as SolverRoutingContext, aH as SolverRoutingPolicy, aI as SwapClient, aJ as SwapClientConfig, aK as SwapDrive, aL as SwapDriveConfig, aM as SwapDriveRefusedError, aN as SwapError, aO as SwapErrorName, aP as SwapFilter, aQ as SwapPolicy, aR as UnsupportedRoute, aS as VerbDeps, aT as acceptQuote, aU as assembleRoute, aV as buildOfferFillPlan, aW as canFailoverQuote, aX as cancelSwap, aY as canonicalAssetId, aZ as cardMarketOf, a_ as chooseMarket, a$ as completedSolverUsage, b0 as conflictingFields, b1 as corridorSet, b2 as createSolverHealth, b3 as createSwapClient, b4 as createSwapDrive, b5 as deepFreeze, b6 as digestJointGraph, b7 as discoveryIndex, b8 as eligibleMarkets, b9 as enforceFeeCeiling, ba as exchange, bb as feedFetch, bc as feedSpread, bd as freezeOpenRfqValue, be as hasPausedKnownBidder, bf as isAddressable, bg as isCardMarket, bh as isIndexedNetwork, bi as isSolverReliabilityFailure, bj as isSwapError, bk as isUsableCard, bl as liveArkadeInfo, bm as liveOperatorInfo, bn as marketBackendOf, bo as marketKeyOf, bp as marketOf, bq as marketRefOf, br as openBidCandidates, bs as orderedSolverCandidates, bt as parseRfqQuote, bu as pay, bv as quoteAdvertisedPlan, bw as quoteFromFeed, bx as quoteViaRfq, by as readableRecord, bz as receive, bA as resolveCorridorBase, bB as resolveCorridorDeps, bC as resolveRoute, bD as rfqLeg, bE as rfqPairFor, bF as solverFacingAmount, bG as swapRecordOf, bH as toDiscoveryLeg, bI as unsignedPsbtBytes, bJ as usableMarkets, bK as verifyJointGraph, bL as verifyOfferFillPlan, bM as verifyPlanLegs, bN as withCanonicalAmount } from './offerFillPlan-CqJerwXd.cjs';
|
|
3
3
|
import { DiscoveredMarket, Side } from '@arkade-os/solver-discovery';
|
|
4
|
-
import { N as NetworkRef, A as AssetId, C as Corridor, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer
|
|
5
|
-
export {
|
|
4
|
+
import { N as NetworkRef, A as AssetId, C as Corridor, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer } from './repository-CFC0fHAy.cjs';
|
|
5
|
+
export { i as ACTIVITY_TOKEN, j as ARKADE_ASSET_NAMESPACE, k as Amount, l as AmountFormatError, m as AmountOn, n as AmountRefusal, o as ArkadeCarrierChoice, p as Artifact, q as AssetIdError, r as AssetIdRefusal, s as AssetNamespace, t as AssetOn, u as AssetPart, v as AssetPaymentInput, w as AssetPaymentTerms, x as AssetRef, y as AssetScale, z as AssetSwapId, B as AtomicDecimal, D as AuctionProvenance, E as BITCOIN_RAILS, F as BTC_ASSET_PART, G as BitcoinRail, H as CORRIDORS, I as CORRIDOR_PASS, J as CardMarketRef, K as CorridorId, M as CorridorKind, P as DepositArtifact, T as DisplayDecimal, U as Endpoint, V as Ep, W as Instrument, X as LOCKUP_OWNER, Y as MarketBackend, Z as MarketRef, _ as OFFER_SWAP_ID_PREFIX, $ as OfferCovenant, a0 as Outcome, a1 as ParsedAssetId, a2 as PinnedAmount, a3 as Quote, a4 as QuoteInput, a5 as QuoteLeg, a6 as RAILS, a7 as RFQ_SWAP_ID_PREFIX, a8 as RailOf, a9 as RankedBid, aa as RawState, ab as ReceiverPaidCarrierQuote, ac as RecordedArtifact, ad as RecordedAssetPayment, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, ah as ResolvedEndpoint, ai as RestoredMarketRef, aj as RfqAmountSide, ak as Route, al as RouteResolution, am as SnapshotRef, an as Swap, ao as SwapFamily, ap as SwapRecordCommon, aq as SwapUpdate, ar as TaxiIdentity, as as Unsubscribe, at as VerifiedCarrierTerms, au as arkadeAsset, av as artifactOf, aw as assetPartOf, ax as assetSwapIdOf, ay as bitcoinNetworkOf, az as btcAssetPart, aA as btcOn, aB as corridorOfRail, aC as corridorOutcome, aD as decodeRfqAmount, aE as encodeRfqAmount, aF as familyOfSwapId, aG as formatAssetId, aH as fromAtomicDecimal, aI as fromRfqAmountSide, aJ as fundingWasNotSubmitted, aK as fundsFromWallet, aL as instrumentOf, aM as isAssetId, aN as isAtomicDecimal, aO as isBtcAsset, aP as isBtcAssetLenient, aQ as isNetworkRef, aR as issuanceOf, aS as legOf, aT as offerOutcome, aU as parseAssetId, aV as quoteIdOfSwapId, aW as railOf, aX as railOfCorridor, aY as readsChain, aZ as recordArtifact, a_ as recordEndpoint, a$ as recordInstrument, b0 as recordLeg, b1 as recordOutcome, b2 as sameAsset, b3 as swapOf, b4 as toAtomicDecimal, b5 as toRfqAmountSide, b6 as toSafeNumber } from './repository-CFC0fHAy.cjs';
|
|
6
6
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, P as Pubkey } from './rfq-nMGywkqI.cjs';
|
|
7
7
|
export { A as AttestingRfqTransport, H as Hex, a as RfqRendezvous, b as RfqTransportFactory, S as SwapRefusal, c as attesting, d as createNostrTransportFactory, n as nostrTransportFactory } from './rfq-nMGywkqI.cjs';
|
|
8
8
|
import * as btc from '@scure/btc-signer';
|
|
9
9
|
import { OnchainProvider, NetworkName, PageRequest, PageResult, IWallet, VHTLC } from '@arkade-os/sdk';
|
|
10
|
-
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-
|
|
10
|
+
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-CpYjItYX.cjs';
|
|
11
|
+
import './openRfq-Dx-vxOzl.cjs';
|
|
11
12
|
import './rfq-contract.cjs';
|
|
12
13
|
import 'nostr-tools';
|
|
13
14
|
|
|
@@ -399,64 +400,6 @@ declare const restoredCorridorRecord: (stored: RfqSwapRecord, network: NetworkRe
|
|
|
399
400
|
*/
|
|
400
401
|
declare const walletLockupIndexer: (wallet: IWallet) => LockupSpendIndexer;
|
|
401
402
|
|
|
402
|
-
/**
|
|
403
|
-
* Route resolution: the single place `to` is parsed, the corridor pair decided, the
|
|
404
|
-
* amount pinned and the market chosen — everything before a solver is told anything.
|
|
405
|
-
*
|
|
406
|
-
* The order (§3.1) is load-bearing: `to` first (needs no market data); the pair selects
|
|
407
|
-
* the `Route` variant, refusing unsupported pairs before any round trip or record; only
|
|
408
|
-
* then the market index, since tickers resolve against the cards themselves. Exactly one
|
|
409
|
-
* amount may be pinned; two is `AmountMismatch`, thrown here so nothing is disclosed.
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
/** The five implemented corridor pairs, spelled as the route union spells them. */
|
|
413
|
-
declare const SUPPORTED_PAIRS: readonly ["arkade->arkade", "arkade->lightning", "lightning->arkade", "arkade->onchain", "onchain->arkade"];
|
|
414
|
-
type SupportedPair = (typeof SUPPORTED_PAIRS)[number];
|
|
415
|
-
interface ResolveDeps {
|
|
416
|
-
readonly corridors: CorridorSet;
|
|
417
|
-
/** The network the wallet reported; every defaulted asset id is on it. */
|
|
418
|
-
readonly network: NetworkName;
|
|
419
|
-
readonly discovery: DiscoveryIndex;
|
|
420
|
-
readonly policy?: SwapPolicy;
|
|
421
|
-
/**
|
|
422
|
-
* `resolve()` reads what is in hand; `quote()` may fetch. A flag, not two functions,
|
|
423
|
-
* so the resolution a caller vetoed is exactly the one they quote.
|
|
424
|
-
*/
|
|
425
|
-
readonly mode: "resolve" | "quote";
|
|
426
|
-
}
|
|
427
|
-
/** What the quote path needs from a resolution, over what a caller sees. */
|
|
428
|
-
interface ResolvedRoute {
|
|
429
|
-
readonly resolution: RouteResolution;
|
|
430
|
-
/** Both legs in discovery's vocabulary — what the market lookup matched on. */
|
|
431
|
-
readonly legs: {
|
|
432
|
-
readonly give: DiscoveryLeg;
|
|
433
|
-
readonly take: DiscoveryLeg;
|
|
434
|
-
};
|
|
435
|
-
readonly give: ResolvedEndpoint;
|
|
436
|
-
readonly take: ResolvedEndpoint;
|
|
437
|
-
readonly pair: SupportedPair;
|
|
438
|
-
readonly candidates: readonly MarketCandidate[];
|
|
439
|
-
/** The chosen card, absent when nothing eligible survived. */
|
|
440
|
-
readonly market?: MarketCandidate;
|
|
441
|
-
readonly snapshot: DiscoverySnapshot;
|
|
442
|
-
readonly amount?: PinnedAmount;
|
|
443
|
-
/** The alias table the snapshot produced, so the quote path can reuse it. */
|
|
444
|
-
readonly aliases: AssetAliasTable;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Assemble the closed `Route` from two fully-instrumented legs.
|
|
448
|
-
*
|
|
449
|
-
* The quote path's one cast: the type checker cannot correlate `corridor` and `asset`,
|
|
450
|
-
* so the runtime re-check turns a broken invariant into a throw rather than a covenant
|
|
451
|
-
* built against the wrong rail.
|
|
452
|
-
*/
|
|
453
|
-
declare const assembleRoute: (give: ResolvedEndpoint & {
|
|
454
|
-
instrument: Instrument;
|
|
455
|
-
}, take: ResolvedEndpoint & {
|
|
456
|
-
instrument: Instrument;
|
|
457
|
-
}) => Route;
|
|
458
|
-
declare const resolveRoute: (input: QuoteInput, deps: ResolveDeps) => Promise<ResolvedRoute>;
|
|
459
|
-
|
|
460
403
|
/** A `number` of sats from atomic units, or {@link AmountEncodingUnsupported}. */
|
|
461
404
|
declare const satsOf: (value: bigint, field: string) => number;
|
|
462
405
|
|
|
@@ -698,4 +641,4 @@ declare function revealClaimPacket(client: CovclaimdClient, input: {
|
|
|
698
641
|
ciphertext: string;
|
|
699
642
|
}>;
|
|
700
643
|
|
|
701
|
-
export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore,
|
|
644
|
+
export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, EVM_CHAIN, type EvmReceiveQuote, type EvmReceiveQuoteProfile, type EvmRfqQuote, type EvmSendQuote, type EvmSendQuoteProfile, INVOICE_HRPS, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, Pubkey, QuoteId, Rail, type RecordSink, type RevealParams, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, cardLegAssetId, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, evmAmountFromWire, evmAmountToWire, evmDirectionOf, evmQuoteSats, evmQuoteTokenAmount, evmReceivePair, evmReceiveRequest, evmSendPair, evmSendRequest, evmTokenLeg, evmTokenOf, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, readEvmReceiveQuote, readEvmSendQuote, reopenedDeposit, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyRefundWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyTaker, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps
|
|
2
|
-
export {
|
|
1
|
+
import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps } from './offerFillPlan-BMZXiVMB.js';
|
|
2
|
+
export { b as AcceptConflict, c as AcceptInput, d as AcceptOptions, e as AmbiguousDestination, f as AmountEncodingUnsupported, g as AmountMismatch, h as AssetRfqPreparation, B as BuildOfferFillPlanOpts, i as CORRIDOR_FACTORIES, j as CancelInput, k as CancelOutcome, l as ClaimedDestination, m as ClientDisposed, n as CorridorBase, o as CorridorClaim, p as CorridorCovenant, q as CorridorDeadline, r as CorridorDeps, s as CorridorDepsByCorridor, t as CorridorDrive, u as CorridorLockup, v as CorridorModule, w as CorridorOverrides, x as CorridorPass, y as CorridorRfqPreparation, z as CorridorSet, D as DEFAULT_MAX_REFUND_WINDOW_SECONDS, E as DEFAULT_OPEN_RFQ_RELAYS, F as DiscoveryConfig, G as DiscoveryIndex, H as DiscoveryIndexInput, I as DiscoveryLeg, J as DiscoverySnapshot, K as DiscoverySnapshotUnavailable, M as DriveMode, N as DriveRefusal, P as ExchangeOptions, Q as FEED_TTL_MS, R as FeeCeiling, S as FeedFetch, T as FeedQuoteInput, U as FillSponsor, V as FillSponsorFare, W as INDEXED_NETWORKS, X as InconsistentRoute, Y as InsufficientFunds, Z as JointGraph, _ as LockupOwner, $ as Market, a0 as MarketCandidate, a1 as MarketLeg, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OpenRfqAuction, ad as OpenRfqOffer, ae as OpenRfqOptions, af as OperatorUnreachable, ag as ParsedRfqQuote, ah as PayOptions, ai as PayResult, aj as QuoteCheck, ak as QuoteExpired, al as QuotePreparation, am as QuoteVerificationFailed, an as REGISTRY_URL, ao as ReceiveArtifact, ap as ReceiveOptions, aq as ReceiveRequest, ar as RecoveryResult, as as RegisteredAsset, at as ResolveDeps, au as ResolvedRoute, av as RfqAuctionPolicy, aw as RfqPreparation, ax as RfqQuoteInput, ay as RouteSide, az as SWAP_ERROR_NAMES, aA as SolverCandidate, aB as SolverHealth, aC as SolverHealthEntry, aD as SolverHealthScope, aE as SolverHealthStorage, aF as SolverRoutesUnavailable, aG as SolverRoutingContext, aH as SolverRoutingPolicy, aI as SwapClient, aJ as SwapClientConfig, aK as SwapDrive, aL as SwapDriveConfig, aM as SwapDriveRefusedError, aN as SwapError, aO as SwapErrorName, aP as SwapFilter, aQ as SwapPolicy, aR as UnsupportedRoute, aS as VerbDeps, aT as acceptQuote, aU as assembleRoute, aV as buildOfferFillPlan, aW as canFailoverQuote, aX as cancelSwap, aY as canonicalAssetId, aZ as cardMarketOf, a_ as chooseMarket, a$ as completedSolverUsage, b0 as conflictingFields, b1 as corridorSet, b2 as createSolverHealth, b3 as createSwapClient, b4 as createSwapDrive, b5 as deepFreeze, b6 as digestJointGraph, b7 as discoveryIndex, b8 as eligibleMarkets, b9 as enforceFeeCeiling, ba as exchange, bb as feedFetch, bc as feedSpread, bd as freezeOpenRfqValue, be as hasPausedKnownBidder, bf as isAddressable, bg as isCardMarket, bh as isIndexedNetwork, bi as isSolverReliabilityFailure, bj as isSwapError, bk as isUsableCard, bl as liveArkadeInfo, bm as liveOperatorInfo, bn as marketBackendOf, bo as marketKeyOf, bp as marketOf, bq as marketRefOf, br as openBidCandidates, bs as orderedSolverCandidates, bt as parseRfqQuote, bu as pay, bv as quoteAdvertisedPlan, bw as quoteFromFeed, bx as quoteViaRfq, by as readableRecord, bz as receive, bA as resolveCorridorBase, bB as resolveCorridorDeps, bC as resolveRoute, bD as rfqLeg, bE as rfqPairFor, bF as solverFacingAmount, bG as swapRecordOf, bH as toDiscoveryLeg, bI as unsignedPsbtBytes, bJ as usableMarkets, bK as verifyJointGraph, bL as verifyOfferFillPlan, bM as verifyPlanLegs, bN as withCanonicalAmount } from './offerFillPlan-BMZXiVMB.js';
|
|
3
3
|
import { DiscoveredMarket, Side } from '@arkade-os/solver-discovery';
|
|
4
|
-
import { N as NetworkRef, A as AssetId, C as Corridor, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer
|
|
5
|
-
export {
|
|
4
|
+
import { N as NetworkRef, A as AssetId, C as Corridor, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer } from './repository-suGldzOK.js';
|
|
5
|
+
export { i as ACTIVITY_TOKEN, j as ARKADE_ASSET_NAMESPACE, k as Amount, l as AmountFormatError, m as AmountOn, n as AmountRefusal, o as ArkadeCarrierChoice, p as Artifact, q as AssetIdError, r as AssetIdRefusal, s as AssetNamespace, t as AssetOn, u as AssetPart, v as AssetPaymentInput, w as AssetPaymentTerms, x as AssetRef, y as AssetScale, z as AssetSwapId, B as AtomicDecimal, D as AuctionProvenance, E as BITCOIN_RAILS, F as BTC_ASSET_PART, G as BitcoinRail, H as CORRIDORS, I as CORRIDOR_PASS, J as CardMarketRef, K as CorridorId, M as CorridorKind, P as DepositArtifact, T as DisplayDecimal, U as Endpoint, V as Ep, W as Instrument, X as LOCKUP_OWNER, Y as MarketBackend, Z as MarketRef, _ as OFFER_SWAP_ID_PREFIX, $ as OfferCovenant, a0 as Outcome, a1 as ParsedAssetId, a2 as PinnedAmount, a3 as Quote, a4 as QuoteInput, a5 as QuoteLeg, a6 as RAILS, a7 as RFQ_SWAP_ID_PREFIX, a8 as RailOf, a9 as RankedBid, aa as RawState, ab as ReceiverPaidCarrierQuote, ac as RecordedArtifact, ad as RecordedAssetPayment, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, ah as ResolvedEndpoint, ai as RestoredMarketRef, aj as RfqAmountSide, ak as Route, al as RouteResolution, am as SnapshotRef, an as Swap, ao as SwapFamily, ap as SwapRecordCommon, aq as SwapUpdate, ar as TaxiIdentity, as as Unsubscribe, at as VerifiedCarrierTerms, au as arkadeAsset, av as artifactOf, aw as assetPartOf, ax as assetSwapIdOf, ay as bitcoinNetworkOf, az as btcAssetPart, aA as btcOn, aB as corridorOfRail, aC as corridorOutcome, aD as decodeRfqAmount, aE as encodeRfqAmount, aF as familyOfSwapId, aG as formatAssetId, aH as fromAtomicDecimal, aI as fromRfqAmountSide, aJ as fundingWasNotSubmitted, aK as fundsFromWallet, aL as instrumentOf, aM as isAssetId, aN as isAtomicDecimal, aO as isBtcAsset, aP as isBtcAssetLenient, aQ as isNetworkRef, aR as issuanceOf, aS as legOf, aT as offerOutcome, aU as parseAssetId, aV as quoteIdOfSwapId, aW as railOf, aX as railOfCorridor, aY as readsChain, aZ as recordArtifact, a_ as recordEndpoint, a$ as recordInstrument, b0 as recordLeg, b1 as recordOutcome, b2 as sameAsset, b3 as swapOf, b4 as toAtomicDecimal, b5 as toRfqAmountSide, b6 as toSafeNumber } from './repository-suGldzOK.js';
|
|
6
6
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, P as Pubkey } from './rfq-CYxOyniL.js';
|
|
7
7
|
export { A as AttestingRfqTransport, H as Hex, a as RfqRendezvous, b as RfqTransportFactory, S as SwapRefusal, c as attesting, d as createNostrTransportFactory, n as nostrTransportFactory } from './rfq-CYxOyniL.js';
|
|
8
8
|
import * as btc from '@scure/btc-signer';
|
|
9
9
|
import { OnchainProvider, NetworkName, PageRequest, PageResult, IWallet, VHTLC } from '@arkade-os/sdk';
|
|
10
|
-
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-
|
|
10
|
+
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-C2z6Onak.js';
|
|
11
|
+
import './openRfq-Dx-vxOzl.js';
|
|
11
12
|
import './rfq-contract.js';
|
|
12
13
|
import 'nostr-tools';
|
|
13
14
|
|
|
@@ -399,64 +400,6 @@ declare const restoredCorridorRecord: (stored: RfqSwapRecord, network: NetworkRe
|
|
|
399
400
|
*/
|
|
400
401
|
declare const walletLockupIndexer: (wallet: IWallet) => LockupSpendIndexer;
|
|
401
402
|
|
|
402
|
-
/**
|
|
403
|
-
* Route resolution: the single place `to` is parsed, the corridor pair decided, the
|
|
404
|
-
* amount pinned and the market chosen — everything before a solver is told anything.
|
|
405
|
-
*
|
|
406
|
-
* The order (§3.1) is load-bearing: `to` first (needs no market data); the pair selects
|
|
407
|
-
* the `Route` variant, refusing unsupported pairs before any round trip or record; only
|
|
408
|
-
* then the market index, since tickers resolve against the cards themselves. Exactly one
|
|
409
|
-
* amount may be pinned; two is `AmountMismatch`, thrown here so nothing is disclosed.
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
/** The five implemented corridor pairs, spelled as the route union spells them. */
|
|
413
|
-
declare const SUPPORTED_PAIRS: readonly ["arkade->arkade", "arkade->lightning", "lightning->arkade", "arkade->onchain", "onchain->arkade"];
|
|
414
|
-
type SupportedPair = (typeof SUPPORTED_PAIRS)[number];
|
|
415
|
-
interface ResolveDeps {
|
|
416
|
-
readonly corridors: CorridorSet;
|
|
417
|
-
/** The network the wallet reported; every defaulted asset id is on it. */
|
|
418
|
-
readonly network: NetworkName;
|
|
419
|
-
readonly discovery: DiscoveryIndex;
|
|
420
|
-
readonly policy?: SwapPolicy;
|
|
421
|
-
/**
|
|
422
|
-
* `resolve()` reads what is in hand; `quote()` may fetch. A flag, not two functions,
|
|
423
|
-
* so the resolution a caller vetoed is exactly the one they quote.
|
|
424
|
-
*/
|
|
425
|
-
readonly mode: "resolve" | "quote";
|
|
426
|
-
}
|
|
427
|
-
/** What the quote path needs from a resolution, over what a caller sees. */
|
|
428
|
-
interface ResolvedRoute {
|
|
429
|
-
readonly resolution: RouteResolution;
|
|
430
|
-
/** Both legs in discovery's vocabulary — what the market lookup matched on. */
|
|
431
|
-
readonly legs: {
|
|
432
|
-
readonly give: DiscoveryLeg;
|
|
433
|
-
readonly take: DiscoveryLeg;
|
|
434
|
-
};
|
|
435
|
-
readonly give: ResolvedEndpoint;
|
|
436
|
-
readonly take: ResolvedEndpoint;
|
|
437
|
-
readonly pair: SupportedPair;
|
|
438
|
-
readonly candidates: readonly MarketCandidate[];
|
|
439
|
-
/** The chosen card, absent when nothing eligible survived. */
|
|
440
|
-
readonly market?: MarketCandidate;
|
|
441
|
-
readonly snapshot: DiscoverySnapshot;
|
|
442
|
-
readonly amount?: PinnedAmount;
|
|
443
|
-
/** The alias table the snapshot produced, so the quote path can reuse it. */
|
|
444
|
-
readonly aliases: AssetAliasTable;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Assemble the closed `Route` from two fully-instrumented legs.
|
|
448
|
-
*
|
|
449
|
-
* The quote path's one cast: the type checker cannot correlate `corridor` and `asset`,
|
|
450
|
-
* so the runtime re-check turns a broken invariant into a throw rather than a covenant
|
|
451
|
-
* built against the wrong rail.
|
|
452
|
-
*/
|
|
453
|
-
declare const assembleRoute: (give: ResolvedEndpoint & {
|
|
454
|
-
instrument: Instrument;
|
|
455
|
-
}, take: ResolvedEndpoint & {
|
|
456
|
-
instrument: Instrument;
|
|
457
|
-
}) => Route;
|
|
458
|
-
declare const resolveRoute: (input: QuoteInput, deps: ResolveDeps) => Promise<ResolvedRoute>;
|
|
459
|
-
|
|
460
403
|
/** A `number` of sats from atomic units, or {@link AmountEncodingUnsupported}. */
|
|
461
404
|
declare const satsOf: (value: bigint, field: string) => number;
|
|
462
405
|
|
|
@@ -698,4 +641,4 @@ declare function revealClaimPacket(client: CovclaimdClient, input: {
|
|
|
698
641
|
ciphertext: string;
|
|
699
642
|
}>;
|
|
700
643
|
|
|
701
|
-
export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore,
|
|
644
|
+
export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, EVM_CHAIN, type EvmReceiveQuote, type EvmReceiveQuoteProfile, type EvmRfqQuote, type EvmSendQuote, type EvmSendQuoteProfile, INVOICE_HRPS, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, Pubkey, QuoteId, Rail, type RecordSink, type RevealParams, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, cardLegAssetId, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, evmAmountFromWire, evmAmountToWire, evmDirectionOf, evmQuoteSats, evmQuoteTokenAmount, evmReceivePair, evmReceiveRequest, evmSendPair, evmSendRequest, evmTokenLeg, evmTokenOf, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, readEvmReceiveQuote, readEvmSendQuote, reopenedDeposit, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyRefundWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyTaker, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
|
package/dist/advanced.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CORRIDORS,
|
|
7
7
|
CORRIDOR_FACTORIES,
|
|
8
8
|
DEFAULT_INVOICE_EXPIRY_SECONDS,
|
|
9
|
+
DEFAULT_OPEN_RFQ_RELAYS,
|
|
9
10
|
FEED_TTL_MS,
|
|
10
11
|
INDEXED_NETWORKS,
|
|
11
12
|
OFFER_FILL_OWNERS,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
ONCHAIN_CLAIM_FEE_RATE_SATVB,
|
|
14
15
|
RAILS,
|
|
15
16
|
REGISTRY_URL,
|
|
17
|
+
SolverRoutesUnavailable,
|
|
16
18
|
SwapDriveRefusedError,
|
|
17
19
|
acceptQuote,
|
|
18
20
|
aliasTableFrom,
|
|
@@ -26,17 +28,20 @@ import {
|
|
|
26
28
|
btcAssetPart,
|
|
27
29
|
btcOn,
|
|
28
30
|
buildOfferFillPlan,
|
|
31
|
+
canFailoverQuote,
|
|
29
32
|
cancelSwap,
|
|
30
33
|
canonicalAssetId,
|
|
31
34
|
cardLegAssetId,
|
|
32
35
|
cardMarketOf,
|
|
33
36
|
chainSourceOver,
|
|
34
37
|
chooseMarket,
|
|
38
|
+
completedSolverUsage,
|
|
35
39
|
conflictingFields,
|
|
36
40
|
corridorOfRail,
|
|
37
41
|
corridorRecordStore,
|
|
38
42
|
corridorSet,
|
|
39
43
|
createNostrTransportFactory,
|
|
44
|
+
createSolverHealth,
|
|
40
45
|
createSwapClient,
|
|
41
46
|
createSwapDrive,
|
|
42
47
|
decodeBolt11,
|
|
@@ -54,7 +59,9 @@ import {
|
|
|
54
59
|
feedFetch,
|
|
55
60
|
feedSpread,
|
|
56
61
|
formatAssetId,
|
|
62
|
+
freezeOpenRfqValue,
|
|
57
63
|
fromRfqAmountSide,
|
|
64
|
+
hasPausedKnownBidder,
|
|
58
65
|
isAddressable,
|
|
59
66
|
isAssetId,
|
|
60
67
|
isBtcAsset,
|
|
@@ -62,6 +69,7 @@ import {
|
|
|
62
69
|
isCardMarket,
|
|
63
70
|
isIndexedNetwork,
|
|
64
71
|
isNetworkRef,
|
|
72
|
+
isSolverReliabilityFailure,
|
|
65
73
|
isUsableCard,
|
|
66
74
|
issuanceOf,
|
|
67
75
|
liveArkadeInfo,
|
|
@@ -73,11 +81,14 @@ import {
|
|
|
73
81
|
nostrTransportFactory,
|
|
74
82
|
offerFactsOf,
|
|
75
83
|
offerRecordSource,
|
|
84
|
+
openBidCandidates,
|
|
85
|
+
orderedSolverCandidates,
|
|
76
86
|
pageRfqRecords,
|
|
77
87
|
parseAssetId,
|
|
78
88
|
parseRfqQuote,
|
|
79
89
|
pay,
|
|
80
90
|
publicAssetId,
|
|
91
|
+
quoteAdvertisedPlan,
|
|
81
92
|
quoteFromFeed,
|
|
82
93
|
quoteViaRfq,
|
|
83
94
|
railOf,
|
|
@@ -96,6 +107,7 @@ import {
|
|
|
96
107
|
sameAsset,
|
|
97
108
|
satsOf,
|
|
98
109
|
scopedToRail,
|
|
110
|
+
solverFacingAmount,
|
|
99
111
|
splitRecords,
|
|
100
112
|
swapRecordOf,
|
|
101
113
|
toDiscoveryLeg,
|
|
@@ -110,7 +122,7 @@ import {
|
|
|
110
122
|
withCanonicalAmount,
|
|
111
123
|
withDepositFate,
|
|
112
124
|
withRfqState
|
|
113
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-F3BGKWIB.js";
|
|
114
126
|
import {
|
|
115
127
|
ACTIVITY_TOKEN,
|
|
116
128
|
Amount,
|
|
@@ -145,7 +157,7 @@ import {
|
|
|
145
157
|
recordOutcome,
|
|
146
158
|
swapOf,
|
|
147
159
|
toAtomicDecimal
|
|
148
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-JBTU7Y6M.js";
|
|
149
161
|
import {
|
|
150
162
|
AcceptConflict,
|
|
151
163
|
AmbiguousDestination,
|
|
@@ -178,7 +190,7 @@ import {
|
|
|
178
190
|
verifySendWindow,
|
|
179
191
|
verifyTaker,
|
|
180
192
|
verifyingDerivation
|
|
181
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-CIDVLDDM.js";
|
|
182
194
|
import {
|
|
183
195
|
ARKADE_BTC,
|
|
184
196
|
SwapRefusal,
|
|
@@ -187,8 +199,8 @@ import {
|
|
|
187
199
|
bindsClaimAmount,
|
|
188
200
|
rfqPair,
|
|
189
201
|
sealClaimPacket
|
|
190
|
-
} from "./chunk-
|
|
191
|
-
import "./chunk-
|
|
202
|
+
} from "./chunk-ISKJIONJ.js";
|
|
203
|
+
import "./chunk-VPVSSBY2.js";
|
|
192
204
|
import "./chunk-A3SHHRX4.js";
|
|
193
205
|
|
|
194
206
|
// src/reveal.ts
|
|
@@ -574,6 +586,7 @@ export {
|
|
|
574
586
|
CovclaimdRevealError,
|
|
575
587
|
DEFAULT_INVOICE_EXPIRY_SECONDS,
|
|
576
588
|
DEFAULT_MAX_REFUND_WINDOW_SECONDS,
|
|
589
|
+
DEFAULT_OPEN_RFQ_RELAYS,
|
|
577
590
|
DiscoverySnapshotUnavailable,
|
|
578
591
|
EVM_CHAIN,
|
|
579
592
|
FEED_TTL_MS,
|
|
@@ -598,6 +611,7 @@ export {
|
|
|
598
611
|
REGISTRY_URL,
|
|
599
612
|
RFQ_SWAP_ID_PREFIX,
|
|
600
613
|
SWAP_ERROR_NAMES,
|
|
614
|
+
SolverRoutesUnavailable,
|
|
601
615
|
SwapDriveRefusedError,
|
|
602
616
|
SwapRefusal,
|
|
603
617
|
UnsupportedRoute,
|
|
@@ -615,12 +629,14 @@ export {
|
|
|
615
629
|
btcAssetPart,
|
|
616
630
|
btcOn,
|
|
617
631
|
buildOfferFillPlan,
|
|
632
|
+
canFailoverQuote,
|
|
618
633
|
cancelSwap,
|
|
619
634
|
canonicalAssetId,
|
|
620
635
|
cardLegAssetId,
|
|
621
636
|
cardMarketOf,
|
|
622
637
|
chainSourceOver,
|
|
623
638
|
chooseMarket,
|
|
639
|
+
completedSolverUsage,
|
|
624
640
|
conflictingFields,
|
|
625
641
|
corridorOfRail,
|
|
626
642
|
corridorOutcome,
|
|
@@ -628,6 +644,7 @@ export {
|
|
|
628
644
|
corridorSet,
|
|
629
645
|
covclaimdClient,
|
|
630
646
|
createNostrTransportFactory,
|
|
647
|
+
createSolverHealth,
|
|
631
648
|
createSwapClient,
|
|
632
649
|
createSwapDrive,
|
|
633
650
|
decodeBolt11,
|
|
@@ -657,10 +674,12 @@ export {
|
|
|
657
674
|
feedFetch,
|
|
658
675
|
feedSpread,
|
|
659
676
|
formatAssetId,
|
|
677
|
+
freezeOpenRfqValue,
|
|
660
678
|
fromAtomicDecimal,
|
|
661
679
|
fromRfqAmountSide,
|
|
662
680
|
fundingWasNotSubmitted,
|
|
663
681
|
fundsFromWallet,
|
|
682
|
+
hasPausedKnownBidder,
|
|
664
683
|
instrumentOf,
|
|
665
684
|
isAddressable,
|
|
666
685
|
isAssetId,
|
|
@@ -670,6 +689,7 @@ export {
|
|
|
670
689
|
isCardMarket,
|
|
671
690
|
isIndexedNetwork,
|
|
672
691
|
isNetworkRef,
|
|
692
|
+
isSolverReliabilityFailure,
|
|
673
693
|
isSwapError,
|
|
674
694
|
isUsableCard,
|
|
675
695
|
issuanceOf,
|
|
@@ -687,11 +707,14 @@ export {
|
|
|
687
707
|
offerOutcome,
|
|
688
708
|
offerRecordSource,
|
|
689
709
|
onchainCorridor,
|
|
710
|
+
openBidCandidates,
|
|
711
|
+
orderedSolverCandidates,
|
|
690
712
|
pageRfqRecords,
|
|
691
713
|
parseAssetId,
|
|
692
714
|
parseRfqQuote,
|
|
693
715
|
pay,
|
|
694
716
|
publicAssetId,
|
|
717
|
+
quoteAdvertisedPlan,
|
|
695
718
|
quoteFromFeed,
|
|
696
719
|
quoteIdOfSwapId,
|
|
697
720
|
quoteViaRfq,
|
|
@@ -721,6 +744,7 @@ export {
|
|
|
721
744
|
sameAsset,
|
|
722
745
|
satsOf,
|
|
723
746
|
scopedToRail,
|
|
747
|
+
solverFacingAmount,
|
|
724
748
|
splitRecords,
|
|
725
749
|
swapOf,
|
|
726
750
|
swapRecordOf,
|