@qntx/wallet-engine 0.12.0 → 0.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.
@@ -1,4 +1,4 @@
1
- import { D as NostrPolicy, S as ConnectionController, T as ConnectionSession, _ as BitcoinHandler, a as SolanaEvent, b as BitcoinWalletHandler, c as SolanaWalletAccount, d as Nip07Request, f as Eip1193Event, g as BitcoinEvent, h as BITCOIN_CHAIN_IDS, i as SOLANA_CHAIN_IDS, l as SolanaWalletHandler, m as Eip1193Request, n as WeblnHandler, o as SolanaHandler, p as Eip1193Handler, r as WeblnRequest, s as SolanaRequest, t as ProviderError, u as Nip07Handler, v as BitcoinRequest, y as BitcoinWalletAccount } from "./errors-DpkJneDe.mjs";
1
+ import { D as NostrPolicy, S as ConnectionController, T as ConnectionSession, _ as BitcoinHandler, a as SolanaEvent, b as BitcoinWalletHandler, c as SolanaWalletAccount, d as Nip07Request, f as Eip1193Event, g as BitcoinEvent, h as BITCOIN_CHAIN_IDS, i as SOLANA_CHAIN_IDS, l as SolanaWalletHandler, m as Eip1193Request, n as WeblnHandler, o as SolanaHandler, p as Eip1193Handler, r as WeblnRequest, s as SolanaRequest, t as ProviderError, u as Nip07Handler, v as BitcoinRequest, y as BitcoinWalletAccount } from "./errors-CQnlTc1i.mjs";
2
2
  /** The EIP-6963 provider identity the host stamps into the injected script. */
3
3
  export type ProviderInfo = {
4
4
  /** UUIDv4 — the host generates or fixes one per install. */
package/dist/connect.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { U as ProviderError, a as Nip07Handler, i as SolanaWalletHandler, o as BITCOIN_CHAIN_IDS, r as SOLANA_CHAIN_IDS, s as BitcoinWalletHandler, t as WeblnHandler } from "./webln-DzsI7jVb.mjs";
1
+ import { G as ProviderError, a as Nip07Handler, i as SolanaWalletHandler, o as BITCOIN_CHAIN_IDS, r as SOLANA_CHAIN_IDS, s as BitcoinWalletHandler, t as WeblnHandler } from "./webln-DKqCnqx1.mjs";
2
2
  import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
3
3
  import { sha256 } from "@noble/hashes/sha2.js";
4
4
  // src/connect/inject.generated.ts
@@ -1,4 +1,4 @@
1
- import { r as NetworkInfo } from "./registry-Deo5WQe1.mjs";
1
+ import { r as NetworkInfo } from "./registry-DwguKWvt.mjs";
2
2
  import { StoreApi } from "zustand/vanilla";
3
3
  import { MessageContent, SignRequest } from "@qntx/wallet-chains";
4
4
  import { NostrKeyRef, UnlockFactor, Wallet } from "@qntx/wallet";
@@ -8,9 +8,9 @@ import { CooperativeExitResult, LightningInvoice, LightningPayment, LightningSen
8
8
  import { LnurlPayRequest, LnurlWithdrawRequest } from "@qntx/spark/lnurl";
9
9
  import { Event, NostrSigner, UnsignedEvent } from "@qntx/nostr";
10
10
  import { chains } from "@qntx/wallet/chains";
11
+ import { PublicClient } from "viem";
11
12
  import { WalletSigner } from "@qntx/wallet/nostr";
12
13
  import { SparkSigner } from "@qntx/wallet/spark";
13
- import { PublicClient } from "viem";
14
14
  import "@solana/kit";
15
15
  import { SparkAccountRef, SparkApproveIntent } from "@qntx/wallet/protocol";
16
16
  import "@scure/btc-signer/psbt.js";
@@ -626,6 +626,90 @@ declare class PhishingController extends Controller<PhishingState> {
626
626
  private apply;
627
627
  private persist;
628
628
  }
629
+ type AcrossBridgeQuote = {
630
+ readonly provider: "across";
631
+ readonly inputToken: string;
632
+ readonly outputToken: string;
633
+ readonly inputAmount: bigint;
634
+ readonly outputAmount: bigint;
635
+ readonly destinationNetwork: string;
636
+ readonly quoteTimestamp: number;
637
+ readonly fillDeadline: number;
638
+ readonly exclusiveRelayer: string;
639
+ readonly exclusivityParameter: number;
640
+ readonly spokePool: string;
641
+ readonly taker: string;
642
+ readonly fetchedAt: number;
643
+ };
644
+ /** The deposit status Across reports for an origin transaction — display only. */
645
+ type AcrossBridgeStatus = {
646
+ readonly status: "pending" | "filled" | "expired" | "refunded" | "failed" | "unknown";
647
+ readonly fillTxHash?: string;
648
+ };
649
+ /**
650
+ * The terms a gateway swap quote commits to — `sell`/`buy` use the engine's own asset ids
651
+ * (`native`, `erc20:<addr>`) rather than the 0x sentinel.
652
+ */
653
+ type SwapQuote = ZeroExSwapQuote | JupiterSwapQuote;
654
+ type ZeroExSwapQuote = {
655
+ readonly provider: "0x";
656
+ readonly network: string;
657
+ readonly taker: string;
658
+ readonly sell: string;
659
+ readonly buy: string;
660
+ readonly sellAmount: bigint;
661
+ readonly buyAmount: bigint;
662
+ readonly minBuyAmount: bigint;
663
+ readonly allowanceTarget: string | undefined;
664
+ readonly transaction: {
665
+ readonly to: string;
666
+ readonly data: string;
667
+ readonly value: bigint;
668
+ readonly gas: bigint | undefined;
669
+ };
670
+ readonly fees: {
671
+ readonly integrator: {
672
+ readonly token: string;
673
+ readonly amount: bigint;
674
+ } | undefined;
675
+ readonly zeroEx: {
676
+ readonly token: string;
677
+ readonly amount: bigint;
678
+ } | undefined;
679
+ };
680
+ readonly blockNumber: bigint;
681
+ readonly fetchedAt: number;
682
+ };
683
+ /** One instruction of a Jupiter `/build` set — wire accounts, raw base64-decoded data. */
684
+ type JupiterInstruction = {
685
+ readonly programId: string;
686
+ readonly accounts: ReadonlyArray<{
687
+ readonly address: string;
688
+ readonly signer: boolean;
689
+ readonly writable: boolean;
690
+ }>;
691
+ readonly data: Uint8Array;
692
+ };
693
+ /**
694
+ * A Jupiter build the engine verifies on-chain before signing — mints use the engine's asset ids
695
+ * (`lamports` for native SOL), amounts are base-unit bigints.
696
+ */
697
+ type JupiterSwapQuote = {
698
+ readonly provider: "jupiter";
699
+ readonly network: string;
700
+ readonly taker: string;
701
+ readonly sell: string;
702
+ readonly buy: string;
703
+ readonly sellAmount: bigint;
704
+ readonly buyAmount: bigint;
705
+ readonly minBuyAmount: bigint;
706
+ readonly setup: ReadonlyArray<JupiterInstruction>;
707
+ readonly swap: JupiterInstruction;
708
+ readonly cleanup: JupiterInstruction | undefined;
709
+ /** Address lookup table addresses — contents are read from chain, never the gateway. */
710
+ readonly lookupTables: ReadonlyArray<string>;
711
+ readonly fetchedAt: number;
712
+ };
629
713
  type ChainApis = ReturnType<typeof chains>;
630
714
  type SignParams = Parameters<ChainApis["sign"]>[0];
631
715
  type AccountRef = Exclude<SignParams["request"], {
@@ -644,6 +728,7 @@ type TrackedTransaction = {
644
728
  readonly id: string;
645
729
  readonly family: "evm" | "solana" | "bitcoin";
646
730
  readonly network: string;
731
+ /** The signer's identity label — `walletId` for HD accounts, `keyId` for imported keys. */
647
732
  readonly account: string;
648
733
  readonly hash: string | undefined;
649
734
  readonly state: TxState;
@@ -660,7 +745,7 @@ type TrackedTransaction = {
660
745
  /** EVM build record persisted at broadcast for rebroadcast, drop detection and replacement. */
661
746
  readonly evm?: {
662
747
  readonly from: string;
663
- readonly groupIndex: number;
748
+ readonly account: AccountRef;
664
749
  readonly raw: string;
665
750
  };
666
751
  /** Bitcoin build record persisted at send for RBF/CPFP rebuilds. */
@@ -696,7 +781,7 @@ type SendParams = {
696
781
  readonly verify: SignParams["verify"];
697
782
  };
698
783
  type PrepareParams = Omit<SendParams, "verify">;
699
- type ChainRequestMethod = "send" | "speed-up" | "cancel" | "cpfp";
784
+ type ChainRequestMethod = "send" | "speed-up" | "cancel" | "cpfp" | "evm-delegation" | "evm-batch" | "evm-approve" | "evm-swap" | "evm-bridge" | "evm-nft-send" | "solana-core-send" | "evm-lido" | "solana-stake" | "solana-swap";
700
785
  /** What a request asks for; replacements and CPFP name the original transaction. */
701
786
  type ChainRequestInput = ({
702
787
  readonly method: "send";
@@ -707,6 +792,123 @@ type ChainRequestInput = ({
707
792
  readonly method: "cpfp";
708
793
  readonly txId: string;
709
794
  readonly feeRate: number;
795
+ } | {
796
+ readonly method: "evm-delegation";
797
+ readonly account: AccountRef;
798
+ readonly network: string;
799
+ readonly action: "upgrade" | "revoke";
800
+ readonly fee: PrepareParams["fee"];
801
+ } | {
802
+ readonly method: "evm-batch";
803
+ readonly account: AccountRef;
804
+ readonly network: string;
805
+ readonly calls: ReadonlyArray<{
806
+ readonly to: string;
807
+ readonly value: bigint;
808
+ readonly data: string;
809
+ }>;
810
+ readonly fee: PrepareParams["fee"];
811
+ /** A page asking for the batch (`wallet_sendCalls`); absent means the wallet itself. */
812
+ readonly origin?: {
813
+ readonly kind: "browser";
814
+ readonly origin: string;
815
+ };
816
+ } | {
817
+ readonly method: "evm-approve";
818
+ readonly account: AccountRef;
819
+ readonly network: string;
820
+ readonly token: string;
821
+ readonly spender: string;
822
+ readonly amount: bigint;
823
+ readonly fee: PrepareParams["fee"];
824
+ } | {
825
+ readonly method: "evm-swap";
826
+ readonly account: AccountRef;
827
+ readonly network: string;
828
+ readonly quote: ZeroExSwapQuote;
829
+ readonly fee: PrepareParams["fee"];
830
+ } | {
831
+ readonly method: "evm-bridge";
832
+ readonly account: AccountRef;
833
+ readonly network: string;
834
+ readonly quote: AcrossBridgeQuote;
835
+ readonly fee: PrepareParams["fee"];
836
+ } | {
837
+ readonly method: "evm-nft-send";
838
+ readonly account: AccountRef;
839
+ readonly network: string;
840
+ /** The ERC-721 or ERC-1155 contract. */
841
+ readonly contract: string;
842
+ readonly tokenId: bigint;
843
+ readonly to: string;
844
+ /** ERC-1155 only — the units sent; ERC-721 ignores it. */
845
+ readonly amount?: bigint;
846
+ readonly fee: PrepareParams["fee"];
847
+ } | {
848
+ readonly method: "solana-core-send";
849
+ readonly account: AccountRef;
850
+ readonly network: string;
851
+ /** The Core asset account. */
852
+ readonly asset: string;
853
+ readonly to: string;
854
+ readonly fee: PrepareParams["fee"];
855
+ } | {
856
+ readonly method: "solana-swap";
857
+ readonly account: AccountRef;
858
+ readonly network: string;
859
+ readonly quote: JupiterSwapQuote;
860
+ readonly fee: PrepareParams["fee"];
861
+ } | {
862
+ readonly method: "evm-lido";
863
+ readonly account: AccountRef;
864
+ readonly network: string;
865
+ readonly action: {
866
+ readonly kind: "stake";
867
+ readonly amount: bigint;
868
+ } | {
869
+ readonly kind: "request";
870
+ readonly amount: bigint;
871
+ } | {
872
+ readonly kind: "claim";
873
+ readonly requestIds: ReadonlyArray<bigint>;
874
+ };
875
+ readonly fee: PrepareParams["fee"];
876
+ } | {
877
+ readonly method: "solana-stake";
878
+ readonly account: AccountRef;
879
+ readonly network: string;
880
+ readonly action: {
881
+ readonly kind: "delegate";
882
+ readonly lamports: bigint;
883
+ readonly vote: string;
884
+ } | {
885
+ readonly kind: "deactivate";
886
+ readonly stakeAccount: string;
887
+ } | {
888
+ readonly kind: "withdraw";
889
+ readonly stakeAccount: string;
890
+ readonly lamports: bigint;
891
+ };
892
+ readonly fee: PrepareParams["fee"];
893
+ };
894
+ /**
895
+ * One `wallet_sendCalls` bundle: the tracked transactions it produced so `wallet_getCallsStatus`
896
+ * can aggregate them, retained alongside those transactions.
897
+ */
898
+ type BatchRecord = {
899
+ readonly origin: string;
900
+ readonly id: string;
901
+ readonly network: string;
902
+ readonly atomic: boolean;
903
+ readonly txIds: ReadonlyArray<string>;
904
+ readonly expected: number;
905
+ readonly createdAt: number;
906
+ };
907
+ /** The account's EIP-7702 delegation state: `supported` follows the registry hash entry. */
908
+ type DelegationStatus = {
909
+ readonly supported: boolean;
910
+ readonly state: "none" | "ours" | "other";
911
+ readonly address?: string;
710
912
  };
711
913
  /**
712
914
  * A fully built, estimated and cross-checked send that has not been signed. The unsigned content
@@ -764,9 +966,16 @@ declare class TransactionController extends Controller<TransactionControllerStat
764
966
  private evmRoute;
765
967
  private bitcoinRoute;
766
968
  private locked;
969
+ private readonly batches;
767
970
  constructor(options: Options$2);
768
971
  init(): Promise<void>;
769
972
  destroy(): Promise<void>;
973
+ /** One `wallet_sendCalls` bundle the user approved; retained alongside the transactions it lists. */
974
+ recordBatch(record: BatchRecord): Promise<void>;
975
+ /** The bundle `origin` asked for, or `undefined` when it is not theirs (or is gone). */
976
+ batchById(origin: string, id: string): BatchRecord | undefined;
977
+ /** A tracked transaction by id — for `wallet_getCallsStatus`. */
978
+ txById(id: string): TrackedTransaction | undefined;
770
979
  lock(): void;
771
980
  private persist;
772
981
  private transition;
@@ -791,9 +1000,31 @@ declare class TransactionController extends Controller<TransactionControllerStat
791
1000
  * Internal entry for replacements and CPFP: builds, cross-checks and reserves what the
792
1001
  * replacement needs without signing it. The original must be `submitted` or `pending`.
793
1002
  */
794
- prepareReplacement(input: Exclude<ChainRequestInput, {
795
- method: "send";
1003
+ prepareReplacement(input: Extract<ChainRequestInput, {
1004
+ method: "speed-up" | "cancel" | "cpfp";
796
1005
  }>, requestId: string): Promise<PreparedRequest>;
1006
+ /**
1007
+ * Internal EVM requests (`evm-delegation`/`evm-batch`/`evm-approve`/`evm-swap`/`evm-lido`):
1008
+ * builds, estimates and cross-checks the self-transaction without signing it.
1009
+ */
1010
+ prepareEvmInternal(input: Extract<ChainRequestInput, {
1011
+ method: "evm-delegation" | "evm-batch" | "evm-approve" | "evm-swap" | "evm-bridge" | "evm-nft-send" | "evm-lido";
1012
+ }>, _requestId: string): Promise<PreparedRequest>;
1013
+ /**
1014
+ * Internal `solana-stake` requests: checks the delegation rules, then builds the stake
1015
+ * transaction through the same fee/simulation path as a SOL send without signing it.
1016
+ */
1017
+ prepareSolanaStake(input: Extract<ChainRequestInput, {
1018
+ method: "solana-stake";
1019
+ }>, _requestId: string): Promise<PreparedRequest>;
1020
+ prepareSolanaSwap(input: Extract<ChainRequestInput, {
1021
+ method: "solana-swap";
1022
+ }>, _requestId: string): Promise<PreparedRequest>;
1023
+ prepareSolanaCoreSend(input: Extract<ChainRequestInput, {
1024
+ method: "solana-core-send";
1025
+ }>, _requestId: string): Promise<PreparedRequest>;
1026
+ /** The account's 7702 delegation state on `network` (primary endpoint only). */
1027
+ delegationState(account: AccountRef, network: string): Promise<DelegationStatus>;
797
1028
  private track;
798
1029
  }
799
1030
  /**
@@ -803,7 +1034,7 @@ declare class TransactionController extends Controller<TransactionControllerStat
803
1034
  * despite the phishing list is a `danger`; one that could not be checked is a `warning`.
804
1035
  */
805
1036
  type RiskFinding = {
806
- readonly code: "first-recipient" | "address-poisoning" | "phishing-origin" | "phishing-unchecked" | "token-impersonation" | "token-symbol-unicode" | "simulation-reverted" | "simulation-mismatch" | "collection-approval" | "unlimited-approval" | "sign-in-malformed" | "sign-in-domain-mismatch" | "sign-in-port-mismatch" | "sign-in-address-mismatch" | "sign-in-expired" | "sign-in-not-yet-valid" | "permit-approval" | "permit-unlimited" | "permit-long-lived" | "order-receives-nothing" | "order-offerer-mismatch" | "safe-delegatecall" | "safe-gas-refund" | "bitcoin-sighash-single" | "bitcoin-inscription-input" | "blind-signing";
1037
+ readonly code: "first-recipient" | "address-poisoning" | "phishing-origin" | "phishing-unchecked" | "token-impersonation" | "token-symbol-unicode" | "simulation-reverted" | "simulation-mismatch" | "collection-approval" | "unlimited-approval" | "sign-in-malformed" | "sign-in-domain-mismatch" | "sign-in-port-mismatch" | "sign-in-address-mismatch" | "sign-in-expired" | "sign-in-not-yet-valid" | "permit-approval" | "permit-unlimited" | "permit-long-lived" | "order-receives-nothing" | "order-offerer-mismatch" | "safe-delegatecall" | "safe-gas-refund" | "bitcoin-sighash-single" | "bitcoin-inscription-input" | "stake-authority" | "blind-signing";
807
1038
  readonly level: "warning" | "danger";
808
1039
  };
809
1040
  /** A web page; `origin` is `scheme://host[:port]`, computed by the host from the top-level URL. */
@@ -814,7 +1045,7 @@ type BrowserOrigin = {
814
1045
  type RequestOrigin = {
815
1046
  readonly kind: "internal";
816
1047
  } | BrowserOrigin;
817
- type RequestMethod = ChainRequestMethod | "pay" | "zap" | "evm-sign" | "nostr-sign" | "webln-invoice" | "watch-asset" | "solana-sign" | "bitcoin-sign" | "spark-deposit" | "spark-exit";
1048
+ type RequestMethod = ChainRequestMethod | "pay" | "zap" | "evm-sign" | "evm-delegation" | "evm-batch" | "nostr-sign" | "webln-invoice" | "watch-asset" | "solana-sign" | "bitcoin-sign" | "spark-deposit" | "spark-exit";
818
1049
  /** A Solana chain account the `solana-sign` request signs for. */
819
1050
  type SolanaAccount = {
820
1051
  readonly walletId: string;
@@ -1529,6 +1760,22 @@ type Eip1193HandlerOptions = {
1529
1760
  readonly defaultNetwork: () => string;
1530
1761
  /** Whether a token is already in the built-in table or the user's custom tokens. */
1531
1762
  readonly isTracked: (network: string, address: string) => boolean;
1763
+ /** The account's EIP-7702 delegation state on `network`. */
1764
+ readonly delegationState: (account: AccountRef, network: string) => Promise<DelegationStatus>;
1765
+ /** `wallet_sendCalls` bundles, keyed by their id. */
1766
+ readonly batches: {
1767
+ readonly record: (record: BatchRecord) => Promise<void>;
1768
+ readonly get: (origin: string, id: string) => BatchRecord | undefined;
1769
+ };
1770
+ /** A tracked transaction by id — `wallet_getCallsStatus` aggregates them. */
1771
+ readonly txById: (id: string) => TrackedTransaction | undefined;
1772
+ /** The host shows a bundle's status page; `wallet_showCallsStatus` is the trigger. */
1773
+ readonly showCallsStatus: (request: {
1774
+ readonly origin: string;
1775
+ readonly txIds: ReadonlyArray<string>;
1776
+ }) => void;
1777
+ readonly now: () => number;
1778
+ readonly random: (length: number) => Uint8Array;
1532
1779
  };
1533
1780
  declare class Eip1193Handler {
1534
1781
  private readonly options;
@@ -1551,8 +1798,25 @@ declare class Eip1193Handler {
1551
1798
  private personalSign;
1552
1799
  private typedData;
1553
1800
  private sendTransaction;
1801
+ /** The eip1559 placeholder the pipeline re-fills; only to, value, data and gas survive. */
1802
+ private txSkeleton;
1554
1803
  private signingSession;
1555
1804
  private sign;
1805
+ private requiredSession;
1806
+ private accountFor;
1807
+ /**
1808
+ * EIP-5792 `wallet_getCapabilities`: `atomic` per chain the page asks about or its session
1809
+ * covers.
1810
+ */
1811
+ private getCapabilities;
1812
+ /** `wallet_sendCalls` (EIP-5792 v2.0.0): atomic batch, sequential fallback or 5760. */
1813
+ private sendCalls;
1814
+ /** One call through the `evm-sign` transaction path — its own approval. */
1815
+ private submitCall;
1816
+ /** ≥2 calls through `evm-batch` with the page's origin. */
1817
+ private submitBatch;
1818
+ /** `wallet_getCallsStatus` / `wallet_showCallsStatus`: the record must belong to the origin. */
1819
+ private callsStatus;
1556
1820
  private read;
1557
1821
  }
1558
1822
  /** A NIP-07 method call from the page. */
@@ -1692,5 +1956,5 @@ declare class ProviderError extends Error {
1692
1956
  readonly code: number;
1693
1957
  constructor(code: number, message: string);
1694
1958
  }
1695
- export { PrepareZapContext as $, PayInput as A, EngineCollection as At, SignLogEntry as B, ConnectionOrigin as C, NetworkController as Ct, NostrPolicy as D, AddressBookEntry as Dt, ConnectionState as E, AddressBookState as Et, RequestControllerState as F, createEventBus as Ft, RiskFinding as G, BrowserOrigin as H, RequestInput as I, Controller as It, PHISHING_REFRESH_MS as J, TransactionController as K, RequestStage as L, ControllerOptions as Lt, REQUEST_TTL_MS as M, PublicStore as Mt, RESIMULATE_AFTER_MS as N, EngineLogger as Nt, PendingConnection as O, AddressBookRecord as Ot, RequestController as P, EventBus as Pt, PhishingStatus as Q, SparkDepositInput as R, ConnectionController as S, RequestCheckCode as St, ConnectionSession as T, AddressBookController as Tt, RequestMethod as U, SignLogOutcome as V, RequestOrigin as W, PhishingControllerOptions as X, PhishingController as Y, PhishingState as Z, BitcoinHandler as _, SparkControllerOptions as _t, SolanaEvent as a, WithdrawLnurlParams as at, BitcoinWalletHandler as b, PaymentNote as bt, SolanaWalletAccount as c, PaymentParse as ct, Nip07Request as d, PreparedSparkAction as dt, PrepareZapParams as et, Eip1193Event as f, SparkDisplay as ft, BitcoinEvent as g, SparkController as gt, BITCOIN_CHAIN_IDS as h, SparkClientFactory as ht, SOLANA_CHAIN_IDS as i, PayParams as it, PendingRequest as j, EngineStore as jt, EvmSignInput as k, AddressFamily as kt, SolanaWalletHandler as l, PaymentRequest as lt, Eip1193Request as m, SparkAccountState as mt, WeblnHandler as n, ZapRecipient as nt, SolanaHandler as o, ParseOptions as ot, Eip1193Handler as p, SparkResult as pt, SignatureResult as q, WeblnRequest as r, prepareZap as rt, SolanaRequest as s, PaymentOption as st, ProviderError as t, PreparedZap as tt, Nip07Handler as u, parsePayment as ut, BitcoinRequest as v, SparkControllerState as vt, ConnectionScope as w, Esplora as wt, AccountGroup as x, SparkActivity as xt, BitcoinWalletAccount as y, sparkStore as yt, SparkExitInput as z };
1696
- //# sourceMappingURL=errors-DpkJneDe.d.mts.map
1959
+ export { PHISHING_REFRESH_MS as $, PayInput as A, AddressBookController as At, SignLogEntry as B, createEventBus as Bt, ConnectionOrigin as C, SparkControllerState as Ct, NostrPolicy as D, RequestCheckCode as Dt, ConnectionState as E, SparkActivity as Et, RequestControllerState as F, EngineCollection as Ft, RiskFinding as G, BrowserOrigin as H, ControllerOptions as Ht, RequestInput as I, EngineStore as It, DelegationStatus as J, TransactionController as K, RequestStage as L, PublicStore as Lt, REQUEST_TTL_MS as M, AddressBookEntry as Mt, RESIMULATE_AFTER_MS as N, AddressBookRecord as Nt, PendingConnection as O, NetworkController as Ot, RequestController as P, AddressFamily as Pt, AcrossBridgeStatus as Q, SparkDepositInput as R, EngineLogger as Rt, ConnectionController as S, SparkControllerOptions as St, ConnectionSession as T, PaymentNote as Tt, RequestMethod as U, SignLogOutcome as V, Controller as Vt, RequestOrigin as W, SwapQuote as X, SignatureResult as Y, AcrossBridgeQuote as Z, BitcoinHandler as _, SparkDisplay as _t, SolanaEvent as a, PrepareZapParams as at, BitcoinWalletHandler as b, SparkClientFactory as bt, SolanaWalletAccount as c, prepareZap as ct, Nip07Request as d, ParseOptions as dt, PhishingController as et, Eip1193Event as f, PaymentOption as ft, BitcoinEvent as g, PreparedSparkAction as gt, BITCOIN_CHAIN_IDS as h, parsePayment as ht, SOLANA_CHAIN_IDS as i, PrepareZapContext as it, PendingRequest as j, AddressBookState as jt, EvmSignInput as k, Esplora as kt, SolanaWalletHandler as l, PayParams as lt, Eip1193Request as m, PaymentRequest as mt, WeblnHandler as n, PhishingState as nt, SolanaHandler as o, PreparedZap as ot, Eip1193Handler as p, PaymentParse as pt, AccountRef as q, WeblnRequest as r, PhishingStatus as rt, SolanaRequest as s, ZapRecipient as st, ProviderError as t, PhishingControllerOptions as tt, Nip07Handler as u, WithdrawLnurlParams as ut, BitcoinRequest as v, SparkResult as vt, ConnectionScope as w, sparkStore as wt, AccountGroup as x, SparkController as xt, BitcoinWalletAccount as y, SparkAccountState as yt, SparkExitInput as z, EventBus as zt };
1960
+ //# sourceMappingURL=errors-CQnlTc1i.d.mts.map
@@ -1,4 +1,4 @@
1
- import { a as networkById, i as SOLANA_NETWORKS, n as NETWORKS, r as NetworkInfo, t as BITCOIN_NETWORKS } from "./registry-Deo5WQe1.mjs";
1
+ import { a as networkById, i as SOLANA_NETWORKS, n as NETWORKS, r as NetworkInfo, t as BITCOIN_NETWORKS } from "./registry-DwguKWvt.mjs";
2
2
  import * as z from "zod/mini";
3
3
  export declare const INSTALL_ID_HEADER = "x-install-id";
4
4
  export declare const PROVIDERS_HEADER = "x-gateway-providers";
@@ -358,5 +358,251 @@ export declare const union: (a: HashList, b: HashList) => HashList;
358
358
  export declare const difference: (a: HashList, b: HashList) => HashList;
359
359
  /** `(list − remove) ∪ add`. */
360
360
  export declare const applyDiff: (list: HashList, add: HashList, remove: HashList) => HashList;
361
+ /** The native-token sentinel 0x uses for sell and buy tokens. */
362
+ export declare const ZEROX_NATIVE_TOKEN = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
363
+ /** The `swapQuote` request: which exact-in sell on which chain, for which taker, at what slippage. */
364
+ export declare const swapQuoteRequest: z.ZodMiniObject<{
365
+ network: z.ZodMiniString<string>;
366
+ sellToken: z.ZodMiniString<string>;
367
+ buyToken: z.ZodMiniString<string>;
368
+ sellAmount: z.ZodMiniString<string>;
369
+ taker: z.ZodMiniString<string>;
370
+ slippageBps: z.ZodMiniNumber<unknown>;
371
+ }, z.core.$strip>;
372
+ export declare const swapQuoteResponse: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
373
+ liquidity: z.ZodMiniLiteral<true>;
374
+ provider: z.ZodMiniLiteral<"0x">;
375
+ sellToken: z.ZodMiniString<string>;
376
+ buyToken: z.ZodMiniString<string>;
377
+ sellAmount: z.ZodMiniString<string>;
378
+ buyAmount: z.ZodMiniString<string>;
379
+ minBuyAmount: z.ZodMiniString<string>;
380
+ allowanceTarget: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNull]>;
381
+ transaction: z.ZodMiniObject<{
382
+ to: z.ZodMiniString<string>;
383
+ data: z.ZodMiniString<string>;
384
+ value: z.ZodMiniString<string>;
385
+ gas: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNull]>;
386
+ }, z.core.$strip>;
387
+ fees: z.ZodMiniObject<{
388
+ integrator: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
389
+ token: z.ZodMiniString<string>;
390
+ amount: z.ZodMiniString<string>;
391
+ }, z.core.$strip>, z.ZodMiniNull]>;
392
+ zeroEx: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
393
+ token: z.ZodMiniString<string>;
394
+ amount: z.ZodMiniString<string>;
395
+ }, z.core.$strip>, z.ZodMiniNull]>;
396
+ }, z.core.$strip>;
397
+ blockNumber: z.ZodMiniString<string>;
398
+ }, z.core.$strip>, z.ZodMiniObject<{
399
+ liquidity: z.ZodMiniLiteral<false>;
400
+ }, z.core.$strip>]>;
401
+ export declare const swapQuote: Endpoint<z.ZodMiniObject<{
402
+ network: z.ZodMiniString<string>;
403
+ sellToken: z.ZodMiniString<string>;
404
+ buyToken: z.ZodMiniString<string>;
405
+ sellAmount: z.ZodMiniString<string>;
406
+ taker: z.ZodMiniString<string>;
407
+ slippageBps: z.ZodMiniNumber<unknown>;
408
+ }, z.core.$strip>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
409
+ liquidity: z.ZodMiniLiteral<true>;
410
+ provider: z.ZodMiniLiteral<"0x">;
411
+ sellToken: z.ZodMiniString<string>;
412
+ buyToken: z.ZodMiniString<string>;
413
+ sellAmount: z.ZodMiniString<string>;
414
+ buyAmount: z.ZodMiniString<string>;
415
+ minBuyAmount: z.ZodMiniString<string>;
416
+ allowanceTarget: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNull]>;
417
+ transaction: z.ZodMiniObject<{
418
+ to: z.ZodMiniString<string>;
419
+ data: z.ZodMiniString<string>;
420
+ value: z.ZodMiniString<string>;
421
+ gas: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNull]>;
422
+ }, z.core.$strip>;
423
+ fees: z.ZodMiniObject<{
424
+ integrator: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
425
+ token: z.ZodMiniString<string>;
426
+ amount: z.ZodMiniString<string>;
427
+ }, z.core.$strip>, z.ZodMiniNull]>;
428
+ zeroEx: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
429
+ token: z.ZodMiniString<string>;
430
+ amount: z.ZodMiniString<string>;
431
+ }, z.core.$strip>, z.ZodMiniNull]>;
432
+ }, z.core.$strip>;
433
+ blockNumber: z.ZodMiniString<string>;
434
+ }, z.core.$strip>, z.ZodMiniObject<{
435
+ liquidity: z.ZodMiniLiteral<false>;
436
+ }, z.core.$strip>]>>;
437
+ export type SwapQuoteRequest = z.infer<typeof swapQuoteRequest>;
438
+ export type SwapQuoteResponse = z.infer<typeof swapQuoteResponse>;
439
+ /** Jupiter is mainnet-only — every other Solana CAIP-2 id is a client error. */
440
+ export declare const SOLANA_MAINNET = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
441
+ /** The `swapQuoteSolana` request: an exact-in mint pair for a taker on Solana mainnet. */
442
+ export declare const swapQuoteSolanaRequest: z.ZodMiniObject<{
443
+ network: z.ZodMiniLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp">;
444
+ inputMint: z.ZodMiniString<string>;
445
+ outputMint: z.ZodMiniString<string>;
446
+ amount: z.ZodMiniString<string>;
447
+ taker: z.ZodMiniString<string>;
448
+ slippageBps: z.ZodMiniNumber<unknown>;
449
+ }, z.core.$strip>;
450
+ /** One Solana instruction as the wire carries it — base64 data, plain account flags. */
451
+ export declare const solanaInstruction: z.ZodMiniObject<{
452
+ programId: z.ZodMiniString<string>;
453
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
454
+ address: z.ZodMiniString<string>;
455
+ signer: z.ZodMiniBoolean<boolean>;
456
+ writable: z.ZodMiniBoolean<boolean>;
457
+ }, z.core.$strip>>;
458
+ data: z.ZodMiniString<string>;
459
+ }, z.core.$strip>;
460
+ export declare const swapQuoteSolanaResponse: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
461
+ liquidity: z.ZodMiniLiteral<true>;
462
+ provider: z.ZodMiniLiteral<"jupiter">;
463
+ inputMint: z.ZodMiniString<string>;
464
+ outputMint: z.ZodMiniString<string>;
465
+ inAmount: z.ZodMiniString<string>;
466
+ outAmount: z.ZodMiniString<string>;
467
+ otherAmountThreshold: z.ZodMiniString<string>;
468
+ slippageBps: z.ZodMiniNumber<unknown>;
469
+ setup: z.ZodMiniArray<z.ZodMiniObject<{
470
+ programId: z.ZodMiniString<string>;
471
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
472
+ address: z.ZodMiniString<string>;
473
+ signer: z.ZodMiniBoolean<boolean>;
474
+ writable: z.ZodMiniBoolean<boolean>;
475
+ }, z.core.$strip>>;
476
+ data: z.ZodMiniString<string>;
477
+ }, z.core.$strip>>;
478
+ swap: z.ZodMiniObject<{
479
+ programId: z.ZodMiniString<string>;
480
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
481
+ address: z.ZodMiniString<string>;
482
+ signer: z.ZodMiniBoolean<boolean>;
483
+ writable: z.ZodMiniBoolean<boolean>;
484
+ }, z.core.$strip>>;
485
+ data: z.ZodMiniString<string>;
486
+ }, z.core.$strip>;
487
+ cleanup: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
488
+ programId: z.ZodMiniString<string>;
489
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
490
+ address: z.ZodMiniString<string>;
491
+ signer: z.ZodMiniBoolean<boolean>;
492
+ writable: z.ZodMiniBoolean<boolean>;
493
+ }, z.core.$strip>>;
494
+ data: z.ZodMiniString<string>;
495
+ }, z.core.$strip>, z.ZodMiniNull]>;
496
+ lookupTables: z.ZodMiniArray<z.ZodMiniString<string>>;
497
+ }, z.core.$strip>, z.ZodMiniObject<{
498
+ liquidity: z.ZodMiniLiteral<false>;
499
+ }, z.core.$strip>]>;
500
+ export declare const swapQuoteSolana: Endpoint<z.ZodMiniObject<{
501
+ network: z.ZodMiniLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp">;
502
+ inputMint: z.ZodMiniString<string>;
503
+ outputMint: z.ZodMiniString<string>;
504
+ amount: z.ZodMiniString<string>;
505
+ taker: z.ZodMiniString<string>;
506
+ slippageBps: z.ZodMiniNumber<unknown>;
507
+ }, z.core.$strip>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
508
+ liquidity: z.ZodMiniLiteral<true>;
509
+ provider: z.ZodMiniLiteral<"jupiter">;
510
+ inputMint: z.ZodMiniString<string>;
511
+ outputMint: z.ZodMiniString<string>;
512
+ inAmount: z.ZodMiniString<string>;
513
+ outAmount: z.ZodMiniString<string>;
514
+ otherAmountThreshold: z.ZodMiniString<string>;
515
+ slippageBps: z.ZodMiniNumber<unknown>;
516
+ setup: z.ZodMiniArray<z.ZodMiniObject<{
517
+ programId: z.ZodMiniString<string>;
518
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
519
+ address: z.ZodMiniString<string>;
520
+ signer: z.ZodMiniBoolean<boolean>;
521
+ writable: z.ZodMiniBoolean<boolean>;
522
+ }, z.core.$strip>>;
523
+ data: z.ZodMiniString<string>;
524
+ }, z.core.$strip>>;
525
+ swap: z.ZodMiniObject<{
526
+ programId: z.ZodMiniString<string>;
527
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
528
+ address: z.ZodMiniString<string>;
529
+ signer: z.ZodMiniBoolean<boolean>;
530
+ writable: z.ZodMiniBoolean<boolean>;
531
+ }, z.core.$strip>>;
532
+ data: z.ZodMiniString<string>;
533
+ }, z.core.$strip>;
534
+ cleanup: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
535
+ programId: z.ZodMiniString<string>;
536
+ accounts: z.ZodMiniArray<z.ZodMiniObject<{
537
+ address: z.ZodMiniString<string>;
538
+ signer: z.ZodMiniBoolean<boolean>;
539
+ writable: z.ZodMiniBoolean<boolean>;
540
+ }, z.core.$strip>>;
541
+ data: z.ZodMiniString<string>;
542
+ }, z.core.$strip>, z.ZodMiniNull]>;
543
+ lookupTables: z.ZodMiniArray<z.ZodMiniString<string>>;
544
+ }, z.core.$strip>, z.ZodMiniObject<{
545
+ liquidity: z.ZodMiniLiteral<false>;
546
+ }, z.core.$strip>]>>;
547
+ export type SwapQuoteSolanaRequest = z.infer<typeof swapQuoteSolanaRequest>;
548
+ export type SwapQuoteSolanaResponse = z.infer<typeof swapQuoteSolanaResponse>;
549
+ /** The `bridgeQuote` request: an exact-in token transfer from an origin chain to a destination. */
550
+ export declare const bridgeQuoteRequest: z.ZodMiniObject<{
551
+ network: z.ZodMiniString<string>;
552
+ destinationNetwork: z.ZodMiniString<string>;
553
+ inputToken: z.ZodMiniString<string>;
554
+ outputToken: z.ZodMiniString<string>;
555
+ amount: z.ZodMiniString<string>;
556
+ taker: z.ZodMiniString<string>;
557
+ }, z.core.$strip>;
558
+ export declare const bridgeQuoteResponse: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
559
+ liquidity: z.ZodMiniLiteral<true>;
560
+ provider: z.ZodMiniLiteral<"across">;
561
+ inputToken: z.ZodMiniString<string>;
562
+ outputToken: z.ZodMiniString<string>;
563
+ inputAmount: z.ZodMiniString<string>;
564
+ outputAmount: z.ZodMiniString<string>;
565
+ destinationNetwork: z.ZodMiniString<string>;
566
+ quoteTimestamp: z.ZodMiniNumber<unknown>;
567
+ fillDeadline: z.ZodMiniNumber<unknown>;
568
+ exclusiveRelayer: z.ZodMiniString<string>;
569
+ exclusivityParameter: z.ZodMiniNumber<unknown>;
570
+ spokePool: z.ZodMiniString<string>;
571
+ limits: z.ZodMiniObject<{
572
+ minDeposit: z.ZodMiniString<string>;
573
+ maxDeposit: z.ZodMiniString<string>;
574
+ }, z.core.$strip>;
575
+ }, z.core.$strip>, z.ZodMiniObject<{
576
+ liquidity: z.ZodMiniLiteral<false>;
577
+ }, z.core.$strip>]>;
578
+ export declare const bridgeQuote: Endpoint<z.ZodMiniObject<{
579
+ network: z.ZodMiniString<string>;
580
+ destinationNetwork: z.ZodMiniString<string>;
581
+ inputToken: z.ZodMiniString<string>;
582
+ outputToken: z.ZodMiniString<string>;
583
+ amount: z.ZodMiniString<string>;
584
+ taker: z.ZodMiniString<string>;
585
+ }, z.core.$strip>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
586
+ liquidity: z.ZodMiniLiteral<true>;
587
+ provider: z.ZodMiniLiteral<"across">;
588
+ inputToken: z.ZodMiniString<string>;
589
+ outputToken: z.ZodMiniString<string>;
590
+ inputAmount: z.ZodMiniString<string>;
591
+ outputAmount: z.ZodMiniString<string>;
592
+ destinationNetwork: z.ZodMiniString<string>;
593
+ quoteTimestamp: z.ZodMiniNumber<unknown>;
594
+ fillDeadline: z.ZodMiniNumber<unknown>;
595
+ exclusiveRelayer: z.ZodMiniString<string>;
596
+ exclusivityParameter: z.ZodMiniNumber<unknown>;
597
+ spokePool: z.ZodMiniString<string>;
598
+ limits: z.ZodMiniObject<{
599
+ minDeposit: z.ZodMiniString<string>;
600
+ maxDeposit: z.ZodMiniString<string>;
601
+ }, z.core.$strip>;
602
+ }, z.core.$strip>, z.ZodMiniObject<{
603
+ liquidity: z.ZodMiniLiteral<false>;
604
+ }, z.core.$strip>]>>;
605
+ export type BridgeQuoteRequest = z.infer<typeof bridgeQuoteRequest>;
606
+ export type BridgeQuoteResponse = z.infer<typeof bridgeQuoteResponse>;
361
607
  export { BITCOIN_NETWORKS, NETWORKS, type NetworkInfo, SOLANA_NETWORKS, networkById };
362
608
  //# sourceMappingURL=gateway-contract.d.mts.map