This is the full developer documentation for Any Wallet Kit
# Introduction
> What Any Wallet Kit is, who it is for and the principles it is built on.
Any Wallet Kit is an open-source SDK for building self-custodial multichain wallets. One seed phrase gives you accounts on EVM networks, Bitcoin, Solana, TON, Tron, NEAR and Zcash behind a single account interface. Protocol modules — swaps, cross-chain swaps, staking, lending, token approvals — are written against that interface, so a wallet picks the blocks it needs and nothing else.
Pre-1.0
The packages are on npm under [`@anywalletkit`](https://www.npmjs.com/org/anywalletkit). Versions are `0.x`: APIs may still change before `1.0`. The source is on [GitHub](https://github.com/ultratestbro/anywalletkit), under the [Apache-2.0](https://github.com/ultratestbro/anywalletkit/blob/main/LICENSE) license.
## Who it is for
[Section titled “Who it is for”](#who-it-is-for)
* **Wallet developers** — ship a multichain wallet (mobile app, extension) without writing chain plumbing, derivation, fee models or swap integrations yourself.
* **dApp and Mini App developers** — embed wallet features next to your product (an embedded, semi-custodial kit is planned).
## Principles
[Section titled “Principles”](#principles)
* **Signer is separate from the account.** The private key lives in a `Signer`. The local seed signer is one implementation; a Safe, a hardware wallet, MPC or a backend signer are others. The SDK never *requires* a seed.
* **Built for mobile apps.** React Native / Hermes is the primary target and the release gate: every chain is tested in the real Hermes VM. Chain and protocol packages are pure TypeScript, with no native modules and no polyfill magic; one runtime package installs what Hermes is missing. Native code lives only in the optional storage packages (`secure-storage-react-native`, `backup-cloud`), which need a development build.
* **Refusals are named, never silent.** When a quote, transaction or route cannot be used, you get an error that says why, not a `null`.
* **Zeroize by design.** Everything that holds a key has `dispose()`.
* **One bar for every module.** Each chain and protocol module passes the same conformance suite before it ships. Pull requests from outside the core team are not accepted yet; when contributions open, a module will get in the same way, with a named maintainer.
## How it fits together
[Section titled “How it fits together”](#how-it-fits-together)
| Layer | Packages | Role |
| ------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Core | `core`, `conformance` | Signer and account interfaces, protocol base classes, errors, key derivation, test suites every module must pass |
| Chains | `wallet-evm`, `wallet-btc`, `wallet-solana`, `wallet-ton`, `wallet-tron`, `wallet-near`, `wallet-zcash` | Accounts, balances, transfers, signing and fees per chain family |
| Protocols | `protocol-swap2-*`, `protocol-staking-*`, `protocol-lending-*`, `protocol-approvals-evm` | Swaps and bridges, staking, lending, approvals |
| Orchestration | `kit`, `keyring` | Register chains and modules, look accounts up by chain, enforce policies before every broadcast; many accounts and imported keys |
| Data & safety | `tx-preview-evm`, `history-evm`, `names-ens`, `networks` | Pre-sign transaction review, activity history, ENS names, networks and custom RPCs |
| Runtime | `runtime-hermes` | React Native / Hermes polyfills |
See [Packages](/getting-started/packages/) for the full list.
## For AI agents
[Section titled “For AI agents”](#for-ai-agents)
The docs are also plain Markdown: [`/llms.txt`](/llms.txt) is the index, [`/llms-full.txt`](/llms-full.txt) is every page with its code samples in one file, and [`/llms-small.txt`](/llms-small.txt) is a shorter version.
# Accounts
> One object that answers "what is my address on Base" and hands out accounts that can sign.
**The job:** one place that answers “what is my address on Base” and “give me something that can sign on Solana”, for every account the user has.
**In the kit:**
| Package | Role |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `wallet-*` | One package per chain family. Its manager derives accounts and knows how to read, build, sign and send on that chain |
| `kit` | The `Wallet` object: register the chains you support, then `getAccount('eip155:8453')`. [Policies](/concepts/policies/) wrap every account it hands out |
| `keyring` | Several accounts from one seed, plus imported seeds and keys, in one list across chains ([guide](/guides/keyring/)) |
Chains are named by [CAIP-2 ids](/concepts/chain-ids/): `eip155:1` for Ethereum, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` for Solana, and so on. Register every EVM network under its exact id with its own RPC (`eip155:1`, `eip155:8453`, …): an EVM manager talks to the network of its RPC only, so one `eip155` registration would send Base transactions to Ethereum ([Chain ids](/concepts/chain-ids/#one-rpc-per-evm-network)). Non-EVM chains have one network each and register by namespace (`solana`, `ton`, `tron`, `bip122`, `near`).
Start with the [Quickstart](/getting-started/quickstart/): it creates accounts on seven chains in about twenty lines.
**Decisions you make:**
* **Which chains you register.** Each `wallet-*` package you install adds bundle size and needs its own data sources ([Networks and RPC](/build-a-wallet/networks-and-rpc/)).
* **How many accounts you show.** Most wallets show account 0 and let the user add more. Recovering a wallet means scanning accounts 0, 1, 2… until one has no history.
* **Read-only accounts.** A watched address (no key) is useful for portfolios and for a “watch wallet” feature. Protocol reads like balances and approvals work on it; writes do not.
* **Dispose.** Call `wallet.dispose()` when the user locks the app: it wipes the seed from the wallet and from every manager, and the wallet refuses any later call. Build a new one on unlock.
# Balances and prices
> Reading balances, finding which tokens the user holds, and putting a fiat value next to them.
## Balances
[Section titled “Balances”](#balances)
**The job:** show what the user holds on every chain.
**In the kit:** every account reads its native balance (`getBalance()`) and the token balances you ask for (`getTokenBalance(token)`, `getTokenBalances(tokens)`). The code is in the [Balances guide](/guides/balances/).
### Finding which tokens to show
[Section titled “Finding which tokens to show”](#finding-which-tokens-to-show)
The chain has no “tokens held by this address” call. Three ways to build the list:
| Way | How | Trade-off |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| A token list | The asset registry in `swap2-assets` (about 400 tokens across the catalog chains), or your own list; read those balances | Cheap and predictable, but misses anything outside the list |
| A holdings indexer | One call returns every token with a balance | Finds everything, spam included; one more provider |
| The history | Tokens the user ever received ([History](/build-a-wallet/history/)) | Free with history; needs a balance read per token |
Most wallets combine the first two: show the list, and add anything else found with a balance behind a “hidden / spam” filter.
**Holdings indexers:**
| Chain | Examples |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EVM | [Alchemy Token API](https://docs.alchemy.com/reference/alchemy-gettokenbalances), [Moralis](https://www.moralis.com), [GoldRush (Covalent)](https://www.goldrush.dev), [QuickNode](https://www.quicknode.com) add-ons |
| Solana | [Helius](https://docs.helius.dev), or RPC `getTokenAccountsByOwner` |
| TON | [tonapi](https://docs.tonconsole.com/tonapi) jettons by owner |
| Tron | [TronGrid](https://developers.tron.network/docs/trongrid) account endpoint |
### Gotchas
[Section titled “Gotchas”](#gotchas)
* **Amounts are `bigint` in base units.** Format with the token’s decimals. Never convert a large value through `Number(…)`: on some Hermes builds it returns garbage above 2⁶³. For display, use `bigintToUnits(value, decimals)` from `core`.
* **The gas coin differs per network.** POL on Polygon, MNT on Mantle, USDC on Arc. Take the symbol and decimals from the network, not from a hardcoded “ETH”.
* **Pending sends.** A balance read right after a broadcast may not include it yet. Show the pending amount from your own record until the transaction lands.
* **Spam tokens.** Airdropped tokens with names like “Claim reward at …” are phishing. Hide unknown tokens by default and never show their names as links.
## Prices
[Section titled “Prices”](#prices)
**The job:** a fiat value next to every amount, and a portfolio total.
**In the kit:** nothing yet.
**You bring:** a price API.
| Provider | Notes |
| --------------------------------------------------- | -------------------------------------------------------- |
| [CoinGecko API](https://docs.coingecko.com) | Look up by contract address per platform; free demo tier |
| [CoinMarketCap API](https://coinmarketcap.com/api/) | Free basic tier |
| [DefiLlama API](https://api-docs.defillama.com) | Prices by `chain:address`, keyless coins endpoint |
**Rules:**
* **Look tokens up by contract address**, never by symbol: symbols collide, and fake tokens copy real ones.
* **Cache** prices for a minute or more, and show when a price is stale.
* **Proxy the key** through your server if the plan needs one.
* **Show “no price” rather than $0** for a token the API doesn’t know.
Check before you rely on a provider
Plans, limits and coverage change. We checked these links on 2026-10-23. Read each provider’s current terms and test with your real token list. A listing here is not an endorsement.
# dApp connection
> Letting websites talk to the wallet — a browser extension, WalletConnect on mobile, and an in-app browser.
**The job:** “Connect wallet” on a website ends in your wallet, and every request the site makes passes your review.
## Browser extension
[Section titled “Browser extension”](#browser-extension)
**In the kit:** `extension-kit` is the core of a Chromium (MV3) extension, without UI:
* an encrypted vault (password, or a passkey through WebAuthn PRF), and a session that locks itself when idle;
* the dApp request router, per-site permissions and the approval queue;
* signing checks, including Sign-In with Ethereum (EIP-4361) messages checked against the asking site.
TON Connect requests are parsed and answered by the kit too.
**You bring:** the providers your page script injects (EVM with EIP-1193 and EIP-6963 discovery, Solana, TON Connect, Tron, Bitcoin, NEAR), the UI (popup, approval window), the store listing and its account.
The code, and how to publish to the Chrome Web Store, are in the [Browser extension guide](/guides/extension-kit/).
**Rules:**
* **Show the requesting site’s origin** on every approval, from the browser, never from the page’s own words.
* **Connect is not approve.** A connected site can ask; every signature still needs the user.
* **Store listing hygiene:** the Chrome Web Store account that publishes your extension can push an update to every user. Protect it with a hardware key and publish manually.
## Mobile: WalletConnect
[Section titled “Mobile: WalletConnect”](#mobile-walletconnect)
On mobile, dApps reach a wallet through WalletConnect (now run by Reown). It is not in the SDK yet.
**You bring:** [Reown WalletKit](https://docs.reown.com) and a project id from [reown.com](https://reown.com). Route its session requests (`eth_sendTransaction`, `personal_sign`, `eth_signTypedData_v4`, `solana_signTransaction`…) to `kit` accounts, so policies and [review](/build-a-wallet/review-and-safety/) apply to them like to any other write.
## Mobile: in-app browser
[Section titled “Mobile: in-app browser”](#mobile-in-app-browser)
A WebView that injects an EIP-1193 provider into the pages it opens. Requests go to the same handlers as WalletConnect. Show the page’s origin in the address bar and on every approval, and don’t inject into pages served over plain HTTP.
Check before you rely on a provider
WalletConnect / Reown changes its SDKs and project requirements over time. We checked these links on 2026-10-23. Follow their current docs. A listing here is not an endorsement.
# Fiat and notifications
> Buying and selling crypto with a card, and telling the user about incoming funds while the app is closed.
## Buy and sell
[Section titled “Buy and sell”](#buy-and-sell)
**The job:** a “Buy” button that ends with crypto in the user’s address, and a “Sell” button that ends with money in their bank.
**In the kit:** `FiatProtocol` in `core` defines the shape: `quoteBuy`, `buy`, `quoteSell`, `sell`, `getTransactionDetail`, `getSupportedCryptoAssets`. No provider module ships yet; write one against that interface, or call the provider’s widget directly.
**You bring:** an on-ramp provider. It runs KYC and payments; you pass the address and the asset, and receive webhooks about the order.
| Provider | Docs |
| ------------ | ---------------------------------------------- |
| MoonPay | [dev.moonpay.com](https://dev.moonpay.com) |
| Transak | [transak.com](https://transak.com) |
| Ramp Network | [docs.ramp.network](https://docs.ramp.network) |
| Banxa | [banxa.com](https://banxa.com) |
**Things to settle with the provider:**
* **Countries and assets.** Coverage differs per country, payment method and network.
* **Who you are to them.** Most providers need a signed agreement and a business review before production keys.
* **Fees.** The user sees the provider’s fee plus the network fee; some let you add your own.
## Notifications
[Section titled “Notifications”](#notifications)
**The job:** “You received 50 USDT” while the app is closed.
**In the kit:** nothing yet.
**You bring:**
1. **An address-watching service** that calls your server when something happens to an address:
| Chain | Examples |
| --------------------------------------------- | ------------------------------------------------------------------------------------- |
| EVM, Solana and other chains QuickNode serves | [QuickNode Streams](https://www.quicknode.com/docs/streams) |
| EVM | [Alchemy Notify (webhooks)](https://docs.alchemy.com/reference/notify-api-quickstart) |
| Solana | [Helius webhooks](https://www.helius.dev/docs/webhooks) |
| Any | Your own indexer polling the history sources |
2. **A server** that receives those events, decides what is worth a notification, and maps the address to a device token.
3. **Push delivery:** [Expo push](https://docs.expo.dev/push-notifications/overview/), or [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) and APNs directly.
**Rules:**
* **Only addresses leave the device**, never keys. Tell users their addresses are linked to a device on your server, and let them turn it off.
* **Filter spam before you push.** A notification about a scam airdrop is phishing you delivered yourself.
Check before you rely on a provider
On-ramps and webhook services change coverage, pricing and requirements. We checked these links on 2026-10-23. Read each provider’s current terms. A listing here is not an endorsement.
# History
> An activity list with readable titles across every chain, and the explorer and indexer APIs behind it.
**The job:** an activity list that reads “Swapped 100 USDC → 0.03 ETH” and “Staked 1 ETH”, not raw hashes and “Contract call”.
**In the kit:**
* **History sources**, one per chain: `history-evm` for EVM networks, and sources built into `wallet-btc`, `wallet-solana`, `wallet-ton`, `wallet-tron`, `wallet-near` and `wallet-zcash`. Register them with `wallet.registerHistorySource(…)`.
* **The feed:** `kit` merges every chain into one list, newest first, with a cursor for paging.
* **Labels from the modules:** every protocol module recognizes its own transactions (`describeActivity`), so a Lido stake, an Aave supply or a CCTP bridge reads as what it is.
* **The intent journal:** record what the app meant when it broadcast, and a pending swap shows correctly before the explorer has indexed it.
The code is in the [History guide](/guides/history/).
## Sources per chain
[Section titled “Sources per chain”](#sources-per-chain)
| Chain | Source the package reads | Key |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| EVM | [Etherscan API v2](https://docs.etherscan.io), [Blockscout PRO](https://docs.blockscout.com/devs/pro-api), [Alchemy](https://www.alchemy.com) Transfers; keyless Blockscout and Routescan as fallbacks | Etherscan v2 refuses keyless requests; a free Etherscan key plus a free Blockscout PRO key cover most networks |
| Solana | JSON-RPC (`getSignaturesForAddress`, `getTransaction`), no indexer | Your RPC; public endpoints rate-limit quickly |
| TON | [tonapi](https://tonapi.io) events, toncenter v3 as fallback | Works keyless at a low rate |
| Tron | [TronGrid](https://www.trongrid.io) account endpoints | Key recommended |
| Bitcoin | Blockbook (Trezor’s, [QuickNode’s add-on](https://www.quicknode.com/docs/bitcoin), or your own) | Depends on the instance |
| NEAR | [nearblocks](https://nearblocks.io) API, archival RPC for single transactions | Keyless at a low rate |
| Zcash | [Blockchair](https://blockchair.com/api) | Key for volume |
Keys for explorers are secrets: put them behind your own proxy ([Your server](/build-a-wallet/your-server/)). `history-evm` takes a proxy URL instead of the Etherscan endpoint for that.
## Gotchas
[Section titled “Gotchas”](#gotchas)
* **Spam.** Airdropped fake tokens and “address poisoning”: tiny transfers from an address that looks like one the user sends to, so the user copies the wrong one from history. The feed hides rows the source flags as spam by default. Still, never offer “copy address” on an incoming row without a warning.
* **Cross-chain operations are two rows on two chains.** A bridge is a send on one chain and a receive on another, minutes later. The intent journal and the swap modules tie them into one item.
* **Explorers lag.** A transaction can be on-chain and missing from the explorer for a few seconds to minutes. Show your own pending row until the source has it.
Check before you rely on a provider
Explorer APIs change their free tiers and key rules often (Etherscan required keys in 2026). We checked these links on 2026-10-23. Read each provider’s current terms and keep a fallback source. A listing here is not an endorsement.
# Keys and storage
> Seed phrases, derivation, and keeping the seed safe on the device.
## Keys
[Section titled “Keys”](#keys)
**The job:** turn 12 or 24 words into keys for every chain, the same way other wallets do. Otherwise a user who imports their MetaMask or Phantom phrase sees an empty wallet.
**In the kit:** `core`.
* `getRandomSeedPhrase(12 | 24)` creates a phrase; `isValidSeedPhrase()` checks the wordlist and the checksum.
* The phrase becomes a 64-byte seed, and keys are derived along the standard paths: BIP-32 for secp256k1 chains (EVM, Bitcoin, Tron, Zcash), SLIP-10 for ed25519 chains (Solana, TON, NEAR).
* Paths are pinned by test vectors, so account `i` is the address MetaMask, Phantom, Tonkeeper, TronLink and MyNearWallet derive. See [Chain ids and derivation](/concepts/chain-ids/).
**Decisions you make:**
* **12 or 24 words.** Both are standard; 24 is the default.
* **A BIP-39 passphrase or not.** The SDK uses an empty one, like every major wallet. A passphrase changes every address, so a user who forgets it loses the funds.
* **Imports.** `keyring` imports a seed phrase, a single private key for one chain, and the 24-word TON format of Tonkeeper, Tonhub and MyTonWallet. See the [Keyring guide](/guides/keyring/).
**Rules:**
* **Don’t keep the phrase as a JS string longer than the onboarding screen.** A string cannot be wiped from memory. The SDK turns a phrase into the 64-byte seed the moment it gets it and keeps only the bytes; `dispose()` wipes them. Better still, keep the 64-byte seed in secure storage next to the phrase and unlock with it (`new Wallet(seedBytes)`): the words are then read only when the user opens “Show recovery phrase”.
* **Logging an object never shows a key.** Seeds and private keys are not properties of any SDK object, so `console.log(account)`, `JSON.stringify(wallet)` or a crash report shows addresses and public keys only. The conformance suite checks this for every chain.
* **Never send the phrase or the seed anywhere.** That includes analytics, crash reports, logs and clipboard history.
* **Don’t let the OS screenshot the phrase screen.** Block screenshots and the app-switcher preview while it is shown.
## Key storage
[Section titled “Key storage”](#key-storage)
**The job:** keep the seed on the device, encrypted, unlocked only by the user.
**In the kit:**
* **Mobile:** `@anywalletkit/secure-storage-react-native`, an Expo module (Swift + Kotlin) that plugs into `keyring` as its `SecretStorage`. Each secret is a Keychain item / Keystore-wrapped file that only Face ID / Touch ID / a fingerprint, with the device passcode as the fallback, can open, on every read; it never leaves the device and is unreadable while the phone is locked. It needs a dev or Release build (not Expo Go) and `NSFaceIDUsageDescription` in `Info.plist`:
```ts
import { createSecureStorage } from '@anywalletkit/secure-storage-react-native'
const secrets = createSecureStorage({ namespace: 'my-wallet' })
const keyring = await Keyring.load({ storage, secrets, chains })
```
* **Browser extension:** `extension-kit` has an encrypted vault (password or passkey) and a session that locks after 15 minutes idle. See [dApp connection](/build-a-wallet/dapp-connection/).
**What to use on mobile:**
| Platform | Store | Notes |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| iOS | [Keychain Services](https://developer.apple.com/documentation/security/keychain-services) | Use an access control that asks for Face ID **or** the device passcode, so a user whose Face ID fails is not locked out |
| Android | [Android Keystore](https://developer.android.com/privacy-and-security/keystore) | Ask for biometrics with a device-credential fallback |
| Expo / React Native | `@anywalletkit/secure-storage-react-native` (above); in Expo Go, [`expo-secure-store`](https://docs.expo.dev/versions/latest/sdk/securestore/) with `requireAuthentication` | One API over both platforms |
**Backup:**
* Show the phrase once, then ask the user to confirm a few of the words.
* Never store the phrase in plain files, app storage or a screenshot.
* “Export private key” for one account goes behind the same authentication as the phrase. `keyring.exportPrivateKey` returns the key in the format the chain’s other wallets import, checked against the account’s address. See [Keyring](/guides/keyring/#back-up-and-remove).
* Encrypted backups: `@anywalletkit/seed-vault` seals a secret into a password- or key-protected file, and `@anywalletkit/backup-cloud` keeps it in the app’s iCloud Drive container with the key in iCloud Keychain (Android is planned).
## Keys that never touch the phone
[Section titled “Keys that never touch the phone”](#keys-that-never-touch-the-phone)
Any key that signs somewhere else works through `externalSigner()`: a hardware wallet, an MPC service, a Safe, or a backend signer for bots. The account behaves the same; only the `sign` call goes out. See [Custom signer](/guides/custom-signer/).
# Networks and RPC
> Where every read and broadcast goes, how to choose RPC providers per chain, and how to keep keys off the client.
**The job:** every balance, fee quote and broadcast goes through a node. This is where most wallet outages come from: a rate limit, a node that lags, a method the plan doesn’t serve.
**In the kit:**
* Every `wallet-*` package takes **a list** of endpoints and fails over in order, with a few retries across the list.
* `networks` holds the catalog of mainnets, each with public RPCs to fail over through. It also stores the RPCs and custom networks the user adds, and `verifyNetwork()` checks that an endpoint really serves the chain it claims before you trust it. See the [Networks guide](/guides/networks/).
## What each chain package talks to
[Section titled “What each chain package talks to”](#what-each-chain-package-talks-to)
| Chain | Package expects | Public / free to start | Production options |
| ------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EVM | JSON-RPC URL or EIP-1193 provider | [PublicNode](https://www.publicnode.com), endpoints on [Chainlist](https://chainlist.org) | [QuickNode](https://www.quicknode.com), [Alchemy](https://www.alchemy.com), [Infura](https://www.infura.io), [dRPC](https://drpc.org), [Ankr](https://www.ankr.com/rpc/), [Chainstack](https://chainstack.com) |
| Solana | JSON-RPC URL | [Public clusters](https://solana.com/docs/references/clusters) (not for production) | [Helius](https://www.helius.dev), [QuickNode](https://www.quicknode.com), [Alchemy](https://www.alchemy.com) |
| TON | toncenter v2 JSON-RPC; tonapi or toncenter v3 for emulation | [toncenter](https://toncenter.com) (low limit without a key), [tonapi](https://tonapi.io) | toncenter / tonapi with a key, [QuickNode](https://www.quicknode.com/chains) |
| Tron | Full-node HTTP API | [TronGrid](https://www.trongrid.io) (low limit without a key) | TronGrid with a key, [QuickNode](https://www.quicknode.com/chains), [GetBlock](https://getblock.io) |
| Bitcoin | Esplora or Blockbook HTTP | [mempool.space](https://mempool.space), [Blockstream](https://blockstream.info) | [QuickNode Blockbook](https://www.quicknode.com/docs/bitcoin), your own [Blockbook](https://github.com/trezor/blockbook) / [Esplora](https://github.com/Blockstream/esplora) / [mempool](https://github.com/mempool/mempool) |
| NEAR | JSON-RPC | [FastNEAR](https://fastnear.com) | [NEAR RPC providers](https://docs.near.org/api/rpc/providers) |
| Zcash | Blockchair or Blockbook | [Blockchair](https://blockchair.com/api) (low limit without a key) | Blockchair with a key, your own Blockbook |
**How we run it.** Our reference wallet uses QuickNode for its EVM chains, with public endpoints as fallbacks. That is one setup that works, not the only one.
## Choosing a provider
[Section titled “Choosing a provider”](#choosing-a-provider)
| Option | Good for | Watch out |
| ---------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Public endpoints | Prototypes, fallback | Rate limits. Many refuse `eth_getLogs` without an address filter, archive reads, or `eth_simulateV1` |
| Paid providers | Production | Each plan has its own `eth_getLogs` block window (QuickNode: 10 000 blocks), per-method credit costs and per-second limits |
| Your own node | Full control | You run it: disks, upgrades, monitoring |
Before you pick, check the methods your features need on that provider’s plan:
| Feature | Needs |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Review before signing](/build-a-wallet/review-and-safety/) | `eth_simulateV1` (EVM). Public endpoints on Ethereum, Base, Arbitrum, Optimism, Polygon and BNB Chain had it when we checked; Avalanche did not |
| [Approvals](/guides/approvals/) | `eth_getLogs` **without** an address filter, over long block ranges. Most free endpoints refuse it |
| [History](/build-a-wallet/history/) on Solana | `getSignaturesForAddress` and `getTransaction` with full history |
| Old transactions | Archive data |
## Keep keys off the client
[Section titled “Keep keys off the client”](#keep-keys-off-the-client)
A paid RPC key shipped inside an app or an extension is public: anyone can extract it and spend your credits. Three ways out:
1. **A proxy** on your server that adds the key ([Your server](/build-a-wallet/your-server/)).
2. **Allow-listing** on the provider’s dashboard: restrict the key to your app’s bundle id or origin, and to the methods you use. This limits abuse; it does not hide the key.
3. **Client-safe keys**, where the provider designs them for that (toncenter, for one).
## Let users bring their own RPC
[Section titled “Let users bring their own RPC”](#let-users-bring-their-own-rpc)
Power users want their own node, and some regions block public providers. `networks` stores user RPCs per chain, can use **only** the user’s RPC when asked, verifies the endpoint before use, and parks endpoints that fail with the reason. Label screens that ran through a user RPC: a simulation from an unknown node is not a guarantee.
Check before you rely on a provider
Links, plans and limits change. We checked these links on 2026-10-23. Read the provider’s current docs and pricing, test with your real traffic, and keep a second provider for fallback. A listing here is not an endorsement.
# Anatomy of a wallet
> What a crypto wallet is made of, which Any Wallet Kit package covers each part, and what you bring yourself.
A crypto wallet looks like one app, but it is about eighteen parts. Some are cryptography, some are network data, some are product decisions. This section goes through them in the order you’ll need them. For each part it says what the job is, which package does it, and what you have to bring yourself: an RPC, an API key, a storage layer.
| # | Part | What the user sees | Any Wallet Kit | You bring |
| -- | ---------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| 1 | [Keys](/build-a-wallet/keys-and-storage/) | “Create wallet”, “Import seed phrase” | `core` | Nothing |
| 2 | [Key storage](/build-a-wallet/keys-and-storage/#key-storage) | Face ID unlock, “Back up your phrase” | `secure-storage-react-native` (iOS Keychain, Android Keystore), `seed-vault` (encrypted backup file), `backup-cloud` (iCloud), `extension-kit` (browser) | Nothing on iOS; an Android cloud backup is planned |
| 3 | [Accounts](/build-a-wallet/accounts/) | One address per chain, several accounts | `kit`, `keyring`, `wallet-*` | Nothing |
| 4 | [Networks and RPC](/build-a-wallet/networks-and-rpc/) | Nothing, until it breaks | `networks` | RPC endpoints |
| 5 | [Balances](/build-a-wallet/balances-and-prices/) | Total, list of assets | `wallet-*`, `swap2-assets` | RPC; an indexer to find tokens |
| 6 | [Prices](/build-a-wallet/balances-and-prices/#prices) | $ next to every amount | Not in the SDK yet | A price API |
| 7 | [Send](/build-a-wallet/send-and-receive/) | Recipient, amount, fee, confirm | `wallet-*` | RPC |
| 8 | [Receive](/build-a-wallet/send-and-receive/#receive) | Address and QR code | `wallet-*` | A QR library |
| 9 | [Names](/build-a-wallet/send-and-receive/#names) | `name.eth` in the recipient field | `names-ens` | An Ethereum RPC |
| 10 | [History](/build-a-wallet/history/) | Activity list with readable titles | `history-evm`, `wallet-*`, `kit` | Explorer / indexer keys |
| 11 | [Review before signing](/build-a-wallet/review-and-safety/) | “You send 100 USDC, you get 0.03 ETH” | `tx-preview-evm`, `kit` | An RPC with `eth_simulateV1` |
| 12 | [Safety](/build-a-wallet/review-and-safety/#safety) | Approvals list, warnings | `protocol-approvals-evm`, `kit` | Blocklist sources |
| 13 | [Swaps and bridges](/build-a-wallet/swaps-and-earn/) | Swap screen, route picker | `protocol-swap2-*` | Provider keys (some) |
| 14 | [Earn](/build-a-wallet/swaps-and-earn/#earn) | Stake, lend, APY | `protocol-staking-*`, `protocol-lending-*` | RPC |
| 15 | [dApp connection](/build-a-wallet/dapp-connection/) | “Connect wallet” on websites | `extension-kit` | WalletConnect on mobile |
| 16 | [Buy and sell](/build-a-wallet/fiat-and-notifications/) | “Buy crypto” button | `FiatProtocol` interface only | An on-ramp provider |
| 17 | [Notifications](/build-a-wallet/fiat-and-notifications/#notifications) | “You received 50 USDT” | Not in the SDK yet | A webhook service and push |
| 18 | [Your server](/build-a-wallet/your-server/) | Nothing | `protocol-swap2-core/server` (swap backend), [`examples/server`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/server) (RPC proxy + swaps) | Hosting, user auth, rate limits |
[Ship a wallet](/build-a-wallet/ship-a-wallet/) puts the parts together end to end, with the server. A minimal wallet is parts 1–8. A wallet people keep using adds 10, 11 and 13. Everything else is what sets one wallet apart from another.
## Build order
[Section titled “Build order”](#build-order)
1. **Keys, storage, accounts.** The wallet can be created and restored.
2. **Networks, balances, prices, send, receive.** A usable wallet.
3. **History, review before signing.** A wallet people trust.
4. **Swaps, Earn, approvals.** A wallet people come back to.
5. **dApp connection, fiat, notifications, names.** A complete product.
## About the providers on these pages
[Section titled “About the providers on these pages”](#about-the-providers-on-these-pages)
These pages name third-party services (RPC nodes, indexers, price APIs, on-ramps) as examples of what fits each part.
Always check the provider yourself
* **Links, plans, limits and prices change.** We checked the links on 2026-10-23. Before you rely on a provider, open its current documentation and pricing page.
* **Test with your real traffic.** Free tiers and “unlimited” plans have limits that show up only under load: rate limits, block-range caps, missing methods.
* **A listing is not an endorsement.** We have no partnership with any provider named here.
* **Keep two providers for anything critical**, so one outage does not take your wallet down.
# Review and safety
> Showing what a transaction will do before it is signed, and protecting users from approvals, drainers and fake tokens.
## Review before signing
[Section titled “Review before signing”](#review-before-signing)
**The job:** before the key is used, show what will happen in words the user understands: “You send 100 USDC, you get at least 0.03 ETH”, “This site asks to spend ALL your USDT”.
**In the kit:**
* `tx-preview-evm` decodes the calls and approvals, simulates the balance changes, and returns named checks (`approval-unlimited`, `simulation-reverted`, `recipient-foreign`…) that your app words its own way. See [Transaction preview](/guides/tx-preview/).
* `kit` [policies](/concepts/policies/) call your `confirm` step before **every** signature and broadcast, and refuse by fee cap, allowlist or blocklist. Wire the preview into `confirm` and nothing reaches the key unseen.
* Swap modules hand the exact plan to `reviewExecution` before the first approval. See [Swaps → Show a review screen](/guides/swaps/#show-a-review-screen).
**You bring:** an RPC that serves `eth_simulateV1` (see [Networks and RPC](/build-a-wallet/networks-and-rpc/#choosing-a-provider)). Where a network lacks it, the preview says so instead of guessing; show that state honestly.
**Design the sheet around three questions:** what leaves, what arrives, who gets permission. Put the fee and the raw details below that.
## Safety
[Section titled “Safety”](#safety)
**The job:** protect users from the most common losses.
| Threat | What happens | In the kit |
| ------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Unlimited approvals | A contract the user approved once can drain the token later | [Approvals](/guides/approvals/): find and revoke; `tx-preview-evm` warns before granting one |
| Permit / Permit2 phishing | A “free” signature authorizes a transfer | Policies treat Permit and Permit2 typed data as approvals: `confirm` sees the spender, the amount and `unlimited` |
| Known drainers | The recipient or spender is a scam address | Policies `blocklist`, checked for every recipient and spender |
| Address poisoning | The user copies a look-alike address from history | Spam flags in [History](/build-a-wallet/history/); warn on first sends |
| Fake tokens | Airdropped tokens with phishing names | Hide unknown tokens ([Balances](/build-a-wallet/balances-and-prices/#gotchas)) |
| Wrong network | Funds sent on a network the recipient doesn’t watch | Say the network on receive and review screens |
**You bring:** blocklist data. Examples: [MetaMask eth-phishing-detect](https://github.com/MetaMask/eth-phishing-detect) (phishing domains for dApp connections), [ScamSniffer](https://scamsniffer.io) (scam addresses and domains), [Chainalysis sanctions screening](https://www.chainalysis.com/free-cryptocurrency-sanctions-screening-tools/). A risk-screening module for the SDK is planned.
Check before you rely on a provider
Blocklists differ in coverage, update speed and license. We checked these links on 2026-10-23. Read each source’s terms before you ship it in an app, and refresh the data often. A listing here is not an endorsement.
# Send and receive
> The send flow on every chain, what differs per chain, receiving with a QR code, and names instead of addresses.
## Send
[Section titled “Send”](#send)
**The job:** recipient, amount, fee, confirm, broadcast, wait.
**In the kit:** every account has the same three calls.
```ts
const { fee } = await account.quoteTransfer({ token, recipient, amount }) // nothing signed
const { hash } = await account.transfer({ token, recipient, amount }) // signs and broadcasts
const receipt = await account.getTransactionReceipt(hash) // undefined until it lands
```
`token` is omitted for the native coin. Amounts are base units (`bigint`). With [policies](/concepts/policies/) registered, the transfer passes the fee cap, the lists and your `confirm` step before anything is signed.
**What differs per chain, and what your UI must show:**
| Chain | What the package does | What can go wrong |
| ------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| EVM | EIP-1559 fees; `autoResetAllowance` sends USDT’s `approve(0)` when needed | The user has no gas coin on that network |
| Solana | Creates the recipient’s token account (ATA) when missing; sets the priority fee automatically | Creating an ATA costs rent, so a token send can cost more SOL than expected |
| TON | Deploys the wallet contract on the first send; supports a text comment | Jetton sends need TON for the fee; exchanges require a comment (memo) |
| Tron | `estimateFee` returns bandwidth, energy and the TRX that will be burned | Without staked energy, a USDT transfer burns several TRX |
| Bitcoin | SegWit (`bc1q…`) or Taproot (`bc1p…`) accounts, fee rate in sat/vB | Dust outputs, a fee rate that is too low in a busy mempool |
| NEAR | Adds `storage_deposit` before a token send to a new holder | Named vs implicit accounts in the recipient field |
| Zcash | Transparent (`t1…`) addresses | Shielded addresses are not supported yet |
**Rules for the send screen:**
* **Validate the address before the amount screen.** Check the format for that chain. On EVM, warn when the address is a token contract: tokens sent to a token contract are usually lost.
* **Warn on a first send** to an address the user has never sent to.
* **Show the fee in the gas coin and in fiat**, and what the recipient will receive.
* **Keep the user from sending the whole balance of the gas coin** without leaving the fee.
* **After broadcast, show a pending row** right away and update it from the receipt.
## Receive
[Section titled “Receive”](#receive)
**The job:** show the address and a QR code.
**In the kit:** `account.getAddress()`.
**You bring:** a QR library.
* **EVM:** the same address works on every EVM network. Say which network the sender should use, or tokens arrive on a network the user doesn’t watch.
* **Bitcoin:** decide which address type to show (SegWit is the most widely accepted).
* **TON and exchanges:** some exchanges need a comment to credit a deposit. The receive screen can’t help with that; the send screen of the exchange must.
## Names
[Section titled “Names”](#names)
**The job:** let users type `name.eth` instead of `0x…`.
**In the kit:** `names-ens` resolves ENS names to the address for the chain you ask for, including L2 names and CCIP-Read (offchain) names. `.sol`, `.ton` and `.near` are planned. See the [Names guide](/guides/names/).
**You bring:** an Ethereum mainnet RPC: resolution always starts on mainnet, whatever chain the user sends on.
**Rule:** show the resolved address on the review screen, not only the name. A name can change owner; the address is what gets the funds.
# Ship a wallet: end to end
> The whole path from an empty Expo app to a release — keys on the device, a server for RPC and swaps, review before signing, and the checklist before you publish.
The pages before this one cover each part of a wallet on its own. This one puts them in the order you build them, with the server in the middle: an app that holds the keys, and a small backend that holds every other secret. The server code is [`examples/server`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/server), which CI starts and tests on every change; the app snippets come from the other `examples/`.
```plaintext
phone (Expo, Release build) your server (examples/server)
───────────────────────────── ────────────────────────────────
runtime-hermes POST /rpc/:caip2 → keyed RPC upstreams
keyring + secure-storage-react-native ── RPC ───► POST /swap2/:action → swap providers + keys
wallet-* accounts, policies, tx-preview ─ swaps ─► GET /health
backup-cloud (iCloud) auth + rate limits (you add)
```
## 1. The app shell
[Section titled “1. The app shell”](#1-the-app-shell)
An Expo app with a **development or Release build** (not Expo Go: key storage is a native module). Install the SDK packages from npm and make Hermes complete before anything else loads:
```sh
npm install @anywalletkit/runtime-hermes @anywalletkit/kit @anywalletkit/keyring \
@anywalletkit/secure-storage-react-native @anywalletkit/wallet-evm @anywalletkit/wallet-solana \
@anywalletkit/protocol-swap2-core @anywalletkit/protocol-swap2-router @anywalletkit/tx-preview-evm \
buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
```
```ts
// index.ts — the very first lines
import { installHermesRuntime } from '@anywalletkit/runtime-hermes'
installHermesRuntime()
```
Details and the Metro settings: [Installation](/getting-started/installation/#react-native--expo).
## 2. Keys on the device
[Section titled “2. Keys on the device”](#2-keys-on-the-device)
The seed lives in the Keychain (iOS) or the Keystore (Android), opened by Face ID / fingerprint with the device passcode as fallback, on every read. The keyring keeps names and addresses in plain storage and asks the secure storage only to sign.
```ts
import { createSecureStorage } from '@anywalletkit/secure-storage-react-native'
const secrets = createSecureStorage({ namespace: 'my-wallet' })
```
```ts
export function openKeyring(storage: KeyringStorage, secrets: SecretStorage): Promise {
return Keyring.load({
storage, // names, addresses, flags
secrets, // one entry per seed or key
chains: {
evm: { Manager: WalletManagerEvm, config: { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 } },
solana: { Manager: WalletManagerSolana, config: { provider: 'https://api.mainnet-beta.solana.com' } },
ton: { Manager: WalletManagerTon, config: { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } } },
tron: { Manager: WalletManagerTron, config: { provider: 'https://api.trongrid.io' } },
},
})
}
```
```ts
export async function createWallet(keyring: Keyring) {
const { account, mnemonic } = await keyring.createMnemonic({ words: 12 })
// `mnemonic` is for the backup screen only: show it, ask for a few words back, drop it.
return { account, mnemonic }
}
```
One keyring signs on one EVM network; for Base, Arbitrum and the rest open one per network over the same secrets ([Keyring: more than one EVM network](/guides/keyring/#more-than-one-evm-network)). Back the seed up: `seed-vault` seals it into an encrypted file and `backup-cloud` keeps it in the app’s iCloud Drive container ([Keys and storage](/build-a-wallet/keys-and-storage/)).
## 3. Your server
[Section titled “3. Your server”](#3-your-server)
Everything that needs a key you pay for, or a setting you don’t want in an app bundle, runs here: RPC with your provider keys, and the swap providers with their API keys and affiliate settings.
```ts
/** The real providers, configured with the keys that must never ship in the app. */
export function providersFromEnv(env: NodeJS.ProcessEnv) {
return [
lifiProvider({ ...(env.LIFI_API_KEY ? { apiKey: env.LIFI_API_KEY } : {}) }),
nearIntentsProvider({ ...(env.NEAR_INTENTS_JWT ? { jwt: env.NEAR_INTENTS_JWT } : {}) }),
thorchainProvider({}),
chainflipProvider(),
]
}
/** RPC_EIP155_1=https://a,https://b → { 'eip155:1': [a, b] }; RPC_SOLANA_MAINNET → 'solana:5eykt…'. */
export function upstreamsFromEnv(env: NodeJS.ProcessEnv): Record {
const ALIASES: Record = { 'solana:mainnet': 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp' }
const out: Record = {}
for (const [key, value] of Object.entries(env)) {
const m = /^RPC_([A-Z0-9]+)_([A-Z0-9]+)$/.exec(key)
if (!m || !value) continue
const chain = `${m[1]!.toLowerCase()}:${m[2]!.toLowerCase()}`
out[ALIASES[chain] ?? chain] = value.split(',').map((u) => u.trim()).filter(Boolean)
}
return out
}
```
```ts
export function createServer(opts: ServerOptions): Server {
const guard = makeGuard(opts)
// With per-user sign-in (Sign-In with Ethereum), also pass `subject: (req) => `:
// quotes and swap ids are then bound to that user, and another user's are refused (403).
const swap2 = createSwap2Handler({ providers: opts.providers, sealSecret: opts.sealSecret, guard: guard.swap2 })
const rpc = createRpcProxy({ upstreams: opts.upstreams, ...(opts.fetchImpl ? { fetchImpl: opts.fetchImpl } : {}) })
// CCIP-Read for apps on React Native (offchain ENS names: cb.id, Basenames): https, public addresses only,
// the connection pinned to the checked address, no redirects. The app side is ensCcipViaProxy(`${api}/ccip`).
const ccip = createEnsCcipHandler(opts.ccip)
return createHttpServer(async (req, res) => {
if (!cors(req, res, opts.allowedOrigin)) return
const url = new URL(req.url ?? '/', 'http://local')
try {
if (req.method === 'GET' && url.pathname === '/health') return send(res, 200, { ok: true })
if (req.method !== 'POST') return send(res, 405, { error: 'method not allowed' })
const swap = /^\/swap2\/([a-z]+)$/.exec(url.pathname)
if (swap) {
guard.authenticate(req) // before reading (and parsing) up to 3 MB from anyone
const raw = await readBody(req, 3 * 1024 * 1024) // a Solana / TON payload can be ~2 MB
let body: unknown
try { body = JSON.parse(raw) } catch { return send(res, 400, { error: 'invalid JSON' }) }
const out = await swap2(swap[1]!, body, req)
return send(res, out.status, out.body)
}
if (url.pathname === '/ccip') {
guard.ccip(req) // the token and a per-caller limit, before the body is read
const raw = await readBody(req, 160 * 1024) // the gateway URL or calldata: up to 64 KiB of hex each
let body: unknown
try { body = JSON.parse(raw) } catch { return send(res, 400, { error: 'invalid JSON' }) }
const out = await ccip(body) // { url, method, body? } → { data } or { error }
return send(res, out.status, out.body)
}
const rpcPath = /^\/rpc\/([a-z0-9]+:[-_a-zA-Z0-9]+)$/.exec(url.pathname)
if (rpcPath) {
const charge = guard.rpc(req)
const out = await rpc(rpcPath[1]!, await readBody(req, 512 * 1024), { charge })
res.writeHead(out.status, { 'content-type': 'application/json' })
return res.end(out.body)
}
return send(res, 404, { error: 'not found' })
} catch (err) {
if (err instanceof Swap2HandlerError) return send(res, err.status, { error: err.message })
console.error('request failed', req.method, url.pathname) // never log bodies: they carry addresses and signed transactions
return send(res, 500, { error: 'internal error' })
}
})
}
```
The swap routes are `createSwap2Handler` from `@anywalletkit/protocol-swap2-core/server`: it validates every request, **seals** each quote (HMAC) and builds a deposit only for a quote it sealed itself, unchanged and not expired, so a client can’t make your server prepare a transaction on terms no provider offered. A provider’s refusal reaches the app with its reason, URLs stripped.
Every swap id the app gets carries an **intent token** from your server: tracking, claims and deposit notices need it, so your server won’t answer questions about swaps it didn’t start (deposit addresses are public on chain). With per-user sign-in, pass `subject` (the user’s Sign-In with Ethereum address, not an email): quotes and swap ids are then bound to that user, and another user’s are refused. Without it, the swap id works like a key to that one swap’s status, so ask users for a transaction hash, not a swap id, in support chats. Moving from another backend? `acceptUntokenedTrackUntil` lets swaps started there keep tracking for a while.
The RPC proxy forwards only what a wallet needs — reads, fee data, simulation and broadcasting an already signed transaction — and refuses anything that signs or administers a node. It also holds each call to a budget: `eth_getLogs` at most 5 000 blocks, no state or block overrides, answers up to 4 MiB, and a separate rate limit for expensive calls:
```ts
/**
* A JSON-RPC proxy: the app talks to `POST /rpc/`, the server adds the keyed upstream.
* Only the methods a wallet needs pass (reads, fee data, simulation, broadcasting a SIGNED
* transaction); anything that could sign or administer a node — eth_sign*, personal_*, admin_*,
* debug_*, eth_sendTransaction — is refused. Each call is also held to a budget: an
* `eth_getLogs` block range, no state or block overrides, a cap on the upstream's answer.
* Errors never carry the upstream URL or key.
*/
export interface RpcProxyOptions {
/** Upstream URLs per CAIP-2 chain, tried in order (failover on network errors and 5xx). */
upstreams: Readonly>
/** Raw body cap; a signed transaction is the largest legitimate request. */
maxBodyBytes?: number
/** Batch size cap. */
maxBatch?: number
/** Widest `eth_getLogs` range, in blocks, between two block numbers (default 5 000). */
maxLogsRange?: number
/** Largest upstream answer relayed, in bytes (default 4 MiB); a larger one is a 502. */
maxResponseBytes?: number
timeoutMs?: number
fetchImpl?: typeof fetch
}
const EVM_METHODS = new Set([
'eth_chainId', 'net_version', 'eth_blockNumber', 'eth_getBalance', 'eth_getTransactionCount', 'eth_getCode',
'eth_getStorageAt', 'eth_call', 'eth_estimateGas', 'eth_createAccessList', 'eth_gasPrice', 'eth_maxPriorityFeePerGas',
'eth_feeHistory', 'eth_getBlockByNumber', 'eth_getBlockByHash', 'eth_getTransactionByHash', 'eth_getTransactionReceipt',
'eth_getLogs', 'eth_simulateV1', 'eth_sendRawTransaction',
])
const SOLANA_METHODS = new Set([
'getBalance', 'getAccountInfo', 'getMultipleAccounts', 'getLatestBlockhash', 'getBlockHeight', 'getSlot', 'getEpochInfo',
'getFeeForMessage', 'getRecentPrioritizationFees', 'getMinimumBalanceForRentExemption', 'getTokenAccountsByOwner',
'getTokenAccountBalance', 'getSignaturesForAddress', 'getSignatureStatuses', 'getTransaction', 'simulateTransaction',
'sendTransaction', 'isBlockhashValid',
])
const ALLOWED: Record> = { eip155: EVM_METHODS, solana: SOLANA_METHODS }
/** Methods that cost the upstream (and your plan) far more than a balance read: give them their own rate limit. */
export const EXPENSIVE_METHODS: ReadonlySet = new Set([
'eth_getLogs', 'eth_call', 'eth_estimateGas', 'eth_createAccessList', 'eth_simulateV1',
'getSignaturesForAddress', 'getTransaction', 'getTokenAccountsByOwner', 'getMultipleAccounts', 'simulateTransaction',
])
export interface RpcResult { status: number; body: string }
const rpcError = (status: number, id: unknown, message: string): RpcResult =>
({ status, body: JSON.stringify({ jsonrpc: '2.0', id: id ?? null, error: { code: status === 400 ? -32600 : -32603, message } }) })
const BLOCK_TAGS = new Set(['latest', 'safe', 'finalized', 'pending'])
const BLOCK_NUMBER = /^0x[0-9a-fA-F]{1,16}$/
const present = (v: unknown) => v !== undefined && v !== null
/** Why one call is over budget, or null. Overrides would let a caller run arbitrary state on your node. */
function overBudget(method: string, params: unknown, maxLogsRange: number): string | null {
const p = Array.isArray(params) ? params : []
switch (method) {
case 'eth_getLogs': {
const f = p[0] as Record | undefined
if (!f || typeof f !== 'object') return 'eth_getLogs expects a filter object'
if (present(f.blockHash)) return present(f.fromBlock) || present(f.toBlock) ? 'eth_getLogs: blockHash or a range, not both' : null
const from = f.fromBlock ?? 'latest'
const to = f.toBlock ?? 'latest'
if (typeof from === 'string' && typeof to === 'string' && BLOCK_NUMBER.test(from) && BLOCK_NUMBER.test(to)) {
const span = BigInt(to) - BigInt(from)
return span >= 0n && span <= BigInt(maxLogsRange) ? null : `eth_getLogs: at most ${maxLogsRange} blocks, from ≤ to`
}
if (typeof from === 'string' && typeof to === 'string' && BLOCK_TAGS.has(from) && BLOCK_TAGS.has(to)) return null
return `eth_getLogs: give two block numbers at most ${maxLogsRange} apart, or a blockHash`
}
case 'eth_call':
return present(p[2]) || present(p[3]) ? 'eth_call: state and block overrides are not allowed' : null
case 'eth_estimateGas':
case 'eth_createAccessList':
return present(p[2]) ? `${method}: state overrides are not allowed` : null
case 'eth_simulateV1': {
const blocks = (p[0] as { blockStateCalls?: unknown } | undefined)?.blockStateCalls
if (!Array.isArray(blocks) || blocks.length > 4) return 'eth_simulateV1: 1..4 blockStateCalls'
for (const b of blocks as Array>) {
if (present(b?.stateOverrides) || present(b?.blockOverrides)) return 'eth_simulateV1: state and block overrides are not allowed'
if (Array.isArray(b?.calls) && b.calls.length > 16) return 'eth_simulateV1: at most 16 calls per block'
}
return null
}
default:
return null
}
}
/** The upstream's body, or null when it is larger than `cap` (read as a stream, never buffered past the cap). */
async function readCapped(res: Response, cap: number): Promise {
const declared = Number(res.headers.get('content-length') ?? Number.NaN)
if (Number.isFinite(declared) && declared > cap) { await res.body?.cancel(); return null }
if (!res.body) return ''
const reader = res.body.getReader()
const chunks: Uint8Array[] = []
let size = 0
for (;;) {
const { done, value } = await reader.read()
if (done) break
size += value.byteLength
if (size > cap) { await reader.cancel(); return null }
chunks.push(value)
}
return Buffer.concat(chunks).toString('utf8')
}
interface RpcCall { jsonrpc: '2.0'; id?: string | number | null; method: string; params: unknown[] }
const CALL_KEYS = new Set(['jsonrpc', 'id', 'method', 'params'])
const idOf = (c: unknown): unknown => {
const id = c && typeof c === 'object' && !Array.isArray(c) ? (c as { id?: unknown }).id : null
return typeof id === 'string' || typeof id === 'number' ? id : null
}
/**
* One JSON-RPC call reduced to `{ jsonrpc, id, method, params }`, or why it is refused. Any other
* key is refused, and so is a case variant of the four (`Method`, `PARAMS`): Go's encoding/json,
* which geth-style nodes use, matches field names case-insensitively, last key wins, so an
* upstream could run a method this proxy never checked. `params` must be an array (absent = []).
*/
function toCall(c: unknown): RpcCall | string {
if (!c || typeof c !== 'object' || Array.isArray(c)) return 'a call must be a JSON object'
const o = c as Record
for (const k of Object.keys(o)) if (!CALL_KEYS.has(k)) return `unexpected key: ${k.slice(0, 40)}`
if (o.jsonrpc !== '2.0') return 'jsonrpc must be "2.0"'
if (typeof o.method !== 'string') return 'method must be a string'
const id = o.id
if (id !== undefined && id !== null && typeof id !== 'string' && typeof id !== 'number') return 'id must be a string, number or null'
if (o.params !== undefined && !Array.isArray(o.params)) return 'params must be an array'
const params = (o.params as unknown[] | undefined) ?? []
return id === undefined ? { jsonrpc: '2.0', method: o.method, params } : { jsonrpc: '2.0', id, method: o.method, params }
}
export function createRpcProxy(opts: RpcProxyOptions) {
const maxBody = opts.maxBodyBytes ?? 256 * 1024
const maxBatch = opts.maxBatch ?? 20
const maxLogsRange = opts.maxLogsRange ?? 5_000
const maxResponse = opts.maxResponseBytes ?? 4 * 1024 * 1024
const timeoutMs = opts.timeoutMs ?? 15_000
const doFetch = opts.fetchImpl ?? fetch
/** `charge` sees the methods once the request is valid, before any upstream call: throw to refuse (rate limits). */
return async function proxy(chain: string, rawBody: string, hooks: { charge?: (methods: readonly string[]) => void | Promise } = {}): Promise {
const urls = opts.upstreams[chain]
if (!urls?.length) return rpcError(404, null, `no RPC configured for ${chain.slice(0, 64)}`)
if (Buffer.byteLength(rawBody) > maxBody) return rpcError(413, null, 'request too large')
let payload: unknown
try { payload = JSON.parse(rawBody) } catch { return rpcError(400, null, 'invalid JSON') }
const calls = Array.isArray(payload) ? payload : [payload]
if (calls.length === 0 || calls.length > maxBatch) return rpcError(400, null, `batch of 1..${maxBatch} calls`)
const allowed = ALLOWED[chain.split(':')[0]!]
const methods: string[] = []
const rebuilt: RpcCall[] = []
for (const c of calls) {
const call = toCall(c)
if (typeof call === 'string') return rpcError(400, idOf(c), call)
const { method, params, id } = call
if (!allowed?.has(method)) {
return rpcError(403, id, `method not allowed: ${method.slice(0, 60)}`)
}
const why = overBudget(method, params, maxLogsRange)
if (why) return rpcError(403, id, why)
methods.push(method)
rebuilt.push(call)
}
await hooks.charge?.(methods)
// Forward the request that was checked, not the bytes that came in: with a duplicated key
// ({"method":"eth_call", …, "method":"eth_sendRawTransaction"}) a parser that keeps the other
// occurrence would run a method the allowlist never saw. Each call is rebuilt from the four
// checked fields only, so nothing else (a "Method" or "PARAMS" that a case-insensitive Go
// decoder would pick up) reaches the upstream.
const checked = JSON.stringify(Array.isArray(payload) ? rebuilt : rebuilt[0])
for (const url of urls) {
try {
const res = await doFetch(url, {
method: 'POST', headers: { 'content-type': 'application/json' }, body: checked,
signal: AbortSignal.timeout(timeoutMs),
})
if (res.status >= 500) { await res.body?.cancel(); continue } // the next upstream
const body = await readCapped(res, maxResponse)
if (body === null) return rpcError(502, null, 'upstream response too large')
return { status: res.status, body }
} catch { /* network error or timeout: the next upstream */ }
}
return rpcError(502, null, 'upstream unavailable') // no URL, no key
}
}
```
**Authentication and rate limits are yours to add**, and the example says so loudly:
```ts
/**
* ⚠️ Replace this before production. A token baked into an app is NOT a secret: anyone can pull
* it out of the bundle. It only stops casual scraping. A real deployment authenticates the USER
* (Sign-In with Ethereum, your account system, App Attest / Play Integrity for the app itself)
* and rate-limits per user, in a shared store (Redis, Upstash), not in this process's memory.
*/
function makeGuard(opts: ServerOptions) {
// An empty token would equal an empty Authorization header: every request would pass.
if (typeof opts.apiToken !== 'string' || opts.apiToken.trim() === '') throw new Error('apiToken must be a non-empty string (an empty one lets every request through).')
const token = Buffer.from(opts.apiToken)
const limits = { rpcHeavy: 60, ccip: 60, ...(opts.limits ?? { live: 30, display: 240, status: 120, rpc: 600 }) }
const limiter = createRateLimiter()
const take = (key: string, perMinute: number) => limiter.take(key, perMinute)
const authenticate = (req: IncomingMessage): string => {
const got = Buffer.from(String(req.headers.authorization ?? '').replace(/^Bearer /, ''))
if (got.length !== token.length || !timingSafeEqual(got, token)) throw new Swap2HandlerError(401, 'unauthorized')
return opts.callerKey ? opts.callerKey(req) : (req.socket.remoteAddress ?? 'unknown') // the caller key; per USER in production
}
return {
/** The token check alone: run it before reading a body. */
authenticate,
swap2: (call: Swap2Call, req: IncomingMessage) => {
const caller = authenticate(req)
// Display quotes (route list, every keystroke) get their own, larger bucket so they never
// starve the one live quote the confirm step needs.
const bucket = call.action === 'track' || call.action === 'claim' ? 'status' : call.dry ? 'display' : 'live'
take(`${caller}:swap2:${bucket}`, limits[bucket])
},
/** One count per CCIP-Read gateway call: each makes this server fetch a URL a name's resolver chose. */
ccip: (req: IncomingMessage) => take(`${authenticate(req)}:ccip`, limits.ccip),
/** One count per request, then one per expensive call in it (a batch of 20 eth_getLogs is 20). */
rpc: (req: IncomingMessage) => {
const caller = authenticate(req)
take(`${caller}:rpc`, limits.rpc)
return (methods: readonly string[]) => {
for (const m of methods) if (EXPENSIVE_METHODS.has(m)) take(`${caller}:rpc-heavy`, limits.rpcHeavy)
}
},
}
}
```
Run it anywhere Node runs; on a serverless platform call the two handlers from your route functions instead ([`examples/server` README](https://github.com/ultratestbro/anywalletkit/tree/main/examples/server)).
## 4. RPC through the server
[Section titled “4. RPC through the server”](#4-rpc-through-the-server)
The app never sees an RPC key: each EVM network gets an EIP-1193 provider that posts to the proxy.
```ts
/** An EIP-1193 provider over the server's RPC proxy (it adds the upstream key). */
export function serverRpc(api: string, chain: string, token: string, fetchImpl: typeof fetch = fetch) {
let id = 0
return {
async request({ method, params }: { method: string; params?: unknown }) {
const res = await fetchImpl(`${api}/rpc/${chain}`, {
method: 'POST',
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params: params ?? [] }),
})
const body = (await res.json()) as { result?: unknown; error?: { code: number; message: string } }
if (body.error) throw Object.assign(new Error(body.error.message), { code: body.error.code })
return body.result
},
}
}
export function walletOverServer(phrase: string, api: string, token: string, fetchImpl?: typeof fetch): Wallet {
const wallet = new Wallet(phrase)
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: serverRpc(api, 'eip155:1', token, fetchImpl) as never, chainId: 1 })
wallet.registerWallet('eip155:8453', WalletManagerEvm, { provider: serverRpc(api, 'eip155:8453', token, fetchImpl) as never, chainId: 8453 })
return wallet
}
```
Pass `chainId` with every EVM registration ([Chain ids](/concepts/chain-ids/#pass-chainid-with-every-evm-registration)). Balances, token lists and history work unchanged on top ([Balances](/guides/balances/), [History](/guides/history/); explorer keys belong on the server too).
## 5. Swaps through the server
[Section titled “5. Swaps through the server”](#5-swaps-through-the-server)
The app builds the same router it would build locally, but every provider is a `remoteProvider` pointing at your server. The engine still validates every quote and every transaction **on the device** before anything is signed: the server can refuse, it cannot make the app sign something else. That needs each provider’s pins (`lifiPins`, `thorchainPins()`, `chainflipPins`…): the contracts its calldata may call and approve come from the app, never from the server, and a remote provider without pins gets no calldata route at all. A route that pays an address the server names (a deposit address, a plain send) runs only on a stub opened with `depositAddressRoutes` — `nearIntentsPins` for NEAR Intents. The server’s address must be https.
```ts
/**
* What the app trusts for each provider on the server: the contracts its calldata may call and approve,
* THORChain's check of each build against two THORNodes and Chainflip's decode of each vault swap. A
* remote provider without pins gets no calldata route at all, and one without `depositAddressRoutes` no
* deposit-address route: nearIntentsPins opt NEAR Intents in, its deposit addresses are per quote.
*/
const PINS: Readonly> = { lifi: lifiPins, thorchain: thorchainPins(), chainflip: chainflipPins, near_intents: nearIntentsPins }
/** The same router the app would build locally, but every provider runs on the server. */
export function swapsOverServer(account: IWalletAccount, api: string, token: string, names = ['lifi', 'near_intents', 'thorchain', 'chainflip'], fetchImpl?: typeof fetch) {
const remote = (name: string) => remoteProvider({
name, baseUrl: `${api}/swap2`, headers: { authorization: `Bearer ${token}` }, ...PINS[name],
// https in production; plain http only for a server on this machine (the tests).
...(/^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?$/.test(api) ? { allowInsecureBaseUrl: true } : {}),
...(fetchImpl ? { fetchImpl } : {}),
})
return new RouterSwap2Protocol(account, {
fromChain: account.chain,
providers: names.map(remote), // the names the server's providers carry
prefer: 'best',
})
}
```
Then quote, show the routes, execute the one the user picked and follow it to the end:
```ts
export async function execute(swaps: RouterSwap2Protocol, options: Swap2Options, route: Swap2Route) {
const result = await swaps
.using(route.provider) // exactly the route the user picked
.swap2({ ...options, minAmountOut: route.quote.toTokenAmountMin }) // never accept less than you showed
return result.id // keep it: status, claims and support all start from this id
}
```
```ts
const DONE = new Set(['completed', 'failed', 'refunded', 'cancelled', 'expired', 'partial'])
export async function waitForDelivery(
swaps: RouterSwap2Protocol,
id: string,
destinationAccount: () => Promise,
{ intervalMs = 10_000, timeoutMs = 2 * 60 * 60_000 }: { intervalMs?: number; timeoutMs?: number } = {},
) {
const deadline = Date.now() + timeoutMs
let claimed = false
while (Date.now() < deadline) {
const { status, transactions } = await swaps.getSwap2Status(id)
if (status === 'action-required' && !claimed) {
// Two-phase routes (CCTP): the mint is a transaction on the DESTINATION chain,
// signed by the user's account there and paid in that chain's gas. Once: the
// provider says 'action-required' until it sees the mint, so keep polling the
// id the claim returns (it carries the claim hash) instead of claiming again.
id = (await swaps.claimSwap2(id, await destinationAccount())).id
claimed = true
} else if (DONE.has(status)) {
return { status, transactions }
}
await new Promise((r) => setTimeout(r, intervalMs))
}
throw new Error(`Swap ${id} not settled within ${Math.ceil(timeoutMs / 1000)} s: keep its id and check again later.`)
}
```
Use the automatic slippage (`suggestSlippage`) and pass the minimum you showed: [Swaps](/guides/swaps/).
## 6. Review before signing
[Section titled “6. Review before signing”](#6-review-before-signing)
Every write goes through policies (fee caps, blocklists, a confirm step) and, for EVM, a simulation the user can read:
```ts
export const policies: Policies = {
// Refuse any Ethereum write whose quoted fee is above 0.005 ETH.
maxFee: { [ETHEREUM]: 5_000_000_000_000_000n },
// Never send to these addresses.
blocklist: { [ETHEREUM]: ['0x000000000000000000000000000000000000dEaD'] },
// The last word before anything is signed: show your confirmation sheet here.
confirm: async (intent) => {
console.log(`${intent.method} on ${intent.chain} → ${intent.to ?? 'contract'}`)
return true
},
}
```
```ts
export type Verdict = { level: 'ok' | 'warn' | 'danger'; lines: string[] }
/** Checks are codes, not prose: the wording (and the language) is yours. */
export function verdict(preview: TxPreview): Verdict {
const lines: string[] = []
let level: Verdict['level'] = 'ok'
const raise = (to: Verdict['level']) => { if (to === 'danger' || level === 'ok') level = to }
for (const check of preview.checks) {
const d = check.detail ?? {}
switch (check.code) {
case 'simulation-reverted':
raise('danger'); lines.push(`This transaction will fail: ${d.reason}`); break
case 'simulation-unavailable':
raise('warn'); lines.push('This network cannot simulate it. Check the details yourself.'); break
case 'approval-unlimited':
raise('danger'); lines.push(`${d.label ?? d.spender} could spend ALL of this token, now and later.`); break
case 'approval-excess':
raise('warn'); lines.push(`Approves ${d.amount}, but the swap needs only ${d.expected}.`); break
case 'approval-unchecked':
raise('warn'); lines.push(`Approves ${d.amount} to ${d.label ?? d.spender}; nothing says how much is needed.`); break
case 'approval-unknown-spender':
raise('warn'); lines.push(`Unknown spender ${d.spender}.`); break
case 'contract-unknown':
raise('warn'); lines.push(`Unknown contract ${d.address}.`); break
case 'recipient-foreign':
lines.push(`Sends to ${d.address}, which is not one of your accounts.`); break
default:
break // the "ok" codes need no line
}
}
return { level, lines }
}
/** Balance changes for the sheet: "-0.01 ETH", "+0.01 WETH". */
export function balanceLines(preview: TxPreview): string[] {
if (preview.simulation.status !== 'ok') return []
return preview.simulation.changes.map((c) => {
const sign = c.delta < 0n ? '-' : '+'
const abs = c.delta < 0n ? -c.delta : c.delta
const amount = c.decimals === null ? abs.toString() : formatUnits(abs, c.decimals)
return `${sign}${amount} ${c.symbol ?? c.token}`
})
}
```
More in [Review and safety](/build-a-wallet/review-and-safety/) and [Transaction preview](/guides/tx-preview/).
## 7. Connecting to dApps
[Section titled “7. Connecting to dApps”](#7-connecting-to-dapps)
WalletConnect for a mobile wallet is **not in the SDK yet** (a headless dApp-request handler is planned). Today you bring [Reown WalletKit](https://docs.reown.com) and route its session requests to `kit` accounts, so every request still passes your policies and review; see [dApp connection](/build-a-wallet/dapp-connection/#mobile-walletconnect). For browsers, `extension-kit` is the core of an extension wallet.
## 8. Before you publish
[Section titled “8. Before you publish”](#8-before-you-publish)
* **Testnet first.** Run every flow on Sepolia / Base Sepolia (and Solana devnet) with the [Networks](/guides/networks/#testnets) testnets on: create, restore, send, swap, a failed swap.
* **A Release build on a real device.** Dev builds hide Hermes and Metro problems.
* **No key in the app bundle.** Grep the built bundle for your RPC and provider keys; they must only be on the server.
* **Server secrets** in the host’s secret store; `SEAL_SECRET` is ≥ 32 random bytes.
* **Real user authentication and per-user rate limits** on the server, in a shared store.
* **Logs without bodies or addresses next to IPs**; alerts on upstream errors, provider refusal rates and 429s.
* **Key storage checks on a device:** Face ID fails → passcode works; re-enrolled Face ID still opens the wallet; the backup restores on a second phone.
* **Small amounts first** for every swap provider you enable.
# Swaps and Earn
> Adding swaps, bridges, staking and lending — which modules, which keys, and what the UI must handle.
## Swaps and bridges
[Section titled “Swaps and bridges”](#swaps-and-bridges)
**The job:** “I have USDT on Tron, I want ETH on Base” in one screen.
**In the kit:** twelve providers behind one `Swap2Protocol` interface, and a router that asks all of them in parallel and tags the best and the fastest route. Before it signs, the engine checks every quote: amounts, recipient, refund address, fee caps. The full flow is in [Swaps and bridges](/guides/swaps/).
**You bring:**
| Provider | Key | Get one |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| LI.FI | Optional; raises the rate limit, needed for an integrator fee | [li.fi](https://li.fi), [docs](https://docs.li.fi) |
| NEAR Intents (1Click) | JWT for volume and fees | [docs.near-intents.org](https://docs.near-intents.org) |
| Jupiter | Optional; keyless is 0.5 requests per second, a key is per organisation (keep it on your server) | [developers.jup.ag](https://developers.jup.ag/portal) |
| Fynd | Hosted API key, or run your own `fynd serve`; the license asks for a revenue share if you charge fees on its swaps | [docs.fynd.xyz](https://docs.fynd.xyz) |
| THORChain, Chainflip, CCTP, USDT0, Uniswap, Balancer, Wrap | None | — |
| STON.fi Omniston | None; EVM orders keep an HTLC secret until delivery, so a serverless backend needs a durable store | See the module README |
* **Secrets stay on a server.** The router can reach providers through your backend (the remote provider in `protocol-swap2-core`), so JWTs and affiliate settings never ship in the app.
* **Track status.** Cross-chain swaps take minutes. Persist the swap id, poll `getSwap2Status`, and handle `action-required` (a CCTP claim on the destination chain).
* **Pick routes in the app.** The router tags `best` and `fastest`; which one is the default, and how close two routes must be to count as a tie, is your product’s call.
## Earn
[Section titled “Earn”](#earn)
**The job:** staking and lending with a clear yield and a clear way out.
**In the kit:** nine modules behind two interfaces: `StakingProtocol` (stake → request withdrawal → claim) and `LendingProtocol` (supply and withdraw; borrow and repay where the market allows). See [Earn](/guides/earn/).
**You bring:** RPC on each chain. Some modules read rates from the protocol’s own public API (Lido’s APR), which you may want to cache on your server.
**Show the user, before they deposit:**
* **How long the exit takes.** Lido’s withdrawal queue takes days; a Jito exit can be instant at a fee, or wait for the epoch; native SOL stake cools down until the next epoch boundary (\~2 days), and native MON stake can be withdrawn one epoch after it deactivates (Monad epochs are about 4 hours).
* **Whom they delegate to.** With native staking your app picks the validators; show each one’s commission and whether it is voting (Solana) or in the active set (Monad).
* **What the yield is made of**, and that it changes.
* **The health factor** before a borrow, and what happens when it drops below 1.
# Your server
> What a wallet backend is for, what never goes on it, and the minimal set of routes.
A non-custodial wallet can run without a server. Most production wallets still have one, for the parts that can’t live in the app.
**What it is for:**
| Need | Why not in the app |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
| RPC and explorer proxy | Paid keys in an app are public ([Networks and RPC](/build-a-wallet/networks-and-rpc/#keep-keys-off-the-client)) |
| Swap provider proxy | Provider JWTs and affiliate settings ([Swaps](/build-a-wallet/swaps-and-earn/)) |
| Swap status tracking | A cross-chain swap may need an action after the app is closed (Omniston disclosure, CCTP claim) |
| Notifications | Watching addresses and pushing to devices ([Notifications](/build-a-wallet/fiat-and-notifications/#notifications)) |
| Price cache | One price API call for all users instead of one per user |
**In the kit:**
* **Swap backend:** `createSwap2Handler` from `@anywalletkit/protocol-swap2-core/server` runs the providers on your server; the app reaches them with `remoteProvider`. It validates every request, seals quotes (HMAC) and builds deposits only for quotes it sealed, and requires a `guard` for authentication and rate limiting.
* **A reference server:** [`examples/server`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/server) wires that handler and a JSON-RPC proxy (method allowlist, failover, no keys in errors) on `node:http`, tested in CI. [Ship a wallet](/build-a-wallet/ship-a-wallet/) walks through it with the app.
* **Everything else is configuration:** every package takes the URL you choose, so pointing it at your proxy needs no SDK change.
* **Not in the kit yet:** notifications (address watching → push), a shared price cache, and a durable store for Omniston’s EVM → TON orders.
**Rules:**
* **The server never holds user keys.** Not encrypted, not “for recovery”. If it signs, it signs for your own accounts (a relayer, a bot), with a backend signer.
* **Authenticate the app.** A public proxy is a free RPC for everyone; limit it by app attestation, a signed session or per-address rate limits.
* **Log nothing you’d regret.** Addresses and IPs together identify a user’s whole portfolio.
* **Pin what you forward.** A proxy should allow the methods and hosts your app uses, not forward any URL it is given.
# Build with AI
> Copy-paste prompts that build a wallet, swaps, a review sheet, Earn, accounts, a payout bot or your own module with an AI coding agent, each tested on a clean project.
Any Wallet Kit is small enough for a coding agent to use correctly when it has the right reference. This section gives you that reference and a set of prompts that build real things on the SDK. We run every prompt on a clean project before publishing it.
## Give your agent the SDK
[Section titled “Give your agent the SDK”](#give-your-agent-the-sdk)
* **[AGENTS.md](https://github.com/ultratestbro/anywalletkit/blob/main/AGENTS.md)**: one file with the packages, chain ids, the canonical patterns (wallet, balances, send, swaps, review, Earn, keyring, policies, modules), the React Native setup, the pitfalls and the security rules. Every API name in it is checked against the packages.
* **[llms-small.txt](/llms-small.txt)**: these guides as plain text.
* **[llms-full.txt](/llms-full.txt)**: the guides plus the generated API reference. It is large, so let the agent search it.
Most agents read a URL when the prompt names it. The prompts below name both.
## The prompts
[Section titled “The prompts”](#the-prompts)
| Prompt | Builds | Starts from |
| ------------------------------------------------ | -------------------------------------------------------------------------- | ------------ |
| [Minimal wallet](/build-with-ai/minimal-wallet/) | Expo wallet: phrase in Face ID storage, balances on 6 chains, send | empty folder |
| [Swaps and bridges](/build-with-ai/swaps/) | Swap screen on the router: streaming routes, auto slippage, review, status | the wallet |
| [Transaction review](/build-with-ai/tx-review/) | Simulated review sheet for every EVM write | the wallet |
| [Earn](/build-with-ai/earn/) | Lido, Aave v3 and Morpho with APY, positions, deposit / withdraw | the wallet |
| [Accounts and imports](/build-with-ai/accounts/) | Account switcher, phrase / key / Tonkeeper imports, gated export | the wallet |
| [Payout bot](/build-with-ai/backend-bot/) | Node CSV payouts: dry run, allowlist policy, idempotent journal | empty folder |
| [Your own module](/build-with-ai/own-module/) | ERC-4626 `LendingProtocol` package with conformance tests | empty folder |
Coming: a **Telegram Mini App wallet**, once the embedded-wallet kit ships.
## Eval results
[Section titled “Eval results”](#eval-results)
Each prompt ran once in a fresh Claude Code session (Opus 5.5, headless, no project settings or MCP servers) in a clean folder. The `@anywalletkit` packages were served from a local registry built from the repository; nothing else differed from a normal setup. Prompts 2–5 started from the app prompt 1 produced. We then checked every result ourselves:
* **Expo prompts:** `npx tsc --noEmit` and `npx expo export --platform ios` (the Hermes bundle).
* **Node prompts:** tsc, the tests, and a real run (the bot’s dry run against Base mainnet with the public test phrase; the module’s conformance suite).
| Prompt | Result | Time | Turns | Cost | Gate |
| -------------------- | --------------- | ------ | ----- | ----- | -------------------------------------------- |
| Minimal wallet | pass, first run | 13 min | 68 | $3.63 | tsc ✓, iOS bundle ✓ (1 967 modules) |
| Swaps and bridges | pass, first run | 9 min | 44 | $2.77 | tsc ✓, iOS bundle ✓ (2 023 modules) |
| Transaction review | pass, first run | 8 min | 50 | $2.46 | tsc ✓, iOS bundle ✓ |
| Earn | pass, first run | 9 min | 64 | $2.83 | tsc ✓, iOS bundle ✓, mainnet reads ✓ |
| Accounts and imports | pass, first run | 9 min | 46 | $2.83 | tsc ✓, iOS bundle ✓ |
| Payout bot | pass, first run | 7 min | 38 | $1.88 | tsc ✓, 17 tests ✓, dry run ✓ |
| Your own module | pass, first run | 11 min | 57 | $2.95 | tsc ✓, 47 tests incl. conformance ✓, build ✓ |
**What the eval changed:**
* **Fixed in the SDK:**
* `runtime-hermes/fast-pbkdf2`: `wallet-ton` no longer needs a native module or a stub on Metro.
* `protocol-swap2-core`: Solana, Tron and Bitcoin accounts can swap with `fromChain: account.chain`.
* Lido, SSV, Mellow and Approvals: these modules now accept real `wallet-evm` accounts in typed code.
* **Added to AGENTS.md:**
* the two forms of chain id;
* balances without a biometric prompt (read-only accounts; TON needs its public key);
* one EVM network per keyring;
* Earn modules over keyring accounts;
* the account errors (`BroadcastUnknownError`);
* how modules read chain state and recognize their transactions.
* **What the eval does not cover:** a bundle that builds is not an app that has been tapped through. None of the results ran on a device or sent a real transaction. Test on a Release build with small amounts.
# Accounts and imports
> Multiple accounts from one phrase, imported phrases, private keys and Tonkeeper wallets, and gated export.
## What you get
[Section titled “What you get”](#what-you-get)
An account switcher on `@anywalletkit/keyring`.
* **Accounts:** add the next account of a phrase; rename, hide or switch accounts.
* **Imports:** another phrase, with discovery of the accounts it has used; a private key, after previewing its address; a Tonkeeper 24-word phrase.
* **Gated screens:** “Show recovery phrase” and “Export private key” need a fresh biometric check every time.
## Before you start
[Section titled “Before you start”](#before-you-start)
The wallet from [Minimal wallet](/build-with-ai/minimal-wallet/). Tonkeeper imports need the `fast-pbkdf2` Metro resolution from [Installation](/getting-started/installation/#ton-on-metro).
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder of the app the earlier prompts built. The raw file is [`prompts/05-accounts.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/05-accounts.md).
```text
Add multiple accounts and imports to this Any Wallet Kit wallet with `@anywalletkit/keyring`.
Read the "Keyring" part of https://docs.anywallet.tech/llms-small.txt (or AGENTS.md in github.com/ultratestbro/anywalletkit) first, and use only APIs that appear there.
- Account switcher: list every account with its name and short addresses. Add account (the next index of the same phrase), rename, hide or unhide, set active. Every screen follows the active account.
- Import another recovery phrase, with discovery of the accounts it has used (any balance counts as used).
- Import a private key for one chain: show the address it gives before saving.
- Import a Tonkeeper-style 24-word TON phrase.
- "Show recovery phrase" and "Export private key" sit behind a fresh biometric / passcode check every time. Block screenshots while either is shown.
- Remove a wallet, together with its accounts and its secret.
- All secrets go through `@anywalletkit/secure-storage-react-native`. Listing accounts never prompts for biometrics. Signing uses one short-lived account per action.
Done when `npx tsc --noEmit` passes and `npx expo export --platform ios` bundles.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/wallet/keyring.ts # Keyring.load, create / import / addAccount / rename / hide / setActive / remove
src/app/accounts/ # switcher, add, rename, hide
src/app/import/ # phrase (discover), private key (preview → confirm), Tonkeeper
src/app/backup/ # re-authenticate → exportSecret / exportPrivateKey, screenshots blocked
```
## Check it works
[Section titled “Check it works”](#check-it-works)
Check that it builds with `npx tsc --noEmit` and `npx expo export --platform ios`. On a phone build:
1. Add an account and confirm its addresses differ from account 1.
2. Import the same phrase into another wallet app and compare the addresses.
3. Open “Show recovery phrase”: it must ask for Face ID every time.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Tonkeeper import throws on the phone | Metro resolves `react-native-fast-pbkdf2` to a throwing stub; use `@anywalletkit/runtime-hermes/fast-pbkdf2` |
| The account list asks for Face ID | Read `listAccounts()` / `AccountMeta.addresses`; only signing and export touch secrets |
| Imported key shows an unexpected address | Always `previewPrivateKey` and ask the user to confirm before `importPrivateKey` |
Security
Never paste a real recovery phrase into an agent chat, a prompt or a test. Use the public test phrase (`abandon abandon … about`) while building, then small amounts on a phone build. Read the diff the agent wrote around keys and signing: nothing should log, store or send the phrase, and every write should pass through a review step. Export screens re-authenticate every time and block screenshots.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 9 min, 46 turns, $2.83, on top of the Minimal wallet result. Account listing never prompts. Each reveal relies on secure storage’s own Face ID / passcode prompt (one prompt, not two), with screenshots blocked.
# Payout bot (Node)
> A Node service that pays USDC on Base from a CSV: dry run by default, policies with an exact allowlist, an idempotent journal and strict key handling.
## What you get
[Section titled “What you get”](#what-you-get)
A TypeScript CLI on Node 22.
* **Input:** a CSV of payouts; the seed phrase comes from an env var.
* **Safety rails:** kit policies (an allowlist of exactly the CSV’s recipients, plus a fee cap), checksummed addresses, per-row limits and balance checks.
* **Dry run:** by default it quotes every fee and prints the plan; `--send` pays.
* **Journal:** written before and after each send, so a restart never pays twice and an unknown outcome waits for a human.
## Before you start
[Section titled “Before you start”](#before-you-start)
* Node 22.
* For a real run, a funded hot wallet that holds only what the run pays out. Use a separate phrase, never your main one.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder. The raw file is [`prompts/06-backend-bot.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/06-backend-bot.md).
```text
Create a Node.js (TypeScript, Node 22, ESM) payout bot on Any Wallet Kit, the `@anywalletkit/*` packages.
Read https://docs.anywallet.tech/llms-small.txt (or AGENTS.md in github.com/ultratestbro/anywalletkit) first, and use only APIs that appear there.
- Input: a CSV of `address,amount` rows, with amounts in USDC (6 decimals). Payouts go out in USDC on Base from account 0 of the seed phrase in the `WALLET_SEED_PHRASE` env var.
- Safety:
- kit policies with an allowlist of exactly the CSV's recipients and a max-fee cap;
- checksum-validate every address;
- refuse duplicates and amounts above a configurable per-row limit;
- check the USDC and ETH balances before starting.
- Dry run by default: quote each transfer's fee and print the plan and the total; nothing is signed. `--send` actually sends.
- Idempotent: a JSON journal records each row as pending, sent (with its hash) or failed, written before and after every send. A restart never pays a row twice, and a row whose outcome is unknown stays pending for a human. No automatic retries.
- Never print or write the seed phrase or keys. Log addresses, amounts and hashes only. Dispose the wallet on exit, including Ctrl-C.
- Add a README that covers setup, the env vars, a dry run, and the key-handling rules.
Done when `npx tsc --noEmit` passes, a unit test covers the CSV and journal logic, and the dry run works against a sample CSV. Use the public test phrase `test test test test test test test test test test test junk`, which has no funds, so the run shows the plan with zero balances.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/main.ts # args, env, dry run vs --send, Ctrl-C → dispose
src/csv.ts # parse + checksum + limits + duplicates
src/journal.ts # pending / sent / failed, written around every send
src/wallet.ts # Wallet + WalletManagerEvm on Base, policies (allowlist, maxFee, confirm)
test/ # CSV and journal unit tests
README.md # setup, env vars, dry run, key handling
```
## Check it works
[Section titled “Check it works”](#check-it-works)
```sh
npx tsc --noEmit && npm test
WALLET_SEED_PHRASE="test test test test test test test test test test test junk" npm run payout -- examples/payouts.sample.csv
```
The test phrase has no funds, so the dry run shows zero balances and says why `--send` would refuse. Then run with a funded test wallet and one tiny row.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Every fee shows “unavailable” | An ERC-20 fee quote simulates the transfer: the wallet must hold the token |
| A crash after sending, then a double payment | Write the journal row as `pending` **before** sending; `BroadcastUnknownError` keeps it pending |
| `PolicyViolationError: allowlist` | Expected for any recipient outside the CSV: the allowlist is the point |
Security
The phrase comes from a secret manager or env var at start, never from the repo. Logs carry addresses, amounts and hashes only. Keep the hot wallet’s balance to what one run needs.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 7 min, 38 turns, $1.88, from an empty folder. 17 unit tests pass. The dry run with the test phrase printed the plan, showed zero balances, and listed why `--send` would refuse. The phrase never appeared in the output.
# Earn
> Add Lido staking, Aave v3 supply and the biggest Morpho USDC vault on Base, with APY, positions, deposits and withdrawals.
## What you get
[Section titled “What you get”](#what-you-get)
An Earn tab with three products:
* Lido staking on Ethereum, with the two-phase withdrawal queue;
* Aave v3 USDC on Ethereum;
* the biggest Morpho USDC vault on Base.
Each shows its APR / APY and the user’s position. Deposit and withdraw quote the fee first and go through the confirm flow.
## Before you start
[Section titled “Before you start”](#before-you-start)
The wallet from the earlier prompts. Earn writes cost mainnet gas, so test with small amounts.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder of the app the earlier prompts built. The raw file is [`prompts/04-earn.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/04-earn.md).
```text
Add an Earn tab to this Any Wallet Kit wallet.
Read the "Earn" part of https://docs.anywallet.tech/llms-small.txt (or AGENTS.md in github.com/ultratestbro/anywalletkit) first, and use only APIs that appear there.
Three products:
- Lido staking on Ethereum (ETH → stETH).
- Aave v3 USDC supply on Ethereum.
- The biggest Morpho USDC vault on Base, found with `MorphoApi`.
For each product:
- Show the APR / APY and the user's position, with a refresh.
- Deposit and withdraw with an amount field, a fee quote, then confirmation through the existing confirm flow.
- Lido withdrawals are two-phase: request first, then claim once the request is claimable. Show pending and claimable amounts.
Put the protocol registrations next to the wallet setup. Amounts stay bigint end to end.
Done when `npx tsc --noEmit` passes and `npx expo export --platform ios` bundles.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/earn/protocols.ts # registerProtocol('lido' | 'aave'), MorphoApi.listVaults → MorphoVaultProtocolEvm
src/earn/useEarn.ts # APR/APY, positions, quote + deposit / withdraw, Lido request → claim
src/app/earn/ # one card per product, amount sheet, pending / claimable for Lido
```
## Check it works
[Section titled “Check it works”](#check-it-works)
Check that it builds with `npx tsc --noEmit` and `npx expo export --platform ios`. On a phone build, check the APYs against the protocols’ own sites. Then deposit and withdraw a few dollars in the Morpho vault on Base, where gas is cheap.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| Lido “withdraw” returns no ETH | Unstaking is two-phase: `requestWithdrawal`, then `claimWithdrawals({ ids: claimableIds })` once finalized |
| `withdraw` leaves dust | Use `amount: 'max'` for the whole position |
| The Morpho vault list is empty | `MorphoApi` filters by chain and asset address; pass the asset on that chain |
Security
Never paste a real recovery phrase into an agent chat, a prompt or a test. Use the public test phrase (`abandon abandon … about`) while building, then small amounts on a phone build. Read the diff the agent wrote around keys and signing: nothing should log, store or send the phrase, and every write should pass through a review step. Show the APY source and the protocol’s risks; never imply a fixed return.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 9 min, 64 turns, $2.83, on top of the Minimal wallet result. A read-only check against mainnet returned the Lido APR and queue, Aave’s USDC APY (4.10 %), and the biggest Morpho USDC vault on Base.
The run found a typing bug, now fixed: modules built directly over a keyring account, with no `registerProtocol`, could not take a real `wallet-evm` account in Lido / SSV / Mellow / Approvals.
# Minimal wallet (Expo)
> One prompt that builds an Expo wallet: recovery phrase in Face ID-protected storage, addresses and balances on six chains, send with a fee quote and confirmation.
## What you get
[Section titled “What you get”](#what-you-get)
An Expo (React Native, expo-router) app. It creates or imports a 12-word phrase and keeps it in `@anywalletkit/secure-storage-react-native` through `@anywalletkit/keyring`. The home screen shows account 0’s addresses and native balances on Ethereum, Base, Solana, TON, Tron and Bitcoin. A send screen quotes the fee, asks for confirmation through the kit’s policies, signs and shows the hash.
## Before you start
[Section titled “Before you start”](#before-you-start)
* Node 22+, and a Mac with Xcode (or an Android SDK / EAS) for the phone build.
* An empty folder. The agent runs `create-expo-app` itself.
* No keys: the public RPCs in the reference are enough to start. Put your own endpoints in the config file before you ship.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder. The raw file is [`prompts/01-minimal-wallet.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/01-minimal-wallet.md).
```text
Build a minimal self-custodial multichain wallet app with Expo (React Native, TypeScript, expo-router) on Any Wallet Kit, the `@anywalletkit/*` packages.
Before writing code, read the SDK reference for agents: AGENTS.md in github.com/ultratestbro/anywalletkit, then the guides at https://docs.anywallet.tech/llms-small.txt (the API reference is in llms-full.txt). Use only APIs that appear there.
What the app does:
- Onboarding: create a new 12-word recovery phrase (show it once, then ask for 3 of the words back) or import an existing phrase (validate it).
- Keys: `@anywalletkit/keyring` with `@anywalletkit/secure-storage-react-native` as its secret storage (Face ID / Touch ID with passcode fallback); account names and addresses in AsyncStorage. The phrase never leaves secure storage after onboarding.
- Home: account 0's addresses and native balances on Ethereum, Base, Solana, TON, Tron and Bitcoin, with pull to refresh. A failed read shows an error, never 0.
- Send: pick a chain, enter recipient and amount, show the network fee quote, confirm, send, show the transaction hash.
- Install the React Native / Hermes polyfills exactly as the reference says.
Rules: amounts are bigint base units (format for display without Number); all RPC URLs in one config file (public endpoints are fine); never log or store the phrase or keys anywhere else; wrap every write in the kit's policies with a confirm step.
Done when `npx tsc --noEmit` passes and `npx expo export --platform ios` bundles. Then tell me how to run it on a phone (a development or Release build; Expo Go cannot load the secure-storage native module).
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
Roughly this. Agents name files differently, and that is fine:
```text
index.js # imports ./polyfills first, then expo-router/entry
polyfills.js # getRandomValues, Buffer, TextDecoder, URL, installHermesRuntime()
metro.config.js # react-native-fast-pbkdf2 → @anywalletkit/runtime-hermes/fast-pbkdf2
src/config.ts # every RPC URL
src/wallet/ # keyring + secure storage, balances, send, bigint formatting
src/app/onboarding/ # create (show once, confirm 3 words) / import (validate)
src/app/(home) # addresses + balances, pull to refresh
src/app/send # chain, recipient, amount → fee → confirm → hash
```
## Check it works
[Section titled “Check it works”](#check-it-works)
```sh
npx tsc --noEmit
npx expo export --platform ios # bundles for Hermes: catches polyfill and Metro problems without a device
npx expo prebuild --platform ios && npx expo run:ios --device --configuration Release
```
On the phone: create a wallet, kill the app, reopen it, and Face ID should unlock the same addresses. Then send a tiny amount on a cheap chain.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metro: `Unable to resolve module react-native-fast-pbkdf2` | Resolve it to `@anywalletkit/runtime-hermes/fast-pbkdf2` in `metro.config.js` and install `expo-crypto` ([Installation](/getting-started/installation/#ton-on-metro)) |
| `crypto.getRandomValues must be defined`, `Buffer is not defined`, `TextDecoder is not defined` | The polyfills are not first: keep them in their own module and import it first from `index.js`; `package.json` `"main"` must point at `index.js` |
| Secure storage throws `not-available` in Expo Go | It is a native module: use a development or Release build |
| `no-passcode` | The device has no passcode; the module refuses to store a secret it cannot protect |
| TON balance needs an unlock | A TON read-only account needs the public key; store it once (see [AGENTS.md](https://github.com/ultratestbro/anywalletkit/blob/main/AGENTS.md)) |
| Signing on Base goes to Ethereum | One EVM network per keyring / registration; open a second keyring for Base ([Keyring: more than one EVM network](/guides/keyring/#more-than-one-evm-network)) |
Security
Never paste a real recovery phrase into an agent chat, a prompt or a test. Use the public test phrase (`abandon abandon … about`) while building, then small amounts on a phone build. Read the diff the agent wrote around keys and signing: nothing should log, store or send the phrase, and every write should pass through a review step. Block screenshots on the phrase screen.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 13 min, 68 agent turns, $3.63, Claude Code (Opus 5.5) starting from an empty folder. The app typechecked and bundled.
The run found three gaps, now fixed in the SDK and the reference:
* **TON on Metro.** `wallet-ton` needs `react-native-fast-pbkdf2` on Metro. The agent wrote a throwing stub; `runtime-hermes` now ships a working drop-in.
* **Base on the keyring.** Signing on a second EVM network with the keyring needed a pattern; it is now in the Keyring guide and AGENTS.md.
* **TON balances.** A TON balance needs the account’s public key; that pattern is in AGENTS.md too.
# Your own protocol module
> Build a LendingProtocol for any ERC-4626 vault as a standalone package, with the SDK's conformance suite, activity recognition and a registry manifest.
## What you get
[Section titled “What you get”](#what-you-get)
A standalone npm package, `@acme/protocol-lending-erc4626-evm`.
* **Protocol:** a `LendingProtocol` with supply (exact approve + deposit), withdraw (redeem everything for `'max'`), quote twins, position and vault reads.
* **Activity:** `describeActivity` recognizes the vault’s deposits and withdrawals.
* **Tests:** Vitest, including `describeProtocolModule` from `@anywalletkit/conformance`.
* **Packaging:** tsup builds and a `module.json`.
## Before you start
[Section titled “Before you start”](#before-you-start)
Node 22+ and an empty folder. The module lives in **your own repository and npm scope**: the SDK repository does not accept pull requests yet. External modules are listed through the registry’s `external.json`.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder. The raw file is [`prompts/07-own-module.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/07-own-module.md).
```text
Create a new Any Wallet Kit protocol module as its own npm package in this directory: `@acme/protocol-lending-erc4626-evm`, a `LendingProtocol` for any ERC-4626 vault on an EVM chain.
Read the "Writing a protocol module" part of AGENTS.md in github.com/ultratestbro/anywalletkit, plus the guides at https://docs.anywallet.tech/llms-small.txt, first. Use only APIs that appear there. Use viem for ABI encoding and reads.
- Config: `{ vault, chainId }`, where `vault` is the vault's `0x…` address.
- `supply({ token, amount })`: `token` must be the vault's asset (refuse others). It sends an exact approve, then `deposit(assets, me)`.
- `withdraw({ token, amount })`: `amount` also accepts `'max'`. It calls `withdraw`, or `redeem` of every share for `'max'`.
- Each write has a `quote*` twin that signs nothing. `borrow` / `repay` (and their quotes) are unsupported and say so.
- Reads: `getPosition()` returns `{ shares, assets }`, and `getVault()` returns the asset address, its decimals, and the total assets.
- Writes refuse a read-only account. Amounts are bigint.
- `describeActivity` recognizes the vault's Deposit / Withdraw events ("Deposited 100 USDC · ") and returns null for anything else. Unit-test it with hand-built transactions.
- Run the SDK's conformance suite (`describeProtocolModule` from `@anywalletkit/conformance`) under Vitest.
- Package: ESM + CJS builds with types (tsup), a `module.json` registry manifest (tier `community`), and a README with usage.
Done when `npm test` passes, `npm run build` produces dist, and `npx tsc --noEmit` passes.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/protocol.ts # class extends LendingProtocol, reads via viem, writes via the account
src/activity.ts # describeActivity: Deposit / Withdraw → "Deposited 100 USDC · "
test/conformance.test.ts # describeProtocolModule('…', { type: 'lending', … })
test/*.test.ts # supply / withdraw / quotes / activity with a mock account
module.json # registry manifest, tier community
tsup.config.ts, README.md
```
## Check it works
[Section titled “Check it works”](#check-it-works)
```sh
npm test && npm run build && npx tsc --noEmit
```
Then supply and withdraw a few dollars in a real vault on Base from a script, with a funded test wallet.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Conformance: “a quote/read called sendTransaction” or “… called sign…” | `quote*` methods must estimate, never sign or send |
| Conformance: writes do not refuse a read-only account | Call `this.requireSigningAccount('supply')` first in every write |
| No way to read the vault from the account | Take an RPC in the config and read with your own viem client; `wallet-evm` accounts also have `simulateTransaction` |
| `describeActivity` sees no events | `ChainTx` has no logs field: match `call.to` / `call.selector` and `transfers` |
Security
A module never holds keys: it builds transactions and the account signs them, behind the wallet’s policies. Approve exact amounts, check every address you call against the config, and refuse an account on another chain.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 11 min, 57 turns, $2.95, from an empty folder. 47 tests pass, including `describeProtocolModule`. ESM, CJS and type builds come out, and tsc is clean.
# Swaps and bridges
> Add a swap screen on the swap router: streaming routes from every provider, auto slippage, a review sheet, execution and status tracking.
## What you get
[Section titled “What you get”](#what-you-get)
A Swap screen on `@anywalletkit/protocol-swap2-router`, running the key-free providers (LI.FI, NEAR Intents, Chainflip, CCTP, USDT0, Uniswap, Wrap, Jupiter).
* **Routes:** they stream in as each provider answers and carry best / fastest tags.
* **Slippage:** Auto, with manual overrides.
* **Review:** a sheet before the first approval or signature.
* **Execution:** the exact route the user picked, with the guaranteed minimum enforced.
* **Tracking:** status runs until a final state, including the claim step for CCTP.
## Before you start
[Section titled “Before you start”](#before-you-start)
* The wallet from [Minimal wallet](/build-with-ai/minimal-wallet/) (or your own app on the kit).
* Optional keys: a LI.FI `apiKey` raises its rate limit, a 1Click `jwt` removes its fee.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder of the app the earlier prompts built. The raw file is [`prompts/02-swaps.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/02-swaps.md).
```text
Add a Swap screen to this Any Wallet Kit wallet, using the swap router `@anywalletkit/protocol-swap2-router`.
Read the "Swaps and bridges" part of https://docs.anywallet.tech/llms-small.txt (or AGENTS.md in github.com/ultratestbro/anywalletkit) first, and use only APIs that appear there.
- Source: the active account on any chain the wallet supports; destination: any chain and token from `@anywalletkit/swap2-assets` (same-chain and cross-chain).
- Providers that need no API key: LI.FI, NEAR Intents, Chainflip, CCTP, USDT0, Uniswap, Wrap, Jupiter. Put RPC URLs in the existing config.
- Routes stream in as each provider answers (`quoteSwap2Routes` with `onUpdate`), tagged best / fastest; the user picks one. Show "you receive at least" (`toTokenAmountMin`), fees and ETA.
- Slippage: Auto by default (`suggestSlippage`), with 0.1 / 0.5 / 1 / 3 % overrides; the same slippage for quoting and execution.
- Execute exactly the picked route with `minAmountOut = route.quote.toTokenAmountMin`, behind a review sheet in `reviewExecution` (amounts, minimum, recipient, approvals) and the execution phases as progress.
- Track the swap by its id until it reaches a final status; when the status is `action-required`, claim on the destination chain.
- Map the swap errors to user messages. `Swap2MaybeSentError` means the swap may already be on chain: show it as pending and never retry.
Done when `npx tsc --noEmit` passes and `npx expo export --platform ios` bundles.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/swap/providers.ts # provider list + RPCs from the config
src/swap/useSwap.ts # quoteSwap2Routes(onUpdate), suggestSlippage, using(route.provider).swap2(...), getSwap2Status polling
src/app/swap/ # token pickers, route list, slippage chips, review sheet, progress, status
```
## Check it works
[Section titled “Check it works”](#check-it-works)
Check that it builds with `npx tsc --noEmit` and `npx expo export --platform ios`. Then on a phone build:
1. Quote 5 USDC from Base to Arbitrum. Routes should appear one by one.
2. Execute the cheapest one and watch the phases.
3. Wait for `completed`.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `swap2: no route available` from a Solana / Tron / Bitcoin account | Update `protocol-swap2-core`: older versions did not accept the genesis-hash chain id (`account.chain`) as `fromChain` |
| Execution refuses with “requires caller-supplied minAmountOut” | Pass `minAmountOut: route.quote.toTokenAmountMin` |
| `rejected by validation` at execution | Quote and execute with the same `slippage` |
| A swap “failed” and the user retries, then pays twice | `Swap2MaybeSentError`: the swap may be on chain. Show it as pending and track `e.id` |
Security
Never paste a real recovery phrase into an agent chat, a prompt or a test. Use the public test phrase (`abandon abandon … about`) while building, then small amounts on a phone build. Read the diff the agent wrote around keys and signing: nothing should log, store or send the phrase, and every write should pass through a review step. Show the guaranteed minimum (`toTokenAmountMin`), never only the expected amount.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 9 min, 44 turns, $2.77, on top of the Minimal wallet result. The screen uses `quoteSwap2Routes` with streaming, `suggestSlippage` for both quote and execution, `using(route.provider).swap2({ …, minAmountOut: route.quote.toTokenAmountMin })`, the `reviewExecution` sheet, status polling with a claim, and a pending state for `Swap2MaybeSentError`.
Building this cookbook also surfaced an SDK bug: `fromChain: account.chain` found no route from Solana, Tron or Bitcoin accounts. It is fixed in `protocol-swap2-core`.
# Transaction review
> Simulate every EVM write before it is signed: balance changes, approvals, recipient, a verdict from the preview's check codes.
## What you get
[Section titled “What you get”](#what-you-get)
A review sheet that runs `@anywalletkit/tx-preview-evm` before every EVM write. Plain sends go through `policies.confirm`, swaps through `reviewExecution`. The sheet shows:
* the simulated balance changes;
* every approval;
* the recipient and the fee;
* an ok / warn / danger verdict. Danger asks for a second, explicit confirmation.
## Before you start
[Section titled “Before you start”](#before-you-start)
The wallet from the earlier prompts, ideally with swaps. An RPC that supports `eth_simulateV1` gives full simulations; others fall back to `simulation-unavailable`.
## The prompt
[Section titled “The prompt”](#the-prompt)
Paste it into your agent as is, in the project folder of the app the earlier prompts built. The raw file is [`prompts/03-tx-review.md`](https://github.com/ultratestbro/anywalletkit/blob/main/prompts/03-tx-review.md).
```text
Add a transaction review sheet to this Any Wallet Kit wallet with `@anywalletkit/tx-preview-evm`.
Read the "Transaction preview" and "Policies" parts of https://docs.anywallet.tech/llms-small.txt (or AGENTS.md in github.com/ultratestbro/anywalletkit) first, and use only APIs that appear there.
- Every EVM write is simulated before the user confirms: plain sends and contract calls through the kit's `policies.confirm`, swaps through the router's `reviewExecution` (preview the approvals and the source call as one sequence).
- The sheet shows the simulated balance changes ("-0.01 ETH", "+25.1 USDC"), every approval with its spender and amount, the recipient, and the network fee.
- A verdict from the preview's check codes: ok, warn or danger, each with one plain-language line. Danger (a revert, an unlimited approval) needs a second, explicit confirmation. "Simulation unavailable" is a warning, not a block.
- Non-EVM writes and signed messages still get a confirmation sheet, without a simulation.
- The user's own addresses count as "own" so moves between them aren't flagged as foreign.
Done when `npx tsc --noEmit` passes and `npx expo export --platform ios` bundles.
```
## What the result looks like
[Section titled “What the result looks like”](#what-the-result-looks-like)
```text
src/review/preview.ts # JSON-RPC transport, previewEvmTx, check codes → verdict + lines
src/review/Sheet.tsx # changes, approvals, recipient, fee, verdict, second confirm on danger
src/wallet/policies.ts # confirm → preview for eip155 writes, plain sheet otherwise
```
## Check it works
[Section titled “Check it works”](#check-it-works)
Check that it builds with `npx tsc --noEmit` and `npx expo export --platform ios`. On a phone build:
1. Send to one of your own addresses. It must not be flagged as foreign.
2. Start a swap and confirm the approval amount equals the input.
## Common failures
[Section titled “Common failures”](#common-failures)
| Symptom | Fix |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Everything shows “simulation unavailable” | Your RPC has no `eth_simulateV1`; the module falls back to `eth_call` where it can, otherwise it is a warning by design |
| The RPC transport loses error details | Throw `Object.assign(new Error(message), body.error)` so `code` and `data` reach the module |
| Sends to your other accounts are flagged as foreign | Pass all of the user’s addresses in `own` |
Security
Never paste a real recovery phrase into an agent chat, a prompt or a test. Use the public test phrase (`abandon abandon … about`) while building, then small amounts on a phone build. Read the diff the agent wrote around keys and signing: nothing should log, store or send the phrase, and every write should pass through a review step. Treat `simulation-reverted` and `approval-unlimited` as danger.
## Eval
[Section titled “Eval”](#eval)
Passed on the first run: 8 min, 50 turns, $2.46, on top of the Minimal wallet result (without the swap screen, so the swap review was wired but had no caller yet). The agent tested its verdict logic in Node against a fake RPC: own-address sends, an unlimited approval, a revert, and no `eth_simulateV1`.
# Accounts and signers
> How Wallet, chain managers, accounts and signers fit together, and where the private key lives.
## Four pieces
[Section titled “Four pieces”](#four-pieces)
| Piece | Package | Job |
| ---------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Wallet` | `kit` | The orchestrator. Holds one seed phrase or signer, knows which chain package serves which chain, hands out accounts wrapped in your [policies](/concepts/policies/). |
| Chain manager (`WalletManagerEvm`, `WalletManagerSolana`…) | `wallet-*` | Derives accounts for one chain family and shares the RPC configuration between them. |
| Account | `wallet-*` | One address on one chain: balances, fee quotes, transfers, signatures. |
| `Signer` | `core` | The **only** place a private key exists. It turns bytes into a signature and does nothing else. |
Accounts build transactions and talk to the network. The signer never touches the network and the account never touches the key. Because of that split, the key can live somewhere else entirely: a hardware wallet, an MPC node, a backend.
The signer is not reachable from an account: it is a private field (`#signer`), so code the account is handed to cannot sign around the account’s checks or read a key. An account tells you only what holds its key, in `signerKind` (`seed`, `key` or `external`). A local signer’s key is not reachable from JavaScript at all, not even through a TypeScript-private method.
## The account interface
[Section titled “The account interface”](#the-account-interface)
Every account on every chain implements the same interface (`IWalletAccount` from `@anywalletkit/core`). Protocol modules are written against it, which is why one swap or staking module works with any wallet built on the SDK.
| Method | What it does |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `chain` | The account’s [CAIP-2 chain id](/concepts/chain-ids/) |
| `getAddress()` | The address in the chain’s usual format |
| `getBalance()` / `getTokenBalance(token)` | Balance in base units, as `bigint` |
| `quoteTransfer(options)` / `quoteSendTransaction(tx)` | The network fee, with nothing signed |
| `transfer({ recipient, amount, token? })` | Build, check, sign and broadcast a native or token transfer |
| `sendTransaction(tx)` | Sign and broadcast a transaction in the chain’s own format |
| `signTransaction(tx)` | Sign without broadcasting |
| `sign(message)` / `verify(message, signature)` | Message signatures the chain’s usual way (EIP-191, BIP-137, ed25519…) |
| `getTransactionReceipt(hash)` | `{ status: 1 }` once confirmed, `{ status: 0 }` if it failed, `undefined` while pending |
| `toReadOnlyAccount()` | The same address without signing ability |
| `dispose()` | Overwrite this account’s key material with zeros |
Chain packages add chain-specific methods on top (EIP-712 typed data on EVM, jetton transfers on TON, PSBTs on Bitcoin…). Those are listed in each package’s API reference.
## Read-only accounts
[Section titled “Read-only accounts”](#read-only-accounts)
A read-only account can read balances, quote fees and check receipts, but has no key. Use one for watch-only addresses, or to pass a protocol module an account that can only quote. Every chain manager has `getReadOnlyAccount(address)`, and every account has `toReadOnlyAccount()`.
## Signers
[Section titled “Signers”](#signers)
There are three kinds:
| `kind` | Where the key is | Made with |
| ---------- | ------------------------------------------------------------- | ------------------------------------------ |
| `seed` | Derived on the device from the seed phrase | `new Wallet(seedPhrase)` does this for you |
| `key` | One imported private key: a single account, nothing to derive | `privateKeySigner(curve, key)` from `core` |
| `external` | Outside the app: hardware wallet, Safe, MPC, backend | `externalSigner()` from `core` |
An external signer receives exactly what it must sign (a 32-byte digest for secp256k1 chains, message bytes for ed25519 chains) plus a `context` such as `evm-tx` or `solana-message`, so a device can show the right prompt.
```ts
import { externalSigner, type SignOptions } from '@anywalletkit/core'
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
/** Your device / MPC node / backend: it holds the key, the SDK never sees it. */
export interface RemoteKey {
publicKey: Uint8Array // 33-byte compressed secp256k1
sign(digest: Uint8Array, options: SignOptions): Promise // 65 bytes r‖s‖v
}
export function walletOnRemoteKey(remote: RemoteKey): Wallet {
const signer = externalSigner({
curve: 'secp256k1',
publicKey: remote.publicKey,
// Throw UserRejectedError from here when the user declines on the device.
sign: (payload, options) => remote.sign(payload, options),
})
const wallet = new Wallet(signer) // no seed phrase anywhere
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
return wallet
}
```
A signer works on one curve: `secp256k1` (EVM, Bitcoin, Tron, Zcash) or `ed25519` (Solana, TON, NEAR). A `Wallet` built on an external signer serves the chains of that curve. An external signer also holds a single key, so it gives you one account (index `0`).
## Disposal
[Section titled “Disposal”](#disposal)
Everything that holds a key has `dispose()`. It overwrites the key bytes in memory with zeros, and the object is unusable afterwards. `wallet.dispose()` disposes every manager, every account and the signer. Call it when the app locks.
Seed phrases and memory
A JavaScript string cannot be wiped from memory, so the SDK keeps no phrase. `new Wallet(seedPhrase)` turns it into the 64-byte seed at once; `new Wallet(seedBytes)` skips the string entirely. No seed or key is a property of any SDK object, so logging a wallet or an account shows no secret. For a hardware wallet, MPC or a signing service, see [Custom signer](/guides/custom-signer/).
# Chain ids
> CAIP-2 chain ids, registering chain packages by namespace or by exact id, and the EVM one-RPC-per-network rule.
The SDK names chains with [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) ids: `:`. One format works for every ecosystem, so a swap from USDT on Tron to SOL on Solana is just two ids.
| Chain | CAIP-2 id |
| --------------- | ----------------------------------------- |
| Ethereum | `eip155:1` |
| Base | `eip155:8453` |
| Arbitrum One | `eip155:42161` |
| Any EVM network | `eip155:` |
| Bitcoin | `bip122:000000000019d6689c085ae165831e93` |
| Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` |
| TON | `ton:-239` |
| Tron | `tron:0x2b6653dc` |
| NEAR | `near:mainnet` |
| Zcash | `zcash:mainnet` |
Every account reports its id as `account.chain`.
## Registering chain packages
[Section titled “Registering chain packages”](#registering-chain-packages)
`wallet.registerWallet(key, Manager, config)` accepts either form:
* **Exact id** (`'eip155:8453'`): serves only that chain.
* **Namespace** (`'solana'`, `'ton'`, `'bip122'`): serves every id that starts with it.
`wallet.getAccount(chain)` uses the exact registration first and falls back to the namespace.
### One RPC per EVM network
[Section titled “One RPC per EVM network”](#one-rpc-per-evm-network)
An EVM chain manager talks to **one** network: the network of its RPC. Register each EVM network you support under its exact id, with its own RPC:
```ts
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: ETHEREUM_RPC, chainId: 1 })
wallet.registerWallet('eip155:8453', WalletManagerEvm, { provider: BASE_RPC, chainId: 8453 })
```
Registering `'eip155'` once with an Ethereum RPC and then asking for `'eip155:8453'` gives you an account whose transactions go to **Ethereum**. Avoid this pattern.
### Pass `chainId` with every EVM registration
[Section titled “Pass chainId with every EVM registration”](#pass-chainid-with-every-evm-registration)
`chainId` in the EVM config is optional, but pass it, matching the id you register under:
```ts
wallet.registerWallet('eip155:8453', WalletManagerEvm, { provider: 'https://base-rpc.publicnode.com', chainId: 8453 })
```
Without it the account learns its network from the RPC (`eth_chainId`) on first use. Until then `account.chain` reads `eip155:unknown`, so code that keys on it (swap2’s `fromChain: account.chain`, policies per chain, history) has nothing to match, and offline signing of a transaction without its own `chainId` is impossible. With it, the chain is known at once and no extra RPC call is made. Non-EVM managers have one network and no `chainId`.
## Assets
[Section titled “Assets”](#assets)
Tokens use [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) ids in the swap packages, for example `eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7` for USDT on Ethereum. Account methods such as `getTokenBalance` and `transfer` take the chain’s own token identifier: a contract address, an SPL mint, a jetton master.
# Errors
> The error classes every package throws, and the rule that refusals are named.
The SDK never answers “no” with a `null`. When a quote, a transaction or a route cannot be used, you get an error whose class and message say why. Check errors with `instanceof`, not by matching messages.
## From `@anywalletkit/core`
[Section titled “From @anywalletkit/core”](#from-anywalletkitcore)
| Error | When | Extra fields |
| ------------------------ | ----------------------------------------------------------------- | ------------------------------------ |
| `InsufficientFundsError` | The account cannot cover amount + fee | `required`, `available` (base units) |
| `NetworkError` | An RPC or API call failed | `provider` (the endpoint) |
| `UserRejectedError` | An external signer or your `confirm` policy declined | |
| `SignerError` | The signer cannot sign: disposed, wrong curve, unsupported scheme | |
| `ReadOnlyAccountError` | A write method was called on a read-only account | |
| `NotImplementedError` | A protocol module does not implement an optional method | |
## From `@anywalletkit/kit`
[Section titled “From @anywalletkit/kit”](#from-anywalletkitkit)
| Error | When | Extra fields |
| ---------------------- | ------------------------------------------------- | ---------------------------------------------------- |
| `PolicyViolationError` | A [policy](/concepts/policies/) refused the write | `policy`: `'maxFee'`, `'allowlist'` or `'blocklist'` |
## From chain and protocol packages
[Section titled “From chain and protocol packages”](#from-chain-and-protocol-packages)
Each package adds errors for its own refusals: a simulation that would revert, a fee above the configured cap, an unsafe transaction shape, a swap quote that expired or whose route changed. They are listed in each package’s API reference.
```ts
import { InsufficientFundsError, UserRejectedError } from '@anywalletkit/core'
import { PolicyViolationError } from '@anywalletkit/kit'
try {
await account.transfer({ recipient, amount })
} catch (e) {
if (e instanceof UserRejectedError) return // the user cancelled: say nothing
if (e instanceof InsufficientFundsError) return showTopUp(e.required - e.available)
if (e instanceof PolicyViolationError) return showBlocked(e.policy)
throw e
}
```
# Policies
> Fee caps, allow and block lists, and a confirmation hook that run before every signature and broadcast.
Policies are rules that run **before** anything is signed or broadcast. You pass them when you create the `Wallet`. Every account it hands out is wrapped in them, including the accounts protocol modules use for swaps, staking or lending, so a module cannot skip them.
```ts
const wallet = new Wallet(seedPhrase, {
policies: {
maxFee: { 'eip155:1': 5_000_000_000_000_000n }, // 0.005 ETH
allowlist: { 'tron:0x2b6653dc': [TREASURY_ADDRESS] },
blocklist: { 'eip155:1': [KNOWN_SCAM_ADDRESS] },
confirm: async (intent) => showConfirmationSheet(intent), // true = go, false = cancel
},
})
```
## Rules
[Section titled “Rules”](#rules)
| Rule | Keyed by | Throws |
| ----------- | -------------------------------------------------------------- | ---------------------------------------------- |
| `maxFee` | chain id or namespace → cap in native base units | `PolicyViolationError` (`policy: 'maxFee'`) |
| `allowlist` | chain id or namespace → destinations; anything else is refused | `PolicyViolationError` (`policy: 'allowlist'`) |
| `blocklist` | chain id or namespace → destinations that are refused | `PolicyViolationError` (`policy: 'blocklist'`) |
| `confirm` | one function for every write | `UserRejectedError` when it returns `false` |
Address comparison ignores letter case.
## What is guarded
[Section titled “What is guarded”](#what-is-guarded)
Every method that produces a signature or a broadcast: `transfer`, `sendTransaction`, `signTransaction`, `sign`, the approval surfaces `approve`, `signPermit` and `signTypedData` (an EIP-2612 `Permit` or a Permit2 message is an approval: the lists check the **spender**, and `confirm` receives `kind: 'approval'` with `unlimited` and `deadline`; typed data that moves value by itself is a send judged by whom it pays: EIP-3009 `TransferWithAuthorization` / `ReceiveWithAuthorization` (`to`, with the verifying contract as the token), an ERC-2771 `ForwardRequest` and a `MetaTransaction` (the call they make, read like a transaction), a 1inch LOP `Order` (the settlement contract, and a `receiver` other than the maker). Any other typed data is `kind: 'typedData'` with `destinationUnknown: true`, because the policies cannot tell whether it moves value: an allowlist refuses it, and so does a blocklist without a `confirm` hook. A blocklisted `verifyingContract` is refused for all typed data), plus chain-specific write methods (Tron’s `signRaw`, NEAR’s `signBuilt` and `signNep413`, Solana’s `sendSerialized`, `signCompiled`, `signTransactionMessage`, swap2’s `sendSerializedTransaction`). The rule is deny-by-default: any other account method whose name starts with `sign`, `send`, `approve`, `revoke` or `transfer` is refused behind the wrapper (`PolicyViolationError`, `policy: 'method'`) unless it is listed in `UNGUARDED_WRITES` (only NEAR’s `transferActions`, which signs nothing), so a new signing method in a chain package cannot bypass the policies. Reads (balances, quotes, receipts) are never affected.
### Destinations
[Section titled “Destinations”](#destinations)
The lists check every destination a write names, not only the contract it calls:
* **EVM**: the contract, plus the recipient or spender inside a standard token call: ERC-20, ERC-721 and ERC-1155 transfers, `approve`, `increaseAllowance`, `setApprovalForAll`, Permit2 `approve`, an on-chain EIP-2612 `permit`, ERC-677 `transferAndCall`. Any other call is judged by the contract it calls.
* **Tron**: the same for TRC-20 calls, whether built from `parameters` or prebuilt (`raw_data_hex`).
* **NEAR**: the receiver, plus who `ft_transfer(_call)`, `nft_transfer(_call)` and `storage_deposit` pay and the beneficiary of `deleteAccount`.
* **TON**: each message’s target, plus a jetton or NFT transfer’s destination and excess receiver.
* **Solana**: the recipient of a SOL transfer; for an SPL transfer, the **owner** of the token account it pays (read through the account when a list or `confirm` applies); for a Stake instruction, whom it pays or empowers (a `Withdraw` recipient, a new authority, the staker and withdrawer, the vote account, the destination stake account), never the Stake program.
An allowlist must hold **all** of them. When part of a write cannot be read, the intent has `destinationUnknown: true`: an allowlist refuses it, and so does a blocklist without a `confirm` hook. `transfer` is judged by `recipient`, the field every chain pays. A TON jetton `transfer` also spends TON, so it is judged on the jetton master (it names the contract that receives `attachedValue`) and on a `responseDestination` other than the wallet itself (it gets the excess); a forward or custom payload cell makes it `destinationUnknown`, and `confirm` receives `attachedValue` and `forwardTonAmount`. wallet-ton itself refuses a foreign `responseDestination` unless `allowForeignResponseDestination` is set, and more than `maxJettonAttachedValue` (1 TON by default) attached.
The checks and the signature work from one copy of the arguments, taken before the first check, and `confirm` gets a copy of its own: nothing can change what is signed after it was judged.
### Revokes
[Section titled “Revokes”](#revokes)
Taking an approval back moves nothing, so a revoke is its own kind: `kind: 'revoke'`. This covers an `approve`, `signPermit` or EIP-2612 `Permit` of 0, the revoke calls sent as raw calldata (`approve(spender, 0)`, `approve(0x0, tokenId)`, `setApprovalForAll(operator, false)`, Permit2 `lockdown`, or a batch made only of these), and `revokeDelegation()`.
A revoke skips the allowlist and the spender’s blocklist entry, so the user can always take an allowance back from a known drainer. The blocklist still applies to the contract the revoke calls (the token, the NFT collection, Permit2). The fee cap and `confirm` apply as usual. `confirm` gets `revokes: [{ token, spender }]` to show what is being revoked.
For each write the checks run in this order:
1. **Fee cap.** The account quotes the fee, and anything above the cap is refused (for `transfer`, `sendTransaction`, `signTransaction`). The cap is then handed to the account, which holds it on what it signs; `approve`, `sendSerialized`, `signRaw`, `revokeDelegation` and `sendSerializedTransaction` get it the same way. A write that pays a fee but cannot take a cap (`signBuilt`, `signCompiled`, `signTransactionMessage`) is refused under one.
2. **Allow and block lists.** These check the destination. They are skipped for message signatures, where nothing moves.
3. **`confirm`.** It receives a `WriteIntent` and has the last word.
4. Only then is the original call made.
## `WriteIntent`
[Section titled “WriteIntent”](#writeintent)
What `confirm` receives:
| Field | Meaning |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `chain` | CAIP-2 id |
| `from` | The account’s address |
| `method` | `transfer`, `sendTransaction`, `sign`… |
| `kind` | `send`, `approval`, `revoke`, `typedData` or `message` |
| `to` | Destination, when it can be read off the call (a `transfer`’s recipient, the contract called, an approval’s spender) |
| `destinations` | Every destination the lists check (see above) |
| `destinationUnknown` | Part of the write could not be read: `destinations` may be incomplete |
| `token` | Token identifier for token transfers and approvals (a calldata transfer’s token too); `undefined` means the native coin |
| `amount` | Amount in base units, when it can be read off the call |
| `unlimited` | Approvals: type(uint128).max or above, a DAI-style `allowed`, or an amount that cannot be read |
| `approvals` | Approvals: every token a signature grants (a Permit2 batch has several) |
| `message` | `true` for message signatures |
| `raw` | The original argument, for anything else you need |
## Which chain’s rules apply
[Section titled “Which chain’s rules apply”](#which-chains-rules-apply)
The rules of the chain id you asked for (`wallet.getAccount('eip155:1')`) **and** of the chain the account reports both apply. An EVM account that has not talked to its RPC yet reports `eip155:unknown`, and your `eip155:1` rules still cover it.
A key can also be a namespace: `eip155` covers every EVM chain, `solana` every Solana cluster. Namespace rules and exact-id rules add up:
* `maxFee`: every matching cap is checked, so the tightest one wins;
* `allowlist`: a destination must be on **every** matching list;
* `blocklist`: a destination on **any** matching list is refused.
```ts
policies: {
blocklist: { eip155: [KNOWN_SCAM_ADDRESS] }, // on every EVM chain
maxFee: { eip155: 10n ** 16n, 'eip155:1': 5n * 10n ** 15n }, // tighter on mainnet
}
```
When the account cannot learn its chain id, its namespace rules still apply; an exact-id rule of that family refuses the write (`policy: 'chain'`) instead of guessing.
## Policies and chain-level limits
[Section titled “Policies and chain-level limits”](#policies-and-chain-level-limits)
Chain packages have their own limits on top: `transferMaxFee` / `transactionMaxFee` in every chain config, a fee-rate ceiling on Bitcoin, refusal of burns to zero addresses, simulation before signing. Policies are the app-wide layer above them: one place, same shape on every chain.
# API at a glance
> The twenty operations most wallets need, each with a short snippet and links to its guide and its full API page. The rest of the API reference is lower-level.
The [API reference](/api/) lists every exported class, function and type: about two thousand pages, most of them for module authors. These are the operations an app actually calls. The snippets come from [`examples/`](https://github.com/ultratestbro/anywalletkit/tree/main/examples), which CI type-checks and tests on every change; the storage and backup ones from the package READMEs. Chain ids are CAIP-2 (`eip155:1`, `solana:…`): see [Chain ids](/concepts/chain-ids/).
## Wallet and accounts
[Section titled “Wallet and accounts”](#wallet-and-accounts)
**1. Create or restore a seed phrase** — [`getRandomSeedPhrase`](/api/anywalletkit/core/functions/getrandomseedphrase/), [`isValidSeedPhrase`](/api/anywalletkit/core/functions/isvalidseedphrase/)
```ts
import { getRandomSeedPhrase, isValidSeedPhrase } from '@anywalletkit/core'
const phrase = getRandomSeedPhrase(12) // or 24
isValidSeedPhrase(words) // wordlist + checksum
```
**2. Open a wallet on the chains you support** — [`Wallet`](/api/anywalletkit/kit/classes/wallet/) · guide: [Quickstart](/getting-started/quickstart/)
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
const wallet = new Wallet(phrase, { policies }) // policies are optional (step 7)
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
wallet.registerWallet('solana', WalletManagerSolana, { provider: 'https://api.mainnet-beta.solana.com' })
// … wallet-ton, wallet-tron, wallet-btc, wallet-near, wallet-zcash the same way
```
**3. Address and balances** — guide: [Balances](/guides/balances/)
```ts
const account = await wallet.getAccount('eip155:1') // account #0; getAccount(chain, 1) = the next
await account.getAddress() // derived locally, no network
await account.getBalance() // native, bigint in base units
await account.getTokenBalance('0xdAC17F958D2ee523a2206206994597C13D831ec7') // USDT
```
Read many balances with `Promise.allSettled` and show a failed read as an error, never as 0.
**4. Several accounts, imported seeds and keys** — [`Keyring`](/api/anywalletkit/keyring/classes/keyring/) · guide: [Keyring](/guides/keyring/)
```ts
import { Keyring } from '@anywalletkit/keyring'
const keyring = await Keyring.load({ storage, secrets, chains })
const { account, mnemonic } = await keyring.createMnemonic({ words: 12 })
await keyring.importMnemonic(phrase, { discover: { isUsed, gapLimit: 1, maxIndex: 20 } })
await keyring.addAccount(sourceId, { name: 'Savings' }) // next index of the same seed
await keyring.previewPrivateKey('evm', key) // address only, stores nothing
```
**5. Keep the seed on the phone behind Face ID** — [`createSecureStorage`](/api/anywalletkit/secure-storage-react-native/functions/createsecurestorage/) · guide: [Keys and storage](/build-a-wallet/keys-and-storage/#key-storage)
```ts
import { createSecureStorage } from '@anywalletkit/secure-storage-react-native'
const secrets = createSecureStorage({ namespace: 'my-wallet' }) // iOS Keychain / Android Keystore
const keyring = await Keyring.load({ storage, secrets, chains })
```
An Expo native module: a development or Release build, not Expo Go.
**6. Encrypted backup to iCloud** — [`saveBackup`](/api/anywalletkit/backup-cloud/functions/savebackup/), [`restoreBackup`](/api/anywalletkit/backup-cloud/functions/restorebackup/)
```ts
import { iCloudDrive, iCloudKeychain, saveBackup, restoreBackup } from '@anywalletkit/backup-cloud'
const store = iCloudDrive({ container: 'iCloud.com.example.wallet' })
await saveBackup({ store, keyVault: iCloudKeychain(), password, secret, meta })
const opened = await restoreBackup({ store, name, keyVault: iCloudKeychain(), expect: source }) // or { password }
```
## Sending and signing
[Section titled “Sending and signing”](#sending-and-signing)
**7. Guard every write: fee caps, blocklists, a confirm step** — [`Policies`](/api/anywalletkit/kit/interfaces/policies/), [`applyPolicies`](/api/anywalletkit/kit/functions/applypolicies/) · concept: [Policies](/concepts/policies/)
```ts
const policies: Policies = {
maxFee: { 'eip155:1': 5_000_000_000_000_000n },
blocklist: { 'eip155:1': ['0x000000000000000000000000000000000000dEaD'] },
confirm: async (intent) => showReviewSheet(intent), // false cancels; nothing is signed
}
```
**8. Send** — guide: [Quickstart](/getting-started/quickstart/)
```ts
const transfer = { token: USDT, recipient, amount: 1_000_000n } // omit token for the native coin
const { fee } = await account.quoteTransfer(transfer) // nothing is signed
const { hash } = await account.transfer(transfer) // simulate → policies → sign → broadcast
await account.getTransactionReceipt(hash) // undefined until mined
```
**9. Sign and verify a message**
```ts
const signature = await account.sign('Sign in to example.com')
await account.verify('Sign in to example.com', signature)
```
**10. Show what a transaction will do before signing** — [`previewEvmTx`](/api/anywalletkit/tx-preview-evm/functions/previewevmtx/) · guide: [Transaction preview](/guides/tx-preview/)
```ts
import { previewEvmTx } from '@anywalletkit/tx-preview-evm'
const preview = await previewEvmTx({ chainId: 8453, from, rpc, own: [from], calls })
preview.checks // simulation-reverted, approval-unlimited, recipient-foreign, contract-unknown, …
preview.simulation // { status: 'ok', changes } — simulated balance changes per address and token
```
**11. Send to `name.eth`** — [`ensResolver`](/api/anywalletkit/names-ens/functions/ensresolver/), [`nameResolvers`](/api/anywalletkit/core/functions/nameresolvers/) · guide: [Names](/guides/names/)
```ts
import { nameResolvers, assertNameUnchanged } from '@anywalletkit/core'
import { ensResolver } from '@anywalletkit/names-ens'
const names = nameResolvers([ensResolver({ rpcUrl: 'https://ethereum-rpc.publicnode.com' })])
const resolved = await names.resolve('vitalik.eth', 'eip155:8453')
await assertNameUnchanged(names, resolved.name, resolved.chain, resolved.address) // right before signing
```
## Swaps and Earn
[Section titled “Swaps and Earn”](#swaps-and-earn)
**12. Quote a swap or bridge across every provider** — [`RouterSwap2Protocol`](/api/anywalletkit/protocol-swap2-router/classes/routerswap2protocol/) · guide: [Swaps](/guides/swaps/)
```ts
import { RouterSwap2Protocol } from '@anywalletkit/protocol-swap2-router'
const swaps = new RouterSwap2Protocol(account, { fromChain: account.chain, providers: [lifiProvider({}), nearIntentsProvider({}), /* … */] })
const routes = await swaps.quoteSwap2Routes(options, { onUpdate: (routes, pending) => render(routes) })
```
**13. Execute the route the user picked** — guide: [Swaps](/guides/swaps/)
```ts
const { id } = await swaps.using(route.provider).swap2({ ...options, minAmountOut: route.quote.toTokenAmountMin })
```
Pass the minimum you showed; add `slippage` (a decimal) to bound the re-quote. `suggestSlippage(...)` from `@anywalletkit/protocol-swap2-core/slippage` gives an automatic one.
**14. Track it to the end** — guide: [Swaps](/guides/swaps/)
```ts
const { status, transactions } = await swaps.getSwap2Status(id)
if (status === 'action-required') ({ id } = await swaps.claimSwap2(id, destinationAccount)) // CCTP mint; keep polling the returned id
```
**15. Stake, lend, withdraw** — [`AaveProtocolEvm`](/api/anywalletkit/protocol-lending-aave-evm/classes/aaveprotocolevm/), [Lido](/api/anywalletkit/protocol-staking-lido-evm/classes/default/) · guide: [Earn](/guides/earn/)
```ts
wallet.registerProtocol('aave', AaveProtocolEvm, { chain: 'eip155:1', config: { market: 'core' } })
const aave = await wallet.getProtocol('aave')
await aave.getSupplyApy(USDC) // 4.1 = 4.1 %
await aave.supply({ token: USDC, amount })
await aave.withdraw({ token: USDC, amount: 'max' })
await aave.getPosition() // supplies, borrows, health factor
```
## Safety, data and networks
[Section titled “Safety, data and networks”](#safety-data-and-networks)
**16. List and revoke token approvals** — [`ApprovalsProtocolEvm`](/api/anywalletkit/protocol-approvals-evm/classes/default/) · guide: [Approvals](/guides/approvals/)
```ts
const approvals = await wallet.getProtocol('approvals')
const { approvals: list, coverage } = await approvals.getApprovals()
await approvals.revoke(list[0])
```
**17. Activity history** — [`createEvmHistory`](/api/anywalletkit/history-evm/functions/createevmhistory/) · guide: [History](/guides/history/)
```ts
wallet.registerHistorySource(createEvmHistory({ chainId: 1 }))
const page = await wallet.history({ limit: 20 }) // every chain with a source, labelled by the modules
await wallet.history({ limit: 20, cursor: page.cursor })
```
**18. User RPCs and custom networks** — [`NetworksTable`](/api/anywalletkit/networks/classes/networkstable/) · guide: [Networks](/guides/networks/)
```ts
const table = new NetworksTable(storage); await table.load()
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: table.rpcUrlsForSync('eip155:1'), chainId: 1 })
await table.addRpc('eip155:1', url) // after checkRpcUrl + verifyNetwork
```
**19. Run on React Native (Hermes)** — guide: [Installation](/getting-started/installation/#react-native--expo)
```ts
import { installHermesRuntime } from '@anywalletkit/runtime-hermes'
installHermesRuntime() // first line of your entry file, before any other @anywalletkit import
```
**20. Lock the app** — [`Wallet`](/api/anywalletkit/kit/classes/wallet/)
```ts
wallet.dispose() // zeroizes the seed and keys; build a new Wallet on unlock
```
## On your server
[Section titled “On your server”](#on-your-server)
**Run swap providers behind your backend** — `createSwap2Handler` from `@anywalletkit/protocol-swap2-core/server` · guide: [Ship a wallet](/build-a-wallet/ship-a-wallet/)
```ts
import { createSwap2Handler } from '@anywalletkit/protocol-swap2-core/server'
const handle = createSwap2Handler({ providers, sealSecret, guard: (call, req) => authAndRateLimit(call, req) })
const { status, body } = await handle(action, json, req) // POST /swap2/:action; the app uses remoteProvider
```
## Everything else
[Section titled “Everything else”](#everything-else)
The API reference also documents the building blocks: provider classes for each swap venue, chain-specific account types, error classes, catalog data and the conformance kit for [writing your own module](/build-with-ai/own-module/). Errors you branch on are listed in [Errors](/concepts/errors/).
# Installation
> Add Any Wallet Kit to a React Native (Expo) app or a Node service.
## Try it from source
[Section titled “Try it from source”](#try-it-from-source)
The source is on [GitHub](https://github.com/ultratestbro/anywalletkit). Node 22+ and pnpm 10:
```sh
git clone https://github.com/ultratestbro/anywalletkit.git
cd anywalletkit
pnpm install
pnpm build
pnpm --filter ./examples/quickstart test
```
Every snippet on this site comes from a package in [`examples/`](https://github.com/ultratestbro/anywalletkit/tree/main/examples), and each one runs the same way.
## Pick your packages
[Section titled “Pick your packages”](#pick-your-packages)
Every package is on npm under [`@anywalletkit`](https://www.npmjs.com/org/anywalletkit), published from CI with provenance (`npm audit signatures` checks it). npm, pnpm, yarn and `npx expo install` all work; the commands on this site use npm.
Every wallet needs `core` and `kit`, plus one package per chain family it supports:
```sh
npm install @anywalletkit/core @anywalletkit/kit \
@anywalletkit/wallet-evm @anywalletkit/wallet-solana @anywalletkit/wallet-ton \
@anywalletkit/wallet-btc @anywalletkit/wallet-tron @anywalletkit/wallet-near
```
Swaps, staking and lending are separate packages — add them when you need them (see [Packages](/getting-started/packages/)).
## React Native / Expo
[Section titled “React Native / Expo”](#react-native--expo)
React Native is the primary target: every chain package is tested inside the Hermes VM before a release. Hermes misses a few web APIs the cryptography and network code expect; you install them once, at the app entry, **before anything else is imported**.
```sh
npx expo install react-native-get-random-values
npm install @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
```
Put the polyfills in their own file so nothing can be evaluated before them:
polyfills.js
```js
// 1. Secure randomness — seed phrases and signatures depend on it. Must be first.
import 'react-native-get-random-values'
// 2. A global Buffer (TON and Bitcoin libraries read it).
import { Buffer } from 'buffer'
globalThis.Buffer ??= Buffer
// 3. Hermes ships TextEncoder but no TextDecoder.
import 'fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min.js'
// 4. React Native's URL has no working searchParams; providers parse endpoints with it.
import 'react-native-url-polyfill/auto'
// 5. Everything else the SDK relies on: AbortSignal.timeout / any,
// crypto.subtle.digest, structuredClone, the Buffer.subarray fix.
// Each piece is installed only when it is missing; it throws if 1–4 are absent.
import { installHermesRuntime } from '@anywalletkit/runtime-hermes'
installHermesRuntime()
```
index.js
```js
import './polyfills'
import 'expo-router/entry' // or your AppRegistry.registerComponent(...)
```
Point `"main"` in `package.json` at `index.js`.
### TON on Metro
[Section titled “TON on Metro”](#ton-on-metro)
`@anywalletkit/wallet-ton` depends on `@ton/crypto-primitives`, whose React Native build requires `expo-crypto` and the native `react-native-fast-pbkdf2` module. Install `expo-crypto` (`npx expo install expo-crypto`) and resolve the native module to the pure-JS drop-in that `runtime-hermes` ships:
metro.config.js
```js
const { getDefaultConfig } = require('expo/metro-config')
const config = getDefaultConfig(__dirname)
const resolveRequest = config.resolver.resolveRequest
config.resolver.resolveRequest = (context, moduleName, platform) =>
moduleName === 'react-native-fast-pbkdf2'
? { type: 'sourceFile', filePath: require.resolve('@anywalletkit/runtime-hermes/fast-pbkdf2') }
: (resolveRequest ?? context.resolveRequest)(context, moduleName, platform)
module.exports = config
```
Tip
`installHermesRuntime()` returns a report of what it found (`native`, `patched`, `polyfilled` or `missing` per API). Log it once in development builds when something behaves differently on the device than in tests.
Note
Test on a **Release** build. Debug builds run JavaScript differently and can hide problems that only show up in production.
## Node
[Section titled “Node”](#node)
Node 22 or newer needs no polyfills. Run a patched release: Node 20 no longer gets security fixes, and the October 2026 fixes are in 22.23.4, 24.22.1 and 26.12.1.
```sh
npm install @anywalletkit/core @anywalletkit/kit @anywalletkit/wallet-evm
```
All packages ship ESM and CommonJS builds with TypeScript types.
## Next
[Section titled “Next”](#next)
Build your first multichain wallet in the [Quickstart](/getting-started/quickstart/).
# Packages
> Every Any Wallet Kit package, grouped by layer.
Install only what your wallet uses. Every package is published under the `@anywalletkit/` scope.
Pre-1.0
Every package is on npm under [`@anywalletkit`](https://www.npmjs.com/org/anywalletkit), published from CI with provenance. Versions are `0.x`: a minor release may still change the API.
## Core
[Section titled “Core”](#core)
| Package | What it does |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `@anywalletkit/core` | Signer and account interfaces, protocol base classes, errors, BIP-39 / BIP-32 / SLIP-10 helpers |
| `@anywalletkit/conformance` | Golden vectors and the test suites every chain and protocol module must pass |
| `@anywalletkit/kit` | Orchestrator: one seed or signer, registered chain wallets and protocol modules, accounts by CAIP-2 chain id, policies (fee cap, allow / block lists, confirmation) before every broadcast |
| `@anywalletkit/keyring` | Many accounts from one seed plus imported seeds and private keys, one account list across chains, per-execution accounts that dispose the key after use |
| `@anywalletkit/runtime-hermes` | One-call React Native / Hermes polyfills the SDK relies on |
| `@anywalletkit/secure-storage-react-native` | The keyring’s secret storage on iOS / Android: Face ID, Touch ID or fingerprint with a passcode fallback on every read (Expo module) |
| `@anywalletkit/seed-vault` | Encrypted backup file for one seed or key, opened by a password (Argon2id) or a 32-byte key |
| `@anywalletkit/backup-cloud` | iCloud Drive backups of seed-vault files, with the key in iCloud Keychain or a password |
## Chains
[Section titled “Chains”](#chains)
| Package | Chains | Derivation |
| ----------------------------- | --------------------------------------- | --------------------------------------------- |
| `@anywalletkit/wallet-evm` | Ethereum and 30+ EVM networks | `m/44'/60'/0'/0/i` |
| `@anywalletkit/wallet-btc` | Bitcoin (BIP-84 SegWit, BIP-86 Taproot) | `m/84'/0'/0'/0/i` (Taproot `m/86'/0'/0'/0/i`) |
| `@anywalletkit/wallet-solana` | Solana | `m/44'/501'/i'/0'` |
| `@anywalletkit/wallet-ton` | TON (WalletContractV5R1) | `m/44'/607'/i'` |
| `@anywalletkit/wallet-tron` | Tron | `m/44'/195'/0'/0/i` |
| `@anywalletkit/wallet-near` | NEAR (implicit and named accounts) | `m/44'/397'/i'` |
| `@anywalletkit/wallet-zcash` | Zcash (transparent addresses) | `m/44'/133'/0'/0/i` |
## Swaps and bridges
[Section titled “Swaps and bridges”](#swaps-and-bridges)
All swap modules implement one `Swap2Protocol` interface, so each works on its own or inside the router.
| Package | What it does |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `@anywalletkit/protocol-swap2-core` | Swap engine, cross-chain router base, quote and execution safety rails |
| `@anywalletkit/protocol-swap2-router` | Auctions every provider you install, tags the best and the fastest route, executes the winner, resumes status |
| `@anywalletkit/swap2-assets` | CAIP-19 asset registry shared by the swap packages |
| `@anywalletkit/protocol-swap2-near-intents` | NEAR Intents (1Click) — cross-chain |
| `@anywalletkit/protocol-swap2-lifi` | LI.FI — same-chain and cross-chain |
| `@anywalletkit/protocol-swap2-thorchain` | THORChain — native cross-chain swaps |
| `@anywalletkit/protocol-swap2-chainflip` | Chainflip — native BTC, ETH, SOL, TRX and stablecoins between Ethereum, Arbitrum, Solana, Tron and Bitcoin; no key, 0 bps |
| `@anywalletkit/protocol-swap2-omniston` | STON.fi Omniston — TON swaps, TON ↔ EVM and EVM ↔ EVM stablecoin orders |
| `@anywalletkit/protocol-swap2-cctp` | Circle CCTP V2 — native USDC between EVM chains |
| `@anywalletkit/protocol-swap2-usdt0` | USDT0 — Tether’s LayerZero OFT: USDT between 16 EVM chains in one transaction |
| `@anywalletkit/protocol-swap2-uniswap` | Uniswap v3 straight from the contracts |
| `@anywalletkit/protocol-swap2-balancer` | Balancer v2, priced and enforced on-chain by the Vault |
| `@anywalletkit/protocol-swap2-fynd` | Fynd (Propeller Heads) same-chain swaps on 7 EVM chains, settled through TychoRouterV3 — Fynd outputs are under the Fynd License |
| `@anywalletkit/protocol-swap2-wrap` | Native ↔ wrapped native (ETH ↔ WETH and others) |
| `@anywalletkit/protocol-swap2-jupiter` | Jupiter — same-chain Solana swaps; the transaction is assembled and checked locally, no Jupiter fee |
## Earn
[Section titled “Earn”](#earn)
| Package | Protocol | Interface |
| ------------------------------------------------------ | ------------------------------------------------------------------------ | ----------------- |
| `@anywalletkit/protocol-staking-lido-evm` | Lido (ETH → stETH) | `StakingProtocol` |
| `@anywalletkit/protocol-staking-ssv-evm` | SSV Network | `StakingProtocol` |
| `@anywalletkit/protocol-staking-tonstakers-ton` | Tonstakers (TON → tsTON) | `StakingProtocol` |
| `@anywalletkit/protocol-staking-spl-stake-pool-solana` | SPL stake pools (Jito by default) | `StakingProtocol` |
| `@anywalletkit/protocol-staking-native-solana` | Native SOL staking to the validators your app lists (Stake program) | `StakingProtocol` |
| `@anywalletkit/protocol-staking-native-monad` | Native MON staking to the validators your app lists (staking precompile) | `StakingProtocol` |
| `@anywalletkit/protocol-lending-aave-evm` | Aave v3 | `LendingProtocol` |
| `@anywalletkit/protocol-lending-morpho-evm` | Morpho Vaults and Blue markets | `LendingProtocol` |
| `@anywalletkit/protocol-lending-mellow-evm` | Mellow Core Vaults (EarnETH / EarnUSD) | `LendingProtocol` |
| `@anywalletkit/protocol-lending-kamino-solana` | Kamino Earn vaults and Lend markets | `LendingProtocol` |
## Data and safety
[Section titled “Data and safety”](#data-and-safety)
| Package | What it does |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@anywalletkit/tx-preview-evm` | What an EVM transaction will do before it is signed: decoded calls, approvals, simulated balance changes, a verdict |
| `@anywalletkit/protocol-approvals-evm` | Discover token approvals (ERC-20 / 721 / 1155 / Permit2 / EIP-7702), flag risky ones, revoke |
| `@anywalletkit/history-evm` | Activity history for every supported EVM chain |
| `@anywalletkit/names-ens` | ENS names → the address for one chain |
| `@anywalletkit/extension-kit` | The core of a Chromium (MV3) wallet extension: encrypted vault with passkey unlock, auto-locking session, dApp request router, per-origin permissions, approval queue, signing checks; no UI. See the [Browser extension guide](/guides/extension-kit/) |
| `@anywalletkit/tokens` | Tokens users add by address: read from the chain (EVM, Solana incl. Token-2022), look-alike and issuer-power warnings, `TokensTable` over any JSON storage. See [Custom tokens](/guides/tokens/) |
| `@anywalletkit/networks` | Networks: catalog mainnets with public RPC failover lists, default testnets, user RPCs and custom networks (`NetworksTable`), per-family endpoint verification, EIP-3085 parsing |
# Quickstart
> One seed phrase → accounts on seven chains, balances, a transfer, a signature and safety policies.
This page builds a wallet on Ethereum, Base, Bitcoin, Solana, TON, Tron and NEAR from one seed phrase. Every snippet comes from [`examples/quickstart`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/quickstart) in the SDK repository, which our CI compiles and runs on every change.
## 1. Imports
[Section titled “1. Imports”](#1-imports)
```ts
import { Wallet, type Policies } from '@anywalletkit/kit'
import { getRandomSeedPhrase, isValidSeedPhrase } from '@anywalletkit/core'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerBtc } from '@anywalletkit/wallet-btc'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
import { WalletManagerTon } from '@anywalletkit/wallet-ton'
import { WalletManagerTron } from '@anywalletkit/wallet-tron'
import { WalletManagerNear } from '@anywalletkit/wallet-near'
```
## 2. Chain ids
[Section titled “2. Chain ids”](#2-chain-ids)
The SDK names chains with [CAIP-2](/concepts/chain-ids/) ids: one string format for every ecosystem.
```ts
// CAIP-2 chain ids: one string names a chain on any ecosystem.
export const ETHEREUM = 'eip155:1'
export const BASE = 'eip155:8453'
export const BITCOIN = 'bip122:000000000019d6689c085ae165831e93'
export const SOLANA = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'
export const TON = 'ton:-239'
export const TRON = 'tron:0x2b6653dc'
export const NEAR = 'near:mainnet'
```
## 3. A seed phrase
[Section titled “3. A seed phrase”](#3-a-seed-phrase)
```ts
export function newSeedPhrase(): string {
return getRandomSeedPhrase(12) // or 24
}
export function checkSeedPhrase(words: string): boolean {
return isValidSeedPhrase(words) // BIP-39 wordlist + checksum
}
```
Store it safely
The seed phrase is the user’s money. Keep it in the platform keystore (iOS Keychain / Android Keystore) behind biometrics, never in plain storage, logs or analytics.
## 4. Create the wallet
[Section titled “4. Create the wallet”](#4-create-the-wallet)
`Wallet` is the orchestrator from `@anywalletkit/kit`. Register one chain package per chain (or per chain family), each with its own RPC endpoint. Managers are built lazily, on first use.
```ts
export function createWallet(seedPhrase: string, policies?: Policies): Wallet {
const wallet = new Wallet(seedPhrase, policies ? { policies } : {})
// One EVM registration per network: each has its own RPC.
wallet.registerWallet(ETHEREUM, WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
wallet.registerWallet(BASE, WalletManagerEvm, { provider: 'https://base-rpc.publicnode.com', chainId: 8453 })
// Other ecosystems register by namespace.
wallet.registerWallet('bip122', WalletManagerBtc, {
client: { type: 'esplora-http', clientConfig: { url: 'https://mempool.space/api' } },
})
wallet.registerWallet('solana', WalletManagerSolana, { provider: 'https://api.mainnet-beta.solana.com' })
wallet.registerWallet('ton', WalletManagerTon, { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } })
wallet.registerWallet('tron', WalletManagerTron, { provider: 'https://api.trongrid.io' })
wallet.registerWallet('near', WalletManagerNear, { provider: 'https://free.rpc.fastnear.com' })
return wallet
}
```
Tip
Public endpoints are fine to start with. For production use your own RPC provider: every `provider` / `client` option also accepts a list, which fails over in order.
## 5. Addresses
[Section titled “5. Addresses”](#5-addresses)
```ts
export async function addresses(wallet: Wallet): Promise> {
const out: Record = {}
for (const chain of [ETHEREUM, BASE, BITCOIN, SOLANA, TON, TRON, NEAR]) {
const account = await wallet.getAccount(chain) // account #0; getAccount(chain, 1) for the next one
out[chain] = await account.getAddress()
}
return out
}
```
Addresses are derived on the device, with no network calls. Every EVM network shares the same address. The default derivation paths are the common ones (MetaMask on EVM, Phantom on Solana and so on), so a user who imports a seed phrase from another wallet usually finds their funds. The paths are listed in [Packages](/getting-started/packages/#chains).
## 6. Balances
[Section titled “6. Balances”](#6-balances)
Amounts are always `bigint` in the chain’s base units (wei, satoshi, lamports, nanotons…). Format them for display yourself; never do money math with floating point numbers.
```ts
export async function ethBalance(wallet: Wallet): Promise {
const account = await wallet.getAccount(ETHEREUM)
return account.getBalance() // wei, as bigint
}
export async function usdtBalance(wallet: Wallet): Promise {
const account = await wallet.getAccount(ETHEREUM)
return account.getTokenBalance('0xdAC17F958D2ee523a2206206994597C13D831ec7') // USDT, 6 decimals
}
```
## 7. Send
[Section titled “7. Send”](#7-send)
Every account has the same `transfer` call on every chain. Quote the fee first, show it to the user, then send:
```ts
export async function sendUsdt(wallet: Wallet, recipient: string, amount: bigint) {
const account = await wallet.getAccount(ETHEREUM)
const transfer = { token: '0xdAC17F958D2ee523a2206206994597C13D831ec7', recipient, amount }
const { fee } = await account.quoteTransfer(transfer) // network fee in wei, nothing is signed
console.log('fee', fee)
const { hash } = await account.transfer(transfer) // simulate → sign → broadcast
const receipt = await account.getTransactionReceipt(hash) // undefined until mined
return { hash, receipt }
}
```
`transfer` simulates the transaction before signing it. A transaction that would revert is refused before anything is signed.
## 8. Sign a message
[Section titled “8. Sign a message”](#8-sign-a-message)
```ts
export async function signIn(wallet: Wallet, message: string) {
const account = await wallet.getAccount(ETHEREUM)
const signature = await account.sign(message) // EIP-191 personal_sign
const valid = await account.verify(message, signature)
return { signature, valid }
}
```
## 9. Policies
[Section titled “9. Policies”](#9-policies)
Policies run before **every** signature and broadcast, including those made by protocol modules (swaps, staking…) through the same account. Pass them when you create the wallet:
```ts
export const policies: Policies = {
// Refuse any Ethereum write whose quoted fee is above 0.005 ETH.
maxFee: { [ETHEREUM]: 5_000_000_000_000_000n },
// Never send to these addresses.
blocklist: { [ETHEREUM]: ['0x000000000000000000000000000000000000dEaD'] },
// The last word before anything is signed: show your confirmation sheet here.
confirm: async (intent) => {
console.log(`${intent.method} on ${intent.chain} → ${intent.to ?? 'contract'}`)
return true
},
}
```
```ts
const wallet = createWallet(seedPhrase, policies)
```
More in [Policies](/concepts/policies/).
## 10. Clean up
[Section titled “10. Clean up”](#10-clean-up)
`wallet.dispose()` overwrites the seed and every derived key in memory with zeros. Call it when the wallet locks or the user signs out, and build a new `Wallet` when they unlock.
```ts
wallet.dispose()
```
## Try it on a testnet
[Section titled “Try it on a testnet”](#try-it-on-a-testnet)
The same code runs on a testnet: register the testnet’s chain id with its RPC and `chainId`, and fund the address from a faucet.
```ts
wallet.registerWallet('eip155:11155111', WalletManagerEvm, { provider: 'https://sepolia.drpc.org', chainId: 11155111 }) // Sepolia
const account = await wallet.getAccount('eip155:11155111')
await account.getAddress() // the same address as on mainnet: fund it from a Sepolia faucet
```
Base Sepolia, Arbitrum Sepolia, OP Sepolia, Polygon Amoy, BSC and Monad testnets work the same way. The [Networks](/guides/networks/#testnets) table ships every supported testnet (Solana devnet, Bitcoin testnet4, TON testnet, Tron Nile, NEAR testnet too) switched off, with its RPC list; show a clear “testnet” badge in the UI whenever one is on.
# Upgrading
> What to change in your app when you move to a new Any Wallet Kit release — the latest security releases first.
Versions are `0.x`, so a minor release may change the API. A `^0.y` range never picks up the next minor release by itself: you take these changes when you bump. Each package’s CHANGELOG lists its changes; the lines marked **Breaking** are the ones that need something from you. This page groups them by what your app does.
## 2026-10-30: the re-audit fixes
[Section titled “2026-10-30: the re-audit fixes”](#2026-10-30-the-re-audit-fixes)
A re-audit of the 2026-10-30 release found five more issues; all are fixed. Only the TON one can change what your app sees.
* **TON: a gateway error on a send is “maybe sent”.** `wallet-ton` used to read any JSON error from an endpoint as the node’s refusal. A gateway’s JSON 502 / 504 / 408 or an empty `{}` after the node had taken the message surfaced as a plain `NetworkError`, so a retry could pay twice. Now only toncenter’s refusal envelope (`{ok: false, error}` outside 408/502/503/504, not a timeout) is a refusal; anything else throws `BroadcastUnknownError` (`maybeSent: true`, `hash`). Handle it as for EVM: tell the user to check Activity before sending again, track the hash, never resend by itself.
* **USDT0 remote quotes are bound to the requested tokens.** `usdt0VerifyQuote` now requires both the source and the destination token to be the deployment’s USDT / USDT0. Honest routes are unchanged.
* **Fynd remote quotes are same-chain only.** `fyndVerifyQuote` refuses a request whose destination chain differs from the source chain.
* **Policies: a class prototype is read as it was.** The snapshot of a write keeps a class prototype (so `instanceof` and methods work) but no longer sees fields or methods added to it after the snapshot.
* **`verifyNetwork` caps an answer at 1 MiB** (`MAX_RESPONSE_BYTES`); a larger one fails with `too-large: …`.
## 2026-10-30: the scan fixes
[Section titled “2026-10-30: the scan fixes”](#2026-10-30-the-scan-fixes)
This release fixes all 19 findings of the external scan of 2026-10-30 and makes Jito-style SPL stake-pool delayed exits work under the default Solana guard again. The sections below are grouped by area.
### Policies, snapshots and EVM nonces
[Section titled “Policies, snapshots and EVM nonces”](#policies-snapshots-and-evm-nonces)
This release fixes six findings of the 2026-10-30 scan in `kit` and `wallet-evm`.
#### Allowance increases are approvals (`kit`)
[Section titled “Allowance increases are approvals (kit)”](#allowance-increases-are-approvals-kit)
A raw `increaseAllowance(spender, x)` or `increaseApproval(spender, x)` call reaches `confirm` as `kind: 'approval'` with the spender in `to` and the increase in `amount` (it was a `send` to the token, and `increaseApproval`’s spender was never checked by the lists). Show it like an approve.
#### Permit2 is read through its declared schema (`kit`, `wallet-evm`)
[Section titled “Permit2 is read through its declared schema (kit, wallet-evm)”](#permit2-is-read-through-its-declared-schema-kit-wallet-evm)
The Permit2 approval `confirm` sees — `approvals`, `token`, `amount`, `unlimited`, `to`, `deadline` — comes only from fields the typed data declares, as Permit2 signs them. A payload whose schema is not Permit2’s (a missing or retyped `details` / `permitted`, both declared, a list where one entry belongs) reaches `confirm` as the worst case: `unlimited: true`, `approvals: []`; one without a declared `spender` has an unknown destination, so an allowlist refuses it. `describeTypedData` flags such a payload `approve-unlimited`. Canonical Permit2 payloads from Uniswap, 1inch and other dApps read as before.
#### Case-sensitive addresses are compared exactly (`kit`)
[Section titled “Case-sensitive addresses are compared exactly (kit)”](#case-sensitive-addresses-are-compared-exactly-kit)
Allowlist and blocklist entries for Solana (and Bitcoin / Zcash base58, and any namespace without its own rule) must be spelled exactly as the address: they were compared lowercased, which let a different Solana key that differs only in letter case pass an allowlist. EVM, NEAR, Aptos and Starknet entries still match in any case, bech32 Bitcoin / Zcash addresses in either case, Tron and TON in any of their forms. If your lists hold lowercased Solana keys, store them as the wallet shows them.
#### `nonce too low` from one RPC is not re-signed (`wallet-evm`)
[Section titled “nonce too low from one RPC is not re-signed (wallet-evm)”](#nonce-too-low-from-one-rpc-is-not-re-signed-wallet-evm)
A send whose transaction the node refuses with “nonce too low”, and whose hash it says it never saw, was signed again with the next nonce. The RPC that refused already holds the first signed bytes, so a lying RPC could broadcast both. Now the account signs again only when at least two distinct configured RPCs show the nonce mined by another transaction. Otherwise the send throws `NonceConflictError` — a `BroadcastUnknownError` (`maybeSent: true`, `hash`), with `nonce` and the node’s `nextNonce`. Apps should show “the network didn’t confirm — check activity, then retry”: keep the operation pending on `hash`, and let the user send again once activity shows the first transaction is not coming; the account’s next send already skips the refused nonce. With one RPC configured, a stale `pending` nonce now costs one retry instead of being fixed silently; configure two RPCs to keep the automatic recovery.
### Remote swap pins
[Section titled “Remote swap pins”](#remote-swap-pins)
* **THORChain memo.** `thorchainPins().verifyBuild` refuses a remote build whose memo is not exactly the canonical memo for the request (output asset, destination/refund, limit, affiliate). Your server’s `thorchainProvider` already builds that memo; nothing to wire.
* **CCTP burn decoded on the device.** `cctpPins` carry `verifyQuote` (`cctpVerifyQuote`): a remote `depositForBurn` must burn exactly the input of the source USDC for the recipient on the requested domain, with no destination caller and a `maxFee` that leaves the quoted minimum. Spread the pins as before.
* **USDT0 send decoded on the device.** `usdt0Pins` carry `verifyQuote` (`usdt0VerifyQuote`): the OFT `send` must go to the requested chain’s eid and recipient, move exactly the input with a `minAmountLD` that keeps the quoted minimum, carry no options or compose message, refund the trader, and attach the declared native fee. Spread the pins as before.
* **Wrap call checked on the device.** `wrapPins` carry `verifyQuote` (`wrapVerifyQuote`): only `deposit()` with the input as value, or `withdraw(input)` with no value, on the chain’s wrapped native, for the sender.
* **LI.FI Diamond call decoded on the device.** `lifiPins` carry `verifyQuote` (`lifiVerifyQuote`): the same calldata check the server’s provider runs on LI.FI’s answer — receiver, minimum, input, output token, destination chain — runs again in the app, with the input’s value and approval. Checked against live LI.FI answers on 32 corridors (every route the provider accepts passes).
* **Breaking: a pinned call needs a check of the call.** A remote stub’s EVM calldata route — a call on a contract its `callTargets` pin — now also needs the app’s own check of what the call does: `verifyQuote` or `verifyBuild` on `remoteProvider`. Without either, the router and the single-provider path drop the route with the reason, and the engine refuses it. Every shipped EVM pins export carries one (`lifiPins`, `cctpPins`, `usdt0Pins`, `wrapPins`, `uniswapPins`, `balancerPins`, `fyndPins`, `chainflipPins`; `thorchainPins()` checks builds), so spreading the pins is enough. If you build `callTargets` by hand, pass a `verifyQuote` or `verifyBuild` that decodes the call against the request. Omniston: keep adding `verifyBuild: omnistonVerifyBuild(...)` next to `...omnistonPins(...)` — `omnistonPins` alone has no check, and the app-supplied `verifyBuild` satisfies this rule. NEAR Intents (`nearIntentsPins`) and Jupiter are not affected: they pin no EVM call targets.
### Omniston
[Section titled “Omniston”](#omniston)
* **TON → TON swaps need `validateTonSwapLeg`.** Same-chain TON swaps are advertised and built only with `validateTonJettonWallet`, `validateTonSwapTarget` and `validateTonSwapLeg`: the leg check is what proves the DEX pays out the quoted token. A server that builds Omniston locally and wires the TON validators one by one loses TON → TON routes until it passes the leg check too — use `createOmnistonTonValidators()` whole (`omnistonProvider({...createOmnistonTonValidators(), ...})`). On the device, `omnistonVerifyBuild` refuses a TON swap body without `validateTonSwapLeg`; spreading `createOmnistonTonValidators()` into it, as the guide shows, already passes it. `tonSwapPayloadCheck: "report"` keeps building without it as an explicit, temporary opt-in.
* **FULLY_FILLED needs proof.** `trackIntent` reports an Omniston order `completed` only once every execution’s secret was disclosed or a delivery locator (`locateEvmDelivery`, `locateTonDelivery`) found the payout; a feed that says FULLY_FILLED without that stays `pending` and keeps its secrets. Keep polling pending orders and keep your refund backstop as before; an order that never shows a disclosure or a delivery is closed by TTL or by the backstop, not by the feed.
* **Intent ids carry the quote’s digest.** An Omniston intent id now ends its dest segment with `#` of the quote’s terms, and a build whose cached quote differs refuses with “quote was replaced — request a fresh quote”; a reused quote id with other terms is refused at quote time. Quotes issued by the previous version (no digest) are refused on build with “request a fresh quote” — a quote is valid for under a minute, so only a quote taken right across the deploy is affected; re-quote. Orders already signed keep being tracked and disclosed. If your code splits the id, strip `#…` from the dest segment; the quote id, trader and source chain segments are unchanged.
### Chain packages
[Section titled “Chain packages”](#chain-packages)
* **NEAR AddKey permissions are exactly one variant.** `wallet-near` refuses an AddKey whose permission is not exactly `{ fullAccess: {} }` or `{ functionCall: { receiverId, methodNames, allowance? } }` (`malformed-action`); it used to encode anything else as FullAccess. Keys built from the documented shapes are unchanged.
* **Tron history fails instead of hanging on a malformed page.** `listActivity` throws `HistoryUnavailableError` when a TronGrid row’s `block_timestamp` is not a non-negative integer; it used to loop forever. Handle it like any other history outage.
* **Tonstakers derives the tsTON jetton wallet.** The unstake destination is computed on the device from the minter’s pinned wallet code and must match the node’s `get_wallet_address`. The default mainnet and testnet deployments need nothing. With a custom `addresses.jetton`, pass that minter’s `jettonWalletCode`, or `allowUnverifiedJettonWallet: true` to keep the old unchecked behaviour.
* **SPL stake-pool delayed exits reclaim pre-funded slots.** When someone sent SOL to the wallet’s next delayed-exit slot address, the exit transaction now starts with a System `TransferWithSeed` that returns that SOL to the wallet. A signing review shows one extra incoming transfer; nothing to change in the app.
* **SPL stake-pool delayed exits sign with the default Solana guard.** `wallet-solana` refused every delayed exit (`requestWithdrawal({ mode: 'delayed' })`, e.g. Jito) with `sets-authority` (“funds stake account … without making this wallet its staker and withdrawer”) unless `allowAuthorityChanges` was set. It now takes a stake account the wallet funds as the wallet’s when an SPL Stake Pool `WithdrawStake` in the same transaction splits into it and names this wallet as the user stake authority. Nothing to change in the app; drop any `allowAuthorityChanges` you set to work around it. Any other authority or program is refused as before.
### Endpoint checks and CCIP-Read gateways
[Section titled “Endpoint checks and CCIP-Read gateways”](#endpoint-checks-and-ccip-read-gateways)
This release fixes findings of the 2026-10-30 scan in `@anywalletkit/networks` and `@anywalletkit/names-ens`.
* **`verifyNetwork` refuses redirects.** An endpoint that answers through a redirect fails with `redirected: Endpoint redirected to ; enter the final URL` — the URL policy judged the address that was entered, not where it points. Ask the user for the final URL. A custom `fetch` that cannot refuse redirects (it gets `redirect: 'error'`) should report `url` or `redirected` on the response. `http-` and `bad-json` errors no longer carry body text.
* **Answer the site generically.** When a site’s `wallet_addEthereumChain` endpoint fails the check, answer `{ code: -32603, message: "The network's RPC failed the check." }`; show `result.error` on the user’s own screen only.
* **CCIP-Read answers are capped on the device.** `ensCcipRequest` (behind `ensResolver({ rpcUrl })`) reads a gateway’s answer to at most 1 MiB and gives each gateway 10 s for the request and the whole answer: `ccip: { maxResponseBytes, timeoutMs }`. Real answers are a few KB; nothing to change unless you lowered your own limits.
* **On Node, CCIP-Read gateways go through the pinned transport.** With no `ccip.fetch`, `ensResolver({ rpcUrl })` on Node asks gateways the way `createEnsCcipHandler` does: DNS answers checked, the connection pinned. A gateway host that resolves to a private address — or mixes public and private records — is refused. Behind a corporate split-horizon DNS or an outbound proxy, pass `ccip: { fetch }`. Browsers are unchanged (no DNS-level check there; use `ensCcipViaProxy` where it matters); React Native is unchanged.
## 2026-10-29: remote swaps checked on the device
[Section titled “2026-10-29: remote swaps checked on the device”](#2026-10-29-remote-swaps-checked-on-the-device)
This release fixes four findings of the 2026-10-28 scan in `remoteProvider` setups. If you run swaps through your own server:
* **Pins now open the call.** `uniswapPins` and `balancerPins` carry `verifyQuote` (`uniswapVerifyQuote`, `balancerVerifyQuote`): the router or Vault call is decoded on the device and must be exactly the swap the user asked for — tokens, input, minimum, recipient. `chainflipPins` carry `chainflipVerifyQuote`. Spread the pins as before; nothing else to wire.
* **Deposit-address routes need an opt-in.** A remote stub’s route that pays an address the server names — a deposit address or a plain value send — is refused unless the stub has `depositAddressRoutes: true`. `nearIntentsPins`, `thorchainPins()` (Tron) and `chainflipPins` (Tron) set it; add `...nearIntentsPins` to your NEAR Intents stub.
* **Remote typed orders need `verifyBuild`.** The engine signs a remote EIP-712 order only after the stub’s `verifyBuild` ran. `omnistonVerifyBuild` now opens Omniston’s EVM orders too, with the order extension the server’s build carries: deploy the new server before the new app, or remote EVM → TON and EVM → EVM orders are refused.
## 2026-10-29: the audit fixes
[Section titled “2026-10-29: the audit fixes”](#2026-10-29-the-audit-fixes)
This release fixes three findings of the 2026-10-29 external audit.
### The signer is no longer a property of an account
[Section titled “The signer is no longer a property of an account”](#the-signer-is-no-longer-a-property-of-an-account)
Every chain account (`wallet-evm`, `-solana`, `-ton`, `-tron`, `-btc`, `-near`, `-zcash`) keeps its signer in a private field. `account.signer` is `undefined` now, on the accounts your app gets too, and `LocalSigner` has no `key()` method at runtime. A protocol module always gets the policy wrapper, even on a `Wallet` without `policies`; without them the wrapper applies no limits.
What to change:
* `account.signer.kind` → `account.signerKind` (`'seed' | 'key' | 'external'`);
* `account.signer.publicKey` → `account.publicKey`;
* an injected `Signer` you need later: keep your own reference to it;
* tests that patched `account.signer.sign` to count signatures: spy on your own external signer, or on `LocalSigner.prototype.sign`;
* do not compare a module’s account with `wallet.getAccount(chain)` by identity: it is a wrapper.
### `setProtection` reports an old copy it could not remove
[Section titled “setProtection reports an old copy it could not remove”](#setprotection-reports-an-old-copy-it-could-not-remove)
`@anywalletkit/secure-storage-react-native` used to ignore a failed delete of the old copy after it rewrote a secret. `setProtection(id, 'biometricsOnly')` resolved, `info` and `list` said strict mode, and the old `biometricsOrPasscode` copy stayed in the Keychain.
Now:
* `setProtection` and `set` reject with `SecureStorageError` code `stale-copy` when the new copy is stored but the old one could not be removed;
* `info` and `list` report the weakest protection among the copies still stored;
* the store retries the removal on its next operation, on first use after a restart and in `prune` (which rejects with `stale-copy` if a copy still stays).
What to change: catch `stale-copy` where you call `setProtection` and do not show strict mode as on. Offer a retry: calling `setProtection` again removes the old copy without another sheet. After `set`, `stale-copy` means the new secret is stored, so do not roll back the account.
### Permit calls in the transaction preview
[Section titled “Permit calls in the transaction preview”](#permit-calls-in-the-transaction-preview)
`@anywalletkit/tx-preview-evm` decodes the calls that grant an allowance without `approve`: an EIP-2612 `permit()` call (the token is the target), Permit2 `permit()` single and batch (the token is inside the struct) and `increaseApproval`. They now carry `approval`, with the usual `approval-unlimited` and `approval-unknown-spender` warnings. A Permit2 batch lists every allowance in the new `approvals` field. A permit body whose arguments can’t be read gives the new `approval-unparsed` warning.
What to change: if your review screen maps check codes to text, add `approval-unparsed`. If it shows `approval`, show every entry of `approvals` when it is set.
## 2026-10-29: names, typed data, Solana and URLs
[Section titled “2026-10-29: names, typed data, Solana and URLs”](#2026-10-29-names-typed-data-solana-and-urls)
This release fixes the 2026-10-28 scan. Four changes can need something from you: offchain ENS names on React Native, typed-data signatures under policies, Solana transactions that create token accounts, and URLs with a backslash.
### ENS on React Native (`names-ens`)
[Section titled “ENS on React Native (names-ens)”](#ens-on-react-native-names-ens)
React Native’s fetch follows a redirect whatever `redirect: 'error'` says, so an offchain name’s gateway could redirect the device to a host on the user’s network. There, the resolver no longer asks gateways with the global fetch. **Offchain names (`cb.id`, Basenames, `uni.eth` subnames) fail with `lookup-failed`** until you set `ccip`. The error’s `reason` is `ccip-proxy-required` and its message says what to set. Browsers, extensions and Node are unchanged.
The safe fix is one route on your server with the new `createEnsCcipHandler`, and the new `ensCcipViaProxy` in the app:
```ts
// server (Node), behind your auth and rate limits
import { createEnsCcipHandler } from '@anywalletkit/names-ens/server'
const ccip = createEnsCcipHandler()
// POST /ccip: const out = await ccip(JSON.parse(rawBody)); reply out.status with JSON out.body
// app
import { ensCcipViaProxy, ensResolver } from '@anywalletkit/names-ens'
const ens = ensResolver({
rpcUrl: ETHEREUM_RPC,
ccip: { fetch: ensCcipViaProxy('https://api.example.com/ccip', { headers: { authorization: `Bearer ${token}` } }) },
})
```
* **The server route** asks only https gateways on public hosts, checks every address the host resolves to, connects to the checked one, and never follows a redirect. See [Names](/guides/names/#react-native) and the reference server’s `POST /ccip`.
* **Without a server**, `ccip: { allowRedirectFollowingFetch: true }` brings direct lookups back and accepts that a redirecting gateway can make the device send one blind request.
* **Your own viem `client`:** pass the same options as `ccipRead: createEnsCcipRead({ … })`.
* **A 3xx answer is never used**, on every runtime.
### Policies and typed data (`kit`)
[Section titled “Policies and typed data (kit)”](#policies-and-typed-data-kit)
The policies now read typed data that moves value by itself:
* EIP-3009 `TransferWithAuthorization` / `ReceiveWithAuthorization` is a `send` to `to`, with the verifying contract as the token and `value` as the amount;
* an ERC-2771 `ForwardRequest` and a `MetaTransaction` are judged by the call they make;
* a 1inch LOP `Order` (the Omniston EVM order) by its settlement contract, and by a `receiver` other than the maker.
What this changes:
* **Under an allowlist,** these signatures need their destinations on the list. Typed data the policies cannot read is refused: it is `kind: 'typedData'` with `destinationUnknown: true`.
* **Under a blocklist,** unreadable typed data is refused unless you have a `confirm` hook, which then sees `destinationUnknown: true`.
* **A blocklisted verifying contract** is refused for all typed data, Permit and Permit2 included. The new `WriteIntent.verifyingContract` carries it.
* **`WriteIntent.message`** is now `false` for every `signTypedData`.
See [Policies](/concepts/policies/).
### Solana token accounts the transaction creates (`wallet-solana`)
[Section titled “Solana token accounts the transaction creates (wallet-solana)”](#solana-token-accounts-the-transaction-creates-wallet-solana)
The guard that simulates what a program does by CPI now also watches token accounts the transaction creates, such as an associated token account made with `CreateAssociatedTokenIdempotent`.
* A transaction that leaves a close authority or another owner on a token account of this wallet that it creates, or a delegate allowance no top-level `Approve` shows, is refused with `UnsafeTransactionError` (`sets-authority` / `approves-delegate`).
* Creating this wallet’s associated token account for another owner is refused.
* `allowAuthorityChanges` still overrides the guard, for example for a token launch.
* `checkSerialized` asks the simulation only for accounts of the transaction. An address outside it keeps its pre-state.
### URLs with a backslash (`networks`)
[Section titled “URLs with a backslash (networks)”](#urls-with-a-backslash-networks)
A WHATWG parser (browsers, Node, the extension) and OkHttp end a host at `\` and drop tabs and line breaks, so `https://192.168.1.1\admin` was checked as one host and fetched from another. Now a URL with `\`, a tab, CR, LF or another control character anywhere is refused:
* `checkRpcUrl` answers `not-a-url`;
* `isPublicHttpsUrl` answers `false`;
* a site’s `rpcUrls` entry in `wallet_addEthereumChain` is dropped;
* ENS gateway and avatar URLs with one are not used.
If you store user-entered RPC URLs, a saved one with a backslash no longer passes: ask the user to enter it again.
## 2026-10-28: the modules security release
[Section titled “2026-10-28: the modules security release”](#2026-10-28-the-modules-security-release)
This release fixes the second 2026-10-27 security scan: 37 findings in the protocol modules. Most of the changes are stricter checks, so input that used to pass is now refused. Go through the sections for the packages you use.
### Swaps through your own server (`remoteProvider`)
[Section titled “Swaps through your own server (remoteProvider)”](#swaps-through-your-own-server-remoteprovider)
#### Pins
[Section titled “Pins”](#pins)
A remote provider now takes the contracts its calldata may call and approve from your app, never from your server. Without pins it gets **no EVM calldata route at all**. Jupiter’s Solana transactions need no pins; deposit-address routes such as NEAR Intents need `depositAddressRoutes` since the next release (above). Every other provider package exports its pins:
```ts
import { remoteProvider } from '@anywalletkit/protocol-swap2-core/remote'
import { lifiPins } from '@anywalletkit/protocol-swap2-lifi'
import { thorchainPins } from '@anywalletkit/protocol-swap2-thorchain'
import { chainflipPins } from '@anywalletkit/protocol-swap2-chainflip'
import { omnistonPins, omnistonVerifyBuild } from '@anywalletkit/protocol-swap2-omniston'
import { AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS, createOmnistonTonValidators } from '@anywalletkit/protocol-swap2-omniston/validators'
const PINS = {
lifi: lifiPins,
chainflip: chainflipPins,
// Exactly your server's THORChain affiliate and affiliateBps: the memo must carry both as configured
// there. If your server has no affiliate, use thorchainPins().
thorchain: thorchainPins({ affiliate: 'your-affiliate', affiliateBps: '30' }),
// integratorAddress: only if your server's Omniston provider sets one. It is the only referral a TON
// swap body may name.
omniston: {
...omnistonPins(AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS),
verifyBuild: omnistonVerifyBuild({ ...createOmnistonTonValidators(), integratorAddress: null }),
},
}
const remote = (name: string) => remoteProvider({ name, baseUrl: 'https://api.example.com/swap2', ...PINS[name as keyof typeof PINS] })
```
The other pins are:
* `fyndPins`: it carries `verifyQuote: fyndVerifyQuote`, so the quote is also checked on the device;
* `cctpPins`, with its `claimTargets`;
* `uniswapPins`, `usdt0Pins`, `balancerPins` and `wrapPins`.
The reference server’s client shows the whole wiring: [Ship a wallet](/build-a-wallet/ship-a-wallet/).
#### The server address
[Section titled “The server address”](#the-server-address)
`baseUrl` must be https, or a same-origin path such as `/api/swap2`. Leading spaces and scheme-relative values (`//host/…`) are refused too. For a server on your own machine during development, pass `allowInsecureBaseUrl: true`.
#### Typed orders
[Section titled “Typed orders”](#typed-orders)
Typed data is signed only when it is the swap’s own order. That means an EIP-712 `Order` that is:
* from the user;
* selling the source token, exactly the input;
* on the swap’s chain, to the approval address.
A permit, or any other message from a provider, is refused.
#### TON swaps
[Section titled “TON swaps”](#ton-swaps)
* **Attached TON.** A TON message may attach at most the input plus the gas ceiling; for a jetton source, the ceiling alone. The ceiling is 1 TON by default. Change it on the swap engine, for example `new RouterSwap2Protocol(account, { …, tonGasCeiling })`, not on `remoteProvider`.
* **Jetton source.** It must be a plain TEP-74 transfer of exactly the input to your own jetton wallet, so **the TON signer must have `getJettonWalletAddress`**.
* **Server-built bodies.** A TON cell body built by your server is refused unless the app checks it (`verifyBuild`; for Omniston, `omnistonVerifyBuild({...createOmnistonTonValidators()})`). It checks TON → TON swap bodies and, from omniston 0.3.1, TON → EVM escrow bodies too (`verifyTonEscrowBuild`). On 0.3.0 a remote TON → EVM build was refused: upgrade to 0.3.1, and if you turned the route off with a `supportsRoute` filter, turn it back on.
#### Omniston quote store
[Section titled “Omniston quote store”](#omniston-quote-store)
If Omniston runs on your server, give your durable quote store a `claim(quoteId, json)` that writes only if nothing is stored yet (Redis `SET NX`). Without it, two server instances can race on one quote id.
### Swap providers in your own process
[Section titled “Swap providers in your own process”](#swap-providers-in-your-own-process)
#### Every provider
[Section titled “Every provider”](#every-provider)
When the swap call is itself a token call (`transfer`, `approve`, `increaseAllowance`), it may only move the source token, by at most the input. It may only pay the user, the deposit address or the declared spender.
These are refused as the swap call:
* an operator approval (`setApprovalForAll`);
* a Permit2 approval;
* a `transferFrom`;
* calldata that is not hex bytes.
Valid hex that calls an unknown function still goes through as a plain contract call. A router’s calldata is not decoded by this check: each provider checks its own targets.
#### LI.FI
[Section titled “LI.FI”](#lifi)
* `apiUrl` must be https; `allowInsecureApiUrl` allows a local mock.
* On an EVM source, every step of the Diamond call is checked:
* steps must chain;
* only the input token may be deposited;
* a bridge without source swaps must bridge the input, less at most 1 % (its `minAmount`). What arrives on the destination is still LI.FI’s figure.
#### THORChain
[Section titled “THORChain”](#thorchain)
* **A second node confirms the vault.** The inbound vault must be confirmed by a second node, at quote time and before broadcast. The second node is any node other than the one that quoted.
* **The default nodes** are Liquify (`https://gateway.liquify.com/chain/thorchain_api`) and IBS (`https://thorchain.ibs.team/api`). They are run by different operators.
* **With one configured `nodeUrl`**, the default nodes confirm it, unless `confirmNodeUrl` names another node; if you name your own, pick one of another operator. A quote is refused when no second node answers, or when one reports another vault or router. For a local mock, name a second mock in `confirmNodeUrl`, because the public nodes report another vault.
* **https only.** Nodes must be https; `allowInsecureNodeUrl` allows a local mock.
* **Routers are pinned per chain.** Pass `trustedRouters` if THORChain migrates its router before you upgrade.
#### Jupiter, Balancer and Fynd
[Section titled “Jupiter, Balancer and Fynd”](#jupiter-balancer-and-fynd)
* **Jupiter:** every instruction of a `/build` transaction besides the swap must have one of the expected shapes. Anything else is refused.
* **Balancer:** `preflightDeposit` refuses calldata that is not the quote’s own batch.
* **Fynd:** `preflightDeposit` refuses a transaction whose target, calldata or value differs from the quote’s.
Pass the transaction `buildDeposit` returned, unchanged.
### Earn
[Section titled “Earn”](#earn)
#### Kamino
[Section titled “Kamino”](#kamino)
Upgrade `@anywalletkit/wallet-solana` together with the Kamino module.
* **Chain reads.** Writes and their quotes (`supply`, `withdraw`, `borrow`, `repay` and every `quote…` call) need an account that can read accounts from the chain (`getAccountInfos`), because the module checks the API’s figures against the chain. Reads do not.
* **Vaults.** On a vault write or quote, an API `tokensPerShare` more than 1 % away from the share price computed on chain is refused.
* **Lend `'max'`.** It is refused when the API reports a deposit or debt more than 1 % away from the obligation’s. APYs and other reads are still the API’s.
* **`WITHDRAW_ALL`.** It is deprecated, and Kamino’s API now refuses it (above u64). To withdraw everything, use the vault’s `withdraw({ amount: 'max' })`, which sends the exact share count read from the chain.
#### Mellow
[Section titled “Mellow”](#mellow)
* **Vaults picked with `preset`** work as before. A queue Mellow adds after this release needs a package update or `config.queues`.
* **Any other vault needs `config.queues`**: the deposit and redeem queues you expect. That includes a preset’s vault passed only by address as `vault`; pass `preset` for it instead.
* **No queue is trusted on the RPC’s word.** Deposits, redemptions, `cancelSupply`, `claimShares` and `claimWithdrawals` go only to a pinned queue.
### Approvals
[Section titled “Approvals”](#approvals)
#### `isRevokeTransaction(tx, { targets })`
[Section titled “isRevokeTransaction(tx, { targets })”](#isrevoketransactiontx--targets-)
* Without `targets`, only a Permit2 `lockdown` counts as a revoke.
* Pass the approvals your scan returned, a `Map` from address to standard, or a plain object from address to standard (`RevokeTargets`).
* `approve(spender, 0)` is a revoke only on an ERC-20. On an ERC-721 the same call approves `spender` for token #0. A bare address list no longer makes it one.
* It never throws.
#### `revoke()` / `revokeAll()`
[Section titled “revoke() / revokeAll()”](#revoke--revokeall)
* **ERC-165 first.** An `'erc20'` revoke first asks the token for ERC-165 (one `eth_call`, with CCIP-Read off), so it needs the protocol’s provider (`config.provider` or the account’s). Without one it is refused (`provider-required`).
* **Outcomes:**
* an ERC-721 is refused (`invalid-approval`);
* a token without ERC-165 (the call reverts) is revoked as before;
* a read that fails sends nothing (`source-failed`).
* **`revokeAll()`** applies this per approval: a refused one comes back as that approval’s `error`, and the others still go out.
* **`buildRevokeTransaction()`** does not check. Run your own ERC-165 read before you batch its output.
### Extension kit
[Section titled “Extension kit”](#extension-kit)
* **Method names.** The relay drops a request whose `method` is not a method name: letters, digits and `_`, at most 128 characters (`isRelayMethod`). Reject such a request in your injected provider with `-32600`, so the page gets an answer instead of a promise that never settles.
* **`setSecret` refuses a key that does not open the vault’s secrets** (`locked`). A vault that holds no secret yet has nothing to check the key against, so the first `setSecret` after `create`, or after the last secret is deleted, must get the key that `create` or `rotateVaultKey` returned. After the new `vault.rotateVaultKey(password)`, hand the returned key to `session.unlock`.
* **Re-keying.** `changePassword` keeps the same vault key. After a suspected compromise, offer `rotateVaultKey`. It drops the passkeys, so ask the user to add them again: see [Extension kit](/guides/extension-kit/).
* **`wallet_addEthereumChain`.** A site’s RPC URL is kept only when it is https on a public host (`isPublicHttpsUrl`).
### Names, tokens and networks
[Section titled “Names, tokens and networks”](#names-tokens-and-networks)
#### ENS
[Section titled “ENS”](#ens)
* **Your own client.** If you pass your own viem `client` to `ensResolver`, create it with `ccipRead: ensCcipRead`. With viem’s default, an offchain name’s resolver chooses URLs the device fetches, including addresses on the user’s network. See [Names](/guides/names/).
* **https avatars on a public host** come back as written, without a fetch.
* **`ipfs://` avatars** come back through `ipfsGateway`: an origin (`/ipfs/` is appended) or a prefix ending in `/ipfs/`.
* **Every other avatar now comes back `null`:** NFT avatars, and `http://`, `data:`, `ipns://` and `ar://` ones. Show your placeholder.
#### Tokens
[Section titled “Tokens”](#tokens)
* **Length.** A user token’s symbol is stored trimmed and cut to 32 characters, and its name to 128. Longer stored symbols are cut when the table loads.
* **Look-alikes.** The check now also folds ASCII look-alikes (“DAl” reads as DAI) and spacing accents.
* **`odd-characters` at `danger`** applies when a symbol has:
* any letter of a script whose letters pass for Latin ones: Cyrillic, Greek, Armenian, Cherokee and others, the whole script (`ЖЛБ` too);
* small capitals, Roman numerals, enclosed or math letters;
* characters that hide in text: zero-width, bidi, controls, line breaks, tag characters.
Emoji (™ included), CJK, other scripts and accented Latin stay a `caution`.
#### Networks
[Section titled “Networks”](#networks)
`isPrivateHost` now also treats these as private:
* IPv4 in every ASCII spelling a URL parser accepts (`127.1`, `2130706433`, `0x7f.0.0.1`);
* any host that is not printable ASCII, which a URL parser would map to ASCII (`127.0.0.1`);
* CGNAT and link-local ranges;
* all of 0/8, 192.0.0/24, the 198.18/15 benchmark range, multicast and reserved addresses (224/4 and up);
* a numeric host that is no valid IPv4 (`256.1.1.1`);
* IPv6 addresses that carry a private IPv4 one (IPv4-mapped `::ffff:…`, IPv4-compatible, NAT64 `64:ff9b::…`, 6to4 `2002::…`), IPv6 multicast, and hosts with `%` (an IPv6 zone);
* `*.internal`, `*.home.arpa` and `*.lan`.
What this changes:
* **`checkRpcUrl`** reports them as `local`. http to them is accepted behind `allowHttpLocal`; it used to be refused as `http-not-local`. https is accepted as before.
* **`parseAddChainParams`** now drops a site’s RPC URL on them, https included, unless `allowHttpLocal` is on.
* **For your own fetches,** use the new `isPublicHttpsUrl`. Import it from `@anywalletkit/networks/url`, together with `isPrivateHost`, `checkRpcUrl` and `parseUrl`, to leave the catalog out: the package root loads it.
* **CCIP-Read is off** in the viem clients the SDK creates (wallet-evm and the protocol modules; names-ens has its own filter). A contract’s `OffchainLookup` revert, such as a spam token’s, no longer makes the device fetch the URLs it names.
# Approvals
> Find every token approval an account has granted, flag the risky ones, and revoke them one by one or all at once.
Every swap, bridge and lending deposit leaves an approval behind: a contract that may move the user’s tokens later. The approvals module finds them, flags the risky ones and revokes them through the account, so the user can answer “who can spend my USDC?” in your app.
| Standard | What it is | How it is revoked |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------- |
| `erc20` | Token allowance (`approve`) | `approve(spender, 0)` |
| `erc721-token` | One NFT approved to one address | `approve(0x0, tokenId)` |
| `erc721`, `erc1155` | Operator over a whole collection (`setApprovalForAll`) | `setApprovalForAll(operator, false)` |
| `permit2` | Uniswap Permit2 allowance | Permit2 `lockdown`, several in one transaction |
| `eip7702` | The account’s EIP-7702 delegation | A type-4 transaction (`revokeDelegation`) |
The module is EVM only for now. Snippets come from [`examples/approvals`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/approvals), which our CI typechecks and tests.
```sh
npm install @anywalletkit/protocol-approvals-evm
```
## Set up
[Section titled “Set up”](#set-up)
```ts
import { Wallet, type Policies, type WriteIntent } from '@anywalletkit/kit'
import { WalletManagerEvm, type EvmConfig } from '@anywalletkit/wallet-evm'
import ApprovalsProtocolEvm, {
BlockscoutSource, type Approval, type ApprovalsCache, type CacheEntry, type RevokeResult,
} from '@anywalletkit/protocol-approvals-evm'
export interface ApprovalsSetup {
/** An RPC that answers eth_getLogs WITHOUT an address filter (your node, most paid plans). */
logsRpc: NonNullable
cache: ApprovalsCache
policies?: Policies
/** The account's RPC (quotes, sends). Default: a public endpoint — pass your own in production. */
ethereumRpc?: EvmConfig['provider']
}
export function walletWithApprovals(seedPhrase: string, { logsRpc, cache, policies, ethereumRpc = 'https://ethereum-rpc.publicnode.com' }: ApprovalsSetup): Wallet {
const wallet = new Wallet(seedPhrase, policies ? { policies } : {})
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: ethereumRpc, chainId: 1 })
wallet.registerProtocol('approvals', ApprovalsProtocolEvm, {
chain: 'eip155:1',
config: {
provider: logsRpc, // discovery only; revokes are sent through the account's own provider
fromBlock: 23_000_000, // the block your app created this wallet in: no approval can be older
blockRange: 10_000, // your RPC's eth_getLogs window
cache, // rescans read only the blocks since the last one
},
})
return wallet
}
```
Discovery asks for every approval event whose owner is the account, across all contracts. That is an `eth_getLogs` call with no `address` filter, and **most free public RPCs refuse it** (publicnode, for one, answers “Please specify an address”). Use your own node or a paid plan for `logsRpc`, or switch discovery to an indexer (see [below](#a-faster-first-scan)). Revokes don’t use `logsRpc`: they go out through the account’s own provider.
Two settings decide how long a scan takes:
* **`fromBlock`.** A scan starts here. Pass the block your app created the wallet in: no approval can be older. An imported wallet has no such block; use an indexer for its first scan.
* **`blockRange`.** The largest `eth_getLogs` window your RPC accepts (QuickNode: 10 000). A range the node refuses is halved and retried. A block that still fails becomes a gap in `coverage` instead of an error.
### Cache
[Section titled “Cache”](#cache)
Give the module a cache, and the next scan reads only the blocks since the last one:
```ts
/** Scan state per `chainId:owner`. Plain JSON: persist it as-is (file, MMKV, IndexedDB). */
export function memoryCache(store = new Map()): ApprovalsCache {
return {
get: (key) => {
const json = store.get(key)
return json ? (JSON.parse(json) as CacheEntry) : null
},
set: (key, entry) => {
store.set(key, JSON.stringify(entry))
},
}
}
```
An entry is plain JSON keyed by `chainId:owner`. Store it wherever your app keeps state. Only complete scans are written.
## List approvals
[Section titled “List approvals”](#list-approvals)
```ts
export async function listApprovals(wallet: Wallet) {
const approvals = await wallet.getProtocol('approvals')
const { approvals: list, coverage } = await approvals.getApprovals()
// complete: false = some block range could not be scanned; the list may be missing entries.
if (!coverage.complete) console.warn('partial scan, gaps:', coverage.gaps)
return {
// Unlimited allowances, spenders without code, live EIP-7702 delegations.
risky: list.filter((a) => a.risks.length > 0),
all: list,
}
}
```
The events only say which pairs to check. The values come from the chain as it is now: `allowance`, `isApprovedForAll`, `getApproved` and the Permit2 `allowance`, read in one Multicall3 call. Anything already used up, expired or revoked is dropped (pass `includeZero: true` to keep it).
| Field | Meaning |
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `id` | Stable key: `chainId:standard:token:spender[:tokenId]` |
| `token`, `spender` | The contract approved, and who may spend from it |
| `amount` | Allowance in base units; `null` for operators and delegations |
| `unlimited` | 2²⁵⁵ or more, or the Permit2 maximum |
| `risks` | `unlimited`; `eoa-spender` (the spender has no code, a classic drainer sign); `expired` (Permit2, with `includeZero`) |
| `expiration` | Unix seconds, Permit2 only |
| `spenderLabel` | Verified contract name, when a `labels` resolver is set |
`getApprovals` filters by `standards`, `tokens` and `spenders`, and takes `fromBlock` / `toBlock` for one-off ranges. An explicit `fromBlock` bypasses the cache.
### Spender names
[Section titled “Spender names”](#spender-names)
A raw spender address means nothing to the user. `EtherscanLabels` turns verified contracts into their verified contract names:
```ts
import { EtherscanLabels } from '@anywalletkit/protocol-approvals-evm'
config: { labels: new EtherscanLabels({ chainId: 1, baseUrl: 'https://your-proxy/etherscan' }) }
```
Keep the Etherscan key on your server: point `baseUrl` at a proxy that adds it. A label lookup that fails leaves `spenderLabel` empty and never fails the scan.
## A faster first scan
[Section titled “A faster first scan”](#a-faster-first-scan)
An indexer returns the whole history in one request instead of thousands of block windows. On a real Ethereum wallet with 11 approval events over 4 M blocks, the RPC walk took 398 requests and 121 s at a 10 000-block window. `EtherscanSource` and `BlockscoutSource` took 1 request and about 1 s.
The indexer source also works without a seed. A read-only account needs only `getAddress()`, so you can audit any address:
```ts
/** Any address, no key and no seed: a read-only account only needs getAddress(). */
export async function auditAddress(address: string): Promise {
const approvals = new ApprovalsProtocolEvm(
{ getAddress: async () => address },
{
provider: 'https://ethereum-rpc.publicnode.com',
chainId: 1,
// The whole history in one request instead of a block-by-block eth_getLogs walk.
source: new BlockscoutSource({ chainId: 1 }),
},
)
const { approvals: list } = await approvals.getApprovals({ standards: ['erc20', 'permit2'] })
return list
}
```
| Source | Key | Limits |
| -------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `BlockscoutSource({ chainId })` | None; an `apiKey` from dev.blockscout.com raises the limit | Keyless instances allow about 10 requests per window. Built-in hosts: Ethereum, Optimism, Gnosis, Polygon, Base, Arbitrum, Scroll, Linea, Sepolia; others take `baseUrl` |
| `EtherscanSource({ chainId, apiKey })` | One Etherscan V2 key for every chain | Free tier: 5 requests/s, no Base, Optimism, BNB or Avalanche. Proxy the key through `baseUrl` |
| `RpcLogsSource` (default) | Your RPC | Address-less `eth_getLogs`, see [Set up](#set-up) |
A common pattern: an indexer for an imported wallet’s first scan, then the default RPC source with a cache for every scan after.
## Revoke
[Section titled “Revoke”](#revoke)
```ts
export async function revokeOne(wallet: Wallet, approval: Approval) {
const approvals = await wallet.getProtocol('approvals')
const { fee } = await approvals.quoteRevoke(approval) // gas in wei, nothing is signed
const { hash } = await approvals.revoke(approval)
return { hash, fee }
}
export async function revokeRisky(wallet: Wallet): Promise {
const approvals = await wallet.getProtocol('approvals')
const { approvals: list } = await approvals.getApprovals()
// Permit2 entries fold into one `lockdown`; every other approval is its own transaction.
const results = await approvals.revokeAll(list.filter((a) => a.risks.length > 0))
for (const r of results) {
// revokeAll never throws for one item: a failure rides on its result.
if (r.error) console.warn('not revoked:', r.ids, r.error.message)
}
return results
}
```
* `quoteRevoke` returns the gas fee in wei without signing. Show it before the user confirms.
* `revoke` sends one transaction and resolves to `{ hash, fee }`. An ERC-20 revoke goes through the account’s `approve({ amount: 0 })`. An EIP-7702 delegation is revoked with `revokeDelegation()`.
* `revokeAll` folds every Permit2 entry into one `lockdown` and sends the rest one by one. On an account that takes a list in `sendTransaction` (ERC-4337, gasless 7702), set `batch: true` and everything goes in one user operation.
* `buildRevokeTransaction(approval)` returns the raw `{ to, data, value }` without sending, for apps that build their own batches.
A revoke costs gas. An account with no ETH cannot revoke anything. Check the balance against `quoteRevoke` first.
## With policies
[Section titled “With policies”](#with-policies)
A revoke is a signature like any other, so [policies](/concepts/policies/) see it. `confirm` gets `kind: 'revoke'`, with the spender in `to` and the full list in `revokes`. New approvals arrive as `kind: 'approval'`: `approve`, `signPermit`, and EIP-2612 or Permit2 typed data. That makes `confirm` the place to warn about unlimited allowances before they are granted:
```ts
/** `ask` is your confirmation sheet: resolve true when the user taps Confirm. */
export function approvalPolicies(ask: (intent: WriteIntent, warning?: string) => Promise): Policies {
return {
confirm: (intent) => {
// A revoke: intent.revokes lists each { token, spender } being taken back.
if (intent.kind === 'revoke') return ask(intent)
// A new approval: approve, signPermit, EIP-2612 or Permit2 typed data; intent.to is the spender.
if (intent.kind === 'approval' && intent.unlimited) {
return ask(intent, `${intent.to} could spend all of this token, now and later.`)
}
return ask(intent)
},
}
}
```
A revoke is not checked against the allowlist or the spender’s blocklist entry, so the user can always take an allowance back from a spender you have blocklisted. See [Revokes](/concepts/policies/#revokes).
## Activity
[Section titled “Activity”](#activity)
`describeActivity` recognises approve and revoke transactions in the account’s history: “Approved USDC for Permit2”, “Revoked USDC for 0x1231…”. Pass `tokens` (lowercase address → symbol and decimals) in the config for readable titles. It runs offline on any EVM chain.
## Errors
[Section titled “Errors”](#errors)
Failures throw `ApprovalsError` with a `reason`:
| `reason` | When |
| ---------------------- | --------------------------------------------------------------------------------------------------- |
| `provider-required` | No `provider` in the config and none on the account |
| `account-required` | `revoke` on a read-only account |
| `unsupported-standard` | A standard this chain cannot revoke, or an EIP-7702 revoke on an account without `revokeDelegation` |
| `invalid-approval` | A malformed approval object |
| `source-failed` | The indexer refused or rate-limited the request. The message says when it resets |
Policy refusals arrive as `UserRejectedError` and `PolicyViolationError` from `kit`, as on every other write.
# Balances
> Native and token balances on every chain, the token list behind them, exact formatting with bigint, and where a price API plugs in.
Every account reads its own balances: `getBalance()` for the network’s gas coin and `getTokenBalance(token)` for a token contract. The wallet decides which tokens to read, formats the amounts and adds prices. This page builds that in a few small functions.
Snippets come from [`examples/balances`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/balances), which our CI typechecks and tests. The live run reads real balances on Base.
```sh
npm install @anywalletkit/kit @anywalletkit/wallet-evm @anywalletkit/networks @anywalletkit/swap2-assets
```
```ts
import { bigintToUnits, type IWalletAccountReadOnly } from '@anywalletkit/core'
import { Wallet } from '@anywalletkit/kit'
import { builtinNetwork } from '@anywalletkit/networks'
import { ccChain } from '@anywalletkit/swap2-assets'
import { WalletManagerEvm, type EvmProvider } from '@anywalletkit/wallet-evm'
```
## One account per chain
[Section titled “One account per chain”](#one-account-per-chain)
```ts
/** One registration per EVM network, each with its own RPC list. */
export function balancesWallet(seedPhrase: string, rpcs: Record): Wallet {
const wallet = new Wallet(seedPhrase)
for (const [id, provider] of Object.entries(rpcs)) {
wallet.registerWallet(`eip155:${id}`, WalletManagerEvm, { provider, chainId: Number(id) })
}
return wallet
}
```
Register each EVM network on its own chain id so it gets its own RPC list. The same seed gives the same address on every EVM network, but the balances are separate. To take the RPC lists from the user’s settings, see [Networks](/guides/networks/).
## Which tokens to read
[Section titled “Which tokens to read”](#which-tokens-to-read)
A chain has no call that lists the tokens an address holds. The wallet keeps a list.
```ts
/** A token the wallet reads a balance for. `token: null` is the network's gas coin. */
export interface ListedToken {
chain: string
token: string | null
symbol: string
decimals: number
/** `catalog`: shipped with the SDK; `user`: the user added it by contract address. */
source: 'catalog' | 'user'
}
/** The gas coin from the network table, the catalog's tokens, then the tokens the user added. */
export function tokenList(chain: string, userTokens: ListedToken[] = []): ListedToken[] {
const network = builtinNetwork(chain)
const native: ListedToken[] = network ? [{ chain, token: null, symbol: network.symbol, decimals: network.decimals, source: 'catalog' }] : []
const catalog: ListedToken[] = (ccChain(chain)?.assets ?? [])
.filter((a) => a.contract) // the native entry is already in from the network table
.map((a) => ({ chain, token: a.contract!, symbol: a.symbol, decimals: a.decimals, source: 'catalog' }))
const known = new Set(catalog.map((t) => t.token!.toLowerCase()))
const own = userTokens.filter((t) => t.chain === chain && t.token && !known.has(t.token.toLowerCase()))
return [...native, ...catalog, ...own]
}
```
* **The gas coin** comes from the network table in `networks`: its symbol and decimals per network. POL on Polygon, MNT on Mantle. Never hardcode “ETH”.
* **The catalog** in `swap2-assets` lists the native coin and the major tokens per chain, with contract addresses and decimals. It is a short curated list, not a full token list.
* **The user’s tokens** are the ones they added by contract address. Keep them in your own storage, mark them as user-added, and drop duplicates of catalog tokens. [Custom tokens](/guides/tokens/) does this with `@anywalletkit/tokens`: it reads the token from the chain and warns about look-alikes before it is saved.
To find tokens outside the list, use a holdings indexer. [Balances and prices](/build-a-wallet/balances-and-prices/) lists providers per chain. Show what it finds behind a “hidden” filter: most unknown tokens are spam.
## Read the balances
[Section titled “Read the balances”](#read-the-balances)
```ts
export interface BalanceRow extends ListedToken {
/** Base units. `null` when this read failed; never show a failed read as 0. */
amount: bigint | null
error?: string
}
/** Every listed balance of one account. One failing token does not hide the others. */
export async function readBalances(account: IWalletAccountReadOnly, tokens: ListedToken[]): Promise {
const reads = await Promise.allSettled(tokens.map((t) => (t.token ? account.getTokenBalance(t.token) : account.getBalance())))
return tokens.map((t, i) => {
const r = reads[i]!
return r.status === 'fulfilled' ? { ...t, amount: r.value } : { ...t, amount: null, error: String((r.reason as Error)?.message ?? r.reason) }
})
}
```
* **Amounts are `bigint` in base units.** 1 USDC is `1_000_000n`, 1 ETH is `10n ** 18n`.
* **A failed read is not zero.** One token contract can revert or one RPC can time out. Keep the row with its error and show “couldn’t load”, never `0`. A wrong zero makes users think their funds are gone.
* **Chains without tokens.** Bitcoin and Zcash accounts throw on `getTokenBalance`. Read only `getBalance()` there. Solana, TON, Tron and NEAR accounts read tokens the same way as EVM: an SPL mint, a jetton master, a TRC-20 contract or a NEP-141 account.
## Format the amount
[Section titled “Format the amount”](#format-the-amount)
```ts
/** Exact decimal string from base units, cut to `maxFraction` digits (rounded down). No Number on the way. */
export function formatAmount(amount: bigint, decimals: number, maxFraction = 6): string {
const negative = amount < 0n
const abs = negative ? -amount : amount
const base = 10n ** BigInt(decimals)
const whole = (abs / base).toLocaleString('en-US')
const fraction = (abs % base).toString().padStart(decimals, '0').slice(0, maxFraction).replace(/0+$/, '')
return `${negative ? '-' : ''}${whole}${fraction ? '.' + fraction : ''}`
}
```
Format from the `bigint` itself. `Number(amount)` loses precision above 2⁵³, and some Hermes builds return wrong values above 2⁶³, so an 18-decimal balance can show a wrong number. When you need a `Number` for math (a USD value, a chart), use `bigintToUnits(amount, decimals)` from `core`. It is exact for display and pricing. Never use it for an amount you sign.
## Every chain at once
[Section titled “Every chain at once”](#every-chain-at-once)
```ts
/** Balances on every chain at once. A chain whose RPC is down comes back with its error, not as zero. */
export async function portfolio(wallet: Wallet, chains: string[], userTokens: ListedToken[] = []) {
const results = await Promise.allSettled(chains.map(async (chain) => readBalances(await wallet.getAccount(chain), tokenList(chain, userTokens))))
return chains.map((chain, i) => {
const r = results[i]!
return r.status === 'fulfilled' ? { chain, rows: r.value } : { chain, rows: [] as BalanceRow[], error: String((r.reason as Error)?.message ?? r.reason) }
})
}
```
Read the chains in parallel. A chain whose RPC is down comes back with its rows marked as failed, and the rest of the screen still loads.
**When to refresh:**
* when the screen opens and when the app returns to the foreground;
* after the user sends, once the receipt arrives. Until then, show your own pending row: a balance read right after a broadcast may not include it yet;
* on pull to refresh. Avoid fast timers: each refresh is one call per token per chain, and public RPCs rate-limit quickly.
## Prices
[Section titled “Prices”](#prices)
The SDK has no price source. You bring a price API and call it through your server, so its key stays off the device. The function below takes it as a parameter.
```ts
/** Your price API, behind your server: USD per whole token, keyed by `chain/token` (token = contract, or `native`). */
export type PriceSource = (keys: string[]) => Promise>
export const priceKey = (t: ListedToken) => `${t.chain}/${t.token ? t.token.toLowerCase() : 'native'}`
/** USD value per row and a total. A token with no price is `null` and stays out of the total. */
export async function valued(rows: BalanceRow[], prices: PriceSource) {
const quotes = await prices(rows.filter((r) => r.amount !== null && r.amount > 0n).map(priceKey))
const out = rows.map((r) => {
const price = quotes[priceKey(r)]
const usd = r.amount !== null && price !== undefined ? bigintToUnits(r.amount, r.decimals) * price : null
return { ...r, usd }
})
return { rows: out, totalUsd: out.reduce((sum, r) => sum + (r.usd ?? 0), 0), unpriced: out.filter((r) => r.usd === null && (r.amount ?? 0n) > 0n).length }
}
```
* **Look up by contract address**, never by symbol. Symbols collide, and fake tokens copy real ones.
* **No price is `null`, not $0.** Show “no price” and leave the token out of the total.
* **Price only what the user holds.** Zero balances never reach the API.
* **Cache** prices for a minute or more and show when a price is stale.
Providers to compare are listed on [Balances and prices](/build-a-wallet/balances-and-prices/#prices).
# Custom signer
> Keep the key outside the app — a hardware wallet, an MPC node, an HSM or a signing service — and use it as any other account.
A signer is the only object that touches a private key. Accounts build transactions, talk to the network and hand the signer exactly the bytes to sign. Replace the signer, and the key can live anywhere: on a hardware wallet, in an MPC network, in an HSM, behind your own service. Everything else (addresses, balances, transfers, swaps, policies) works unchanged.
Snippets come from [`examples/signer`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/signer), which our CI typechecks and tests against the same addresses and signatures a seed wallet produces.
```ts
import { UserRejectedError, externalSigner, type SignOptions, type SignScheme, type Signer } from '@anywalletkit/core'
import { Wallet, type Policies } from '@anywalletkit/kit'
import { WalletManagerBtc } from '@anywalletkit/wallet-btc'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
```
## What a signer receives
[Section titled “What a signer receives”](#what-a-signer-receives)
`externalSigner({ curve, publicKey, sign })` wraps your callback. The SDK calls `sign` with the payload and options, and checks the length of what comes back.
| `scheme` | Curve | Payload | Return |
| ------------------- | --------- | --------------- | ------------------------------ |
| `ecdsa-recoverable` | secp256k1 | 32-byte hash | 65 bytes `r‖s‖v`, `v` = 0 or 1 |
| `ecdsa` | secp256k1 | 32-byte hash | 64 bytes `r‖s`, low-S |
| `schnorr` | secp256k1 | 32-byte message | 64 bytes, BIP-340 (Taproot) |
| `ed25519` | ed25519 | message bytes | 64 bytes |
`options.context` says what the bytes are, so a device can show the right screen:
| Context | Chain | Payload |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------- |
| `evm-tx`, `evm-191`, `evm-712` | EVM | Transaction hash, `personal_sign` hash, EIP-712 hash |
| `btc-sighash`, `btc-taproot-keypath`, `btc-message` | Bitcoin | SegWit sighash, Taproot sighash (with `tweak`), BIP-137 hash |
| `tron-tx`, `tron-message` | Tron | Transaction hash, TIP-191 hash |
| `solana-message`, `solana-offchain` | Solana | Transaction message bytes, off-chain message |
| `ton-external`, `ton-message` | TON | Signing-cell hash, message bytes (never 32 bytes) |
| `ton-proof`, `ton-sign-data` | TON | TON Connect `ton_proof` digest, `signData` digest |
| `near-tx`, `near-message`, `near-nep413` | NEAR | sha256 of the transaction, message bytes (never 32 bytes), NEP-413 digest |
One ed25519 key behind several chains (an external signer registered for Solana, TON and NEAR) is guarded across them: TON and NEAR `sign()` refuse bytes that name the key as a Solana signer, and Solana `sign()` on an external key refuses 32-byte messages (a TON or NEAR transaction digest).
A signer advertises the `schemes` it can produce. By default that is the curve’s main one: `ecdsa-recoverable` for secp256k1, `ed25519` for ed25519. Add `ecdsa` for Bitcoin SegWit inputs and `schnorr` for Taproot. Asking for a scheme the signer doesn’t list throws `SignerError` before your callback runs.
## A hardware wallet
[Section titled “A hardware wallet”](#a-hardware-wallet)
```ts
/** What a hardware wallet SDK typically gives you. */
export interface Device {
publicKey(path: string): Promise // 33-byte compressed secp256k1
signDigest(path: string, digest: Uint8Array, prompt: string): Promise
}
const PROMPTS: Record = {
'evm-tx': 'Sign transaction',
'evm-191': 'Sign message',
'evm-712': 'Sign typed data',
}
export async function deviceSigner(device: Device, path = "m/44'/60'/0'/0/0"): Promise {
return externalSigner({
curve: 'secp256k1',
publicKey: await device.publicKey(path),
sign: async (digest, options) => {
// options.context says what the bytes are, so the device can show the right screen.
const sig = await device.signDigest(path, digest, PROMPTS[options.context ?? ''] ?? 'Sign')
if (sig === 'rejected') throw new UserRejectedError('Rejected on the device.')
return sig // 65 bytes r‖s‖v (v = 0 or 1)
},
})
}
export async function walletOnDevice(device: Device, policies: Policies): Promise {
const wallet = new Wallet(await deviceSigner(device), { policies }) // no seed in the app at all
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
return wallet
}
```
* **Throw `UserRejectedError` when the user declines on the device.** Every module treats it as “cancelled”, not as a failure to retry.
* **The app never sees a seed.** `new Wallet(signer)` takes the signer instead of a phrase.
* **Policies still apply.** Fee caps, allowlists and your `confirm` step run before the device is asked, so the screen on the phone and the screen on the device agree.
## A signing service
[Section titled “A signing service”](#a-signing-service)
```ts
/** A signing service you run (MPC node, HSM, KMS proxy): it holds the key, the app holds a session token. */
export function remoteSigner(options: {
url: string
token: string
curve: 'secp256k1' | 'ed25519'
publicKey: Uint8Array
schemes?: readonly SignScheme[]
fetch?: typeof fetch
}): Signer {
return externalSigner({
curve: options.curve,
publicKey: options.publicKey,
...(options.schemes ? { schemes: options.schemes } : {}),
sign: async (payload: Uint8Array, opts: SignOptions & { scheme: SignScheme }) => {
const res = await (options.fetch ?? fetch)(options.url, {
method: 'POST',
headers: { 'content-type': 'application/json', authorization: `Bearer ${options.token}` },
body: JSON.stringify({ payload: toHex(payload), scheme: opts.scheme, context: opts.context ?? null }),
})
if (res.status === 403) throw new UserRejectedError('The signing service refused.')
if (!res.ok) throw new Error(`Signing service: HTTP ${res.status}`)
const { signature } = (await res.json()) as { signature: string }
return fromHex(signature) // the SDK checks the length for the scheme
},
})
}
```
This is the shape for an MPC node, an HSM, a cloud KMS behind your proxy, or a backend signer for bots and treasury accounts. The service returns a signature over the bytes it is given.
A digest signer signs blindly
The service receives a hash. It cannot tell a payment from a drain by looking at it. Protect it like the key it is:
* **Check before the call.** Run [policies](/concepts/policies/) and your review on the client, so nothing unreviewed reaches `sign`.
* **Authenticate every request.** Use a short-lived session token bound to the user and the device, never a static key shipped in the app.
* **Limit on the server.** Rate limits, per-account caps, and an audit log of every signature.
* **For bots, sign on the server.** Build and check the transaction where the key is, rather than accepting hashes from a client.
## Several chains, two curves
[Section titled “Several chains, two curves”](#several-chains-two-curves)
```ts
/**
* One external signer = one key = one curve. Two curves → two wallets.
* The secp256k1 key serves EVM and Bitcoin, but it is ONE key: the Bitcoin
* address is that key's SegWit address, not the m/84' one a seed wallet shows.
*/
export function walletsOnService(service: { url: string; token: string; secpKey: Uint8Array; edKey: Uint8Array; fetch?: typeof fetch }) {
const evmAndBitcoin = new Wallet(
remoteSigner({
...service, curve: 'secp256k1', publicKey: service.secpKey,
schemes: ['ecdsa-recoverable', 'ecdsa'], // EVM and BTC messages use the first, SegWit inputs the second
}),
)
evmAndBitcoin.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
evmAndBitcoin.registerWallet('bip122', WalletManagerBtc, {
client: { type: 'esplora-http', clientConfig: { url: 'https://mempool.space/api' } },
})
const solana = new Wallet(remoteSigner({ ...service, curve: 'ed25519', publicKey: service.edKey }))
solana.registerWallet('solana', WalletManagerSolana, { provider: 'https://api.mainnet-beta.solana.com' })
return { evmAndBitcoin, solana }
}
```
* **One external signer is one key.** It gives one account per chain (index 0), and it signs on one curve. EVM, Bitcoin, Tron and Zcash share secp256k1; Solana, TON and NEAR use ed25519. Cover both families with two signers and two wallets.
* **The same secp256k1 key on EVM and Bitcoin gives that key’s addresses on both.** A seed wallet derives Bitcoin at `m/84'/0'/0'/0/0`, a different key, so the addresses differ. Tell users who move from a seed wallet.
* **Several accounts** need several keys from the device or service: one signer per path, or a signer that derives (`kind: 'seed'` with `derive`). The [Keyring](/guides/keyring/) handles many accounts for seed-based wallets.
## Checklist
[Section titled “Checklist”](#checklist)
* **Prove the public key matches before the first send:** sign a test message and verify it with `account.verify`.
* **Return signatures in the exact shape from the table.** The SDK rejects a wrong length or a recovery id other than 0 or 1.
* **Implement `dispose`** if your signer holds a session or a connection; `wallet.dispose()` calls it.
# Earn
> Staking and lending through two shared interfaces — stake, read positions and rates, withdraw in two phases, supply and borrow.
Earn modules come in two shapes, and every module of a shape has the same methods:
| Interface | Modules | Flow |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `StakingProtocol` | Lido (ETH), SSV Network, Tonstakers (TON), SPL stake pools (Jito on Solana), native SOL staking, native MON staking (Monad) | Stake → request a withdrawal → wait for the queue → claim |
| `LendingProtocol` | Aave v3, Morpho, Mellow, Kamino | Supply / withdraw, and on markets that allow it, borrow / repay |
This page uses Lido and Aave on Ethereum. The other modules work the same way, with different packages and chains (see [Packages](/getting-started/packages/#earn)). Snippets come from [`examples/earn`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/earn), which our CI typechecks and tests.
```sh
npm install @anywalletkit/protocol-staking-lido-evm @anywalletkit/protocol-lending-aave-evm
```
## Set up
[Section titled “Set up”](#set-up)
Register each module as a protocol, bound to the chain its account lives on:
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import LidoProtocolEvm from '@anywalletkit/protocol-staking-lido-evm'
import { AaveProtocolEvm } from '@anywalletkit/protocol-lending-aave-evm'
export function walletWithEarn(seedPhrase: string): Wallet {
const wallet = new Wallet(seedPhrase)
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
// A protocol is bound to the account of one chain.
wallet.registerProtocol('lido', LidoProtocolEvm, { chain: 'eip155:1' })
wallet.registerProtocol('aave', AaveProtocolEvm, { chain: 'eip155:1', config: { market: 'core' } })
return wallet
}
```
Every write has a `quote…` twin that returns the gas fee without signing anything. Show it before the user confirms. [Policies](/concepts/policies/) apply to every write a module makes, because modules sign through the same account.
## Staking
[Section titled “Staking”](#staking)
### Stake
[Section titled “Stake”](#stake)
```ts
export async function stakeEth(wallet: Wallet, amount: bigint) {
const lido = await wallet.getProtocol('lido')
const { fee } = await lido.quoteStake({ amount }) // gas in wei, nothing is signed
const { hash } = await lido.stake({ amount }) // ETH → stETH
return { hash, fee }
}
```
### Position and rate
[Section titled “Position and rate”](#position-and-rate)
```ts
export async function stakingPosition(wallet: Wallet) {
const lido = await wallet.getProtocol('lido')
const position = await lido.getStakedBalance()
return {
staked: position.total, // the whole position in stETH, wei
apr: await lido.getApr(), // percent: 2.7 = 2.7 %
}
}
```
Note
Rates are percentages: `getApr()` returning `2.2` means 2.2% a year. The same holds for lending APYs.
### Unstake: two phases
[Section titled “Unstake: two phases”](#unstake-two-phases)
Staked funds do not come back in one transaction. A withdrawal request joins the protocol’s queue, finalizes later (hours to days, depending on the protocol), and only then can be claimed. The interface names the queue instead of pretending `withdraw()` returns money:
```ts
export async function unstake(wallet: Wallet, amount: bigint) {
const lido = await wallet.getProtocol('lido')
// Phase 1: join the withdrawal queue.
await lido.requestWithdrawal({ amount })
}
export async function claimIfReady(wallet: Wallet) {
const lido = await wallet.getProtocol('lido')
const queue = await lido.getWithdrawalRequests()
// queue.pendingAmount: still in the queue; queue.claimableAmount: ready to claim
if (queue.claimableIds.length === 0) return null
// Phase 2: claim the finalized requests back as ETH.
return lido.claimWithdrawals({ ids: queue.claimableIds })
}
```
Show `pendingAmount` as “unstaking” and `claimableAmount` with a **Claim** button. Check the queue when the screen opens; there is nothing to watch in between.
## Lending
[Section titled “Lending”](#lending)
### Supply and withdraw
[Section titled “Supply and withdraw”](#supply-and-withdraw)
```ts
const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
export async function lendUsdc(wallet: Wallet, amount: bigint) {
const aave = await wallet.getProtocol('aave')
const apy = await aave.getSupplyApy(USDC) // 4.1 = 4.1 %
const { fee } = await aave.quoteSupply({ token: USDC, amount })
const result = await aave.supply({ token: USDC, amount }) // permit when the token supports it, else an exact approval
return { apy, fee, hash: result.hash }
}
export async function withdrawAll(wallet: Wallet) {
const aave = await wallet.getProtocol('aave')
return aave.withdraw({ token: USDC, amount: 'max' }) // principal + interest
}
```
Tokens are contract addresses; `'native'` supplies the chain’s coin (ETH) through Aave’s gateway. Where the token supports EIP-2612, the module signs a permit instead of sending a separate approval transaction. `amount: 'max'` withdraws or repays everything, interest included.
### Position and health
[Section titled “Position and health”](#position-and-health)
```ts
export async function lendingPosition(wallet: Wallet) {
const aave = await wallet.getProtocol('aave')
const { supplies, borrows, account } = await aave.getPosition()
return {
supplies, // [{ token, symbol, amount, supplyApy, collateral }]
borrows, // [{ token, symbol, amount, borrowApy }]
healthFactor: account.healthFactor, // < 1 = liquidation; Infinity without debt
}
}
```
With debt, keep an eye on `healthFactor`: below `1.0` the position can be liquidated. Show it on every borrow and withdraw screen, and warn well before it gets close (for example under `1.5`).
## Native SOL staking
[Section titled “Native SOL staking”](#native-sol-staking)
`@anywalletkit/protocol-staking-native-solana` delegates SOL straight to validators through Solana’s Stake program: no pool, no token. Your app decides which validators it offers; the module has no default list and refuses to start without one.
```sh
npm install @anywalletkit/protocol-staking-native-solana @anywalletkit/wallet-solana
```
### Choose the validators
[Section titled “Choose the validators”](#choose-the-validators)
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
import { NativeStakingProtocolSolana } from '@anywalletkit/protocol-staking-native-solana'
const SOLANA = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'
export function walletWithNativeStaking(seedPhrase: string, rpc = 'https://api.mainnet-beta.solana.com'): Wallet {
const wallet = new Wallet(seedPhrase)
wallet.registerWallet('solana', WalletManagerSolana, { provider: rpc })
wallet.registerProtocol('sol-staking', NativeStakingProtocolSolana, {
chain: SOLANA,
config: {
// Required: the vote accounts your wallet delegates to. Replace these with your own choice.
validators: [
{ voteAccount: 'he1iusunGwqrNtafDtLdhsUQDFvo13z9sUa36PauBtk', name: 'Validator A' },
{ voteAccount: 'CatzoSMUkTRidT5DwBxAC2pEtnwMBTpkCepHkFgZDiqb', name: 'Validator B' },
],
maxCommission: 10, // refuse a validator whose commission is above 10 % (checked at every delegation)
},
})
return wallet
}
```
Each stake goes to a validator from this list (or any voting validator with `validators: 'any'`, when your users pick from the whole cluster). Before every delegation the module reads the validator live and refuses it when it is delinquent or its commission is above `maxCommission` (10 % unless you set it). `enrich` can attach an explorer’s APR or a logo to each validator; the on-chain checks do not depend on it.
### Stake
[Section titled “Stake”](#stake-1)
```ts
export async function stakeSol(wallet: Wallet, lamports: bigint) {
const staking = await wallet.getProtocol('sol-staking')
const validators = await staking.listValidators() // live commission, stake, APR; `eligible` and `refusals`
const pick = validators.find((v) => v.eligible)!
const quote = await staking.quoteStake({ amount: lamports, validator: pick.voteAccount }) // ≥ 1 SOL; nothing is signed
// quote.total = amount + the stake account's rent (returned on withdraw); quote.fee = network fee
const result = await staking.stake({ amount: lamports, validator: pick.voteAccount })
return { hash: result.hash, stakeAccount: result.stakeAccount, activeFrom: result.readyEpoch }
}
```
A stake is one transaction: a new stake account at an address derived from the wallet (seed `stake:`), initialized with the wallet as its only authority and delegated. Only the wallet signs, and the position can be rebuilt from the wallet address alone. The minimum is 1 SOL; the account also holds about 0.0017 SOL of rent, which comes back on withdrawal. The stake starts earning from the next epoch boundary (an epoch is about two days).
### Position
[Section titled “Position”](#position)
```ts
export async function nativePosition(wallet: Wallet) {
const staking = await wallet.getProtocol('sol-staking')
const accounts = await staking.getStakeAccounts() // one per delegation: status, validator, amounts, readyAt
const { balance, total } = await staking.getStakedBalance() // delegated lamports; everything in stake accounts
return { accounts, balance, total, apr: await staking.getApr() }
}
```
`status` is computed from the StakeHistory sysvar the way the Stake program computes it: `activating`, `active`, `deactivating` or `inactive`, with `readyEpoch` / `readyAt` while it changes. Rewards compound into each account at every epoch boundary; `getRewards()` lists them per epoch.
### Unstake and claim
[Section titled “Unstake and claim”](#unstake-and-claim)
```ts
export async function unstakeSol(wallet: Wallet, lamports: bigint) {
const staking = await wallet.getProtocol('sol-staking')
// Whole accounts are deactivated; a partial amount is split into a new account first.
const { steps, readyAt } = await staking.requestWithdrawal({ amount: lamports })
return { steps, readyAt } // the SOL can be claimed after the epoch boundary (~2 days)
}
export async function claimSol(wallet: Wallet) {
const staking = await wallet.getProtocol('sol-staking')
const { claimableIds } = await staking.getWithdrawalRequests()
if (claimableIds.length === 0) return null
return staking.claimWithdrawals({ ids: claimableIds }) // every lamport, rent included, back to the wallet
}
```
Unstaking deactivates whole accounts and, for a partial amount, splits it off one account into a new one first; both parts must keep the 1 SOL minimum. The SOL can be withdrawn after the cool-down (the next epoch boundary). A stake deactivated in the epoch it was made is free at once, and `delegate({ account })` in the same epoch undoes an unstake. `merge` joins two compatible accounts on the same validator.
Allowlist policies
A Solana `allowlist` checks each Stake instruction by whom it pays or empowers. Allow the wallet’s own address (staker, withdrawer, withdrawal recipient), the stake accounts (`getStakeAccountAddress(i)`) and the vote accounts of the validators you list, or the kit refuses staking writes. Allowlisting the Stake program itself opens nothing.
## Native MON staking
[Section titled “Native MON staking”](#native-mon-staking)
`@anywalletkit/protocol-staking-native-monad` delegates MON straight to Monad validators through the staking precompile (`0x…1000`): no pool, no token. Your app decides which validator ids it offers; the module has no default list and refuses to start without one.
```sh
npm install @anywalletkit/protocol-staking-native-monad @anywalletkit/wallet-evm
```
### Choose the validators
[Section titled “Choose the validators”](#choose-the-validators-1)
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { NativeStakingProtocolMonad } from '@anywalletkit/protocol-staking-native-monad'
export function walletWithMonadStaking(seedPhrase: string, rpc = 'https://rpc.monad.xyz'): Wallet {
const wallet = new Wallet(seedPhrase)
wallet.registerWallet('eip155:143', WalletManagerEvm, { provider: rpc, chainId: 143 })
wallet.registerProtocol('mon-staking', NativeStakingProtocolMonad, {
chain: 'eip155:143',
config: {
// Required: the validator ids your wallet delegates to. Replace them with your own choice.
validators: [{ id: 97n, name: 'Validator A' }, { id: 21n, name: 'Validator B' }],
defaultValidator: 97n,
maxCommission: 10, // refuse a validator whose commission is above 10 % (checked at every delegation)
},
})
return wallet
}
```
`validators: 'any'` lets users pick from the whole active set (`listValidators()`). Before every delegation the module reads the validator live and refuses it when it does not exist, is not in the consensus set in good standing, or charges more than `maxCommission` (10 % unless you set it; many validators charge 10–15 %). `enrich` can attach an explorer’s APR or a logo.
### Stake and position
[Section titled “Stake and position”](#stake-and-position)
```ts
export async function stakeMon(wallet: Wallet, wei: bigint) {
const staking = await wallet.getProtocol('mon-staking')
const validators = await staking.listValidators() // live commission, standing, APR; `eligible` and `refusals`
const quote = await staking.quoteStake({ amount: wei }) // simulated, nothing is signed; keeps the 10 MON reserve
const result = await staking.stake({ amount: wei }) // delegate(97) with the amount as value
return { validators, fee: quote.fee, hash: result.hash, activeFrom: result.activatesAtEpoch } // epoch n+1, or n+2 after the boundary block
}
export async function monadPosition(wallet: Wallet) {
const staking = await wallet.getProtocol('mon-staking')
const positions = await staking.listPositions() // per validator: active, activating, unclaimed rewards
const { balance, total, unclaimedRewards } = await staking.getStakedBalance()
return { positions, balance, total, unclaimedRewards, apr: await staking.getApr() }
}
```
A stake becomes active at the next epoch, or the one after when it is sent after the epoch’s boundary block (`getEpoch().activatesAtEpoch`; epochs are about 4 hours). Monad keeps a 10 MON reserve on every account: a stake that would leave less is refused (`getMaxStakeable()`). Rewards accrue separately in `unclaimedRewards`; claim them or compound them into the stake.
### Unstake and claim
[Section titled “Unstake and claim”](#unstake-and-claim-1)
```ts
export async function unstakeMon(wallet: Wallet, wei: bigint) {
const staking = await wallet.getProtocol('mon-staking')
// Only active stake can be undelegated; the module picks a free withdrawal slot (0..255).
const { id, withdrawableAtEpoch } = await staking.requestWithdrawal({ amount: wei, validator: 97n })
return { id, withdrawableAtEpoch } // claimable one epoch after the stake deactivates
}
export async function claimMon(wallet: Wallet) {
const staking = await wallet.getProtocol('mon-staking')
const { claimableIds } = await staking.getWithdrawalRequests({ validator: 97n })
if (claimableIds.length > 0) await staking.claimWithdrawals({ ids: claimableIds }) // one withdraw per request
const position = (await staking.listPositions()).find((p) => p.validatorId === 97n)
if (position && position.unclaimedRewards > 0n) await staking.claimRewards({ validator: 97n }) // or compound({ validator })
return { claimed: claimableIds.length }
}
```
Only active stake can be undelegated. Each unstake takes a withdrawal slot (0–255 per validator) and can be withdrawn one epoch after the stake deactivates. The precompile withdraws one request per transaction, so `claimWithdrawals` may send several. After a full exit the precompile no longer lists the validator among the wallet’s delegations: keep the `id` that `requestWithdrawal` returns, or pass the validator in `validators`, so the withdrawal is found again.
Policies
Staking writes go to the precompile `0x0000000000000000000000000000000000001000`; a Monad `allowlist` must include it.
## Module-specific extras
[Section titled “Module-specific extras”](#module-specific-extras)
The shared interfaces cover what every module can do. Modules add their own methods on top: Lido wraps stETH into wstETH, Aave toggles collateral and lists reserves with their rates and caps, Morpho lists vaults, SSV reports APR history. They are listed in each package’s API reference.
# Browser extension
> A Chromium (MV3) wallet extension on extension-kit — the encrypted vault, passkey unlock, auto-lock, the dApp request router, approvals and signing checks, and publishing to the Chrome Web Store.
`extension-kit` is the security core of a non-custodial Chromium (MV3) wallet extension. It is a library, not an extension. You build the popup, the approval window, the injected provider and the release pipeline. The kit gives you the parts that must be right:
* **Vault:** every secret encrypted at rest in `chrome.storage.local`. A password opens it (scrypt), and a passkey can open it too (WebAuthn PRF).
* **Session:** the unlocked key lives only in `chrome.storage.session`, with an expiry that is checked on every read and an alarm that locks the wallet.
* **Relay and router:** page → content script → service worker. The worker trusts the origin the browser recorded for the port, never the one the page claims. Per-site permissions decide what a site may call.
* **Approval queue:** one approval window at a time, at most three waiting requests per site, one waiting connect.
* **Signing checks:** the signing address must be connected, typed data must be for the connected chain, `eth_sign` is never offered, contract deployments and site-made EIP-7702 delegations are refused. Nonce and fees come from your RPC.
The kit has no UI and makes no network requests of its own. It doesn’t need `@types/chrome`: its adapters take plain objects shaped like `chrome.storage` and `chrome.alarms`, so the same code runs in tests with in-memory fakes. Snippets come from [`examples/extension-kit`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/extension-kit), which our CI typechecks and tests.
```sh
npm install @anywalletkit/extension-kit @anywalletkit/keyring @anywalletkit/wallet-evm
```
```ts
import {
ApprovalQueue, NetworksTable, PAGE_TARGET, PORT_NAME, PermissionStore, PhishingDetector, RequestRouter, Session, Vault,
checkSenderOrigin, chromeAlarms, chromeJsonStorage, chromeKeyringStorage, chromeLocalVaultStorage,
chromeSessionStorage, createSignHandler, isRelayRequest, isRelayToContent, pageRequestFrom, stampOrigin,
toRelayError, vaultSecretStorage,
type AlarmsLike, type ApprovalRequest, type PageMessageEvent, type PageWindow, type ApprovalWindow, type EvmNetwork, type EvmSigner, type PermissionsState,
type PortSender, type RelayResponse, type RelayToContent, type StorageAreaLike,
} from '@anywalletkit/extension-kit'
import { Keyring } from '@anywalletkit/keyring'
import { WalletManagerEvm, type WalletAccountEvm } from '@anywalletkit/wallet-evm'
```
## Open the wallet
[Section titled “Open the wallet”](#open-the-wallet)
The service worker can be stopped at any moment, so it rebuilds everything from storage on start-up.
```ts
/** Service worker start-up. The worker can be stopped at any time; everything lives in storage. */
export async function openWallet(chrome: ChromeLike) {
const vault = new Vault({ storage: chromeLocalVaultStorage(chrome.storage.local) })
const session = new Session({
storage: chromeSessionStorage(chrome.storage.session), // memory-only, cleared when the browser quits
alarms: chromeAlarms(chrome.alarms), // locks on time even if the worker was asleep
})
const keyring = await Keyring.load({
storage: chromeKeyringStorage(chrome.storage.local), // names, addresses: no secrets
secrets: vaultSecretStorage(vault, session), // every secret read goes through the unlocked vault
chains: { evm: { Manager: WalletManagerEvm, config: {} } },
})
return { vault, session, keyring }
}
export type WalletParts = Awaited>
```
The [keyring](/guides/keyring/) keeps its account list in `chrome.storage.local` as plain JSON: names and addresses, no secrets. Every secret read goes through the vault and needs an unlocked session; a locked session throws `VaultError` with the code `locked`.
## Create the wallet
[Section titled “Create the wallet”](#create-the-wallet)
```ts
/** First run: create the vault, unlock the session, import the phrase. */
export async function createWallet({ vault, session, keyring }: WalletParts, password: string, phrase: string) {
const dek = await vault.create(password) // refuses if a vault exists or the password is under 8 characters
await session.unlock(dek) // keeps the key in session storage and zeroizes `dek`
return keyring.importMnemonic(phrase) // sealed in the vault, never in plain storage
}
```
* `vault.create` refuses when a vault already exists. Resetting is a separate, explicit `vault.destroy()`; build it as its own screen with its own warning.
* Passwords shorter than 8 characters are refused by the vault itself.
* `session.unlock` zeroizes the key you pass in.
## Unlock: password and passkey
[Section titled “Unlock: password and passkey”](#unlock-password-and-passkey)
```ts
export async function unlockWithPassword({ vault, session }: WalletParts, password: string) {
await session.unlock(await vault.unlock(password)) // VaultError 'wrong-password' on a bad password
}
/**
* Passkey unlock. Your extension page runs navigator.credentials.get() with the WebAuthn PRF
* extension and passes the 32-byte PRF output here; the vault zeroizes it after use.
* The password stays the recovery path.
*/
export async function addPasskey({ vault }: WalletParts, password: string, passkey: { id: string; prf: Uint8Array; label: string }) {
const dek = await vault.unlock(password) // the user confirms with the password once
try {
await vault.addPasskey(dek, passkey)
} finally {
dek.fill(0)
}
}
export async function unlockWithPasskey({ vault, session }: WalletParts, id: string, prf: Uint8Array) {
await session.unlock(await vault.unlockWithPasskey(id, prf))
}
```
| `VaultError` code | When |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `wrong-password` | Wrong password, wrong passkey, or an envelope that was edited on disk. AES-GCM can’t tell these apart. |
| `locked` | A secret was read after the session locked, or `setSecret` got a key that does not open the vault (one `rotateVaultKey` retired) |
| `exists` | `create` while a vault exists |
| `weak-kdf` | The stored KDF settings are below the floor this build accepts |
| `unsupported-envelope` | An envelope of an unknown shape, or one whose KDF cost or size is above `VAULT_LIMITS` (refused before any KDF runs) |
| `invalid-input` | Empty or short password, bad key length, bad id |
A passkey is a second key to the same vault, not a replacement for the password. Keep the password as the recovery path, and let users remove a passkey (`vault.removePasskey`).
`changePassword` re-wraps the same vault key, and removing a passkey does not take back a key it already opened. After a suspected compromise (a copied browser profile, a leaked session, a lost passkey), offer **re-key the vault**: `vault.rotateVaultKey(password)` makes a new vault key, re-seals every secret under it and writes the vault once, so a failure leaves the old one as it was. Hand the key it returns to `session.unlock`, which replaces the old one. Passkeys are dropped, because they wrap the old key; ask the user to add them again. The old key opens nothing in the new vault, and `setSecret` refuses it.
```ts
await session.unlock(await vault.rotateVaultKey(password))
```
The relay drops a request whose `method` is not a method name (letters, digits and `_`, at most 128 characters, `isRelayMethod`). Reject such a request in your injected provider with `-32600`, so the page gets an answer.
Auto-lock defaults to 15 minutes (`SESSION_DEFAULT_AUTOLOCK_MS`). Change it with `session.setAutoLockMs(ms)`, and call `session.touch()` when the user is active in your UI.
## The request router
[Section titled “The request router”](#the-request-router)
Everything a site can ask for goes through `RequestRouter`. You give it your RPC transport, your approval window, and the signer for an address.
```ts
/** Everything a dApp can ask for goes through this router. */
export function createRouter(wallet: WalletParts, options: WorkerOptions) {
const { keyring, session } = wallet
const local = options.chrome.storage.local
const phishing = new PhishingDetector(options.phishing)
// A site on the shipped phishing list is refused (4100) before any window opens; lookalikes and
// punycode only add warnings to the sheet.
const approvals = new ApprovalQueue(options.window, undefined, { annotate: (origin) => phishing.check(origin).warnings, refuse: (origin) => phishing.refusal(origin) })
const ports = new Map void>>()
// Signing: the account lives only for one signature, then its key is wiped.
const signerFor = async (address: string) => {
const meta = keyring.listAccounts().find((a) => a.addresses.evm?.toLowerCase() === address.toLowerCase())
if (!meta) throw new Error('This address is not in the wallet.')
const handle = await keyring.getAccount(meta.id, 'evm')
const signer: EvmSigner = {
signMessage: (m) => handle.account.sign(m),
signTypedData: (t) => handle.account.signTypedData(t),
signTransaction: (tx) => handle.account.signTransaction(tx),
}
return { signer, dispose: () => handle.dispose() }
}
const router = new RequestRouter({
permissions: new PermissionStore(chromeJsonStorage(local, 'my-wallet.permissions')),
networks: new NetworksTable(chromeJsonStorage(local, 'my-wallet.networks')),
approvals,
refuse: (origin) => phishing.refusal(origin), // reads and an earlier permission included
// A locked wallet shows no accounts; eth_requestAccounts then opens the window to unlock.
accounts: async () => {
const address = keyring.activeAccount?.addresses.evm
return (await session.isUnlocked()) && address ? [address] : []
},
rpc: options.rpc, // reads go to your RPC, never to the site's
emit: (origin, event, data) => { for (const post of ports.get(origin) ?? []) post({ kind: 'event', chain: 'eip155', event, data }) },
sign: createSignHandler({ approvals, rpc: options.rpc, signerFor }),
})
// Locking the wallet answers every waiting request with "declined".
session.onLock(() => approvals.declineAll())
return { router, approvals, ports }
}
export type WorkerParts = ReturnType
```
What the router does with a request:
| Request | What happens |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `eth_chainId`, `eth_accounts` | Answered without a prompt. A site that is not connected, or a locked wallet, gets `[]` |
| `eth_requestAccounts` | Opens the approval window (your window asks to unlock first when the wallet is locked) and stores the permission for that origin |
| `wallet_switchEthereumChain`, `wallet_addEthereumChain` | Through the approval window; only catalog chains, https only, `eth_chainId` verified |
| Read-only RPC (`READ_METHODS`) | Sent to your RPC for the site’s chain, never to an endpoint the site chose |
| `personal_sign`, `eth_signTypedData_v4`, `eth_sendTransaction` | Checked, reviewed in the approval window, signed, and a transaction is broadcast through your RPC |
| Anything else | Error `4200` (unsupported method) |
Errors come back as EIP-1193 codes: `4001` the user declined, `4100` unauthorized, `4900` disconnected, `-32002` a connect request is already waiting, `-32005` too many waiting requests. A node’s own error (a revert: code `3` with its data) passes through without the RPC URL. Anything else reaches the page as `-32603 Internal error`: pass `log` to `toRelayError` to keep the details in the extension’s console, since transport errors name the RPC URL and often the provider key in it.
The signer is built for one signature and its key is wiped right after (`handle.dispose()`). Pass a `preview` function to `createSignHandler` to show a simulation in the approval window; [Transaction preview](/guides/tx-preview/) builds one.
## The approval window
[Section titled “The approval window”](#the-approval-window)
The queue shows one request at a time. Your approval page reads the request, shows it, and answers with `approvals.resolve(id, value)` or `approvals.decline(id)`. Closing the window declines the request.
```ts
/** One popup per request. Your approval page reads the request by id and answers through the queue. */
export function popupApprovalWindow(windows: WindowsLike, pageUrl: string): ApprovalWindow & { shown: Map } {
const byWindow = new Map()
const shown = new Map()
const closed: Array<(requestId: string) => void> = []
windows.onRemoved.addListener((windowId) => {
const requestId = byWindow.get(windowId)
if (requestId === undefined) return
byWindow.delete(windowId)
shown.delete(requestId)
for (const handler of closed) handler(requestId) // closing the popup declines the request
})
return {
shown,
async open(request) {
shown.set(request.id, request)
const win = await windows.create({ url: `${pageUrl}?request=${encodeURIComponent(request.id)}`, type: 'popup', width: 380, height: 640 })
if (win.id !== undefined) byWindow.set(win.id, request.id)
},
async close(requestId) {
shown.delete(requestId)
for (const [windowId, id] of byWindow) if (id === requestId) { byWindow.delete(windowId); await windows.remove(windowId) }
},
onClosed(handler) { closed.push(handler) },
}
}
```
Show on every approval:
* **The origin from the request** (`request.origin`), which the browser recorded. Never show a name or URL the page sent about itself.
* **`request.originWarnings`**: lookalike and punycode warnings from your `annotate` hook. The router snippet wires `PhishingDetector`, which reads a list in the `eth-phishing-detect` format. Ship the list inside your build; the kit never downloads it. A site ON the list never reaches the sheet: `refuse: (origin) => phishing.refusal(origin)` on the queue and the router answers it with 4100 before any window opens.
* **What will happen**: for transactions, the prepared fee (`payload.prepared.maxFee`) and your preview. The nonce on the sheet is a guess; the one signed is read after the approval. When the network’s fee outgrew the shown cap while the sheet was open, the same transaction comes back with `payload.repriced: true` and the new numbers: say the fee went up.
## The relay
[Section titled “The relay”](#the-relay)
The worker side checks the origin of every message against the port’s sender:
```ts
/** chrome.runtime.onConnect.addListener((port) => onPort(worker, port)) */
export function onPort({ router, ports }: WorkerParts, port: PortLike) {
if (port.name !== PORT_NAME) return
let origin: string | null = null
const post = (message: RelayToContent) => port.postMessage(message)
port.onMessage.addListener(async (message) => {
if (!isRelayRequest(message)) return
// The origin the browser recorded for this port, not the one the page claims.
const trusted = checkSenderOrigin(port.sender, message.origin)
if (!trusted) return // forged: dropped, never answered
if (origin === null) {
origin = trusted
if (!ports.has(origin)) ports.set(origin, new Set())
ports.get(origin)!.add(post)
}
let response: RelayResponse
try {
response = { kind: 'response', id: message.id, result: (await router.handle(trusted, message.chain, message.method, message.params)) ?? null }
} catch (e) {
// The page gets the EIP-1193 code and a URL-free message; anything internal is
// "Internal error" there, and the details stay in the extension's own log.
response = { kind: 'response', id: message.id, error: toRelayError(e, { log: (err) => console.error('[wallet] request failed', err) }) }
}
post(response)
})
port.onDisconnect.addListener(() => { if (origin) ports.get(origin)?.delete(post) })
}
```
The content script only stamps the page’s origin and forwards messages both ways:
```ts
/** Content script: stamps the page's origin and forwards both ways. It holds no wallet logic. */
export function startContentScript(env: ContentLike) {
const port = env.connect(PORT_NAME)
env.addPageListener((event) => {
// Only what the page itself posted: an iframe's parent.postMessage is not the site speaking.
const request = pageRequestFrom(event, env.page)
if (request) port.postMessage(stampOrigin(request, env.page.location.origin))
})
port.onMessage.addListener((message) => {
if (!isRelayToContent(message)) return
if (message.kind === 'response') {
env.postToPage({ target: PAGE_TARGET.toPage, id: message.id, ...('result' in message ? { result: message.result } : {}), ...(message.error ? { error: message.error } : {}) })
} else {
env.postToPage({ target: PAGE_TARGET.toPage, chain: message.chain, event: message.event, data: message.data })
}
})
}
```
Your injected provider (the `window.ethereum` object, EIP-6963 announcements) posts `PageRequest` messages with `target: PAGE_TARGET.toContent` and listens for responses and events. Keep it small: it runs in the page’s world, where the page can see and change it.
## What you still build
[Section titled “What you still build”](#what-you-still-build)
* The popup, the onboarding and unlock screens, and the approval page.
* The injected providers for the chains you support.
* The extension’s content security policy: `script-src 'self'`, no remote scripts or images.
* An allowlist of hosts your worker’s `fetch` may reach.
* A reproducible release build, and the store listing below.
## Publishing to the Chrome Web Store
[Section titled “Publishing to the Chrome Web Store”](#publishing-to-the-chrome-web-store)
The SDK ships no store listing. The store account is yours, and whoever controls it can push an update to every user of your wallet. Treat it like a signing key.
**The account**
* Use a dedicated Google account for publishing, not someone’s personal mail.
* Turn on 2-Step Verification with a passkey or a hardware security key, not SMS. The store requires 2-Step Verification before anyone can publish or update an item ([policy](https://developer.chrome.com/docs/webstore/program-policies/two-step-verification)).
* Working as a team: invite members to the publisher with the right roles instead of sharing one login ([publisher members](https://developer.chrome.com/docs/webstore/group-publishers)).
* The developer email can’t be changed after the account is created ([registration](https://developer.chrome.com/docs/webstore/register)).
**Identity and disclosures**
* Every publisher declares whether it is a trader. A trader’s legal name, phone number and address are shown on the listing ([trader FAQ](https://developer.chrome.com/docs/webstore/program-policies/trader-verification-faq)).
* Verify your publisher identity. The “Established Publisher” badge comes later, on its own, after a track record ([discovery](https://developer.chrome.com/docs/webstore/discovery)).
* Fill in the Privacy tab: a single purpose, a reason for every permission, the remote code declaration, the data use disclosures, and a privacy policy URL ([privacy fields](https://developer.chrome.com/docs/webstore/cws-dashboard-privacy)).
**The package**
* Ask for as few permissions as you can. Broad host permissions (``, `https://*/*`) and powerful ones (`tabs`, `cookies`, `webRequest`) get a longer review ([review process](https://developer.chrome.com/docs/webstore/review-process)).
* Bundle all code. MV3 doesn’t allow code loaded from outside the extension’s own files ([remote hosted code](https://developer.chrome.com/docs/extensions/develop/migrate/remote-hosted-code)). Submit readable code: obfuscation is not allowed.
**Releasing**
* Publish by hand from the dashboard. Don’t keep a publish token (an OAuth refresh token for the [Web Store API](https://developer.chrome.com/docs/webstore/using-api)) in CI: anyone who gets it can ship an update to all your users.
* Use deferred publishing to choose when a reviewed version goes live; you have 30 days. Once the item has more than 10,000 weekly users, roll out to a percentage of users first ([updates](https://developer.chrome.com/docs/webstore/update)).
* Plan for review time. Most reviews take a few days, some take a few weeks. After three weeks, contact developer support.
Check the current store policy yourself
Store rules, review times and dashboard fields change. We checked the facts above against Chrome’s documentation on 2026-10-24. Read the current [program policies](https://developer.chrome.com/docs/webstore/program-policies) before you submit.
# History
> One activity feed across every chain, with titles the modules write, paging, refresh, pending rows from an intent journal, and spam hidden.
`wallet.history()` returns one activity list for the account across every chain you registered a source for, newest first. Each row has a title a person can read (“Received USDC”, “Staked ETH”, “Swapped USDC → ETH”), the amounts that left and arrived, a fee, and an explorer link.
Three layers make it:
1. **Sources** read the chain: one per chain id, from an explorer or the RPC.
2. **Recognizers** turn a transaction into a row. Every registered protocol module recognizes its own transactions; a generic fallback covers sends, receives, approvals and unknown calls.
3. **The intent journal** records what your app meant when it broadcast, so a swap shows as one pending row before any explorer has it.
Snippets come from [`examples/history`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/history), which our CI typechecks and tests.
```sh
npm install @anywalletkit/kit @anywalletkit/history-evm
```
```ts
import { Wallet, createMemoryIntentJournal, type FeedItem, type HistoryFeedPage, type Intent, type IntentJournal } from '@anywalletkit/kit'
import type { ActivityAsset, ChainTx } from '@anywalletkit/core'
import { createEvmHistory } from '@anywalletkit/history-evm'
import LidoProtocolEvm from '@anywalletkit/protocol-staking-lido-evm'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana, createSolanaHistory } from '@anywalletkit/wallet-solana'
import { WalletManagerTon, createTonHistory } from '@anywalletkit/wallet-ton'
import { WalletManagerTron, createTronHistory } from '@anywalletkit/wallet-tron'
```
## Set up
[Section titled “Set up”](#set-up)
```ts
/** Keys for explorer APIs: on the client, point the URLs at your proxy instead. */
export interface HistoryKeys { etherscan?: string; blockscoutPro?: string; tonapi?: string; trongrid?: string }
export function walletWithHistory(seedPhrase: string, keys: HistoryKeys = {}): Wallet {
const wallet = new Wallet(seedPhrase, {
activity: {
// A label for contract calls no module recognizes.
known: { 'eip155:1': { '0x66a9893cc07d91d95644aedd05d03f95e1dba8af': 'Uniswap Universal Router' } },
onError: (report) => console.warn('history', report.stage, report.chain ?? report.module, report.error),
},
})
// The accounts: history reads account `index` on every chain that has a source.
// One registration per EVM network, each with its own RPC (see Chain ids: one RPC per EVM network).
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
wallet.registerWallet('eip155:8453', WalletManagerEvm, { provider: 'https://base-rpc.publicnode.com', chainId: 8453 })
wallet.registerWallet('solana', WalletManagerSolana, { provider: 'https://api.mainnet-beta.solana.com' })
wallet.registerWallet('ton', WalletManagerTon, { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } })
wallet.registerWallet('tron', WalletManagerTron, { provider: 'https://api.trongrid.io' })
// One source per chain.
const evmKeys = { ...(keys.etherscan ? { etherscanApiKey: keys.etherscan } : {}), ...(keys.blockscoutPro ? { blockscoutProApiKey: keys.blockscoutPro } : {}) }
wallet.registerHistorySource(createEvmHistory({ chainId: 1, ...evmKeys }))
wallet.registerHistorySource(createEvmHistory({ chainId: 8453, ...evmKeys }))
wallet.registerHistorySource(createSolanaHistory({ rpcUrl: 'https://api.mainnet-beta.solana.com' }))
wallet.registerHistorySource(createTonHistory(keys.tonapi ? { apiKey: keys.tonapi } : {}))
wallet.registerHistorySource(createTronHistory(keys.trongrid ? { apiKey: keys.trongrid } : {}))
// Every registered protocol labels its own transactions: a Lido stake reads "Staked ETH".
wallet.registerProtocol('lido', LidoProtocolEvm, { chain: 'eip155:1' })
return wallet
}
```
| Chain | Source | Keys |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| EVM (one per chain id) | `createEvmHistory` from `history-evm`: Etherscan v2, Blockscout PRO, Alchemy; keyless Blockscout and Routescan as fallbacks | Etherscan v2 needs a key; a free Etherscan key plus a free Blockscout PRO key cover most networks |
| Solana | `createSolanaHistory`: plain RPC, no indexer | Your RPC; public endpoints rate-limit fast |
| TON | `createTonHistory`: tonapi events, toncenter v3 fallback | Keyless tonapi is about 1 request/s |
| Tron | `createTronHistory`: TronGrid | Keyless is 1 request/s |
| Bitcoin, NEAR, Zcash | `createBtcHistory`, `createNearHistory`, `createZcashHistory` from the chain packages | See [Build a wallet → History](/build-a-wallet/history/) |
Explorer keys are secrets. On a mobile app or an extension, point the source at your own proxy (`etherscanUrl` and similar options) and keep the key on the server.
## Pages, refresh and errors
[Section titled “Pages, refresh and errors”](#pages-refresh-and-errors)
```ts
export async function firstPage(wallet: Wallet): Promise {
const page = await wallet.history({ limit: 20 }) // account 0, every chain with a source
// A source that failed is listed in page.errors and retried on the next call; the rest still loads.
return page
}
export async function nextPage(wallet: Wallet, cursor: string): Promise {
return wallet.history({ limit: 20, cursor })
}
export async function refresh(wallet: Wallet, lastSeen: number): Promise {
const { items } = await wallet.history({ since: lastSeen }) // only what is newer
return items
}
```
* **`cursor`** packs every source’s position into one string. Rows stay in time order across chains: a slow chain’s older rows are never shown after newer ones.
* **`since`** (unix seconds) returns only newer rows: use it for pull-to-refresh.
* **`errors`** lists what failed in this call: a source that is down, a recognizer that threw. The other chains still load, and the failed source keeps its place for the next call. Show a quiet “some activity may be missing” rather than an error screen.
* **Spam** is hidden by default: zero-value transfers and airdrops the source flags. Pass `includeSpam: true` for a “hidden” tab.
## Pending rows: the intent journal
[Section titled “Pending rows: the intent journal”](#pending-rows-the-intent-journal)
```ts
/** Call right after broadcasting a swap: the row shows at once, with what the user meant. */
export async function recordSwap(journal: IntentJournal, swap: {
id: string; from: string; sourceHash: string; out: ActivityAsset; in: ActivityAsset
}): Promise {
const intent: Intent = {
id: swap.id,
kind: 'swap',
createdAt: Math.floor(Date.now() / 1000),
chain: 'eip155:1',
address: swap.from,
hashes: [{ chain: 'eip155:1', hash: swap.sourceHash }], // source leg first
expect: { assetsOut: [swap.out], assetsIn: [swap.in] },
subtitle: 'LI.FI',
status: 'pending',
}
await journal.put(intent)
}
export function attachJournal(wallet: Wallet): IntentJournal {
const journal = createMemoryIntentJournal() // or your own { list, put, remove } over SQLite / MMKV
wallet.setIntentJournal(journal)
return journal
}
```
The chain alone can’t say “swapped USDC → ETH via LI.FI”: it shows a USDC transfer to a router. It can’t pair a bridge’s two legs on two chains, and nothing is there until the explorer indexes it. Record an intent right after broadcast:
* **Source leg first** in `hashes`. When the swap’s status reports the destination hash, `put` the intent again with it appended.
* **`expect`** holds the quote amounts, shown while the row is pending.
* **An intent that never gets its row** is marked failed after `pendingTtl` (24 hours by default).
* **Persist the journal** (SQLite, MMKV, a file): a pending swap must survive an app restart.
Earn modules and approvals don’t need intents: they recognize their own transactions.
## Rendering a row
[Section titled “Rendering a row”](#rendering-a-row)
```ts
/** One row of the activity list. Amounts are base units: format with the asset's decimals. */
export function row(item: FeedItem): { title: string; subtitle: string; amount: string; pending: boolean } {
const fmt = (a: ActivityAsset, sign: string) => `${sign}${units(a.amount, a.decimals ?? 0)} ${a.symbol ?? ''}`.trim()
const amount = [...item.assetsOut.map((a) => fmt(a, '−')), ...item.assetsIn.map((a) => fmt(a, '+'))].join(' ')
return { title: item.title, subtitle: item.subtitle ?? '', amount, pending: item.status === 'pending' }
}
function units(amount: bigint, decimals: number): string {
const s = amount.toString().padStart(decimals + 1, '0')
const whole = s.slice(0, s.length - decimals)
const frac = s.slice(s.length - decimals).replace(/0+$/, '')
return frac ? `${whole}.${frac}` : whole
}
```
| Field | Meaning |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kind` | `send`, `receive`, `self`, `swap`, `bridge`, `stake`, `unstake`, `claim`, `supply`, `withdraw`, `borrow`, `repay`, `approve`, `revoke`, `wrap`, `unwrap`, `contract`, `unknown` |
| `title`, `subtitle` | Readable title, and the venue or counterparty |
| `assetsOut`, `assetsIn` | What left and what arrived, in base units with `symbol` and `decimals` |
| `status` | `confirmed`, `failed`, `pending` |
| `counterparty`, `related` | The other party; the other leg of a cross-chain operation |
| `approval` | On `approve` / `revoke` rows: token, spender, amount (`null` = unlimited) |
| `fee`, `explorerUrl` | Network fee in the native coin; a link for the details |
**Address poisoning:** scammers send tiny transfers from an address that looks like one the user uses, hoping the user copies it from history. Never offer “copy address” on an incoming row without a warning, and don’t use history as the address book.
## One transaction
[Section titled “One transaction”](#one-transaction)
```ts
/** A detail screen for one transaction, through the same recognizers as the list. */
export async function detail(wallet: Wallet, tx: ChainTx): Promise {
return wallet.describeTransaction(tx)
}
```
`describeTransaction` runs one transaction through the same recognizers and journal: use it for a detail screen, or for a transaction your app just got from a push notification.
# Keyring
> Many accounts from one seed, imported keys, secure storage on the device, restore with discovery, and signing that holds the key only for one call.
`keyring` is the account list of a real wallet: several seeds and imported keys, accounts 0, 1, 2… on every chain, names, hidden accounts, the active one. It is also where the key handling rules live.
* **Secrets go only to your secure storage**, one entry per seed or key.
* **Everything else is public metadata**: names, addresses, flags, a fingerprint of the public key. Plain storage is fine for it.
* **The SDK holds no secret between calls.** Signing reads the secret, builds the account, signs, and wipes the key when the callback ends.
Snippets come from [`examples/keyring`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/keyring), which our CI typechecks and tests.
```sh
npm install @anywalletkit/keyring @anywalletkit/kit @anywalletkit/wallet-evm
```
```ts
import { Keyring, type AccountMeta, type ChainKey, type KeyringState, type KeyringStorage, type SecretStorage } from '@anywalletkit/keyring'
import { applyPolicies, type Policies } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
import { WalletManagerTon } from '@anywalletkit/wallet-ton'
import { WalletManagerTron } from '@anywalletkit/wallet-tron'
```
## Storage
[Section titled “Storage”](#storage)
The keyring takes two adapters: `secrets` (one entry per seed or key) and `storage` (names, addresses, flags).
### Secrets
[Section titled “Secrets”](#secrets)
On a phone, use [`@anywalletkit/secure-storage-react-native`](/build-a-wallet/keys-and-storage/#key-storage): every secret is a Keychain item (iOS) or a Keystore-wrapped file (Android) that only Face ID / Touch ID / a fingerprint, with the device passcode as the fallback, opens, on every read.
```ts
import { createSecureStorage } from '@anywalletkit/secure-storage-react-native'
const secrets = createSecureStorage({ namespace: 'my-wallet' }) // a SecretStorage
```
It is an Expo native module: it needs a development or Release build (not Expo Go) and `NSFaceIDUsageDescription` in `Info.plist`.
**Your own adapter** (Expo Go, another store, a test): `SecretStorage` is three methods. `delete` must resolve for an id that is not there: the keyring retries an interrupted delete on the next load. Over `expo-secure-store` it looks like this:
```ts
/** The shape of expo-secure-store (getItemAsync / setItemAsync / deleteItemAsync). */
export interface SecureStoreLike {
getItemAsync(key: string, options?: O): Promise
setItemAsync(key: string, value: string, options?: O): Promise
deleteItemAsync(key: string, options?: O): Promise
}
/**
* One secure-storage entry per source. `options` is where the protection lives:
* with expo-secure-store, `{ requireAuthentication: true,
* keychainAccessible: SecureStore.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY }`.
*/
export function secureSecrets(store: SecureStoreLike, options: O): SecretStorage {
const key = (sourceId: string) => `awk.secret.${sourceId}` // letters, digits, . - _ only
return {
get: (sourceId) => store.getItemAsync(key(sourceId), options),
set: (sourceId, secret) => store.setItemAsync(key(sourceId), secret, options),
delete: (sourceId) => store.deleteItemAsync(key(sourceId), options),
}
}
```
The protection is then in the storage options, so choose them on purpose:
| Option | What it does | Trade-off |
| ---------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------- |
| Ask for authentication on every read | Face ID / fingerprint / passcode before each signature | One prompt per signing session; batch reads where you can |
| Device only (`…THIS_DEVICE_ONLY`) | The secret never leaves the device in an OS backup | A new phone needs the recovery phrase |
| Passcode required (`WHEN_PASSCODE_SET…`) | No secret on a device without a passcode | Users without a passcode can’t create a wallet |
expo-secure-store and Face ID
With `requireAuthentication: true`, expo-secure-store 15 on iOS accepts **only** the currently enrolled biometrics (`.biometryCurrentSet`):
* **No passcode fallback.** A user whose Face ID fails cannot unlock.
* **Re-enrolling Face ID makes the item unreadable for good.** Only the recovery phrase gets the wallet back.
`secure-storage-react-native` allows biometrics **or** the device passcode and survives re-enrolment, which is why it exists. With your own adapter, use an access control that does the same, and test “Face ID fails → passcode” and “re-enroll Face ID” on a real device before you ship.
### Metadata
[Section titled “Metadata”](#metadata)
```ts
/** The shape of AsyncStorage / MMKV / chrome.storage: plain storage is fine, nothing here is secret. */
export interface PlainStoreLike {
getItem(key: string): Promise
setItem(key: string, value: string): Promise
}
export function plainMetadata(store: PlainStoreLike): KeyringStorage {
return {
load: async () => {
const json = await store.getItem('awk.keyring')
return json ? (JSON.parse(json) as KeyringState) : null
},
save: (state) => store.setItem('awk.keyring', JSON.stringify(state)),
}
}
```
## Set up
[Section titled “Set up”](#set-up)
```ts
export function openKeyring(storage: KeyringStorage, secrets: SecretStorage): Promise {
return Keyring.load({
storage, // names, addresses, flags
secrets, // one entry per seed or key
chains: {
evm: { Manager: WalletManagerEvm, config: { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 } },
solana: { Manager: WalletManagerSolana, config: { provider: 'https://api.mainnet-beta.solana.com' } },
ton: { Manager: WalletManagerTon, config: { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } } },
tron: { Manager: WalletManagerTron, config: { provider: 'https://api.trongrid.io' } },
},
})
}
```
Register every chain the wallet supports: each seed account gets an address on each of them. A chain added later is filled in with `missingChains(accountId)` and `completeAddresses(sourceId)`, with one secret read per seed.
### More than one EVM network
[Section titled “More than one EVM network”](#more-than-one-evm-network)
`chains.evm` takes one network (one RPC and `chainId`), and an EVM address is the same on every network. To sign on Base, Arbitrum or any other EVM network, open one more keyring per network over the **same** `secrets`, with a `storage` that never saves: the main keyring owns the metadata.
```ts
/**
* The same accounts on another EVM network. `chains.evm` takes one network, and the address is
* the same on all of them, so a second keyring over the same secrets signs on Base (or any EVM
* network) while the main one keeps the metadata.
*/
export function keyringOn(network: { provider: string; chainId: number }, storage: KeyringStorage, secrets: SecretStorage): Promise {
return Keyring.load({
storage: { load: () => storage.load(), save: async () => {} }, // read-only: the main keyring owns the metadata
secrets,
chains: { evm: { Manager: WalletManagerEvm, config: network } },
})
}
```
```ts
const base = await keyringOn({ provider: BASE_RPC, chainId: 8453 }, storage, secrets)
await base.withAccount(accountId, 'evm', (account) => account.sign(message)) // account.chain = eip155:8453
```
Create, import, rename and remove accounts on the main keyring only, then reopen the others (or keep them per screen): they read the metadata on `load`.
## Create a wallet
[Section titled “Create a wallet”](#create-a-wallet)
```ts
export async function createWallet(keyring: Keyring) {
const { account, mnemonic } = await keyring.createMnemonic({ words: 12 })
// `mnemonic` is for the backup screen only: show it, ask for a few words back, drop it.
return { account, mnemonic }
}
```
This is the only time the phrase is handed to your code without asking. Show it on a screen that blocks screenshots, ask the user to confirm a few words, then let the variable go.
## Restore a wallet
[Section titled “Restore a wallet”](#restore-a-wallet)
```ts
/** Your check: any balance or history on any of the addresses. */
export type IsUsed = (addresses: Partial>) => Promise
export async function restoreWallet(keyring: Keyring, phrase: string, isUsed: IsUsed) {
const { accounts } = await keyring.importMnemonic(phrase, {
// Adds account 0, then 1, 2… while they have activity; stops at the first unused one.
discover: { isUsed: (addresses) => isUsed(addresses), gapLimit: 1, maxIndex: 20 },
})
return accounts
}
```
A restored seed may have used accounts beyond 0. `discover` derives the next ones and asks your `isUsed` whether each has a balance or history, stopping after `gapLimit` unused ones in a row (1 is what MetaMask and Phantom do). The keyring has no indexer, so `isUsed` is yours: a balance read, or the [history](/build-a-wallet/history/) source of each chain.
Importing the same seed twice throws `KeyringError` with `code: 'duplicate'`. The check compares a fingerprint of the public key, so no secret is kept for it. The same holds for the same key in another format.
## Manage accounts
[Section titled “Manage accounts”](#manage-accounts)
```ts
export async function manageAccounts(keyring: Keyring, sourceId: string): Promise {
const second = await keyring.addAccount(sourceId, { name: 'Savings' }) // the next index of this seed
await keyring.renameAccount(second.id, 'Long-term')
await keyring.setActiveAccount(second.id)
// Reading accounts never touches a secret: no biometric prompt, no key in memory.
return keyring.listAccounts() // hidden accounts are left out unless { includeHidden: true }
}
```
`listAccounts()`, `state` and `getAccountMeta()` never read a secret, so the account picker, the portfolio and the receive screen open without a biometric prompt.
## Sign
[Section titled “Sign”](#sign)
```ts
export async function signMessage(keyring: Keyring, accountId: string, policies: Policies, message: string) {
// One secret read, one live account, zeroized when the callback returns or throws.
return keyring.withAccount(accountId, 'evm', async (account) => {
const guarded = applyPolicies(account, policies, account.chain) // fee caps, lists, confirm
return guarded.sign(message)
})
}
```
`withAccount` reads the secret once, builds the chain manager, runs your callback and disposes the key whatever happens. Accounts from the keyring are not wrapped by [policies](/concepts/policies/) on their own: wrap them with `applyPolicies`, as above, so fee caps, lists and your `confirm` step apply like on accounts from `Wallet`.
Before it returns the account, the keyring checks that the address still matches the stored one. A changed chain config or a swapped secret fails loudly instead of signing from an unexpected address.
## Import keys
[Section titled “Import keys”](#import-keys)
```ts
export async function importKey(keyring: Keyring, chain: ChainKey, key: string, confirm: (address: string) => Promise) {
const address = await keyring.previewPrivateKey(chain, key) // stores nothing
if (!(await confirm(address))) return null
return keyring.importPrivateKey(chain, key, { label: 'Imported' })
}
export async function importTonkeeper(keyring: Keyring, words: string) {
return keyring.importTonMnemonic(words) // the address Tonkeeper shows for these 24 words
}
```
| Source | Accounts | Formats |
| ----------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Seed phrase (BIP-39, optional passphrase) | 0, 1, 2… on every registered chain | 12 or 24 English words |
| Private key | One, on one chain | EVM / Tron hex; BTC WIF or hex; Solana base58 or JSON byte array; TON hex; NEAR `ed25519:…`; Zcash WIF or hex |
| TON 24-word mnemonic | One TON account | Tonkeeper, Tonhub, MyTonWallet |
Always show the address from `previewPrivateKey` before importing: a key pasted into the wrong chain imports a different, empty account.
## Back up and remove
[Section titled “Back up and remove”](#back-up-and-remove)
```ts
/** "Show recovery phrase": ask for biometrics or the passcode first, every time. */
export async function revealSecret(keyring: Keyring, sourceId: string, authenticate: () => Promise) {
if (!(await authenticate())) throw new Error('Not authenticated.')
return keyring.exportSecret(sourceId) // { type, secret, passphrase?, chain? }
}
/** "Export private key" for one account on one chain: the same gate as the phrase. */
export async function revealPrivateKey(keyring: Keyring, accountId: string, chain: ChainKey, authenticate: () => Promise) {
if (!(await authenticate())) throw new Error('Not authenticated.')
// Checked against the account's address before it is returned; TON 24-word wallets are refused.
const { privateKey, format, address, compatibleWith } = await keyring.exportPrivateKey(accountId, chain)
return { privateKey, format, address, compatibleWith } // e.g. format 'hex' (EVM 0x…), 'wif' (BTC)
}
export async function removeWallet(keyring: Keyring, sourceId: string) {
await keyring.removeSource(sourceId) // its accounts, and its entry in secure storage
}
```
`exportSecret` returns the phrase or the key itself. Gate it behind authentication every time, block screenshots on that screen, and never copy it to the clipboard without a warning. `removeSource` removes the source and its accounts from the metadata first, then deletes the secure-storage entry. A failed save leaves everything as it was; a delete that fails (or never runs because the app was killed) stays in `pendingSecretDeletes` and `Keyring.load` finishes it.
`exportPrivateKey(accountId, chain)` returns one account’s key on one chain, for an “Export private key” screen. Treat it like the phrase: authenticate first, show it once.
* **The format other wallets import.** EVM gets `0x` hex (MetaMask, Rabby), Tron plain hex, Bitcoin and Zcash compressed WIF, Solana base58 of the 64-byte secret (Phantom), NEAR `ed25519:…`. `compatibleWith` names wallets that accept it.
* **Checked before it is returned.** The SDK builds an account from the exported key and compares its address with the account’s. If they differ, nothing is returned.
* **One key, not the wallet.** It controls this account on this chain only. Say so on the screen: a user who wants everything back needs the phrase.
* **TON wallets imported from 24 TON words** are refused: Tonkeeper and other TON wallets import only those words, so export them with `exportSecret` instead.
* **Bitcoin in Electrum** needs a `p2wpkh:` prefix before the WIF to land on the same SegWit address.
## How the key is kept in memory
[Section titled “How the key is kept in memory”](#how-the-key-is-kept-in-memory)
* **A phrase becomes the 64-byte seed** the moment the SDK gets it. A JS string cannot be wiped, bytes can.
* **No seed or key is a property of any SDK object**, so logging an account or a crash report shows addresses and public keys only.
* **Each account holds only its own key**, never the master seed, and `dispose()` wipes it.
These rules are checked by the conformance suite on every chain. See [Keys and storage](/build-a-wallet/keys-and-storage/) for the wider picture.
# Names
> ENS names in the recipient field — the address for the right chain, lookalike-letter warnings, a re-check before signing, primary names and avatars.
Users type `vitalik.eth`, `jesse.base.eth` or `alice.cb.id` instead of an address. `names-ens` turns the name into the address **for the chain the user is sending on**, flags names written to look like other names, and re-checks the name right before signing.
The resolver implements `NameResolver` from `core`. Solana (`.sol`), TON (`.ton`) and NEAR names will plug into the same interface. Snippets come from [`examples/names`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/names), which our CI typechecks and tests; the live run resolves real names on Ethereum and Base.
```sh
npm install @anywalletkit/names-ens
```
```ts
import { NameError, assertNameUnchanged, isNameLike, nameResolvers, type NameResolver, type ResolvedName } from '@anywalletkit/core'
import { ensResolver } from '@anywalletkit/names-ens'
```
## Set up
[Section titled “Set up”](#set-up)
```ts
export function names(): NameResolver {
return nameResolvers([
// More specific resolvers (.sol, .ton) go before ENS when they exist: ENS also serves DNS names.
ensResolver({
rpcUrl: 'https://ethereum-rpc.publicnode.com', // always Ethereum mainnet, whatever chain you send on
cacheTtlMs: 5 * 60_000,
ipfsGateway: 'https://ipfs.io/ipfs/', // point at your own proxy in production
}),
])
}
```
ENS lives on Ethereum mainnet, so the resolver always needs an Ethereum RPC, even when the user sends on Base or Arbitrum. Names that resolve off-chain (Coinbase `cb.id`, Basenames, `uni.eth`) go through CCIP-Read without extra setup in a browser, an extension or Node. On React Native they go through your server ([React Native](#react-native) below). Results are cached for five minutes by default.
## The recipient field
[Section titled “The recipient field”](#the-recipient-field)
```ts
export type Recipient =
| { kind: 'address'; address: string }
| { kind: 'name'; resolved: ResolvedName }
| { kind: 'error'; message: string }
/** The recipient field: an address passes through, a name is resolved for THIS chain. */
export async function readRecipient(resolver: NameResolver, input: string, chain: string): Promise {
const text = input.trim()
// On NEAR, `alice.near` IS the account address; elsewhere a dotted string is never an address.
if (!isNameLike(text) || chain.startsWith('near:')) return { kind: 'address', address: text } // validate it as an address next
// Not served: an invalid name, a lookalike-letter mixture (`vitаlik.eth` with a Cyrillic "а"), or a TLD with no resolver yet.
if (!resolver.supports(text)) return { kind: 'error', message: 'This name is not valid, or names like it are not supported yet.' }
try {
return { kind: 'name', resolved: await resolver.resolve(text, chain) }
} catch (e) {
if (!(e instanceof NameError)) throw e
const messages: Record = {
'invalid-name': 'This is not a valid name.',
'not-found': 'No one owns this name.',
'no-address-for-chain': 'This name has no address for this network.', // never send to its Ethereum address instead
unsupported: 'Names like this are not supported yet.',
'lookup-failed': 'Could not look the name up. Try again.',
}
return { kind: 'error', message: messages[e.code] ?? e.message }
}
}
```
* **One chain per lookup.** `resolve(name, 'eip155:8453')` reads the name’s Base address. A name with no Base record is an error, `no-address-for-chain`, and **never** its Ethereum address: sending to the mainnet address on another chain is how funds get lost.
* **Bitcoin and Solana records** are read the same way: `bip122:…` and `solana:…` as the chain.
* **Invalid names are refused before any network call**, with the reason. Names are normalized per ENSIP-15, so mixed scripts like `vitаlik.eth` (a Cyrillic “а”) don’t resolve at all.
* **On NEAR**, `alice.near` is the account address itself, not a name to resolve.
| `NameError` code | What to tell the user |
| ---------------------- | ------------------------------------------------- |
| `invalid-name` | Not a valid name |
| `not-found` | No one owns this name |
| `no-address-for-chain` | The name has no address for this network |
| `unsupported` | Names like this aren’t supported yet |
| `lookup-failed` | The lookup failed; try again (the name may exist) |
| `changed` | The name points elsewhere now (see below) |
## Review and signing
[Section titled “Review and signing”](#review-and-signing)
```ts
/** The review screen shows the address the name resolved to, and every warning. */
export function reviewLines(resolved: ResolvedName): string[] {
return [`${resolved.name} → ${resolved.address}`, ...resolved.warnings.map((w) => `⚠ ${w.message}`)]
}
/** Right before signing: resolve again; refuse if the name now points elsewhere. */
export async function beforeSigning(resolver: NameResolver, resolved: ResolvedName): Promise {
await assertNameUnchanged(resolver, resolved.name, resolved.chain, resolved.address) // throws NameError 'changed'
}
```
* **Show the resolved address, not only the name.** The address gets the funds.
* **Show every warning** that comes with the result: `confusable` (Latin letters replaced by lookalikes), `mixed-script`, `punycode`. Each has a sentence you can show as-is.
* **Resolve again right before signing.** An owner can point the name somewhere else between the review screen and the tap on “Send”. `assertNameUnchanged` throws `changed` when that happens; go back to the review screen with the new address.
## Primary names and avatars
[Section titled “Primary names and avatars”](#primary-names-and-avatars)
```ts
/** The account header: the verified primary name and its avatar URL, if any. */
export async function profile(resolver: NameResolver, address: string, chain: string) {
const name = await resolver.reverse(address, chain) // counts only if it resolves back to this address
const avatar = name ? await resolver.avatar(name) : null // a URL: fetch it through your proxy
return { name, avatar }
}
```
`reverse` returns the primary name of an address only when that name resolves back to the same address. Anyone can set any primary name on their own address, so an unverified one proves nothing. L2 primary names (ENSIP-19) are read for the chain you pass.
`avatar` returns the name’s avatar record when it is an https URL on a public host, or an IPFS one through your gateway, and never fetches it. NFT avatars come back `null`: resolving one would fetch the metadata URL the NFT’s issuer chose. Fetch avatars through your own proxy, so the user’s IP and address list don’t reach arbitrary servers.
Offchain names (CCIP-Read) make the device fetch gateway URLs the name’s resolver chooses. The resolver built from `rpcUrl` asks only https gateway URLs whose host, as written, is not a private one, refuses redirects, and reads at most 1 MiB within 10 s per gateway (`ccip: { maxResponseBytes, timeoutMs }`). Where the host really resolves depends on the runtime:
* **Node**, no `ccip.fetch`: gateways go through the same pinned transport as `createEnsCcipHandler` — every DNS answer is checked and the connection is pinned to it, so a public-looking name that resolves to a private address is not asked. A host whose records mix public and private addresses is refused; behind a corporate split-horizon DNS or an outbound proxy, pass `ccip.fetch`.
* **Browser** and other runtimes: the global fetch connects. The URL is checked, the address it resolves to is not — no DNS-level isolation. Send gateway calls through your server (`ensCcipViaProxy`, below) where that matters.
If you pass your own viem `client`, create it with `ccipRead: ensCcipRead` from `@anywalletkit/names-ens` (or `ccipRead: false`): viem’s default would fetch any URL, a router’s admin page on the user’s network included.
## React Native
[Section titled “React Native”](#react-native)
React Native’s fetch follows redirects whatever `redirect: 'error'` says, so a gateway could redirect the device to a LAN or loopback address, and the request goes out before the SDK can see the final URL. There, offchain names are off by default: they fail with `lookup-failed`, and the error’s `reason` is `ccip-proxy-required`. The safe setup sends each gateway call to your own server, which refuses redirects and checks the address it connects to.
On the server, one route with `createEnsCcipHandler` from `@anywalletkit/names-ens/server` (Node: it connects with `node:https`). Authenticate and rate-limit it like your other routes: without that it fetches https URLs for anyone.
```ts
// app/api/ccip/route.ts (Next.js; any framework works the same way)
import { createEnsCcipHandler } from '@anywalletkit/names-ens/server'
export const runtime = 'nodejs'
const ccip = createEnsCcipHandler() // options: allowHosts, denyHosts, timeoutMs, maxResponseBytes
export async function POST(req: Request): Promise {
await requireUser(req) // your auth + rate limit: throw a 401 / 429 Response
const raw = await req.text()
if (raw.length > 160 * 1024) return Response.json({ error: 'request too large' }, { status: 413 })
let body: unknown
try { body = JSON.parse(raw) } catch { return Response.json({ error: 'invalid JSON' }, { status: 400 }) }
const out = await ccip(body) // { url, method, body? } → { data } or { error }
return Response.json(out.body, { status: out.status })
}
```
The handler asks only https gateways on public hosts. It resolves the host and refuses it when any address is private, loopback, link-local, CGNAT or an IPv6 address carrying one of those, then connects to the checked address, so a second DNS answer cannot move the request (DNS rebinding). It never follows a redirect, applies a timeout (10 s) and an answer cap (1 MiB), sends GET or POST exactly as EIP-3668 defines them, and forwards none of the app’s headers or cookies.
In the app, `ensCcipViaProxy` is the `fetch` for the resolver. It needs no Node API and runs on Hermes:
```ts
/**
* ENS names on React Native: offchain names (cb.id, Basenames, uni.eth) ask their CCIP-Read gateways through
* the server's `/ccip` route, because the device's fetch cannot refuse a gateway's redirect.
*/
export function namesOverServer(api: string, token: string, ethereumRpc: string): NameResolver {
return ensResolver({
rpcUrl: ethereumRpc,
ccip: {
fetch: ensCcipViaProxy(`${api}/ccip`, {
headers: { authorization: `Bearer ${token}` },
// https in production; plain http only for a server on this machine (the tests).
allowInsecureProxyUrl: /^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?$/.test(api),
}),
},
})
}
```
The reference server has this route at `POST /ccip`, behind the same token check and rate limits as its other routes:
```ts
if (url.pathname === '/ccip') {
guard.ccip(req) // the token and a per-caller limit, before the body is read
const raw = await readBody(req, 160 * 1024) // the gateway URL or calldata: up to 64 KiB of hex each
let body: unknown
try { body = JSON.parse(raw) } catch { return send(res, 400, { error: 'invalid JSON' }) }
const out = await ccip(body) // { url, method, body? } → { data } or { error }
return send(res, out.status, out.body)
}
```
If you would rather not run the route, `ccip: { allowRedirectFollowingFetch: true }` asks gateways directly and accepts that a redirecting gateway can make the device send one blind request (the answer is never used) to a host on the user’s network.
With your own `client`, the same options go to `ccipRead: createEnsCcipRead({ … })`.
# Networks
> One table of networks and RPC endpoints — shipped failover lists, the user's own RPCs, testnets, sites that add chains — and how to wire it into the wallet.
`networks` is the wallet’s list of networks and the endpoints to reach them:
* the catalog mainnets (30 EVM networks, Solana, TON, Tron, Bitcoin, NEAR, Zcash), each with a shipped list of public RPCs to fail over through;
* default testnets, shipped switched off;
* the RPCs and custom networks the user adds, and the ones sites add through `wallet_addEthereumChain`;
* a verifier that proves an endpoint serves the network it claims before the wallet trusts it.
It is plain TypeScript with no runtime dependencies beyond the asset catalog, and runs under Hermes. Snippets come from [`examples/networks`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/networks), which our CI typechecks and tests.
```sh
npm install @anywalletkit/networks
```
```ts
import {
NetworksTable, SOLANA_CHAIN, checkRpcUrl, isAddChainError, parseAddChainParams, verifyNetwork,
type FetchLike, type JsonStorage, type Network, type NetworksState,
} from '@anywalletkit/networks'
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
```
## The table
[Section titled “The table”](#the-table)
```ts
/** Load once at cold start. Storage holds only the user's changes; the shipped lists stay current. */
export async function openNetworks(storage: JsonStorage): Promise {
const table = new NetworksTable(storage) // AsyncStorage, MMKV, chrome.storage…
await table.load()
return table
}
```
The table stores only what the user changed. The shipped lists live in the package, so an app update with new endpoints reaches every install, and the user’s own RPCs stay on top.
| Rule | Why |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| Built-in networks can’t be removed; the user can add RPCs before the shipped list, or switch a network off | The fallback is always there |
| “Only my RPC” (`setOnlyOwnRpc`) drops the shipped fallback | For users who don’t want any public provider to see their addresses |
| A custom network needs at least one RPC and gets no fallback | There is nothing to fall back to |
| A stored custom entry for a built-in chain id is ignored | A site must not replace Ethereum’s endpoints |
| A failing user RPC is parked with the reason (`markRpc`) until it passes again | Failover skips it; the settings screen shows why |
## Wire it into the wallet
[Section titled “Wire it into the wallet”](#wire-it-into-the-wallet)
```ts
export function walletOnNetworks(seedPhrase: string, table: NetworksTable, evmChainIds: number[]): Wallet {
const wallet = new Wallet(seedPhrase)
for (const id of evmChainIds) {
// One registration per EVM network: its own failover list, user RPCs first.
wallet.registerWallet(`eip155:${id}`, WalletManagerEvm, { provider: table.rpcUrlsForSync(`eip155:${id}`), chainId: id })
}
wallet.registerWallet('solana', WalletManagerSolana, { provider: table.rpcUrlsForSync(SOLANA_CHAIN) })
return wallet
}
```
`rpcUrlsForSync` answers from memory, so client factories can call it synchronously after `load()`. Register each EVM network on its own chain id to give it its own list.
Two names for the same chain: the table names Solana `solana:mainnet`, while accounts report the genesis-hash form (`solana:5eykt4…`). Use the table’s id when you read endpoints, and the account’s `chain` everywhere else.
## The user’s own RPC
[Section titled “The user’s own RPC”](#the-users-own-rpc)
```ts
/** "Add your own RPC": check the URL, prove the endpoint serves this chain, then store it. */
export async function addUserRpc(table: NetworksTable, caip2: string, url: string, fetch?: FetchLike) {
const policy = checkRpcUrl(url, { allowHttpLocal: table.allowHttpLocalSync() })
if (!policy.ok) return { ok: false as const, error: policy.message } // http, credentials in the URL…
const network = (await table.get(caip2))!
const result = await verifyNetwork(network, { rpc: url, ...(fetch ? { fetch } : {}) })
if (!result.ok) return { ok: false as const, error: result.error! } // e.g. "chain-id-mismatch: …"
await table.addRpc(caip2, url) // goes before the shipped list
await table.markRpc(caip2, url, result)
return { ok: true as const, latencyMs: result.latencyMs }
}
```
`checkRpcUrl` allows `https://` anywhere, and `http://` only for private addresses (`localhost`, `192.168.x.x`, `*.local`…) with the “allow local HTTP” setting on. Credentials in the URL are refused: use a keyed path or a header.
`verifyNetwork` asks the endpoint who it is and compares it with the network:
| Family | Identity checked | Tip |
| -------------- | ------------------------------ | ------------------- |
| EVM | `eth_chainId` | `eth_blockNumber` |
| Solana | genesis hash | slot |
| TON | global id from config param 19 | masterchain seqno |
| Tron | genesis block id | latest block |
| Bitcoin, Zcash | genesis block | tip height |
| NEAR | `chain_id` | latest block height |
It never throws. A failure comes back with a coded reason: `chain-id-mismatch`, `url-policy`, `redirected`, `http-`, `timeout`, `unreachable`… An endpoint that changes its chain id later is treated as an attack, not an outage. Redirects are refused: the URL policy judged the address that was entered, so an endpoint that answers through a redirect fails with `redirected` until the user enters its final URL. Show the reason to the user; a site that supplied the endpoint gets a generic error.
```ts
/** Label screens that ran through an endpoint you didn't ship. */
export function reviewLabel(table: NetworksTable, caip2: string): string | null {
return table.usesUserRpcSync(caip2) ? 'Custom RPC: the simulation comes from a node you added' : null
}
```
A simulation or a balance from a node you didn’t ship is only as honest as that node. Say so on the review screen.
## Testnets
[Section titled “Testnets”](#testnets)
Testnets ship switched off: Sepolia, Base Sepolia, Arbitrum Sepolia, OP Sepolia, Polygon Amoy, BSC testnet, Monad testnet, Solana devnet, Bitcoin testnet4, TON testnet, Tron Nile, NEAR testnet. A Zcash testnet entry exists, but no public API answers for it, so the user brings a Blockbook. Turn one on with `table.enable(caip2, true)`, and show a clear “testnet” badge wherever its balances appear.
## Sites that add a network
[Section titled “Sites that add a network”](#sites-that-add-a-network)
```ts
/** A site calls wallet_addEthereumChain. Never add silently: ask, verify, then store. */
export async function onAddEthereumChain(
table: NetworksTable,
origin: string,
params: unknown,
ask: (network: Network) => Promise,
fetch?: FetchLike,
): Promise {
// `known` decides which chains a site may add: by default only the catalog (already built in),
// here any chain the user approves.
const parsed = parseAddChainParams(params, { origin, known: () => true })
if (isAddChainError(parsed)) return parsed // the EIP-1193 error to answer with
if (await table.get(parsed.caip2)) return null // known already: nothing to add
if (!(await ask(parsed))) return { code: 4001, message: 'User rejected the request.' }
const result = await verifyNetwork(parsed, fetch ? { fetch } : {})
// The site gets a generic answer: what the endpoint said (or where it redirected) is for the user's
// own screen, not for the page that supplied the endpoint.
if (!result.ok) return { code: -32603, message: "The network's RPC failed the check." }
await table.add(parsed)
return null
}
```
`parseAddChainParams` turns a `wallet_addEthereumChain` request into a network, or into the EIP-1193 error to answer with: `-32602` for bad params, `4902` for a chain the wallet refuses. By default only catalog chains are accepted, and those are built in already. Pass `known` to let users add others. The new network records the site’s origin.
Never add a network silently. Show the chain id, the name, the RPC and the requesting site, verify the endpoint, and only then store it.
# Swaps and bridges
> Quote every swap provider at once, let the user pick a route, execute it safely and track delivery across chains.
One interface covers same-chain swaps and cross-chain transfers. A **router** asks every provider you install in parallel, checks each quote the same way, ranks the routes and executes the one you choose. Snippets on this page come from [`examples/swap`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/swap), which our CI typechecks and tests.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-router \
@anywalletkit/protocol-swap2-lifi @anywalletkit/protocol-swap2-near-intents \
@anywalletkit/protocol-swap2-thorchain @anywalletkit/protocol-swap2-chainflip \
@anywalletkit/protocol-swap2-cctp \
@anywalletkit/protocol-swap2-usdt0 \
@anywalletkit/protocol-swap2-uniswap @anywalletkit/protocol-swap2-wrap \
@anywalletkit/protocol-swap2-jupiter
```
The router bundles no provider. Only the providers you install and pass in end up in your app, and each provider also works on its own without the router.
```ts
import type { IWalletAccount, Swap2Options } from '@anywalletkit/core'
import { RouterSwap2Protocol, type Swap2Route } from '@anywalletkit/protocol-swap2-router'
import { lifiProvider } from '@anywalletkit/protocol-swap2-lifi/provider'
import { nearIntentsProvider } from '@anywalletkit/protocol-swap2-near-intents/provider'
import { thorchainProvider } from '@anywalletkit/protocol-swap2-thorchain/provider'
import { chainflipProvider } from '@anywalletkit/protocol-swap2-chainflip/provider'
import { jupiterProvider } from '@anywalletkit/protocol-swap2-jupiter/provider'
import { cctpProvider } from '@anywalletkit/protocol-swap2-cctp/provider'
import { usdt0Provider } from '@anywalletkit/protocol-swap2-usdt0/provider'
import { uniswapProvider } from '@anywalletkit/protocol-swap2-uniswap/provider'
import { wrapProvider } from '@anywalletkit/protocol-swap2-wrap/provider'
import {
Swap2FeeLimitError, Swap2InFlightError, Swap2InsufficientGasError, Swap2MaybeSentError, Swap2QuoteError,
} from '@anywalletkit/protocol-swap2-core'
```
## 1. Pick providers
[Section titled “1. Pick providers”](#1-pick-providers)
```ts
const RPC = {
1: ['https://ethereum-rpc.publicnode.com'],
8453: ['https://base-rpc.publicnode.com'],
42161: ['https://arbitrum-one-rpc.publicnode.com'],
} as const
export function providers() {
return [
// Cross-chain venues: their APIs quote and build the route.
lifiProvider({}), // apiKey: raises LI.FI's rate limit
nearIntentsProvider({}), // jwt: removes 1Click's fee
thorchainProvider({}),
chainflipProvider(), // native BTC / SOL / TRX and stables; no key, 0 bps
cctpProvider({ rpcUrls: { 'eip155:1': RPC[1][0], 'eip155:8453': RPC[8453][0] } }),
usdt0Provider({ rpcUrls: { 'eip155:1': RPC[1], 'eip155:42161': RPC[42161] } }), // RPC for each source chain
// Same-chain venues priced straight from the contracts: no API, no key.
uniswapProvider({ rpcUrls: RPC }),
wrapProvider({ rpcUrls: RPC }),
// Same-chain Solana: Jupiter's /build instructions, checked and assembled locally; apiKey optional.
jupiterProvider({ rpcUrls: ['https://api.mainnet-beta.solana.com'] }),
]
}
```
| Provider | Kind | Good at |
| --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lifi` | Aggregator API | Same-chain and cross-chain, many bridges and DEXes behind one quote |
| `near_intents` | Intents (1Click) | Cross-chain between different ecosystems: EVM, Solana, Tron, Bitcoin, NEAR… |
| `thorchain` | Native cross-chain | Native BTC and other L1 coins |
| `chainflip` | Native cross-chain (vault swaps) | Native BTC, ETH, SOL, TRX and USDC / USDT; from Ethereum, Arbitrum and Tron to those plus Solana and Bitcoin; no key, 0 bps |
| `omniston` | STON.fi | TON swaps, TON ↔ EVM and EVM ↔ EVM stablecoin orders |
| `cctp` | Circle burn-and-mint | USDC between EVM chains, no slippage |
| `usdt0` | Tether’s LayerZero OFT | USDT / USDT0 between 16 EVM chains in one transaction; the direct USDT path into HyperEVM |
| `uniswap`, `balancer` | On-chain DEX | Same-chain, priced from the contracts, no API key |
| `wrap` | WETH9 | Native ↔ wrapped native, 1:1 |
| `jupiter` | Solana aggregator (Metis) | Same-chain Solana swaps; instructions from Jupiter’s `/build`, checked and assembled locally, no Jupiter fee; key optional |
| `fynd` | EVM aggregator (Propeller Heads) | Same-chain swaps on Ethereum, Base, Arbitrum, BNB Chain, Polygon, Unichain and Robinhood Chain through the Tycho router; key or your own Fynd server. Its outputs are under the [Fynd License](https://github.com/propeller-heads/fynd/blob/main/LICENSE.md): read it before you ship |
## 2. Create the router
[Section titled “2. Create the router”](#2-create-the-router)
The router is bound to one account: the source of the swap. Its chain is the source chain.
```ts
export function swapsFor(account: IWalletAccount): RouterSwap2Protocol {
return new RouterSwap2Protocol(account, {
fromChain: account.chain, // the source chain is the account's chain
providers: providers(),
prefer: 'best', // or 'fastest'
// Progress for your UI: approving → requoting → preflight → signing → broadcast.
onExecutionPhase: (phase, detail) => console.log('swap', phase, detail ?? ''),
})
}
```
## 3. Describe the swap
[Section titled “3. Describe the swap”](#3-describe-the-swap)
```ts
// 100 USDC on Ethereum → USDC on Base, delivered to the same address.
export async function usdcToBase(account: IWalletAccount): Promise {
return {
fromToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC on Ethereum (or the symbol 'USDC')
toToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base: the destination chain's own id
toChain: 'eip155:8453',
fromTokenAmount: 100_000_000n, // 100 USDC, 6 decimals
recipient: await account.getAddress(),
}
}
```
* `fromToken`: a token on the **source** chain, as its contract address or a catalog symbol (`'USDC'`, `'ETH'`).
* `toToken`: the token on the **destination** chain, as that chain’s own id: a contract address, a Solana mint or a TON jetton master. A symbol that does not exist in the catalog of the destination chain leads to “no route”.
* Tokens outside the catalog (the user’s own) need `allowUnlistedTokens` on the engine: see [Custom tokens](/guides/tokens/#swap-it).
* Omit `toChain` for a same-chain swap.
* Amounts are `bigint` in base units. Use `toTokenAmount` instead of `fromTokenAmount` for exact-output swaps.
## 4. Quote
[Section titled “4. Quote”](#4-quote)
```ts
export async function bestQuote(swaps: RouterSwap2Protocol, options: Swap2Options) {
const quote = await swaps.quoteSwap2(options) // asks every provider in parallel, nothing is signed
return {
receive: quote.toTokenAmount, // expected output
atLeast: quote.toTokenAmountMin, // guaranteed output: show this one
seconds: quote.estimatedDuration,
fees: quote.fees, // network / protocol / affiliate, each in its own token
}
}
```
Show the user `toTokenAmountMin`, not `toTokenAmount`: it is what the route guarantees.
## 5. Let the user pick a route
[Section titled “5. Let the user pick a route”](#5-let-the-user-pick-a-route)
```ts
export async function routePicker(
swaps: RouterSwap2Protocol,
options: Swap2Options,
render: (routes: Swap2Route[], searching: boolean) => void,
): Promise {
return swaps.quoteSwap2Routes(options, {
// Called each time another provider answers: show the first price at once.
onUpdate: (routes, pending) => render(routes, pending.length > 0),
})
}
// route = { provider, quote, netValueUsd, relativeValue, tags: ['best'] | ['fastest'] | … }
```
Routes come back ranked by value. Two of them are tagged:
* **`best`**: the highest value. Routes within 0.2% of each other count as the same price; inside that band the faster and more reliable route wins.
* **`fastest`**: the lowest estimated time.
For a real USDC Ethereum → Base quote on 100 USDC, this returned four routes: CCTP tagged `best` (99.989 USDC guaranteed, \~3 minutes), LI.FI tagged `fastest` (99.735 USDC, seconds), then NEAR Intents and THORChain. For 25 USDT from Ethereum to USDT0 on Arbitrum, USDT0 came out `best` (exactly 25 guaranteed, \~17 minutes) and LI.FI `fastest`.
Pass `valueUsd: usdValue(prices)` to the router to rank on net USD value. Gas and native bridge fees are then subtracted.
## 6. Execute
[Section titled “6. Execute”](#6-execute)
```ts
export async function execute(swaps: RouterSwap2Protocol, options: Swap2Options, route: Swap2Route) {
const result = await swaps
.using(route.provider) // exactly the route the user picked
.swap2({ ...options, minAmountOut: route.quote.toTokenAmountMin }) // never accept less than you showed
return result.id // keep it: status, claims and support all start from this id
}
```
Before anything is signed, the router fetches a live quote from the chosen provider and checks it against what you showed:
* the output is not below your `minAmountOut`;
* the recipient, amounts and chains match the request;
* the transaction sends exactly the quoted amount, and any transfer or approval inside it names only your account, the quoted deposit address or the declared spender;
* aggregator calls go only to that provider’s audited contracts.
A route that fails any check is refused, and nothing is sent. ERC-20 approvals are for the exact amount, never unlimited, and are revoked again if the swap fails after approving. On Ethereum, USDT is reset to zero first, as that token requires.
### Show a review screen
[Section titled “Show a review screen”](#show-a-review-screen)
```ts
export function swapsWithReview(account: IWalletAccount, confirm: (text: string) => Promise) {
return new RouterSwap2Protocol(account, {
fromChain: account.chain,
providers: providers(),
// Runs after every check passed and BEFORE the first approval or signature.
// It receives exactly what will be signed; throwing cancels with nothing sent.
reviewExecution: async (plan) => {
const ok = await confirm(
`${plan.sourceAmount} → at least ${plan.minDestAmount} on ${plan.destChain} via ${plan.provider}, ` +
`${plan.approvals.length} approval(s), ~${plan.etaSeconds}s`,
)
if (!ok) throw new Error('cancelled by the user')
},
})
}
```
`plan` holds exactly what will be signed: provider, amounts, guaranteed output, approvals, ETA and the source transaction itself.
## 7. Track delivery
[Section titled “7. Track delivery”](#7-track-delivery)
A cross-chain swap finishes on another chain, minutes later. Poll its status with the id returned by `swap2()`:
```ts
const DONE = new Set(['completed', 'failed', 'refunded', 'cancelled', 'expired', 'partial'])
export async function waitForDelivery(
swaps: RouterSwap2Protocol,
id: string,
destinationAccount: () => Promise,
{ intervalMs = 10_000, timeoutMs = 2 * 60 * 60_000 }: { intervalMs?: number; timeoutMs?: number } = {},
) {
const deadline = Date.now() + timeoutMs
let claimed = false
while (Date.now() < deadline) {
const { status, transactions } = await swaps.getSwap2Status(id)
if (status === 'action-required' && !claimed) {
// Two-phase routes (CCTP): the mint is a transaction on the DESTINATION chain,
// signed by the user's account there and paid in that chain's gas. Once: the
// provider says 'action-required' until it sees the mint, so keep polling the
// id the claim returns (it carries the claim hash) instead of claiming again.
id = (await swaps.claimSwap2(id, await destinationAccount())).id
claimed = true
} else if (DONE.has(status)) {
return { status, transactions }
}
await new Promise((r) => setTimeout(r, intervalMs))
}
throw new Error(`Swap ${id} not settled within ${Math.ceil(timeoutMs / 1000)} s: keep its id and check again later.`)
}
```
| Status | Meaning |
| ------------------------------------------- | -------------------------------------------------------------------- |
| `pending` | In flight |
| `action-required` | Two-phase route (CCTP): the user must claim on the destination chain |
| `completed` | Delivered |
| `refund-pending` / `refunded` | The provider is returning / has returned the funds |
| `failed`, `expired`, `cancelled`, `partial` | Final, not delivered in full |
The id is a string (`awk1..…`). Store it with the user’s activity: it is all you need to resume tracking after an app restart.
## 8. Handle errors
[Section titled “8. Handle errors”](#8-handle-errors)
```ts
export async function swapSafely(swaps: RouterSwap2Protocol, options: Swap2Options) {
try {
return await swaps.swap2(options)
} catch (e) {
if (e instanceof Swap2MaybeSentError) {
// The broadcast may have reached the network. Do NOT retry: track e.id / e.hash.
return { pending: e.id ?? e.hash }
}
if (e instanceof Swap2InFlightError) return null // the same swap is already running (double tap)
if (e instanceof Swap2InsufficientGasError) throw new Error('Not enough native coin for gas')
if (e instanceof Swap2FeeLimitError) throw new Error('Fees are above your cap')
if (e instanceof Swap2QuoteError) throw new Error('No route right now: ' + e.message)
throw e
}
}
```
Never retry a `Swap2MaybeSentError`
The source transaction may already be on its way. Retrying can send the money twice. Track the id or hash instead.
## Fee caps
[Section titled “Fee caps”](#fee-caps)
`maxNetworkFeeBps` and `maxProtocolFeeBps` (basis points of the input) refuse routes whose **itemized** fees are above the cap. The check is fail-closed: a route whose provider does not itemize its fees is refused whenever a cap is set. With caps on, the USDC example above keeps only the CCTP route. To protect the user without losing routes, compare the guaranteed output (`toTokenAmountMin`) instead.
## With the kit
[Section titled “With the kit”](#with-the-kit)
Register the router as a protocol and the [policies](/concepts/policies/) wrap the account it signs with:
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { RouterSwap2Protocol } from '@anywalletkit/protocol-swap2-router'
import { providers } from './swap.ts'
export function walletWithSwaps(seedPhrase: string): Wallet {
const wallet = new Wallet(seedPhrase, {
// Policies wrap the account the router signs with: swaps cannot skip them.
policies: { maxFee: { 'eip155:1': 5_000_000_000_000_000n } },
})
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://ethereum-rpc.publicnode.com', chainId: 1 })
wallet.registerProtocol('swap', RouterSwap2Protocol, {
chain: 'eip155:1',
config: { fromChain: 'eip155:1', providers: providers() },
})
return wallet
}
// const swaps = await wallet.getProtocol('swap')
```
# Custom tokens
> Let users add a token by its address, at their own risk: read it from the chain, warn about look-alikes and issuer powers, keep the list, show balances and swap it.
The swap catalog in `swap2-assets` is a short curated list. Users hold other tokens too. This page lets them add one by its address — an EVM contract or a Solana mint — see its balance and swap it. The wallet reads everything about the token from the chain and tells the user what it found before anything is saved.
Snippets come from [`examples/balances`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/balances), which our CI typechecks and tests. `packages/tokens/scripts/verify-live.mjs` runs the same steps on Ethereum and Solana mainnet.
```sh
npm install @anywalletkit/tokens @anywalletkit/protocol-swap2-router
```
```ts
import type { IWalletAccount, IWalletAccountReadOnly } from '@anywalletkit/core'
import { inspectToken, swapSource, TokensTable, type JsonStorage, type TokenInspection, type TokensState, type UserToken } from '@anywalletkit/tokens'
import { RouterSwap2Protocol, type Swap2Route } from '@anywalletkit/protocol-swap2-router'
import type { CrossChainProvider } from '@anywalletkit/protocol-swap2-core'
import type { ListedToken } from './balances.ts'
```
## Look the token up
[Section titled “Look the token up”](#look-the-token-up)
```ts
/**
* Step 1 of "Add token": read what the address is and what to warn about. Nothing is saved yet.
* A token the catalog already lists comes back as `listed`: show it, there is nothing to add.
*/
export async function lookUp(account: IWalletAccountReadOnly, address: string): Promise {
const found = await inspectToken(account, address)
if (!found.listed) {
// found.assessment.level: 'danger' | 'caution'; found.assessment.risks: [{ code, level, message }]
// Show every message, worst first, before the user confirms.
}
return found
}
```
`inspectToken` asks the account’s chain package (`getTokenInfo` in `wallet-evm` and `wallet-solana`) for the token’s decimals, symbol, name and supply. An address that is not a token — a wallet, an NFT collection, a plain contract — throws `NotATokenError`. A token the catalog already lists comes back as `{ listed }`: nothing to add.
The assessment lists every warning, worst first. A user token is never “safe”: the floor is `caution`.
| Code | Level | Meaning |
| ---------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `unlisted` | caution | Always. Anyone can deploy a token with any name and logo. |
| `impersonation` | danger | Its symbol reads as a catalog token of the same chain, or as a native coin or major stablecoin anywhere. Look-alike letters (Cyrillic С, `$` for S, `₮`, fullwidth, invisible characters) are folded first. |
| `permanent-delegate` | danger | Solana Token-2022: the issuer can move or burn the user’s tokens. |
| `transfer-hook` | danger | Token-2022: a program of the issuer’s choosing runs on every transfer and can block selling. |
| `non-transferable` | danger | It cannot be sent or swapped. |
| `upgradeable` | caution | An EVM proxy: the owner can replace the code (USDC is one too). |
| `mint-authority`, `freeze-authority` | caution | Solana: the issuer can mint more, or freeze balances. |
| `transfer-fee`, `default-frozen`, `pausable` | caution | Token-2022 extensions. |
| `odd-characters`, `no-symbol`, `zero-supply`, `unusual-decimals` | caution | What the token reports about itself. |
Show the symbol and the name as the token reports them, next to the address. Never let a user token borrow a catalog token’s icon: match icons by address, not by symbol.
## Keep the list
[Section titled “Keep the list”](#keep-the-list)
```ts
/** The user's tokens, kept in the app's storage (AsyncStorage, chrome.storage…). Load once at start. */
export async function openTokens(storage: JsonStorage): Promise {
const tokens = new TokensTable(storage)
await tokens.load()
return tokens
}
/** Step 2, after the user accepted the warnings: save the token the inspection returned. */
export async function confirmAdd(tokens: TokensTable, found: TokenInspection): Promise {
if (found.listed) return null
return tokens.add(found.token)
}
/** The user's tokens on one chain as rows for the balances screen (source 'user'). */
export function userRows(tokens: TokensTable, chain: string): ListedToken[] {
return tokens.list(chain).map((t) => ({ chain, token: t.address, symbol: t.symbol, decimals: t.decimals, source: 'user' }))
}
```
`TokensTable` stores the list in any JSON storage the app has (`AsyncStorage`, `chrome.storage`, memory in tests). Load it once at start; reads are then synchronous. Writes queue behind each other, and a failed save leaves the list as it was. A failed read leaves the table unloaded instead of empty, so a later write cannot erase the user’s tokens. Entries are keyed by chain and address; Solana is stored under the catalog’s `solana:mainnet` whichever id the account reports.
The rows feed the token list of the [Balances](/guides/balances/) guide, marked `source: 'user'`. Balances are read with the same `getTokenBalance(address)` as catalog tokens.
## Swap it
[Section titled “Swap it”](#swap-it)
```ts
/**
* Routes that sell a user token. `allowUnlistedTokens` lets the engine take a token outside the
* catalog; only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) answer.
*/
export function swapsForUserTokens(account: IWalletAccount | IWalletAccountReadOnly, chain: string, providers: CrossChainProvider[]): RouterSwap2Protocol {
return new RouterSwap2Protocol(account, { fromChain: chain, providers, allowUnlistedTokens: true })
}
export function sellRoutes(swaps: RouterSwap2Protocol, token: UserToken, amount: bigint, toToken: string): Promise {
return swaps.quoteSwap2Routes({ ...swapSource(token), toToken, fromTokenAmount: amount })
}
```
* **Opt in per engine.** `allowUnlistedTokens: true` lets the swap engine take a token outside the catalog. It is off by default.
* **Decimals come from the chain.** The engine reads them once with `getTokenInfo`. A `fromTokenDecimals` that disagrees is refused.
* **Which providers answer.** LI.FI, Uniswap, Balancer, Fynd and Jupiter trade any token. NEAR Intents, THORChain, Chainflip, Omniston, CCTP and USDT0 only trade their own lists, so they stay out of these routes.
* **Approvals.** The approval goes to the token the user named, for exactly the amount, to the spender the quote declares — the same checks as catalog tokens.
* **No USD value.** A user token has no price in the router, so the loss warning cannot judge the route. Show the amounts in and out.
* **Destination tokens.** An EVM destination was always an address. A Solana destination mint outside the catalog needs the same flag.
**Server.** With a remote swap engine, set `allowUnlistedTokens: true` on `createSwap2Handler` too. Otherwise the server drops the token’s decimals, and providers refuse the unlisted source.
# Transaction preview
> Show what an EVM transaction will do before it is signed — decoded calls, approvals, simulated balance changes and named checks for your review screen.
A review screen that shows only “to: 0x1231…” and “data: 0x095ea7b3…” asks the user to trust blindly. `tx-preview-evm` turns one call, or an approve → call sequence, into what the user needs to see before signing:
* **Decoded calls.** Approvals (ERC-20 `approve`, `increaseAllowance` and `increaseApproval`, an EIP-2612 `permit` call, Permit2 `approve` and `permit`, single or batch, `setApprovalForAll`), token transfers, and the name of every contract you list as known. A Permit2 batch puts every allowance in `approvals` (the first one is also `approval`).
* **Simulated balance changes.** The whole sequence runs in one simulated block through `eth_simulateV1` with transfer tracing: “-100 USDC, +0.03 ETH”.
* **Checks.** Named outcomes (`approval-unlimited`, `simulation-reverted`, `recipient-foreign`…) that your app turns into its own words.
Nothing is signed or sent. The module only reads, through your RPC. Snippets come from [`examples/tx-preview`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/tx-preview), which our CI typechecks and tests.
```sh
npm install @anywalletkit/tx-preview-evm
```
```ts
import { previewEvmTx, type PreviewCall, type Rpc, type TxPreview } from '@anywalletkit/tx-preview-evm'
import type { Policies, WriteIntent } from '@anywalletkit/kit'
import type { Swap2ExecutionPlan } from '@anywalletkit/protocol-swap2-core'
import { encodeFunctionData, erc20Abi, formatUnits, type Hex } from 'viem'
```
## RPC
[Section titled “RPC”](#rpc)
The module takes a function `(method, params) → result`, so any transport works:
```ts
/** The module takes any JSON-RPC transport: (method, params) → result. */
export function jsonRpc(url: string): Rpc {
return async (method, params) => {
const res = await fetch(url, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
})
const body = (await res.json()) as { result?: unknown; error?: { code: number; message: string; data?: string } }
// Keep code and data: the module reads them to tell "no eth_simulateV1" from a revert.
if (body.error) throw Object.assign(new Error(body.error.message), body.error)
return body.result
}
}
```
Pass JSON-RPC errors through with their `code` and `data`: the module uses them to tell a revert from a node that has no `eth_simulateV1`.
Balance changes need `eth_simulateV1`. On public endpoints we checked (October 2026) it is served on Ethereum, Base, Arbitrum, Optimism, Polygon and BNB Chain, and missing on Avalanche. Where it is missing, a single call falls back to `eth_call`, which tells pass from revert but shows no balance changes. A sequence can’t be simulated there at all (`simulation.status: 'unavailable'`).
## Preview a transaction
[Section titled “Preview a transaction”](#preview-a-transaction)
```ts
const WETH_BASE = '0x4200000000000000000000000000000000000006'
export async function previewWrap(from: string, amount: bigint): Promise {
return previewEvmTx({
chainId: 8453,
from,
rpc: jsonRpc('https://base-rpc.publicnode.com'),
own: [from], // every address of this user: sends between them are not "foreign"
known: { [WETH_BASE]: 'Wrapped Ether' }, // contracts you trust, with the name to show
calls: [{ to: WETH_BASE, data: '0xd0e30db0', value: amount }], // WETH deposit()
// Simulate as if the account held 1 ETH: preview a flow before it is funded.
stateOverrides: { [from]: { balance: 10n ** 18n } },
})
}
```
| Input | Meaning |
| ------------------- | ----------------------------------------------------------------------------------------------------- |
| `calls` | Run in order in one block: approvals first, then the call |
| `own` | Every address of this user; a transfer to one of them is not “foreign” |
| `known` | Contracts you trust → the name to show (a provider’s routers, your tokens) |
| `expectedRecipient` | Where the funds should arrive; anyone else is flagged |
| `expectedApproval` | The allowance the flow needs; a larger approval is flagged |
| `stateOverrides` | Simulate with a different balance, nonce or code, e.g. to preview a flow before the account is funded |
| `native` | Symbol and decimals of the gas coin (default ETH, 18) |
The result has three parts:
* **`calls`.** Each call with `method`, `label`, and `approval` or `transfer` when decoded. An approval’s `amount` is `null` when it is unlimited (2²⁵⁵ or more) or an operator approval.
* **`simulation`.** One of three statuses:
* `ok`: `changes` (signed deltas in base units, with symbol and decimals) and `gasUsed`;
* `reverted`: `callIndex` and `reason`;
* `unavailable`: `reason`.
* **`checks`.** `{ code, status: 'ok' | 'warn' | 'unknown', detail }`.
Balance changes count ERC-20 `Transfer` events to and from the sender, plus native transfers. WETH-style `Deposit` / `Withdrawal` events count only for contracts in `known`, so a look-alike event from an arbitrary contract can’t fake a balance change.
## Turn checks into a verdict
[Section titled “Turn checks into a verdict”](#turn-checks-into-a-verdict)
Checks are codes, not text. The wording, the language and how strict to be are your app’s decisions:
```ts
export type Verdict = { level: 'ok' | 'warn' | 'danger'; lines: string[] }
/** Checks are codes, not prose: the wording (and the language) is yours. */
export function verdict(preview: TxPreview): Verdict {
const lines: string[] = []
let level: Verdict['level'] = 'ok'
const raise = (to: Verdict['level']) => { if (to === 'danger' || level === 'ok') level = to }
for (const check of preview.checks) {
const d = check.detail ?? {}
switch (check.code) {
case 'simulation-reverted':
raise('danger'); lines.push(`This transaction will fail: ${d.reason}`); break
case 'simulation-unavailable':
raise('warn'); lines.push('This network cannot simulate it. Check the details yourself.'); break
case 'approval-unlimited':
raise('danger'); lines.push(`${d.label ?? d.spender} could spend ALL of this token, now and later.`); break
case 'approval-excess':
raise('warn'); lines.push(`Approves ${d.amount}, but the swap needs only ${d.expected}.`); break
case 'approval-unchecked':
raise('warn'); lines.push(`Approves ${d.amount} to ${d.label ?? d.spender}; nothing says how much is needed.`); break
case 'approval-unknown-spender':
raise('warn'); lines.push(`Unknown spender ${d.spender}.`); break
case 'contract-unknown':
raise('warn'); lines.push(`Unknown contract ${d.address}.`); break
case 'recipient-foreign':
lines.push(`Sends to ${d.address}, which is not one of your accounts.`); break
default:
break // the "ok" codes need no line
}
}
return { level, lines }
}
/** Balance changes for the sheet: "-0.01 ETH", "+0.01 WETH". */
export function balanceLines(preview: TxPreview): string[] {
if (preview.simulation.status !== 'ok') return []
return preview.simulation.changes.map((c) => {
const sign = c.delta < 0n ? '-' : '+'
const abs = c.delta < 0n ? -c.delta : c.delta
const amount = c.decimals === null ? abs.toString() : formatUnits(abs, c.decimals)
return `${sign}${amount} ${c.symbol ?? c.token}`
})
}
```
| Code | Status | Meaning |
| ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `contract-known` / `contract-unknown` | ok / warn | A contract a call goes to is in `known`, or isn’t — one per target, every call but approvals (a transfer-shaped call included) |
| `simulation-ok` | ok | Simulated; balance changes are in `simulation.changes` |
| `simulation-reverted` | warn | It will fail; `detail.reason` says why |
| `simulation-unavailable` | unknown | The network can’t simulate it |
| `recipient-own` / `recipient-foreign` | ok / warn | A recipient is, or isn’t, one of `own` |
| `approval-exact` | ok | Approves no more than `expectedApproval` |
| `approval-unchecked` | unknown | A bounded approval and no `expectedApproval` to compare it with |
| `approval-excess` | warn | Approves more than `expectedApproval` |
| `approval-unlimited` | warn | Unlimited allowance (≥ 2^128 − 1) or operator approval |
| `approval-unknown-spender` | warn | The spender is not in `known` |
| `approval-unparsed` | warn | A `permit` selector (EIP-2612 or Permit2) whose arguments can’t be read: it may grant an allowance nobody can size |
| `native-value` | ok / warn | A call sends native coin into a contract (`detail.amount`, per call); warn when that contract is not in `known` (`detail.address`) |
## Preview every write
[Section titled “Preview every write”](#preview-every-write)
Policies call `confirm` before every write, which makes it the place to simulate. The `intent` carries the call as `raw`:
```ts
/** The EVM calls behind a kit write, when it has any. */
function callsOf(intent: WriteIntent): PreviewCall[] | null {
const raw = intent.raw as Record
if (intent.method === 'sendTransaction' || intent.method === 'signTransaction') {
const txs = (Array.isArray(raw) ? raw : [raw]) as { to: string; data?: string; value?: bigint }[]
return txs.map(({ to, data, value }) => ({ to, ...(data ? { data } : {}), value: BigInt(value ?? 0) }))
}
if ((intent.kind === 'approval' || intent.kind === 'revoke') && intent.method === 'approve') {
const { token, spender, amount } = raw as { token: string; spender: string; amount: bigint }
return [{ to: token, data: encodeFunctionData({ abi: erc20Abi, functionName: 'approve', args: [spender as Hex, amount] }) }]
}
return null // messages, typed data, other chains: confirm without a simulation
}
/** Policies whose confirm step simulates EVM writes before asking the user. */
export function previewPolicies(
rpcFor: (chainId: number) => Rpc,
own: string[],
ask: (intent: WriteIntent, preview: TxPreview | null) => Promise,
): Policies {
return {
confirm: async (intent) => {
const calls = intent.chain.startsWith('eip155:') ? callsOf(intent) : null
if (!calls) return ask(intent, null)
const chainId = Number(intent.chain.split(':')[1])
const preview = await previewEvmTx({ chainId, from: intent.from, rpc: rpcFor(chainId), own, calls })
return ask(intent, preview)
},
}
}
```
`ask` receives the preview, or `null` for writes with nothing to simulate (message signatures, typed data, non-EVM chains), and shows your sheet. With this in the wallet’s policies, no EVM transaction reaches the key without a simulation the user has seen. See [Policies](/concepts/policies/).
## Preview a swap
[Section titled “Preview a swap”](#preview-a-swap)
The swap router hands the exact plan to `reviewExecution` before the first approval. Preview the approvals and the source call together, the way they will run:
```ts
/** A swap's approvals and source call, previewed as the one sequence they will run as. */
export async function previewSwap(plan: Swap2ExecutionPlan, from: string, rpc: Rpc): Promise {
if (plan.source.kind !== 'call') return null // serialized / typed-order legs are checked by the provider module
const approvals: PreviewCall[] = plan.approvals.map((a) => ({
to: a.token,
data: encodeFunctionData({ abi: erc20Abi, functionName: 'approve', args: [a.spender as Hex, a.amount] }),
}))
return previewEvmTx({
chainId: Number(plan.fromChain.split(':')[1]),
from,
rpc,
own: [from],
// The router the provider named is the contract the user is trusting.
known: Object.fromEntries([plan.source.to, ...plan.approvals.map((a) => a.spender)].map((a) => [a, plan.provider])),
calls: [...approvals, { to: plan.source.to, ...(plan.source.data ? { data: plan.source.data } : {}), value: plan.source.value }],
expectedApproval: plan.sourceAmount, // anything above the swap input is flagged
...(plan.destChain === plan.fromChain ? { expectedRecipient: plan.recipient } : {}),
})
}
```
`expectedApproval: plan.sourceAmount` flags a route that asks for more than it spends. For a same-chain swap, `expectedRecipient` flags output going to anyone but the user. Wire it into the router as shown in [Swaps → Show a review screen](/guides/swaps/#show-a-review-screen).
# API reference
## Packages
[Section titled “Packages”](#packages)
* [@anywalletkit/backup-cloud](/api/anywalletkit/backup-cloud/)
* [@anywalletkit/conformance](/api/anywalletkit/conformance/)
* [@anywalletkit/core](/api/anywalletkit/core/)
* [@anywalletkit/extension-kit](/api/anywalletkit/extension-kit/)
* [@anywalletkit/history-evm](/api/anywalletkit/history-evm/)
* [@anywalletkit/keyring](/api/anywalletkit/keyring/)
* [@anywalletkit/kit](/api/anywalletkit/kit/)
* [@anywalletkit/names-ens](/api/anywalletkit/names-ens/)
* [@anywalletkit/networks](/api/anywalletkit/networks/)
* [@anywalletkit/protocol-approvals-evm](/api/anywalletkit/protocol-approvals-evm/)
* [@anywalletkit/protocol-lending-aave-evm](/api/anywalletkit/protocol-lending-aave-evm/)
* [@anywalletkit/protocol-lending-kamino-solana](/api/anywalletkit/protocol-lending-kamino-solana/)
* [@anywalletkit/protocol-lending-mellow-evm](/api/anywalletkit/protocol-lending-mellow-evm/)
* [@anywalletkit/protocol-lending-morpho-evm](/api/anywalletkit/protocol-lending-morpho-evm/)
* [@anywalletkit/protocol-staking-lido-evm](/api/anywalletkit/protocol-staking-lido-evm/)
* [@anywalletkit/protocol-staking-native-monad](/api/anywalletkit/protocol-staking-native-monad/)
* [@anywalletkit/protocol-staking-native-solana](/api/anywalletkit/protocol-staking-native-solana/)
* [@anywalletkit/protocol-staking-spl-stake-pool-solana](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/)
* [@anywalletkit/protocol-staking-ssv-evm](/api/anywalletkit/protocol-staking-ssv-evm/)
* [@anywalletkit/protocol-staking-tonstakers-ton](/api/anywalletkit/protocol-staking-tonstakers-ton/)
* [@anywalletkit/protocol-swap2-balancer](/api/anywalletkit/protocol-swap2-balancer/)
* [@anywalletkit/protocol-swap2-cctp](/api/anywalletkit/protocol-swap2-cctp/)
* [@anywalletkit/protocol-swap2-chainflip](/api/anywalletkit/protocol-swap2-chainflip/)
* [@anywalletkit/protocol-swap2-core](/api/anywalletkit/protocol-swap2-core/)
* [@anywalletkit/protocol-swap2-fynd](/api/anywalletkit/protocol-swap2-fynd/)
* [@anywalletkit/protocol-swap2-jupiter](/api/anywalletkit/protocol-swap2-jupiter/)
* [@anywalletkit/protocol-swap2-lifi](/api/anywalletkit/protocol-swap2-lifi/)
* [@anywalletkit/protocol-swap2-near-intents](/api/anywalletkit/protocol-swap2-near-intents/)
* [@anywalletkit/protocol-swap2-omniston](/api/anywalletkit/protocol-swap2-omniston/)
* [@anywalletkit/protocol-swap2-router](/api/anywalletkit/protocol-swap2-router/)
* [@anywalletkit/protocol-swap2-thorchain](/api/anywalletkit/protocol-swap2-thorchain/)
* [@anywalletkit/protocol-swap2-uniswap](/api/anywalletkit/protocol-swap2-uniswap/)
* [@anywalletkit/protocol-swap2-usdt0](/api/anywalletkit/protocol-swap2-usdt0/)
* [@anywalletkit/protocol-swap2-wrap](/api/anywalletkit/protocol-swap2-wrap/)
* [@anywalletkit/runtime-hermes](/api/anywalletkit/runtime-hermes/)
* [@anywalletkit/secure-storage-react-native](/api/anywalletkit/secure-storage-react-native/)
* [@anywalletkit/seed-vault](/api/anywalletkit/seed-vault/)
* [@anywalletkit/swap2-assets](/api/anywalletkit/swap2-assets/)
* [@anywalletkit/tokens](/api/anywalletkit/tokens/)
* [@anywalletkit/tx-preview-evm](/api/anywalletkit/tx-preview-evm/)
* [@anywalletkit/wallet-btc](/api/anywalletkit/wallet-btc/)
* [@anywalletkit/wallet-evm](/api/anywalletkit/wallet-evm/)
* [@anywalletkit/wallet-near](/api/anywalletkit/wallet-near/)
* [@anywalletkit/wallet-solana](/api/anywalletkit/wallet-solana/)
* [@anywalletkit/wallet-ton](/api/anywalletkit/wallet-ton/)
* [@anywalletkit/wallet-tron](/api/anywalletkit/wallet-tron/)
* [@anywalletkit/wallet-zcash](/api/anywalletkit/wallet-zcash/)
# @anywalletkit/backup-cloud
# @anywalletkit/backup-cloud
[Section titled “@anywalletkit/backup-cloud”](#anywalletkitbackup-cloud)
[](https://www.npmjs.com/package/@anywalletkit/backup-cloud)
Cloud backups for React Native wallets built on the SDK. Each seed or key becomes one encrypted [`@anywalletkit/seed-vault`](/api/anywalletkit/seed-vault/) file in the app’s hidden iCloud Drive container. The user picks how it opens:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/backup-cloud
# or: pnpm add @anywalletkit/backup-cloud · yarn add @anywalletkit/backup-cloud
```
On npm: [@anywalletkit/backup-cloud](https://www.npmjs.com/package/@anywalletkit/backup-cloud), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance. An Expo native module (`expo-modules-core` is its peer, already in every Expo app): use a development build, not Expo Go.
| Option | Where the pieces live | Who can open it |
| --------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **iCloud Keychain** (no password) | File in iCloud Drive; its 32-byte key in iCloud Keychain (end-to-end encrypted by Apple) | This app on the user’s Apple devices, after Face ID / Touch ID / the device passcode. Neither the file nor the key opens anything alone. |
| **Password** | File in iCloud Drive | Anyone with the backup password, on any phone (Argon2id, ≥10 characters) |
| **Both** | — | Either one |
```ts
import { iCloudDrive, iCloudKeychain, saveBackup, checkBackup, listBackups, restoreBackup } from '@anywalletkit/backup-cloud'
const store = iCloudDrive({ container: 'iCloud.com.example.wallet' })
const keys = iCloudKeychain()
await saveBackup({ store, keyVault: keys, password, secret: await secrets.get(source.id), meta: { type: source.type, fingerprint: source.fingerprint, label: source.label } })
await checkBackup(store, source) // { present, createdAt, protectors } — no prompt, nothing opened
const opened = await restoreBackup({ store, name, keyVault: keys, expect: source }) // or { password }
await secrets.set(id, opened.text()); opened.dispose()
```
**Protection on the device.**
* **The key:** `WhenUnlocked`. It is never readable while the phone is locked, after-first-unlock included. Keys written by 0.1.0 are raised to this class on their next read.
* **Reading it:** the native module asks for the device owner (Face ID / Touch ID / passcode) before handing the key out, so app code can’t read it silently. One confirmation covers 30 s, so a multi-wallet backup or restore asks once. Creating a new key asks for nothing.
* **The file:** written with complete file protection.
* **No strict mode:** a synced keychain item can’t carry a biometric ACL, so the no-password option can’t honour strict biometrics-only mode. Offer the password option to users who want that.
`saveBackup` reads the file back and compares it before reporting success. `restoreBackup` refuses another wallet’s backup when given `expect`. A device without the synced key gets `key-missing`, and can then use the password.
## Setup (Expo)
[Section titled “Setup (Expo)”](#setup-expo)
```json
["@anywalletkit/backup-cloud", { "iCloudContainer": "iCloud." }]
```
The plugin adds the iCloud Documents entitlements for **your** container. Every app has its own container, because a shared one would let apps read each other’s backups.
With automatic signing, Xcode registers the container on your team. `xcodebuild -allowProvisioningUpdates` needs an Apple ID in Xcode › Settings › Accounts.
Files go to `/WalletBackups`, not `Documents/`, so they stay out of the Files app. iCloud Keychain needs no entitlement.
## Status
[Section titled “Status”](#status)
Supported today: iOS (iCloud Drive and iCloud Keychain).
Next: Android, with Google Drive `appDataFolder` (needs your OAuth client) and Block Store.
On Android, `status()` reports `unavailable`.
## Classes
[Section titled “Classes”](#classes)
* [CloudBackupError](/api/anywalletkit/backup-cloud/classes/cloudbackuperror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [BackupInfo](/api/anywalletkit/backup-cloud/interfaces/backupinfo/)
* [BackupStore](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
* [ICloudDriveOptions](/api/anywalletkit/backup-cloud/interfaces/iclouddriveoptions/)
* [ICloudKeychainOptions](/api/anywalletkit/backup-cloud/interfaces/icloudkeychainoptions/)
* [KeyVault](/api/anywalletkit/backup-cloud/interfaces/keyvault/)
* [NativeBackupCloud](/api/anywalletkit/backup-cloud/interfaces/nativebackupcloud/)
* [NativeDriveFile](/api/anywalletkit/backup-cloud/interfaces/nativedrivefile/)
* [RestoreBackupOptions](/api/anywalletkit/backup-cloud/interfaces/restorebackupoptions/)
* [SaveBackupOptions](/api/anywalletkit/backup-cloud/interfaces/savebackupoptions/)
* [StoredFile](/api/anywalletkit/backup-cloud/interfaces/storedfile/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [CloudBackupErrorCode](/api/anywalletkit/backup-cloud/type-aliases/cloudbackuperrorcode/)
## Functions
[Section titled “Functions”](#functions)
* [backupFileName](/api/anywalletkit/backup-cloud/functions/backupfilename/)
* [checkBackup](/api/anywalletkit/backup-cloud/functions/checkbackup/)
* [iCloudDrive](/api/anywalletkit/backup-cloud/functions/iclouddrive/)
* [iCloudKeychain](/api/anywalletkit/backup-cloud/functions/icloudkeychain/)
* [isCloudBackupError](/api/anywalletkit/backup-cloud/functions/iscloudbackuperror/)
* [listBackups](/api/anywalletkit/backup-cloud/functions/listbackups/)
* [restoreBackup](/api/anywalletkit/backup-cloud/functions/restorebackup/)
* [saveBackup](/api/anywalletkit/backup-cloud/functions/savebackup/)
# CloudBackupError
Defined in: errors.ts:13
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new CloudBackupError**(`code`, `message`, `options?`): `CloudBackupError`
Defined in: errors.ts:15
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`CloudBackupErrorCode`](/api/anywalletkit/backup-cloud/type-aliases/cloudbackuperrorcode/)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
###### cause?
[Section titled “cause?”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`CloudBackupError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`CloudBackupErrorCode`](/api/anywalletkit/backup-cloud/type-aliases/cloudbackuperrorcode/)
Defined in: errors.ts:16
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `"CloudBackupError"` = `'CloudBackupError'`
Defined in: errors.ts:14
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Error.name`
# backupFileName
> **backupFileName**(`meta`): `string`
Defined in: backup.ts:8
One file per wallet secret: `-.fwbackup`. Saving again replaces it.
## Parameters
[Section titled “Parameters”](#parameters)
### meta
[Section titled “meta”](#meta)
`Pick`<`BackupMeta`, `"type"` | `"fingerprint"`>
## Returns
[Section titled “Returns”](#returns)
`string`
# checkBackup
> **checkBackup**(`store`, `meta`): `Promise`<{ `present`: `false`; } | { `createdAt`: `number`; `present`: `true`; `protectors`: `string`\[]; }>
Defined in: backup.ts:84
Is this wallet backed up here — without opening anything: the file exists, decodes, and names the same type + fingerprint. For a “Backup: OK” badge.
## Parameters
[Section titled “Parameters”](#parameters)
### store
[Section titled “store”](#store)
[`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
### meta
[Section titled “meta”](#meta)
`Pick`<`BackupMeta`, `"type"` | `"fingerprint"`>
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `present`: `false`; } | { `createdAt`: `number`; `present`: `true`; `protectors`: `string`\[]; }>
# iCloudDrive
> **iCloudDrive**(`opts`): [`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
Defined in: stores.ts:72
Backup files in the app’s own iCloud Drive container — hidden from the Files app, synced to the user’s devices.
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`ICloudDriveOptions`](/api/anywalletkit/backup-cloud/interfaces/iclouddriveoptions/)
## Returns
[Section titled “Returns”](#returns)
[`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
# iCloudKeychain
> **iCloudKeychain**(`opts?`): [`KeyVault`](/api/anywalletkit/backup-cloud/interfaces/keyvault/)
Defined in: stores.ts:128
Backup keys in iCloud Keychain (synchronizable items, end-to-end encrypted by Apple, readable by this app on the user’s devices). Holds keys only — never a secret: the backup file itself is in iCloud Drive. Keys are WhenUnlocked, and the native module asks for the device owner before handing one out, so the no-password backup still needs Face ID or the passcode to open. It cannot honour strict (biometrics-only) mode: a synced item can’t carry a biometric ACL.
## Parameters
[Section titled “Parameters”](#parameters)
### opts?
[Section titled “opts?”](#opts)
[`ICloudKeychainOptions`](/api/anywalletkit/backup-cloud/interfaces/icloudkeychainoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`KeyVault`](/api/anywalletkit/backup-cloud/interfaces/keyvault/)
# isCloudBackupError
> **isCloudBackupError**(`err`, `code?`): `err is CloudBackupError`
Defined in: errors.ts:24
## Parameters
[Section titled “Parameters”](#parameters)
### err
[Section titled “err”](#err)
`unknown`
### code?
[Section titled “code?”](#code)
[`CloudBackupErrorCode`](/api/anywalletkit/backup-cloud/type-aliases/cloudbackuperrorcode/)
## Returns
[Section titled “Returns”](#returns)
`err is CloudBackupError`
# listBackups
> **listBackups**(`store`): `Promise`<[`BackupInfo`](/api/anywalletkit/backup-cloud/interfaces/backupinfo/)\[]>
Defined in: backup.ts:64
Every backup in the store, described (downloads placeholders). Broken files are listed with `error`.
## Parameters
[Section titled “Parameters”](#parameters)
### store
[Section titled “store”](#store)
[`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`BackupInfo`](/api/anywalletkit/backup-cloud/interfaces/backupinfo/)\[]>
# restoreBackup
> **restoreBackup**(`opts`): `Promise`<`OpenedBackup`>
Defined in: backup.ts:109
Open a stored backup. The caller writes `opened.text()` where it belongs, then `dispose()`s.
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`RestoreBackupOptions`](/api/anywalletkit/backup-cloud/interfaces/restorebackupoptions/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<`OpenedBackup`>
# saveBackup
> **saveBackup**(`opts`): `Promise`<{ `name`: `string`; `protectors`: `string`\[]; }>
Defined in: backup.ts:31
Seal one secret with the chosen protectors, write it, read it back and compare. At least one of `password` / `keyVault`.
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`SaveBackupOptions`](/api/anywalletkit/backup-cloud/interfaces/savebackupoptions/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `name`: `string`; `protectors`: `string`\[]; }>
# BackupInfo
Defined in: backup.ts:51
## Properties
[Section titled “Properties”](#properties)
### createdAt?
[Section titled “createdAt?”](#createdat)
> `optional` **createdAt?**: `number`
Defined in: backup.ts:57
***
### downloaded
[Section titled “downloaded”](#downloaded)
> **downloaded**: `boolean`
Defined in: backup.ts:53
***
### error?
[Section titled “error?”](#error)
> `optional` **error?**: `string`
Defined in: backup.ts:60
Why the file couldn’t be read (left for the app to show; never thrown from list).
***
### meta?
[Section titled “meta?”](#meta)
> `optional` **meta?**: `BackupMeta`
Defined in: backup.ts:56
Present when the file was read and decoded.
***
### modifiedAt
[Section titled “modifiedAt”](#modifiedat)
> **modifiedAt**: `number`
Defined in: backup.ts:54
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: backup.ts:52
***
### protectors?
[Section titled “protectors?”](#protectors)
> `optional` **protectors?**: `string`\[]
Defined in: backup.ts:58
# BackupStore
Defined in: stores.ts:12
Where backup files live. One small text file per wallet secret.
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> `readonly` **kind**: `string`
Defined in: stores.ts:13
## Methods
[Section titled “Methods”](#methods)
### delete()
[Section titled “delete()”](#delete)
> **delete**(`name`): `Promise`<`void`>
Defined in: stores.ts:18
#### Parameters
[Section titled “Parameters”](#parameters)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`name`): `Promise`<`string` | `null`>
Defined in: stores.ts:17
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### name
[Section titled “name”](#name-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string` | `null`>
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`StoredFile`](/api/anywalletkit/backup-cloud/interfaces/storedfile/)\[]>
Defined in: stores.ts:15
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`StoredFile`](/api/anywalletkit/backup-cloud/interfaces/storedfile/)\[]>
***
### put()
[Section titled “put()”](#put)
> **put**(`name`, `text`): `Promise`<`void`>
Defined in: stores.ts:16
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### name
[Section titled “name”](#name-2)
`string`
##### text
[Section titled “text”](#text)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
***
### status()
[Section titled “status()”](#status)
> **status**(): `Promise`<{ `available`: `boolean`; `reason?`: `"signed-out"` | `"unavailable"`; }>
Defined in: stores.ts:14
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `available`: `boolean`; `reason?`: `"signed-out"` | `"unavailable"`; }>
# ICloudDriveOptions
Defined in: stores.ts:61
## Properties
[Section titled “Properties”](#properties)
### container
[Section titled “container”](#container)
> **container**: `string`
Defined in: stores.ts:63
The app’s iCloud container, e.g. “iCloud.page.vaulty.app” (same as in the config plugin).
***
### downloadTimeoutMs?
[Section titled “downloadTimeoutMs?”](#downloadtimeoutms)
> `optional` **downloadTimeoutMs?**: `number`
Defined in: stores.ts:67
How long a read may wait for iCloud to download a file. Default 30 s.
***
### folder?
[Section titled “folder?”](#folder)
> `optional` **folder?**: `string`
Defined in: stores.ts:65
Folder inside the container’s hidden scope. Default “WalletBackups”.
***
### native?
[Section titled “native?”](#native)
> `optional` **native?**: [`NativeBackupCloud`](/api/anywalletkit/backup-cloud/interfaces/nativebackupcloud/)
Defined in: stores.ts:68
# ICloudKeychainOptions
Defined in: stores.ts:104
## Properties
[Section titled “Properties”](#properties)
### native?
[Section titled “native?”](#native)
> `optional` **native?**: [`NativeBackupCloud`](/api/anywalletkit/backup-cloud/interfaces/nativebackupcloud/)
Defined in: stores.ts:107
***
### random?
[Section titled “random?”](#random)
> `optional` **random?**: (`n`) => `Uint8Array`
Defined in: stores.ts:109
Randomness for new keys — crypto.getRandomValues by default.
#### Parameters
[Section titled “Parameters”](#parameters)
##### n
[Section titled “n”](#n)
`number`
#### Returns
[Section titled “Returns”](#returns)
`Uint8Array`
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: stores.ts:111
Line under Face ID when a key is read. Default “Open your wallet backup”.
***
### service?
[Section titled “service?”](#service)
> `optional` **service?**: `string`
Defined in: stores.ts:106
Keychain service for the synced backup keys. Default “anywalletkit.backup-keys”.
# KeyVault
Defined in: stores.ts:22
Where backup KEYS live for the no-password option (a key protector on the file).
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> `readonly` **kind**: `string`
Defined in: stores.ts:24
Also the protector id written into the backup file.
## Methods
[Section titled “Methods”](#methods)
### delete()
[Section titled “delete()”](#delete)
> **delete**(`id`): `Promise`<`void`>
Defined in: stores.ts:29
#### Parameters
[Section titled “Parameters”](#parameters)
##### id
[Section titled “id”](#id)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`id`): `Promise`<`Uint8Array`<`ArrayBufferLike`> | `null`>
Defined in: stores.ts:26
The key — asks for the device owner (Face ID / passcode) first. null when there is none.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Uint8Array`<`ArrayBufferLike`> | `null`>
***
### getOrCreate()
[Section titled “getOrCreate()”](#getorcreate)
> **getOrCreate**(`id`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: stores.ts:28
An existing key (asks for the device owner, as `get`) or a new one (no prompt).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### id
[Section titled “id”](#id-2)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# NativeBackupCloud
Defined in: native.ts:8
The `AnyWalletKitBackupCloud` Expo module (iOS).
## Methods
[Section titled “Methods”](#methods)
### driveDelete()
[Section titled “driveDelete()”](#drivedelete)
> **driveDelete**(`container`, `folder`, `name`): `Promise`<`void`>
Defined in: native.ts:13
#### Parameters
[Section titled “Parameters”](#parameters)
##### container
[Section titled “container”](#container)
`string`
##### folder
[Section titled “folder”](#folder)
`string`
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### driveList()
[Section titled “driveList()”](#drivelist)
> **driveList**(`container`, `folder`): `Promise`<[`NativeDriveFile`](/api/anywalletkit/backup-cloud/interfaces/nativedrivefile/)\[]>
Defined in: native.ts:10
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### container
[Section titled “container”](#container-1)
`string`
##### folder
[Section titled “folder”](#folder-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`NativeDriveFile`](/api/anywalletkit/backup-cloud/interfaces/nativedrivefile/)\[]>
***
### driveRead()
[Section titled “driveRead()”](#driveread)
> **driveRead**(`container`, `folder`, `name`, `timeoutMs`): `Promise`<`string` | `null`>
Defined in: native.ts:12
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### container
[Section titled “container”](#container-2)
`string`
##### folder
[Section titled “folder”](#folder-2)
`string`
##### name
[Section titled “name”](#name-1)
`string`
##### timeoutMs
[Section titled “timeoutMs”](#timeoutms)
`number`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `null`>
***
### driveStatus()
[Section titled “driveStatus()”](#drivestatus)
> **driveStatus**(`container`): `Promise`<{ `container`: `boolean`; `signedIn`: `boolean`; }>
Defined in: native.ts:9
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### container
[Section titled “container”](#container-3)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `container`: `boolean`; `signedIn`: `boolean`; }>
***
### driveWrite()
[Section titled “driveWrite()”](#drivewrite)
> **driveWrite**(`container`, `folder`, `name`, `text`): `Promise`<`void`>
Defined in: native.ts:11
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### container
[Section titled “container”](#container-4)
`string`
##### folder
[Section titled “folder”](#folder-3)
`string`
##### name
[Section titled “name”](#name-2)
`string`
##### text
[Section titled “text”](#text)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### keychainDelete()
[Section titled “keychainDelete()”](#keychaindelete)
> **keychainDelete**(`service`, `account`): `Promise`<`void`>
Defined in: native.ts:19
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### service
[Section titled “service”](#service)
`string`
##### account
[Section titled “account”](#account)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`void`>
***
### keychainGet()
[Section titled “keychainGet()”](#keychainget)
> **keychainGet**(`service`, `account`, `reason`): `Promise`<`string` | `null`>
Defined in: native.ts:17
The key, after Face ID / Touch ID / passcode (one confirmation covers 30 s).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### service
[Section titled “service”](#service-1)
`string`
##### account
[Section titled “account”](#account-1)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`string` | `null`>
***
### keychainHas()
[Section titled “keychainHas()”](#keychainhas)
> **keychainHas**(`service`, `account`): `Promise`<`boolean`>
Defined in: native.ts:15
Is a synced key there — no prompt.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### service
[Section titled “service”](#service-2)
`string`
##### account
[Section titled “account”](#account-2)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`boolean`>
***
### keychainSet()
[Section titled “keychainSet()”](#keychainset)
> **keychainSet**(`service`, `account`, `value`): `Promise`<`void`>
Defined in: native.ts:18
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### service
[Section titled “service”](#service-3)
`string`
##### account
[Section titled “account”](#account-3)
`string`
##### value
[Section titled “value”](#value)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`void`>
# NativeDriveFile
Defined in: native.ts:1
## Properties
[Section titled “Properties”](#properties)
### downloaded
[Section titled “downloaded”](#downloaded)
> **downloaded**: `boolean`
Defined in: native.ts:3
***
### modifiedAt
[Section titled “modifiedAt”](#modifiedat)
> **modifiedAt**: `number`
Defined in: native.ts:4
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: native.ts:2
# RestoreBackupOptions
Defined in: backup.ts:96
## Properties
[Section titled “Properties”](#properties)
### expect?
[Section titled “expect?”](#expect)
> `optional` **expect?**: `Pick`<`BackupMeta`, `"type"` | `"fingerprint"`>
Defined in: backup.ts:104
Refuse a backup of any other wallet (e.g. restoring “this” account).
***
### kdf?
[Section titled “kdf?”](#kdf)
> `optional` **kdf?**: `KdfOptions`
Defined in: backup.ts:105
***
### keyVault?
[Section titled “keyVault?”](#keyvault)
> `optional` **keyVault?**: [`KeyVault`](/api/anywalletkit/backup-cloud/interfaces/keyvault/)
Defined in: backup.ts:102
…or with the key from this vault (tried when no password is given).
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: backup.ts:98
***
### password?
[Section titled “password?”](#password)
> `optional` **password?**: `string`
Defined in: backup.ts:100
Open with the password…
***
### store
[Section titled “store”](#store)
> **store**: [`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
Defined in: backup.ts:97
# SaveBackupOptions
Defined in: backup.ts:15
## Properties
[Section titled “Properties”](#properties)
### kdf?
[Section titled “kdf?”](#kdf)
> `optional` **kdf?**: `KdfOptions`
Defined in: backup.ts:24
***
### keyVault?
[Section titled “keyVault?”](#keyvault)
> `optional` **keyVault?**: [`KeyVault`](/api/anywalletkit/backup-cloud/interfaces/keyvault/)
Defined in: backup.ts:23
A key protector from this vault (e.g. iCloud Keychain) — the no-password option.
***
### meta
[Section titled “meta”](#meta)
> **meta**: `BackupMeta`
Defined in: backup.ts:19
***
### password?
[Section titled “password?”](#password)
> `optional` **password?**: `string`
Defined in: backup.ts:21
A password protector (≥10 characters).
***
### secret
[Section titled “secret”](#secret)
> **secret**: `string`
Defined in: backup.ts:18
The keyring’s stored string for this source.
***
### store
[Section titled “store”](#store)
> **store**: [`BackupStore`](/api/anywalletkit/backup-cloud/interfaces/backupstore/)
Defined in: backup.ts:16
# StoredFile
Defined in: stores.ts:4
## Properties
[Section titled “Properties”](#properties)
### downloaded
[Section titled “downloaded”](#downloaded)
> **downloaded**: `boolean`
Defined in: stores.ts:7
false = iCloud has it but this device hasn’t downloaded it yet (`get` downloads it).
***
### modifiedAt
[Section titled “modifiedAt”](#modifiedat)
> **modifiedAt**: `number`
Defined in: stores.ts:8
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: stores.ts:5
# CloudBackupErrorCode
> **CloudBackupErrorCode** = `"cancelled"` | `"signed-out"` | `"unavailable"` | `"not-found"` | `"key-missing"` | `"mismatch"` | `"storage"`
Defined in: errors.ts:11
* `cancelled` — the user dismissed the Face ID / passcode sheet that guards a backup key.
* `signed-out` — no iCloud account on the device, or iCloud Drive is off.
* `unavailable` — this platform / build has no such store (e.g. Android today, or the entitlement is missing).
* `not-found` — no backup under that name.
* `key-missing` — the backup needs its iCloud Keychain key, and this device doesn’t have it (Keychain sync off, not synced yet).
* `mismatch` — the backup belongs to a different wallet than the one expected.
* `storage` — anything else from the cloud layer. Wrong password / wrong key / a corrupted file stay seed-vault `BackupError`s.
# @anywalletkit/conformance
# @anywalletkit/conformance
[Section titled “@anywalletkit/conformance”](#anywalletkitconformance)
[](https://www.npmjs.com/package/@anywalletkit/conformance)
Test suites every Any Wallet Kit chain and protocol module runs, and the pinned derivation vectors they check against.
## Install
[Section titled “Install”](#install)
```sh
npm install -D @anywalletkit/conformance vitest
# or: pnpm add -D @anywalletkit/conformance vitest · yarn add -D @anywalletkit/conformance vitest
```
On npm: [@anywalletkit/conformance](https://www.npmjs.com/package/@anywalletkit/conformance), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance. A dev dependency for module authors; `vitest` is its peer.
| Export | Checks |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `describeChainModule` | a chain package: derivation against `derivationVectors` (several seeds and account indexes), signing, read-only accounts that never write |
| `describeProtocolModule` | a protocol module’s shape: required methods, a read-only account cannot write, a read or quote never signs or sends (any `sign*` / `send*` / `transfer` / `approve` / `broadcast*` call on the account fails it, even one the mock lacks, even when the quote then throws); reads listed in `mustResolve` must succeed with their samples |
| `describeProtocolBehaviour` | a swap2 module run to the review gate: only own or declared recipients, approvals exactly to the declared spender, amounts equal to the quote |
| `describeActivitySuite` | `describeActivity` recognizes the module’s recorded real transactions |
| `namesSuite` | a `NameResolver` implementation |
| `createMockAccount` | a recording `IWalletAccount` for tests |
| `derivationVectors` | golden addresses, public keys and signatures per chain |
The suites run under [Vitest](https://vitest.dev):
```sh
pnpm add -D @anywalletkit/conformance vitest
```
Apache-2.0
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ActivityFixtureJson](/api/anywalletkit/conformance/interfaces/activityfixturejson/)
* [ActivitySuiteOptions](/api/anywalletkit/conformance/interfaces/activitysuiteoptions/)
* [ChainSuiteOptions](/api/anywalletkit/conformance/interfaces/chainsuiteoptions/)
* [DerivationVectors](/api/anywalletkit/conformance/interfaces/derivationvectors/)
* [MockAccountOptions](/api/anywalletkit/conformance/interfaces/mockaccountoptions/)
* [MockCall](/api/anywalletkit/conformance/interfaces/mockcall/)
* [NamesSuiteFixture](/api/anywalletkit/conformance/interfaces/namessuitefixture/)
* [ProtocolBehaviourOptions](/api/anywalletkit/conformance/interfaces/protocolbehaviouroptions/)
* [ProtocolSuiteOptions](/api/anywalletkit/conformance/interfaces/protocolsuiteoptions/)
* [Swap2BehaviourFixture](/api/anywalletkit/conformance/interfaces/swap2behaviourfixture/)
* [VectorAccount](/api/anywalletkit/conformance/interfaces/vectoraccount/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ChainKey](/api/anywalletkit/conformance/type-aliases/chainkey/)
* [ProtocolCtor](/api/anywalletkit/conformance/type-aliases/protocolctor/)
* [WriteProtocolCtor](/api/anywalletkit/conformance/type-aliases/writeprotocolctor/)
## Variables
[Section titled “Variables”](#variables)
* [derivationVectors](/api/anywalletkit/conformance/variables/derivationvectors/)
## Functions
[Section titled “Functions”](#functions)
* [createMockAccount](/api/anywalletkit/conformance/functions/createmockaccount/)
* [describeActivitySuite](/api/anywalletkit/conformance/functions/describeactivitysuite/)
* [describeChainModule](/api/anywalletkit/conformance/functions/describechainmodule/)
* [describeProtocolBehaviour](/api/anywalletkit/conformance/functions/describeprotocolbehaviour/)
* [describeProtocolModule](/api/anywalletkit/conformance/functions/describeprotocolmodule/)
* [namesSuite](/api/anywalletkit/conformance/functions/namessuite/)
* [parseActivityFixture](/api/anywalletkit/conformance/functions/parseactivityfixture/)
* [watchSigning](/api/anywalletkit/conformance/functions/watchsigning/)
# createMockAccount
> **createMockAccount**(`opts?`): `IWalletAccount` & `object`
Defined in: mock-account.ts:21
An account that records every call. Protocol module unit tests use it to prove that `quote*` never sends and that writes go through `sendTransaction`.
## Parameters
[Section titled “Parameters”](#parameters)
### opts?
[Section titled “opts?”](#opts)
[`MockAccountOptions`](/api/anywalletkit/conformance/interfaces/mockaccountoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`IWalletAccount` & `object`
# describeActivitySuite
> **describeActivitySuite**<`P`>(`name`, `o`): `void`
Defined in: activity-suite.ts:59
The activity half of the conformance gate: every fixture classified, every negative refused, output well-formed.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P` *extends* `object`
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
### o
[Section titled “o”](#o)
[`ActivitySuiteOptions`](/api/anywalletkit/conformance/interfaces/activitysuiteoptions/)<`P`>
## Returns
[Section titled “Returns”](#returns)
`void`
# describeChainModule
> **describeChainModule**<`M`>(`name`, `o`): `void`
Defined in: chain-suite.ts:23
The conformance suite every chain package must pass. Call it inside a test file; it registers `describe`/`it` blocks with vitest.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### M
[Section titled “M”](#m)
`M` *extends* `WalletManager`<`IWalletAccount`, `object`>
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
### o
[Section titled “o”](#o)
[`ChainSuiteOptions`](/api/anywalletkit/conformance/interfaces/chainsuiteoptions/)<`M`>
## Returns
[Section titled “Returns”](#returns)
`void`
# describeProtocolBehaviour
> **describeProtocolBehaviour**<`P`>(`name`, `o`): `void`
Defined in: behaviour-suite.ts:65
Opt-in behavioural conformance: runs the module against a recorded quote to the engine’s review gate and checks WHAT it would sign, not just its shape.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P` *extends* `object`
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
### o
[Section titled “o”](#o)
[`ProtocolBehaviourOptions`](/api/anywalletkit/conformance/interfaces/protocolbehaviouroptions/)<`P`>
## Returns
[Section titled “Returns”](#returns)
`void`
# describeProtocolModule
> **describeProtocolModule**<`P`>(`name`, `o`): `void`
Defined in: protocol-suite.ts:76
The conformance suite every protocol module must pass.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P` *extends* `object`
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
### o
[Section titled “o”](#o)
[`ProtocolSuiteOptions`](/api/anywalletkit/conformance/interfaces/protocolsuiteoptions/)<`P`>
## Returns
[Section titled “Returns”](#returns)
`void`
# namesSuite
> **namesSuite**(`label`, `make`, `fx`): `void`
Defined in: names-suite.ts:26
## Parameters
[Section titled “Parameters”](#parameters)
### label
[Section titled “label”](#label)
`string`
### make
[Section titled “make”](#make)
() => `NameResolver`
### fx
[Section titled “fx”](#fx)
[`NamesSuiteFixture`](/api/anywalletkit/conformance/interfaces/namessuitefixture/)
## Returns
[Section titled “Returns”](#returns)
`void`
# parseActivityFixture
> **parseActivityFixture**(`f`): `object`
Defined in: activity-suite.ts:33
## Parameters
[Section titled “Parameters”](#parameters)
### f
[Section titled “f”](#f)
[`ActivityFixtureJson`](/api/anywalletkit/conformance/interfaces/activityfixturejson/)
## Returns
[Section titled “Returns”](#returns)
`object`
### own
[Section titled “own”](#own)
> **own**: `Set`<`string`>
### tx
[Section titled “tx”](#tx)
> **tx**: `ChainTx`
# watchSigning
> **watchSigning**<`A`>(`account`): `object`
Defined in: protocol-suite.ts:60
Wrap `account` so that every signing or broadcasting call is recorded — including one to a method the account does not have (a quote that calls `signTypedData` on the plain mock would otherwise fail with a TypeError and look like a missing fixture).
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### A
[Section titled “A”](#a)
`A` *extends* `object`
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`A`
## Returns
[Section titled “Returns”](#returns)
`object`
### account
[Section titled “account”](#account-1)
> **account**: `A`
### calls
[Section titled “calls”](#calls)
> **calls**: `string`\[]
# ActivityFixtureJson
Defined in: activity-suite.ts:11
Activity fixtures: recorded real transactions a module must recognize through `describeActivity`. JSON on disk (bigints as decimal strings) so fixtures can be captured from explorers / the live harness and reviewed in a diff.
## Properties
[Section titled “Properties”](#properties)
### expect
[Section titled “expect”](#expect)
> **expect**: `object`
Defined in: activity-suite.ts:22
#### assetsIn?
[Section titled “assetsIn?”](#assetsin)
> `optional` **assetsIn?**: `object`\[]
Assets that must appear, by token id (null = native) and exact base-unit amount.
#### assetsOut?
[Section titled “assetsOut?”](#assetsout)
> `optional` **assetsOut?**: `object`\[]
#### counterparty?
[Section titled “counterparty?”](#counterparty)
> `optional` **counterparty?**: `string`
#### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
#### title?
[Section titled “title?”](#title)
> `optional` **title?**: `string`
Substring the title must contain (case-insensitive).
***
### note?
[Section titled “note?”](#note)
> `optional` **note?**: `string`
Defined in: activity-suite.ts:13
Why this tx is here, e.g. “Aave v3 supply USDC on Base (funded test 2026-10-10)”.
***
### own
[Section titled “own”](#own)
> **own**: `string`\[]
Defined in: activity-suite.ts:15
The wallet’s own addresses on that chain.
***
### tx
[Section titled “tx”](#tx)
> **tx**: `Omit`<`ChainTx`, `"fee"` | `"nativeValue"` | `"block"` | `"transfers"`> & `object`
Defined in: activity-suite.ts:16
#### Type Declaration
[Section titled “Type Declaration”](#type-declaration)
##### block?
[Section titled “block?”](#block)
> `optional` **block?**: `string`
##### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `string`
##### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `string`
##### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `Omit`<`ChainTransfer`, `"amount"`> & `object`\[]
# ActivitySuiteOptions
Defined in: activity-suite.ts:46
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
## Properties
[Section titled “Properties”](#properties)
### config?
[Section titled “config?”](#config)
> `optional` **config?**: `unknown`
Defined in: activity-suite.ts:48
***
### fixtures
[Section titled “fixtures”](#fixtures)
> **fixtures**: [`ActivityFixtureJson`](/api/anywalletkit/conformance/interfaces/activityfixturejson/)\[]
Defined in: activity-suite.ts:50
Recorded transactions this module must describe. At least one is required: a module that recognizes nothing is not ready.
***
### negatives?
[Section titled “negatives?”](#negatives)
> `optional` **negatives?**: [`ActivityFixtureJson`](/api/anywalletkit/conformance/interfaces/activityfixturejson/)\[]
Defined in: activity-suite.ts:52
Transactions that look similar but are NOT this module’s; `describeActivity` must return null.
***
### Protocol
[Section titled “Protocol”](#protocol)
> **Protocol**: [`ProtocolCtor`](/api/anywalletkit/conformance/type-aliases/protocolctor/)<`P`>
Defined in: activity-suite.ts:47
# ChainSuiteOptions
Defined in: chain-suite.ts:5
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### M
[Section titled “M”](#m)
`M` *extends* `WalletManager`<`IWalletAccount`, `object`>
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`ChainKey`](/api/anywalletkit/conformance/type-aliases/chainkey/)
Defined in: chain-suite.ts:7
Which vector set to compare against.
***
### checkSignMessage?
[Section titled “checkSignMessage?”](#checksignmessage)
> `optional` **checkSignMessage?**: `boolean`
Defined in: chain-suite.ts:11
Compare the recorded `sign(message)` encoding too (default true).
***
### create
[Section titled “create”](#create)
> **create**: (`seed`) => `M` | `Promise`<`M`>
Defined in: chain-suite.ts:9
Build a manager for a seed. Must NOT need the network for getAccount/getAddress/sign.
#### Parameters
[Section titled “Parameters”](#parameters)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns)
`M` | `Promise`<`M`>
***
### curve?
[Section titled “curve?”](#curve)
> `optional` **curve?**: `SignerCurve`
Defined in: chain-suite.ts:16
***
### fromSigner?
[Section titled “fromSigner?”](#fromsigner)
> `optional` **fromSigner?**: (`signer`) => `M` | `Promise`<`M`>
Defined in: chain-suite.ts:15
Build a manager from a Signer (multi-keyring import). With `curve`, the single-key account rules are checked.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### signer
[Section titled “signer”](#signer)
`Signer`
#### Returns
[Section titled “Returns”](#returns-1)
`M` | `Promise`<`M`>
***
### publicKeyOf?
[Section titled “publicKeyOf?”](#publickeyof)
> `optional` **publicKeyOf?**: (`account`) => `Promise`<`string` | `Uint8Array`<`ArrayBufferLike`> | `undefined`>
Defined in: chain-suite.ts:13
Hex of the account’s public key; omit if the account does not expose one.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### account
[Section titled “account”](#account)
`IWalletAccount`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `Uint8Array`<`ArrayBufferLike`> | `undefined`>
# DerivationVectors
Defined in: vectors.ts:18
## Properties
[Section titled “Properties”](#properties)
### evmTx
[Section titled “evmTx”](#evmtx)
> **evmTx**: `Record`<`string`, `unknown`>
Defined in: vectors.ts:21
***
### evmTypedData
[Section titled “evmTypedData”](#evmtypeddata)
> **evmTypedData**: `Record`<`string`, `unknown`>
Defined in: vectors.ts:22
***
### generatedAt
[Section titled “generatedAt”](#generatedat)
> **generatedAt**: `string`
Defined in: vectors.ts:19
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: vectors.ts:20
***
### seeds
[Section titled “seeds”](#seeds)
> **seeds**: `Record`<`string`, `string`>
Defined in: vectors.ts:23
***
### vectors
[Section titled “vectors”](#vectors)
> **vectors**: `Record`<[`ChainKey`](/api/anywalletkit/conformance/type-aliases/chainkey/), `Record`<`string`, { `accounts`: [`VectorAccount`](/api/anywalletkit/conformance/interfaces/vectoraccount/)\[]; }>>
Defined in: vectors.ts:24
# MockAccountOptions
Defined in: mock-account.ts:5
## Properties
[Section titled “Properties”](#properties)
### address?
[Section titled “address?”](#address)
> `optional` **address?**: `string`
Defined in: mock-account.ts:7
***
### balance?
[Section titled “balance?”](#balance)
> `optional` **balance?**: `bigint`
Defined in: mock-account.ts:8
***
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: `string`
Defined in: mock-account.ts:6
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: mock-account.ts:10
***
### receipt?
[Section titled “receipt?”](#receipt)
> `optional` **receipt?**: `Receipt`
Defined in: mock-account.ts:12
Receipt returned for any hash; default a successful one.
***
### serialized?
[Section titled “serialized?”](#serialized)
> `optional` **serialized?**: `boolean`
Defined in: mock-account.ts:14
Also expose swap2’s `sendSerializedTransaction` hook (Solana aggregator legs), recorded in `sent` with its expectation.
***
### tokenBalances?
[Section titled “tokenBalances?”](#tokenbalances)
> `optional` **tokenBalances?**: `Record`<`string`, `bigint`>
Defined in: mock-account.ts:9
# MockCall
Defined in: mock-account.ts:3
## Properties
[Section titled “Properties”](#properties)
### args
[Section titled “args”](#args)
> **args**: `unknown`\[]
Defined in: mock-account.ts:3
***
### method
[Section titled “method”](#method)
> **method**: `string`
Defined in: mock-account.ts:3
# NamesSuiteFixture
Defined in: names-suite.ts:11
What every NameResolver promises: a known name resolves to the expected address for its chain, bad input is refused by code (no I/O for invalid names), a name with no record for a chain is `no-address-for-chain` rather than another chain’s address, reverse lookups are forward-verified, and `supports` is a pure shape check.
## Properties
[Section titled “Properties”](#properties)
### foreign?
[Section titled “foreign?”](#foreign)
> `optional` **foreign?**: `string`
Defined in: names-suite.ts:23
A name shape another resolver owns (`alice.sol` for ENS) — `supports` must be false.
***
### invalid
[Section titled “invalid”](#invalid)
> **invalid**: `string`
Defined in: names-suite.ts:17
Input that must be refused as `invalid-name`.
***
### known
[Section titled “known”](#known)
> **known**: `object`
Defined in: names-suite.ts:13
A name that resolves on `chain` to `address` (case-insensitive compare).
#### address
[Section titled “address”](#address)
> **address**: `string`
#### chain
[Section titled “chain”](#chain)
> **chain**: `string`
#### name
[Section titled “name”](#name)
> **name**: `string`
***
### noRecord?
[Section titled “noRecord?”](#norecord)
> `optional` **noRecord?**: `object`
Defined in: names-suite.ts:19
A name that exists but has no record for this chain (optional).
#### chain
[Section titled “chain”](#chain-1)
> **chain**: `string`
#### name
[Section titled “name”](#name-1)
> **name**: `string`
***
### unregistered
[Section titled “unregistered”](#unregistered)
> **unregistered**: `string`
Defined in: names-suite.ts:15
A name the resolver serves but that is not registered.
***
### unsupportedChain?
[Section titled “unsupportedChain?”](#unsupportedchain)
> `optional` **unsupportedChain?**: `string`
Defined in: names-suite.ts:21
A chain the resolver cannot serve at all (optional).
# ProtocolBehaviourOptions
Defined in: behaviour-suite.ts:46
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
## Properties
[Section titled “Properties”](#properties)
### config
[Section titled “config”](#config)
> **config**: `Record`<`string`, `unknown`>
Defined in: behaviour-suite.ts:50
Constructor config (e.g. `{fromChain}`); the suite adds `reviewExecution`.
***
### fixtures
[Section titled “fixtures”](#fixtures)
> **fixtures**: [`Swap2BehaviourFixture`](/api/anywalletkit/conformance/interfaces/swap2behaviourfixture/)\[]
Defined in: behaviour-suite.ts:51
***
### Protocol
[Section titled “Protocol”](#protocol)
> **Protocol**: [`WriteProtocolCtor`](/api/anywalletkit/conformance/type-aliases/writeprotocolctor/)<`P`>
Defined in: behaviour-suite.ts:48
***
### type
[Section titled “type”](#type)
> **type**: `"swap2"`
Defined in: behaviour-suite.ts:47
# ProtocolSuiteOptions
Defined in: protocol-suite.ts:21
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
## Properties
[Section titled “Properties”](#properties)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: () => `IWalletAccount`
Defined in: protocol-suite.ts:36
Account factory for reads; default: the recording mock. Use a fixture-backed one for real quote checks.
#### Returns
[Section titled “Returns”](#returns)
`IWalletAccount`
***
### activity?
[Section titled “activity?”](#activity)
> `optional` **activity?**: `object`
Defined in: protocol-suite.ts:49
Recorded transactions the module must recognize through `describeActivity` (and ones it must refuse). Required for every module in the registry: a wallet built on the SDK shows these as “Supplied USDC · Aave v3” instead of “Contract call”. Load them from `fixtures/activity/*.json`.
#### fixtures
[Section titled “fixtures”](#fixtures)
> **fixtures**: [`ActivityFixtureJson`](/api/anywalletkit/conformance/interfaces/activityfixturejson/)\[]
#### negatives?
[Section titled “negatives?”](#negatives)
> `optional` **negatives?**: [`ActivityFixtureJson`](/api/anywalletkit/conformance/interfaces/activityfixturejson/)\[]
***
### config?
[Section titled “config?”](#config)
> `optional` **config?**: `unknown`
Defined in: protocol-suite.ts:43
Constructor config, when the module requires one (e.g. swap2 engines need `fromChain`).
***
### mustResolve?
[Section titled “mustResolve?”](#mustresolve)
> `optional` **mustResolve?**: `string`\[]
Defined in: protocol-suite.ts:41
Reads and quotes that must RESOLVE with their sample on `account` — an error fails the suite. Every other read is lenient (fixtures may be absent): it may throw, but it may never sign or send.
***
### notImplemented?
[Section titled “notImplemented?”](#notimplemented)
> `optional` **notImplemented?**: `string`\[]
Defined in: protocol-suite.ts:27
Methods this module intentionally leaves unimplemented (must throw NotImplementedError).
***
### Protocol
[Section titled “Protocol”](#protocol)
> **Protocol**: [`ProtocolCtor`](/api/anywalletkit/conformance/type-aliases/protocolctor/)<`P`>
Defined in: protocol-suite.ts:23
***
### samples?
[Section titled “samples?”](#samples)
> `optional` **samples?**: `Partial`<`Record`<`string`, `unknown`\[]>>
Defined in: protocol-suite.ts:25
Sample arguments per method, used to call `quote*`/reads and check they never send. Methods without a sample are only checked for presence.
***
### type
[Section titled “type”](#type)
> **type**: `ProtocolType`
Defined in: protocol-suite.ts:22
***
### unsupported?
[Section titled “unsupported?”](#unsupported)
> `optional` **unsupported?**: `string`\[]
Defined in: protocol-suite.ts:34
Methods the protocol itself has no use for (e.g. a staking protocol whose payouts settle automatically has nothing to claim). They must still exist and throw a clear Error on every account; they are excluded from the read-only check. Prefer `notImplemented` when the operation exists in the protocol but the module has not built it yet.
# Swap2BehaviourFixture
Defined in: behaviour-suite.ts:22
## Properties
[Section titled “Properties”](#properties)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: [`MockAccountOptions`](/api/anywalletkit/conformance/interfaces/mockaccountoptions/)
Defined in: behaviour-suite.ts:29
Signing mock account (address/chain must match what the recorded quote binds).
***
### depositAddress?
[Section titled “depositAddress?”](#depositaddress)
> `optional` **depositAddress?**: `string`
Defined in: behaviour-suite.ts:33
Deposit-address providers: the address the recorded quote declares.
***
### fetch
[Section titled “fetch”](#fetch)
> **fetch**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: behaviour-suite.ts:27
Recorded/mocked network for this fixture, installed as the global `fetch`.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`RequestInfo` | `URL`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `Request` | `URL`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: behaviour-suite.ts:23
***
### options
[Section titled “options”](#options)
> **options**: `Record`<`string`, `unknown`>
Defined in: behaviour-suite.ts:25
`Swap2Options` for `swap2()` / `quoteSwap2()` (include `minAmountOut`).
***
### own?
[Section titled “own?”](#own)
> `optional` **own?**: `string`\[]
Defined in: behaviour-suite.ts:31
The user’s other addresses (e.g. the destination-chain recipient). The signing account is always own.
***
### serialized?
[Section titled “serialized?”](#serialized)
> `optional` **serialized?**: (`serializedTx`, `own`) => `void` | `Promise`<`void`>
Defined in: behaviour-suite.ts:43
Provider-serialized legs (Solana aggregators): decode what the account would be asked to sign and assert it (fee payer, signers, programs, amounts). Required when the plan’s source is `serialized` — opaque bytes are not accepted unread.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### serializedTx
[Section titled “serializedTx”](#serializedtx)
`string`
##### own
[Section titled “own”](#own-1)
`ReadonlySet`<`string`>
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
***
### sourceToken?
[Section titled “sourceToken?”](#sourcetoken)
> `optional` **sourceToken?**: `string`
Defined in: behaviour-suite.ts:37
Source token contract; omit for the native coin.
***
### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
Defined in: behaviour-suite.ts:35
Calldata providers: the approval spender the recorded quote declares (none → no approval allowed).
# VectorAccount
Defined in: vectors.ts:5
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: vectors.ts:8
***
### index
[Section titled “index”](#index)
> **index**: `number`
Defined in: vectors.ts:6
***
### path
[Section titled “path”](#path)
> **path**: `string`
Defined in: vectors.ts:7
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: `string`
Defined in: vectors.ts:10
Hex. Compressed secp256k1 (33 bytes) or ed25519 (32 bytes).
***
### signMessage
[Section titled “signMessage”](#signmessage)
> **signMessage**: `string`
Defined in: vectors.ts:12
Chain-conventional encoding of `sign(message)`.
***
### signTransaction?
[Section titled “signTransaction?”](#signtransaction)
> `optional` **signTransaction?**: `string`
Defined in: vectors.ts:14
EVM only.
***
### signTypedData?
[Section titled “signTypedData?”](#signtypeddata)
> `optional` **signTypedData?**: `string`
Defined in: vectors.ts:15
# ChainKey
> **ChainKey** = `"evm"` | `"btc"` | `"ton"` | `"tron"` | `"solana"` | `"near"` | `"zcash"`
Defined in: vectors.ts:3
# ProtocolCtor
> **ProtocolCtor**<`P`> = (`account`, `config?`) => `P`
Defined in: ctor.ts:4
A protocol module class the suites construct over a mock account (read-only or signing) and an optional config.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
### config?
[Section titled “config?”](#config)
`any`
## Returns
[Section titled “Returns”](#returns)
`P`
# WriteProtocolCtor
> **WriteProtocolCtor**<`P`> = (`account`, `config?`) => `P`
Defined in: ctor.ts:6
A protocol module class the behaviour suite drives through writes: constructed over a signing account.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`IWalletAccount`
### config?
[Section titled “config?”](#config)
`any`
## Returns
[Section titled “Returns”](#returns)
`P`
# derivationVectors
> `const` **derivationVectors**: [`DerivationVectors`](/api/anywalletkit/conformance/interfaces/derivationvectors/)
Defined in: vectors.ts:28
Pinned derivation vectors: addresses, public keys and signatures per chain for three test seeds.
# @anywalletkit/core
# @anywalletkit/core
[Section titled “@anywalletkit/core”](#anywalletkitcore)
[](https://www.npmjs.com/package/@anywalletkit/core)
The contracts every Any Wallet Kit package is written against.
* **Accounts and signers.** `IWalletAccount` (what protocol modules see) and `Signer` (what holds a key). The local seed signer is one implementation; a Safe, a hardware wallet, MPC or a backend signer are others.
* **`WalletManager`** — the base class chain packages extend: one seed → accounts by index or path, `dispose()` zeroizes.
* **Protocol base classes** — swap, bridge, swap2 (swap + bridge in one), lending, staking, approvals, fiat. Every method throws `NotImplementedError` until a module implements it.
* **Errors** — the shared error classes apps branch on.
* **Key derivation** — BIP-39 seeds, BIP-32 (secp256k1) and SLIP-10 (ed25519) helpers.
* **History, names, numbers** — the activity and `NameResolver` interfaces, and BigInt helpers that are safe on Hermes.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/core
# or: pnpm add @anywalletkit/core · yarn add @anywalletkit/core
```
On npm: [@anywalletkit/core](https://www.npmjs.com/package/@anywalletkit/core), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Docs: [Accounts and signers](https://docs.anywallet.tech/concepts/accounts-and-signers/) · [Errors](https://docs.anywallet.tech/concepts/errors/) · [Packages](https://docs.anywallet.tech/getting-started/packages/)
Apache-2.0
## Classes
[Section titled “Classes”](#classes)
* [ApprovalsError](/api/anywalletkit/core/classes/approvalserror/)
* [ApprovalsProtocol](/api/anywalletkit/core/classes/approvalsprotocol/)
* [BridgeProtocol](/api/anywalletkit/core/classes/bridgeprotocol/)
* [FiatProtocol](/api/anywalletkit/core/classes/fiatprotocol/)
* [InsufficientFundsError](/api/anywalletkit/core/classes/insufficientfundserror/)
* [LendingProtocol](/api/anywalletkit/core/classes/lendingprotocol/)
* [LocalSigner](/api/anywalletkit/core/classes/localsigner/)
* [NameError](/api/anywalletkit/core/classes/nameerror/)
* [NetworkError](/api/anywalletkit/core/classes/networkerror/)
* [NotATokenError](/api/anywalletkit/core/classes/notatokenerror/)
* [NotImplementedError](/api/anywalletkit/core/classes/notimplementederror/)
* [ProtocolBase](/api/anywalletkit/core/classes/protocolbase/)
* [ReadOnlyAccountError](/api/anywalletkit/core/classes/readonlyaccounterror/)
* [SignerError](/api/anywalletkit/core/classes/signererror/)
* [StakingProtocol](/api/anywalletkit/core/classes/stakingprotocol/)
* [Swap2Protocol](/api/anywalletkit/core/classes/swap2protocol/)
* [SwapProtocol](/api/anywalletkit/core/classes/swapprotocol/)
* [UserRejectedError](/api/anywalletkit/core/classes/userrejectederror/)
* [WalletManager](/api/anywalletkit/core/classes/walletmanager/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ActivityAsset](/api/anywalletkit/core/interfaces/activityasset/)
* [ActivityItem](/api/anywalletkit/core/interfaces/activityitem/)
* [Approval](/api/anywalletkit/core/interfaces/approval/)
* [ApprovalsCoverage](/api/anywalletkit/core/interfaces/approvalscoverage/)
* [ApprovalsResult](/api/anywalletkit/core/interfaces/approvalsresult/)
* [BorrowOptions](/api/anywalletkit/core/interfaces/borrowoptions/)
* [BridgeOptions](/api/anywalletkit/core/interfaces/bridgeoptions/)
* [BridgeProtocolConfig](/api/anywalletkit/core/interfaces/bridgeprotocolconfig/)
* [BridgeResult](/api/anywalletkit/core/interfaces/bridgeresult/)
* [BuyCommonOptions](/api/anywalletkit/core/interfaces/buycommonoptions/)
* [BuyExactCryptoAmountOptions](/api/anywalletkit/core/interfaces/buyexactcryptoamountoptions/)
* [BuyResult](/api/anywalletkit/core/interfaces/buyresult/)
* [BuyWithFiatAmountOptions](/api/anywalletkit/core/interfaces/buywithfiatamountoptions/)
* [ChainCall](/api/anywalletkit/core/interfaces/chaincall/)
* [ChainTransfer](/api/anywalletkit/core/interfaces/chaintransfer/)
* [ChainTx](/api/anywalletkit/core/interfaces/chaintx/)
* [ClaimWithdrawalsOptions](/api/anywalletkit/core/interfaces/claimwithdrawalsoptions/)
* [ClaimWithdrawalsResult](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/)
* [DerivedKey](/api/anywalletkit/core/interfaces/derivedkey/)
* [DescribeActivityContext](/api/anywalletkit/core/interfaces/describeactivitycontext/)
* [ExternalSignerOptions](/api/anywalletkit/core/interfaces/externalsigneroptions/)
* [FeeRates](/api/anywalletkit/core/interfaces/feerates/)
* [FiatQuote](/api/anywalletkit/core/interfaces/fiatquote/)
* [FiatTransactionDetail](/api/anywalletkit/core/interfaces/fiattransactiondetail/)
* [GetApprovalsOptions](/api/anywalletkit/core/interfaces/getapprovalsoptions/)
* [HistoryPage](/api/anywalletkit/core/interfaces/historypage/)
* [HistoryQuery](/api/anywalletkit/core/interfaces/historyquery/)
* [HistorySource](/api/anywalletkit/core/interfaces/historysource/)
* [IApprovalsProtocol](/api/anywalletkit/core/interfaces/iapprovalsprotocol/)
* [IBridgeProtocol](/api/anywalletkit/core/interfaces/ibridgeprotocol/)
* [IFiatProtocol](/api/anywalletkit/core/interfaces/ifiatprotocol/)
* [ILendingProtocol](/api/anywalletkit/core/interfaces/ilendingprotocol/)
* [IStakingProtocol](/api/anywalletkit/core/interfaces/istakingprotocol/)
* [ISwap2Protocol](/api/anywalletkit/core/interfaces/iswap2protocol/)
* [ISwapProtocol](/api/anywalletkit/core/interfaces/iswapprotocol/)
* [IWalletAccount](/api/anywalletkit/core/interfaces/iwalletaccount/)
* [IWalletAccountReadOnly](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/)
* [LendingResult](/api/anywalletkit/core/interfaces/lendingresult/)
* [NameResolver](/api/anywalletkit/core/interfaces/nameresolver/)
* [NameWarning](/api/anywalletkit/core/interfaces/namewarning/)
* [Receipt](/api/anywalletkit/core/interfaces/receipt/)
* [RepayOptions](/api/anywalletkit/core/interfaces/repayoptions/)
* [ResolvedName](/api/anywalletkit/core/interfaces/resolvedname/)
* [RevokeResult](/api/anywalletkit/core/interfaces/revokeresult/)
* [SeedSigner](/api/anywalletkit/core/interfaces/seedsigner/)
* [SellCommonOptions](/api/anywalletkit/core/interfaces/sellcommonoptions/)
* [SellExactCryptoAmountOptions](/api/anywalletkit/core/interfaces/sellexactcryptoamountoptions/)
* [SellForFiatAmountOptions](/api/anywalletkit/core/interfaces/sellforfiatamountoptions/)
* [SellResult](/api/anywalletkit/core/interfaces/sellresult/)
* [Signer](/api/anywalletkit/core/interfaces/signer/)
* [SignOptions](/api/anywalletkit/core/interfaces/signoptions/)
* [StakedBalance](/api/anywalletkit/core/interfaces/stakedbalance/)
* [StakeOptions](/api/anywalletkit/core/interfaces/stakeoptions/)
* [StakeResult](/api/anywalletkit/core/interfaces/stakeresult/)
* [SupplyOptions](/api/anywalletkit/core/interfaces/supplyoptions/)
* [SupportedCountry](/api/anywalletkit/core/interfaces/supportedcountry/)
* [SupportedCryptoAsset](/api/anywalletkit/core/interfaces/supportedcryptoasset/)
* [SupportedFiatCurrency](/api/anywalletkit/core/interfaces/supportedfiatcurrency/)
* [Swap2CommonOptions](/api/anywalletkit/core/interfaces/swap2commonoptions/)
* [Swap2ExactInOptions](/api/anywalletkit/core/interfaces/swap2exactinoptions/)
* [Swap2ExactOutOptions](/api/anywalletkit/core/interfaces/swap2exactoutoptions/)
* [Swap2Fee](/api/anywalletkit/core/interfaces/swap2fee/)
* [Swap2ProtocolConfig](/api/anywalletkit/core/interfaces/swap2protocolconfig/)
* [Swap2Quote](/api/anywalletkit/core/interfaces/swap2quote/)
* [Swap2Result](/api/anywalletkit/core/interfaces/swap2result/)
* [Swap2StatusOptions](/api/anywalletkit/core/interfaces/swap2statusoptions/)
* [Swap2StatusResult](/api/anywalletkit/core/interfaces/swap2statusresult/)
* [Swap2SupportedChain](/api/anywalletkit/core/interfaces/swap2supportedchain/)
* [Swap2SupportedToken](/api/anywalletkit/core/interfaces/swap2supportedtoken/)
* [Swap2SupportedTokensOptions](/api/anywalletkit/core/interfaces/swap2supportedtokensoptions/)
* [Swap2Transaction](/api/anywalletkit/core/interfaces/swap2transaction/)
* [SwapBuyOptions](/api/anywalletkit/core/interfaces/swapbuyoptions/)
* [SwapCommonOptions](/api/anywalletkit/core/interfaces/swapcommonoptions/)
* [SwapProtocolConfig](/api/anywalletkit/core/interfaces/swapprotocolconfig/)
* [SwapResult](/api/anywalletkit/core/interfaces/swapresult/)
* [SwapSellOptions](/api/anywalletkit/core/interfaces/swapselloptions/)
* [TokenInfo](/api/anywalletkit/core/interfaces/tokeninfo/)
* [TransferOptions](/api/anywalletkit/core/interfaces/transferoptions/)
* [TransferResult](/api/anywalletkit/core/interfaces/transferresult/)
* [WithdrawalRequest](/api/anywalletkit/core/interfaces/withdrawalrequest/)
* [WithdrawalRequestOptions](/api/anywalletkit/core/interfaces/withdrawalrequestoptions/)
* [WithdrawalRequestResult](/api/anywalletkit/core/interfaces/withdrawalrequestresult/)
* [WithdrawalRequestsView](/api/anywalletkit/core/interfaces/withdrawalrequestsview/)
* [WithdrawOptions](/api/anywalletkit/core/interfaces/withdrawoptions/)
* [WriteOptions](/api/anywalletkit/core/interfaces/writeoptions/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ActivityKind](/api/anywalletkit/core/type-aliases/activitykind/)
* [ApprovalRisk](/api/anywalletkit/core/type-aliases/approvalrisk/)
* [ApprovalsErrorReason](/api/anywalletkit/core/type-aliases/approvalserrorreason/)
* [ApprovalStandard](/api/anywalletkit/core/type-aliases/approvalstandard/)
* [BridgeQuote](/api/anywalletkit/core/type-aliases/bridgequote/)
* [BuyOptions](/api/anywalletkit/core/type-aliases/buyoptions/)
* [ChainTxStatus](/api/anywalletkit/core/type-aliases/chaintxstatus/)
* [FiatTransactionStatus](/api/anywalletkit/core/type-aliases/fiattransactionstatus/)
* [LendingQuote](/api/anywalletkit/core/type-aliases/lendingquote/)
* [NameErrorCode](/api/anywalletkit/core/type-aliases/nameerrorcode/)
* [ProtocolType](/api/anywalletkit/core/type-aliases/protocoltype/)
* [SellOptions](/api/anywalletkit/core/type-aliases/selloptions/)
* [SignerCurve](/api/anywalletkit/core/type-aliases/signercurve/)
* [SignScheme](/api/anywalletkit/core/type-aliases/signscheme/)
* [Swap2FeeType](/api/anywalletkit/core/type-aliases/swap2feetype/)
* [Swap2Options](/api/anywalletkit/core/type-aliases/swap2options/)
* [Swap2Status](/api/anywalletkit/core/type-aliases/swap2status/)
* [SwapOptions](/api/anywalletkit/core/type-aliases/swapoptions/)
* [SwapQuote](/api/anywalletkit/core/type-aliases/swapquote/)
* [TokenFlag](/api/anywalletkit/core/type-aliases/tokenflag/)
## Variables
[Section titled “Variables”](#variables)
* [UNLIMITED_ALLOWANCE](/api/anywalletkit/core/variables/unlimited_allowance/)
## Functions
[Section titled “Functions”](#functions)
* [activityBase](/api/anywalletkit/core/functions/activitybase/)
* [assertNameUnchanged](/api/anywalletkit/core/functions/assertnameunchanged/)
* [bigintToNumber](/api/anywalletkit/core/functions/biginttonumber/)
* [bigintToUnits](/api/anywalletkit/core/functions/biginttounits/)
* [canSign](/api/anywalletkit/core/functions/cansign/)
* [copyBytes](/api/anywalletkit/core/functions/copybytes/)
* [defaultScheme](/api/anywalletkit/core/functions/defaultscheme/)
* [deriveEd25519](/api/anywalletkit/core/functions/deriveed25519/)
* [deriveSecp256k1](/api/anywalletkit/core/functions/derivesecp256k1/)
* [externalSigner](/api/anywalletkit/core/functions/externalsigner/)
* [feeLimit](/api/anywalletkit/core/functions/feelimit/)
* [getRandomSeedPhrase](/api/anywalletkit/core/functions/getrandomseedphrase/)
* [isNameLike](/api/anywalletkit/core/functions/isnamelike/)
* [isSeedSigner](/api/anywalletkit/core/functions/isseedsigner/)
* [isUnlimitedAllowance](/api/anywalletkit/core/functions/isunlimitedallowance/)
* [isValidSeedPhrase](/api/anywalletkit/core/functions/isvalidseedphrase/)
* [nameResolvers](/api/anywalletkit/core/functions/nameresolvers/)
* [netTransfers](/api/anywalletkit/core/functions/nettransfers/)
* [normalizeMnemonic](/api/anywalletkit/core/functions/normalizemnemonic/)
* [parsePath](/api/anywalletkit/core/functions/parsepath/)
* [privateKeySigner](/api/anywalletkit/core/functions/privatekeysigner/)
* [requireCurve](/api/anywalletkit/core/functions/requirecurve/)
* [sameAddress](/api/anywalletkit/core/functions/sameaddress/)
* [schemesFor](/api/anywalletkit/core/functions/schemesfor/)
* [seedFromMnemonic](/api/anywalletkit/core/functions/seedfrommnemonic/)
* [seedFromMnemonicSync](/api/anywalletkit/core/functions/seedfrommnemonicsync/)
* [splitNet](/api/anywalletkit/core/functions/splitnet/)
* [tweakSecp256k1PrivateKey](/api/anywalletkit/core/functions/tweaksecp256k1privatekey/)
* [zeroize](/api/anywalletkit/core/functions/zeroize/)
# ApprovalsError
Defined in: protocols/approvals.ts:101
Thrown by approvals modules with a machine-readable [ApprovalsErrorReason](/api/anywalletkit/core/type-aliases/approvalserrorreason/).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ApprovalsError**(`message`, `reason`, `details?`): `ApprovalsError`
Defined in: protocols/approvals.ts:106
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### reason
[Section titled “reason”](#reason)
[`ApprovalsErrorReason`](/api/anywalletkit/core/type-aliases/approvalserrorreason/)
##### details?
[Section titled “details?”](#details)
`Record`<`string`, `unknown`> = `{}`
#### Returns
[Section titled “Returns”](#returns)
`ApprovalsError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### details
[Section titled “details”](#details-1)
> `readonly` **details**: `Record`<`string`, `unknown`>
Defined in: protocols/approvals.ts:105
Extra context for logs (never secrets).
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: [`ApprovalsErrorReason`](/api/anywalletkit/core/type-aliases/approvalserrorreason/)
Defined in: protocols/approvals.ts:103
Machine-readable reason.
# ApprovalsProtocol
Defined in: protocols/approvals.ts:132
Base class for approvals modules.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* [`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ApprovalsProtocol**<`TConfig`>(`account`, `config?`): `ApprovalsProtocol`<`TConfig`>
Defined in: protocols/approvals.ts:136
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`ApprovalsProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-1)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### getApprovals()
[Section titled “getApprovals()”](#getapprovals)
> **getApprovals**(`_o?`): `Promise`<[`ApprovalsResult`](/api/anywalletkit/core/interfaces/approvalsresult/)>
Defined in: protocols/approvals.ts:140
Live approvals of the account, with risks and scan coverage.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_o?
[Section titled “\_o?”](#_o)
[`GetApprovalsOptions`](/api/anywalletkit/core/interfaces/getapprovalsoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`ApprovalsResult`](/api/anywalletkit/core/interfaces/approvalsresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/).[`getApprovals`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#getapprovals)
***
### getSupportedStandards()
[Section titled “getSupportedStandards()”](#getsupportedstandards)
> **getSupportedStandards**(): `Promise`<[`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)\[]>
Defined in: protocols/approvals.ts:139
Approval kinds this module can find and revoke.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/).[`getSupportedStandards`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#getsupportedstandards)
***
### quoteRevoke()
[Section titled “quoteRevoke()”](#quoterevoke)
> **quoteRevoke**(`_a`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocols/approvals.ts:141
Network fee of revoking one approval.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_a
[Section titled “\_a”](#_a)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/).[`quoteRevoke`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#quoterevoke)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### revoke()
[Section titled “revoke()”](#revoke)
> **revoke**(`_a`): `Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)>
Defined in: protocols/approvals.ts:142
Revoke one approval.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_a
[Section titled “\_a”](#_a-1)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/).[`revoke`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#revoke)
***
### revokeAll()
[Section titled “revokeAll()”](#revokeall)
> **revokeAll**(`_a`): `Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)\[]>
Defined in: protocols/approvals.ts:143
Revoke several, batching where the standard allows. Continues past failures; each result carries its own `error`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_a
[Section titled “\_a”](#_a-2)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)\[]
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`IApprovalsProtocol`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/).[`revokeAll`](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#revokeall)
# BridgeProtocol
Defined in: protocols/bridge.ts:45
Base class for bridge-only modules.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* [`BridgeProtocolConfig`](/api/anywalletkit/core/interfaces/bridgeprotocolconfig/) = [`BridgeProtocolConfig`](/api/anywalletkit/core/interfaces/bridgeprotocolconfig/)
## Implements
[Section titled “Implements”](#implements)
* [`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BridgeProtocol**<`TConfig`>(`account`, `config?`): `BridgeProtocol`<`TConfig`>
Defined in: protocols/bridge.ts:49
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`BridgeProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`_options`): `Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
Defined in: protocols/bridge.ts:52
Sign and broadcast a bridge transfer.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_options
[Section titled “\_options”](#_options)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/).[`bridge`](/api/anywalletkit/core/interfaces/ibridgeprotocol/#bridge)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-2)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`_options`): `Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
Defined in: protocols/bridge.ts:53
Fees of a bridge transfer; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_options
[Section titled “\_options”](#_options-1)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/).[`quoteBridge`](/api/anywalletkit/core/interfaces/ibridgeprotocol/#quotebridge)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
# FiatProtocol
Defined in: protocols/fiat.ts:68
Base class for fiat on/off-ramp modules.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* [`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new FiatProtocol**<`TConfig`>(`account`, `config?`): `FiatProtocol`<`TConfig`>
Defined in: protocols/fiat.ts:72
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`FiatProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### buy()
[Section titled “buy()”](#buy)
> **buy**(`_o`): `Promise`<[`BuyResult`](/api/anywalletkit/core/interfaces/buyresult/)>
Defined in: protocols/fiat.ts:76
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o
[Section titled “\_o”](#_o)
[`BuyOptions`](/api/anywalletkit/core/type-aliases/buyoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`BuyResult`](/api/anywalletkit/core/interfaces/buyresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`buy`](/api/anywalletkit/core/interfaces/ifiatprotocol/#buy)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-2)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### getSupportedCountries()
[Section titled “getSupportedCountries()”](#getsupportedcountries)
> **getSupportedCountries**(): `Promise`<[`SupportedCountry`](/api/anywalletkit/core/interfaces/supportedcountry/)\[]>
Defined in: protocols/fiat.ts:82
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`SupportedCountry`](/api/anywalletkit/core/interfaces/supportedcountry/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`getSupportedCountries`](/api/anywalletkit/core/interfaces/ifiatprotocol/#getsupportedcountries)
***
### getSupportedCryptoAssets()
[Section titled “getSupportedCryptoAssets()”](#getsupportedcryptoassets)
> **getSupportedCryptoAssets**(): `Promise`<[`SupportedCryptoAsset`](/api/anywalletkit/core/interfaces/supportedcryptoasset/)\[]>
Defined in: protocols/fiat.ts:80
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`SupportedCryptoAsset`](/api/anywalletkit/core/interfaces/supportedcryptoasset/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`getSupportedCryptoAssets`](/api/anywalletkit/core/interfaces/ifiatprotocol/#getsupportedcryptoassets)
***
### getSupportedFiatCurrencies()
[Section titled “getSupportedFiatCurrencies()”](#getsupportedfiatcurrencies)
> **getSupportedFiatCurrencies**(): `Promise`<[`SupportedFiatCurrency`](/api/anywalletkit/core/interfaces/supportedfiatcurrency/)\[]>
Defined in: protocols/fiat.ts:81
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`SupportedFiatCurrency`](/api/anywalletkit/core/interfaces/supportedfiatcurrency/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`getSupportedFiatCurrencies`](/api/anywalletkit/core/interfaces/ifiatprotocol/#getsupportedfiatcurrencies)
***
### getTransactionDetail()
[Section titled “getTransactionDetail()”](#gettransactiondetail)
> **getTransactionDetail**(`_id`): `Promise`<[`FiatTransactionDetail`](/api/anywalletkit/core/interfaces/fiattransactiondetail/)>
Defined in: protocols/fiat.ts:79
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_id
[Section titled “\_id”](#_id)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`FiatTransactionDetail`](/api/anywalletkit/core/interfaces/fiattransactiondetail/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`getTransactionDetail`](/api/anywalletkit/core/interfaces/ifiatprotocol/#gettransactiondetail)
***
### quoteBuy()
[Section titled “quoteBuy()”](#quotebuy)
> **quoteBuy**(`_o`): `Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
Defined in: protocols/fiat.ts:75
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_o
[Section titled “\_o”](#_o-1)
[`BuyOptions`](/api/anywalletkit/core/type-aliases/buyoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`quoteBuy`](/api/anywalletkit/core/interfaces/ifiatprotocol/#quotebuy)
***
### quoteSell()
[Section titled “quoteSell()”](#quotesell)
> **quoteSell**(`_o`): `Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
Defined in: protocols/fiat.ts:77
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-2)
[`SellOptions`](/api/anywalletkit/core/type-aliases/selloptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`quoteSell`](/api/anywalletkit/core/interfaces/ifiatprotocol/#quotesell)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### sell()
[Section titled “sell()”](#sell)
> **sell**(`_o`): `Promise`<[`SellResult`](/api/anywalletkit/core/interfaces/sellresult/)>
Defined in: protocols/fiat.ts:78
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_o
[Section titled “\_o”](#_o-3)
[`SellOptions`](/api/anywalletkit/core/type-aliases/selloptions/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`SellResult`](/api/anywalletkit/core/interfaces/sellresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`IFiatProtocol`](/api/anywalletkit/core/interfaces/ifiatprotocol/).[`sell`](/api/anywalletkit/core/interfaces/ifiatprotocol/#sell)
# InsufficientFundsError
Defined in: errors.ts:29
The account cannot cover amount + fee. Both in base units.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new InsufficientFundsError**(`required`, `available`, `token?`): `InsufficientFundsError`
Defined in: errors.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### required
[Section titled “required”](#required)
`bigint`
##### available
[Section titled “available”](#available)
`bigint`
##### token?
[Section titled “token?”](#token)
`string` = `'native'`
#### Returns
[Section titled “Returns”](#returns)
`InsufficientFundsError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### available
[Section titled “available”](#available-1)
> `readonly` **available**: `bigint`
Defined in: errors.ts:33
What the account holds, in base units.
***
### required
[Section titled “required”](#required-1)
> `readonly` **required**: `bigint`
Defined in: errors.ts:31
Amount plus fee needed, in base units.
# LendingProtocol
Defined in: protocols/lending.ts:48
Base class for lending modules: holds the account and config, and throws `NotImplementedError` for every method a module leaves out.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* [`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new LendingProtocol**<`TConfig`>(`account`, `config?`): `LendingProtocol`<`TConfig`>
Defined in: protocols/lending.ts:52
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`LendingProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`_o`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:59
Borrow against collateral.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o
[Section titled “\_o”](#_o)
[`BorrowOptions`](/api/anywalletkit/core/interfaces/borrowoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`borrow`](/api/anywalletkit/core/interfaces/ilendingprotocol/#borrow)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-2)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`_o`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:60
Network fee of `borrow`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_o
[Section titled “\_o”](#_o-1)
[`BorrowOptions`](/api/anywalletkit/core/interfaces/borrowoptions/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`quoteBorrow`](/api/anywalletkit/core/interfaces/ilendingprotocol/#quoteborrow)
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`_o`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:62
Network fee of `repay`.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_o
[Section titled “\_o”](#_o-2)
[`RepayOptions`](/api/anywalletkit/core/interfaces/repayoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`quoteRepay`](/api/anywalletkit/core/interfaces/ilendingprotocol/#quoterepay)
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`_o`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:56
Network fee of `supply`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-3)
[`SupplyOptions`](/api/anywalletkit/core/interfaces/supplyoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`quoteSupply`](/api/anywalletkit/core/interfaces/ilendingprotocol/#quotesupply)
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`_o`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:58
Network fee of `withdraw`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_o
[Section titled “\_o”](#_o-4)
[`WithdrawOptions`](/api/anywalletkit/core/interfaces/withdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`quoteWithdraw`](/api/anywalletkit/core/interfaces/ilendingprotocol/#quotewithdraw)
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`_o`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:61
Repay a borrow.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_o
[Section titled “\_o”](#_o-5)
[`RepayOptions`](/api/anywalletkit/core/interfaces/repayoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`repay`](/api/anywalletkit/core/interfaces/ilendingprotocol/#repay)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`_o`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:55
Deposit into the market or vault. Sends an approval first when needed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### \_o
[Section titled “\_o”](#_o-6)
[`SupplyOptions`](/api/anywalletkit/core/interfaces/supplyoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`supply`](/api/anywalletkit/core/interfaces/ilendingprotocol/#supply)
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`_o`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:57
Withdraw a deposit.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### \_o
[Section titled “\_o”](#_o-7)
[`WithdrawOptions`](/api/anywalletkit/core/interfaces/withdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`ILendingProtocol`](/api/anywalletkit/core/interfaces/ilendingprotocol/).[`withdraw`](/api/anywalletkit/core/interfaces/ilendingprotocol/#withdraw)
# LocalSigner
Defined in: signer.ts:184
Local key signer: the key lives in one `Uint8Array`, zeroized by `dispose()`. Built from a seed (derivable), from a seed as a leaf (`leafFromSeed`: no seed kept), or from a raw derived key (leaf only).
## Implements
[Section titled “Implements”](#implements)
* [`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/)
## Properties
[Section titled “Properties”](#properties)
### curve
[Section titled “curve”](#curve)
> `readonly` **curve**: [`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
Defined in: signer.ts:187
Curve of the key.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`curve`](/api/anywalletkit/core/interfaces/seedsigner/#curve)
***
### kind
[Section titled “kind”](#kind)
> `readonly` **kind**: `"seed"`
Defined in: signer.ts:185
Where the key lives: derived from a seed, one imported key, or outside the SDK.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`kind`](/api/anywalletkit/core/interfaces/seedsigner/#kind)
***
### path
[Section titled “path”](#path)
> `readonly` **path**: `string`
Defined in: signer.ts:189
Derivation path of this key.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`path`](/api/anywalletkit/core/interfaces/seedsigner/#path)
***
### publicKey
[Section titled “publicKey”](#publickey)
> `readonly` **publicKey**: `Uint8Array`
Defined in: signer.ts:191
Public key, available without a call.
***
### schemes
[Section titled “schemes”](#schemes)
> `readonly` **schemes**: readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
Defined in: signer.ts:193
Every scheme a local key on this curve can produce.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`schemes`](/api/anywalletkit/core/interfaces/seedsigner/#schemes)
## Methods
[Section titled “Methods”](#methods)
### derive()
[Section titled “derive()”](#derive)
> **derive**(`relativePath`): `Promise`<`LocalSigner`>
Defined in: signer.ts:281
A child signer at `path/relativePath` that keeps a seed copy and can derive further.
#### Parameters
[Section titled “Parameters”](#parameters)
##### relativePath
[Section titled “relativePath”](#relativepath)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`LocalSigner`>
#### Throws
[Section titled “Throws”](#throws)
[SignerError](/api/anywalletkit/core/classes/signererror/) when this signer has no seed (built with `fromPrivateKey` or `leafFromSeed`) or was disposed.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`derive`](/api/anywalletkit/core/interfaces/seedsigner/#derive)
***
### deriveLeaf()
[Section titled “deriveLeaf()”](#deriveleaf)
> **deriveLeaf**(`relativePath`): `Promise`<`LocalSigner`>
Defined in: signer.ts:289
Like `derive`, but the child keeps only its own key (no seed copy) and cannot derive further. What managers use for accounts.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### relativePath
[Section titled “relativePath”](#relativepath-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`LocalSigner`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`deriveLeaf`](/api/anywalletkit/core/interfaces/seedsigner/#deriveleaf)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: signer.ts:298
Zeroize the private key and any seed copy. Idempotent; signing afterwards throws.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`dispose`](/api/anywalletkit/core/interfaces/seedsigner/#dispose)
***
### getPublicKey()
[Section titled “getPublicKey()”](#getpublickey)
> **getPublicKey**(): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:230
The public key; same as [LocalSigner.publicKey](/api/anywalletkit/core/classes/localsigner/#publickey).
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`getPublicKey`](/api/anywalletkit/core/interfaces/seedsigner/#getpublickey)
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`payload`, `options?`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:241
Sign `payload` with the requested scheme (the curve’s default when omitted).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### payload
[Section titled “payload”](#payload)
`Uint8Array`
##### options?
[Section titled “options?”](#options)
[`SignOptions`](/api/anywalletkit/core/interfaces/signoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
#### Throws
[Section titled “Throws”](#throws-1)
[SignerError](/api/anywalletkit/core/classes/signererror/) after `dispose()`, for a scheme this curve cannot produce, a payload of the wrong length, or a `tweak` outside `schnorr`.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/).[`sign`](/api/anywalletkit/core/interfaces/seedsigner/#sign)
***
### toJSON()
[Section titled “toJSON()”](#tojson)
> **toJSON**(): `object`
Defined in: signer.ts:225
Public view only, for logs and serializers.
#### Returns
[Section titled “Returns”](#returns-5)
`object`
##### curve
[Section titled “curve”](#curve-1)
> **curve**: [`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
##### kind
[Section titled “kind”](#kind-1)
> **kind**: `"seed"`
##### path
[Section titled “path”](#path-1)
> **path**: `string`
##### publicKey
[Section titled “publicKey”](#publickey-1)
> **publicKey**: `string`
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`curve`, `privateKey`, `publicKey`, `path`): `LocalSigner`
Defined in: signer.ts:220
Wrap an already-derived key. Cannot derive children. Takes ownership of `privateKey` (zeroized on dispose).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### curve
[Section titled “curve”](#curve-2)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`LocalSigner`
***
### fromSeed()
[Section titled “fromSeed()”](#fromseed)
> `static` **fromSeed**(`seed`, `curve`, `path`): `LocalSigner`
Defined in: signer.ts:204
Derive the key at `path` from the 64-byte BIP-39 seed. Keeps a COPY of the seed so it can derive children.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### seed
[Section titled “seed”](#seed)
`Uint8Array`
##### curve
[Section titled “curve”](#curve-3)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
##### path
[Section titled “path”](#path-3)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`LocalSigner`
***
### leafFromSeed()
[Section titled “leafFromSeed()”](#leaffromseed)
> `static` **leafFromSeed**(`seed`, `curve`, `path`): `LocalSigner`
Defined in: signer.ts:214
Derive the key at `path` from the seed and keep ONLY that key: the signer cannot derive children and holds no copy of the seed. What chain managers hand to accounts, so an account never carries the master seed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### seed
[Section titled “seed”](#seed-1)
`Uint8Array`
##### curve
[Section titled “curve”](#curve-4)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
##### path
[Section titled “path”](#path-4)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`LocalSigner`
# NameError
Defined in: names.ts:29
Thrown by name resolvers with a machine-readable [NameErrorCode](/api/anywalletkit/core/type-aliases/nameerrorcode/).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NameError**(`code`, `message`, `detail?`): `NameError`
Defined in: names.ts:31
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`NameErrorCode`](/api/anywalletkit/core/type-aliases/nameerrorcode/)
##### message
[Section titled “message”](#message)
`string`
##### detail?
[Section titled “detail?”](#detail)
###### cause?
[Section titled “cause?”](#cause)
`unknown`
###### chain?
[Section titled “chain?”](#chain)
`string`
###### name?
[Section titled “name?”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NameError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`NameErrorCode`](/api/anywalletkit/core/type-aliases/nameerrorcode/)
Defined in: names.ts:32
***
### detail
[Section titled “detail”](#detail-1)
> `readonly` **detail**: `object` = `{}`
Defined in: names.ts:34
#### cause?
[Section titled “cause?”](#cause-1)
> `optional` **cause?**: `unknown`
#### chain?
[Section titled “chain?”](#chain-1)
> `optional` **chain?**: `string`
#### name?
[Section titled “name?”](#name-1)
> `optional` **name?**: `string`
***
### name
[Section titled “name”](#name-2)
> `readonly` **name**: `"NameError"` = `'NameError'`
Defined in: names.ts:30
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Error.name`
# NetworkError
Defined in: errors.ts:18
A network call failed. `provider` names the endpoint so failover can skip it.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NetworkError**(`message`, `options?`): `NetworkError`
Defined in: errors.ts:21
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
###### cause?
[Section titled “cause?”](#cause)
`unknown`
###### provider?
[Section titled “provider?”](#provider)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NetworkError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### provider
[Section titled “provider”](#provider-1)
> `readonly` **provider**: `string` | `undefined`
Defined in: errors.ts:20
Endpoint that failed, when known.
# NotATokenError
Defined in: errors.ts:59
The address is not a token on this chain (no contract, not a mint, no ERC-20 surface).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NotATokenError**(`address`, `reason`): `NotATokenError`
Defined in: errors.ts:62
#### Parameters
[Section titled “Parameters”](#parameters)
##### address
[Section titled “address”](#address)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NotATokenError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address-1)
> `readonly` **address**: `string`
Defined in: errors.ts:61
The address that was checked.
# NotImplementedError
Defined in: errors.ts:2
Thrown by protocol base classes for methods a module did not implement.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NotImplementedError**(`methodName`): `NotImplementedError`
Defined in: errors.ts:3
#### Parameters
[Section titled “Parameters”](#parameters)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NotImplementedError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# ProtocolBase
Defined in: protocols/base.ts:7
Shared plumbing for protocol base classes: holds the account and config, guards writes.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`SwapProtocol`](/api/anywalletkit/core/classes/swapprotocol/)
* [`BridgeProtocol`](/api/anywalletkit/core/classes/bridgeprotocol/)
* [`Swap2Protocol`](/api/anywalletkit/core/classes/swap2protocol/)
* [`LendingProtocol`](/api/anywalletkit/core/classes/lendingprotocol/)
* [`StakingProtocol`](/api/anywalletkit/core/classes/stakingprotocol/)
* [`ApprovalsProtocol`](/api/anywalletkit/core/classes/approvalsprotocol/)
* [`FiatProtocol`](/api/anywalletkit/core/classes/fiatprotocol/)
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ProtocolBase**<`TConfig`>(`account`, `config`): `ProtocolBase`<`TConfig`>
Defined in: protocols/base.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config
[Section titled “config”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
`ProtocolBase`<`TConfig`>
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
## Methods
[Section titled “Methods”](#methods)
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-1)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
# ReadOnlyAccountError
Defined in: errors.ts:51
A write method was called on a read-only account.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ReadOnlyAccountError**(`methodName`): `ReadOnlyAccountError`
Defined in: errors.ts:52
#### Parameters
[Section titled “Parameters”](#parameters)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns)
`ReadOnlyAccountError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# SignerError
Defined in: errors.ts:10
A signer could not produce a signature (locked, disposed, wrong curve…).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SignerError**(`message`): `SignerError`
Defined in: errors.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`SignerError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# StakingProtocol
Defined in: protocols/staking.ts:101
Base class for staking modules: holds the account and config, and throws `NotImplementedError` for every method a module leaves out.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* [`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StakingProtocol**<`TConfig`>(`account`, `config?`): `StakingProtocol`<`TConfig`>
Defined in: protocols/staking.ts:105
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`StakingProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_o?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/)>
Defined in: protocols/staking.ts:113
Claim finalized requests; the native coin returns to the account.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o?
[Section titled “\_o?”](#_o)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/core/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/core/interfaces/istakingprotocol/#claimwithdrawals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-2)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocols/staking.ts:116
APR in percent: 2.5 = 2.5 % (every staking module and app reads it this way).
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`getApr`](/api/anywalletkit/core/interfaces/istakingprotocol/#getapr)
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/core/interfaces/stakedbalance/)>
Defined in: protocols/staking.ts:115
The account’s staked position.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`StakedBalance`](/api/anywalletkit/core/interfaces/stakedbalance/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`getStakedBalance`](/api/anywalletkit/core/interfaces/istakingprotocol/#getstakedbalance)
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/core/interfaces/withdrawalrequestsview/)>
Defined in: protocols/staking.ts:112
The account’s open requests, and which are claimable.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/core/interfaces/withdrawalrequestsview/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/core/interfaces/istakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_o?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocols/staking.ts:114
Network fee of [IStakingProtocol.claimWithdrawals](/api/anywalletkit/core/interfaces/istakingprotocol/#claimwithdrawals).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_o?
[Section titled “\_o?”](#_o-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/core/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/core/interfaces/istakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`_o`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocols/staking.ts:111
Network fee of [IStakingProtocol.requestWithdrawal](/api/anywalletkit/core/interfaces/istakingprotocol/#requestwithdrawal).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_o
[Section titled “\_o”](#_o-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/core/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/core/interfaces/istakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`_o`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/), `"hash"`>>
Defined in: protocols/staking.ts:109
Network fee of [IStakingProtocol.stake](/api/anywalletkit/core/interfaces/istakingprotocol/#stake); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-3)
[`StakeOptions`](/api/anywalletkit/core/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`quoteStake`](/api/anywalletkit/core/interfaces/istakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`_o`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/)>
Defined in: protocols/staking.ts:110
Put staked tokens in the withdrawal queue. Sends an approval first when the protocol needs one.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_o
[Section titled “\_o”](#_o-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/core/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/core/interfaces/istakingprotocol/#requestwithdrawal)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`_o`): `Promise`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/)>
Defined in: protocols/staking.ts:108
Stake native coin and receive the protocol’s staked token.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### \_o
[Section titled “\_o”](#_o-5)
[`StakeOptions`](/api/anywalletkit/core/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`IStakingProtocol`](/api/anywalletkit/core/interfaces/istakingprotocol/).[`stake`](/api/anywalletkit/core/interfaces/istakingprotocol/#stake)
# Swap2Protocol
Defined in: protocols/swap2.ts:185
Swap + bridge in one. `swap` and `bridge` are derived from `swap2`, so a swap2 module is automatically a swap and a bridge module.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* [`Swap2ProtocolConfig`](/api/anywalletkit/core/interfaces/swap2protocolconfig/) = [`Swap2ProtocolConfig`](/api/anywalletkit/core/interfaces/swap2protocolconfig/)
## Implements
[Section titled “Implements”](#implements)
* [`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/)
* [`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/)
* [`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2Protocol**<`TConfig`>(`account`, `config?`): `Swap2Protocol`<`TConfig`>
Defined in: protocols/swap2.ts:189
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`Swap2Protocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
Defined in: protocols/swap2.ts:204
The older `bridge`, run through `swap2` with the same token on both chains.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options
[Section titled “options”](#options)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/).[`bridge`](/api/anywalletkit/core/interfaces/ibridgeprotocol/#bridge)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-2)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<[`Swap2SupportedChain`](/api/anywalletkit/core/interfaces/swap2supportedchain/)\[]>
Defined in: protocols/swap2.ts:217
Chains this provider can swap on or to.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`Swap2SupportedChain`](/api/anywalletkit/core/interfaces/swap2supportedchain/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/).[`getSupportedChains`](/api/anywalletkit/core/interfaces/iswap2protocol/#getsupportedchains)
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`_options?`): `Promise`<[`Swap2SupportedToken`](/api/anywalletkit/core/interfaces/swap2supportedtoken/)\[]>
Defined in: protocols/swap2.ts:218
Tokens this provider can swap, optionally narrowed by [Swap2SupportedTokensOptions](/api/anywalletkit/core/interfaces/swap2supportedtokensoptions/).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_options?
[Section titled “\_options?”](#_options)
[`Swap2SupportedTokensOptions`](/api/anywalletkit/core/interfaces/swap2supportedtokensoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`Swap2SupportedToken`](/api/anywalletkit/core/interfaces/swap2supportedtoken/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/).[`getSupportedTokens`](/api/anywalletkit/core/interfaces/iswap2protocol/#getsupportedtokens)
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`_id`, `_options?`): `Promise`<[`Swap2StatusResult`](/api/anywalletkit/core/interfaces/swap2statusresult/)>
Defined in: protocols/swap2.ts:216
State of a swap by the `id` from [Swap2Result](/api/anywalletkit/core/interfaces/swap2result/). Poll it until a final status.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_id
[Section titled “\_id”](#_id)
`string`
##### \_options?
[Section titled “\_options?”](#_options-1)
[`Swap2StatusOptions`](/api/anywalletkit/core/interfaces/swap2statusoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`Swap2StatusResult`](/api/anywalletkit/core/interfaces/swap2statusresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/).[`getSwap2Status`](/api/anywalletkit/core/interfaces/iswap2protocol/#getswap2status)
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
Defined in: protocols/swap2.ts:209
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-1)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`IBridgeProtocol`](/api/anywalletkit/core/interfaces/ibridgeprotocol/).[`quoteBridge`](/api/anywalletkit/core/interfaces/ibridgeprotocol/#quotebridge)
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
Defined in: protocols/swap2.ts:199
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-2)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/).[`quoteSwap`](/api/anywalletkit/core/interfaces/iswapprotocol/#quoteswap)
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`_options`): `Promise`<[`Swap2Quote`](/api/anywalletkit/core/interfaces/swap2quote/)>
Defined in: protocols/swap2.ts:214
Price a swap. Signs nothing and works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_options
[Section titled “\_options”](#_options-2)
[`Swap2Options`](/api/anywalletkit/core/type-aliases/swap2options/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`Swap2Quote`](/api/anywalletkit/core/interfaces/swap2quote/)>
#### Throws
[Section titled “Throws”](#throws)
`Swap2QuoteError` (from `protocol-swap2-core`) with a named reason when there is no route.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/).[`quoteSwap2`](/api/anywalletkit/core/interfaces/iswap2protocol/#quoteswap2)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
Defined in: protocols/swap2.ts:194
The older same-chain `swap`, run through [Swap2Protocol.swap2](/api/anywalletkit/core/classes/swap2protocol/#swap2).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options
[Section titled “options”](#options-3)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/).[`swap`](/api/anywalletkit/core/interfaces/iswapprotocol/#swap)
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`_options`, `_config?`): `Promise`<[`Swap2Result`](/api/anywalletkit/core/interfaces/swap2result/)>
Defined in: protocols/swap2.ts:215
Quote again, check the quote (amounts, recipient, refund address, fee ceilings in `config`), then sign and broadcast the source transaction (and an approval when one is needed).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### \_options
[Section titled “\_options”](#_options-3)
[`Swap2Options`](/api/anywalletkit/core/type-aliases/swap2options/)
##### \_config?
[Section titled “\_config?”](#_config-1)
[`Swap2ProtocolConfig`](/api/anywalletkit/core/interfaces/swap2protocolconfig/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`Swap2Result`](/api/anywalletkit/core/interfaces/swap2result/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`ISwap2Protocol`](/api/anywalletkit/core/interfaces/iswap2protocol/).[`swap2`](/api/anywalletkit/core/interfaces/iswap2protocol/#swap2)
# SwapProtocol
Defined in: protocols/swap.ts:52
Base class for swap-only modules.
## Extends
[Section titled “Extends”](#extends)
* [`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/)<`TConfig`>
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* [`SwapProtocolConfig`](/api/anywalletkit/core/interfaces/swapprotocolconfig/) = [`SwapProtocolConfig`](/api/anywalletkit/core/interfaces/swapprotocolconfig/)
## Implements
[Section titled “Implements”](#implements)
* [`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SwapProtocol**<`TConfig`>(`account`, `config?`): `SwapProtocol`<`TConfig`>
Defined in: protocols/swap.ts:56
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
##### config?
[Section titled “config?”](#config)
`TConfig` = `...`
#### Returns
[Section titled “Returns”](#returns)
`SwapProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`constructor`](/api/anywalletkit/core/classes/protocolbase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/) | [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:8
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_account`](/api/anywalletkit/core/classes/protocolbase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: protocols/base.ts:9
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`_config`](/api/anywalletkit/core/classes/protocolbase/#_config)
## Methods
[Section titled “Methods”](#methods)
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_tx
[Section titled “\_tx”](#_tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
##### \_ctx
[Section titled “\_ctx”](#_ctx)
[`DescribeActivityContext`](/api/anywalletkit/core/interfaces/describeactivitycontext/)
#### Returns
[Section titled “Returns”](#returns-1)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/) | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`describeActivity`](/api/anywalletkit/core/classes/protocolbase/#describeactivity)
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`_options`): `Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
Defined in: protocols/swap.ts:60
Price a same-chain swap; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_options
[Section titled “\_options”](#_options)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/).[`quoteSwap`](/api/anywalletkit/core/interfaces/iswapprotocol/#quoteswap)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
[`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ProtocolBase`](/api/anywalletkit/core/classes/protocolbase/).[`requireSigningAccount`](/api/anywalletkit/core/classes/protocolbase/#requiresigningaccount)
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`_options`): `Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
Defined in: protocols/swap.ts:59
Sign and broadcast a same-chain swap.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_options
[Section titled “\_options”](#_options-1)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`ISwapProtocol`](/api/anywalletkit/core/interfaces/iswapprotocol/).[`swap`](/api/anywalletkit/core/interfaces/iswapprotocol/#swap)
# UserRejectedError
Defined in: errors.ts:43
An external signer (hardware, Safe, MPC, a human) declined to sign.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UserRejectedError**(`message?`): `UserRejectedError`
Defined in: errors.ts:44
#### Parameters
[Section titled “Parameters”](#parameters)
##### message?
[Section titled “message?”](#message)
`string` = `'The signer rejected the request.'`
#### Returns
[Section titled “Returns”](#returns)
`UserRejectedError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# WalletManager
Defined in: wallet-manager.ts:27
Base for chain packages. Holds either the 64-byte BIP-39 seed (local seed signers derive from it) or an external Signer, derives accounts by index or path, and zeroizes on dispose.
A mnemonic passed as a string is stretched to the seed bytes right here and the string is not kept: JS strings cannot be zeroized, `Uint8Array`s can. A 64-byte seed passed as bytes is COPIED (the caller zeroizes its own). Keep the mnemonic’s own lifetime short on the calling side (read it, build the manager, drop the reference) — or build from a `Signer` and never hand the words to the SDK at all (see `@anywalletkit/keyring`).
The seed is never an own property: it lives in a module WeakMap, so logging or serializing a manager shows no secret.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TAccount
[Section titled “TAccount”](#taccount)
`TAccount` *extends* [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManager**<`TAccount`, `TConfig`>(`seedOrSigner`, `config`): `WalletManager`<`TAccount`, `TConfig`>
Defined in: wallet-manager.ts:33
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | [`Signer`](/api/anywalletkit/core/interfaces/signer/)
##### config
[Section titled “config”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
`WalletManager`<`TAccount`, `TConfig`>
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, `TAccount`>
Defined in: wallet-manager.ts:30
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: wallet-manager.ts:29
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: [`Signer`](/api/anywalletkit/core/interfaces/signer/) | `undefined`
Defined in: wallet-manager.ts:28
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<`TAccount`>
Defined in: wallet-manager.ts:86
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => `TAccount` | `Promise`<`TAccount`>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`TAccount`>
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-manager.ts:130
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): [`Signer`](/api/anywalletkit/core/interfaces/signer/) | `undefined`
Defined in: wallet-manager.ts:64
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
[`Signer`](/api/anywalletkit/core/interfaces/signer/) | `undefined`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> `abstract` **getAccount**(`index?`): `Promise`<`TAccount`>
Defined in: wallet-manager.ts:75
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`TAccount`>
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> `abstract` **getAccountByPath**(`path`): `Promise`<`TAccount`>
Defined in: wallet-manager.ts:77
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`TAccount`>
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> `abstract` **getFeeRates**(): `Promise`<[`FeeRates`](/api/anywalletkit/core/interfaces/feerates/)>
Defined in: wallet-manager.ts:79
Current network fee rates at three speeds.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`FeeRates`](/api/anywalletkit/core/interfaces/feerates/)>
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): [`Signer`](/api/anywalletkit/core/interfaces/signer/)
Defined in: wallet-manager.ts:69
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### curve
[Section titled “curve”](#curve)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
#### Returns
[Section titled “Returns”](#returns-7)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: wallet-manager.ts:47
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-8)
`Uint8Array`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<`TAccount`>
Defined in: wallet-manager.ts:113
[cachedAccount](/api/anywalletkit/core/classes/walletmanager/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => `TAccount`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`TAccount`>
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: wallet-manager.ts:59
Same as the core [getRandomSeedPhrase](/api/anywalletkit/core/functions/getrandomseedphrase/).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-10)
`string`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: wallet-manager.ts:54
Same as the core [isValidSeedPhrase](/api/anywalletkit/core/functions/isvalidseedphrase/).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`boolean`
# activityBase
> **activityBase**(`tx`, `kind`, `title`, `extra?`): [`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/)
Defined in: history.ts:201
Build the common part of an `ActivityItem` from a `ChainTx`.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
### kind
[Section titled “kind”](#kind)
[`ActivityKind`](/api/anywalletkit/core/type-aliases/activitykind/)
### title
[Section titled “title”](#title)
`string`
### extra?
[Section titled “extra?”](#extra)
`Partial`<[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/)> = `{}`
## Returns
[Section titled “Returns”](#returns)
[`ActivityItem`](/api/anywalletkit/core/interfaces/activityitem/)
# assertNameUnchanged
> **assertNameUnchanged**(`resolver`, `name`, `chain`, `expected`): `Promise`<[`ResolvedName`](/api/anywalletkit/core/interfaces/resolvedname/)>
Defined in: names.ts:129
The signing-time check: resolve again and refuse when the address moved. Returns the fresh resolution so the wallet can show it.
## Parameters
[Section titled “Parameters”](#parameters)
### resolver
[Section titled “resolver”](#resolver)
[`NameResolver`](/api/anywalletkit/core/interfaces/nameresolver/)
### name
[Section titled “name”](#name)
`string`
### chain
[Section titled “chain”](#chain)
`string`
### expected
[Section titled “expected”](#expected)
`string`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`ResolvedName`](/api/anywalletkit/core/interfaces/resolvedname/)>
# bigintToNumber
> **bigintToNumber**(`value`): `number`
Defined in: numbers.ts:16
Convert a bigint to a Number, correct on every engine including Hermes. Use it for display and pricing; never for amounts you sign.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# bigintToUnits
> **bigintToUnits**(`value`, `decimals`): `number`
Defined in: numbers.ts:25
`value / 10^decimals` as a Number (display, pricing, ratios — never for signing).
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`bigint`
### decimals
[Section titled “decimals”](#decimals)
`number`
## Returns
[Section titled “Returns”](#returns)
`number`
# canSign
> **canSign**(`account`): `account is IWalletAccount`
Defined in: account.ts:158
Type guard: does this account carry a signer?
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/)
## Returns
[Section titled “Returns”](#returns)
`account is IWalletAccount`
# copyBytes
> **copyBytes**(`bytes`): `Uint8Array`
Defined in: mnemonic.ts:43
An independent copy of key bytes. Not `.slice()`: on a Node `Buffer` that is a view sharing the caller’s memory, so zeroizing either side would change the other.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# defaultScheme
> **defaultScheme**(`curve`): [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)
Defined in: signer.ts:113
The scheme a chain gets when it asks for none: recoverable ECDSA on secp256k1, EdDSA on ed25519.
## Parameters
[Section titled “Parameters”](#parameters)
### curve
[Section titled “curve”](#curve)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
## Returns
[Section titled “Returns”](#returns)
[`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)
# deriveEd25519
> **deriveEd25519**(`seed`, `path`): [`DerivedKey`](/api/anywalletkit/core/interfaces/derivedkey/)
Defined in: derive.ts:61
SLIP-10 over ed25519 — Solana (m/44’/501’/i’/0’), TON (m/44’/607’/i’). Only hardened segments exist for ed25519; a non-hardened one is an error. Returns the 32-byte ed25519 public key.
## Parameters
[Section titled “Parameters”](#parameters)
### seed
[Section titled “seed”](#seed)
`Uint8Array`
### path
[Section titled “path”](#path)
`string`
## Returns
[Section titled “Returns”](#returns)
[`DerivedKey`](/api/anywalletkit/core/interfaces/derivedkey/)
# deriveSecp256k1
> **deriveSecp256k1**(`seed`, `path`): [`DerivedKey`](/api/anywalletkit/core/interfaces/derivedkey/)
Defined in: derive.ts:38
BIP-32 over secp256k1 — EVM (m/44’/60’/0’/0/i), BTC (m/84’/0’/0’/0/i), Tron (m/44’/195’/0’/0/i). Returns the 33-byte compressed public key.
## Parameters
[Section titled “Parameters”](#parameters)
### seed
[Section titled “seed”](#seed)
`Uint8Array`
### path
[Section titled “path”](#path)
`string`
## Returns
[Section titled “Returns”](#returns)
[`DerivedKey`](/api/anywalletkit/core/interfaces/derivedkey/)
# externalSigner
> **externalSigner**(`options`): [`Signer`](/api/anywalletkit/core/interfaces/signer/)
Defined in: signer.ts:378
Wrap a signing callback (hardware wallet, Safe, MPC, backend) as a Signer. The SDK validates the scheme against `schemes`, the result length, and the signature itself against `publicKey` (a recoverable one must also recover to it; a tweaked schnorr one must verify under the tweaked output key); the callback owns everything else.
## Parameters
[Section titled “Parameters”](#parameters)
### options
[Section titled “options”](#options)
[`ExternalSignerOptions`](/api/anywalletkit/core/interfaces/externalsigneroptions/)
## Returns
[Section titled “Returns”](#returns)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
# feeLimit
> **feeLimit**(`configured`, `options?`): `bigint` | `undefined`
Defined in: account.ts:129
The tighter of an account’s configured fee cap and a per-call [WriteOptions.maxFee](/api/anywalletkit/core/interfaces/writeoptions/#maxfee).
## Parameters
[Section titled “Parameters”](#parameters)
### configured
[Section titled “configured”](#configured)
`number` | `bigint` | `undefined`
### options?
[Section titled “options?”](#options)
[`WriteOptions`](/api/anywalletkit/core/interfaces/writeoptions/)
## Returns
[Section titled “Returns”](#returns)
`bigint` | `undefined`
# getRandomSeedPhrase
> **getRandomSeedPhrase**(`words?`): `string`
Defined in: mnemonic.ts:13
A new BIP-39 English seed phrase from the platform’s secure random source: 24 words (256 bits) by default, or 12.
## Parameters
[Section titled “Parameters”](#parameters)
### words?
[Section titled “words?”](#words)
`12` | `24`
## Returns
[Section titled “Returns”](#returns)
`string`
# isNameLike
> **isNameLike**(`input`): `boolean`
Defined in: names.ts:89
Does the input look like a name rather than an address: two or more labels, no whitespace, not hex.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isSeedSigner
> **isSeedSigner**(`s`): `s is SeedSigner`
Defined in: signer.ts:108
Narrowing helper.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
## Returns
[Section titled “Returns”](#returns)
`s is SeedSigner`
# isUnlimitedAllowance
> **isUnlimitedAllowance**(`amount`): `boolean`
Defined in: numbers.ts:37
True for an allowance a spender can treat as unlimited (≥ type(uint128).max).
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isValidSeedPhrase
> **isValidSeedPhrase**(`mnemonic`): `boolean`
Defined in: mnemonic.ts:21
True when the phrase is valid BIP-39 English (known words, right length, checksum). Input is normalised first, so extra spaces and capitals are fine.
## Parameters
[Section titled “Parameters”](#parameters)
### mnemonic
[Section titled “mnemonic”](#mnemonic)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# nameResolvers
> **nameResolvers**(`resolvers`): [`NameResolver`](/api/anywalletkit/core/interfaces/nameresolver/)
Defined in: names.ts:101
Several resolvers behind one: the first whose `supports(name)` is true answers. Order them specific → generic (SNS `.sol`, TON `.ton` before ENS, which also serves DNS names).
## Parameters
[Section titled “Parameters”](#parameters)
### resolvers
[Section titled “resolvers”](#resolvers)
readonly [`NameResolver`](/api/anywalletkit/core/interfaces/nameresolver/)\[]
## Returns
[Section titled “Returns”](#returns)
[`NameResolver`](/api/anywalletkit/core/interfaces/nameresolver/)
# netTransfers
> **netTransfers**(`tx`, `own`): `Map`<`string` | `null`, `bigint`>
Defined in: history.ts:178
Net movement of each token for `own` addresses: positive = arrived, negative = left.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)
### own
[Section titled “own”](#own)
`Set`<`string`>
## Returns
[Section titled “Returns”](#returns)
`Map`<`string` | `null`, `bigint`>
# normalizeMnemonic
> **normalizeMnemonic**(`mnemonic`): `string`
Defined in: mnemonic.ts:5
Normalise user input: trim, collapse whitespace, lowercase.
## Parameters
[Section titled “Parameters”](#parameters)
### mnemonic
[Section titled “mnemonic”](#mnemonic)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# parsePath
> **parsePath**(`path`): `number`\[]
Defined in: derive.ts:23
Parse “m/44’/60’/0’/0/0” into indexes; `'` or `h` marks hardened, on every curve. A segment is a plain decimal index below 2^31 — `1.9'`, `0x10'`, `1e3'`, `01` are refused (parseInt read them as other numbers).
## Parameters
[Section titled “Parameters”](#parameters)
### path
[Section titled “path”](#path)
`string`
## Returns
[Section titled “Returns”](#returns)
`number`\[]
# privateKeySigner
> **privateKeySigner**(`curve`, `privateKey`): [`Signer`](/api/anywalletkit/core/interfaces/signer/)
Defined in: signer.ts:422
One imported private key as a Signer (`kind: 'key'`): signs with every scheme of its curve, derives nothing, zeroizes on `dispose()`. Takes ownership of `privateKey`. Chain managers give it exactly one account (index 0); any other index or path throws.
## Parameters
[Section titled “Parameters”](#parameters)
### curve
[Section titled “curve”](#curve)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
# requireCurve
> **requireCurve**(`signer`, `curve`): [`Signer`](/api/anywalletkit/core/interfaces/signer/)
Defined in: signer.ts:123
Throws unless `signer` signs on `curve` — chain managers call this before building accounts.
## Parameters
[Section titled “Parameters”](#parameters)
### signer
[Section titled “signer”](#signer)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
### curve
[Section titled “curve”](#curve)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
## Returns
[Section titled “Returns”](#returns)
[`Signer`](/api/anywalletkit/core/interfaces/signer/)
# sameAddress
> **sameAddress**(`a`, `b`): `boolean`
Defined in: history.ts:172
Address comparison that ignores EVM case; other chains compare verbatim.
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string` | `null` | `undefined`
### b
[Section titled “b”](#b)
`string` | `null` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# schemesFor
> **schemesFor**(`curve`): readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
Defined in: signer.ts:118
Every scheme a local key on `curve` can produce.
## Parameters
[Section titled “Parameters”](#parameters)
### curve
[Section titled “curve”](#curve)
[`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
## Returns
[Section titled “Returns”](#returns)
readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
# seedFromMnemonic
> **seedFromMnemonic**(`mnemonic`, `passphrase?`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: mnemonic.ts:26
BIP-39 seed (64 bytes). Empty passphrase.
## Parameters
[Section titled “Parameters”](#parameters)
### mnemonic
[Section titled “mnemonic”](#mnemonic)
`string`
### passphrase?
[Section titled “passphrase?”](#passphrase)
`string` = `''`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# seedFromMnemonicSync
> **seedFromMnemonicSync**(`mnemonic`, `passphrase?`): `Uint8Array`
Defined in: mnemonic.ts:35
The 64-byte BIP-39 seed, computed synchronously. Blocks the thread for the PBKDF2 rounds; prefer [seedFromMnemonic](/api/anywalletkit/core/functions/seedfrommnemonic/) on a UI thread. The caller owns the bytes and should [zeroize](/api/anywalletkit/core/functions/zeroize/) them.
## Parameters
[Section titled “Parameters”](#parameters)
### mnemonic
[Section titled “mnemonic”](#mnemonic)
`string`
### passphrase?
[Section titled “passphrase?”](#passphrase)
`string` = `''`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# splitNet
> **splitNet**(`net`, `meta?`): `object`
Defined in: history.ts:190
Split a net map into assetsIn / assetsOut lists.
## Parameters
[Section titled “Parameters”](#parameters)
### net
[Section titled “net”](#net)
`Map`<`string` | `null`, `bigint`>
### meta?
[Section titled “meta?”](#meta)
(`token`) => `Partial`<[`ActivityAsset`](/api/anywalletkit/core/interfaces/activityasset/)> | `undefined`
## Returns
[Section titled “Returns”](#returns)
`object`
### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: [`ActivityAsset`](/api/anywalletkit/core/interfaces/activityasset/)\[]
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: [`ActivityAsset`](/api/anywalletkit/core/interfaces/activityasset/)\[]
# tweakSecp256k1PrivateKey
> **tweakSecp256k1PrivateKey**(`privateKey`, `tweak`): `Uint8Array`
Defined in: signer.ts:149
BIP-341 private-key tweak: negate `privateKey` when its public key has an odd Y (so the internal key is the even lift of its x-only form), then add `tweak` mod n. Returns a fresh buffer — the caller zeroizes it after signing.
## Parameters
[Section titled “Parameters”](#parameters)
### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
### tweak
[Section titled “tweak”](#tweak)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# zeroize
> **zeroize**(…`buffers`): `void`
Defined in: mnemonic.ts:48
Overwrite a key buffer. Call from every `dispose()`.
## Parameters
[Section titled “Parameters”](#parameters)
### buffers
[Section titled “buffers”](#buffers)
…(`Uint8Array`<`ArrayBufferLike`> | `undefined`)\[]
## Returns
[Section titled “Returns”](#returns)
`void`
# ActivityAsset
Defined in: history.ts:118
An amount of one asset in an activity row.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: history.ts:122
Amount in base units.
***
### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
Defined in: history.ts:124
***
### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
Defined in: history.ts:123
***
### token
[Section titled “token”](#token)
> **token**: `string` | `null`
Defined in: history.ts:120
Chain token id as in `ChainTransfer.token`; null = native.
# ActivityItem
Defined in: history.ts:130
One row of the activity feed, described for people: a kind, a title, what left and what arrived.
## Properties
[Section titled “Properties”](#properties)
### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: [`ActivityAsset`](/api/anywalletkit/core/interfaces/activityasset/)\[]
Defined in: history.ts:152
What arrived.
***
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: [`ActivityAsset`](/api/anywalletkit/core/interfaces/activityasset/)\[]
Defined in: history.ts:150
What left the wallet.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: history.ts:134
CAIP-2 chain id.
***
### counterparty?
[Section titled “counterparty?”](#counterparty)
> `optional` **counterparty?**: `string`
Defined in: history.ts:154
The other party: recipient, sender, spender, contract.
***
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: `string`
Defined in: history.ts:162
Link to the transaction in a block explorer.
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: history.ts:160
Network fee paid, native base units.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: history.ts:136
Transaction hash.
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: history.ts:132
`${chain}:${hash}` — unique across chains.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`ActivityKind`](/api/anywalletkit/core/type-aliases/activitykind/)
Defined in: history.ts:142
What happened, from the owner’s side.
***
### protocol?
[Section titled “protocol?”](#protocol)
> `optional` **protocol?**: `string`
Defined in: history.ts:144
Registry module name that recognized it (e.g. “@anywalletkit/protocol-lending-aave-evm”); undefined for the generic fallback.
***
### related?
[Section titled “related?”](#related)
> `optional` **related?**: `object`\[]
Defined in: history.ts:156
For cross-chain operations: the other leg (chain + hash) when known.
#### chain
[Section titled “chain”](#chain-1)
> **chain**: `string`
#### hash
[Section titled “hash”](#hash-1)
> **hash**: `string`
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `boolean`
Defined in: history.ts:158
Source flagged it as spam / dust (unsolicited airdrop, zero-value transfer). The app hides these by default.
***
### status
[Section titled “status”](#status)
> **status**: [`ChainTxStatus`](/api/anywalletkit/core/type-aliases/chaintxstatus/)
Defined in: history.ts:140
Whether the transaction succeeded.
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: history.ts:148
Protocol / venue / counterparty label for the subtitle, e.g. “Aave v3 · Base”, “LI.FI”, “0x1234…abcd”.
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: history.ts:138
Unix seconds.
***
### title
[Section titled “title”](#title)
> **title**: `string`
Defined in: history.ts:146
Short human title, e.g. “Supplied USDC”, “Swapped ETH → USDC”, “Sent USDT”.
# Approval
Defined in: protocols/approvals.ts:21
One live approval the account granted.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
Defined in: protocols/approvals.ts:33
Allowance in base units; null for operator approvals and delegations.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `string` | `number`
Defined in: protocols/approvals.ts:27
Chain it lives on.
***
### expiration?
[Section titled “expiration?”](#expiration)
> `optional` **expiration?**: `number`
Defined in: protocols/approvals.ts:39
Unix seconds; Permit2 and authz only.
***
### grantedAt?
[Section titled “grantedAt?”](#grantedat)
> `optional` **grantedAt?**: `object`
Defined in: protocols/approvals.ts:41
Where the approval was granted, when the source knows.
#### block?
[Section titled “block?”](#block)
> `optional` **block?**: `number`
#### txHash?
[Section titled “txHash?”](#txhash)
> `optional` **txHash?**: `string`
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: protocols/approvals.ts:23
Deterministic key: `chainId:standard:token:spender[:tokenId]`.
***
### risks
[Section titled “risks”](#risks)
> **risks**: [`ApprovalRisk`](/api/anywalletkit/core/type-aliases/approvalrisk/)\[]
Defined in: protocols/approvals.ts:43
Every risk that applies; empty when none.
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: protocols/approvals.ts:31
Who may spend: the spender, operator or delegate.
***
### spenderLabel?
[Section titled “spenderLabel?”](#spenderlabel)
> `optional` **spenderLabel?**: `object`
Defined in: protocols/approvals.ts:45
Known name of the spender, when a label source has one.
#### name
[Section titled “name”](#name)
> **name**: `string`
#### url?
[Section titled “url?”](#url)
> `optional` **url?**: `string`
***
### standard
[Section titled “standard”](#standard)
> **standard**: [`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)
Defined in: protocols/approvals.ts:25
Which kind of approval.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/approvals.ts:29
Token contract (or mint); for `eip7702` the account itself.
***
### tokenId?
[Section titled “tokenId?”](#tokenid)
> `optional` **tokenId?**: `string`
Defined in: protocols/approvals.ts:37
NFT id, for a per-token approval.
***
### unlimited
[Section titled “unlimited”](#unlimited)
> **unlimited**: `boolean`
Defined in: protocols/approvals.ts:35
The allowance is effectively unbounded.
# ApprovalsCoverage
Defined in: protocols/approvals.ts:49
How much history the scan covered. Show a warning when `complete` is false.
## Properties
[Section titled “Properties”](#properties)
### complete
[Section titled “complete”](#complete)
> **complete**: `boolean`
Defined in: protocols/approvals.ts:57
False when some block range could not be scanned — the list may miss approvals.
***
### fromBlock?
[Section titled “fromBlock?”](#fromblock)
> `optional` **fromBlock?**: `number`
Defined in: protocols/approvals.ts:53
First block scanned.
***
### gaps?
[Section titled “gaps?”](#gaps)
> `optional` **gaps?**: \[`number`, `number`]\[]
Defined in: protocols/approvals.ts:59
Block ranges that could not be scanned.
***
### source
[Section titled “source”](#source)
> **source**: `string`
Defined in: protocols/approvals.ts:51
`rpc-logs`, `state`, or a custom source name.
***
### toBlock?
[Section titled “toBlock?”](#toblock)
> `optional` **toBlock?**: `number`
Defined in: protocols/approvals.ts:55
Last block scanned.
# ApprovalsResult
Defined in: protocols/approvals.ts:63
The approvals found and how complete the scan was.
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Approval`](/api/anywalletkit/core/interfaces/approval/)\[]
Defined in: protocols/approvals.ts:63
***
### coverage
[Section titled “coverage”](#coverage)
> **coverage**: [`ApprovalsCoverage`](/api/anywalletkit/core/interfaces/approvalscoverage/)
Defined in: protocols/approvals.ts:63
# BorrowOptions
Defined in: protocols/lending.ts:12
Borrow `amount` of `token` (base units) against supplied collateral.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/lending.ts:12
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: protocols/lending.ts:12
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/lending.ts:12
# BridgeOptions
Defined in: protocols/bridge.ts:14
Move `amount` of `token` (base units) to `recipient` on `targetChain`.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/bridge.ts:19
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: protocols/bridge.ts:17
***
### targetChain
[Section titled “targetChain”](#targetchain)
> **targetChain**: `string`
Defined in: protocols/bridge.ts:16
Destination chain identifier (provider specific, e.g. “arbitrum” or a CAIP-2 id).
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/bridge.ts:18
# BridgeProtocolConfig
Defined in: protocols/bridge.ts:8
Fee ceiling for [IBridgeProtocol.bridge](/api/anywalletkit/core/interfaces/ibridgeprotocol/#bridge).
## Properties
[Section titled “Properties”](#properties)
### bridgeMaxFee?
[Section titled “bridgeMaxFee?”](#bridgemaxfee)
> `optional` **bridgeMaxFee?**: `number` | `bigint`
Defined in: protocols/bridge.ts:10
Maximum fee for bridge operations, in native base units.
# BridgeResult
Defined in: protocols/bridge.ts:23
The bridge transaction and its fees.
## Properties
[Section titled “Properties”](#properties)
### bridgeFee
[Section titled “bridgeFee”](#bridgefee)
> **bridgeFee**: `bigint`
Defined in: protocols/bridge.ts:28
Native tokens paid to the bridge protocol.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/bridge.ts:26
Gas cost.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/bridge.ts:24
# BuyCommonOptions
Defined in: protocols/fiat.ts:19
What to buy, with which currency, and where the crypto goes.
## Properties
[Section titled “Properties”](#properties)
### cryptoAsset
[Section titled “cryptoAsset”](#cryptoasset)
> **cryptoAsset**: `string`
Defined in: protocols/fiat.ts:19
***
### fiatCurrency
[Section titled “fiatCurrency”](#fiatcurrency)
> **fiatCurrency**: `string`
Defined in: protocols/fiat.ts:19
***
### recipient?
[Section titled “recipient?”](#recipient)
> `optional` **recipient?**: `string`
Defined in: protocols/fiat.ts:19
# BuyExactCryptoAmountOptions
Defined in: protocols/fiat.ts:21
Buy exactly `cryptoAmount` (base units).
## Properties
[Section titled “Properties”](#properties)
### cryptoAmount
[Section titled “cryptoAmount”](#cryptoamount)
> **cryptoAmount**: `number` | `bigint`
Defined in: protocols/fiat.ts:21
***
### fiatAmount?
[Section titled “fiatAmount?”](#fiatamount)
> `optional` **fiatAmount?**: `undefined`
Defined in: protocols/fiat.ts:21
# BuyResult
Defined in: protocols/fiat.ts:27
The provider’s checkout URL; open it in a browser or web view.
## Properties
[Section titled “Properties”](#properties)
### buyUrl
[Section titled “buyUrl”](#buyurl)
> **buyUrl**: `string`
Defined in: protocols/fiat.ts:27
# BuyWithFiatAmountOptions
Defined in: protocols/fiat.ts:23
Spend exactly `fiatAmount` (smallest fiat unit).
## Properties
[Section titled “Properties”](#properties)
### cryptoAmount?
[Section titled “cryptoAmount?”](#cryptoamount)
> `optional` **cryptoAmount?**: `undefined`
Defined in: protocols/fiat.ts:23
***
### fiatAmount
[Section titled “fiatAmount”](#fiatamount)
> **fiatAmount**: `number` | `bigint`
Defined in: protocols/fiat.ts:23
# ChainCall
Defined in: history.ts:31
The contract / program the transaction invoked, as far as the chain exposes it.
## Properties
[Section titled “Properties”](#properties)
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: history.ts:37
Full calldata (EVM / Tron), op code (TON), method name (NEAR) — whatever the chain gives.
***
### method?
[Section titled “method?”](#method)
> `optional` **method?**: `string`
Defined in: history.ts:41
NEAR / TON: method or op name when decoded.
***
### programs?
[Section titled “programs?”](#programs)
> `optional` **programs?**: `string`\[]
Defined in: history.ts:39
Solana: one entry per top-level instruction (program id); NEAR: one per action method.
***
### selector?
[Section titled “selector?”](#selector)
> `optional` **selector?**: `string`
Defined in: history.ts:35
EVM 4-byte selector (0x-prefixed, lowercase) when calldata is present.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: history.ts:33
Contract address (EVM, Tron), program id (Solana), account (NEAR), destination contract (TON).
# ChainTransfer
Defined in: history.ts:13
A token movement inside a transaction. `token` is the chain’s identifier (contract, mint, jetton master, TRC-20 contract); `null` = native coin.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: history.ts:20
Amount in base units.
***
### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
Defined in: history.ts:25
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: history.ts:16
Sender of the movement.
***
### standard?
[Section titled “standard?”](#standard)
> `optional` **standard?**: `"erc20"` | `"erc721"` | `"erc1155"` | `"spl"` | `"token2022"` | `"jetton"` | `"trc20"` | `"nep141"`
Defined in: history.ts:22
Token standard when known (erc20, spl, token2022, jetton, trc20, nep141). Native transfers leave it undefined.
***
### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
Defined in: history.ts:24
Symbol / decimals when the source already knows them (catalog or on-chain metadata); the kit fills the rest.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: history.ts:18
Receiver of the movement.
***
### token
[Section titled “token”](#token)
> **token**: `string` | `null`
Defined in: history.ts:14
***
### tokenId?
[Section titled “tokenId?”](#tokenid)
> `optional` **tokenId?**: `string`
Defined in: history.ts:27
ERC-721 / ERC-1155 token id.
# ChainTx
Defined in: history.ts:48
One transaction as seen from `address`, normalized across chains.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: history.ts:58
The address this history was fetched for (the wallet’s own).
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: history.ts:72
Block number / slot / lt, for ordering and cursors.
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: [`ChainCall`](/api/anywalletkit/core/interfaces/chaincall/)
Defined in: history.ts:70
The invoked contract / program, when it is not a plain transfer.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: history.ts:50
CAIP-2 chain id.
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: history.ts:68
Network fee paid by `from`, in native base units; undefined when unknown.
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: history.ts:60
Sender (the fee payer).
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: history.ts:52
Transaction hash.
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: history.ts:64
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
***
### raw?
[Section titled “raw?”](#raw)
> `optional` **raw?**: `unknown`
Defined in: history.ts:74
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
***
### status
[Section titled “status”](#status)
> **status**: [`ChainTxStatus`](/api/anywalletkit/core/type-aliases/chaintxstatus/)
Defined in: history.ts:56
Whether it succeeded.
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: history.ts:54
Unix seconds.
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: history.ts:62
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: [`ChainTransfer`](/api/anywalletkit/core/interfaces/chaintransfer/)\[]
Defined in: history.ts:66
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
# ClaimWithdrawalsOptions
Defined in: protocols/staking.ts:53
Which finalized requests to claim; all claimable ones when `ids` is omitted.
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: protocols/staking.ts:53
# ClaimWithdrawalsResult
Defined in: protocols/staking.ts:55
The claim transaction and the fee it paid.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/staking.ts:55
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/staking.ts:55
# DerivedKey
Defined in: derive.ts:7
A key derived from a seed at one path. The caller owns `privateKey` and should zeroize it.
## Properties
[Section titled “Properties”](#properties)
### path
[Section titled “path”](#path)
> **path**: `string`
Defined in: derive.ts:13
The path it was derived at.
***
### privateKey
[Section titled “privateKey”](#privatekey)
> **privateKey**: `Uint8Array`
Defined in: derive.ts:9
32-byte private key (secp256k1 scalar or ed25519 seed).
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: `Uint8Array`
Defined in: derive.ts:11
Compressed 33-byte secp256k1 or 32-byte ed25519 public key.
# DescribeActivityContext
Defined in: history.ts:166
Context a module gets when asked to describe a transaction.
## Properties
[Section titled “Properties”](#properties)
### own
[Section titled “own”](#own)
> **own**: `Set`<`string`>
Defined in: history.ts:168
The wallet’s own addresses on this chain (lowercase for EVM), so a module can tell in from out.
# ExternalSignerOptions
Defined in: signer.ts:309
Options for [externalSigner](/api/anywalletkit/core/functions/externalsigner/): the key’s curve and public key, and the function that asks your backend, device or user for a signature.
## Properties
[Section titled “Properties”](#properties)
### curve
[Section titled “curve”](#curve)
> **curve**: [`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
Defined in: signer.ts:311
Curve of the key.
***
### dispose?
[Section titled “dispose?”](#dispose)
> `optional` **dispose?**: () => `void`
Defined in: signer.ts:319
Called once by the signer’s `dispose()`.
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: `Uint8Array`
Defined in: signer.ts:313
The key’s public key (33-byte compressed secp256k1 or 32-byte ed25519).
***
### schemes?
[Section titled “schemes?”](#schemes)
> `optional` **schemes?**: readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
Defined in: signer.ts:315
Schemes the backend can produce. Defaults to the curve’s default scheme only.
***
### sign
[Section titled “sign”](#sign)
> **sign**: (`payload`, `options`) => `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:317
Called with the resolved scheme (never undefined). Throw `UserRejectedError` when the user declines.
#### Parameters
[Section titled “Parameters”](#parameters)
##### payload
[Section titled “payload”](#payload)
`Uint8Array`
##### options
[Section titled “options”](#options)
[`SignOptions`](/api/anywalletkit/core/interfaces/signoptions/) & `object`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# FeeRates
Defined in: account.ts:34
Network fee rates at three speeds, in the chain’s fee unit (gas price in wei, sat/vB…).
## Properties
[Section titled “Properties”](#properties)
### fast
[Section titled “fast”](#fast)
> **fast**: `bigint`
Defined in: account.ts:40
Rate for the next block or two.
***
### normal
[Section titled “normal”](#normal)
> **normal**: `bigint`
Defined in: account.ts:38
Rate for the usual inclusion time.
***
### slow
[Section titled “slow”](#slow)
> **slow**: `bigint`
Defined in: account.ts:36
Rate for a slow, cheap inclusion.
# FiatQuote
Defined in: protocols/fiat.ts:41
A provider’s price for a buy or sell.
## Properties
[Section titled “Properties”](#properties)
### cryptoAmount
[Section titled “cryptoAmount”](#cryptoamount)
> **cryptoAmount**: `bigint`
Defined in: protocols/fiat.ts:43
Crypto amount, base units.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/fiat.ts:47
In the smallest fiat unit.
***
### fiatAmount
[Section titled “fiatAmount”](#fiatamount)
> **fiatAmount**: `bigint`
Defined in: protocols/fiat.ts:45
Smallest fiat unit (cents).
***
### rate
[Section titled “rate”](#rate)
> **rate**: `string`
Defined in: protocols/fiat.ts:49
Standard units, as a string (“3000.50” = 1 ETH is 3000.50 USD).
# FiatTransactionDetail
Defined in: protocols/fiat.ts:10
An order’s state and its assets, from [IFiatProtocol.getTransactionDetail](/api/anywalletkit/core/interfaces/ifiatprotocol/#gettransactiondetail).
## Properties
[Section titled “Properties”](#properties)
### cryptoAsset
[Section titled “cryptoAsset”](#cryptoasset)
> **cryptoAsset**: `string`
Defined in: protocols/fiat.ts:10
***
### fiatCurrency
[Section titled “fiatCurrency”](#fiatcurrency)
> **fiatCurrency**: `string`
Defined in: protocols/fiat.ts:10
***
### status
[Section titled “status”](#status)
> **status**: [`FiatTransactionStatus`](/api/anywalletkit/core/type-aliases/fiattransactionstatus/)
Defined in: protocols/fiat.ts:10
# GetApprovalsOptions
Defined in: protocols/approvals.ts:66
Filters for [IApprovalsProtocol.getApprovals](/api/anywalletkit/core/interfaces/iapprovalsprotocol/#getapprovals).
## Properties
[Section titled “Properties”](#properties)
### fromBlock?
[Section titled “fromBlock?”](#fromblock)
> `optional` **fromBlock?**: `number`
Defined in: protocols/approvals.ts:76
Scan from this block.
***
### includeZero?
[Section titled “includeZero?”](#includezero)
> `optional` **includeZero?**: `boolean`
Defined in: protocols/approvals.ts:74
Also return approvals already set to zero.
***
### spenders?
[Section titled “spenders?”](#spenders)
> `optional` **spenders?**: `string`\[]
Defined in: protocols/approvals.ts:72
Only these spenders.
***
### standards?
[Section titled “standards?”](#standards)
> `optional` **standards?**: [`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)\[]
Defined in: protocols/approvals.ts:68
Only these kinds.
***
### toBlock?
[Section titled “toBlock?”](#toblock)
> `optional` **toBlock?**: `number`
Defined in: protocols/approvals.ts:78
Scan up to this block.
***
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: `string`\[]
Defined in: protocols/approvals.ts:70
Only these token contracts or mints.
# HistoryPage
Defined in: history.ts:78
One page of an address’s history from a [HistorySource](/api/anywalletkit/core/interfaces/historysource/), newest first.
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: history.ts:82
Opaque cursor for the next (older) page; absent when the source has no more.
***
### items
[Section titled “items”](#items)
> **items**: [`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/)\[]
Defined in: history.ts:80
Transactions, newest first.
# HistoryQuery
Defined in: history.ts:86
Paging and refresh options for [HistorySource.listActivity](/api/anywalletkit/core/interfaces/historysource/#listactivity).
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: history.ts:88
Resume from a cursor returned by a previous page.
***
### limit?
[Section titled “limit?”](#limit)
> `optional` **limit?**: `number`
Defined in: history.ts:90
Page size hint; sources may return fewer.
***
### since?
[Section titled “since?”](#since)
> `optional` **since?**: `number`
Defined in: history.ts:92
Only transactions newer than this unix time (for refresh).
# HistorySource
Defined in: history.ts:96
Where a chain package gets an address’s transaction history.
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: history.ts:98
CAIP-2 chain id this source serves.
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: history.ts:104
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/) | `undefined`>
Defined in: history.ts:102
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ChainTx`](/api/anywalletkit/core/interfaces/chaintx/) | `undefined`>
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`HistoryPage`](/api/anywalletkit/core/interfaces/historypage/)>
Defined in: history.ts:100
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
[`HistoryQuery`](/api/anywalletkit/core/interfaces/historyquery/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`HistoryPage`](/api/anywalletkit/core/interfaces/historypage/)>
# IApprovalsProtocol
Defined in: protocols/approvals.ts:115
Find the approvals an account granted, flag the risky ones, and revoke them.
## Methods
[Section titled “Methods”](#methods)
### getApprovals()
[Section titled “getApprovals()”](#getapprovals)
> **getApprovals**(`options?`): `Promise`<[`ApprovalsResult`](/api/anywalletkit/core/interfaces/approvalsresult/)>
Defined in: protocols/approvals.ts:119
Live approvals of the account, with risks and scan coverage.
#### Parameters
[Section titled “Parameters”](#parameters)
##### options?
[Section titled “options?”](#options)
[`GetApprovalsOptions`](/api/anywalletkit/core/interfaces/getapprovalsoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`ApprovalsResult`](/api/anywalletkit/core/interfaces/approvalsresult/)>
***
### getSupportedStandards()
[Section titled “getSupportedStandards()”](#getsupportedstandards)
> **getSupportedStandards**(): `Promise`<[`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)\[]>
Defined in: protocols/approvals.ts:117
Approval kinds this module can find and revoke.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ApprovalStandard`](/api/anywalletkit/core/type-aliases/approvalstandard/)\[]>
***
### quoteRevoke()
[Section titled “quoteRevoke()”](#quoterevoke)
> **quoteRevoke**(`approval`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocols/approvals.ts:121
Network fee of revoking one approval.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### approval
[Section titled “approval”](#approval)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee`: `bigint`; }>
***
### revoke()
[Section titled “revoke()”](#revoke)
> **revoke**(`approval`): `Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)>
Defined in: protocols/approvals.ts:123
Revoke one approval.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### approval
[Section titled “approval”](#approval-1)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)>
***
### revokeAll()
[Section titled “revokeAll()”](#revokeall)
> **revokeAll**(`approvals`): `Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)\[]>
Defined in: protocols/approvals.ts:128
Revoke several, batching where the standard allows. Continues past failures; each result carries its own `error`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### approvals
[Section titled “approvals”](#approvals)
[`Approval`](/api/anywalletkit/core/interfaces/approval/)\[]
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`RevokeResult`](/api/anywalletkit/core/interfaces/revokeresult/)\[]>
# IBridgeProtocol
Defined in: protocols/bridge.ts:37
The older bridge-only interface. Every swap2 module implements it too; new code should use [ISwap2Protocol](/api/anywalletkit/core/interfaces/iswap2protocol/).
## Methods
[Section titled “Methods”](#methods)
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
Defined in: protocols/bridge.ts:39
Sign and broadcast a bridge transfer.
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/)>
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
Defined in: protocols/bridge.ts:41
Fees of a bridge transfer; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options
[Section titled “options”](#options-1)
[`BridgeOptions`](/api/anywalletkit/core/interfaces/bridgeoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`BridgeQuote`](/api/anywalletkit/core/type-aliases/bridgequote/)>
# IFiatProtocol
Defined in: protocols/fiat.ts:56
Interface for on-ramp and off-ramp providers: quotes, a hosted checkout URL, and order status. The SDK ships no fiat module yet.
## Methods
[Section titled “Methods”](#methods)
### buy()
[Section titled “buy()”](#buy)
> **buy**(`options`): `Promise`<[`BuyResult`](/api/anywalletkit/core/interfaces/buyresult/)>
Defined in: protocols/fiat.ts:58
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`BuyOptions`](/api/anywalletkit/core/type-aliases/buyoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`BuyResult`](/api/anywalletkit/core/interfaces/buyresult/)>
***
### getSupportedCountries()
[Section titled “getSupportedCountries()”](#getsupportedcountries)
> **getSupportedCountries**(): `Promise`<[`SupportedCountry`](/api/anywalletkit/core/interfaces/supportedcountry/)\[]>
Defined in: protocols/fiat.ts:64
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`SupportedCountry`](/api/anywalletkit/core/interfaces/supportedcountry/)\[]>
***
### getSupportedCryptoAssets()
[Section titled “getSupportedCryptoAssets()”](#getsupportedcryptoassets)
> **getSupportedCryptoAssets**(): `Promise`<[`SupportedCryptoAsset`](/api/anywalletkit/core/interfaces/supportedcryptoasset/)\[]>
Defined in: protocols/fiat.ts:62
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`SupportedCryptoAsset`](/api/anywalletkit/core/interfaces/supportedcryptoasset/)\[]>
***
### getSupportedFiatCurrencies()
[Section titled “getSupportedFiatCurrencies()”](#getsupportedfiatcurrencies)
> **getSupportedFiatCurrencies**(): `Promise`<[`SupportedFiatCurrency`](/api/anywalletkit/core/interfaces/supportedfiatcurrency/)\[]>
Defined in: protocols/fiat.ts:63
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`SupportedFiatCurrency`](/api/anywalletkit/core/interfaces/supportedfiatcurrency/)\[]>
***
### getTransactionDetail()
[Section titled “getTransactionDetail()”](#gettransactiondetail)
> **getTransactionDetail**(`txId`): `Promise`<[`FiatTransactionDetail`](/api/anywalletkit/core/interfaces/fiattransactiondetail/)>
Defined in: protocols/fiat.ts:61
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### txId
[Section titled “txId”](#txid)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`FiatTransactionDetail`](/api/anywalletkit/core/interfaces/fiattransactiondetail/)>
***
### quoteBuy()
[Section titled “quoteBuy()”](#quotebuy)
> **quoteBuy**(`options`): `Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
Defined in: protocols/fiat.ts:57
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-1)
[`BuyOptions`](/api/anywalletkit/core/type-aliases/buyoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
***
### quoteSell()
[Section titled “quoteSell()”](#quotesell)
> **quoteSell**(`options`): `Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
Defined in: protocols/fiat.ts:59
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-2)
[`SellOptions`](/api/anywalletkit/core/type-aliases/selloptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`FiatQuote`](/api/anywalletkit/core/interfaces/fiatquote/)>
***
### sell()
[Section titled “sell()”](#sell)
> **sell**(`options`): `Promise`<[`SellResult`](/api/anywalletkit/core/interfaces/sellresult/)>
Defined in: protocols/fiat.ts:60
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-3)
[`SellOptions`](/api/anywalletkit/core/type-aliases/selloptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`SellResult`](/api/anywalletkit/core/interfaces/sellresult/)>
# ILendingProtocol
Defined in: protocols/lending.ts:25
The lending interface every lending and vault module implements. Vault modules (Morpho vaults, Mellow, Kamino Earn) support `supply` and `withdraw`; borrowing exists where the market allows it, otherwise it throws.
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`options`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:35
Borrow against collateral.
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`BorrowOptions`](/api/anywalletkit/core/interfaces/borrowoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`options`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:37
Network fee of `borrow`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options
[Section titled “options”](#options-1)
[`BorrowOptions`](/api/anywalletkit/core/interfaces/borrowoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`options`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:41
Network fee of `repay`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-2)
[`RepayOptions`](/api/anywalletkit/core/interfaces/repayoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`options`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:29
Network fee of `supply`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-3)
[`SupplyOptions`](/api/anywalletkit/core/interfaces/supplyoptions/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`options`): `Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
Defined in: protocols/lending.ts:33
Network fee of `withdraw`.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-4)
[`WithdrawOptions`](/api/anywalletkit/core/interfaces/withdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`LendingQuote`](/api/anywalletkit/core/type-aliases/lendingquote/)>
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`options`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:39
Repay a borrow.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-5)
[`RepayOptions`](/api/anywalletkit/core/interfaces/repayoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`options`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:27
Deposit into the market or vault. Sends an approval first when needed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-6)
[`SupplyOptions`](/api/anywalletkit/core/interfaces/supplyoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`options`): `Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
Defined in: protocols/lending.ts:31
Withdraw a deposit.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### options
[Section titled “options”](#options-7)
[`WithdrawOptions`](/api/anywalletkit/core/interfaces/withdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/)>
# IStakingProtocol
Defined in: protocols/staking.ts:74
The staking interface every staking module implements. Unstaking has two phases: `requestWithdrawal` puts an amount in the protocol’s queue, and `claimWithdrawals` collects it once finalized.
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/)>
Defined in: protocols/staking.ts:88
Claim finalized requests; the native coin returns to the account.
#### Parameters
[Section titled “Parameters”](#parameters)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/core/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/)>
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocols/staking.ts:94
APR in percent: 2.5 = 2.5 % (every staking module and app reads it this way).
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`number`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/core/interfaces/stakedbalance/)>
Defined in: protocols/staking.ts:92
The account’s staked position.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`StakedBalance`](/api/anywalletkit/core/interfaces/stakedbalance/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/core/interfaces/withdrawalrequestsview/)>
Defined in: protocols/staking.ts:86
The account’s open requests, and which are claimable.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/core/interfaces/withdrawalrequestsview/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocols/staking.ts:90
Network fee of [IStakingProtocol.claimWithdrawals](/api/anywalletkit/core/interfaces/istakingprotocol/#claimwithdrawals).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/core/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/core/interfaces/claimwithdrawalsresult/), `"hash"`>>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocols/staking.ts:84
Network fee of [IStakingProtocol.requestWithdrawal](/api/anywalletkit/core/interfaces/istakingprotocol/#requestwithdrawal).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/core/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/), `"hash"`>>
Defined in: protocols/staking.ts:78
Network fee of [IStakingProtocol.stake](/api/anywalletkit/core/interfaces/istakingprotocol/#stake); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/core/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/), `"hash"`>>
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/)>
Defined in: protocols/staking.ts:82
Put staked tokens in the withdrawal queue. Sends an approval first when the protocol needs one.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/core/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/core/interfaces/withdrawalrequestresult/)>
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/)>
Defined in: protocols/staking.ts:76
Stake native coin and receive the protocol’s staked token.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/core/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`StakeResult`](/api/anywalletkit/core/interfaces/stakeresult/)>
# ISwap2Protocol
Defined in: protocols/swap2.ts:157
The swap-and-bridge interface every swap module implements, and the router too. One call shape covers same-chain swaps and cross-chain transfers.
## Methods
[Section titled “Methods”](#methods)
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<[`Swap2SupportedChain`](/api/anywalletkit/core/interfaces/swap2supportedchain/)\[]>
Defined in: protocols/swap2.ts:173
Chains this provider can swap on or to.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`Swap2SupportedChain`](/api/anywalletkit/core/interfaces/swap2supportedchain/)\[]>
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<[`Swap2SupportedToken`](/api/anywalletkit/core/interfaces/swap2supportedtoken/)\[]>
Defined in: protocols/swap2.ts:175
Tokens this provider can swap, optionally narrowed by [Swap2SupportedTokensOptions](/api/anywalletkit/core/interfaces/swap2supportedtokensoptions/).
#### Parameters
[Section titled “Parameters”](#parameters)
##### options?
[Section titled “options?”](#options)
[`Swap2SupportedTokensOptions`](/api/anywalletkit/core/interfaces/swap2supportedtokensoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`Swap2SupportedToken`](/api/anywalletkit/core/interfaces/swap2supportedtoken/)\[]>
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `options?`): `Promise`<[`Swap2StatusResult`](/api/anywalletkit/core/interfaces/swap2statusresult/)>
Defined in: protocols/swap2.ts:171
State of a swap by the `id` from [Swap2Result](/api/anywalletkit/core/interfaces/swap2result/). Poll it until a final status.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id)
`string`
##### options?
[Section titled “options?”](#options-1)
[`Swap2StatusOptions`](/api/anywalletkit/core/interfaces/swap2statusoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`Swap2StatusResult`](/api/anywalletkit/core/interfaces/swap2statusresult/)>
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<[`Swap2Quote`](/api/anywalletkit/core/interfaces/swap2quote/)>
Defined in: protocols/swap2.ts:164
Price a swap. Signs nothing and works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-2)
[`Swap2Options`](/api/anywalletkit/core/type-aliases/swap2options/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`Swap2Quote`](/api/anywalletkit/core/interfaces/swap2quote/)>
#### Throws
[Section titled “Throws”](#throws)
`Swap2QuoteError` (from `protocol-swap2-core`) with a named reason when there is no route.
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<[`Swap2Result`](/api/anywalletkit/core/interfaces/swap2result/)>
Defined in: protocols/swap2.ts:169
Quote again, check the quote (amounts, recipient, refund address, fee ceilings in `config`), then sign and broadcast the source transaction (and an approval when one is needed).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-3)
[`Swap2Options`](/api/anywalletkit/core/type-aliases/swap2options/)
##### config?
[Section titled “config?”](#config)
[`Swap2ProtocolConfig`](/api/anywalletkit/core/interfaces/swap2protocolconfig/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`Swap2Result`](/api/anywalletkit/core/interfaces/swap2result/)>
# ISwapProtocol
Defined in: protocols/swap.ts:44
The older same-chain swap interface. Every swap2 module implements it too; new code should use [ISwap2Protocol](/api/anywalletkit/core/interfaces/iswap2protocol/).
## Methods
[Section titled “Methods”](#methods)
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
Defined in: protocols/swap.ts:48
Price a same-chain swap; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`SwapQuote`](/api/anywalletkit/core/type-aliases/swapquote/)>
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
Defined in: protocols/swap.ts:46
Sign and broadcast a same-chain swap.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options
[Section titled “options”](#options-1)
[`SwapOptions`](/api/anywalletkit/core/type-aliases/swapoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/)>
# IWalletAccount
Defined in: account.ts:135
A read-only account plus the ability to sign and broadcast.
## Extends
[Section titled “Extends”](#extends)
* [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/)
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: account.ts:94
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`chain`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#chain)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `boolean`
Defined in: account.ts:140
True when `signTransaction` itself needs the network (TON seqno, Solana blockhash, BTC UTXOs, Tron ref block). EVM signs offline.
## Methods
[Section titled “Methods”](#methods)
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: account.ts:154
Zeroize this account’s key material.
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: account.ts:96
The account’s address in the chain’s canonical form.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`getAddress`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#getaddress)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: account.ts:98
Native balance in base units.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`getBalance`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#getbalance)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: account.ts:100
Balance of a token (contract, mint, jetton master) in its base units.
#### Parameters
[Section titled “Parameters”](#parameters)
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`getTokenBalance`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#gettokenbalance)
***
### getTokenInfo()?
[Section titled “getTokenInfo()?”](#gettokeninfo)
> `optional` **getTokenInfo**(`token`): `Promise`<[`TokenInfo`](/api/anywalletkit/core/interfaces/tokeninfo/)>
Defined in: account.ts:106
Decimals, symbol, name, supply and holder-relevant [TokenFlag](/api/anywalletkit/core/type-aliases/tokenflag/)s of a token, read from the chain. Throws [NotATokenError](/api/anywalletkit/core/classes/notatokenerror/) when the address is not a token there. Chain packages that cannot read token metadata leave it out.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`TokenInfo`](/api/anywalletkit/core/interfaces/tokeninfo/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`getTokenInfo`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#gettokeninfo)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`Receipt`](/api/anywalletkit/core/interfaces/receipt/) | `undefined`>
Defined in: account.ts:112
The receipt of a transaction, or `undefined` while it is not yet included.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`Receipt`](/api/anywalletkit/core/interfaces/receipt/) | `undefined`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`getTransactionReceipt`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#gettransactionreceipt)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: account.ts:108
Network fee the transaction would pay, in native base units. Nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `fee`: `bigint`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`quoteSendTransaction`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`options`): `Promise`<{ `fee`: `bigint`; }>
Defined in: account.ts:110
Network fee a [TransferOptions](/api/anywalletkit/core/interfaces/transferoptions/) transfer would pay, in native base units.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options)
[`TransferOptions`](/api/anywalletkit/core/interfaces/transferoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<{ `fee`: `bigint`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`quoteTransfer`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#quotetransfer)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<[`TransferResult`](/api/anywalletkit/core/interfaces/transferresult/)>
Defined in: account.ts:146
Sign and broadcast.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### tx
[Section titled “tx”](#tx-1)
`unknown`
##### options?
[Section titled “options?”](#options-1)
[`WriteOptions`](/api/anywalletkit/core/interfaces/writeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`TransferResult`](/api/anywalletkit/core/interfaces/transferresult/)>
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: account.ts:142
Sign a message the chain’s conventional way (EIP-191, BIP-137, ed25519 raw…). Returns the chain’s conventional encoding (hex, base64…).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`string`>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: account.ts:144
Sign a fully specified transaction WITHOUT broadcasting. Returns the serialised signed tx.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx-2)
`unknown`
##### options?
[Section titled “options?”](#options-2)
[`WriteOptions`](/api/anywalletkit/core/interfaces/writeoptions/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`string`>
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): [`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/)
Defined in: account.ts:152
The same address without signing ability: safe to hand to code that should only read or quote.
#### Returns
[Section titled “Returns”](#returns-11)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/)
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`options`, `writeOptions?`): `Promise`<[`TransferResult`](/api/anywalletkit/core/interfaces/transferresult/)>
Defined in: account.ts:148
Native or token transfer; the account builds the transaction.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### options
[Section titled “options”](#options-3)
[`TransferOptions`](/api/anywalletkit/core/interfaces/transferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
[`WriteOptions`](/api/anywalletkit/core/interfaces/writeoptions/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`TransferResult`](/api/anywalletkit/core/interfaces/transferresult/)>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: account.ts:114
Check a message signature against this account’s key, the chain’s conventional way.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`IWalletAccountReadOnly`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/).[`verify`](/api/anywalletkit/core/interfaces/iwalletaccountreadonly/#verify)
# IWalletAccountReadOnly
Defined in: account.ts:92
Anything that can be read about an address without a key: balances, quotes, receipts. Protocol modules constructed with a read-only account may only quote.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`IWalletAccount`](/api/anywalletkit/core/interfaces/iwalletaccount/)
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: account.ts:94
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: account.ts:96
The account’s address in the chain’s canonical form.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: account.ts:98
Native balance in base units.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`bigint`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: account.ts:100
Balance of a token (contract, mint, jetton master) in its base units.
#### Parameters
[Section titled “Parameters”](#parameters)
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`bigint`>
***
### getTokenInfo()?
[Section titled “getTokenInfo()?”](#gettokeninfo)
> `optional` **getTokenInfo**(`token`): `Promise`<[`TokenInfo`](/api/anywalletkit/core/interfaces/tokeninfo/)>
Defined in: account.ts:106
Decimals, symbol, name, supply and holder-relevant [TokenFlag](/api/anywalletkit/core/type-aliases/tokenflag/)s of a token, read from the chain. Throws [NotATokenError](/api/anywalletkit/core/classes/notatokenerror/) when the address is not a token there. Chain packages that cannot read token metadata leave it out.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`TokenInfo`](/api/anywalletkit/core/interfaces/tokeninfo/)>
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`Receipt`](/api/anywalletkit/core/interfaces/receipt/) | `undefined`>
Defined in: account.ts:112
The receipt of a transaction, or `undefined` while it is not yet included.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`Receipt`](/api/anywalletkit/core/interfaces/receipt/) | `undefined`>
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: account.ts:108
Network fee the transaction would pay, in native base units. Nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx)
`unknown`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `fee`: `bigint`; }>
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`options`): `Promise`<{ `fee`: `bigint`; }>
Defined in: account.ts:110
Network fee a [TransferOptions](/api/anywalletkit/core/interfaces/transferoptions/) transfer would pay, in native base units.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options)
[`TransferOptions`](/api/anywalletkit/core/interfaces/transferoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `fee`: `bigint`; }>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: account.ts:114
Check a message signature against this account’s key, the chain’s conventional way.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`boolean`>
# LendingResult
Defined in: protocols/lending.ts:16
Every lending write returns the hash and the gas cost.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/lending.ts:16
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/lending.ts:16
# NameResolver
Defined in: names.ts:71
Turns names into addresses for one chain and back. `names-ens` implements it; [nameResolvers](/api/anywalletkit/core/functions/nameresolvers/) combines several.
## Properties
[Section titled “Properties”](#properties)
### id
[Section titled “id”](#id)
> `readonly` **id**: `string`
Defined in: names.ts:73
Resolver id, e.g. `ens`.
## Methods
[Section titled “Methods”](#methods)
### avatar()
[Section titled “avatar()”](#avatar)
> **avatar**(`name`): `Promise`<`string` | `null`>
Defined in: names.ts:85
Avatar URL (https / ipfs / resolved NFT image) or `null`. Wallets should fetch it through their own proxy.
#### Parameters
[Section titled “Parameters”](#parameters)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string` | `null`>
***
### resolve()
[Section titled “resolve()”](#resolve)
> **resolve**(`name`, `chain`, `options?`): `Promise`<[`ResolvedName`](/api/anywalletkit/core/interfaces/resolvedname/)>
Defined in: names.ts:81
Name → address for `chain`. Throws `NameError`; never falls back to another chain’s record. `fresh: true` must bypass any cache: the signing-time check ([assertNameUnchanged](/api/anywalletkit/core/functions/assertnameunchanged/)) asks that way, and a cached answer would let a re-pointed name through.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### name
[Section titled “name”](#name-1)
`string`
##### chain
[Section titled “chain”](#chain)
`string`
##### options?
[Section titled “options?”](#options)
###### fresh?
[Section titled “fresh?”](#fresh)
`boolean`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ResolvedName`](/api/anywalletkit/core/interfaces/resolvedname/)>
***
### reverse()
[Section titled “reverse()”](#reverse)
> **reverse**(`address`, `chain`): `Promise`<`string` | `null`>
Defined in: names.ts:83
Address → primary name, verified by forward resolution; `null` when there is none or it does not match.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address)
`string`
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `null`>
***
### supports()
[Section titled “supports()”](#supports)
> **supports**(`name`): `boolean`
Defined in: names.ts:75
Cheap shape check: does this resolver serve names like this one? No I/O.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### name
[Section titled “name”](#name-2)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`boolean`
# NameWarning
Defined in: names.ts:41
Something about a name the user should see before sending to it.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `"mixed-script"` | `"confusable"` | `"punycode"`
Defined in: names.ts:46
`mixed-script`: letters from several scripts; `confusable`: letters that look like others (Cyrillic а for Latin a); `punycode`: an `xn--` label.
***
### label
[Section titled “label”](#label)
> **label**: `string`
Defined in: names.ts:48
The label the warning is about.
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: names.ts:50
One sentence a wallet can show as-is.
# Receipt
Defined in: account.ts:24
The outcome of a mined transaction.
## Properties
[Section titled “Properties”](#properties)
### blockNumber?
[Section titled “blockNumber?”](#blocknumber)
> `optional` **blockNumber?**: `bigint`
Defined in: account.ts:30
Block (height, slot) it was included in, when the chain reports one.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: account.ts:26
Transaction hash.
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: account.ts:28
1 = succeeded, 0 = reverted / failed. Mirrors the EVM convention modules test against.
# RepayOptions
Defined in: protocols/lending.ts:14
Repay `amount` of `token` (base units) of a borrow.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/lending.ts:14
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: protocols/lending.ts:14
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/lending.ts:14
# ResolvedName
Defined in: names.ts:54
A name resolved for one chain, with the warnings to show next to it.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: names.ts:60
The address, in the chain’s canonical form (checksummed for EVM).
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: names.ts:58
CAIP-2 chain the address is for.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: names.ts:56
The normalized name that was resolved.
***
### resolver
[Section titled “resolver”](#resolver)
> **resolver**: `string`
Defined in: names.ts:62
Which resolver answered (`ens`, `sns`, …).
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`NameWarning`](/api/anywalletkit/core/interfaces/namewarning/)\[]
Defined in: names.ts:64
Warnings to show; empty when none.
# RevokeResult
Defined in: protocols/approvals.ts:82
Outcome of one revoke transaction.
## Properties
[Section titled “Properties”](#properties)
### error?
[Section titled “error?”](#error)
> `optional` **error?**: `Error`
Defined in: protocols/approvals.ts:90
Why this item could not be revoked (`revokeAll` continues past failures).
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: protocols/approvals.ts:88
Network fee paid.
***
### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
Defined in: protocols/approvals.ts:86
Transaction hash, when it was sent.
***
### ids
[Section titled “ids”](#ids)
> **ids**: `string`\[]
Defined in: protocols/approvals.ts:84
Ids of the approvals this transaction revoked.
# SeedSigner
Defined in: signer.ts:97
A signer whose key came from a seed and that can derive children.
## Extends
[Section titled “Extends”](#extends)
* [`Signer`](/api/anywalletkit/core/interfaces/signer/)
## Properties
[Section titled “Properties”](#properties)
### curve
[Section titled “curve”](#curve)
> `readonly` **curve**: [`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
Defined in: signer.ts:85
The curve this signer signs with. Chain packages assert the one they need.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`curve`](/api/anywalletkit/core/interfaces/signer/#curve)
***
### kind
[Section titled “kind”](#kind)
> `readonly` **kind**: `"seed"`
Defined in: signer.ts:98
Where the key lives: derived from a seed, one imported key, or outside the SDK.
#### Overrides
[Section titled “Overrides”](#overrides)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`kind`](/api/anywalletkit/core/interfaces/signer/#kind)
***
### path
[Section titled “path”](#path)
> `readonly` **path**: `string`
Defined in: signer.ts:100
The BIP-32 / SLIP-10 path this signer sits at (e.g. “m/44’/60’/0’/0/0”).
***
### schemes
[Section titled “schemes”](#schemes)
> `readonly` **schemes**: readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
Defined in: signer.ts:87
Schemes this signer can produce; asking for another throws `SignerError`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`schemes`](/api/anywalletkit/core/interfaces/signer/#schemes)
## Methods
[Section titled “Methods”](#methods)
### derive()
[Section titled “derive()”](#derive)
> **derive**(`relativePath`): `Promise`<`SeedSigner`>
Defined in: signer.ts:102
Derive a child along `relativePath` (e.g. “0/1”). Hardened-only for ed25519.
#### Parameters
[Section titled “Parameters”](#parameters)
##### relativePath
[Section titled “relativePath”](#relativepath)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`SeedSigner`>
***
### deriveLeaf()?
[Section titled “deriveLeaf()?”](#deriveleaf)
> `optional` **deriveLeaf**(`relativePath`): `Promise`<[`Signer`](/api/anywalletkit/core/interfaces/signer/)>
Defined in: signer.ts:104
Like `derive`, but the child keeps only its own key (no seed copy) and cannot derive further. What managers use for accounts.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### relativePath
[Section titled “relativePath”](#relativepath-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`Signer`](/api/anywalletkit/core/interfaces/signer/)>
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: signer.ts:93
Zeroize key material. Idempotent; the signer is unusable afterwards.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`dispose`](/api/anywalletkit/core/interfaces/signer/#dispose)
***
### getPublicKey()
[Section titled “getPublicKey()”](#getpublickey)
> **getPublicKey**(): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:89
Compressed 33-byte secp256k1 or 32-byte ed25519 public key.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`getPublicKey`](/api/anywalletkit/core/interfaces/signer/#getpublickey)
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`payload`, `options?`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:91
Sign an already-hashed or already-serialised payload. Chains decide what the bytes are.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### payload
[Section titled “payload”](#payload)
`Uint8Array`
##### options?
[Section titled “options?”](#options)
[`SignOptions`](/api/anywalletkit/core/interfaces/signoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Signer`](/api/anywalletkit/core/interfaces/signer/).[`sign`](/api/anywalletkit/core/interfaces/signer/#sign)
# SellCommonOptions
Defined in: protocols/fiat.ts:30
What to sell, for which currency, and where a failed order refunds.
## Properties
[Section titled “Properties”](#properties)
### cryptoAsset
[Section titled “cryptoAsset”](#cryptoasset)
> **cryptoAsset**: `string`
Defined in: protocols/fiat.ts:30
***
### fiatCurrency
[Section titled “fiatCurrency”](#fiatcurrency)
> **fiatCurrency**: `string`
Defined in: protocols/fiat.ts:30
***
### refundAddress?
[Section titled “refundAddress?”](#refundaddress)
> `optional` **refundAddress?**: `string`
Defined in: protocols/fiat.ts:30
# SellExactCryptoAmountOptions
Defined in: protocols/fiat.ts:32
Sell exactly `cryptoAmount` (base units).
## Properties
[Section titled “Properties”](#properties)
### cryptoAmount
[Section titled “cryptoAmount”](#cryptoamount)
> **cryptoAmount**: `number` | `bigint`
Defined in: protocols/fiat.ts:32
***
### fiatAmount?
[Section titled “fiatAmount?”](#fiatamount)
> `optional` **fiatAmount?**: `undefined`
Defined in: protocols/fiat.ts:32
# SellForFiatAmountOptions
Defined in: protocols/fiat.ts:34
Receive exactly `fiatAmount` (smallest fiat unit).
## Properties
[Section titled “Properties”](#properties)
### cryptoAmount?
[Section titled “cryptoAmount?”](#cryptoamount)
> `optional` **cryptoAmount?**: `undefined`
Defined in: protocols/fiat.ts:34
***
### fiatAmount
[Section titled “fiatAmount”](#fiatamount)
> **fiatAmount**: `number` | `bigint`
Defined in: protocols/fiat.ts:34
# SellResult
Defined in: protocols/fiat.ts:38
The provider’s checkout URL for the sale.
## Properties
[Section titled “Properties”](#properties)
### sellUrl
[Section titled “sellUrl”](#sellurl)
> **sellUrl**: `string`
Defined in: protocols/fiat.ts:38
# Signer
Defined in: signer.ts:81
Turns bytes into signatures; the only object that may hold a private key. Implement it to plug in a hardware wallet, MPC or a backend, or use [LocalSigner](/api/anywalletkit/core/classes/localsigner/), [privateKeySigner](/api/anywalletkit/core/functions/privatekeysigner/) or [externalSigner](/api/anywalletkit/core/functions/externalsigner/).
## Extended by
[Section titled “Extended by”](#extended-by)
* [`SeedSigner`](/api/anywalletkit/core/interfaces/seedsigner/)
## Properties
[Section titled “Properties”](#properties)
### curve
[Section titled “curve”](#curve)
> `readonly` **curve**: [`SignerCurve`](/api/anywalletkit/core/type-aliases/signercurve/)
Defined in: signer.ts:85
The curve this signer signs with. Chain packages assert the one they need.
***
### kind
[Section titled “kind”](#kind)
> `readonly` **kind**: `"seed"` | `"key"` | `"external"`
Defined in: signer.ts:83
Where the key lives: derived from a seed, one imported key, or outside the SDK.
***
### schemes
[Section titled “schemes”](#schemes)
> `readonly` **schemes**: readonly [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)\[]
Defined in: signer.ts:87
Schemes this signer can produce; asking for another throws `SignerError`.
## Methods
[Section titled “Methods”](#methods)
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: signer.ts:93
Zeroize key material. Idempotent; the signer is unusable afterwards.
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### getPublicKey()
[Section titled “getPublicKey()”](#getpublickey)
> **getPublicKey**(): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:89
Compressed 33-byte secp256k1 or 32-byte ed25519 public key.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`payload`, `options?`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: signer.ts:91
Sign an already-hashed or already-serialised payload. Chains decide what the bytes are.
#### Parameters
[Section titled “Parameters”](#parameters)
##### payload
[Section titled “payload”](#payload)
`Uint8Array`
##### options?
[Section titled “options?”](#options)
[`SignOptions`](/api/anywalletkit/core/interfaces/signoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# SignOptions
Defined in: signer.ts:59
Per-call options for [Signer.sign](/api/anywalletkit/core/interfaces/signer/#sign).
## Properties
[Section titled “Properties”](#properties)
### aux?
[Section titled “aux?”](#aux)
> `optional` **aux?**: `Uint8Array`<`ArrayBufferLike`>
Defined in: signer.ts:65
BIP-340 auxiliary randomness (32 bytes) — deterministic tests only; omit for fresh randomness.
***
### context?
[Section titled “context?”](#context)
> `optional` **context?**: `string`
Defined in: signer.ts:63
What is being signed (see the table above). Informational for local signers.
***
### scheme?
[Section titled “scheme?”](#scheme)
> `optional` **scheme?**: [`SignScheme`](/api/anywalletkit/core/type-aliases/signscheme/)
Defined in: signer.ts:61
Defaults to [defaultScheme](/api/anywalletkit/core/functions/defaultscheme/) for the signer’s curve.
***
### tweak?
[Section titled “tweak?”](#tweak)
> `optional` **tweak?**: `Uint8Array`<`ArrayBufferLike`>
Defined in: signer.ts:73
BIP-341 key tweak (32 bytes), `schnorr` only: the signer signs with `(even(priv) + tweak) mod n`, i.e. for the tweaked output key — taproot key-path spends (BIP-86: `tweak = taggedHash('TapTweak', xonlyPub)`). A hardware/MPC signer that tweaks internally may ignore it, but it must still produce a signature valid under the tweaked key.
# StakedBalance
Defined in: protocols/staking.ts:58
The account’s staked position. Amounts in base units.
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: protocols/staking.ts:60
Primary staked token held (for Lido, stETH).
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: protocols/staking.ts:64
Primary staked tokens per wrapped token, 1e18 fixed point (0n if none).
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: protocols/staking.ts:66
Whole position in primary staked tokens.
***
### wrappedBalance
[Section titled “wrappedBalance”](#wrappedbalance)
> **wrappedBalance**: `bigint`
Defined in: protocols/staking.ts:62
Non-rebasing wrapped form, 0n if the protocol has none.
# StakeOptions
Defined in: protocols/staking.ts:10
How much native coin to stake, in base units.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/staking.ts:10
# StakeResult
Defined in: protocols/staking.ts:12
The stake transaction and the fee it paid.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/staking.ts:12
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/staking.ts:12
# SupplyOptions
Defined in: protocols/lending.ts:8
Supply `amount` of `token` (base units) to the market; `onBehalfOf` credits another address.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/lending.ts:8
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: protocols/lending.ts:8
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/lending.ts:8
# SupportedCountry
Defined in: protocols/fiat.ts:16
A country the provider serves, and in which directions.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `string`
Defined in: protocols/fiat.ts:16
***
### isBuyAllowed
[Section titled “isBuyAllowed”](#isbuyallowed)
> **isBuyAllowed**: `boolean`
Defined in: protocols/fiat.ts:16
***
### isSellAllowed
[Section titled “isSellAllowed”](#issellallowed)
> **isSellAllowed**: `boolean`
Defined in: protocols/fiat.ts:16
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocols/fiat.ts:16
# SupportedCryptoAsset
Defined in: protocols/fiat.ts:12
A crypto asset the provider trades, by its own code and network code.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `string`
Defined in: protocols/fiat.ts:12
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocols/fiat.ts:12
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocols/fiat.ts:12
***
### networkCode
[Section titled “networkCode”](#networkcode)
> **networkCode**: `string`
Defined in: protocols/fiat.ts:12
# SupportedFiatCurrency
Defined in: protocols/fiat.ts:14
A fiat currency the provider accepts (ISO 4217 code).
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `string`
Defined in: protocols/fiat.ts:14
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocols/fiat.ts:14
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocols/fiat.ts:14
# Swap2CommonOptions
Defined in: protocols/swap2.ts:29
What every swap names: the tokens, the destination chain and who receives.
## Properties
[Section titled “Properties”](#properties)
### fromToken
[Section titled “fromToken”](#fromtoken)
> **fromToken**: `string`
Defined in: protocols/swap2.ts:34
Token on the source chain: contract, mint or jetton address, or a catalog symbol such as `'USDC'`.
***
### fromTokenDecimals?
[Section titled “fromTokenDecimals?”](#fromtokendecimals)
> `optional` **fromTokenDecimals?**: `number`
Defined in: protocols/swap2.ts:40
Decimals of `fromToken` when it is a token the swap catalog does not list (named by its contract or mint). Engines that accept unlisted tokens read it from the chain when it is left out; listed tokens ignore it.
***
### minAmountOut?
[Section titled “minAmountOut?”](#minamountout)
> `optional` **minAmountOut?**: `number` | `bigint`
Defined in: protocols/swap2.ts:55
Minimum acceptable destination amount, base units (overrides slippage when set).
***
### recipient?
[Section titled “recipient?”](#recipient)
> `optional` **recipient?**: `string`
Defined in: protocols/swap2.ts:49
Who receives on the destination chain. Defaults to the swapping account’s address on that chain when the provider can derive it.
***
### refundAddress?
[Section titled “refundAddress?”](#refundaddress)
> `optional` **refundAddress?**: `string`
Defined in: protocols/swap2.ts:51
Where a failed cross-chain swap sends the input back. Defaults to the source address.
***
### slippage?
[Section titled “slippage?”](#slippage)
> `optional` **slippage?**: `number`
Defined in: protocols/swap2.ts:53
Decimal, 0.01 = 1 %.
***
### toChain?
[Section titled “toChain?”](#tochain)
> `optional` **toChain?**: `string` | `number`
Defined in: protocols/swap2.ts:44
Destination chain. Omitted = same-chain swap.
***
### toToken
[Section titled “toToken”](#totoken)
> **toToken**: `string`
Defined in: protocols/swap2.ts:42
Token on the destination chain, in the same forms.
# Swap2ExactInOptions
Defined in: protocols/swap2.ts:58
Sell exactly `fromTokenAmount` (base units).
## Properties
[Section titled “Properties”](#properties)
### fromTokenAmount
[Section titled “fromTokenAmount”](#fromtokenamount)
> **fromTokenAmount**: `number` | `bigint`
Defined in: protocols/swap2.ts:58
***
### toTokenAmount?
[Section titled “toTokenAmount?”](#totokenamount)
> `optional` **toTokenAmount?**: `undefined`
Defined in: protocols/swap2.ts:58
# Swap2ExactOutOptions
Defined in: protocols/swap2.ts:62
Receive exactly `toTokenAmount` (base units); only providers that quote exact output accept it.
## Properties
[Section titled “Properties”](#properties)
### fromTokenAmount?
[Section titled “fromTokenAmount?”](#fromtokenamount)
> `optional` **fromTokenAmount?**: `undefined`
Defined in: protocols/swap2.ts:62
***
### toTokenAmount
[Section titled “toTokenAmount”](#totokenamount)
> **toTokenAmount**: `number` | `bigint`
Defined in: protocols/swap2.ts:62
# Swap2Fee
Defined in: protocols/swap2.ts:67
One fee in a quote or result.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocols/swap2.ts:71
Amount in `token`’s base units.
***
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: `string` | `number`
Defined in: protocols/swap2.ts:75
Chain the fee is paid on, when it is not the source chain.
***
### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
Defined in: protocols/swap2.ts:78
***
### included?
[Section titled “included?”](#included)
> `optional` **included?**: `boolean`
Defined in: protocols/swap2.ts:77
Already included in the quoted amounts.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/swap2.ts:73
Token the fee is paid in.
***
### type
[Section titled “type”](#type)
> **type**: [`Swap2FeeType`](/api/anywalletkit/core/type-aliases/swap2feetype/)
Defined in: protocols/swap2.ts:69
Who takes it.
# Swap2ProtocolConfig
Defined in: protocols/swap2.ts:21
Fee ceilings checked before a swap is signed. A quote above either ceiling is refused.
## Properties
[Section titled “Properties”](#properties)
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: protocols/swap2.ts:23
Maximum acceptable network fee, basis points of the input amount.
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: protocols/swap2.ts:25
Maximum acceptable protocol fee, basis points of the input amount.
# Swap2Quote
Defined in: protocols/swap2.ts:92
A price for a swap, before anything is signed. Amounts in base units.
## Properties
[Section titled “Properties”](#properties)
### estimatedDuration?
[Section titled “estimatedDuration?”](#estimatedduration)
> `optional` **estimatedDuration?**: `number`
Defined in: protocols/swap2.ts:102
Seconds.
***
### expiry?
[Section titled “expiry?”](#expiry)
> `optional` **expiry?**: `number`
Defined in: protocols/swap2.ts:104
Unix seconds.
***
### fees
[Section titled “fees”](#fees)
> **fees**: [`Swap2Fee`](/api/anywalletkit/core/interfaces/swap2fee/)\[]
Defined in: protocols/swap2.ts:100
Every fee, network and protocol.
***
### fromTokenAmount
[Section titled “fromTokenAmount”](#fromtokenamount)
> **fromTokenAmount**: `bigint`
Defined in: protocols/swap2.ts:94
What leaves the wallet.
***
### priceImpact?
[Section titled “priceImpact?”](#priceimpact)
> `optional` **priceImpact?**: `number`
Defined in: protocols/swap2.ts:106
Decimal, 0.01 = 1 %.
***
### toTokenAmount
[Section titled “toTokenAmount”](#totokenamount)
> **toTokenAmount**: `bigint`
Defined in: protocols/swap2.ts:96
Expected delivery.
***
### toTokenAmountMin
[Section titled “toTokenAmountMin”](#totokenamountmin)
> **toTokenAmountMin**: `bigint`
Defined in: protocols/swap2.ts:98
Least the swap may deliver after slippage; below it the swap reverts or refunds.
# Swap2Result
Defined in: protocols/swap2.ts:113
What `swap2()` returns once the source transaction is broadcast. Delivery on another chain comes later; poll [ISwap2Protocol.getSwap2Status](/api/anywalletkit/core/interfaces/iswap2protocol/#getswap2status).
## Properties
[Section titled “Properties”](#properties)
### fees
[Section titled “fees”](#fees)
> **fees**: [`Swap2Fee`](/api/anywalletkit/core/interfaces/swap2fee/)\[]
Defined in: protocols/swap2.ts:119
Fees as quoted at execution.
***
### fromTokenAmount
[Section titled “fromTokenAmount”](#fromtokenamount)
> **fromTokenAmount**: `bigint`
Defined in: protocols/swap2.ts:123
Input amount, base units.
***
### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
Defined in: protocols/swap2.ts:117
Source transaction hash.
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: protocols/swap2.ts:115
Id to pass to `getSwap2Status`; for a same-chain swap, the transaction hash.
***
### toTokenAmount
[Section titled “toTokenAmount”](#totokenamount)
> **toTokenAmount**: `bigint`
Defined in: protocols/swap2.ts:125
Expected delivery, base units.
***
### toTokenAmountMin?
[Section titled “toTokenAmountMin?”](#totokenamountmin)
> `optional` **toTokenAmountMin?**: `bigint`
Defined in: protocols/swap2.ts:127
Least delivery after slippage.
***
### transactions?
[Section titled “transactions?”](#transactions)
> `optional` **transactions?**: [`Swap2Transaction`](/api/anywalletkit/core/interfaces/swap2transaction/)\[]
Defined in: protocols/swap2.ts:121
Every transaction sent so far (approval, source).
# Swap2StatusOptions
Defined in: protocols/swap2.ts:131
Chains of the swap, for providers that need them to look a swap up.
## Properties
[Section titled “Properties”](#properties)
### fromChain?
[Section titled “fromChain?”](#fromchain)
> `optional` **fromChain?**: `string` | `number`
Defined in: protocols/swap2.ts:131
***
### toChain?
[Section titled “toChain?”](#tochain)
> `optional` **toChain?**: `string` | `number`
Defined in: protocols/swap2.ts:131
# Swap2StatusResult
Defined in: protocols/swap2.ts:133
A swap’s state and the transactions seen so far (source, destination, refund).
## Properties
[Section titled “Properties”](#properties)
### status
[Section titled “status”](#status)
> **status**: [`Swap2Status`](/api/anywalletkit/core/type-aliases/swap2status/)
Defined in: protocols/swap2.ts:133
***
### transactions?
[Section titled “transactions?”](#transactions)
> `optional` **transactions?**: [`Swap2Transaction`](/api/anywalletkit/core/interfaces/swap2transaction/)\[]
Defined in: protocols/swap2.ts:133
# Swap2SupportedChain
Defined in: protocols/swap2.ts:136
A chain a provider can swap on or to.
## Properties
[Section titled “Properties”](#properties)
### id
[Section titled “id”](#id)
> **id**: `string` | `number`
Defined in: protocols/swap2.ts:136
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocols/swap2.ts:136
***
### nativeToken
[Section titled “nativeToken”](#nativetoken)
> **nativeToken**: `string`
Defined in: protocols/swap2.ts:136
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: protocols/swap2.ts:136
# Swap2SupportedToken
Defined in: protocols/swap2.ts:138
A token a provider can swap.
## Properties
[Section titled “Properties”](#properties)
### address?
[Section titled “address?”](#address)
> `optional` **address?**: `string`
Defined in: protocols/swap2.ts:147
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string` | `number`
Defined in: protocols/swap2.ts:142
Chain it is on.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocols/swap2.ts:146
Decimals of its base unit.
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocols/swap2.ts:148
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: protocols/swap2.ts:144
Ticker.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/swap2.ts:140
Identifier to pass as `fromToken` / `toToken`.
# Swap2SupportedTokensOptions
Defined in: protocols/swap2.ts:151
Narrow the token list: tokens reachable from `fromChain` / `fromToken`, or on `toChain`.
## Properties
[Section titled “Properties”](#properties)
### fromChain?
[Section titled “fromChain?”](#fromchain)
> `optional` **fromChain?**: `string` | `number`
Defined in: protocols/swap2.ts:151
***
### fromToken?
[Section titled “fromToken?”](#fromtoken)
> `optional` **fromToken?**: `string`
Defined in: protocols/swap2.ts:151
***
### toChain?
[Section titled “toChain?”](#tochain)
> `optional` **toChain?**: `string` | `number`
Defined in: protocols/swap2.ts:151
# Swap2Transaction
Defined in: protocols/swap2.ts:82
One on-chain transaction that belongs to a swap.
## Properties
[Section titled “Properties”](#properties)
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: `string` | `number`
Defined in: protocols/swap2.ts:86
Chain it is on.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/swap2.ts:84
Transaction hash.
***
### type?
[Section titled “type?”](#type)
> `optional` **type?**: `"other"` | `"source"` | `"destination"` | `"approval"` | `"refund"`
Defined in: protocols/swap2.ts:88
Its role in the swap.
# SwapBuyOptions
Defined in: protocols/swap.ts:23
Receive exactly `tokenOutAmount`.
## Properties
[Section titled “Properties”](#properties)
### tokenInAmount?
[Section titled “tokenInAmount?”](#tokeninamount)
> `optional` **tokenInAmount?**: `undefined`
Defined in: protocols/swap.ts:23
***
### tokenOutAmount
[Section titled “tokenOutAmount”](#tokenoutamount)
> **tokenOutAmount**: `number` | `bigint`
Defined in: protocols/swap.ts:23
# SwapCommonOptions
Defined in: protocols/swap.ts:14
Tokens of a same-chain swap and who receives.
## Properties
[Section titled “Properties”](#properties)
### minAmountOut?
[Section titled “minAmountOut?”](#minamountout)
> `optional` **minAmountOut?**: `number` | `bigint`
Defined in: protocols/swap.ts:20
Minimum acceptable output amount, base units.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocols/swap.ts:18
Receiver of the output tokens. Defaults to the account itself.
***
### tokenIn
[Section titled “tokenIn”](#tokenin)
> **tokenIn**: `string`
Defined in: protocols/swap.ts:15
***
### tokenOut
[Section titled “tokenOut”](#tokenout)
> **tokenOut**: `string`
Defined in: protocols/swap.ts:16
# SwapProtocolConfig
Defined in: protocols/swap.ts:8
Fee ceiling for [ISwapProtocol.swap](/api/anywalletkit/core/interfaces/iswapprotocol/#swap).
## Properties
[Section titled “Properties”](#properties)
### swapMaxFee?
[Section titled “swapMaxFee?”](#swapmaxfee)
> `optional` **swapMaxFee?**: `number` | `bigint`
Defined in: protocols/swap.ts:10
Maximum fee for swap operations, in native base units.
# SwapResult
Defined in: protocols/swap.ts:30
The swap transaction, its fee and amounts.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/swap.ts:33
Gas cost.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/swap.ts:31
***
### tokenInAmount
[Section titled “tokenInAmount”](#tokeninamount)
> **tokenInAmount**: `bigint`
Defined in: protocols/swap.ts:34
***
### tokenOutAmount
[Section titled “tokenOutAmount”](#tokenoutamount)
> **tokenOutAmount**: `bigint`
Defined in: protocols/swap.ts:35
# SwapSellOptions
Defined in: protocols/swap.ts:25
Sell exactly `tokenInAmount`.
## Properties
[Section titled “Properties”](#properties)
### tokenInAmount
[Section titled “tokenInAmount”](#tokeninamount)
> **tokenInAmount**: `number` | `bigint`
Defined in: protocols/swap.ts:25
***
### tokenOutAmount?
[Section titled “tokenOutAmount?”](#tokenoutamount)
> `optional` **tokenOutAmount?**: `undefined`
Defined in: protocols/swap.ts:25
# TokenInfo
Defined in: account.ts:71
What a chain package reads about a token from the chain itself, never from a list. `symbol` and `name` are whatever the token says about itself: anyone can deploy a token called “USDC”, so they never identify it — the address does.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: account.ts:73
The token’s address (contract, mint) in the chain’s canonical form.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: account.ts:77
Base-unit decimals.
***
### flags
[Section titled “flags”](#flags)
> **flags**: [`TokenFlag`](/api/anywalletkit/core/type-aliases/tokenflag/)\[]
Defined in: account.ts:85
Holder-relevant facts read from the chain; empty when none apply.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: account.ts:81
As the token reports it (may be empty).
***
### standard
[Section titled “standard”](#standard)
> **standard**: `string`
Defined in: account.ts:75
`erc20`, `spl` or `spl-token-2022`.
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: account.ts:79
As the token reports it (may be empty).
***
### totalSupply?
[Section titled “totalSupply?”](#totalsupply)
> `optional` **totalSupply?**: `bigint`
Defined in: account.ts:83
Total supply in base units, when the token reports it.
# TransferOptions
Defined in: account.ts:6
A transfer of the chain’s native token or of a token on it. Amounts in base units.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: account.ts:12
Amount in base units (wei, lamports, satoshi…).
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: account.ts:10
Address that receives the funds.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: account.ts:8
Token identifier (contract, mint, jetton master). Omit for the native token.
# TransferResult
Defined in: account.ts:16
What a broadcast returns.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: account.ts:20
Network fee actually paid or quoted, in native base units.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: account.ts:18
Transaction hash (id) on the chain.
# WithdrawalRequest
Defined in: protocols/staking.ts:30
One request in the protocol’s withdrawal queue.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocols/staking.ts:34
Amount requested, base units.
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: protocols/staking.ts:38
Finalized and ready to claim.
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocols/staking.ts:32
Request id, as the claim call takes it.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocols/staking.ts:36
Unix seconds.
# WithdrawalRequestOptions
Defined in: protocols/staking.ts:15
How much staked token to put in the withdrawal queue.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/staking.ts:16
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocols/staking.ts:18
Which staked-token form to withdraw (e.g. “stETH” | “wstETH”). Defaults to the primary one.
# WithdrawalRequestResult
Defined in: protocols/staking.ts:21
The withdrawal-request transaction.
## Properties
[Section titled “Properties”](#properties)
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `string` | `null`
Defined in: protocols/staking.ts:26
Hash of the approval sent first, or `null` when none was needed.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocols/staking.ts:24
Total gas, including a prior approval if the two-transaction fallback ran.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocols/staking.ts:22
# WithdrawalRequestsView
Defined in: protocols/staking.ts:41
The account’s open withdrawal requests and what can be claimed now.
## Properties
[Section titled “Properties”](#properties)
### claimableAmount
[Section titled “claimableAmount”](#claimableamount)
> **claimableAmount**: `bigint`
Defined in: protocols/staking.ts:47
Total ready to claim.
***
### claimableIds
[Section titled “claimableIds”](#claimableids)
> **claimableIds**: `bigint`\[]
Defined in: protocols/staking.ts:49
Finalized ids, in the ascending order the claim call expects.
***
### pendingAmount
[Section titled “pendingAmount”](#pendingamount)
> **pendingAmount**: `bigint`
Defined in: protocols/staking.ts:45
Total still waiting to finalize.
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`WithdrawalRequest`](/api/anywalletkit/core/interfaces/withdrawalrequest/)\[]
Defined in: protocols/staking.ts:43
Open (unclaimed) requests, newest first.
# WithdrawOptions
Defined in: protocols/lending.ts:10
Withdraw `amount` of `token` (base units); `to` sends it to another address.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocols/lending.ts:10
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocols/lending.ts:10
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocols/lending.ts:10
# WriteOptions
Defined in: account.ts:118
Per-call limits of one write, on top of the account’s own configuration.
## Properties
[Section titled “Properties”](#properties)
### maxFee?
[Section titled “maxFee?”](#maxfee)
> `optional` **maxFee?**: `bigint`
Defined in: account.ts:125
Cap on this write’s worst-case network fee, in native base units. Checked by the chain package on the transaction it is about to sign (EVM: its gas limit × its own gas price), with the tighter of this and the account’s configured cap winning. The kit’s `policies.maxFee` passes it down.
# ActivityKind
> **ActivityKind** = `"send"` | `"receive"` | `"self"` | `"swap"` | `"bridge"` | `"stake"` | `"unstake"` | `"claim"` | `"supply"` | `"withdraw"` | `"borrow"` | `"repay"` | `"approve"` | `"revoke"` | `"wrap"` | `"unwrap"` | `"contract"` | `"unknown"`
Defined in: history.ts:108
What happened, from the wallet owner’s point of view.
# ApprovalRisk
> **ApprovalRisk** = `"unlimited"` | `"eoa-spender"` | `"expired"` | `"permanent"`
Defined in: protocols/approvals.ts:18
Why an approval is flagged: an unlimited amount, a spender that is a plain address (not a contract), an expired permit still on record, or no expiry at all.
# ApprovalsErrorReason
> **ApprovalsErrorReason** = `"account-required"` | `"provider-required"` | `"unsupported-standard"` | `"invalid-approval"` | `"source-failed"`
Defined in: protocols/approvals.ts:97
Why an approvals call failed: a signing account or an RPC provider is missing, the standard is not supported, the approval object is invalid, or the history source failed.
# ApprovalStandard
> **ApprovalStandard** = `"erc20"` | `"erc721"` | `"erc721-token"` | `"erc1155"` | `"permit2"` | `"eip7702"` | `"trc20"` | `"spl"` | `"spl-2022"` | `"authz"`
Defined in: protocols/approvals.ts:11
Kinds of approval the approvals interface covers: EVM token allowances, NFT operators, Permit2, EIP-7702 delegations, and their Tron, Solana and Cosmos counterparts.
# BridgeQuote
> **BridgeQuote** = `Omit`<[`BridgeResult`](/api/anywalletkit/core/interfaces/bridgeresult/), `"hash"`>
Defined in: protocols/bridge.ts:31
Fees a bridge would pay; nothing is signed.
# BuyOptions
> **BuyOptions** = [`BuyCommonOptions`](/api/anywalletkit/core/interfaces/buycommonoptions/) & [`BuyExactCryptoAmountOptions`](/api/anywalletkit/core/interfaces/buyexactcryptoamountoptions/) | [`BuyWithFiatAmountOptions`](/api/anywalletkit/core/interfaces/buywithfiatamountoptions/)
Defined in: protocols/fiat.ts:25
An on-ramp request with an exact crypto or an exact fiat amount.
# ChainTxStatus
> **ChainTxStatus** = `"confirmed"` | `"failed"` | `"pending"`
Defined in: history.ts:45
Whether a transaction is confirmed, failed (reverted) or still pending.
# FiatTransactionStatus
> **FiatTransactionStatus** = `"in_progress"` | `"failed"` | `"completed"`
Defined in: protocols/fiat.ts:8
State of an on-ramp or off-ramp order at the provider.
# LendingQuote
> **LendingQuote** = `Omit`<[`LendingResult`](/api/anywalletkit/core/interfaces/lendingresult/), `"hash"`>
Defined in: protocols/lending.ts:18
The network fee a lending write would pay; nothing is signed.
# NameErrorCode
> **NameErrorCode** = `"invalid-name"` | `"not-found"` | `"no-address-for-chain"` | `"unsupported"` | `"lookup-failed"` | `"changed"`
Defined in: names.ts:14
Why a name lookup failed. Each code maps to one message a wallet can show.
# ProtocolType
> **ProtocolType** = `"swap"` | `"bridge"` | `"swap2"` | `"lending"` | `"staking"` | `"approvals"` | `"fiat"`
Defined in: protocols/index.ts:11
Every protocol type the registry knows.
# SellOptions
> **SellOptions** = [`SellCommonOptions`](/api/anywalletkit/core/interfaces/sellcommonoptions/) & [`SellExactCryptoAmountOptions`](/api/anywalletkit/core/interfaces/sellexactcryptoamountoptions/) | [`SellForFiatAmountOptions`](/api/anywalletkit/core/interfaces/sellforfiatamountoptions/)
Defined in: protocols/fiat.ts:36
An off-ramp request with an exact crypto or an exact fiat amount.
# SignerCurve
> **SignerCurve** = `"secp256k1"` | `"ed25519"`
Defined in: signer.ts:54
The two curves the SDK signs on: secp256k1 (EVM, Bitcoin, Tron, Zcash) and ed25519 (Solana, TON, NEAR).
# SignScheme
> **SignScheme** = `"ecdsa-recoverable"` | `"ecdsa"` | `"schnorr"` | `"ed25519"`
Defined in: signer.ts:56
How a payload is signed; see the scheme table in this module’s summary.
# Swap2FeeType
> **Swap2FeeType** = `"network"` | `"protocol"` | `"affiliate"` | `"other"`
Defined in: protocols/swap2.ts:18
Who takes a fee: the network (gas), the protocol or bridge, an affiliate, or something else.
# Swap2Options
> **Swap2Options** = [`Swap2CommonOptions`](/api/anywalletkit/core/interfaces/swap2commonoptions/) & [`Swap2ExactInOptions`](/api/anywalletkit/core/interfaces/swap2exactinoptions/) | [`Swap2ExactOutOptions`](/api/anywalletkit/core/interfaces/swap2exactoutoptions/)
Defined in: protocols/swap2.ts:64
One swap request: the common fields plus either an exact input or an exact output amount.
# Swap2Status
> **Swap2Status** = `"pending"` | `"action-required"` | `"completed"` | `"failed"` | `"refund-pending"` | `"refunded"` | `"cancelled"` | `"expired"` | `"partial"`
Defined in: protocols/swap2.ts:14
Where a swap is. `action-required` means the user must act (a CCTP claim on the destination chain); `partial` means only part of the amount was delivered; `refund-pending` and `refunded` cover a failed cross-chain leg that sends the input back.
# SwapOptions
> **SwapOptions** = [`SwapCommonOptions`](/api/anywalletkit/core/interfaces/swapcommonoptions/) & [`SwapBuyOptions`](/api/anywalletkit/core/interfaces/swapbuyoptions/) | [`SwapSellOptions`](/api/anywalletkit/core/interfaces/swapselloptions/)
Defined in: protocols/swap.ts:27
A same-chain swap with an exact input or an exact output.
# SwapQuote
> **SwapQuote** = `Omit`<[`SwapResult`](/api/anywalletkit/core/interfaces/swapresult/), `"hash"`>
Defined in: protocols/swap.ts:38
A swap price; nothing is signed.
# TokenFlag
> **TokenFlag** = `"upgradeable"` | `"mint-authority"` | `"freeze-authority"` | `"permanent-delegate"` | `"transfer-fee"` | `"transfer-hook"` | `"non-transferable"` | `"default-frozen"` | `"pausable"`
Defined in: account.ts:55
A fact about a token that matters to whoever holds it, read from the chain:
* `upgradeable`: an EVM proxy (EIP-1967 / EIP-1822 / beacon); its owner can replace the code.
* `mint-authority`: someone can still mint more (Solana).
* `freeze-authority`: someone can freeze holders’ token accounts (Solana).
* `permanent-delegate`: someone can move or burn anyone’s balance (Token-2022).
* `transfer-fee`: every transfer pays a fee to the mint (Token-2022).
* `transfer-hook`: a program of the mint’s choosing runs on every transfer (Token-2022).
* `non-transferable`: holders cannot move it (Token-2022).
* `default-frozen`: new token accounts start frozen (Token-2022).
* `pausable`: someone can pause every transfer (Token-2022).
# UNLIMITED_ALLOWANCE
> `const` **UNLIMITED_ALLOWANCE**: `bigint`
Defined in: numbers.ts:34
The smallest allowance treated as unlimited across the SDK: type(uint128).max. It is far above any token’s supply in base units, and every “infinite approval” sentinel in use (uint256, uint160, uint128 max, 2^255) reaches it.
# @anywalletkit/extension-kit
# @anywalletkit/extension-kit
[Section titled “@anywalletkit/extension-kit”](#anywalletkitextension-kit)
[](https://www.npmjs.com/package/@anywalletkit/extension-kit)
The security-relevant core of a non-custodial Chromium (MV3) wallet extension, built on the Any Wallet Kit chain and protocol packages: an encrypted vault, the unlocked-key session with auto-lock, the dApp request router with per-origin permissions and an approval queue, signing-request classification, and the review helpers for swaps and Earn plans. No UI, no `@types/chrome`, no network code of its own: the chrome adapters take structural objects (`StorageAreaLike`, `AlarmsLike`), so everything runs under Vitest with in-memory adapters.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/extension-kit
# or: pnpm add @anywalletkit/extension-kit · yarn add @anywalletkit/extension-kit
```
On npm: [@anywalletkit/extension-kit](https://www.npmjs.com/package/@anywalletkit/extension-kit), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
This package is for wallet developers who build their own extension. It is a library, not an extension: the popup, approval windows, injected providers, service-worker wiring, build and release pipeline are the wallet’s. The Vaulty browser extension is one product built on it.
```sh
pnpm add @anywalletkit/extension-kit @anywalletkit/core @anywalletkit/keyring
```
## What it provides
[Section titled “What it provides”](#what-it-provides)
| Area | Exports | What |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Vault | `Vault`, `chromeLocalVaultStorage`, `memoryVaultStorage`, `VAULT_SCRYPT`, `VAULT_LIMITS`, `VAULT_MIN_PASSWORD_LENGTH` | every secret at rest in `chrome.storage.local`, two key layers (a KEK wraps a DEK, the DEK seals each secret); passkey (WebAuthn PRF) unlock as a second wrap of the same DEK |
| Session | `Session`, `chromeSessionStorage`, `chromeAlarms`, `SESSION_DEFAULT_AUTOLOCK_MS` | the DEK in `chrome.storage.session` with an expiry and an alarm; `getKey()` re-checks the expiry itself |
| Keyring adapters | `chromeKeyringStorage`, `vaultSecretStorage` | `@anywalletkit/keyring` metadata as plain JSON, secrets through the vault, one DEK use per call |
| Relay | `PageRequest` / `RelayRequest` shapes and guards, `isRelayMethod`, `pageRequestFrom`, `stampOrigin`, `checkSenderOrigin`, `RELAY_ERRORS` | page ⇄ content script ⇄ service worker messages; the content script takes only messages the page window itself posted (`pageRequestFrom(event, window)`: an iframe’s `parent.postMessage` is not the site), and the origin is the browser’s (`port.sender`), never the page’s |
| Router | `RequestRouter`, `READ_METHODS`, `SIGNING_METHODS`, `toRelayError` | what a dApp may call: accounts only for connected origins, chain add / switch through the approval window, reads from the wallet’s own RPCs, `eth_sign` never offered, everything else 4200 |
| Permissions | `PermissionStore`, `CHAIN_ACCOUNT_KEYS` | per-origin accounts (EVM, Solana, TON, Tron, Bitcoin, NEAR) and chain |
| Approvals | `ApprovalQueue`, `ReviewDeclined`, `QueueLimitError`, `APPROVALS_MAX_PENDING_PER_ORIGIN` | one approval window at a time, at most 3 pending requests per origin and one pending `connect`; transport notes (`setVia`) for WalletConnect peers |
| Signing | `classifySignRequest`, `prepareTransaction`, `createSignHandler`, `messageText` | connected-address and chain checks, EIP-7702 delegations from sites refused, nonce / gas / fees from the wallet’s RPC |
| Networks | `NetworksTable`, `DEFAULT_NETWORKS`, `parseAddChainParams`, Solana / TON / Tron endpoints | EVM networks with public RPC failover lists; `wallet_addEthereumChain` only for catalog chains, https only, `eth_chainId` verified, site-supplied RPCs stamped `custom` |
| Review gate | `ReviewGate`, `evmCallMatcher`, `chainTxMatcher` | after one sheet reviewed a whole plan, exactly those operations pass once within a TTL |
| Swaps | `quoteRoutes`, `reviewSwapPlan`, `executionFloor`, `SwapsStore`, `SwapTracker`, `parseSwapId` | progressive quotes over swap2 providers, one review sheet per plan (a gasless order is shown and matched by its EIP-712 hash), pre-approvals bound to the reviewing account (`meta.account`), pending swaps resumed across worker restarts |
| Earn | `reviewEarnPlan`, `earnPlanMatchers` | one sheet for an Earn module’s plan (approvals + call), bound to `meta.account` |
| TON Connect | `parseConnectRequest`, `parseSendTransaction`, `parseSignData`, `tonProofMessage`, `tonSignDataMessage` | the pure-data half of TON Connect v2 (the digests `ton_proof` and `signData` sign, to verify them); the account signs with `signTonProof` / `signTonConnectData` (wallet-ton) — `sign()` refuses 32-byte digests |
| Phishing | `PhishingDetector` | MetaMask `eth-phishing-detect` list format, shipped with the build (never fetched at runtime); a listed site is refused (`refusal` → `refuse` on `ApprovalQueue` and `RequestRouter`, 4100, no window); fuzzy lookalikes, brand-in-label, punycode warn |
| SIWE | `parseSiwe`, `siweProblems`, `describeSiwe` | EIP-4361 sign-in messages: domain vs. the asking site, address, chain, expiry, nonce (warnings) |
| Address poisoning | `lookalikeOf`, `RecipientBook` | warns when a new recipient imitates one the user confirmed |
| WebAuthn | `verifyAssertion`, `approvalChallenge`, `derToRaw`, `rawToDer` | ES256 assertion check for “passkey on every signature”; the worker never trusts the page’s word |
## Security model (summary)
[Section titled “Security model (summary)”](#security-model-summary)
* **Keys at rest.** Envelope v2: scrypt N=2^17 r=8 p=1 (`@noble/hashes`) → AES-256-GCM wraps a random 32-byte DEK; the DEK seals each secret under AAD `forgewallet-vault/secret/` (boxes cannot be swapped). The DEK box’s AAD binds the exact KDF parameters, so an envelope whose salt or cost was edited on disk fails to open; `unlock` refuses sub-floor costs (`weak-kdf`), and costs or sizes above `VAULT_LIMITS` (scrypt N ≤ 2^20, r ≤ 16, p ≤ 4; PBKDF2 ≤ 5 000 000 iterations; 1 000 secrets, 32 passkeys, 4 MiB) before any KDF runs (`unsupported-envelope`). Writes to the envelope are serialized (one `Vault` per storage area), so parallel imports keep every secret. v1 envelopes (PBKDF2-SHA256, ≥ 600 000 iterations) still open and are re-sealed as v2. Passwords shorter than 8 characters are refused by the vault itself. Wrong password and tampering are the same failure (`wrong-password`). `create` never overwrites; reset is an explicit `destroy()`.
* **Passkeys.** A passkey wraps the same DEK under HKDF-SHA256(PRF output, salt = credential id); the password stays the recovery path.
* **Re-keying.** `changePassword` re-wraps the same DEK, and `removePasskey` does not take back a DEK the passkey already unwrapped. After a suspected compromise, `rotateVaultKey(password)` makes a fresh DEK, re-seals every secret, drops the passkeys (register them again) and writes one envelope; hand the returned DEK to `session.unlock`, which replaces the old one. `setSecret` refuses a DEK that does not open the vault’s secrets.
* **Unlocked state.** Only the DEK is kept, in `chrome.storage.session` (memory-only, trusted contexts), with an expiry enforced on every read and an alarm that locks; key buffers this package owns are zeroized after use. `unlock` / `lock` / `touch` / `getKey` run one at a time, so activity racing a lock never brings the key back.
* **Errors to pages.** `toRelayError(e, { log })` passes the wallet’s own refusals (EIP-1193 codes) and a node’s JSON-RPC error (code, revert data) with URLs removed; anything else is `-32603 Internal error` on the page and goes to `log`.
* **Origins.** The content script relays only what the page window itself posted (`pageRequestFrom`: `event.source` is the page, `event.origin` its origin), so an ad or embed in an iframe cannot speak as the site. The service worker answers a relay message only when the content script’s stamped origin equals `port.sender.origin`. Permissions are keyed by that origin, never by a URL a page or a WalletConnect peer claims.
* **Requests.** Everything that reveals accounts or moves funds goes through the approval queue; blind signing (`eth_sign`) is not offered; typed data for another chain, deployments and site-originated EIP-7702 delegations are refused; read-only RPC goes to the wallet’s own endpoints.
* **Network.** The kit makes no requests of its own beyond the RPC / provider calls the wallet wires in; the phishing list is data the wallet ships.
What stays the wallet’s job: the extension-page CSP (`script-src 'self'`, no remote images), a host allowlist for the worker’s `fetch`, isolating third-party network SDKs (WalletConnect, Omniston) in a sandbox page, the reproducible release build and the store account.
## Using the chrome adapters
[Section titled “Using the chrome adapters”](#using-the-chrome-adapters)
```ts
import {
Vault, Session, PermissionStore, NetworksTable, ApprovalQueue, RequestRouter,
chromeLocalVaultStorage, chromeSessionStorage, chromeAlarms, chromeJsonStorage,
chromeKeyringStorage, vaultSecretStorage, checkSenderOrigin, isRelayRequest, PORT_NAME,
} from '@anywalletkit/extension-kit'
// service worker
const vault = new Vault({ storage: chromeLocalVaultStorage(chrome.storage.local) })
const session = new Session({ storage: chromeSessionStorage(chrome.storage.session), alarms: chromeAlarms(chrome.alarms) })
// onboarding
const dek = await vault.create(password) // refuses if a vault exists or the password is too short
await vault.setSecret(dek, 'main', utf8(seedPhrase))
await session.unlock(dek) // dek is zeroized here
// @anywalletkit/keyring on top of the vault
const keyringStorage = chromeKeyringStorage(chrome.storage.local)
const secrets = vaultSecretStorage(vault, session) // VaultError('locked') once the session expired
// the dApp side
const permissions = new PermissionStore(chromeJsonStorage(chrome.storage.local, 'my-wallet.permissions'))
const networks = new NetworksTable(chromeJsonStorage(chrome.storage.local, 'my-wallet.networks'))
const approvals = new ApprovalQueue(myApprovalWindow) // chrome.windows.create({ type: 'popup' }) behind ApprovalWindow
const router = new RequestRouter({ permissions, networks, approvals, accounts, rpc, emit, sign })
chrome.runtime.onConnect.addListener((port) => {
if (port.name !== PORT_NAME) return
port.onMessage.addListener(async (msg) => {
if (!isRelayRequest(msg)) return
const origin = checkSenderOrigin(port.sender, msg.origin)
if (!origin) return // forged origin: dropped, not answered
const result = await router.handle(origin, msg.chain, msg.method, msg.params)
// post a RelayResponse { kind: 'response', id: msg.id, … } back on the port
})
})
```
`memoryVaultStorage`, `memorySessionStorage`, `memoryAlarms`, `memoryJsonStorage` and `memoryApprovalWindow` are the in-memory twins for tests.
## Classes
[Section titled “Classes”](#classes)
* [ApprovalQueue](/api/anywalletkit/extension-kit/classes/approvalqueue/)
* [NetworksTable](/api/anywalletkit/extension-kit/classes/networkstable/)
* [OriginRefused](/api/anywalletkit/extension-kit/classes/originrefused/)
* [PermissionStore](/api/anywalletkit/extension-kit/classes/permissionstore/)
* [PhishingDetector](/api/anywalletkit/extension-kit/classes/phishingdetector/)
* [QueueLimitError](/api/anywalletkit/extension-kit/classes/queuelimiterror/)
* [RecipientBook](/api/anywalletkit/extension-kit/classes/recipientbook/)
* [RequestRouter](/api/anywalletkit/extension-kit/classes/requestrouter/)
* [ReviewDeclined](/api/anywalletkit/extension-kit/classes/reviewdeclined/)
* [ReviewGate](/api/anywalletkit/extension-kit/classes/reviewgate/)
* [RouterError](/api/anywalletkit/extension-kit/classes/routererror/)
* [Session](/api/anywalletkit/extension-kit/classes/session/)
* [SwapsStore](/api/anywalletkit/extension-kit/classes/swapsstore/)
* [SwapTracker](/api/anywalletkit/extension-kit/classes/swaptracker/)
* [TonConnectError](/api/anywalletkit/extension-kit/classes/tonconnecterror/)
* [Vault](/api/anywalletkit/extension-kit/classes/vault/)
* [VaultError](/api/anywalletkit/extension-kit/classes/vaulterror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AddChainApproval](/api/anywalletkit/extension-kit/interfaces/addchainapproval/)
* [AlarmsLike](/api/anywalletkit/extension-kit/interfaces/alarmslike/)
* [ApprovalQueueOptions](/api/anywalletkit/extension-kit/interfaces/approvalqueueoptions/)
* [ApprovalRequest](/api/anywalletkit/extension-kit/interfaces/approvalrequest/)
* [ApprovalWindow](/api/anywalletkit/extension-kit/interfaces/approvalwindow/)
* [AssertionExpectations](/api/anywalletkit/extension-kit/interfaces/assertionexpectations/)
* [AssertionInput](/api/anywalletkit/extension-kit/interfaces/assertioninput/)
* [ChainDescriptor](/api/anywalletkit/extension-kit/interfaces/chaindescriptor/)
* [ConnectApproval](/api/anywalletkit/extension-kit/interfaces/connectapproval/)
* [EarnApproval](/api/anywalletkit/extension-kit/interfaces/earnapproval/)
* [EarnPlan](/api/anywalletkit/extension-kit/interfaces/earnplan/)
* [EarnReviewMeta](/api/anywalletkit/extension-kit/interfaces/earnreviewmeta/)
* [EarnTx](/api/anywalletkit/extension-kit/interfaces/earntx/)
* [EvmNetwork](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
* [EvmSigner](/api/anywalletkit/extension-kit/interfaces/evmsigner/)
* [HostCheck](/api/anywalletkit/extension-kit/interfaces/hostcheck/)
* [JsonStorage](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)
* [OriginPermission](/api/anywalletkit/extension-kit/interfaces/originpermission/)
* [OriginVia](/api/anywalletkit/extension-kit/interfaces/originvia/)
* [PageEvent](/api/anywalletkit/extension-kit/interfaces/pageevent/)
* [PageMessageEvent](/api/anywalletkit/extension-kit/interfaces/pagemessageevent/)
* [PageRequest](/api/anywalletkit/extension-kit/interfaces/pagerequest/)
* [PageResponse](/api/anywalletkit/extension-kit/interfaces/pageresponse/)
* [PageWindow](/api/anywalletkit/extension-kit/interfaces/pagewindow/)
* [PhishingList](/api/anywalletkit/extension-kit/interfaces/phishinglist/)
* [PortSender](/api/anywalletkit/extension-kit/interfaces/portsender/)
* [PreparedTx](/api/anywalletkit/extension-kit/interfaces/preparedtx/)
* [QuoteRoutesOptions](/api/anywalletkit/extension-kit/interfaces/quoteroutesoptions/)
* [RelayError](/api/anywalletkit/extension-kit/interfaces/relayerror/)
* [RelayErrorOptions](/api/anywalletkit/extension-kit/interfaces/relayerroroptions/)
* [RelayEvent](/api/anywalletkit/extension-kit/interfaces/relayevent/)
* [RelayRequest](/api/anywalletkit/extension-kit/interfaces/relayrequest/)
* [RelayResponse](/api/anywalletkit/extension-kit/interfaces/relayresponse/)
* [RouteListView](/api/anywalletkit/extension-kit/interfaces/routelistview/)
* [RouterDeps](/api/anywalletkit/extension-kit/interfaces/routerdeps/)
* [RouteView](/api/anywalletkit/extension-kit/interfaces/routeview/)
* [SealedBox](/api/anywalletkit/extension-kit/interfaces/sealedbox/)
* [SessionAlarms](/api/anywalletkit/extension-kit/interfaces/sessionalarms/)
* [SessionOptions](/api/anywalletkit/extension-kit/interfaces/sessionoptions/)
* [SessionStorage](/api/anywalletkit/extension-kit/interfaces/sessionstorage/)
* [SignApproval](/api/anywalletkit/extension-kit/interfaces/signapproval/)
* [SignDeps](/api/anywalletkit/extension-kit/interfaces/signdeps/)
* [SiweContext](/api/anywalletkit/extension-kit/interfaces/siwecontext/)
* [SiweInfo](/api/anywalletkit/extension-kit/interfaces/siweinfo/)
* [SiweMessage](/api/anywalletkit/extension-kit/interfaces/siwemessage/)
* [StorageAreaLike](/api/anywalletkit/extension-kit/interfaces/storagearealike/)
* [SwapApproval](/api/anywalletkit/extension-kit/interfaces/swapapproval/)
* [SwapRecord](/api/anywalletkit/extension-kit/interfaces/swaprecord/)
* [SwapReviewMeta](/api/anywalletkit/extension-kit/interfaces/swapreviewmeta/)
* [SwapTrackerDeps](/api/anywalletkit/extension-kit/interfaces/swaptrackerdeps/)
* [SwitchChainApproval](/api/anywalletkit/extension-kit/interfaces/switchchainapproval/)
* [TonAddressParts](/api/anywalletkit/extension-kit/interfaces/tonaddressparts/)
* [TonConnectMessage](/api/anywalletkit/extension-kit/interfaces/tonconnectmessage/)
* [TonConnectRequest](/api/anywalletkit/extension-kit/interfaces/tonconnectrequest/)
* [TonConnectSendTransaction](/api/anywalletkit/extension-kit/interfaces/tonconnectsendtransaction/)
* [TypedData](/api/anywalletkit/extension-kit/interfaces/typeddata/)
* [VaultEnvelopeV1](/api/anywalletkit/extension-kit/interfaces/vaultenvelopev1/)
* [VaultEnvelopeV2](/api/anywalletkit/extension-kit/interfaces/vaultenvelopev2/)
* [VaultKdfInfo](/api/anywalletkit/extension-kit/interfaces/vaultkdfinfo/)
* [VaultOptions](/api/anywalletkit/extension-kit/interfaces/vaultoptions/)
* [VaultPasskey](/api/anywalletkit/extension-kit/interfaces/vaultpasskey/)
* [VaultStorage](/api/anywalletkit/extension-kit/interfaces/vaultstorage/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ApprovalKind](/api/anywalletkit/extension-kit/type-aliases/approvalkind/)
* [AssertionVerdict](/api/anywalletkit/extension-kit/type-aliases/assertionverdict/)
* [ChainAccountsKey](/api/anywalletkit/extension-kit/type-aliases/chainaccountskey/)
* [GatedOp](/api/anywalletkit/extension-kit/type-aliases/gatedop/)
* [GateMatcher](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
* [PermissionsState](/api/anywalletkit/extension-kit/type-aliases/permissionsstate/)
* [RecipientsState](/api/anywalletkit/extension-kit/type-aliases/recipientsstate/)
* [RelayChain](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
* [RelayToContent](/api/anywalletkit/extension-kit/type-aliases/relaytocontent/)
* [RelayToWorker](/api/anywalletkit/extension-kit/type-aliases/relaytoworker/)
* [SignRequestInfo](/api/anywalletkit/extension-kit/type-aliases/signrequestinfo/)
* [SwapRecordStatus](/api/anywalletkit/extension-kit/type-aliases/swaprecordstatus/)
* [TonSignDataPayload](/api/anywalletkit/extension-kit/type-aliases/tonsigndatapayload/)
* [VaultEnvelope](/api/anywalletkit/extension-kit/type-aliases/vaultenvelope/)
* [VaultErrorCode](/api/anywalletkit/extension-kit/type-aliases/vaulterrorcode/)
## Variables
[Section titled “Variables”](#variables)
* [ACTIVE_STATUSES](/api/anywalletkit/extension-kit/variables/active_statuses/)
* [APPROVALS_MAX_PENDING_PER_ORIGIN](/api/anywalletkit/extension-kit/variables/approvals_max_pending_per_origin/)
* [BTC_CHAIN](/api/anywalletkit/extension-kit/variables/btc_chain/)
* [BTC_ESPLORA](/api/anywalletkit/extension-kit/variables/btc_esplora/)
* [CHAIN_ACCOUNT_KEYS](/api/anywalletkit/extension-kit/variables/chain_account_keys/)
* [DEFAULT_CHAIN](/api/anywalletkit/extension-kit/variables/default_chain/)
* [DEFAULT_NETWORKS](/api/anywalletkit/extension-kit/variables/default_networks/)
* [FLOOR_TOLERANCE_BPS](/api/anywalletkit/extension-kit/variables/floor_tolerance_bps/)
* [KEYRING_STORAGE_KEY](/api/anywalletkit/extension-kit/variables/keyring_storage_key/)
* [LOOKALIKE_PREFIX](/api/anywalletkit/extension-kit/variables/lookalike_prefix/)
* [LOOKALIKE_SUFFIX](/api/anywalletkit/extension-kit/variables/lookalike_suffix/)
* [NEAR_CHAIN](/api/anywalletkit/extension-kit/variables/near_chain/)
* [NEAR_PROVIDERS](/api/anywalletkit/extension-kit/variables/near_providers/)
* [NON_EVM_CHAINS](/api/anywalletkit/extension-kit/variables/non_evm_chains/)
* [PAGE_TARGET](/api/anywalletkit/extension-kit/variables/page_target/)
* [PORT_NAME](/api/anywalletkit/extension-kit/variables/port_name/)
* [READ_METHODS](/api/anywalletkit/extension-kit/variables/read_methods/)
* [RELAY_ERRORS](/api/anywalletkit/extension-kit/variables/relay_errors/)
* [RELAY_METHOD_MAX](/api/anywalletkit/extension-kit/variables/relay_method_max/)
* [SESSION_DEFAULT_AUTOLOCK_MS](/api/anywalletkit/extension-kit/variables/session_default_autolock_ms/)
* [SIGNING_METHODS](/api/anywalletkit/extension-kit/variables/signing_methods/)
* [SOLANA_CHAIN](/api/anywalletkit/extension-kit/variables/solana_chain/)
* [SOLANA_RPCS](/api/anywalletkit/extension-kit/variables/solana_rpcs/)
* [TON_CHAIN](/api/anywalletkit/extension-kit/variables/ton_chain/)
* [TON_ENDPOINTS](/api/anywalletkit/extension-kit/variables/ton_endpoints/)
* [TONCONNECT_ERRORS](/api/anywalletkit/extension-kit/variables/tonconnect_errors/)
* [TONCONNECT_MAX_MESSAGES](/api/anywalletkit/extension-kit/variables/tonconnect_max_messages/)
* [TRON_CHAIN](/api/anywalletkit/extension-kit/variables/tron_chain/)
* [TRON_PROVIDERS](/api/anywalletkit/extension-kit/variables/tron_providers/)
* [VAULT_DEFAULT_ITERATIONS](/api/anywalletkit/extension-kit/variables/vault_default_iterations/)
* [VAULT_LIMITS](/api/anywalletkit/extension-kit/variables/vault_limits/)
* [VAULT_MIN_ITERATIONS](/api/anywalletkit/extension-kit/variables/vault_min_iterations/)
* [VAULT_MIN_PASSWORD_LENGTH](/api/anywalletkit/extension-kit/variables/vault_min_password_length/)
* [VAULT_MIN_SCRYPT](/api/anywalletkit/extension-kit/variables/vault_min_scrypt/)
* [VAULT_SCRYPT](/api/anywalletkit/extension-kit/variables/vault_scrypt/)
* [VAULT_STORAGE_KEY](/api/anywalletkit/extension-kit/variables/vault_storage_key/)
* [ZCASH_BLOCKCHAIR](/api/anywalletkit/extension-kit/variables/zcash_blockchair/)
* [ZCASH_CHAIN](/api/anywalletkit/extension-kit/variables/zcash_chain/)
## Functions
[Section titled “Functions”](#functions)
* [approvalChallenge](/api/anywalletkit/extension-kit/functions/approvalchallenge/)
* [caip2FromChainId](/api/anywalletkit/extension-kit/functions/caip2fromchainid/)
* [chainHex](/api/anywalletkit/extension-kit/functions/chainhex/)
* [chainTxMatcher](/api/anywalletkit/extension-kit/functions/chaintxmatcher/)
* [checkSenderOrigin](/api/anywalletkit/extension-kit/functions/checksenderorigin/)
* [chromeAlarms](/api/anywalletkit/extension-kit/functions/chromealarms/)
* [chromeJsonStorage](/api/anywalletkit/extension-kit/functions/chromejsonstorage/)
* [chromeKeyringStorage](/api/anywalletkit/extension-kit/functions/chromekeyringstorage/)
* [chromeLocalVaultStorage](/api/anywalletkit/extension-kit/functions/chromelocalvaultstorage/)
* [chromeSessionStorage](/api/anywalletkit/extension-kit/functions/chromesessionstorage/)
* [classifySignRequest](/api/anywalletkit/extension-kit/functions/classifysignrequest/)
* [createSignHandler](/api/anywalletkit/extension-kit/functions/createsignhandler/)
* [decodedMessage](/api/anywalletkit/extension-kit/functions/decodedmessage/)
* [derToRaw](/api/anywalletkit/extension-kit/functions/dertoraw/)
* [describeSiwe](/api/anywalletkit/extension-kit/functions/describesiwe/)
* [earnApprovalPayload](/api/anywalletkit/extension-kit/functions/earnapprovalpayload/)
* [earnPlanMatchers](/api/anywalletkit/extension-kit/functions/earnplanmatchers/)
* [encodeApproveCalldata](/api/anywalletkit/extension-kit/functions/encodeapprovecalldata/)
* [evmCallMatcher](/api/anywalletkit/extension-kit/functions/evmcallmatcher/)
* [executionFloor](/api/anywalletkit/extension-kit/functions/executionfloor/)
* [fromBase64Url](/api/anywalletkit/extension-kit/functions/frombase64url/)
* [hostOf](/api/anywalletkit/extension-kit/functions/hostof/)
* [isCatalogChain](/api/anywalletkit/extension-kit/functions/iscatalogchain/)
* [isEnvelopeV1](/api/anywalletkit/extension-kit/functions/isenvelopev1/)
* [isEnvelopeV2](/api/anywalletkit/extension-kit/functions/isenvelopev2/)
* [isLocalHost](/api/anywalletkit/extension-kit/functions/islocalhost/)
* [isPageEvent](/api/anywalletkit/extension-kit/functions/ispageevent/)
* [isPageRequest](/api/anywalletkit/extension-kit/functions/ispagerequest/)
* [isPageResponse](/api/anywalletkit/extension-kit/functions/ispageresponse/)
* [isRelayMethod](/api/anywalletkit/extension-kit/functions/isrelaymethod/)
* [isRelayRequest](/api/anywalletkit/extension-kit/functions/isrelayrequest/)
* [isRelayToContent](/api/anywalletkit/extension-kit/functions/isrelaytocontent/)
* [levenshtein](/api/anywalletkit/extension-kit/functions/levenshtein/)
* [lookalikeOf](/api/anywalletkit/extension-kit/functions/lookalikeof/)
* [memoryAlarms](/api/anywalletkit/extension-kit/functions/memoryalarms/)
* [memoryApprovalWindow](/api/anywalletkit/extension-kit/functions/memoryapprovalwindow/)
* [memoryJsonStorage](/api/anywalletkit/extension-kit/functions/memoryjsonstorage/)
* [memorySessionStorage](/api/anywalletkit/extension-kit/functions/memorysessionstorage/)
* [memoryVaultStorage](/api/anywalletkit/extension-kit/functions/memoryvaultstorage/)
* [messageText](/api/anywalletkit/extension-kit/functions/messagetext/)
* [newRequestId](/api/anywalletkit/extension-kit/functions/newrequestid/)
* [nonEvmChain](/api/anywalletkit/extension-kit/functions/nonevmchain/)
* [normalizeHost](/api/anywalletkit/extension-kit/functions/normalizehost/)
* [pageRequestFrom](/api/anywalletkit/extension-kit/functions/pagerequestfrom/)
* [parseAddChainParams](/api/anywalletkit/extension-kit/functions/parseaddchainparams/)
* [parseConnectRequest](/api/anywalletkit/extension-kit/functions/parseconnectrequest/)
* [parseRawAddress](/api/anywalletkit/extension-kit/functions/parserawaddress/)
* [parseSendTransaction](/api/anywalletkit/extension-kit/functions/parsesendtransaction/)
* [parseSignData](/api/anywalletkit/extension-kit/functions/parsesigndata/)
* [parseSiwe](/api/anywalletkit/extension-kit/functions/parsesiwe/)
* [parseSwapId](/api/anywalletkit/extension-kit/functions/parseswapid/)
* [planMatchers](/api/anywalletkit/extension-kit/functions/planmatchers/)
* [prepareTransaction](/api/anywalletkit/extension-kit/functions/preparetransaction/)
* [proofDomain](/api/anywalletkit/extension-kit/functions/proofdomain/)
* [quoteRoutes](/api/anywalletkit/extension-kit/functions/quoteroutes/)
* [rank](/api/anywalletkit/extension-kit/functions/rank/)
* [rawToDer](/api/anywalletkit/extension-kit/functions/rawtoder/)
* [relayError](/api/anywalletkit/extension-kit/functions/relayerror/)
* [reviewEarnPlan](/api/anywalletkit/extension-kit/functions/reviewearnplan/)
* [reviewSwapPlan](/api/anywalletkit/extension-kit/functions/reviewswapplan/)
* [siweProblems](/api/anywalletkit/extension-kit/functions/siweproblems/)
* [stampOrigin](/api/anywalletkit/extension-kit/functions/stamporigin/)
* [swapApprovalPayload](/api/anywalletkit/extension-kit/functions/swapapprovalpayload/)
* [toBase64Url](/api/anywalletkit/extension-kit/functions/tobase64url/)
* [tonConnectErrorCode](/api/anywalletkit/extension-kit/functions/tonconnecterrorcode/)
* [tonProofMessage](/api/anywalletkit/extension-kit/functions/tonproofmessage/)
* [tonSignDataMessage](/api/anywalletkit/extension-kit/functions/tonsigndatamessage/)
* [toRelayError](/api/anywalletkit/extension-kit/functions/torelayerror/)
* [typedDataMatcher](/api/anywalletkit/extension-kit/functions/typeddatamatcher/)
* [vaultSecretStorage](/api/anywalletkit/extension-kit/functions/vaultsecretstorage/)
* [verifyAssertion](/api/anywalletkit/extension-kit/functions/verifyassertion/)
# ApprovalQueue
Defined in: approvals.ts:106
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ApprovalQueue**(`window`, `newId?`, `options?`): `ApprovalQueue`
Defined in: approvals.ts:112
#### Parameters
[Section titled “Parameters”](#parameters)
##### window
[Section titled “window”](#window)
[`ApprovalWindow`](/api/anywalletkit/extension-kit/interfaces/approvalwindow/)
##### newId?
[Section titled “newId?”](#newid)
() => `string`
##### options?
[Section titled “options?”](#options)
[`ApprovalQueueOptions`](/api/anywalletkit/extension-kit/interfaces/approvalqueueoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`ApprovalQueue`
## Accessors
[Section titled “Accessors”](#accessors)
### current
[Section titled “current”](#current)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **current**(): [`ApprovalRequest`](/api/anywalletkit/extension-kit/interfaces/approvalrequest/)<`unknown`> | `null`
Defined in: approvals.ts:155
The request currently shown (the window asks for it by id on load).
##### Returns
[Section titled “Returns”](#returns-1)
[`ApprovalRequest`](/api/anywalletkit/extension-kit/interfaces/approvalrequest/)<`unknown`> | `null`
***
### queued
[Section titled “queued”](#queued)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **queued**(): `number`
Defined in: approvals.ts:159
##### Returns
[Section titled “Returns”](#returns-2)
`number`
## Methods
[Section titled “Methods”](#methods)
### decline()
[Section titled “decline()”](#decline)
> **decline**(`requestId`, `error?`): `boolean`
Defined in: approvals.ts:167
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### requestId
[Section titled “requestId”](#requestid)
`string`
##### error?
[Section titled “error?”](#error)
`Error` = `...`
#### Returns
[Section titled “Returns”](#returns-3)
`boolean`
***
### declineAll()
[Section titled “declineAll()”](#declineall)
> **declineAll**(`error?`): `void`
Defined in: approvals.ts:172
Lock, disconnect, shutdown: everything pending is declined.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### error?
[Section titled “error?”](#error-1)
`Error` = `...`
#### Returns
[Section titled “Returns”](#returns-4)
`void`
***
### onChange()
[Section titled “onChange()”](#onchange)
> **onChange**(`listener`): () => `void`
Defined in: approvals.ts:180
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### listener
[Section titled “listener”](#listener)
() => `void`
#### Returns
[Section titled “Returns”](#returns-5)
() => `void`
***
### pendingFor()
[Section titled “pendingFor()”](#pendingfor)
> **pendingFor**(`origin`): `number`
Defined in: approvals.ts:150
Requests waiting for `origin` (current + queued).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### origin
[Section titled “origin”](#origin)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`number`
***
### request()
[Section titled “request()”](#request)
> **request**<`T`>(`input`): `Promise`<`T`>
Defined in: approvals.ts:117
Enqueue and wait for the user’s answer. Refuses (never queues) past the per-origin limits.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T` = `unknown`
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### input
[Section titled “input”](#input)
`Omit`<[`ApprovalRequest`](/api/anywalletkit/extension-kit/interfaces/approvalrequest/), `"id"` | `"createdAt"` | `"originWarnings"` | `"via"`>
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`T`>
***
### resolve()
[Section titled “resolve()”](#resolve)
> **resolve**(`requestId`, `value`): `boolean`
Defined in: approvals.ts:163
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### requestId
[Section titled “requestId”](#requestid-1)
`string`
##### value
[Section titled “value”](#value)
`unknown`
#### Returns
[Section titled “Returns”](#returns-8)
`boolean`
***
### setVia()
[Section titled “setVia()”](#setvia)
> **setVia**(`origin`, `via`): `void`
Defined in: approvals.ts:139
Attach (or clear) the transport note every later request from `origin` carries.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### origin
[Section titled “origin”](#origin-1)
`string`
##### via
[Section titled “via”](#via)
[`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/) | `null`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
***
### viaFor()
[Section titled “viaFor()”](#viafor)
> **viaFor**(`origin`): [`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/) | `undefined`
Defined in: approvals.ts:145
The transport note later requests from `origin` carry (WalletConnect Verify’s verdict for `wc:`), if any.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### origin
[Section titled “origin”](#origin-2)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
[`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/) | `undefined`
# NetworksTable
Defined in: networks.ts:94
Shipped networks plus the ones the user accepted from sites, persisted. Lookup by CAIP-2; a custom entry for a shipped chain is ignored (the build’s RPC list wins — a site must not be able to replace Ethereum’s endpoints).
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NetworksTable**(`storage`, `defaults?`): `NetworksTable`
Defined in: networks.ts:100
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)\[]>
##### defaults?
[Section titled “defaults?”](#defaults)
readonly [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)\[] = `DEFAULT_NETWORKS`
#### Returns
[Section titled “Returns”](#returns)
`NetworksTable`
## Methods
[Section titled “Methods”](#methods)
### add()
[Section titled “add()”](#add)
> **add**(`network`): `Promise`<`void`>
Defined in: networks.ts:110
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`caip2`): `Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/) | `null`>
Defined in: networks.ts:106
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/) | `null`>
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)\[]>
Defined in: networks.ts:102
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)\[]>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`caip2`): `Promise`<`void`>
Defined in: networks.ts:119
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### caip2
[Section titled “caip2”](#caip2-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
# OriginRefused
Defined in: approvals.ts:55
The origin is refused before any window opens (the shipped phishing list); EIP-1193 4100.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new OriginRefused**(`message`): `OriginRefused`
Defined in: approvals.ts:57
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`OriginRefused`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: `4100` = `RELAY_ERRORS.unauthorized`
Defined in: approvals.ts:56
# PermissionStore
Defined in: permissions.ts:30
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new PermissionStore**(`storage`): `PermissionStore`
Defined in: permissions.ts:37
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<[`PermissionsState`](/api/anywalletkit/extension-kit/type-aliases/permissionsstate/)>
#### Returns
[Section titled “Returns”](#returns)
`PermissionStore`
## Methods
[Section titled “Methods”](#methods)
### connect()
[Section titled “connect()”](#connect)
> **connect**(`origin`, `accounts`, `chain`): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)>
Defined in: permissions.ts:69
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### origin
[Section titled “origin”](#origin)
`string`
##### accounts
[Section titled “accounts”](#accounts)
`string`\[]
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)>
***
### connectChain()
[Section titled “connectChain()”](#connectchain)
> **connectChain**(`origin`, `key`, `accounts`, `defaultChain`): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)>
Defined in: permissions.ts:80
Connect another chain’s accounts to the same origin (one “connected sites” list).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### origin
[Section titled “origin”](#origin-1)
`string`
##### key
[Section titled “key”](#key)
[`ChainAccountsKey`](/api/anywalletkit/extension-kit/type-aliases/chainaccountskey/)
##### accounts
[Section titled “accounts”](#accounts-1)
`string`\[]
##### defaultChain
[Section titled “defaultChain”](#defaultchain)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)>
***
### disconnect()
[Section titled “disconnect()”](#disconnect)
> **disconnect**(`origin`): `Promise`<`void`>
Defined in: permissions.ts:132
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### origin
[Section titled “origin”](#origin-2)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
***
### disconnectChain()
[Section titled “disconnectChain()”](#disconnectchain)
> **disconnectChain**(`origin`, `key`): `Promise`<`void`>
Defined in: permissions.ts:91
Drop one chain’s accounts; the origin stays connected while any chain remains. A no-op (no write) when there is nothing to drop.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### origin
[Section titled “origin”](#origin-3)
`string`
##### key
[Section titled “key”](#key-1)
[`ChainAccountsKey`](/api/anywalletkit/extension-kit/type-aliases/chainaccountskey/) | `"accounts"`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`origin`): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/) | `null`>
Defined in: permissions.ts:61
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### origin
[Section titled “origin”](#origin-4)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/) | `null`>
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)\[]>
Defined in: permissions.ts:65
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)\[]>
***
### onChange()
[Section titled “onChange()”](#onchange)
> **onChange**(`listener`): () => `void`
Defined in: permissions.ts:139
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### listener
[Section titled “listener”](#listener)
(`origin`, `permission`) => `void`
#### Returns
[Section titled “Returns”](#returns-7)
() => `void`
***
### setAccountsEverywhere()
[Section titled “setAccountsEverywhere()”](#setaccountseverywhere)
> **setAccountsEverywhere**(`accounts`): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)\[]>
Defined in: permissions.ts:119
The active EVM account changed: every origin holding an EVM grant now sees `accounts` (MetaMask behaviour). An origin connected only on another chain (`accounts: []` — Solana/TON/Tron/BTC/NEAR providers, a WalletConnect session without eip155) is skipped: it never passed an EVM connect and must not learn the EVM address (scan F6/F8). Lock never writes `[]` here, so the skip cannot strip a real EVM grant.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### accounts
[Section titled “accounts”](#accounts-2)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)\[]>
***
### setChain()
[Section titled “setChain()”](#setchain)
> **setChain**(`origin`, `chain`): `Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/) | `null`>
Defined in: permissions.ts:103
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### origin
[Section titled “origin”](#origin-5)
`string`
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/) | `null`>
# PhishingDetector
Defined in: phishing.ts:28
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new PhishingDetector**(`list`): `PhishingDetector`
Defined in: phishing.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### list
[Section titled “list”](#list)
[`PhishingList`](/api/anywalletkit/extension-kit/interfaces/phishinglist/)
#### Returns
[Section titled “Returns”](#returns)
`PhishingDetector`
## Accessors
[Section titled “Accessors”](#accessors)
### size
[Section titled “size”](#size)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **size**(): `number`
Defined in: phishing.ts:41
##### Returns
[Section titled “Returns”](#returns-1)
`number`
## Methods
[Section titled “Methods”](#methods)
### brandInLabel()
[Section titled “brandInLabel()”](#brandinlabel)
> **brandInLabel**(`host`): { `known`: `string`; `label`: `string`; } | `null`
Defined in: phishing.ts:74
`metamask.io-login.com`, `app-uniswap.com`, `uniswap.org.evil.net`: a known site’s name used as (part of) a label of a host that is not that site. Names shorter than 5 characters are skipped (too many honest matches).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### host
[Section titled “host”](#host)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
{ `known`: `string`; `label`: `string`; } | `null`
***
### check()
[Section titled “check()”](#check)
> **check**(`hostOrOrigin`): [`HostCheck`](/api/anywalletkit/extension-kit/interfaces/hostcheck/)
Defined in: phishing.ts:45
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hostOrOrigin
[Section titled “hostOrOrigin”](#hostororigin)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
[`HostCheck`](/api/anywalletkit/extension-kit/interfaces/hostcheck/)
***
### lookalike()
[Section titled “lookalike()”](#lookalike)
> **lookalike**(`host`): `string` | `null`
Defined in: phishing.ts:87
eth-phishing-detect’s fuzzy check: the host (minus the TLD and a [www](http://www).) within `tolerance` edits of a known one.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### host
[Section titled “host”](#host-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`string` | `null`
***
### refusal()
[Section titled “refusal()”](#refusal)
> **refusal**(`hostOrOrigin`): `string` | `null`
Defined in: phishing.ts:66
Why `hostOrOrigin` must be refused outright, or `null`: a host on the blocklist (or under a listed domain) and not on the allowlist. Lookalikes and punycode only warn ([check](/api/anywalletkit/extension-kit/classes/phishingdetector/#check)). Wire it as `ApprovalQueueOptions.refuse` and `RouterDeps.refuse`.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### hostOrOrigin
[Section titled “hostOrOrigin”](#hostororigin-1)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`string` | `null`
# QueueLimitError
Defined in: approvals.ts:47
The queue refused to enqueue (per-origin limits); carries an EIP-1474 code the page understands.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new QueueLimitError**(`code`, `message`): `QueueLimitError`
Defined in: approvals.ts:48
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`number`
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`QueueLimitError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `number`
Defined in: approvals.ts:48
# RecipientBook
Defined in: poison.ts:32
Recipients the user confirmed on each chain (`eip155`, `solana`, …), newest last, capped.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RecipientBook**(`storage`, `cap?`): `RecipientBook`
Defined in: poison.ts:35
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<[`RecipientsState`](/api/anywalletkit/extension-kit/type-aliases/recipientsstate/)>
##### cap?
[Section titled “cap?”](#cap)
`number` = `500`
#### Returns
[Section titled “Returns”](#returns)
`RecipientBook`
## Methods
[Section titled “Methods”](#methods)
### check()
[Section titled “check()”](#check)
> **check**(`namespace`, `address`): `Promise`<{ `known`: `boolean`; `lookalike`: `string` | `null`; }>
Defined in: poison.ts:56
`known` → the address is one the user paid before; `lookalike` → it imitates one.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### namespace
[Section titled “namespace”](#namespace)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `known`: `boolean`; `lookalike`: `string` | `null`; }>
***
### list()
[Section titled “list()”](#list)
> **list**(`namespace`): `Promise`<`string`\[]>
Defined in: poison.ts:42
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### namespace
[Section titled “namespace”](#namespace-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string`\[]>
***
### remember()
[Section titled “remember()”](#remember)
> **remember**(`namespace`, `address`): `Promise`<`void`>
Defined in: poison.ts:46
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### namespace
[Section titled “namespace”](#namespace-2)
`string`
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
# RequestRouter
Defined in: router.ts:143
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RequestRouter**(`deps`): `RequestRouter`
Defined in: router.ts:144
#### Parameters
[Section titled “Parameters”](#parameters)
##### deps
[Section titled “deps”](#deps)
[`RouterDeps`](/api/anywalletkit/extension-kit/interfaces/routerdeps/)
#### Returns
[Section titled “Returns”](#returns)
`RequestRouter`
## Methods
[Section titled “Methods”](#methods)
### chainFor()
[Section titled “chainFor()”](#chainfor)
> **chainFor**(`origin`): `Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)>
Defined in: router.ts:147
The chain an origin currently sees (its permission’s, else the default).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### origin
[Section titled “origin”](#origin)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)>
***
### disconnect()
[Section titled “disconnect()”](#disconnect)
> **disconnect**(`origin`): `Promise`<`void`>
Defined in: router.ts:245
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### origin
[Section titled “origin”](#origin-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### handle()
[Section titled “handle()”](#handle)
> **handle**(`origin`, `chain`, `method`, `rawParams`): `Promise`<`unknown`>
Defined in: router.ts:153
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### origin
[Section titled “origin”](#origin-2)
`string`
##### chain
[Section titled “chain”](#chain)
[`RelayChain`](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
##### method
[Section titled “method”](#method)
`string`
##### rawParams
[Section titled “rawParams”](#rawparams)
`unknown`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`unknown`>
# ReviewDeclined
Defined in: approvals.ts:25
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ReviewDeclined**(`message?`): `ReviewDeclined`
Defined in: approvals.ts:27
#### Parameters
[Section titled “Parameters”](#parameters)
##### message?
[Section titled “message?”](#message)
`string` = `'You declined — nothing was signed.'`
#### Returns
[Section titled “Returns”](#returns)
`ReviewDeclined`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: `4001` = `RELAY_ERRORS.userRejected`
Defined in: approvals.ts:26
# ReviewGate
Defined in: gate.ts:31
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ReviewGate**(`now?`): `ReviewGate`
Defined in: gate.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### now?
[Section titled “now?”](#now)
() => `number`
#### Returns
[Section titled “Returns”](#returns)
`ReviewGate`
## Accessors
[Section titled “Accessors”](#accessors)
### pending
[Section titled “pending”](#pending)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **pending**(): `number`
Defined in: gate.ts:56
##### Returns
[Section titled “Returns”](#returns-1)
`number`
## Methods
[Section titled “Methods”](#methods)
### clear()
[Section titled “clear()”](#clear)
> **clear**(): `void`
Defined in: gate.ts:60
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### consume()
[Section titled “consume()”](#consume)
> **consume**(`op`): `boolean`
Defined in: gate.ts:47
True (and the matcher is spent) when a pre-approval covers `op`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### op
[Section titled “op”](#op)
[`GatedOp`](/api/anywalletkit/extension-kit/type-aliases/gatedop/)
#### Returns
[Section titled “Returns”](#returns-3)
`boolean`
***
### preApprove()
[Section titled “preApprove()”](#preapprove)
> **preApprove**(`matchers`, `ttlMs?`, `account?`): `void`
Defined in: gate.ts:41
Each matcher passes ONE operation, within `ttlMs` (default 10 min). With `account`, only an op whose `account` is that account (an op without one does not pass). `reviewSwapPlan` and `reviewEarnPlan` always bind.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### matchers
[Section titled “matchers”](#matchers)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)\[]
##### ttlMs?
[Section titled “ttlMs?”](#ttlms)
`number` = `...`
##### account?
[Section titled “account?”](#account)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`void`
# RouterError
Defined in: router.ts:25
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RouterError**(`code`, `message`, `data?`): `RouterError`
Defined in: router.ts:28
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`number`
##### message
[Section titled “message”](#message)
`string`
##### data?
[Section titled “data?”](#data)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`RouterError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `number`
Defined in: router.ts:26
***
### data
[Section titled “data”](#data-1)
> `readonly` **data**: `unknown`
Defined in: router.ts:27
## Methods
[Section titled “Methods”](#methods)
### from()
[Section titled “from()”](#from)
> `static` **from**(`e`): `RouterError`
Defined in: router.ts:34
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### e
[Section titled “e”](#e)
[`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
#### Returns
[Section titled “Returns”](#returns-1)
`RouterError`
# Session
Defined in: session.ts:51
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Session**(`options`): `Session`
Defined in: session.ts:67
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`SessionOptions`](/api/anywalletkit/extension-kit/interfaces/sessionoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Session`
## Accessors
[Section titled “Accessors”](#accessors)
### autoLockMs
[Section titled “autoLockMs”](#autolockms)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **autoLockMs**(): `number`
Defined in: session.ts:123
##### Returns
[Section titled “Returns”](#returns-1)
`number`
## Methods
[Section titled “Methods”](#methods)
### getKey()
[Section titled “getKey()”](#getkey)
> **getKey**(): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: session.ts:103
The DEK for one operation (zeroize it after). `locked` when there is none or the timer ran out while the worker was asleep — the record is then removed as well, so a missed alarm cannot keep the key alive.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
***
### isUnlocked()
[Section titled “isUnlocked()”](#isunlocked)
> **isUnlocked**(): `Promise`<`boolean`>
Defined in: session.ts:94
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`boolean`>
***
### lock()
[Section titled “lock()”](#lock)
> **lock**(): `Promise`<`void`>
Defined in: session.ts:90
Forget the DEK and cancel the alarm. Safe to call when already locked.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### onLock()
[Section titled “onLock()”](#onlock)
> **onLock**(`callback`): () => `void`
Defined in: session.ts:134
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### callback
[Section titled “callback”](#callback)
() => `void`
#### Returns
[Section titled “Returns”](#returns-5)
() => `void`
***
### setAutoLockMs()
[Section titled “setAutoLockMs()”](#setautolockms)
> **setAutoLockMs**(`ms`): `Promise`<`void`>
Defined in: session.ts:128
Change the timer (options page); re-arms from now when unlocked. 0 disables.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### ms
[Section titled “ms”](#ms)
`number`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`void`>
***
### touch()
[Section titled “touch()”](#touch)
> **touch**(): `Promise`<`void`>
Defined in: session.ts:112
User activity: push the auto-lock out again. No-op when locked.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`void`>
***
### unlock()
[Section titled “unlock()”](#unlock)
> **unlock**(`dek`): `Promise`<`void`>
Defined in: session.ts:79
Store the DEK and arm the auto-lock. The caller’s copy is zeroized.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### dek
[Section titled “dek”](#dek)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`void`>
# SwapsStore
Defined in: swaps.ts:59
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SwapsStore**(`storage`): `SwapsStore`
Defined in: swaps.ts:69
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)\[]>
#### Returns
[Section titled “Returns”](#returns)
`SwapsStore`
## Methods
[Section titled “Methods”](#methods)
### active()
[Section titled “active()”](#active)
> **active**(): `Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)\[]>
Defined in: swaps.ts:79
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)\[]>
***
### add()
[Section titled “add()”](#add)
> **add**(`record`): `Promise`<`void`>
Defined in: swaps.ts:83
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### record
[Section titled “record”](#record)
[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`id`): `Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/) | `null`>
Defined in: swaps.ts:75
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### id
[Section titled “id”](#id)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/) | `null`>
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)\[]>
Defined in: swaps.ts:71
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)\[]>
***
### onChange()
[Section titled “onChange()”](#onchange)
> **onChange**(`listener`): () => `void`
Defined in: swaps.ts:108
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### listener
[Section titled “listener”](#listener)
() => `void`
#### Returns
[Section titled “Returns”](#returns-5)
() => `void`
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`id`): `Promise`<`void`>
Defined in: swaps.ts:102
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### id
[Section titled “id”](#id-1)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`void`>
***
### update()
[Section titled “update()”](#update)
> **update**(`id`, `patch`): `Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/) | `null`>
Defined in: swaps.ts:90
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### id
[Section titled “id”](#id-2)
`string`
##### patch
[Section titled “patch”](#patch)
`Partial`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)>
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/) | `null`>
# SwapTracker
Defined in: swaps.ts:142
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SwapTracker**(`deps`): `SwapTracker`
Defined in: swaps.ts:146
#### Parameters
[Section titled “Parameters”](#parameters)
##### deps
[Section titled “deps”](#deps)
[`SwapTrackerDeps`](/api/anywalletkit/extension-kit/interfaces/swaptrackerdeps/)
#### Returns
[Section titled “Returns”](#returns)
`SwapTracker`
## Methods
[Section titled “Methods”](#methods)
### claimed()
[Section titled “claimed()”](#claimed)
> **claimed**(`id`, `destTxHash`): `Promise`<`void`>
Defined in: swaps.ts:160
After the user’s claim transaction went out: keep polling until the provider sees the mint.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id)
`string`
##### destTxHash
[Section titled “destTxHash”](#desttxhash)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### tick()
[Section titled “tick()”](#tick)
> **tick**(): `Promise`<`void`>
Defined in: swaps.ts:166
One alarm tick: check every active record once; stop the alarm when nothing is active. Concurrent ticks coalesce.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### track()
[Section titled “track()”](#track)
> **track**(`input`): `Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)>
Defined in: swaps.ts:151
Record a just-executed swap and make sure the alarm runs.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### input
[Section titled “input”](#input)
`Omit`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/), `"createdAt"` | `"checks"` | `"destTxHash"` | `"status"` | `"updatedAt"`> & `object`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)>
# TonConnectError
Defined in: tonconnect.ts:25
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TonConnectError**(`code`, `message`): `TonConnectError`
Defined in: tonconnect.ts:26
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`number`
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`TonConnectError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `number`
Defined in: tonconnect.ts:26
# Vault
Defined in: vault.ts:158
One `Vault` per storage area: writes to the envelope are serialized inside the instance, so two instances over the same area could still overwrite each other.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Vault**(`options`): `Vault`
Defined in: vault.ts:168
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`VaultOptions`](/api/anywalletkit/extension-kit/interfaces/vaultoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Vault`
## Methods
[Section titled “Methods”](#methods)
### addPasskey()
[Section titled “addPasskey()”](#addpasskey)
> **addPasskey**(`dek`, `passkey`): `Promise`<`void`>
Defined in: vault.ts:322
Register a passkey as a second unlock path: the DEK (from the unlocked session) is sealed under HKDF-SHA256(`prf`, salt = credential id). The password stays the recovery path; `prf` is zeroized here. A v1 envelope must be unlocked (and thereby upgraded) first, and the vault must hold a secret (it proves the DEK).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### dek
[Section titled “dek”](#dek)
`Uint8Array`
##### passkey
[Section titled “passkey”](#passkey)
###### alg?
[Section titled “alg?”](#alg)
`number`
###### id
[Section titled “id”](#id)
`string`
###### label
[Section titled “label”](#label)
`string`
###### prf
[Section titled “prf”](#prf)
`Uint8Array`
###### publicKey?
[Section titled “publicKey?”](#publickey)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### changePassword()
[Section titled “changePassword()”](#changepassword)
> **changePassword**(`oldPassword`, `newPassword`): `Promise`<`void`>
Defined in: vault.ts:243
Re-wrap the DEK under a new password (fresh salt, current KDF). Secrets and passkeys are untouched — and so is the DEK: after a suspected compromise (a copied profile, a leaked session, a lost passkey) this is not enough, because whoever holds the DEK still opens every secret, old and new. Use [Vault.rotateVaultKey](/api/anywalletkit/extension-kit/classes/vault/#rotatevaultkey) then.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### oldPassword
[Section titled “oldPassword”](#oldpassword)
`string`
##### newPassword
[Section titled “newPassword”](#newpassword)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### create()
[Section titled “create()”](#create)
> **create**(`password`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: vault.ts:199
Create an empty vault protected by `password`. Returns the DEK — hand it to the session, then `setSecret` the first seed. Refuses when a vault exists.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### password
[Section titled “password”](#password)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
***
### deleteSecret()
[Section titled “deleteSecret()”](#deletesecret)
> **deleteSecret**(`sourceId`): `Promise`<`void`>
Defined in: vault.ts:406
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### sourceId
[Section titled “sourceId”](#sourceid)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### destroy()
[Section titled “destroy()”](#destroy)
> **destroy**(): `Promise`<`void`>
Defined in: vault.ts:418
Remove the whole vault. The explicit destructive flow only (back up → wipe → create).
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`void`>
***
### exists()
[Section titled “exists()”](#exists)
> **exists**(): `Promise`<`boolean`>
Defined in: vault.ts:182
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`boolean`>
***
### getSecret()
[Section titled “getSecret()”](#getsecret)
> **getSecret**(`dek`, `sourceId`): `Promise`<`Uint8Array`<`ArrayBufferLike`> | `null`>
Defined in: vault.ts:397
Unseal one secret. `null` when the id is unknown; the caller zeroizes the result after use.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### dek
[Section titled “dek”](#dek-1)
`Uint8Array`
##### sourceId
[Section titled “sourceId”](#sourceid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Uint8Array`<`ArrayBufferLike`> | `null`>
***
### kdfInfo()
[Section titled “kdfInfo()”](#kdfinfo)
> **kdfInfo**(): `Promise`<[`VaultKdfInfo`](/api/anywalletkit/extension-kit/interfaces/vaultkdfinfo/) | `null`>
Defined in: vault.ts:187
What protects the DEK right now (UI). `null` without a vault.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`VaultKdfInfo`](/api/anywalletkit/extension-kit/interfaces/vaultkdfinfo/) | `null`>
***
### listPasskeys()
[Section titled “listPasskeys()”](#listpasskeys)
> **listPasskeys**(): `Promise`<`object`\[]>
Defined in: vault.ts:302
Public view of the registered passkeys (ids, labels; whether each can verify assertions).
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`object`\[]>
***
### listSecretIds()
[Section titled “listSecretIds()”](#listsecretids)
> **listSecretIds**(): `Promise`<`string`\[]>
Defined in: vault.ts:372
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`string`\[]>
***
### passkeyPublicKey()
[Section titled “passkeyPublicKey()”](#passkeypublickey)
> **passkeyPublicKey**(`id`): `Promise`<{ `alg`: `number`; `publicKey`: `string`; } | `null`>
Defined in: vault.ts:309
The SPKI public key (base64) of one passkey, for assertion verification; `null` when unknown.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id-1)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `alg`: `number`; `publicKey`: `string`; } | `null`>
***
### removePasskey()
[Section titled “removePasskey()”](#removepasskey)
> **removePasskey**(`id`): `Promise`<`void`>
Defined in: vault.ts:361
Forget one passkey’s box. A DEK that passkey already unwrapped stays valid: after a lost or compromised passkey, [Vault.rotateVaultKey](/api/anywalletkit/extension-kit/classes/vault/#rotatevaultkey).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### id
[Section titled “id”](#id-2)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`void`>
***
### rotateVaultKey()
[Section titled “rotateVaultKey()”](#rotatevaultkey)
> **rotateVaultKey**(`password`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: vault.ts:269
Replace the DEK (scan 2026-10-27 modules, F30): a fresh random DEK, every secret re-sealed under it, the DEK wrapped under `password` with a fresh salt — written as one envelope, so a failure leaves the old vault as it was. Returns the new DEK: hand it to `session.unlock(dek)`, which overwrites the old one in `chrome.storage.session`. A DEK copied before the rotation opens nothing in the new envelope, and [Vault.setSecret](/api/anywalletkit/extension-kit/classes/vault/#setsecret) refuses it, so a stale session cannot seal new secrets under it.
Passkeys are dropped — their boxes hold the old DEK and cannot be re-wrapped without their PRF output — and must be registered again ([Vault.addPasskey](/api/anywalletkit/extension-kit/classes/vault/#addpasskey) with the new DEK).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### password
[Section titled “password”](#password-1)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
***
### setSecret()
[Section titled “setSecret()”](#setsecret)
> **setSecret**(`dek`, `sourceId`, `secret`): `Promise`<`void`>
Defined in: vault.ts:381
Seal `secret` under the DEK as `sourceId` (overwrites an entry with the same id). The DEK must open the vault’s secrets (`locked` otherwise): a key retired by [Vault.rotateVaultKey](/api/anywalletkit/extension-kit/classes/vault/#rotatevaultkey) never seals a new one.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### dek
[Section titled “dek”](#dek-2)
`Uint8Array`
##### sourceId
[Section titled “sourceId”](#sourceid-2)
`string`
##### secret
[Section titled “secret”](#secret)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`void`>
***
### unlock()
[Section titled “unlock()”](#unlock)
> **unlock**(`password`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: vault.ts:214
Derive the KEK from `password`, unseal and return the DEK. `wrong-password` on failure. A v1 (PBKDF2) envelope that opens is re-sealed as v2 (scrypt) on the way out, secrets untouched.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### password
[Section titled “password”](#password-2)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
***
### unlockWithPasskey()
[Section titled “unlockWithPasskey()”](#unlockwithpasskey)
> **unlockWithPasskey**(`id`, `prf`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: vault.ts:345
Unseal the DEK with a passkey’s PRF output. `wrong-password` when the box does not open, `missing` when the id is unknown.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### id
[Section titled “id”](#id-3)
`string`
##### prf
[Section titled “prf”](#prf-1)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# VaultError
Defined in: errors.ts:2
A vault or session rule was broken. Messages are safe to show the user and never contain secrets.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new VaultError**(`message`, `code`): `VaultError`
Defined in: errors.ts:4
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code
[Section titled “code”](#code)
[`VaultErrorCode`](/api/anywalletkit/extension-kit/type-aliases/vaulterrorcode/)
#### Returns
[Section titled “Returns”](#returns)
`VaultError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`VaultErrorCode`](/api/anywalletkit/extension-kit/type-aliases/vaulterrorcode/)
Defined in: errors.ts:3
# approvalChallenge
> **approvalChallenge**(`request`, `c?`): `Promise`<`Uint8Array`<`ArrayBufferLike`>>
Defined in: webauthn.ts:131
The challenge for one approval request: SHA-256 over the request id, kind, origin and payload, so an assertion made for one sheet cannot answer another.
## Parameters
[Section titled “Parameters”](#parameters)
### request
[Section titled “request”](#request)
#### id
[Section titled “id”](#id)
`string`
#### kind
[Section titled “kind”](#kind)
`string`
#### origin
[Section titled “origin”](#origin)
`string`
#### payload
[Section titled “payload”](#payload)
`unknown`
### c?
[Section titled “c?”](#c)
`Crypto` = `globalThis.crypto`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Uint8Array`<`ArrayBufferLike`>>
# caip2FromChainId
> **caip2FromChainId**(`value`): `string` | `null`
Defined in: networks.ts:72
`0x1` / `1` → `eip155:1`; `null` for anything that is not a positive integer chain id.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# chainHex
> **chainHex**(`caip2`): `string`
Defined in: networks.ts:69
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# chainTxMatcher
> **chainTxMatcher**(`expected`): [`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
Defined in: gate.ts:85
Matcher for a non-EVM send: same chain, recipient, amount, token and memo.
## Parameters
[Section titled “Parameters”](#parameters)
### expected
[Section titled “expected”](#expected)
#### amount
[Section titled “amount”](#amount)
`bigint`
#### chain
[Section titled “chain”](#chain)
`string`
#### memo?
[Section titled “memo?”](#memo)
`string`
#### to
[Section titled “to”](#to)
`string`
#### token?
[Section titled “token?”](#token)
`string`
## Returns
[Section titled “Returns”](#returns)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
# checkSenderOrigin
> **checkSenderOrigin**(`sender`, `stamped`): `string` | `null`
Defined in: relay.ts:179
The service worker’s check before it believes a stamped origin: it must equal the origin the browser recorded for the port. Returns the trusted origin or `null`.
## Parameters
[Section titled “Parameters”](#parameters)
### sender
[Section titled “sender”](#sender)
[`PortSender`](/api/anywalletkit/extension-kit/interfaces/portsender/) | `undefined`
### stamped
[Section titled “stamped”](#stamped)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# chromeAlarms
> **chromeAlarms**(`alarms`): [`SessionAlarms`](/api/anywalletkit/extension-kit/interfaces/sessionalarms/)
Defined in: chrome.ts:49
`chrome.alarms` as one-shot named alarms. Chrome rounds alarms to ≥ 30 s in packed extensions.
## Parameters
[Section titled “Parameters”](#parameters)
### alarms
[Section titled “alarms”](#alarms)
[`AlarmsLike`](/api/anywalletkit/extension-kit/interfaces/alarmslike/)
## Returns
[Section titled “Returns”](#returns)
[`SessionAlarms`](/api/anywalletkit/extension-kit/interfaces/sessionalarms/)
# chromeJsonStorage
> **chromeJsonStorage**<`T`>(`area`, `key`): [`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<`T`>
Defined in: storage.ts:9
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Parameters
[Section titled “Parameters”](#parameters)
### area
[Section titled “area”](#area)
[`StorageAreaLike`](/api/anywalletkit/extension-kit/interfaces/storagearealike/)
### key
[Section titled “key”](#key)
`string`
## Returns
[Section titled “Returns”](#returns)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<`T`>
# chromeKeyringStorage
> **chromeKeyringStorage**(`area`, `key?`): `KeyringStorage`
Defined in: keyring.ts:27
Keyring metadata (no secrets) in `chrome.storage.local`.
## Parameters
[Section titled “Parameters”](#parameters)
### area
[Section titled “area”](#area)
[`StorageAreaLike`](/api/anywalletkit/extension-kit/interfaces/storagearealike/)
### key?
[Section titled “key?”](#key)
`string` = `KEYRING_STORAGE_KEY`
## Returns
[Section titled “Returns”](#returns)
`KeyringStorage`
# chromeLocalVaultStorage
> **chromeLocalVaultStorage**(`area`, `key?`): [`VaultStorage`](/api/anywalletkit/extension-kit/interfaces/vaultstorage/)
Defined in: chrome.ts:26
The encrypted envelope in `chrome.storage.local` (survives browser restarts; ciphertext only).
## Parameters
[Section titled “Parameters”](#parameters)
### area
[Section titled “area”](#area)
[`StorageAreaLike`](/api/anywalletkit/extension-kit/interfaces/storagearealike/)
### key?
[Section titled “key?”](#key)
`string` = `VAULT_STORAGE_KEY`
## Returns
[Section titled “Returns”](#returns)
[`VaultStorage`](/api/anywalletkit/extension-kit/interfaces/vaultstorage/)
# chromeSessionStorage
> **chromeSessionStorage**(`area`): [`SessionStorage`](/api/anywalletkit/extension-kit/interfaces/sessionstorage/)
Defined in: chrome.ts:39
`chrome.storage.session`: memory-only, gone when the browser exits. Access is pinned to trusted contexts (the default; made explicit so a content script can never read the unlocked key even if a later change opens the area to them).
## Parameters
[Section titled “Parameters”](#parameters)
### area
[Section titled “area”](#area)
[`StorageAreaLike`](/api/anywalletkit/extension-kit/interfaces/storagearealike/)
## Returns
[Section titled “Returns”](#returns)
[`SessionStorage`](/api/anywalletkit/extension-kit/interfaces/sessionstorage/)
# classifySignRequest
> **classifySignRequest**(`input`): [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/) | [`SignRequestInfo`](/api/anywalletkit/extension-kit/type-aliases/signrequestinfo/)
Defined in: signing.ts:135
Signing method + params → what the window reviews, or the error to answer with.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
#### accounts
[Section titled “accounts”](#accounts)
`string`\[]
#### method
[Section titled “method”](#method)
`string`
#### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
#### now?
[Section titled “now?”](#now)
`number`
#### origin?
[Section titled “origin?”](#origin)
`string`
#### params
[Section titled “params”](#params)
`unknown`\[]
#### via?
[Section titled “via?”](#via)
[`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/)
## Returns
[Section titled “Returns”](#returns)
[`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/) | [`SignRequestInfo`](/api/anywalletkit/extension-kit/type-aliases/signrequestinfo/)
# createSignHandler
> **createSignHandler**(`deps`): (`input`) => `Promise`<`unknown`>
Defined in: signing.ts:242
The router’s `sign` hook: classify → prepare → review → sign (→ broadcast).
## Parameters
[Section titled “Parameters”](#parameters)
### deps
[Section titled “deps”](#deps)
[`SignDeps`](/api/anywalletkit/extension-kit/interfaces/signdeps/)
## Returns
[Section titled “Returns”](#returns)
> (`input`): `Promise`<`unknown`>
The review flow for signing methods. Absent → 4200.
### Parameters
[Section titled “Parameters”](#parameters-1)
#### input
[Section titled “input”](#input)
##### accounts
[Section titled “accounts”](#accounts)
`string`\[]
##### method
[Section titled “method”](#method)
`string`
##### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
##### origin
[Section titled “origin”](#origin)
`string`
##### params
[Section titled “params”](#params)
`unknown`\[]
### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`>
# decodedMessage
> **decodedMessage**(`value`): `string` | `null`
Defined in: signing.ts:119
The message as the signer will sign it: hex decoded when it is valid UTF-8, whatever its printability (scan 2026-10-23 F7 — the SIWE checks must read the bytes that get signed, not the hex fallback `messageText` shows for unprintable text).
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# derToRaw
> **derToRaw**(`der`): `Uint8Array`<`ArrayBufferLike`> | `null`
Defined in: webauthn.ts:87
DER `SEQUENCE { INTEGER r, INTEGER s }` → 64-byte r‖s; `null` when malformed.
## Parameters
[Section titled “Parameters”](#parameters)
### der
[Section titled “der”](#der)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`<`ArrayBufferLike`> | `null`
# describeSiwe
> **describeSiwe**(`text`, `ctx`): [`SiweInfo`](/api/anywalletkit/extension-kit/interfaces/siweinfo/) | `null`
Defined in: siwe.ts:172
`null` only when the text does not start with an EIP-4361 header; a header with unreadable fields comes back with a “malformed sign-in message” problem.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
### ctx
[Section titled “ctx”](#ctx)
[`SiweContext`](/api/anywalletkit/extension-kit/interfaces/siwecontext/)
## Returns
[Section titled “Returns”](#returns)
[`SiweInfo`](/api/anywalletkit/extension-kit/interfaces/siweinfo/) | `null`
# earnApprovalPayload
> **earnApprovalPayload**(`plan`, `meta`): [`EarnApproval`](/api/anywalletkit/extension-kit/interfaces/earnapproval/)
Defined in: earn.ts:60
## Parameters
[Section titled “Parameters”](#parameters)
### plan
[Section titled “plan”](#plan)
[`EarnPlan`](/api/anywalletkit/extension-kit/interfaces/earnplan/)
### meta
[Section titled “meta”](#meta)
[`EarnReviewMeta`](/api/anywalletkit/extension-kit/interfaces/earnreviewmeta/)
## Returns
[Section titled “Returns”](#returns)
[`EarnApproval`](/api/anywalletkit/extension-kit/interfaces/earnapproval/)
# earnPlanMatchers
> **earnPlanMatchers**(`network`, `plan`): [`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)\[]
Defined in: earn.ts:56
## Parameters
[Section titled “Parameters”](#parameters)
### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
### plan
[Section titled “plan”](#plan)
[`EarnPlan`](/api/anywalletkit/extension-kit/interfaces/earnplan/)
## Returns
[Section titled “Returns”](#returns)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)\[]
# encodeApproveCalldata
> **encodeApproveCalldata**(`spender`, `amount`): `string`
Defined in: swap.ts:169
## Parameters
[Section titled “Parameters”](#parameters)
### spender
[Section titled “spender”](#spender)
`string`
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`string`
# evmCallMatcher
> **evmCallMatcher**(`expected`): [`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
Defined in: gate.ts:68
Matcher for an exact EVM call: same chain, `to`, calldata and value.
## Parameters
[Section titled “Parameters”](#parameters)
### expected
[Section titled “expected”](#expected)
#### caip2
[Section titled “caip2”](#caip2)
`string`
#### data?
[Section titled “data?”](#data)
`string`
#### to
[Section titled “to”](#to)
`string`
#### value
[Section titled “value”](#value)
`bigint`
## Returns
[Section titled “Returns”](#returns)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
# executionFloor
> **executionFloor**(`minDestAmount`): `bigint`
Defined in: swap.ts:118
## Parameters
[Section titled “Parameters”](#parameters)
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# fromBase64Url
> **fromBase64Url**(`text`): `Uint8Array`
Defined in: vault.ts:598
base64url (WebAuthn ids) → bytes; plain base64 is accepted too.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# hostOf
> **hostOf**(`hostOrOrigin`): `string`
Defined in: phishing.ts:104
## Parameters
[Section titled “Parameters”](#parameters)
### hostOrOrigin
[Section titled “hostOrOrigin”](#hostororigin)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# isCatalogChain
> **isCatalogChain**(`caip2`): `boolean`
Defined in: networks.ts:85
Whether the asset catalog knows this chain — the gate for `wallet_addEthereumChain`.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isEnvelopeV1
> **isEnvelopeV1**(`x`): `x is VaultEnvelopeV1`
Defined in: vault.ts:536
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is VaultEnvelopeV1`
# isEnvelopeV2
> **isEnvelopeV2**(`x`): `x is VaultEnvelopeV2`
Defined in: vault.ts:548
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is VaultEnvelopeV2`
# isLocalHost
> **isLocalHost**(`host`): `boolean`
Defined in: siwe.ts:128
Loopback / `*.localhost` (dev servers): plain http is normal there, so no scheme warnings. Takes `host[:port]`.
## Parameters
[Section titled “Parameters”](#parameters)
### host
[Section titled “host”](#host)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isPageEvent
> **isPageEvent**(`x`): `x is PageEvent`
Defined in: relay.ts:129
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is PageEvent`
# isPageRequest
> **isPageRequest**(`x`): `x is PageRequest`
Defined in: relay.ts:121
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is PageRequest`
# isPageResponse
> **isPageResponse**(`x`): `x is PageResponse`
Defined in: relay.ts:125
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is PageResponse`
# isRelayMethod
> **isRelayMethod**(`x`): `x is string`
Defined in: relay.ts:119
A method name as the providers spell them (`eth_sendTransaction`, `signAndSendTransaction`, `tron_requestAccounts`): letters, digits and `_`, at most [RELAY_METHOD_MAX](/api/anywalletkit/extension-kit/variables/relay_method_max/). Anything else is dropped at the relay, so a megabyte “method” never reaches a regex, a log or an error message (scan 2026-10-27 modules, F5).
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is string`
# isRelayRequest
> **isRelayRequest**(`x`): `x is RelayRequest`
Defined in: relay.ts:133
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is RelayRequest`
# isRelayToContent
> **isRelayToContent**(`x`): `x is RelayToContent`
Defined in: relay.ts:137
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`x is RelayToContent`
# levenshtein
> **levenshtein**(`a`, `b`): `number`
Defined in: phishing.ts:121
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
### b
[Section titled “b”](#b)
`string`
## Returns
[Section titled “Returns”](#returns)
`number`
# lookalikeOf
> **lookalikeOf**(`address`, `known`): `string` | `null`
Defined in: poison.ts:20
A known recipient that `address` imitates (same start and end, different address), or `null`.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### known
[Section titled “known”](#known)
readonly `string`\[]
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# memoryAlarms
> **memoryAlarms**(): [`SessionAlarms`](/api/anywalletkit/extension-kit/interfaces/sessionalarms/) & `object`
Defined in: session.ts:196
In-memory alarms: `fire(name)` from the test, `pending` to inspect.
## Returns
[Section titled “Returns”](#returns)
[`SessionAlarms`](/api/anywalletkit/extension-kit/interfaces/sessionalarms/) & `object`
# memoryApprovalWindow
> **memoryApprovalWindow**(): [`ApprovalWindow`](/api/anywalletkit/extension-kit/interfaces/approvalwindow/) & `object`
Defined in: approvals.ts:225
In-memory window: tests answer through the queue; `opened` records every request shown.
## Returns
[Section titled “Returns”](#returns)
[`ApprovalWindow`](/api/anywalletkit/extension-kit/interfaces/approvalwindow/) & `object`
# memoryJsonStorage
> **memoryJsonStorage**<`T`>(`initial?`): [`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<`T`> & `object`
Defined in: storage.ts:16
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Parameters
[Section titled “Parameters”](#parameters)
### initial?
[Section titled “initial?”](#initial)
`T` | `null`
## Returns
[Section titled “Returns”](#returns)
[`JsonStorage`](/api/anywalletkit/extension-kit/interfaces/jsonstorage/)<`T`> & `object`
# memorySessionStorage
> **memorySessionStorage**(): [`SessionStorage`](/api/anywalletkit/extension-kit/interfaces/sessionstorage/) & `object`
Defined in: session.ts:185
In-memory `chrome.storage.session` stand-in.
## Returns
[Section titled “Returns”](#returns)
[`SessionStorage`](/api/anywalletkit/extension-kit/interfaces/sessionstorage/) & `object`
# memoryVaultStorage
> **memoryVaultStorage**(`initial?`): [`VaultStorage`](/api/anywalletkit/extension-kit/interfaces/vaultstorage/) & `object`
Defined in: vault.ts:608
Envelope in memory — tests and the smoke.
## Parameters
[Section titled “Parameters”](#parameters)
### initial?
[Section titled “initial?”](#initial)
[`VaultEnvelope`](/api/anywalletkit/extension-kit/type-aliases/vaultenvelope/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`VaultStorage`](/api/anywalletkit/extension-kit/interfaces/vaultstorage/) & `object`
# messageText
> **messageText**(`value`): `string`
Defined in: signing.ts:102
Vaulty’s `messageText`: hex that decodes to printable text is shown decoded; binary payloads stay hex.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string`
# newRequestId
> **newRequestId**(): `string`
Defined in: relay.ts:141
## Returns
[Section titled “Returns”](#returns)
`string`
# nonEvmChain
> **nonEvmChain**(`caip2`): [`ChainDescriptor`](/api/anywalletkit/extension-kit/interfaces/chaindescriptor/) | `undefined`
Defined in: networks.ts:221
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
[`ChainDescriptor`](/api/anywalletkit/extension-kit/interfaces/chaindescriptor/) | `undefined`
# normalizeHost
> **normalizeHost**(`h`): `string`
Defined in: phishing.ts:102
## Parameters
[Section titled “Parameters”](#parameters)
### h
[Section titled “h”](#h)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# pageRequestFrom
> **pageRequestFrom**(`event`, `page`): [`PageRequest`](/api/anywalletkit/extension-kit/interfaces/pagerequest/) | `null`
Defined in: relay.ts:156
The page’s own request, or `null`. A content script must take only messages the page itself posted — `event.source` is the page window and `event.origin` its origin — or an iframe on the page (an ad, an embed) would have its `parent.postMessage` stamped with the site’s origin and shown in the approval window as the site (round 3, H6).
## Parameters
[Section titled “Parameters”](#parameters)
### event
[Section titled “event”](#event)
[`PageMessageEvent`](/api/anywalletkit/extension-kit/interfaces/pagemessageevent/)
### page
[Section titled “page”](#page)
[`PageWindow`](/api/anywalletkit/extension-kit/interfaces/pagewindow/)
## Returns
[Section titled “Returns”](#returns)
[`PageRequest`](/api/anywalletkit/extension-kit/interfaces/pagerequest/) | `null`
# parseAddChainParams
> **parseAddChainParams**(`params`, `known?`): [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/) | [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: networks.ts:168
EIP-3085 `wallet_addEthereumChain` parameter → [EvmNetwork](/api/anywalletkit/extension-kit/interfaces/evmnetwork/), or the error to answer with. Public https RPC urls only (a private / local host is dropped); the chain id must be in the catalog.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
`unknown`
### known?
[Section titled “known?”](#known)
(`caip2`) => `boolean`
## Returns
[Section titled “Returns”](#returns)
[`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/) | [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
# parseConnectRequest
> **parseConnectRequest**(`message`): [`TonConnectRequest`](/api/anywalletkit/extension-kit/interfaces/tonconnectrequest/)
Defined in: tonconnect.ts:35
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`TonConnectRequest`](/api/anywalletkit/extension-kit/interfaces/tonconnectrequest/)
# parseRawAddress
> **parseRawAddress**(`raw`): [`TonAddressParts`](/api/anywalletkit/extension-kit/interfaces/tonaddressparts/)
Defined in: tonconnect.ts:128
`0:abcd…` → parts; friendly addresses are the wallet package’s job (it hands us the raw form).
## Parameters
[Section titled “Parameters”](#parameters)
### raw
[Section titled “raw”](#raw)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TonAddressParts`](/api/anywalletkit/extension-kit/interfaces/tonaddressparts/)
# parseSendTransaction
> **parseSendTransaction**(`param`, `options?`): [`TonConnectSendTransaction`](/api/anywalletkit/extension-kit/interfaces/tonconnectsendtransaction/)
Defined in: tonconnect.ts:67
`sendTransaction` params\[0] (a JSON string per the spec, or an object).
## Parameters
[Section titled “Parameters”](#parameters)
### param
[Section titled “param”](#param)
`unknown`
### options?
[Section titled “options?”](#options)
#### maxMessages?
[Section titled “maxMessages?”](#maxmessages)
`number`
#### network?
[Section titled “network?”](#network)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TonConnectSendTransaction`](/api/anywalletkit/extension-kit/interfaces/tonconnectsendtransaction/)
# parseSignData
> **parseSignData**(`param`): [`TonSignDataPayload`](/api/anywalletkit/extension-kit/type-aliases/tonsigndatapayload/)
Defined in: tonconnect.ts:91
`signData` params\[0]: text or binary only — `cell` payloads need schema-aware rendering and are refused by name.
## Parameters
[Section titled “Parameters”](#parameters)
### param
[Section titled “param”](#param)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`TonSignDataPayload`](/api/anywalletkit/extension-kit/type-aliases/tonsigndatapayload/)
# parseSiwe
> **parseSiwe**(`text`): [`SiweMessage`](/api/anywalletkit/extension-kit/interfaces/siwemessage/) | `null`
Defined in: siwe.ts:99
`null` when the text is not a well-formed EIP-4361 message (see [describeSiwe](/api/anywalletkit/extension-kit/functions/describesiwe/) for the tolerant form the sheet uses).
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
[`SiweMessage`](/api/anywalletkit/extension-kit/interfaces/siwemessage/) | `null`
# parseSwapId
> **parseSwapId**(`id`): { `destTxHash?`: `string`; `intentId`: `string`; `provider`: `string`; `sourceTxHash?`: `string`; } | `null`
Defined in: swaps.ts:47
`awk1..[.[.]]` — the 4th segment is on the id `claimSwap2` returns.
## Parameters
[Section titled “Parameters”](#parameters)
### id
[Section titled “id”](#id)
`string`
## Returns
[Section titled “Returns”](#returns)
{ `destTxHash?`: `string`; `intentId`: `string`; `provider`: `string`; `sourceTxHash?`: `string`; } | `null`
# planMatchers
> **planMatchers**(`plan`): [`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)\[]
Defined in: swap.ts:220
Matchers for exactly the operations the plan will perform, in the engine’s order.
## Parameters
[Section titled “Parameters”](#parameters)
### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
## Returns
[Section titled “Returns”](#returns)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)\[]
# prepareTransaction
> **prepareTransaction**(`deps`, `network`, `from`, `tx`): `Promise`<[`PreparedTx`](/api/anywalletkit/extension-kit/interfaces/preparedtx/)>
Defined in: signing.ts:229
Nonce, gas, fees from the wallet’s RPC.
## Parameters
[Section titled “Parameters”](#parameters)
### deps
[Section titled “deps”](#deps)
`Pick`<[`SignDeps`](/api/anywalletkit/extension-kit/interfaces/signdeps/), `"rpc"` | `"tipFloor"`>
### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
### from
[Section titled “from”](#from)
`string`
### tx
[Section titled “tx”](#tx)
#### data
[Section titled “data”](#data)
`string` | `null`
#### gas
[Section titled “gas”](#gas)
`string` | `null`
#### to
[Section titled “to”](#to)
`string`
#### value
[Section titled “value”](#value)
`string`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`PreparedTx`](/api/anywalletkit/extension-kit/interfaces/preparedtx/)>
# proofDomain
> **proofDomain**(`origin`): `string`
Defined in: tonconnect.ts:135
The dApp’s domain for proofs, from the page origin (host only, as the spec’s `domain.value`).
## Parameters
[Section titled “Parameters”](#parameters)
### origin
[Section titled “origin”](#origin)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# quoteRoutes
> **quoteRoutes**(`providers`, `params`, `options?`): `Promise`<[`RouteListView`](/api/anywalletkit/extension-kit/interfaces/routelistview/)>
Defined in: swap.ts:55
Dry quotes from every enabled provider that claims the route, progressively.
## Parameters
[Section titled “Parameters”](#parameters)
### providers
[Section titled “providers”](#providers)
readonly [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)\[]
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### options?
[Section titled “options?”](#options)
[`QuoteRoutesOptions`](/api/anywalletkit/extension-kit/interfaces/quoteroutesoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`RouteListView`](/api/anywalletkit/extension-kit/interfaces/routelistview/)>
# rank
> **rank**(`quotes`): [`RouteView`](/api/anywalletkit/extension-kit/interfaces/routeview/)\[]
Defined in: swap.ts:103
Highest output first (same destination token for every quote); FASTEST = lowest ETA among them.
## Parameters
[Section titled “Parameters”](#parameters)
### quotes
[Section titled “quotes”](#quotes)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)\[]
## Returns
[Section titled “Returns”](#returns)
[`RouteView`](/api/anywalletkit/extension-kit/interfaces/routeview/)\[]
# rawToDer
> **rawToDer**(`raw`): `Uint8Array`
Defined in: webauthn.ts:114
Raw r‖s → DER (tests build assertions with WebCrypto, which signs raw).
## Parameters
[Section titled “Parameters”](#parameters)
### raw
[Section titled “raw”](#raw)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# relayError
> **relayError**(`code`, `message`, `data?`): [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
Defined in: relay.ts:189
## Parameters
[Section titled “Parameters”](#parameters)
### code
[Section titled “code”](#code)
`number`
### message
[Section titled “message”](#message)
`string`
### data?
[Section titled “data?”](#data)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
# reviewEarnPlan
> **reviewEarnPlan**(`approvals`, `gate`, `meta`, `plan`): `Promise`<`void`>
Defined in: earn.ts:70
One sheet for the plan; approve → pre-approve exactly its calls; decline → ReviewDeclined, nothing sent.
## Parameters
[Section titled “Parameters”](#parameters)
### approvals
[Section titled “approvals”](#approvals)
[`ApprovalQueue`](/api/anywalletkit/extension-kit/classes/approvalqueue/)
### gate
[Section titled “gate”](#gate)
[`ReviewGate`](/api/anywalletkit/extension-kit/classes/reviewgate/)
### meta
[Section titled “meta”](#meta)
[`EarnReviewMeta`](/api/anywalletkit/extension-kit/interfaces/earnreviewmeta/)
### plan
[Section titled “plan”](#plan)
[`EarnPlan`](/api/anywalletkit/extension-kit/interfaces/earnplan/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
# reviewSwapPlan
> **reviewSwapPlan**(`approvals`, `gate`, `meta`): (`plan`) => `Promise`<`void`>
Defined in: swap.ts:241
The engine’s `reviewExecution`: one sheet for the plan; approve → pre-approve exactly its operations; decline → nothing sent.
## Parameters
[Section titled “Parameters”](#parameters)
### approvals
[Section titled “approvals”](#approvals)
[`ApprovalQueue`](/api/anywalletkit/extension-kit/classes/approvalqueue/)
### gate
[Section titled “gate”](#gate)
[`ReviewGate`](/api/anywalletkit/extension-kit/classes/reviewgate/)
### meta
[Section titled “meta”](#meta)
[`SwapReviewMeta`](/api/anywalletkit/extension-kit/interfaces/swapreviewmeta/)
## Returns
[Section titled “Returns”](#returns)
(`plan`) => `Promise`<`void`>
# siweProblems
> **siweProblems**(`m`, `ctx`): `string`\[]
Defined in: siwe.ts:134
The checks; `origin` is the page that asked (as the browser recorded it), `account` the signing address, `chainId` the site’s chain.
## Parameters
[Section titled “Parameters”](#parameters)
### m
[Section titled “m”](#m)
[`SiweMessage`](/api/anywalletkit/extension-kit/interfaces/siwemessage/)
### ctx
[Section titled “ctx”](#ctx)
[`SiweContext`](/api/anywalletkit/extension-kit/interfaces/siwecontext/)
## Returns
[Section titled “Returns”](#returns)
`string`\[]
# stampOrigin
> **stampOrigin**(`request`, `origin`): [`RelayRequest`](/api/anywalletkit/extension-kit/interfaces/relayrequest/)
Defined in: relay.ts:162
The content script’s stamp: [PageRequest](/api/anywalletkit/extension-kit/interfaces/pagerequest/) + the page origin.
## Parameters
[Section titled “Parameters”](#parameters)
### request
[Section titled “request”](#request)
[`PageRequest`](/api/anywalletkit/extension-kit/interfaces/pagerequest/)
### origin
[Section titled “origin”](#origin)
`string`
## Returns
[Section titled “Returns”](#returns)
[`RelayRequest`](/api/anywalletkit/extension-kit/interfaces/relayrequest/)
# swapApprovalPayload
> **swapApprovalPayload**(`plan`, `meta`): [`SwapApproval`](/api/anywalletkit/extension-kit/interfaces/swapapproval/)
Defined in: swap.ts:180
## Parameters
[Section titled “Parameters”](#parameters)
### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
### meta
[Section titled “meta”](#meta)
[`SwapReviewMeta`](/api/anywalletkit/extension-kit/interfaces/swapreviewmeta/)
## Returns
[Section titled “Returns”](#returns)
[`SwapApproval`](/api/anywalletkit/extension-kit/interfaces/swapapproval/)
# toBase64Url
> **toBase64Url**(`bytes`): `string`
Defined in: vault.ts:603
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# tonConnectErrorCode
> **tonConnectErrorCode**(`e`): `number`
Defined in: tonconnect.ts:140
Our relay errors → TON Connect error codes.
## Parameters
[Section titled “Parameters”](#parameters)
### e
[Section titled “e”](#e)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`number`
# tonProofMessage
> **tonProofMessage**(`input`): `Uint8Array`
Defined in: tonconnect.ts:111
The 32-byte digest a wallet signs for `ton_proof` — to verify a proof; sign with `WalletAccountTon.signTonProof`.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
#### address
[Section titled “address”](#address)
[`TonAddressParts`](/api/anywalletkit/extension-kit/interfaces/tonaddressparts/)
#### domain
[Section titled “domain”](#domain)
`string`
#### payload
[Section titled “payload”](#payload)
`string`
#### timestamp
[Section titled “timestamp”](#timestamp)
`number`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# tonSignDataMessage
> **tonSignDataMessage**(`input`): `Uint8Array`
Defined in: tonconnect.ts:119
The 32-byte digest a wallet signs for `signData` (text / binary) — to verify; sign with `WalletAccountTon.signTonConnectData`.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
#### address
[Section titled “address”](#address)
[`TonAddressParts`](/api/anywalletkit/extension-kit/interfaces/tonaddressparts/)
#### domain
[Section titled “domain”](#domain)
`string`
#### payload
[Section titled “payload”](#payload)
[`TonSignDataPayload`](/api/anywalletkit/extension-kit/type-aliases/tonsigndatapayload/)
#### timestamp
[Section titled “timestamp”](#timestamp)
`number`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# toRelayError
> **toRelayError**(`e`, `options?`): [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
Defined in: router.ts:89
Any error → the `RelayError` for the page. Wallet refusals keep their EIP-1193 code ([RouterError](/api/anywalletkit/extension-kit/classes/routererror/), [ReviewDeclined](/api/anywalletkit/extension-kit/classes/reviewdeclined/), a core `UserRejectedError` → 4001), a node’s own JSON-RPC error keeps its code and revert data; their messages lose URLs. Everything else is `-32603 Internal error` on the page and goes to `options.log` in full — transport errors name the RPC URL (often with the provider key in it) and the request.
## Parameters
[Section titled “Parameters”](#parameters)
### e
[Section titled “e”](#e)
`unknown`
### options?
[Section titled “options?”](#options)
[`RelayErrorOptions`](/api/anywalletkit/extension-kit/interfaces/relayerroroptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
# typedDataMatcher
> **typedDataMatcher**(`expected`): [`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
Defined in: gate.ts:79
Matcher for one EIP-712 payload on one chain, by the digest the account signs (`typedDataHash` from `@anywalletkit/wallet-evm`).
## Parameters
[Section titled “Parameters”](#parameters)
### expected
[Section titled “expected”](#expected)
#### caip2
[Section titled “caip2”](#caip2)
`string`
#### typedDataHash
[Section titled “typedDataHash”](#typeddatahash)
`string`
## Returns
[Section titled “Returns”](#returns)
[`GateMatcher`](/api/anywalletkit/extension-kit/type-aliases/gatematcher/)
# vaultSecretStorage
> **vaultSecretStorage**(`vault`, `session`): `SecretStorage`
Defined in: keyring.ts:35
Keyring secrets sealed in the vault; readable only while the session is unlocked.
## Parameters
[Section titled “Parameters”](#parameters)
### vault
[Section titled “vault”](#vault)
[`Vault`](/api/anywalletkit/extension-kit/classes/vault/)
### session
[Section titled “session”](#session)
[`Session`](/api/anywalletkit/extension-kit/classes/session/)
## Returns
[Section titled “Returns”](#returns)
`SecretStorage`
# verifyAssertion
> **verifyAssertion**(`input`, `expect`): `Promise`<[`AssertionVerdict`](/api/anywalletkit/extension-kit/type-aliases/assertionverdict/)>
Defined in: webauthn.ts:49
Verify one assertion. Never throws on bad input — a verdict with the reason, so the worker can refuse in-band.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
[`AssertionInput`](/api/anywalletkit/extension-kit/interfaces/assertioninput/)
### expect
[Section titled “expect”](#expect)
[`AssertionExpectations`](/api/anywalletkit/extension-kit/interfaces/assertionexpectations/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`AssertionVerdict`](/api/anywalletkit/extension-kit/type-aliases/assertionverdict/)>
# AddChainApproval
Defined in: router.ts:119
## Properties
[Section titled “Properties”](#properties)
### network
[Section titled “network”](#network)
> **network**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: router.ts:120
# AlarmsLike
Defined in: chrome.ts:16
## Properties
[Section titled “Properties”](#properties)
### onAlarm
[Section titled “onAlarm”](#onalarm)
> **onAlarm**: `object`
Defined in: chrome.ts:19
#### addListener()
[Section titled “addListener()”](#addlistener)
> **addListener**(`callback`): `void`
##### Parameters
[Section titled “Parameters”](#parameters)
###### callback
[Section titled “callback”](#callback)
(`alarm`) => `void`
##### Returns
[Section titled “Returns”](#returns)
`void`
## Methods
[Section titled “Methods”](#methods)
### clear()
[Section titled “clear()”](#clear)
> **clear**(`name`): `boolean` | `void` | `Promise`<`boolean`>
Defined in: chrome.ts:18
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean` | `void` | `Promise`<`boolean`>
***
### create()
[Section titled “create()”](#create)
> **create**(`name`, `info`): `void` | `Promise`<`void`>
Defined in: chrome.ts:17
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### name
[Section titled “name”](#name-1)
`string`
##### info
[Section titled “info”](#info)
###### when
[Section titled “when”](#when)
`number`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
# ApprovalQueueOptions
Defined in: approvals.ts:79
## Properties
[Section titled “Properties”](#properties)
### annotate?
[Section titled “annotate?”](#annotate)
> `optional` **annotate?**: (`origin`) => `string`\[]
Defined in: approvals.ts:81
Called for every request’s origin; the lines are shown on the sheet (e.g. the shipped phishing list’s verdict).
#### Parameters
[Section titled “Parameters”](#parameters)
##### origin
[Section titled “origin”](#origin)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`\[]
***
### maxPendingPerOrigin?
[Section titled “maxPendingPerOrigin?”](#maxpendingperorigin)
> `optional` **maxPendingPerOrigin?**: `number`
Defined in: approvals.ts:89
Requests one origin may have waiting (current + queued). Default [APPROVALS_MAX_PENDING_PER_ORIGIN](/api/anywalletkit/extension-kit/variables/approvals_max_pending_per_origin/).
***
### refuse?
[Section titled “refuse?”](#refuse)
> `optional` **refuse?**: (`origin`) => `string` | `null` | `undefined`
Defined in: approvals.ts:87
Called for every request’s origin before anything is queued: a reason refuses the request with [OriginRefused](/api/anywalletkit/extension-kit/classes/originrefused/) (4100) and no window opens. Wire `PhishingDetector.refusal` here — a warning on the sheet is one click away from a signature.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### origin
[Section titled “origin”](#origin-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`string` | `null` | `undefined`
# ApprovalRequest
Defined in: approvals.ts:65
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P` = `unknown`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: approvals.ts:68
***
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: approvals.ts:72
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: approvals.ts:66
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`ApprovalKind`](/api/anywalletkit/extension-kit/type-aliases/approvalkind/)
Defined in: approvals.ts:69
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: approvals.ts:67
***
### originWarnings?
[Section titled “originWarnings?”](#originwarnings)
> `optional` **originWarnings?**: `string`\[]
Defined in: approvals.ts:74
Phishing / lookalike / punycode notes about the origin, from the queue’s `annotate` hook.
***
### payload
[Section titled “payload”](#payload)
> **payload**: `P`
Defined in: approvals.ts:71
What the window shows; shape per kind, public data only.
***
### via?
[Section titled “via?”](#via)
> `optional` **via?**: [`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/)
Defined in: approvals.ts:76
Set when the origin is a transport pseudo-origin (`wc:`): what the sheet should say about where this came from.
# ApprovalWindow
Defined in: approvals.ts:93
The window side: open for one request, close when it is answered. `memoryApprovalWindow()` for tests.
## Methods
[Section titled “Methods”](#methods)
### close()
[Section titled “close()”](#close)
> **close**(`requestId`): `Promise`<`void`>
Defined in: approvals.ts:95
#### Parameters
[Section titled “Parameters”](#parameters)
##### requestId
[Section titled “requestId”](#requestid)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### onClosed()
[Section titled “onClosed()”](#onclosed)
> **onClosed**(`handler`): `void`
Defined in: approvals.ts:97
The user closed the window themself (chrome.windows.onRemoved): the queue declines the request.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### handler
[Section titled “handler”](#handler)
(`requestId`) => `void`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### open()
[Section titled “open()”](#open)
> **open**(`request`): `Promise`<`void`>
Defined in: approvals.ts:94
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### request
[Section titled “request”](#request)
[`ApprovalRequest`](/api/anywalletkit/extension-kit/interfaces/approvalrequest/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
# AssertionExpectations
Defined in: webauthn.ts:27
## Properties
[Section titled “Properties”](#properties)
### alg
[Section titled “alg”](#alg)
> **alg**: `number`
Defined in: webauthn.ts:31
COSE alg of the key; only -7 is accepted.
***
### challenge
[Section titled “challenge”](#challenge)
> **challenge**: `Uint8Array`
Defined in: webauthn.ts:33
The challenge the worker handed the page (raw bytes; the page sent it base64url in clientDataJSON).
***
### crypto?
[Section titled “crypto?”](#crypto)
> `optional` **crypto?**: `Crypto`
Defined in: webauthn.ts:40
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: webauthn.ts:35
`chrome-extension://`
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: `string`
Defined in: webauthn.ts:29
SPKI public key of the credential, base64 (what `getPublicKey()` returned at registration).
***
### requireUserVerification?
[Section titled “requireUserVerification?”](#requireuserverification)
> `optional` **requireUserVerification?**: `boolean`
Defined in: webauthn.ts:39
Require the UV flag (user verification: biometric / PIN) — on for signing.
***
### rpId
[Section titled “rpId”](#rpid)
> **rpId**: `string`
Defined in: webauthn.ts:37
The RP id the credential was created for (the extension id); its SHA-256 must be the first 32 bytes of authenticatorData.
# AssertionInput
Defined in: webauthn.ts:16
## Properties
[Section titled “Properties”](#properties)
### authenticatorData
[Section titled “authenticatorData”](#authenticatordata)
> **authenticatorData**: `string`
Defined in: webauthn.ts:20
`AuthenticatorAssertionResponse.authenticatorData`, base64url.
***
### clientDataJSON
[Section titled “clientDataJSON”](#clientdatajson)
> **clientDataJSON**: `string`
Defined in: webauthn.ts:22
`AuthenticatorAssertionResponse.clientDataJSON`, base64url.
***
### credentialId
[Section titled “credentialId”](#credentialid)
> **credentialId**: `string`
Defined in: webauthn.ts:18
`PublicKeyCredential.rawId`, base64url.
***
### signature
[Section titled “signature”](#signature)
> **signature**: `string`
Defined in: webauthn.ts:24
`AuthenticatorAssertionResponse.signature` (DER), base64url.
# ChainDescriptor
Defined in: networks.ts:202
## Properties
[Section titled “Properties”](#properties)
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: networks.ts:203
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: networks.ts:207
***
### explorerAddress
[Section titled “explorerAddress”](#exploreraddress)
> **explorerAddress**: `string`
Defined in: networks.ts:209
***
### explorerTx
[Section titled “explorerTx”](#explorertx)
> **explorerTx**: `string`
Defined in: networks.ts:208
***
### key
[Section titled “key”](#key)
> **key**: `"solana"` | `"ton"` | `"tron"` | `"near"` | `"btc"` | `"zcash"`
Defined in: networks.ts:204
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: networks.ts:205
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: networks.ts:206
# ConnectApproval
Defined in: router.ts:111
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `string`\[]
Defined in: router.ts:113
Addresses the wallet can expose, active account first (empty while locked — the window unlocks first and reloads).
# EarnApproval
Defined in: earn.ts:43
## Properties
[Section titled “Properties”](#properties)
### action
[Section titled “action”](#action)
> **action**: `string`
Defined in: earn.ts:45
***
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`EarnTx`](/api/anywalletkit/extension-kit/interfaces/earntx/)\[]
Defined in: earn.ts:48
***
### checks
[Section titled “checks”](#checks)
> **checks**: `object`\[]
Defined in: earn.ts:50
#### label
[Section titled “label”](#label)
> **label**: `string`
#### status
[Section titled “status”](#status)
> **status**: `"ok"` | `"warn"` | `"unknown"`
***
### facts
[Section titled “facts”](#facts)
> **facts**: `object`\[]
Defined in: earn.ts:47
#### k
[Section titled “k”](#k)
> **k**: `string`
#### v
[Section titled “v”](#v)
> **v**: `string`
***
### module
[Section titled “module”](#module)
> **module**: `string`
Defined in: earn.ts:44
***
### network
[Section titled “network”](#network)
> **network**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: earn.ts:46
***
### preview
[Section titled “preview”](#preview)
> **preview**: `unknown`
Defined in: earn.ts:51
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`EarnTx`](/api/anywalletkit/extension-kit/interfaces/earntx/)
Defined in: earn.ts:49
# EarnPlan
Defined in: earn.ts:21
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`EarnTx`](/api/anywalletkit/extension-kit/interfaces/earntx/)\[]
Defined in: earn.ts:22
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`EarnTx`](/api/anywalletkit/extension-kit/interfaces/earntx/)
Defined in: earn.ts:23
# EarnReviewMeta
Defined in: earn.ts:26
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: earn.ts:29
The account that sends the plan: the gate passes its calls for this account only.
***
### action
[Section titled “action”](#action)
> **action**: `string`
Defined in: earn.ts:33
‘Supply’, ‘Withdraw’, ‘Borrow’, ‘Repay’, ‘Stake’, …
***
### checks?
[Section titled “checks?”](#checks)
> `optional` **checks?**: `object`\[]
Defined in: earn.ts:38
What the module says about the plan (its own refusals never reach here — they throw before).
#### label
[Section titled “label”](#label)
> **label**: `string`
#### status
[Section titled “status”](#status)
> **status**: `"ok"` | `"warn"` | `"unknown"`
***
### facts
[Section titled “facts”](#facts)
> **facts**: `object`\[]
Defined in: earn.ts:36
Human lines the sheet shows (asset, amount, APY, market/vault, health factor…).
#### k
[Section titled “k”](#k)
> **k**: `string`
#### v
[Section titled “v”](#v)
> **v**: `string`
***
### module
[Section titled “module”](#module)
> **module**: `string`
Defined in: earn.ts:31
‘Aave v3’, ‘Morpho’, …
***
### network
[Section titled “network”](#network)
> **network**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: earn.ts:34
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: earn.ts:27
***
### preview?
[Section titled “preview?”](#preview)
> `optional` **preview?**: `unknown`
Defined in: earn.ts:40
tx-preview-evm result for approvals + call, attached by the wallet (JSON-safe) or null.
# EarnTx
Defined in: earn.ts:14
## Properties
[Section titled “Properties”](#properties)
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: earn.ts:16
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: earn.ts:15
***
### value
[Section titled “value”](#value)
> **value**: `string`
Defined in: earn.ts:18
Base units, decimal string.
# EvmNetwork
Defined in: networks.ts:14
## Properties
[Section titled “Properties”](#properties)
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: networks.ts:16
CAIP-2, `eip155:`.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: networks.ts:17
***
### custom?
[Section titled “custom?”](#custom)
> `optional` **custom?**: `object`
Defined in: networks.ts:25
Set when a SITE supplied the RPC list (wallet_addEthereumChain): every sheet on this network says so and simulations are not trusted.
#### addedAt
[Section titled “addedAt”](#addedat)
> **addedAt**: `number`
#### origin
[Section titled “origin”](#origin)
> **origin**: `string`
***
### explorer?
[Section titled “explorer?”](#explorer)
> `optional` **explorer?**: `string`
Defined in: networks.ts:23
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: networks.ts:18
***
### rpcs
[Section titled “rpcs”](#rpcs)
> **rpcs**: `string`\[]
Defined in: networks.ts:22
Tried in order; the client fails over.
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: networks.ts:20
Native currency symbol, 18 decimals on every chain here (on Arc that is the 18-decimal native view of USDC).
# EvmSigner
Defined in: signing.ts:79
## Methods
[Section titled “Methods”](#methods)
### signMessage()
[Section titled “signMessage()”](#signmessage)
> **signMessage**(`message`): `Promise`<`string`>
Defined in: signing.ts:80
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`): `Promise`<`string`>
Defined in: signing.ts:83
Fully specified tx (chainId, nonce, gas, fees) → signed raw transaction.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
###### chainId
[Section titled “chainId”](#chainid)
`number`
###### data
[Section titled “data”](#data)
`string`
###### gasLimit
[Section titled “gasLimit”](#gaslimit)
`bigint`
###### gasPrice?
[Section titled “gasPrice?”](#gasprice)
`bigint`
###### maxFeePerGas?
[Section titled “maxFeePerGas?”](#maxfeepergas)
`bigint`
###### maxPriorityFeePerGas?
[Section titled “maxPriorityFeePerGas?”](#maxpriorityfeepergas)
`bigint`
###### nonce
[Section titled “nonce”](#nonce)
`number`
###### to
[Section titled “to”](#to)
`string`
###### value
[Section titled “value”](#value)
`bigint`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
***
### signTypedData()
[Section titled “signTypedData()”](#signtypeddata)
> **signTypedData**(`typed`): `Promise`<`string`>
Defined in: signing.ts:81
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### typed
[Section titled “typed”](#typed)
[`TypedData`](/api/anywalletkit/extension-kit/interfaces/typeddata/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string`>
# HostCheck
Defined in: phishing.ts:20
## Properties
[Section titled “Properties”](#properties)
### blocked
[Section titled “blocked”](#blocked)
> **blocked**: `boolean`
Defined in: phishing.ts:23
On the blocklist (or a subdomain of a listed domain): refuse to inject / connect.
***
### host
[Section titled “host”](#host)
> **host**: `string`
Defined in: phishing.ts:21
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: `string`\[]
Defined in: phishing.ts:25
Human lines for the approval window; empty when nothing is odd.
# JsonStorage
Defined in: storage.ts:4
One JSON value under one key — the shape every small store here needs.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(): `Promise`<`T` | `null`>
Defined in: storage.ts:5
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`T` | `null`>
***
### set()
[Section titled “set()”](#set)
> **set**(`value`): `Promise`<`void`>
Defined in: storage.ts:6
#### Parameters
[Section titled “Parameters”](#parameters)
##### value
[Section titled “value”](#value)
`T`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
# OriginPermission
Defined in: permissions.ts:8
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `string`\[]
Defined in: permissions.ts:11
EVM addresses exposed to this origin (checksummed as the keyring stores them). Empty when only another chain is connected.
***
### btcAccounts?
[Section titled “btcAccounts?”](#btcaccounts)
> `optional` **btcAccounts?**: `string`\[]
Defined in: permissions.ts:20
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: permissions.ts:13
CAIP-2 chain the origin currently sees (`eth_chainId`).
***
### connectedAt
[Section titled “connectedAt”](#connectedat)
> **connectedAt**: `number`
Defined in: permissions.ts:22
***
### nearAccounts?
[Section titled “nearAccounts?”](#nearaccounts)
> `optional` **nearAccounts?**: `string`\[]
Defined in: permissions.ts:21
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: permissions.ts:9
***
### solanaAccounts?
[Section titled “solanaAccounts?”](#solanaaccounts)
> `optional` **solanaAccounts?**: `string`\[]
Defined in: permissions.ts:15
Solana addresses exposed to this origin (Wallet Standard `standard:connect`).
***
### tonAccounts?
[Section titled “tonAccounts?”](#tonaccounts)
> `optional` **tonAccounts?**: `string`\[]
Defined in: permissions.ts:17
TON addresses exposed to this origin (TON Connect).
***
### tronAccounts?
[Section titled “tronAccounts?”](#tronaccounts)
> `optional` **tronAccounts?**: `string`\[]
Defined in: permissions.ts:19
Tron (TIP-1193), Bitcoin (sats-connect) and NEAR (wallet-selector) addresses.
# OriginVia
Defined in: approvals.ts:36
How a request reached the wallet when it did not come through a content script.
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: approvals.ts:40
***
### scam?
[Section titled “scam?”](#scam)
> `optional` **scam?**: `boolean`
Defined in: approvals.ts:43
***
### transport
[Section titled “transport”](#transport)
> **transport**: `"walletconnect"`
Defined in: approvals.ts:37
***
### url
[Section titled “url”](#url)
> **url**: `string`
Defined in: approvals.ts:39
What the dApp declared about itself (self-reported, unverified unless `verify` says so).
***
### verify
[Section titled “verify”](#verify)
> **verify**: `"VALID"` | `"INVALID"` | `"UNKNOWN"`
Defined in: approvals.ts:42
WalletConnect Verify: VALID = the relay saw the request come from `url`’s origin; INVALID = it came from somewhere else; UNKNOWN = not attested.
# PageEvent
Defined in: relay.ts:69
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`RelayChain`](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
Defined in: relay.ts:71
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `unknown`
Defined in: relay.ts:73
***
### event
[Section titled “event”](#event)
> **event**: `string`
Defined in: relay.ts:72
***
### target
[Section titled “target”](#target)
> **target**: `"anywalletkit/page"`
Defined in: relay.ts:70
# PageMessageEvent
Defined in: relay.ts:146
What a content script’s `message` listener receives (structural `MessageEvent`).
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `unknown`
Defined in: relay.ts:146
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: relay.ts:146
***
### source
[Section titled “source”](#source)
> **source**: `unknown`
Defined in: relay.ts:146
# PageRequest
Defined in: relay.ts:54
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`RelayChain`](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
Defined in: relay.ts:57
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: relay.ts:56
***
### method
[Section titled “method”](#method)
> **method**: `string`
Defined in: relay.ts:58
***
### params?
[Section titled “params?”](#params)
> `optional` **params?**: `unknown`
Defined in: relay.ts:59
***
### target
[Section titled “target”](#target)
> **target**: `"anywalletkit/content"`
Defined in: relay.ts:55
# PageResponse
Defined in: relay.ts:62
## Properties
[Section titled “Properties”](#properties)
### error?
[Section titled “error?”](#error)
> `optional` **error?**: [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
Defined in: relay.ts:66
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: relay.ts:64
***
### result?
[Section titled “result?”](#result)
> `optional` **result?**: `unknown`
Defined in: relay.ts:65
***
### target
[Section titled “target”](#target)
> **target**: `"anywalletkit/page"`
Defined in: relay.ts:63
# PageWindow
Defined in: relay.ts:148
The page window the content script shares (structural `window`).
## Properties
[Section titled “Properties”](#properties)
### location
[Section titled “location”](#location)
> **location**: `object`
Defined in: relay.ts:148
#### origin
[Section titled “origin”](#origin)
> **origin**: `string`
# PhishingList
Defined in: phishing.ts:10
Phishing / impersonation checks on a page’s host, against a SHIPPED list (never fetched at runtime — decision 10). The list format is MetaMask’s eth-phishing-detect `config.json`: `blacklist` / `whitelist` (hosts; a listed domain covers its subdomains), `fuzzylist` + `tolerance` (well-known hosts a lookalike is measured against by Levenshtein distance). On top: punycode (`xn--`) labels are flagged, because mixed-script lookalikes are the common impersonation shape.
## Properties
[Section titled “Properties”](#properties)
### blacklist
[Section titled “blacklist”](#blacklist)
> **blacklist**: readonly `string`\[]
Defined in: phishing.ts:13
***
### extraFuzzylist?
[Section titled “extraFuzzylist?”](#extrafuzzylist)
> `optional` **extraFuzzylist?**: readonly `string`\[]
Defined in: phishing.ts:17
The wallet’s own additions to the fuzzylist (the big dApps our users visit): same semantics.
***
### fuzzylist?
[Section titled “fuzzylist?”](#fuzzylist)
> `optional` **fuzzylist?**: readonly `string`\[]
Defined in: phishing.ts:15
***
### tolerance?
[Section titled “tolerance?”](#tolerance)
> `optional` **tolerance?**: `number`
Defined in: phishing.ts:12
***
### version?
[Section titled “version?”](#version)
> `optional` **version?**: `number`
Defined in: phishing.ts:11
***
### whitelist?
[Section titled “whitelist?”](#whitelist)
> `optional` **whitelist?**: readonly `string`\[]
Defined in: phishing.ts:14
# PortSender
Defined in: relay.ts:168
What `port.sender` looks like (structural `chrome.runtime.MessageSender`).
## Properties
[Section titled “Properties”](#properties)
### frameId?
[Section titled “frameId?”](#frameid)
> `optional` **frameId?**: `number`
Defined in: relay.ts:172
***
### origin?
[Section titled “origin?”](#origin)
> `optional` **origin?**: `string`
Defined in: relay.ts:169
***
### tab?
[Section titled “tab?”](#tab)
> `optional` **tab?**: `object`
Defined in: relay.ts:171
#### id?
[Section titled “id?”](#id)
> `optional` **id?**: `number`
***
### url?
[Section titled “url?”](#url)
> `optional` **url?**: `string`
Defined in: relay.ts:170
# PreparedTx
Defined in: signing.ts:56
## Properties
[Section titled “Properties”](#properties)
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: signing.ts:57
***
### gasLimit
[Section titled “gasLimit”](#gaslimit)
> **gasLimit**: `string`
Defined in: signing.ts:59
***
### gasPrice?
[Section titled “gasPrice?”](#gasprice)
> `optional` **gasPrice?**: `string`
Defined in: signing.ts:63
***
### maxFee
[Section titled “maxFee”](#maxfee)
> **maxFee**: `string`
Defined in: signing.ts:65
gasLimit × max fee, base units.
***
### maxFeePerGas?
[Section titled “maxFeePerGas?”](#maxfeepergas)
> `optional` **maxFeePerGas?**: `string`
Defined in: signing.ts:61
EIP-1559 fields, or `gasPrice` on legacy-fee chains. All 0x hex.
***
### maxPriorityFeePerGas?
[Section titled “maxPriorityFeePerGas?”](#maxpriorityfeepergas)
> `optional` **maxPriorityFeePerGas?**: `string`
Defined in: signing.ts:62
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `number`
Defined in: signing.ts:58
# QuoteRoutesOptions
Defined in: swap.ts:46
## Properties
[Section titled “Properties”](#properties)
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: swap.ts:51
#### Returns
[Section titled “Returns”](#returns)
`number`
***
### onUpdate?
[Section titled “onUpdate?”](#onupdate)
> `optional` **onUpdate?**: (`view`) => `void`
Defined in: swap.ts:47
#### Parameters
[Section titled “Parameters”](#parameters)
##### view
[Section titled “view”](#view)
[`RouteListView`](/api/anywalletkit/extension-kit/interfaces/routelistview/)
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### signal?
[Section titled “signal?”](#signal)
> `optional` **signal?**: `AbortSignal`
Defined in: swap.ts:50
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: swap.ts:49
Per-provider wall clock (default 20 s).
# RelayError
Defined in: relay.ts:28
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `number`
Defined in: relay.ts:30
EIP-1193 / EIP-1474 numbering for EVM; the same numbers are reused for the other providers.
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `unknown`
Defined in: relay.ts:32
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: relay.ts:31
# RelayErrorOptions
Defined in: router.ts:40
Options for [toRelayError](/api/anywalletkit/extension-kit/functions/torelayerror/).
## Properties
[Section titled “Properties”](#properties)
### log?
[Section titled “log?”](#log)
> `optional` **log?**: (`error`) => `void`
Defined in: router.ts:42
Gets every error that is NOT passed to the page, in full — the extension’s own log.
#### Parameters
[Section titled “Parameters”](#parameters)
##### error
[Section titled “error”](#error)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`void`
# RelayEvent
Defined in: relay.ts:95
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`RelayChain`](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
Defined in: relay.ts:97
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `unknown`
Defined in: relay.ts:99
***
### event
[Section titled “event”](#event)
> **event**: `string`
Defined in: relay.ts:98
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"event"`
Defined in: relay.ts:96
# RelayRequest
Defined in: relay.ts:78
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`RelayChain`](/api/anywalletkit/extension-kit/type-aliases/relaychain/)
Defined in: relay.ts:83
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: relay.ts:80
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"request"`
Defined in: relay.ts:79
***
### method
[Section titled “method”](#method)
> **method**: `string`
Defined in: relay.ts:84
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: relay.ts:82
`location.origin` of the page, stamped by the content script.
***
### params?
[Section titled “params?”](#params)
> `optional` **params?**: `unknown`
Defined in: relay.ts:85
# RelayResponse
Defined in: relay.ts:88
## Properties
[Section titled “Properties”](#properties)
### error?
[Section titled “error?”](#error)
> `optional` **error?**: [`RelayError`](/api/anywalletkit/extension-kit/interfaces/relayerror/)
Defined in: relay.ts:92
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: relay.ts:90
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"response"`
Defined in: relay.ts:89
***
### result?
[Section titled “result?”](#result)
> `optional` **result?**: `unknown`
Defined in: relay.ts:91
# RouteListView
Defined in: swap.ts:36
## Properties
[Section titled “Properties”](#properties)
### pending
[Section titled “pending”](#pending)
> **pending**: `string`\[]
Defined in: swap.ts:39
Providers still quoting.
***
### quotes
[Section titled “quotes”](#quotes)
> **quotes**: `Record`<`string`, [`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)>
Defined in: swap.ts:43
The quotes themselves, by provider, for execution with the same numbers the user saw.
***
### refusals
[Section titled “refusals”](#refusals)
> **refusals**: `Record`<`string`, `string`>
Defined in: swap.ts:41
Provider → why it sat out (refusal, error, timeout).
***
### routes
[Section titled “routes”](#routes)
> **routes**: [`RouteView`](/api/anywalletkit/extension-kit/interfaces/routeview/)\[]
Defined in: swap.ts:37
# RouterDeps
Defined in: router.ts:123
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`ApprovalQueue`](/api/anywalletkit/extension-kit/classes/approvalqueue/)
Defined in: router.ts:126
***
### defaultChain?
[Section titled “defaultChain?”](#defaultchain)
> `optional` **defaultChain?**: `string`
Defined in: router.ts:135
***
### networks
[Section titled “networks”](#networks)
> **networks**: [`NetworksTable`](/api/anywalletkit/extension-kit/classes/networkstable/)
Defined in: router.ts:125
***
### permissions
[Section titled “permissions”](#permissions)
> **permissions**: [`PermissionStore`](/api/anywalletkit/extension-kit/classes/permissionstore/)
Defined in: router.ts:124
## Methods
[Section titled “Methods”](#methods)
### accounts()
[Section titled “accounts()”](#accounts)
> **accounts**(): `Promise`<`string`\[]>
Defined in: router.ts:128
EVM addresses the wallet exposes, active account first. Empty when locked or without a wallet.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`\[]>
***
### emit()
[Section titled “emit()”](#emit)
> **emit**(`origin`, `event`, `data`): `void`
Defined in: router.ts:132
Push an EIP-1193 event to every page of `origin`.
#### Parameters
[Section titled “Parameters”](#parameters)
##### origin
[Section titled “origin”](#origin)
`string`
##### event
[Section titled “event”](#event)
`string`
##### data
[Section titled “data”](#data)
`unknown`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### refuse()?
[Section titled “refuse()?”](#refuse)
> `optional` **refuse**(`origin`): `string` | `null` | `undefined`
Defined in: router.ts:140
A reason to refuse every request from `origin` (reads, `eth_accounts`, an earlier permission included) with 4100, or nothing. Wire `PhishingDetector.refusal`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### origin
[Section titled “origin”](#origin-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`string` | `null` | `undefined`
***
### rpc()
[Section titled “rpc()”](#rpc)
> **rpc**(`network`, `method`, `params`): `Promise`<`unknown`>
Defined in: router.ts:130
Read-only JSON-RPC over the network’s own RPC list.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
##### method
[Section titled “method”](#method)
`string`
##### params
[Section titled “params”](#params)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`unknown`>
***
### sign()?
[Section titled “sign()?”](#sign)
> `optional` **sign**(`input`): `Promise`<`unknown`>
Defined in: router.ts:134
The review flow for signing methods. Absent → 4200.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### input
[Section titled “input”](#input)
###### accounts
[Section titled “accounts”](#accounts-1)
`string`\[]
###### method
[Section titled “method”](#method-1)
`string`
###### network
[Section titled “network”](#network-1)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
###### origin
[Section titled “origin”](#origin-2)
`string`
###### params
[Section titled “params”](#params-1)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`unknown`>
# RouteView
Defined in: swap.ts:24
## Properties
[Section titled “Properties”](#properties)
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: swap.ts:26
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: swap.ts:31
***
### feeNote?
[Section titled “feeNote?”](#feenote)
> `optional` **feeNote?**: `string`
Defined in: swap.ts:30
On-chain pool venues take the fee inside the output; “$0.00” would mislead.
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: swap.ts:28
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: swap.ts:27
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: swap.ts:25
***
### tags
[Section titled “tags”](#tags)
> **tags**: (`"best"` | `"fastest"`)\[]
Defined in: swap.ts:33
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: swap.ts:32
# SealedBox
Defined in: vault.ts:74
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: vault.ts:78
ciphertext ‖ 128-bit tag, base64.
***
### iv
[Section titled “iv”](#iv)
> **iv**: `string`
Defined in: vault.ts:76
96-bit AES-GCM nonce, base64.
# SessionAlarms
Defined in: session.ts:25
Structural `chrome.alarms`: one named alarm, fired once at `when` (ms since epoch).
## Methods
[Section titled “Methods”](#methods)
### clear()
[Section titled “clear()”](#clear)
> **clear**(`name`): `void` | `Promise`<`void`>
Defined in: session.ts:27
#### Parameters
[Section titled “Parameters”](#parameters)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`void` | `Promise`<`void`>
***
### onFire()
[Section titled “onFire()”](#onfire)
> **onFire**(`handler`): `void`
Defined in: session.ts:29
Register the lock callback; the chrome adapter wires `chrome.alarms.onAlarm`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### handler
[Section titled “handler”](#handler)
(`name`) => `void`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### schedule()
[Section titled “schedule()”](#schedule)
> **schedule**(`name`, `when`): `void` | `Promise`<`void`>
Defined in: session.ts:26
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### name
[Section titled “name”](#name-1)
`string`
##### when
[Section titled “when”](#when)
`number`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
# SessionOptions
Defined in: session.ts:32
## Properties
[Section titled “Properties”](#properties)
### alarms
[Section titled “alarms”](#alarms)
> **alarms**: [`SessionAlarms`](/api/anywalletkit/extension-kit/interfaces/sessionalarms/)
Defined in: session.ts:34
***
### autoLockMs?
[Section titled “autoLockMs?”](#autolockms)
> `optional` **autoLockMs?**: `number`
Defined in: session.ts:36
Lock this long after the last `touch` / `unlock`. Default 15 min; 0 disables the timer (lock only on browser exit or explicit lock; stored as `expiresAt: null`).
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: session.ts:38
Storage key and alarm name prefix.
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: session.ts:40
Clock, injectable for tests.
#### Returns
[Section titled “Returns”](#returns)
`number`
***
### storage
[Section titled “storage”](#storage)
> **storage**: [`SessionStorage`](/api/anywalletkit/extension-kit/interfaces/sessionstorage/)
Defined in: session.ts:33
# SessionStorage
Defined in: session.ts:18
Structural `chrome.storage.session` (or any `StorageArea`); `memorySessionStorage()` for tests.
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(`key`): `Promise`<`unknown`>
Defined in: session.ts:19
#### Parameters
[Section titled “Parameters”](#parameters)
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`key`): `Promise`<`void`>
Defined in: session.ts:21
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### set()
[Section titled “set()”](#set)
> **set**(`key`, `value`): `Promise`<`void`>
Defined in: session.ts:20
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### key
[Section titled “key”](#key-2)
`string`
##### value
[Section titled “value”](#value)
`unknown`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
# SignApproval
Defined in: signing.ts:69
The approval window’s payload for the three signing kinds.
## Properties
[Section titled “Properties”](#properties)
### network
[Section titled “network”](#network)
> **network**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: signing.ts:71
***
### prepared?
[Section titled “prepared?”](#prepared)
> `optional` **prepared?**: [`PreparedTx`](/api/anywalletkit/extension-kit/interfaces/preparedtx/)
Defined in: signing.ts:72
***
### preview
[Section titled “preview”](#preview)
> **preview**: `unknown`
Defined in: signing.ts:76
What the wallet attached (tx-preview-evm `TxPreview`, typed-data description…).
***
### repriced?
[Section titled “repriced?”](#repriced)
> `optional` **repriced?**: `true`
Defined in: signing.ts:74
A second sheet for the same transaction: the network’s fee outgrew the cap the first one showed.
***
### request
[Section titled “request”](#request)
> **request**: [`SignRequestInfo`](/api/anywalletkit/extension-kit/type-aliases/signrequestinfo/)
Defined in: signing.ts:70
# SignDeps
Defined in: signing.ts:86
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`ApprovalQueue`](/api/anywalletkit/extension-kit/classes/approvalqueue/)
Defined in: signing.ts:87
***
### tipFloor?
[Section titled “tipFloor?”](#tipfloor)
> `optional` **tipFloor?**: (`chainId`) => `bigint`
Defined in: signing.ts:94
Tip floor per chain id in wei (default 0.1 gwei everywhere).
#### Parameters
[Section titled “Parameters”](#parameters)
##### chainId
[Section titled “chainId”](#chainid)
`number`
#### Returns
[Section titled “Returns”](#returns)
`bigint`
## Methods
[Section titled “Methods”](#methods)
### preview()?
[Section titled “preview()?”](#preview)
> `optional` **preview**(`input`): `Promise`<`unknown`>
Defined in: signing.ts:92
Review data for the window (errors inside are the wallet’s to swallow → `null`).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### input
[Section titled “input”](#input)
###### accounts
[Section titled “accounts”](#accounts)
`string`\[]
###### network
[Section titled “network”](#network)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
###### request
[Section titled “request”](#request)
[`SignRequestInfo`](/api/anywalletkit/extension-kit/type-aliases/signrequestinfo/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`>
***
### rpc()
[Section titled “rpc()”](#rpc)
> **rpc**(`network`, `method`, `params`): `Promise`<`unknown`>
Defined in: signing.ts:88
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### network
[Section titled “network”](#network-1)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
##### method
[Section titled “method”](#method)
`string`
##### params
[Section titled “params”](#params)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`unknown`>
***
### signerFor()
[Section titled “signerFor()”](#signerfor)
> **signerFor**(`address`, `network`): `Promise`<{ `signer`: [`EvmSigner`](/api/anywalletkit/extension-kit/interfaces/evmsigner/); `dispose`: `void`; }>
Defined in: signing.ts:90
Opens the key for `address`; `dispose()` zeroizes it.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
##### network
[Section titled “network”](#network-2)
[`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `signer`: [`EvmSigner`](/api/anywalletkit/extension-kit/interfaces/evmsigner/); `dispose`: `void`; }>
# SiweContext
Defined in: siwe.ts:40
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: siwe.ts:44
The signing address.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: siwe.ts:46
The site’s chain.
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: `number`
Defined in: siwe.ts:47
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: siwe.ts:42
The page that asked, as the browser recorded it (`https://…`), or a transport pseudo-origin (`wc:`).
***
### via?
[Section titled “via?”](#via)
> `optional` **via?**: [`OriginVia`](/api/anywalletkit/extension-kit/interfaces/originvia/)
Defined in: siwe.ts:49
Transport note for pseudo-origins (WalletConnect): the dApp’s claimed URL and what Verify said about it.
# SiweInfo
Defined in: siwe.ts:32
## Properties
[Section titled “Properties”](#properties)
### malformed?
[Section titled “malformed?”](#malformed)
> `optional` **malformed?**: `boolean`
Defined in: siwe.ts:37
The header said “sign-in” but the rest did not parse as EIP-4361 (`message` then holds what could be read).
***
### message
[Section titled “message”](#message)
> **message**: [`SiweMessage`](/api/anywalletkit/extension-kit/interfaces/siwemessage/)
Defined in: siwe.ts:33
***
### problems
[Section titled “problems”](#problems)
> **problems**: `string`\[]
Defined in: siwe.ts:35
Human lines, each a reason the sheet should warn; empty = the sign-in is consistent with the request.
# SiweMessage
Defined in: siwe.ts:16
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: siwe.ts:19
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: siwe.ts:23
***
### domain
[Section titled “domain”](#domain)
> **domain**: `string`
Defined in: siwe.ts:18
As written in the header: `host[:port]`, optionally prefixed by `scheme://`.
***
### expirationTime?
[Section titled “expirationTime?”](#expirationtime)
> `optional` **expirationTime?**: `string`
Defined in: siwe.ts:26
***
### issuedAt
[Section titled “issuedAt”](#issuedat)
> **issuedAt**: `string`
Defined in: siwe.ts:25
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `string`
Defined in: siwe.ts:24
***
### notBefore?
[Section titled “notBefore?”](#notbefore)
> `optional` **notBefore?**: `string`
Defined in: siwe.ts:27
***
### requestId?
[Section titled “requestId?”](#requestid)
> `optional` **requestId?**: `string`
Defined in: siwe.ts:28
***
### resources
[Section titled “resources”](#resources)
> **resources**: `string`\[]
Defined in: siwe.ts:29
***
### statement?
[Section titled “statement?”](#statement)
> `optional` **statement?**: `string`
Defined in: siwe.ts:20
***
### uri
[Section titled “uri”](#uri)
> **uri**: `string`
Defined in: siwe.ts:21
***
### version
[Section titled “version”](#version)
> **version**: `string`
Defined in: siwe.ts:22
# StorageAreaLike
Defined in: chrome.ts:8
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(`keys`): `Promise`<`Record`<`string`, `unknown`>>
Defined in: chrome.ts:9
#### Parameters
[Section titled “Parameters”](#parameters)
##### keys
[Section titled “keys”](#keys)
`string` | `string`\[]
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`Record`<`string`, `unknown`>>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`keys`): `Promise`<`void`>
Defined in: chrome.ts:11
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### keys
[Section titled “keys”](#keys-1)
`string` | `string`\[]
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### set()
[Section titled “set()”](#set)
> **set**(`items`): `Promise`<`void`>
Defined in: chrome.ts:10
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### items
[Section titled “items”](#items)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### setAccessLevel()?
[Section titled “setAccessLevel()?”](#setaccesslevel)
> `optional` **setAccessLevel**(`options`): `Promise`<`void`>
Defined in: chrome.ts:13
`chrome.storage.session` only.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options)
###### accessLevel
[Section titled “accessLevel”](#accesslevel)
`"TRUSTED_CONTEXTS"` | `"TRUSTED_AND_UNTRUSTED_CONTEXTS"`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
# SwapApproval
Defined in: swap.ts:142
What the swap sheet renders. Amounts are base-unit strings.
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: `object`\[]
Defined in: swap.ts:156
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### spender
[Section titled “spender”](#spender)
> **spender**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### checks
[Section titled “checks”](#checks)
> **checks**: `object`\[]
Defined in: swap.ts:163
#### label
[Section titled “label”](#label)
> **label**: `string`
#### status
[Section titled “status”](#status)
> **status**: `"ok"` | `"warn"` | `"unknown"`
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: swap.ts:154
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: swap.ts:153
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: swap.ts:145
***
### fromChainName
[Section titled “fromChainName”](#fromchainname)
> **fromChainName**: `string`
Defined in: swap.ts:147
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: swap.ts:143
***
### providerLabel
[Section titled “providerLabel”](#providerlabel)
> **providerLabel**: `string`
Defined in: swap.ts:144
***
### receive
[Section titled “receive”](#receive)
> **receive**: `object`
Defined in: swap.ts:150
#### amount
[Section titled “amount”](#amount-1)
> **amount**: `string`
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### min
[Section titled “min”](#min)
> **min**: `string`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `object`
Defined in: swap.ts:151
#### address
[Section titled “address”](#address)
> **address**: `string`
#### isOwn
[Section titled “isOwn”](#isown)
> **isOwn**: `boolean`
***
### refundAddress
[Section titled “refundAddress”](#refundaddress)
> **refundAddress**: `string`
Defined in: swap.ts:152
***
### send
[Section titled “send”](#send)
> **send**: `object`
Defined in: swap.ts:149
#### amount
[Section titled “amount”](#amount-2)
> **amount**: `string`
#### decimals
[Section titled “decimals”](#decimals-1)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol-1)
> **symbol**: `string`
***
### source
[Section titled “source”](#source)
> **source**: { `data?`: `string`; `deposit?`: `string`; `kind`: `"call"`; `to`: `string`; `value`: `string`; } | { `amount`: `string`; `kind`: `"token-transfer"`; `memo?`: `string`; `recipient`: `string`; `token`: `string`; } | { `kind`: `"serialized"`; } | { `kind`: `"typed-order"`; `text`: `string`; `typedData`: [`TypedData`](/api/anywalletkit/extension-kit/interfaces/typeddata/); }
Defined in: swap.ts:157
***
### toChain
[Section titled “toChain”](#tochain)
> **toChain**: `string`
Defined in: swap.ts:146
***
### toChainName
[Section titled “toChainName”](#tochainname)
> **toChainName**: `string`
Defined in: swap.ts:148
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: swap.ts:155
# SwapRecord
Defined in: swaps.ts:19
## Properties
[Section titled “Properties”](#properties)
### amountIn
[Section titled “amountIn”](#amountin)
> **amountIn**: `string`
Defined in: swaps.ts:28
Base units.
***
### checks
[Section titled “checks”](#checks)
> **checks**: `number`
Defined in: swaps.ts:41
***
### claim?
[Section titled “claim?”](#claim)
> `optional` **claim?**: `object`
Defined in: swaps.ts:36
Two-phase routes: where and whether the claim can be built now.
#### chain
[Section titled “chain”](#chain)
> **chain**: `string`
#### ready
[Section titled “ready”](#ready)
> **ready**: `boolean`
***
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: swaps.ts:37
***
### depositReceived?
[Section titled “depositReceived?”](#depositreceived)
> `optional` **depositReceived?**: `boolean`
Defined in: swaps.ts:34
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: swaps.ts:29
***
### destTxHash
[Section titled “destTxHash”](#desttxhash)
> **destTxHash**: `string` | `null`
Defined in: swaps.ts:32
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: swaps.ts:23
***
### fromToken
[Section titled “fromToken”](#fromtoken)
> **fromToken**: `string`
Defined in: swaps.ts:25
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: swaps.ts:21
swap2 id — `awk1..[.[.]]`.
***
### lastError?
[Section titled “lastError?”](#lasterror)
> `optional` **lastError?**: `string`
Defined in: swaps.ts:40
Last tracker problem (RPC/API), kept until the next successful check.
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: swaps.ts:22
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: swaps.ts:30
***
### sourceTxHash
[Section titled “sourceTxHash”](#sourcetxhash)
> **sourceTxHash**: `string` | `null`
Defined in: swaps.ts:31
***
### status
[Section titled “status”](#status)
> **status**: [`SwapRecordStatus`](/api/anywalletkit/extension-kit/type-aliases/swaprecordstatus/)
Defined in: swaps.ts:33
***
### toChain
[Section titled “toChain”](#tochain)
> **toChain**: `string`
Defined in: swaps.ts:24
***
### toToken
[Section titled “toToken”](#totoken)
> **toToken**: `string`
Defined in: swaps.ts:26
***
### updatedAt
[Section titled “updatedAt”](#updatedat)
> **updatedAt**: `number`
Defined in: swaps.ts:38
# SwapReviewMeta
Defined in: swap.ts:125
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: swap.ts:129
The account that signs the plan: the gate passes the plan’s operations for this account only.
***
### fromChainName
[Section titled “fromChainName”](#fromchainname)
> **fromChainName**: `string`
Defined in: swap.ts:135
***
### fromDecimals
[Section titled “fromDecimals”](#fromdecimals)
> **fromDecimals**: `number`
Defined in: swap.ts:132
***
### fromSymbol
[Section titled “fromSymbol”](#fromsymbol)
> **fromSymbol**: `string`
Defined in: swap.ts:131
***
### origin
[Section titled “origin”](#origin)
> **origin**: `string`
Defined in: swap.ts:127
Who runs the flow (the wallet’s origin).
***
### own
[Section titled “own”](#own)
> **own**: `string`\[]
Defined in: swap.ts:138
All of the user’s addresses — recipient own/foreign.
***
### providerLabel
[Section titled “providerLabel”](#providerlabel)
> **providerLabel**: `string`
Defined in: swap.ts:130
***
### toChainName
[Section titled “toChainName”](#tochainname)
> **toChainName**: `string`
Defined in: swap.ts:136
***
### toDecimals
[Section titled “toDecimals”](#todecimals)
> **toDecimals**: `number`
Defined in: swap.ts:134
***
### toSymbol
[Section titled “toSymbol”](#tosymbol)
> **toSymbol**: `string`
Defined in: swap.ts:133
# SwapTrackerDeps
Defined in: swaps.ts:131
## Properties
[Section titled “Properties”](#properties)
### alarm
[Section titled “alarm”](#alarm)
> **alarm**: `object`
Defined in: swaps.ts:136
Start / stop the periodic alarm (`chrome.alarms.create(name, { periodInMinutes: 1 })`).
#### start()
[Section titled “start()”](#start)
> **start**(): `void` | `Promise`<`void`>
##### Returns
[Section titled “Returns”](#returns)
`void` | `Promise`<`void`>
#### stop()
[Section titled “stop()”](#stop)
> **stop**(): `void` | `Promise`<`void`>
##### Returns
[Section titled “Returns”](#returns-1)
`void` | `Promise`<`void`>
***
### giveUpAfterMs?
[Section titled “giveUpAfterMs?”](#giveupafterms)
> `optional` **giveUpAfterMs?**: `number`
Defined in: swaps.ts:139
No progress for this long → `expired` (default 48 h).
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: swaps.ts:137
#### Returns
[Section titled “Returns”](#returns-2)
`number`
***
### store
[Section titled “store”](#store)
> **store**: [`SwapsStore`](/api/anywalletkit/extension-kit/classes/swapsstore/)
Defined in: swaps.ts:132
## Methods
[Section titled “Methods”](#methods)
### status()
[Section titled “status()”](#status)
> **status**(`record`): `Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
Defined in: swaps.ts:134
The provider’s view of the swap (`CrossChainRouter.trackIntent`).
#### Parameters
[Section titled “Parameters”](#parameters)
##### record
[Section titled “record”](#record)
[`SwapRecord`](/api/anywalletkit/extension-kit/interfaces/swaprecord/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
# SwitchChainApproval
Defined in: router.ts:115
## Properties
[Section titled “Properties”](#properties)
### from
[Section titled “from”](#from)
> **from**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/) | `null`
Defined in: router.ts:116
***
### to
[Section titled “to”](#to)
> **to**: [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)
Defined in: router.ts:117
# TonAddressParts
Defined in: tonconnect.ts:100
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash)
> **hash**: `Uint8Array`
Defined in: tonconnect.ts:100
***
### workchain
[Section titled “workchain”](#workchain)
> **workchain**: `number`
Defined in: tonconnect.ts:100
# TonConnectMessage
Defined in: tonconnect.ts:46
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: tonconnect.ts:48
Destination, as given (friendly or raw).
***
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: tonconnect.ts:50
Nanotons, decimal string.
***
### payload?
[Section titled “payload?”](#payload)
> `optional` **payload?**: `string`
Defined in: tonconnect.ts:52
base64 BoC body.
***
### stateInit?
[Section titled “stateInit?”](#stateinit)
> `optional` **stateInit?**: `string`
Defined in: tonconnect.ts:54
base64 BoC state init.
# TonConnectRequest
Defined in: tonconnect.ts:29
## Properties
[Section titled “Properties”](#properties)
### manifestUrl
[Section titled “manifestUrl”](#manifesturl)
> **manifestUrl**: `string`
Defined in: tonconnect.ts:30
***
### proofPayload?
[Section titled “proofPayload?”](#proofpayload)
> `optional` **proofPayload?**: `string`
Defined in: tonconnect.ts:32
`ton_addr` always; `ton_proof` with the dApp’s payload when asked.
# TonConnectSendTransaction
Defined in: tonconnect.ts:57
## Properties
[Section titled “Properties”](#properties)
### from?
[Section titled “from?”](#from)
> `optional` **from?**: `string`
Defined in: tonconnect.ts:60
***
### messages
[Section titled “messages”](#messages)
> **messages**: [`TonConnectMessage`](/api/anywalletkit/extension-kit/interfaces/tonconnectmessage/)\[]
Defined in: tonconnect.ts:61
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
Defined in: tonconnect.ts:59
***
### validUntil?
[Section titled “validUntil?”](#validuntil)
> `optional` **validUntil?**: `number`
Defined in: tonconnect.ts:58
# TypedData
Defined in: signing.ts:49
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `Record`<`string`, `unknown`>
Defined in: signing.ts:50
***
### message
[Section titled “message”](#message)
> **message**: `Record`<`string`, `unknown`>
Defined in: signing.ts:52
***
### primaryType?
[Section titled “primaryType?”](#primarytype)
> `optional` **primaryType?**: `string`
Defined in: signing.ts:53
***
### types
[Section titled “types”](#types)
> **types**: `Record`<`string`, `object`\[]>
Defined in: signing.ts:51
# VaultEnvelopeV1
Defined in: vault.ts:81
## Properties
[Section titled “Properties”](#properties)
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: vault.ts:88
***
### dek
[Section titled “dek”](#dek)
> **dek**: [`SealedBox`](/api/anywalletkit/extension-kit/interfaces/sealedbox/)
Defined in: vault.ts:85
The DEK, sealed under the password-derived key. AAD = version + kdf.
***
### kdf
[Section titled “kdf”](#kdf)
> **kdf**: `object`
Defined in: vault.ts:83
#### iterations
[Section titled “iterations”](#iterations)
> **iterations**: `number`
#### name
[Section titled “name”](#name)
> **name**: `"PBKDF2-SHA256"`
#### salt
[Section titled “salt”](#salt)
> **salt**: `string`
***
### secrets
[Section titled “secrets”](#secrets)
> **secrets**: `Record`<`string`, [`SealedBox`](/api/anywalletkit/extension-kit/interfaces/sealedbox/)>
Defined in: vault.ts:87
One box per key source (keyring source id), sealed under the DEK. AAD `forgewallet-vault/secret/`.
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: vault.ts:82
# VaultEnvelopeV2
Defined in: vault.ts:104
## Properties
[Section titled “Properties”](#properties)
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: vault.ts:110
***
### dek
[Section titled “dek”](#dek)
> **dek**: [`SealedBox`](/api/anywalletkit/extension-kit/interfaces/sealedbox/)
Defined in: vault.ts:107
***
### kdf
[Section titled “kdf”](#kdf)
> **kdf**: `object`
Defined in: vault.ts:106
#### N
[Section titled “N”](#n)
> **N**: `number`
#### name
[Section titled “name”](#name)
> **name**: `"scrypt"`
#### p
[Section titled “p”](#p)
> **p**: `number`
#### r
[Section titled “r”](#r)
> **r**: `number`
#### salt
[Section titled “salt”](#salt)
> **salt**: `string`
***
### passkeys
[Section titled “passkeys”](#passkeys)
> **passkeys**: [`VaultPasskey`](/api/anywalletkit/extension-kit/interfaces/vaultpasskey/)\[]
Defined in: vault.ts:109
***
### rotatedAt?
[Section titled “rotatedAt?”](#rotatedat)
> `optional` **rotatedAt?**: `number`
Defined in: vault.ts:114
When [Vault.rotateVaultKey](/api/anywalletkit/extension-kit/classes/vault/#rotatevaultkey) last replaced the DEK.
***
### secrets
[Section titled “secrets”](#secrets)
> **secrets**: `Record`<`string`, [`SealedBox`](/api/anywalletkit/extension-kit/interfaces/sealedbox/)>
Defined in: vault.ts:108
***
### upgradedAt?
[Section titled “upgradedAt?”](#upgradedat)
> `optional` **upgradedAt?**: `number`
Defined in: vault.ts:112
When a v1 envelope was re-sealed as v2.
***
### v
[Section titled “v”](#v)
> **v**: `2`
Defined in: vault.ts:105
# VaultKdfInfo
Defined in: vault.ts:140
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `"scrypt"` | `"PBKDF2-SHA256"`
Defined in: vault.ts:142
***
### summary
[Section titled “summary”](#summary)
> **summary**: `string`
Defined in: vault.ts:144
Human line for the UI, e.g. “scrypt N=2^17 r=8 p=1”.
***
### version
[Section titled “version”](#version)
> **version**: `1` | `2`
Defined in: vault.ts:141
# VaultOptions
Defined in: vault.ts:126
## Properties
[Section titled “Properties”](#properties)
### crypto?
[Section titled “crypto?”](#crypto)
> `optional` **crypto?**: `Crypto`
Defined in: vault.ts:137
Defaults to `globalThis.crypto`; injectable for tests.
***
### iterations?
[Section titled “iterations?”](#iterations)
> `optional` **iterations?**: `number`
Defined in: vault.ts:131
PBKDF2 iterations for v1 envelopes (default and minimum [VAULT_DEFAULT_ITERATIONS](/api/anywalletkit/extension-kit/variables/vault_default_iterations/)).
***
### kdf?
[Section titled “kdf?”](#kdf)
> `optional` **kdf?**: `"scrypt"` | `"pbkdf2"`
Defined in: vault.ts:129
KDF for NEW envelopes and re-seals. Default scrypt (v2); `'pbkdf2'` writes v1 (tests, or a build that must stay FIPS-only).
***
### onProgress?
[Section titled “onProgress?”](#onprogress)
> `optional` **onProgress?**: (`fraction`) => `void`
Defined in: vault.ts:135
Progress of the scrypt derivation, 0..1 — the unlock screen’s bar.
#### Parameters
[Section titled “Parameters”](#parameters)
##### fraction
[Section titled “fraction”](#fraction)
`number`
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### scrypt?
[Section titled “scrypt?”](#scrypt)
> `optional` **scrypt?**: `object`
Defined in: vault.ts:133
scrypt cost for v2 envelopes (default [VAULT_SCRYPT](/api/anywalletkit/extension-kit/variables/vault_scrypt/); not below [VAULT_MIN_SCRYPT](/api/anywalletkit/extension-kit/variables/vault_min_scrypt/)).
#### N
[Section titled “N”](#n)
> **N**: `number`
#### p
[Section titled “p”](#p)
> **p**: `number`
#### r
[Section titled “r”](#r)
> **r**: `number`
***
### storage
[Section titled “storage”](#storage)
> **storage**: [`VaultStorage`](/api/anywalletkit/extension-kit/interfaces/vaultstorage/)
Defined in: vault.ts:127
# VaultPasskey
Defined in: vault.ts:91
## Properties
[Section titled “Properties”](#properties)
### alg?
[Section titled “alg?”](#alg)
> `optional` **alg?**: `number`
Defined in: vault.ts:101
COSE algorithm of `publicKey` (-7 = ES256).
***
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: vault.ts:95
***
### dek
[Section titled “dek”](#dek)
> **dek**: [`SealedBox`](/api/anywalletkit/extension-kit/interfaces/sealedbox/)
Defined in: vault.ts:97
The DEK sealed under HKDF(PRF output, salt = credential id). AAD = `forgewallet-vault/2/passkey/`.
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: vault.ts:93
WebAuthn credential id, base64url.
***
### label
[Section titled “label”](#label)
> **label**: `string`
Defined in: vault.ts:94
***
### publicKey?
[Section titled “publicKey?”](#publickey)
> `optional` **publicKey?**: `string`
Defined in: vault.ts:99
The credential’s public key (SPKI, base64) when the authenticator gave one — lets the worker verify assertions (passkey-per-signature).
# VaultStorage
Defined in: vault.ts:120
Where the envelope lives. `chromeLocalVaultStorage()` for the extension, `memoryVaultStorage()` for tests.
## Methods
[Section titled “Methods”](#methods)
### clear()
[Section titled “clear()”](#clear)
> **clear**(): `Promise`<`void`>
Defined in: vault.ts:123
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(): `Promise`<[`VaultEnvelope`](/api/anywalletkit/extension-kit/type-aliases/vaultenvelope/) | `null`>
Defined in: vault.ts:121
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`VaultEnvelope`](/api/anywalletkit/extension-kit/type-aliases/vaultenvelope/) | `null`>
***
### set()
[Section titled “set()”](#set)
> **set**(`envelope`): `Promise`<`void`>
Defined in: vault.ts:122
#### Parameters
[Section titled “Parameters”](#parameters)
##### envelope
[Section titled “envelope”](#envelope)
[`VaultEnvelope`](/api/anywalletkit/extension-kit/type-aliases/vaultenvelope/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
# ApprovalKind
> **ApprovalKind** = `"connect"` | `"switch-chain"` | `"add-chain"` | `"sign-message"` | `"sign-typed-data"` | `"send-transaction"` | `"solana-send"` | `"swap"` | `"earn"` | `"chain-send"` | `"tron-sign"` | `"btc-sign"` | `"near-sign"` | `"near-signin"` | `"wc-session"`
Defined in: approvals.ts:33
# AssertionVerdict
> **AssertionVerdict** = { `counter`: `number`; `ok`: `true`; } | { `ok`: `false`; `reason`: `string`; }
Defined in: webauthn.ts:43
# ChainAccountsKey
> **ChainAccountsKey** = `"solanaAccounts"` | `"tonAccounts"` | `"tronAccounts"` | `"btcAccounts"` | `"nearAccounts"`
Defined in: permissions.ts:27
# GatedOp
> **GatedOp** = { `caip2`: `string`; `data?`: `string`; `kind`: `"evm-tx"`; `to`: `string`; `value`: `bigint`; } | { `caip2`: `string`; `kind`: `"evm-typed-data"`; `typedDataHash`: `string`; } | { `amount`: `bigint`; `kind`: `"solana-transfer"`; `to`: `string`; `token?`: `string`; } | { `kind`: `"solana-tx"`; `to`: `string`; `value`: `bigint`; } | { `kind`: `"solana-serialized"`; `serializedTx`: `string`; } | { `kind`: `"solana-message"`; } | { `amount`: `bigint`; `chain`: `string`; `kind`: `"chain-tx"`; `memo?`: `string`; `to`: `string`; `token?`: `string`; } & `object`
Defined in: gate.ts:9
Pre-approvals — the second half of Vaulty’s `txGate` (mobile/lib/txGate.ts). A flow that reviewed a WHOLE plan in one sheet (a swap: approvals + source leg) registers one matcher per operation it is about to perform; the reviewed account then lets exactly those operations through without a second window, each once, within `ttlMs`, and only for the account that reviewed the plan. Anything else still stops at the review.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: `string`
The account about to sign or send. A pre-approval bound to an account passes only ops that name it.
# GateMatcher
> **GateMatcher** = (`op`) => `boolean`
Defined in: gate.ts:25
## Parameters
[Section titled “Parameters”](#parameters)
### op
[Section titled “op”](#op)
[`GatedOp`](/api/anywalletkit/extension-kit/type-aliases/gatedop/)
## Returns
[Section titled “Returns”](#returns)
`boolean`
# PermissionsState
> **PermissionsState** = `Record`<`string`, [`OriginPermission`](/api/anywalletkit/extension-kit/interfaces/originpermission/)>
Defined in: permissions.ts:25
# RecipientsState
> **RecipientsState** = `Record`<`string`, `string`\[]>
Defined in: poison.ts:11
# RelayChain
> **RelayChain** = `"eip155"` | `"solana"` | `"ton"` | `"tron"` | `"bip122"` | `"near"`
Defined in: relay.ts:26
CAIP-2 namespace of the provider that spoke.
# RelayToContent
> **RelayToContent** = [`RelayResponse`](/api/anywalletkit/extension-kit/interfaces/relayresponse/) | [`RelayEvent`](/api/anywalletkit/extension-kit/interfaces/relayevent/)
Defined in: relay.ts:103
# RelayToWorker
> **RelayToWorker** = [`RelayRequest`](/api/anywalletkit/extension-kit/interfaces/relayrequest/)
Defined in: relay.ts:102
# SignRequestInfo
> **SignRequestInfo** = { `account`: `string`; `kind`: `"sign-message"`; `method`: `"personal_sign"`; `raw`: `string`; `siwe?`: [`SiweInfo`](/api/anywalletkit/extension-kit/interfaces/siweinfo/); `text`: `string`; } | { `account`: `string`; `kind`: `"sign-typed-data"`; `method`: `string`; `text`: `string`; `typedData`: [`TypedData`](/api/anywalletkit/extension-kit/interfaces/typeddata/); } | { `account`: `string`; `kind`: `"send-transaction"`; `method`: `"eth_sendTransaction"`; `tx`: { `data`: `string` | `null`; `gas`: `string` | `null`; `to`: `string`; `value`: `string`; }; }
Defined in: signing.ts:44
# SwapRecordStatus
> **SwapRecordStatus** = [`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)\[`"state"`] | `"claiming"`
Defined in: swaps.ts:17
# TonSignDataPayload
> **TonSignDataPayload** = { `text`: `string`; `type`: `"text"`; } | { `bytes`: `string`; `type`: `"binary"`; }
Defined in: tonconnect.ts:88
# VaultEnvelope
> **VaultEnvelope** = [`VaultEnvelopeV1`](/api/anywalletkit/extension-kit/interfaces/vaultenvelopev1/) | [`VaultEnvelopeV2`](/api/anywalletkit/extension-kit/interfaces/vaultenvelopev2/)
Defined in: vault.ts:117
# VaultErrorCode
> **VaultErrorCode** = `"wrong-password"` | `"exists"` | `"missing"` | `"unsupported-envelope"` | `"locked"` | `"invalid-input"` | `"weak-kdf"`
Defined in: errors.ts:11
# ACTIVE_STATUSES
> `const` **ACTIVE_STATUSES**: `ReadonlySet`<[`SwapRecordStatus`](/api/anywalletkit/extension-kit/type-aliases/swaprecordstatus/)>
Defined in: swaps.ts:44
# APPROVALS_MAX_PENDING_PER_ORIGIN
> `const` **APPROVALS_MAX_PENDING_PER_ORIGIN**: `3` = `3`
Defined in: approvals.ts:63
# BTC_CHAIN
> `const` **BTC_CHAIN**: `"bitcoin:mainnet"` = `'bitcoin:mainnet'`
Defined in: networks.ts:194
# BTC_ESPLORA
> `const` **BTC_ESPLORA**: readonly `string`\[]
Defined in: networks.ts:195
# CHAIN_ACCOUNT_KEYS
> `const` **CHAIN_ACCOUNT_KEYS**: readonly [`ChainAccountsKey`](/api/anywalletkit/extension-kit/type-aliases/chainaccountskey/)\[]
Defined in: permissions.ts:28
# DEFAULT_CHAIN
> `const` **DEFAULT_CHAIN**: `"eip155:1"` = `'eip155:1'`
Defined in: networks.ts:28
# DEFAULT_NETWORKS
> `const` **DEFAULT_NETWORKS**: readonly [`EvmNetwork`](/api/anywalletkit/extension-kit/interfaces/evmnetwork/)\[]
Defined in: networks.ts:33
# FLOOR_TOLERANCE_BPS
> `const` **FLOOR_TOLERANCE_BPS**: `50n` = `50n`
Defined in: swap.ts:117
Vaulty’s execution floor: 50 bps under the quoted minimum rides normal drift while the user reviews, still refuses a real reprice.
# KEYRING_STORAGE_KEY
> `const` **KEYRING_STORAGE_KEY**: `"forgewallet.keyring.v1"` = `'forgewallet.keyring.v1'`
Defined in: keyring.ts:24
Stable storage key: existing keyrings live under it — never rename.
# LOOKALIKE_PREFIX
> `const` **LOOKALIKE_PREFIX**: `4` = `4`
Defined in: poison.ts:14
How many characters at each end must match (after any `0x`).
# LOOKALIKE_SUFFIX
> `const` **LOOKALIKE_SUFFIX**: `4` = `4`
Defined in: poison.ts:15
# NEAR_CHAIN
> `const` **NEAR_CHAIN**: `"near:mainnet"` = `'near:mainnet'`
Defined in: networks.ts:196
# NEAR_PROVIDERS
> `const` **NEAR_PROVIDERS**: readonly `string`\[]
Defined in: networks.ts:197
# NON_EVM_CHAINS
> `const` **NON_EVM_CHAINS**: readonly [`ChainDescriptor`](/api/anywalletkit/extension-kit/interfaces/chaindescriptor/)\[]
Defined in: networks.ts:212
# PAGE_TARGET
> `const` **PAGE_TARGET**: `object`
Defined in: relay.ts:23
`window.postMessage` discriminators (both directions).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### toContent
[Section titled “toContent”](#tocontent)
> `readonly` **toContent**: `"anywalletkit/content"` = `'anywalletkit/content'`
### toPage
[Section titled “toPage”](#topage)
> `readonly` **toPage**: `"anywalletkit/page"` = `'anywalletkit/page'`
# PORT_NAME
> `const` **PORT_NAME**: `"anywalletkit/relay/1"` = `'anywalletkit/relay/1'`
Defined in: relay.ts:21
`chrome.runtime.connect({ name })` for content-script ports.
# READ_METHODS
> `const` **READ_METHODS**: `ReadonlySet`<`string`>
Defined in: router.ts:102
Read-only methods answered from our RPC without asking the user.
# RELAY_ERRORS
> `const` **RELAY_ERRORS**: `object`
Defined in: relay.ts:35
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### chainDisconnected
[Section titled “chainDisconnected”](#chaindisconnected)
> `readonly` **chainDisconnected**: `4901` = `4901`
### chainNotAdded
[Section titled “chainNotAdded”](#chainnotadded)
> `readonly` **chainNotAdded**: `4902` = `4902`
EIP-3326/3085: the chain is not in the wallet (`wallet_switchEthereumChain` → suggest `wallet_addEthereumChain`).
### disconnected
[Section titled “disconnected”](#disconnected)
> `readonly` **disconnected**: `4900` = `4900`
### internal
[Section titled “internal”](#internal)
> `readonly` **internal**: `-32603` = `-32603`
### invalidParams
[Section titled “invalidParams”](#invalidparams)
> `readonly` **invalidParams**: `-32602` = `-32602`
### invalidRequest
[Section titled “invalidRequest”](#invalidrequest)
> `readonly` **invalidRequest**: `-32600` = `-32600`
### limitExceeded
[Section titled “limitExceeded”](#limitexceeded)
> `readonly` **limitExceeded**: `-32005` = `-32005`
EIP-1474: this origin has too many requests waiting.
### resourceUnavailable
[Section titled “resourceUnavailable”](#resourceunavailable)
> `readonly` **resourceUnavailable**: `-32002` = `-32002`
EIP-1474: a request of the same kind from this origin is already waiting (MetaMask’s “already pending”).
### unauthorized
[Section titled “unauthorized”](#unauthorized)
> `readonly` **unauthorized**: `4100` = `4100`
### unsupportedMethod
[Section titled “unsupportedMethod”](#unsupportedmethod)
> `readonly` **unsupportedMethod**: `4200` = `4200`
### userRejected
[Section titled “userRejected”](#userrejected)
> `readonly` **userRejected**: `4001` = `4001`
# RELAY_METHOD_MAX
> `const` **RELAY_METHOD_MAX**: `128` = `128`
Defined in: relay.ts:112
Longest method name a request may carry.
# SESSION_DEFAULT_AUTOLOCK_MS
> `const` **SESSION_DEFAULT_AUTOLOCK_MS**: `number`
Defined in: session.ts:49
# SIGNING_METHODS
> `const` **SIGNING_METHODS**: `ReadonlySet`<`string`>
Defined in: router.ts:109
Methods that produce a signature — the review flow’s business (step 4), never answered here.
# SOLANA_CHAIN
> `const` **SOLANA_CHAIN**: `"solana:mainnet"` = `'solana:mainnet'`
Defined in: networks.ts:188
Solana mainnet as the catalog names it (`solana:mainnet`); the wallet package also accepts the genesis-hash form.
# SOLANA_RPCS
> `const` **SOLANA_RPCS**: readonly `string`\[]
Defined in: networks.ts:189
# TON_CHAIN
> `const` **TON_CHAIN**: `"ton:-239"` = `'ton:-239'`
Defined in: networks.ts:190
# TON_ENDPOINTS
> `const` **TON_ENDPOINTS**: readonly `string`\[]
Defined in: networks.ts:191
# TONCONNECT_ERRORS
> `const` **TONCONNECT_ERRORS**: `object`
Defined in: tonconnect.ts:23
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### badRequest
[Section titled “badRequest”](#badrequest)
> `readonly` **badRequest**: `1` = `1`
### manifestContent
[Section titled “manifestContent”](#manifestcontent)
> `readonly` **manifestContent**: `3` = `3`
### manifestNotFound
[Section titled “manifestNotFound”](#manifestnotfound)
> `readonly` **manifestNotFound**: `2` = `2`
### methodNotSupported
[Section titled “methodNotSupported”](#methodnotsupported)
> `readonly` **methodNotSupported**: `400` = `400`
### unknown
[Section titled “unknown”](#unknown)
> `readonly` **unknown**: `0` = `0`
### unknownApp
[Section titled “unknownApp”](#unknownapp)
> `readonly` **unknownApp**: `100` = `100`
### userDeclined
[Section titled “userDeclined”](#userdeclined)
> `readonly` **userDeclined**: `300` = `300`
# TONCONNECT_MAX_MESSAGES
> `const` **TONCONNECT_MAX_MESSAGES**: `4` = `4`
Defined in: tonconnect.ts:64
# TRON_CHAIN
> `const` **TRON_CHAIN**: `"tron:728126428"` = `'tron:728126428'`
Defined in: networks.ts:192
# TRON_PROVIDERS
> `const` **TRON_PROVIDERS**: readonly `string`\[]
Defined in: networks.ts:193
# VAULT_DEFAULT_ITERATIONS
> `const` **VAULT_DEFAULT_ITERATIONS**: `600000` = `600_000`
Defined in: vault.ts:40
# VAULT_LIMITS
> `const` **VAULT_LIMITS**: `Readonly`<{ `boxChars`: `number`; `envelopeChars`: `number`; `iterations`: `5000000`; `passkeys`: `32`; `scrypt`: `Readonly`<{ `N`: `number`; `p`: `4`; `r`: `16`; }>; `secretBytes`: `number`; `secrets`: `1000`; }>
Defined in: vault.ts:52
Upper bounds on what an envelope (and the options) may carry, checked before any KDF runs: an envelope edited on disk must not make unlock hang (PBKDF2 iterations) or exhaust the worker’s memory (scrypt N × r), and its size stays within what `chrome.storage.local` holds.
# VAULT_MIN_ITERATIONS
> `const` **VAULT_MIN_ITERATIONS**: `600000` = `600_000`
Defined in: vault.ts:39
PBKDF2-SHA256 iterations (v1 envelopes): OWASP 2023 floor for SHA-256; anything lower is refused.
# VAULT_MIN_PASSWORD_LENGTH
> `const` **VAULT_MIN_PASSWORD_LENGTH**: `8` = `8`
Defined in: vault.ts:46
Shortest password `create` / `changePassword` accept. `unlock` takes whatever opens the vault.
# VAULT_MIN_SCRYPT
> `const` **VAULT_MIN_SCRYPT**: `object`
Defined in: vault.ts:44
The weakest scrypt an envelope may carry and still open (16 MiB). Tests use this; `create` uses [VAULT_SCRYPT](/api/anywalletkit/extension-kit/variables/vault_scrypt/).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### N
[Section titled “N”](#n)
> `readonly` **N**: `number`
### p
[Section titled “p”](#p)
> `readonly` **p**: `1` = `1`
### r
[Section titled “r”](#r)
> `readonly` **r**: `8` = `8`
# VAULT_SCRYPT
> `const` **VAULT_SCRYPT**: `object`
Defined in: vault.ts:42
scrypt for v2 envelopes: OWASP’s recommended cost (128 MiB, \~1 s in a service worker).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### N
[Section titled “N”](#n)
> `readonly` **N**: `number`
### p
[Section titled “p”](#p)
> `readonly` **p**: `1` = `1`
### r
[Section titled “r”](#r)
> `readonly` **r**: `8` = `8`
# VAULT_STORAGE_KEY
> `const` **VAULT_STORAGE_KEY**: `"forgewallet.vault.v1"` = `'forgewallet.vault.v1'`
Defined in: chrome.ts:23
Stable storage key: existing vaults live under it — never rename.
# ZCASH_BLOCKCHAIR
> `const` **ZCASH_BLOCKCHAIR**: `"https://api.blockchair.com/zcash"` = `'https://api.blockchair.com/zcash'`
Defined in: networks.ts:200
# ZCASH_CHAIN
> `const` **ZCASH_CHAIN**: `"zcash:mainnet"` = `'zcash:mainnet'`
Defined in: networks.ts:199
Zcash transparent (t1…) accounts over Blockchair’s public API, as `@anywalletkit/wallet-zcash` reads and broadcasts them.
# @anywalletkit/history-evm
# @anywalletkit/history-evm
[Section titled “@anywalletkit/history-evm”](#anywalletkithistory-evm)
[](https://www.npmjs.com/package/@anywalletkit/history-evm)
`HistorySource` for every EVM chain the SDK supports. One source per chain (`chain = "eip155:"`), backed by Etherscan v2 when you have an API key, Blockscout PRO and Alchemy (Transfers API) with theirs, and keyless fallbacks (Blockscout `/api/v2`, Routescan’s Etherscan-format mirror) where a public instance exists. Explorer rows are merged into one `ChainTx` per hash: top-level transaction, ERC-20 transfers and internal native transfers, with fee, status, call selector and a documented spam flag.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/history-evm @anywalletkit/core
# or: pnpm add @anywalletkit/history-evm @anywalletkit/core · yarn add @anywalletkit/history-evm @anywalletkit/core
```
On npm: [@anywalletkit/history-evm](https://www.npmjs.com/package/@anywalletkit/history-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import { createEvmHistory } from '@anywalletkit/history-evm'
const history = createEvmHistory({ chainId: 8453, etherscanApiKey: process.env.ETHERSCAN_API_KEY })
const page = await history.listActivity('0x8AbE813577E47415A3CD0Bbc68c7ABCa2c4c55bA', { limit: 50 })
for (const tx of page.items) console.log(tx.hash, tx.status, tx.transfers.length, tx.spam ? 'spam' : '')
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://basescan.org/tx/0x…
```
## Options
[Section titled “Options”](#options)
| option | default | notes |
| --------------------------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chainId` | — | 1, 8453, 42161, 10, 137, 56, 43114, 100, 130, 143, 999, 146, 80094, 59144, 534352, 324, 42220, 9745, 4326, 4663, 480, 1329, 57073, 98866, 196 |
| `etherscanApiKey` | none | Without it Etherscan is never called: since 2026 `api.etherscan.io/v2` answers `Missing/Invalid API Key` to keyless requests. |
| `etherscanUrl` | `https://api.etherscan.io/v2/api` | Point at a proxy that adds the key server-side. |
| `blockscoutProApiKey` | none | Blockscout PRO multichain key (`proapi_…`; free tier 100K credits/day, 5 rps, one key for every Blockscout chain). Etherscan-format with `chain_id=`; tried after Etherscan, so a free Etherscan key + a free PRO key together cover Base, Arbitrum, Polygon, Optimism, Gnosis, Robinhood, Arc, Scroll, zkSync, Ink, Plume without a paid plan. Register at docs.blockscout.com/devs/pro-api. |
| `blockscoutProUrl` / `blockscoutProRateLimit` | `https://api.blockscout.com/v2/api` / 5 | Override the endpoint (proxy) / the per-key limiter. |
| `alchemyApiKey` | none | Alchemy key (free tier: 30M CU/month, no card). Enables the `alchemy` backend: `alchemy_getAssetTransfers` lists + one JSON-RPC batch of `eth_getTransactionByHash`/`eth_getTransactionReceipt` per page. The only free source on **Base** and **BSC**; also a second source for Monad, Berachain, Linea, HyperEVM and Robinhood, which otherwise depend on Etherscan alone. Tried after Etherscan and Blockscout PRO. **Every network must be enabled for the app in the Alchemy dashboard** (see below). |
| `alchemyNetwork` | `ALCHEMY_NETWORKS[chainId]` when the Transfers API is documented for the chain | Slug override (`base-mainnet`). Passing it also forces the backend on for a chain the table lists as undocumented (Sonic, Plasma, MegaETH, Sei, Plume, X Layer). |
| `alchemyUrl` | `https://{network}.g.alchemy.com/v2/{key}` | Host template for a proxy; `{network}` / `{key}` substituted. |
| `alchemyComputeUnitsPerSecond` | 300 | Alchemy compute units per second, shared per key across chains. Each call is charged its published cost (Transfers 120, receipt 20, tx 17, block 16, else 26) and a JSON-RPC batch the sum of its members, so concurrent chains on one key stay under the free tier’s 500 CU/s. A rate-limit answer is retried up to three times with backoff. |
| `blockscoutUrl` | built-in table | Any Blockscout `/api/v2` root; adds or overrides the chain’s entry. |
| `etherscanCompatUrl` | built-in table (Routescan) | Keyless Etherscan-format endpoint. |
| `fetch` | `globalThis.fetch` | Inject for tests / custom transports. |
| `rateLimit` | 3 rps with a key | Etherscan requests per second (free tier 3, Lite 5, Standard 10). One token bucket per key is shared by every source in the process (25 chains do not multiply the quota). Blockscout: 5 rps per host, Routescan: 2 rps. |
| `prefer` | `'etherscan'` | `'blockscout'` tries Blockscout first to save Etherscan quota; `'alchemy'` tries Alchemy first (Base, where it is the only free one, or to spend Alchemy CU instead of Etherscan calls). |
| `timeoutMs` | 15 000 | Per request (`AbortSignal.timeout` when the runtime has it). |
Backend order: Etherscan v2 (key + chain in the v2 chainlist) → Blockscout PRO (key) → Alchemy (key + documented Transfers API, or `alchemyNetwork`) → Routescan → Blockscout. `prefer` moves Blockscout or Alchemy first. A failing backend is retried once on rate limiting (HTTP 429/5xx, `Max rate limit reached`), then the next backend is tried. Plan / key refusals (`Free API access is not supported for this chain`, `Missing/Invalid API Key`, `Community Free API Limit reached`, unsupported chainid, Blockscout PRO `Unauthorized` / `Featured chain`, Alchemy ` is not enabled for this app` / HTTP 401 / 403 / `Unsupported method`) skip straight to the fallback. When nothing is left the source throws `HistoryUnavailableError` with `chain`, `reason` and one line per `attempts`. Chains in `NO_EXPLORER_CHAIN_IDS` return an empty page with a `note` instead.
The Etherscan v2 chainlist (`/v2/chainlist`) is fetched once per process and cached; when it cannot be fetched the table verified on 2026-10-14 is used.
## Chain coverage (verified with curl on 2026-10-14)
[Section titled “Chain coverage (verified with curl on 2026-10-14)”](#chain-coverage-verified-with-curl-on-2026-10-14)
With a **Blockscout PRO** key (verified live with a free-tier key on 2026-10-14): served on 1, 10, 100, 130, 534352, 42220, 4326, 4663, 480, 57073, 98866, 5042 and **42161 (Arbitrum)**. “Featured” chains need the Builder plan ($49/mo): **8453 Base, 137 Polygon, 324 zkSync** (`{"error":"Featured chain … requires one of the following plans: Builder, Business, Pro"}` → classified unavailable, falls through). “Network not supported”: 56, 43114, 143, 999, 146, 80094, 59144, 9745, 1329, 196, 5000, 747474, 2818, 14. Net effect with a free Etherscan key + a free PRO key: everything has a free source except **Base** (paid Etherscan or Blockscout Builder), **BSC**, **X Layer** and **Morph** — add a free **Alchemy** key (section below) and Base and BSC are covered too; only X Layer (and Sonic / Plasma / MegaETH / Sei / Plume, where Alchemy has no Transfers API) stay on Etherscan alone.
Probe used for Blockscout: `GET /api/v2/addresses/0x8AbE813577E47415A3CD0Bbc68c7ABCa2c4c55bA/transactions` and `/api/v2/transactions`, kept only when both answer `200` JSON.
| chain | id | Etherscan v2 | keyless fallback | notes |
| ----------------- | ------ | ------------------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| Ethereum | 1 | yes (free plan ok) | Blockscout `eth.blockscout.com`, Routescan | |
| Base | 8453 | yes, **paid plan only** | none | `base.blockscout.com` is behind a Cloudflare JS challenge (403) |
| Arbitrum One | 42161 | yes (free plan ok) | none | `arbitrum.blockscout.com` 403 (Cloudflare) |
| OP Mainnet | 10 | yes, **paid plan only** | Blockscout `explorer.optimism.io` | |
| Polygon | 137 | yes (free plan ok) | none | `polygon.blockscout.com` 403 (Cloudflare) |
| BNB Smart Chain | 56 | yes, **paid plan only** | none | no public Blockscout found |
| Avalanche C-Chain | 43114 | yes, **paid plan only** | Routescan | |
| Gnosis | 100 | yes, **paid plan only** | Blockscout-compatible `gnosisscan.io` | `gnosis.blockscout.com` redirects there |
| Unichain | 130 | yes | Blockscout `unichain.blockscout.com` | |
| Monad | 143 | yes | none | |
| HyperEVM | 999 | yes (free plan ok) | none | |
| Sonic | 146 | yes | none | |
| Berachain | 80094 | yes | none | `beratrail.io` (Routescan UI) answers 202, no JSON |
| Linea | 59144 | yes | none | `explorer.linea.build` has no `/api/v2` |
| Scroll | 534352 | **no** (not in chainlist) | Blockscout-compatible `scrollscan.com` | `scroll.blockscout.com` redirects there |
| zkSync Era | 324 | **no** | Blockscout `zksync.blockscout.com` | |
| Celo | 42220 | yes, community quota | Blockscout `celo.blockscout.com` | |
| Plasma | 9745 | yes | Routescan | |
| MegaETH | 4326 | yes | Blockscout `megaeth.blockscout.com` | |
| Robinhood Chain | 4663 | yes (free plan ok) | none | |
| World Chain | 480 | yes | Blockscout `worldchain-mainnet.explorer.alchemy.com` | |
| Sei | 1329 | yes | none | `seitrace.com` has its own API |
| Ink | 57073 | **no** | Blockscout `explorer.inkonchain.com` | |
| Plume | 98866 | **no** | Blockscout `explorer.plume.org` | |
| X Layer | 196 | **no** | **none** | only OKLink (own API, key); empty page + `note` |
“free plan ok” = a free-tier key returned rows (or `No transactions found`) that day; “paid plan only” = `Free API access is not supported for this chain`. Chains marked “yes” without a qualifier were served but the test wallet has no history there, so the plan tier could not be told apart. Without a key, the chains with “none” in the fallback column throw `HistoryUnavailableError` (`no keyless explorer; pass etherscanApiKey`).
## Alchemy backend (`backend: 'alchemy'`)
[Section titled “Alchemy backend (backend: 'alchemy')”](#alchemy-backend-backend-alchemy)
`alchemy_getAssetTransfers` is called twice per page — `fromAddress` and `toAddress` — with `category: ['external', 'erc20']` (+ `'internal'` on the chains in `ALCHEMY_INTERNAL_CHAIN_IDS`), `order: 'desc'`, `withMetadata: true` (block timestamps), `excludeZeroValue: false` (zero-value address-poisoning transfers are what the spam rule flags; Alchemy hides them by default) and `maxCount = limit`. Transfers are de-duplicated by `uniqueId`, grouped by hash, and the Transfers API’s gaps are filled from the same endpoint: every unique hash of the page gets `eth_getTransactionByHash` + `eth_getTransactionReceipt` in **one JSON-RPC batch** (≤ 20 requests per HTTP call, one retry) → `from`, `to`, `value`, `input` → `call.selector`, `status`, `fee = gasUsed × effectiveGasPrice`. Blocks whose transfers carried no `metadata.blockTimestamp` get an `eth_getBlockByNumber` in that batch.
Merge rules (mirroring the Etherscan `txlist` + `tokentx` + `txlistinternal` merge): `erc20` rows → token transfers (symbol = `asset`, decimals = `rawContract.decimal`, amount = `rawContract.value`); `internal` rows → native transfers; `external` rows are the transaction’s own value and are already the tx row’s `nativeValue` — they add no second native transfer. Only when the node has no such tx any more (dropped / reorged, `null` from the batch) is the external row turned into a bare tx row (`status: confirmed`, no fee) so the item still renders. ERC-721 / 1155 / special-NFT rows are skipped (v1). `getTransaction(hash)` = the same batch for one hash + ERC-20 `Transfer` logs of the receipt + `eth_getBlockByNumber` for the time.
**Pagination is by block, not by `pageKey`.** Measured on base-mainnet on 2026-10-14: a request that carries a `pageKey` ignores `toBlock`; an unknown or expired `pageKey` (TTL 10 minutes) silently restarts from the first page; a malformed one is HTTP 400 `Invalid pageKey format`. None of that fits a cursor that is resumed hours later or re-fetched with a narrower window, so the Alchemy lists page exactly like the Etherscan ones — `toBlock = w − 1` from the window cursor, `next` is a marker — and an Alchemy cursor never expires.
**Budget.** 120 CU per Transfers call, 15 CU per `eth_getTransactionByHash`, 15 CU per `eth_getTransactionReceipt`: a 50-item page ≈ 2 × 120 + 50 × 30 ≈ 1 740 CU, so the free 30M CU/month is ≈ 17 000 pages (≈ 570 a day); a `getTransaction` ≈ 45–60 CU. Throughput on the free tier is 500 CU/s, hence the 4 rps advice above.
**Gotcha: enable the network in the Alchemy app.** A new app has only the networks you tick in the dashboard (Apps → your app → Networks). Every other slug answers HTTP 403 `{"error":{"code":-32600,"message":"BNB_MAINNET is not enabled for this app. Visit this page to enable the network: …"}}` — classified `unavailable`, no retry, next backend. Verified 2026-10-14 with a free key: `eth-mainnet` and `base-mainnet` answered (including the `internal` category on both); every other slug below answered “not enabled” until ticked.
Slug table (`ALCHEMY_NETWORKS`; verified 2026-10-14 by `eth_chainId` on every slug — an existing slug answers the chain id or “not enabled”, a non-existent one does not resolve). “Transfers API” = the chain’s docs page `https://www.alchemy.com/rpc/.md` lists it under “Supported on …” (`ALCHEMY_TRANSFERS_CHAIN_IDS`); “internal” = the `internal` category per docs (“available only on Ethereum Mainnet, Polygon Mainnet, Base Mainnet, Arc Mainnet, and Arc Testnet”; `ALCHEMY_INTERNAL_CHAIN_IDS`).
| chain | id | slug | Transfers API documented | `internal` category |
| ----------------- | ------ | --------------------- | ---------------------------------- | ------------------- |
| Ethereum | 1 | `eth-mainnet` | yes | yes (verified live) |
| Base | 8453 | `base-mainnet` | yes | yes (verified live) |
| Arbitrum One | 42161 | `arb-mainnet` | yes | no |
| OP Mainnet | 10 | `opt-mainnet` | yes | no |
| Polygon PoS | 137 | `polygon-mainnet` | yes (`/rpc/matic.md`) | yes (docs) |
| BNB Smart Chain | 56 | `bnb-mainnet` | yes | no |
| Avalanche C-Chain | 43114 | `avax-mainnet` | yes | no |
| Gnosis | 100 | `gnosis-mainnet` | yes | no |
| Unichain | 130 | `unichain-mainnet` | yes | no |
| Monad | 143 | `monad-mainnet` | yes | no |
| HyperEVM | 999 | `hyperliquid-mainnet` | yes | no |
| Sonic | 146 | `sonic-mainnet` | **no** (“Not currently supported”) | no |
| Berachain | 80094 | `berachain-mainnet` | yes | no |
| Linea | 59144 | `linea-mainnet` | yes | no |
| Scroll | 534352 | `scroll-mainnet` | yes | no |
| zkSync Era | 324 | `zksync-mainnet` | yes | no |
| Celo | 42220 | `celo-mainnet` | yes | no |
| Plasma | 9745 | `plasma-mainnet` | **no** | no |
| MegaETH | 4326 | `megaeth-mainnet` | **no** | no |
| Robinhood Chain | 4663 | `robinhood-mainnet` | yes | no |
| World Chain | 480 | `worldchain-mainnet` | yes | no |
| Sei | 1329 | `sei-mainnet` | **no** | no |
| Ink | 57073 | `ink-mainnet` | yes | no |
| Plume | 98866 | `plume-mainnet` | **no** (no Alchemy docs page) | no |
| X Layer | 196 | `xlayer-mainnet` | **no** | no |
| Arc | 5042 | `arc-mainnet` | yes | yes (docs) |
Only Ethereum and Base were exercised end to end (the test key had only those two networks enabled); the other rows are slug + documentation checks. Chains marked “no” are not tried unless `alchemyNetwork` is passed.
## What a `ChainTx` contains
[Section titled “What a ChainTx contains”](#what-a-chaintx-contains)
* `time` from `timeStamp` (Etherscan) / ISO `timestamp` (Blockscout) / `metadata.blockTimestamp` (Alchemy, else `eth_getBlockByNumber`).
* `status`: `failed` when `isError = 1` or `txreceipt_status = 0` (Blockscout `status = error`, receipt `status = 0x0`), else `confirmed`.
* `from` / `to` / `nativeValue` from the transaction row. A hash the explorer only lists as a token transfer to the address (incoming ERC-20) has no transaction row: `from`/`to` are then the transfer’s, `raw.tx` is absent.
* `fee` = `gasUsed × gasPrice` (Blockscout `fee.value`; Alchemy and the Etherscan proxy path: receipt `gasUsed × effectiveGasPrice`).
* `call` = `{ to, selector (4 bytes, lowercase), data }` when the input is not `0x`.
* `transfers`: the native value (when > 0), every ERC-20 row (`standard: 'erc20'`, symbol/decimals from the explorer or the swap2 asset catalog), every internal native transfer with value > 0. ERC-721 / ERC-1155 rows are skipped in v1.
* `block` as bigint, `raw = { source, tx, tokens, internal, spam?, spamReason? }` with the untouched explorer rows (Alchemy: `raw.tx = { tx, receipt }` JSON-RPC objects, `raw.tokens` / `raw.internal` the Transfers API rows).
* `EvmChainTx.spam` mirrors `raw.spam`.
`getTransaction(hash, address)` uses Etherscan’s `proxy` module or Alchemy’s JSON-RPC (`eth_getTransactionByHash` + `eth_getTransactionReceipt`; ERC-20 `Transfer` logs become transfers; no internal transfers, neither has traces) or Blockscout `/api/v2/transactions/` + `/token-transfers` + `/internal-transactions`. Returns `undefined` for an unknown hash.
## Pagination
[Section titled “Pagination”](#pagination)
Explorer lists (transactions, token transfers, internal transfers) paginate independently, so the source pages by **block window**: each page fetches one explorer page of every list and emits only rows above the highest cut block among the lists that still have more rows. Everything emitted is complete across all three lists, so the merge by hash is exact. The cursor (base64 JSON: `{ v, b: backend, w: exclusive upper block, lists }`) carries Blockscout’s `next_page_params` per list; Etherscan lists simply re-query with `endblock = w - 1`, Alchemy lists with `toBlock = w - 1`. A cursor from one backend resumes on another by block when the first one fails. `limit` (default 50, max 100) is the explorer page size, so a page can hold more hashes than `limit` when token/internal rows add hashes of their own. Degenerate case: when one list has more than `limit` rows in a single block, that block is emitted once and the remainder skipped.
`since` is applied client-side on `time` (explorers page by block, not time): rows older than `since` are dropped and the page has no cursor.
## Spam rule
[Section titled “Spam rule”](#spam-rule)
Never applied to a transaction the address itself sent. A tx with at least one token row is flagged (`raw.spamReason`) when:
1. `zero-value` — every movement in the tx is zero (zero-value `transferFrom` address poisoning, even with a catalog token such as USDT);
2. `zero-value-unknown-token` — a token the catalog does not know moved 0;
3. `bulk-airdrop` — 20 or more token rows in one tx and at least one unknown token;
4. `symbol-impersonation` — an unknown token whose symbol contains non-ASCII characters (`USDΤ`) or whose ASCII form equals a catalog symbol on this chain (fake “USDT” at another contract).
“Catalog” = `@anywalletkit/swap2-assets` (`ccChain('eip155:').assets`).
## Adding a chain
[Section titled “Adding a chain”](#adding-a-chain)
1. Add the id to `SUPPORTED_CHAIN_IDS` and its explorer to `EXPLORER_TX_BASE` in `src/chains.ts`.
2. `curl https://api.etherscan.io/v2/chainlist` — if listed, add to `ETHERSCAN_V2_CHAIN_IDS_FALLBACK`.
3. Probe a Blockscout root (`/api/v2/transactions` must be `200` JSON) → `BLOCKSCOUT_URLS`; Routescan (`https://api.routescan.io/v2/network/mainnet/evm//etherscan/api?module=account&action=txlist&address=…`) → `ETHERSCAN_COMPAT_URLS`.
4. Alchemy: `curl -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' https://.g.alchemy.com/v2/` → `ALCHEMY_NETWORKS`; `https://www.alchemy.com/rpc/.md` lists “Transfers API” → `ALCHEMY_TRANSFERS_CHAIN_IDS` (and `ALCHEMY_INTERNAL_CHAIN_IDS` when the `internal` category is documented).
5. Nothing answers → `NO_EXPLORER_CHAIN_IDS`.
6. Update the tables above with the date, run `pnpm --filter @anywalletkit/history-evm test` (the chain-table tests enforce that every id is covered and has an Alchemy slug).
## Tests
[Section titled “Tests”](#tests)
`pnpm --filter @anywalletkit/history-evm test` — no network: fixtures in `tests/fixtures/` are real Etherscan v2 (`chainid=1`, captured with a key — keyless capture is no longer possible) and `eth.blockscout.com` responses for the public test wallet `0x8AbE813577E47415A3CD0Bbc68c7ABCa2c4c55bA`, plus a Routescan sample for Avalanche and synthetic rows for a 3-leg swap, a failed tx, a 20-row airdrop and a fake-USDT dust transfer. Alchemy fixtures (`alchemy-base-*.json`, base-mainnet, same wallet, captured with a free key on 2026-10-14): the `fromAddress` / `toAddress` Transfers pages (incl. `internal` rows, an Aave supply and withdraw, inbound-via-internal payments and non-ASCII spoofed tokens), the tx + receipt batch for every hash in them (calldata longer than 2 KB and receipts with many logs trimmed, marked `_inputTrimmed` / `_logsTrimmed`), and the `is not enabled for this app` envelope. `LIVE_HISTORY=1` (and optionally `ETHERSCAN_API_KEY` / `ALCHEMY_API_KEY`) enables the live checks.
Hermes-safe: `fetch` only, guarded `AbortSignal.timeout`, own base64 (no `Buffer`/`btoa`), no `URL` in `src/`.
## Classes
[Section titled “Classes”](#classes)
* [AlchemyClient](/api/anywalletkit/history-evm/classes/alchemyclient/)
* [BlockscoutClient](/api/anywalletkit/history-evm/classes/blockscoutclient/)
* [EtherscanClient](/api/anywalletkit/history-evm/classes/etherscanclient/)
* [ExplorerError](/api/anywalletkit/history-evm/classes/explorererror/)
* [HistoryUnavailableError](/api/anywalletkit/history-evm/classes/historyunavailableerror/)
* [TokenBucket](/api/anywalletkit/history-evm/classes/tokenbucket/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AlchemyClientOptions](/api/anywalletkit/history-evm/interfaces/alchemyclientoptions/)
* [AlchemyTransfer](/api/anywalletkit/history-evm/interfaces/alchemytransfer/)
* [BlockscoutClientOptions](/api/anywalletkit/history-evm/interfaces/blockscoutclientoptions/)
* [EtherscanClientOptions](/api/anywalletkit/history-evm/interfaces/etherscanclientoptions/)
* [EvmChainTx](/api/anywalletkit/history-evm/interfaces/evmchaintx/)
* [EvmHistoryOptions](/api/anywalletkit/history-evm/interfaces/evmhistoryoptions/)
* [EvmHistoryPage](/api/anywalletkit/history-evm/interfaces/evmhistorypage/)
* [EvmHistoryRaw](/api/anywalletkit/history-evm/interfaces/evmhistoryraw/)
* [EvmHistorySource](/api/anywalletkit/history-evm/interfaces/evmhistorysource/)
* [ListPage](/api/anywalletkit/history-evm/interfaces/listpage/)
* [PageCursor](/api/anywalletkit/history-evm/interfaces/pagecursor/)
* [TxRow](/api/anywalletkit/history-evm/interfaces/txrow/)
* [WindowCursor](/api/anywalletkit/history-evm/interfaces/windowcursor/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ExplorerFailureKind](/api/anywalletkit/history-evm/type-aliases/explorerfailurekind/)
* [FetchLike](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
* [HistoryBackend](/api/anywalletkit/history-evm/type-aliases/historybackend/)
* [RawRow](/api/anywalletkit/history-evm/type-aliases/rawrow/)
## Variables
[Section titled “Variables”](#variables)
* [ALCHEMY_INTERNAL_CHAIN_IDS](/api/anywalletkit/history-evm/variables/alchemy_internal_chain_ids/)
* [ALCHEMY_NETWORKS](/api/anywalletkit/history-evm/variables/alchemy_networks/)
* [ALCHEMY_TRANSFERS_CHAIN_IDS](/api/anywalletkit/history-evm/variables/alchemy_transfers_chain_ids/)
* [ALCHEMY_URL_TEMPLATE](/api/anywalletkit/history-evm/variables/alchemy_url_template/)
* [BLOCKSCOUT_PRO_API](/api/anywalletkit/history-evm/variables/blockscout_pro_api/)
* [BLOCKSCOUT_PRO_CHAIN_IDS](/api/anywalletkit/history-evm/variables/blockscout_pro_chain_ids/)
* [BLOCKSCOUT_URLS](/api/anywalletkit/history-evm/variables/blockscout_urls/)
* [ETHERSCAN_COMPAT_URLS](/api/anywalletkit/history-evm/variables/etherscan_compat_urls/)
* [ETHERSCAN_V2_API](/api/anywalletkit/history-evm/variables/etherscan_v2_api/)
* [ETHERSCAN_V2_CHAIN_IDS_FALLBACK](/api/anywalletkit/history-evm/variables/etherscan_v2_chain_ids_fallback/)
* [ETHERSCAN_V2_CHAINLIST](/api/anywalletkit/history-evm/variables/etherscan_v2_chainlist/)
* [EXPLORER_TX_BASE](/api/anywalletkit/history-evm/variables/explorer_tx_base/)
* [NO_EXPLORER_CHAIN_IDS](/api/anywalletkit/history-evm/variables/no_explorer_chain_ids/)
* [SUPPORTED_CHAIN_IDS](/api/anywalletkit/history-evm/variables/supported_chain_ids/)
* [TRANSFER_TOPIC](/api/anywalletkit/history-evm/variables/transfer_topic/)
## Functions
[Section titled “Functions”](#functions)
* [createEvmHistory](/api/anywalletkit/history-evm/functions/createevmhistory/)
* [etherscanServedChains](/api/anywalletkit/history-evm/functions/etherscanservedchains/)
* [explorerTxUrl](/api/anywalletkit/history-evm/functions/explorertxurl/)
* [mergeRows](/api/anywalletkit/history-evm/functions/mergerows/)
* [parseAlchemyTransfer](/api/anywalletkit/history-evm/functions/parsealchemytransfer/)
* [parseReceiptTransfers](/api/anywalletkit/history-evm/functions/parsereceipttransfers/)
* [resetEtherscanChainlistCache](/api/anywalletkit/history-evm/functions/resetetherscanchainlistcache/)
* [resetSharedBuckets](/api/anywalletkit/history-evm/functions/resetsharedbuckets/)
* [sharedBucket](/api/anywalletkit/history-evm/functions/sharedbucket/)
* [spamReason](/api/anywalletkit/history-evm/functions/spamreason/)
* [txRowFromRpc](/api/anywalletkit/history-evm/functions/txrowfromrpc/)
# AlchemyClient
Defined in: history-evm/src/alchemy.ts:100
Alchemy `alchemy_getAssetTransfers` as a history backend, for chains or volumes the explorers do not cover. Needs an Alchemy key.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new AlchemyClient**(`options`): `AlchemyClient`
Defined in: history-evm/src/alchemy.ts:107
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`AlchemyClientOptions`](/api/anywalletkit/history-evm/interfaces/alchemyclientoptions/)
#### Returns
[Section titled “Returns”](#returns)
`AlchemyClient`
## Properties
[Section titled “Properties”](#properties)
### backend
[Section titled “backend”](#backend)
> `readonly` **backend**: `"alchemy"`
Defined in: history-evm/src/alchemy.ts:101
***
### degraded
[Section titled “degraded”](#degraded)
> **degraded**: [`ExplorerError`](/api/anywalletkit/history-evm/classes/explorererror/) | `undefined`
Defined in: history-evm/src/alchemy.ts:105
Last enrichment failure `toRows` absorbed (tests / diagnostics); cleared on the next successful batch.
***
### url
[Section titled “url”](#url)
> `readonly` **url**: `string`
Defined in: history-evm/src/alchemy.ts:103
## Methods
[Section titled “Methods”](#methods)
### batch()
[Section titled “batch()”](#batch)
> **batch**(`calls`): `Promise`<`unknown`\[]>
Defined in: history-evm/src/alchemy.ts:173
JSON-RPC batch in chunks of `BATCH_SIZE`; results in call order (`null` where the node had nothing).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### calls
[Section titled “calls”](#calls)
`object`\[]
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`\[]>
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`): `Promise`<{ `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
Defined in: history-evm/src/alchemy.ts:311
`eth_getTransactionByHash` + receipt in one batch; ERC-20 `Transfer` logs → token rows; block timestamp fetched when needed.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
***
### listSpecs()
[Section titled “listSpecs()”](#listspecs)
> **listSpecs**(`address`): `ListSpec`<{ `block`: `number`; }>\[]
Defined in: history-evm/src/alchemy.ts:215
Two window-pagination lists (`from`, `to`); `next` is a marker, paging is by `toBlock`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`ListSpec`<{ `block`: `number`; }>\[]
***
### rpc()
[Section titled “rpc()”](#rpc)
> **rpc**(`method`, `params`): `Promise`<`unknown`>
Defined in: history-evm/src/alchemy.ts:167
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### method
[Section titled “method”](#method)
`string`
##### params
[Section titled “params”](#params)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`unknown`>
***
### toRows()
[Section titled “toRows()”](#torows)
> **toRows**(`rows`): `Promise`<`ExplorerRows`>
Defined in: history-evm/src/alchemy.ts:237
Window rows (`from` + `to` transfers) → the three explorer lists. Transfers are de-duplicated by `uniqueId` (a self-transfer, or a swap whose legs sit in both lists, appears twice), grouped by hash, and every unique hash gets `eth_getTransactionByHash` + `eth_getTransactionReceipt` in one batch (≤ 10 requests per HTTP call, retried on rate limits). `erc20` rows → token rows, `internal` rows → internal rows, `external` rows are the transaction’s own value and are already covered by the tx row (no second native transfer); only when the node has no tx (dropped / reorged) is the external row turned into a bare tx row so the item still renders.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### rows
[Section titled “rows”](#rows)
`Map`<`string`, `object`\[]>
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`ExplorerRows`>
# BlockscoutClient
Defined in: history-evm/src/blockscout.ts:25
Blockscout `/api/v2` client (also works against Blockscout-compatible explorers such as scrollscan.com).
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BlockscoutClient**(`options`): `BlockscoutClient`
Defined in: history-evm/src/blockscout.ts:30
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`BlockscoutClientOptions`](/api/anywalletkit/history-evm/interfaces/blockscoutclientoptions/)
#### Returns
[Section titled “Returns”](#returns)
`BlockscoutClient`
## Properties
[Section titled “Properties”](#properties)
### backend
[Section titled “backend”](#backend)
> `readonly` **backend**: `"blockscout"`
Defined in: history-evm/src/blockscout.ts:26
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(`path`, `params?`): `Promise`<`unknown`>
Defined in: history-evm/src/blockscout.ts:41
GET with the limiter; one retry on 429/5xx; 404 → `undefined` (unknown address / tx).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### path
[Section titled “path”](#path)
`string`
##### params?
[Section titled “params?”](#params)
`Record`<`string`, `string` | `number` | `undefined`>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`>
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`): `Promise`<{ `internal`: `InternalRow`\[]; `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
Defined in: history-evm/src/blockscout.ts:98
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `internal`: `InternalRow`\[]; `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
***
### listSpecs()
[Section titled “listSpecs()”](#listspecs)
> **listSpecs**(`address`): `ListSpec`<{ `block`: `number`; }>\[]
Defined in: history-evm/src/blockscout.ts:78
Address lists as window-pagination specs. Blockscout pages are fixed at 50 items and carry their own `next_page_params`; `limit` is a hint only.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`ListSpec`<{ `block`: `number`; }>\[]
***
### url()
[Section titled “url()”](#url)
> **url**(`path`, `params?`): `string`
Defined in: history-evm/src/blockscout.ts:35
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### path
[Section titled “path”](#path-1)
`string`
##### params?
[Section titled “params?”](#params-1)
`Record`<`string`, `string` | `number` | `undefined`>
#### Returns
[Section titled “Returns”](#returns-4)
`string`
# EtherscanClient
Defined in: history-evm/src/etherscan.ts:40
Etherscan-format explorer client (Etherscan v2, or a keyless mirror such as Routescan).
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new EtherscanClient**(`options`): `EtherscanClient`
Defined in: history-evm/src/etherscan.ts:44
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
[`EtherscanClientOptions`](/api/anywalletkit/history-evm/interfaces/etherscanclientoptions/)
#### Returns
[Section titled “Returns”](#returns)
`EtherscanClient`
## Properties
[Section titled “Properties”](#properties)
### backend
[Section titled “backend”](#backend)
> `readonly` **backend**: [`HistoryBackend`](/api/anywalletkit/history-evm/type-aliases/historybackend/)
Defined in: history-evm/src/etherscan.ts:41
## Methods
[Section titled “Methods”](#methods)
### call()
[Section titled “call()”](#call)
> **call**(`params`): `Promise`<`unknown`>
Defined in: history-evm/src/etherscan.ts:58
One API call with the limiter; rate-limit answers are retried with a backoff (free Etherscan keys count 3 calls per wall-clock second); classified failures.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### params
[Section titled “params”](#params)
`Record`<`string`, `string` | `number` | `undefined`>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`>
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`): `Promise`<{ `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
Defined in: history-evm/src/etherscan.ts:122
`proxy` module: transaction + receipt (+ block for the timestamp when the node does not inline it).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `tokens`: `TokenRow`\[]; `tx`: [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/); } | `undefined`>
***
### listSpecs()
[Section titled “listSpecs()”](#listspecs)
> **listSpecs**(`address`): `ListSpec`<{ `block`: `number`; }>\[]
Defined in: history-evm/src/etherscan.ts:105
The three address lists as window-pagination specs; `next` is a marker (Etherscan pages by `endblock`, not cursors).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`ListSpec`<{ `block`: `number`; }>\[]
***
### url()
[Section titled “url()”](#url)
> **url**(`params`): `string`
Defined in: history-evm/src/etherscan.ts:49
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### params
[Section titled “params”](#params-1)
`Record`<`string`, `string` | `number` | `undefined`>
#### Returns
[Section titled “Returns”](#returns-4)
`string`
# ExplorerError
Defined in: history-evm/src/errors.ts:23
One explorer backend failed: rate limit, bad key, unsupported chain, malformed answer or network error. The source tries the next backend.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ExplorerError**(`backend`, `kind`, `message`): `ExplorerError`
Defined in: history-evm/src/errors.ts:28
#### Parameters
[Section titled “Parameters”](#parameters)
##### backend
[Section titled “backend”](#backend)
`string`
##### kind
[Section titled “kind”](#kind)
[`ExplorerFailureKind`](/api/anywalletkit/history-evm/type-aliases/explorerfailurekind/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`ExplorerError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### backend
[Section titled “backend”](#backend-1)
> `readonly` **backend**: `string`
Defined in: history-evm/src/errors.ts:27
Backend that failed (`etherscan`, `blockscout`, `alchemy`…).
***
### kind
[Section titled “kind”](#kind-1)
> `readonly` **kind**: [`ExplorerFailureKind`](/api/anywalletkit/history-evm/type-aliases/explorerfailurekind/)
Defined in: history-evm/src/errors.ts:25
What went wrong.
# HistoryUnavailableError
Defined in: history-evm/src/errors.ts:2
No explorer could serve the request for this chain: every configured backend failed or none applies.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: history-evm/src/errors.ts:7
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: history-evm/src/errors.ts:6
One line per backend that was tried, in order.
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: history-evm/src/errors.ts:3
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: history-evm/src/errors.ts:4
# TokenBucket
Defined in: history-evm/src/rate-limit.ts:6
Tiny token bucket: `rate` tokens per second, burst = ceil(rate). Callers queue in arrival order, so N concurrent `acquire()`s drain at the rate instead of racing. Uses only `Date.now` + `setTimeout` (fake-timer friendly).
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TokenBucket**(`ratePerSecond`, `burst?`): `TokenBucket`
Defined in: history-evm/src/rate-limit.ts:13
#### Parameters
[Section titled “Parameters”](#parameters)
##### ratePerSecond
[Section titled “ratePerSecond”](#ratepersecond)
`number`
##### burst?
[Section titled “burst?”](#burst)
`number` = `...`
#### Returns
[Section titled “Returns”](#returns)
`TokenBucket`
## Properties
[Section titled “Properties”](#properties)
### burst
[Section titled “burst”](#burst-1)
> `readonly` **burst**: `number`
Defined in: history-evm/src/rate-limit.ts:11
***
### rate
[Section titled “rate”](#rate)
> `readonly` **rate**: `number`
Defined in: history-evm/src/rate-limit.ts:10
## Methods
[Section titled “Methods”](#methods)
### acquire()
[Section titled “acquire()”](#acquire)
> **acquire**(`cost?`): `Promise`<`void`>
Defined in: history-evm/src/rate-limit.ts:22
Wait for `cost` tokens (default 1; clamped to the burst so one oversized call cannot wait forever).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### cost?
[Section titled “cost?”](#cost)
`number` = `1`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
# createEvmHistory
> **createEvmHistory**(`options`): [`EvmHistorySource`](/api/anywalletkit/history-evm/interfaces/evmhistorysource/)
Defined in: history-evm/src/source.ts:92
A `HistorySource` for one EVM chain. Backends, in order: Etherscan v2 (only with an API key and only for chains the v2 chainlist serves) → Blockscout PRO (with its key; Etherscan-format, one key for every Blockscout chain) → Alchemy (with its key, on chains whose Transfers API is documented or with an explicit `alchemyNetwork`) → keyless Etherscan-format mirror (Routescan, where one exists) → Blockscout instance (where a public one exists). `prefer: 'blockscout'` / `prefer: 'alchemy'` moves that backend first.
## Parameters
[Section titled “Parameters”](#parameters)
### options
[Section titled “options”](#options)
[`EvmHistoryOptions`](/api/anywalletkit/history-evm/interfaces/evmhistoryoptions/)
## Returns
[Section titled “Returns”](#returns)
[`EvmHistorySource`](/api/anywalletkit/history-evm/interfaces/evmhistorysource/)
# etherscanServedChains
> **etherscanServedChains**(`fetchFn`, `timeoutMs`): `Promise`<`Set`<`number`>>
Defined in: history-evm/src/source.ts:55
Chain ids Etherscan v2 serves, fetched once and cached; the built-in fallback list when the chainlist cannot be read.
## Parameters
[Section titled “Parameters”](#parameters)
### fetchFn
[Section titled “fetchFn”](#fetchfn)
[`FetchLike`](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
### timeoutMs
[Section titled “timeoutMs”](#timeoutms)
`number`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Set`<`number`>>
# explorerTxUrl
> **explorerTxUrl**(`chainId`, `hash`): `string`
Defined in: history-evm/src/chains.ts:177
Block-explorer link for a transaction on an EVM chain.
## Parameters
[Section titled “Parameters”](#parameters)
### chainId
[Section titled “chainId”](#chainid)
`number`
### hash
[Section titled “hash”](#hash)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
## Throws
[Section titled “Throws”](#throws)
Error when no explorer is known for the chain.
# mergeRows
> **mergeRows**(`ctx`, `rows`): [`EvmChainTx`](/api/anywalletkit/history-evm/interfaces/evmchaintx/)\[]
Defined in: history-evm/src/rows.ts:112
One `EvmChainTx` per hash, newest first (block desc, then time desc).
## Parameters
[Section titled “Parameters”](#parameters)
### ctx
[Section titled “ctx”](#ctx)
`MergeContext`
### rows
[Section titled “rows”](#rows)
`ExplorerRows`
## Returns
[Section titled “Returns”](#returns)
[`EvmChainTx`](/api/anywalletkit/history-evm/interfaces/evmchaintx/)\[]
# parseAlchemyTransfer
> **parseAlchemyTransfer**(`r`): [`AlchemyTransfer`](/api/anywalletkit/history-evm/interfaces/alchemytransfer/) | `undefined`
Defined in: history-evm/src/alchemy.ts:329
One `alchemy_getAssetTransfers` row → `AlchemyTransfer`; NFT categories and malformed rows → undefined.
## Parameters
[Section titled “Parameters”](#parameters)
### r
[Section titled “r”](#r)
[`RawRow`](/api/anywalletkit/history-evm/type-aliases/rawrow/)
## Returns
[Section titled “Returns”](#returns)
[`AlchemyTransfer`](/api/anywalletkit/history-evm/interfaces/alchemytransfer/) | `undefined`
# parseReceiptTransfers
> **parseReceiptTransfers**(`receipt`, `tx`): `TokenRow`\[]
Defined in: history-evm/src/rpc-rows.ts:40
ERC-20 `Transfer` logs (3 topics) of a receipt → token rows. 4-topic (ERC-721) transfers are skipped.
## Parameters
[Section titled “Parameters”](#parameters)
### receipt
[Section titled “receipt”](#receipt)
[`RawRow`](/api/anywalletkit/history-evm/type-aliases/rawrow/)
### tx
[Section titled “tx”](#tx)
[`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/)
## Returns
[Section titled “Returns”](#returns)
`TokenRow`\[]
# resetEtherscanChainlistCache
> **resetEtherscanChainlistCache**(): `void`
Defined in: history-evm/src/source.ts:79
Tests only.
## Returns
[Section titled “Returns”](#returns)
`void`
# resetSharedBuckets
> **resetSharedBuckets**(): `void`
Defined in: history-evm/src/rate-limit.ts:69
Tests only.
## Returns
[Section titled “Returns”](#returns)
`void`
# sharedBucket
> **sharedBucket**(`key`, `ratePerSecond`): [`TokenBucket`](/api/anywalletkit/history-evm/classes/tokenbucket/)
Defined in: history-evm/src/rate-limit.ts:59
One bucket per key for the whole process: every source built with the same Etherscan key (or the same Blockscout host) shares it, so 25 chain sources cannot multiply the per-key quota.
## Parameters
[Section titled “Parameters”](#parameters)
### key
[Section titled “key”](#key)
`string`
### ratePerSecond
[Section titled “ratePerSecond”](#ratepersecond)
`number`
## Returns
[Section titled “Returns”](#returns)
[`TokenBucket`](/api/anywalletkit/history-evm/classes/tokenbucket/)
# spamReason
> **spamReason**(`ctx`, `tx`, `tokens`, `internal`): `string` | `undefined`
Defined in: history-evm/src/rows.ts:208
Spam heuristic (documented in the README). Never flags a transaction the address itself sent. Returns the rule name or undefined.
1. `zero-value`: every movement in the tx is zero (zero-value `transferFrom` address poisoning, even with a catalog token such as USDT).
2. `zero-value-unknown-token`: a token the catalog does not know moved 0.
3. `bulk-airdrop`: 20+ token rows in one tx and at least one unknown token.
4. `symbol-impersonation`: an unknown token whose symbol has non-ASCII characters, or whose ASCII form equals a catalog symbol on this chain (fake “USDT” at another contract, `USDΤ`).
## Parameters
[Section titled “Parameters”](#parameters)
### ctx
[Section titled “ctx”](#ctx)
`MergeContext`
### tx
[Section titled “tx”](#tx)
[`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/) | `undefined`
### tokens
[Section titled “tokens”](#tokens)
`TokenRow`\[]
### internal
[Section titled “internal”](#internal)
`InternalRow`\[]
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# txRowFromRpc
> **txRowFromRpc**(`tx`, `receipt`, `time`): [`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/)
Defined in: history-evm/src/rpc-rows.ts:16
`time` = unix seconds already known from elsewhere (transfer metadata, block); 0 when unknown.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`RawRow`](/api/anywalletkit/history-evm/type-aliases/rawrow/)
### receipt
[Section titled “receipt”](#receipt)
[`RawRow`](/api/anywalletkit/history-evm/type-aliases/rawrow/) | `null` | `undefined`
### time
[Section titled “time”](#time)
`number`
## Returns
[Section titled “Returns”](#returns)
[`TxRow`](/api/anywalletkit/history-evm/interfaces/txrow/)
# AlchemyClientOptions
Defined in: history-evm/src/alchemy.ts:26
Alchemy backend: `alchemy_getAssetTransfers` (Transfers API) for the address lists, plain JSON-RPC on the same endpoint for what the Transfers API lacks (fee, status, calldata). Free tier: 30M CU / month; a Transfers call is 120 CU, `eth_getTransactionByHash` 15 CU, `eth_getTransactionReceipt` 15 CU.
Lists: one per direction (`fromAddress`, `toAddress`), both paged by block (`toBlock = below - 1`, `order: desc`, `maxCount = limit`) exactly like the Etherscan lists. The API’s own `pageKey` is deliberately NOT used as the list cursor: measured 2026-10-14 on base-mainnet, a request carrying a `pageKey` ignores `toBlock`, an unknown / expired pageKey (TTL 10 min) silently restarts from the first page, and a malformed one is a 400 — none of which fits a cursor that may be resumed hours later or re-fetched with a narrower window. Block paging has no TTL and is idempotent.
## Properties
[Section titled “Properties”](#properties)
### apiKey
[Section titled “apiKey”](#apikey)
> **apiKey**: `string`
Defined in: history-evm/src/alchemy.ts:29
***
### bucket
[Section titled “bucket”](#bucket)
> **bucket**: [`TokenBucket`](/api/anywalletkit/history-evm/classes/tokenbucket/)
Defined in: history-evm/src/alchemy.ts:35
***
### fetch
[Section titled “fetch”](#fetch)
> **fetch**: [`FetchLike`](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
Defined in: history-evm/src/alchemy.ts:34
***
### internal
[Section titled “internal”](#internal)
> **internal**: `boolean`
Defined in: history-evm/src/alchemy.ts:33
Ask for the `internal` category (only where Alchemy supports it; elsewhere the call is rejected).
***
### network
[Section titled “network”](#network)
> **network**: `string`
Defined in: history-evm/src/alchemy.ts:28
Network slug, e.g. `base-mainnet`.
***
### timeoutMs
[Section titled “timeoutMs”](#timeoutms)
> **timeoutMs**: `number`
Defined in: history-evm/src/alchemy.ts:36
***
### urlTemplate?
[Section titled “urlTemplate?”](#urltemplate)
> `optional` **urlTemplate?**: `string`
Defined in: history-evm/src/alchemy.ts:31
`https://{network}.g.alchemy.com/v2/{key}` by default.
# AlchemyTransfer
Defined in: history-evm/src/alchemy.ts:52
One normalized Transfers API row (the `block` field is what the window engine pages on).
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: history-evm/src/alchemy.ts:62
Raw integer amount (wei / token base units) from `rawContract.value`.
***
### block
[Section titled “block”](#block)
> **block**: `number`
Defined in: history-evm/src/alchemy.ts:53
***
### category
[Section titled “category”](#category)
> **category**: `string`
Defined in: history-evm/src/alchemy.ts:58
***
### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
Defined in: history-evm/src/alchemy.ts:64
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: history-evm/src/alchemy.ts:56
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: history-evm/src/alchemy.ts:55
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`RawRow`](/api/anywalletkit/history-evm/type-aliases/rawrow/)
Defined in: history-evm/src/alchemy.ts:67
***
### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
Defined in: history-evm/src/alchemy.ts:63
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: history-evm/src/alchemy.ts:66
Unix seconds from `metadata.blockTimestamp`; 0 when absent.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: history-evm/src/alchemy.ts:57
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: history-evm/src/alchemy.ts:60
Token contract (lower-cased) for `erc20`; undefined for native.
***
### uniqueId
[Section titled “uniqueId”](#uniqueid)
> **uniqueId**: `string`
Defined in: history-evm/src/alchemy.ts:54
# BlockscoutClientOptions
Defined in: history-evm/src/blockscout.ts:8
## Properties
[Section titled “Properties”](#properties)
### baseUrl
[Section titled “baseUrl”](#baseurl)
> **baseUrl**: `string`
Defined in: history-evm/src/blockscout.ts:10
Instance root, e.g. `https://eth.blockscout.com`.
***
### bucket
[Section titled “bucket”](#bucket)
> **bucket**: [`TokenBucket`](/api/anywalletkit/history-evm/classes/tokenbucket/)
Defined in: history-evm/src/blockscout.ts:12
***
### fetch
[Section titled “fetch”](#fetch)
> **fetch**: [`FetchLike`](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
Defined in: history-evm/src/blockscout.ts:11
***
### timeoutMs
[Section titled “timeoutMs”](#timeoutms)
> **timeoutMs**: `number`
Defined in: history-evm/src/blockscout.ts:13
# EtherscanClientOptions
Defined in: history-evm/src/etherscan.ts:11
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: history-evm/src/etherscan.ts:19
***
### backend
[Section titled “backend”](#backend)
> **backend**: [`HistoryBackend`](/api/anywalletkit/history-evm/type-aliases/historybackend/)
Defined in: history-evm/src/etherscan.ts:12
***
### baseUrl
[Section titled “baseUrl”](#baseurl)
> **baseUrl**: `string`
Defined in: history-evm/src/etherscan.ts:14
`https://api.etherscan.io/v2/api` or a Routescan-style mirror.
***
### bucket
[Section titled “bucket”](#bucket)
> **bucket**: [`TokenBucket`](/api/anywalletkit/history-evm/classes/tokenbucket/)
Defined in: history-evm/src/etherscan.ts:21
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: history-evm/src/etherscan.ts:16
Added as `chainid=` (Etherscan v2) or `chain_id=` (Blockscout PRO), see `chainParam`.
***
### chainParam?
[Section titled “chainParam?”](#chainparam)
> `optional` **chainParam?**: `"chainid"` | `"chain_id"`
Defined in: history-evm/src/etherscan.ts:18
Query parameter name for the chain id. Default `chainid`.
***
### fetch
[Section titled “fetch”](#fetch)
> **fetch**: [`FetchLike`](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
Defined in: history-evm/src/etherscan.ts:20
***
### timeoutMs
[Section titled “timeoutMs”](#timeoutms)
> **timeoutMs**: `number`
Defined in: history-evm/src/etherscan.ts:22
# EvmChainTx
Defined in: history-evm/src/types.ts:79
`ChainTx` with the spam flag this source computes (also mirrored in `raw.spam`).
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`EvmHistoryRaw`](/api/anywalletkit/history-evm/interfaces/evmhistoryraw/)
Defined in: history-evm/src/types.ts:81
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `boolean`
Defined in: history-evm/src/types.ts:80
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# EvmHistoryOptions
Defined in: history-evm/src/types.ts:13
Options for [createEvmHistory](/api/anywalletkit/history-evm/functions/createevmhistory/): the chain, explorer keys or a proxy, and limits.
## Properties
[Section titled “Properties”](#properties)
### alchemyApiKey?
[Section titled “alchemyApiKey?”](#alchemyapikey)
> `optional` **alchemyApiKey?**: `string`
Defined in: history-evm/src/types.ts:43
Alchemy API key (free tier: 30M CU/month, no card). Enables the `alchemy` backend — `alchemy_getAssetTransfers` (120 CU) for the lists plus one JSON-RPC batch of `eth_getTransactionByHash` + `eth_getTransactionReceipt` per page for fee / status / calldata. The only free source on Base and BSC. Every network must be **enabled for the app** in the Alchemy dashboard first; otherwise the backend answers ` is not enabled for this app` and the source falls through to the next backend.
***
### alchemyComputeUnitsPerSecond?
[Section titled “alchemyComputeUnitsPerSecond?”](#alchemycomputeunitspersecond)
> `optional` **alchemyComputeUnitsPerSecond?**: `number`
Defined in: history-evm/src/types.ts:49
Alchemy compute units per second, shared per key across every chain (a batch costs the sum of its calls). Default 300 — the free tier’s 500 CU/s with headroom.
***
### alchemyNetwork?
[Section titled “alchemyNetwork?”](#alchemynetwork)
> `optional` **alchemyNetwork?**: `string`
Defined in: history-evm/src/types.ts:45
Alchemy network slug override (`base-mainnet`); default from `ALCHEMY_NETWORKS[chainId]`. Also enables the backend on chains the table does not list for the Transfers API.
***
### alchemyUrl?
[Section titled “alchemyUrl?”](#alchemyurl)
> `optional` **alchemyUrl?**: `string`
Defined in: history-evm/src/types.ts:47
Override the Alchemy host template; `{network}` and `{key}` are substituted. Default `https://{network}.g.alchemy.com/v2/{key}`.
***
### blockscoutProApiKey?
[Section titled “blockscoutProApiKey?”](#blockscoutproapikey)
> `optional` **blockscoutProApiKey?**: `string`
Defined in: history-evm/src/types.ts:30
Blockscout PRO multichain API key (`proapi_…`, free tier 100K credits/day, 5 rps, every Blockscout chain through one key). Etherscan-format (`chain_id=` instead of `chainid=`), so it covers chains where the free Etherscan key is refused (Base, Optimism, BSC, Avalanche, Gnosis, Arc, Robinhood) and ones Etherscan v2 lacks (Scroll, zkSync, Ink, Plume). Tried after Etherscan.
***
### blockscoutProRateLimit?
[Section titled “blockscoutProRateLimit?”](#blockscoutproratelimit)
> `optional` **blockscoutProRateLimit?**: `number`
Defined in: history-evm/src/types.ts:34
Blockscout PRO requests per second (free tier: 5). Shared per key across chains.
***
### blockscoutProUrl?
[Section titled “blockscoutProUrl?”](#blockscoutprourl)
> `optional` **blockscoutProUrl?**: `string`
Defined in: history-evm/src/types.ts:32
Override the Blockscout PRO endpoint. Default `https://api.blockscout.com/v2/api`.
***
### blockscoutUrl?
[Section titled “blockscoutUrl?”](#blockscouturl)
> `optional` **blockscoutUrl?**: `string` | `null`
Defined in: history-evm/src/types.ts:51
Blockscout instance root (`https://eth.blockscout.com`). Overrides / adds to the built-in table; `null` disables the built-in entry.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: history-evm/src/types.ts:15
EVM chain id (1, 8453, …). The source’s `chain` is `eip155:`.
***
### etherscanApiKey?
[Section titled “etherscanApiKey?”](#etherscanapikey)
> `optional` **etherscanApiKey?**: `string`
Defined in: history-evm/src/types.ts:21
Etherscan v2 API key. Without it Etherscan is never called (since 2026 the v2 API rejects keyless requests) and the source relies on the keyless fallbacks (Routescan / Blockscout) of the chain, if any.
***
### etherscanCompatUrl?
[Section titled “etherscanCompatUrl?”](#etherscancompaturl)
> `optional` **etherscanCompatUrl?**: `string` | `null`
Defined in: history-evm/src/types.ts:53
Keyless Etherscan-format endpoint (Routescan style). Overrides / adds to the built-in table; `null` disables the built-in entry.
***
### etherscanUrl?
[Section titled “etherscanUrl?”](#etherscanurl)
> `optional` **etherscanUrl?**: `string`
Defined in: history-evm/src/types.ts:23
Override the Etherscan v2 endpoint (e.g. a proxy that adds the key server-side). Default `https://api.etherscan.io/v2/api`.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/history-evm/type-aliases/fetchlike/)
Defined in: history-evm/src/types.ts:55
Fetch implementation; defaults to `globalThis.fetch`.
***
### prefer?
[Section titled “prefer?”](#prefer)
> `optional` **prefer?**: `"etherscan"` | `"alchemy"` | `"blockscout"`
Defined in: history-evm/src/types.ts:59
Try Blockscout (or Alchemy) before Etherscan when both exist (saves Etherscan quota / the only free source on Base). Default: Etherscan first.
***
### rateLimit?
[Section titled “rateLimit?”](#ratelimit)
> `optional` **rateLimit?**: `number`
Defined in: history-evm/src/types.ts:57
Etherscan requests per second for this key. Default 3 (the free tier’s limit; Lite 5, Standard 10). Shared by every source using the same key — 25 chains do not multiply it.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: history-evm/src/types.ts:61
Per-request timeout, ms. Default 15 000.
# EvmHistoryPage
Defined in: history-evm/src/types.ts:85
One page of EVM history, with the backend that served it.
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### backend?
[Section titled “backend?”](#backend)
> `optional` **backend?**: [`HistoryBackend`](/api/anywalletkit/history-evm/type-aliases/historybackend/)
Defined in: history-evm/src/types.ts:88
Which explorer served this page.
***
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`EvmChainTx`](/api/anywalletkit/history-evm/interfaces/evmchaintx/)\[]
Defined in: history-evm/src/types.ts:86
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
***
### note?
[Section titled “note?”](#note)
> `optional` **note?**: `string`
Defined in: history-evm/src/types.ts:90
Set when the page is empty because the chain has no explorer API at all.
# EvmHistoryRaw
Defined in: history-evm/src/types.ts:65
The explorer rows a `ChainTx` was built from, plus the spam verdict.
## Properties
[Section titled “Properties”](#properties)
### internal
[Section titled “internal”](#internal)
> **internal**: `unknown`\[]
Defined in: history-evm/src/types.ts:72
Internal native transfers (txlistinternal / Blockscout internal-transactions / Alchemy `internal` transfers).
***
### source
[Section titled “source”](#source)
> **source**: [`HistoryBackend`](/api/anywalletkit/history-evm/type-aliases/historybackend/)
Defined in: history-evm/src/types.ts:66
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `true`
Defined in: history-evm/src/types.ts:73
***
### spamReason?
[Section titled “spamReason?”](#spamreason)
> `optional` **spamReason?**: `string`
Defined in: history-evm/src/types.ts:75
Which rule fired: `zero-value`, `zero-value-unknown-token`, `bulk-airdrop`, `symbol-impersonation`.
***
### tokens
[Section titled “tokens”](#tokens)
> **tokens**: `unknown`\[]
Defined in: history-evm/src/types.ts:70
Token transfer rows (tokentx / Blockscout token-transfers / Alchemy `erc20` transfers).
***
### tx?
[Section titled “tx?”](#tx)
> `optional` **tx?**: `unknown`
Defined in: history-evm/src/types.ts:68
The top-level transaction row (txlist / Blockscout transaction / Alchemy `{ tx, receipt }`). Absent when only a token transfer to the address was indexed.
# EvmHistorySource
Defined in: history-evm/src/types.ts:97
EVM history for one chain from Etherscan v2, Blockscout or Alchemy, with keyless Blockscout and Routescan as fallbacks. Build it with [createEvmHistory](/api/anywalletkit/history-evm/functions/createevmhistory/).
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
***
### chainId
[Section titled “chainId”](#chainid)
> `readonly` **chainId**: `number`
Defined in: history-evm/src/types.ts:98
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`EvmChainTx`](/api/anywalletkit/history-evm/interfaces/evmchaintx/) | `undefined`>
Defined in: history-evm/src/types.ts:100
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`EvmChainTx`](/api/anywalletkit/history-evm/interfaces/evmchaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`EvmHistoryPage`](/api/anywalletkit/history-evm/interfaces/evmhistorypage/)>
Defined in: history-evm/src/types.ts:99
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`EvmHistoryPage`](/api/anywalletkit/history-evm/interfaces/evmhistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
# ListPage
Defined in: history-evm/src/paginate.ts:17
Block-window pagination over several independently paginated explorer lists (transactions, token transfers, internal transfers).
Each page fetches one explorer page of every list that is not exhausted, then only emits rows above the highest “cut” block `L` among the lists that still have more rows (everything above `L` is complete in every list, so the merge by hash is exact). The next cursor is `w = L + 1` (exclusive upper bound): Etherscan lists re-query with `endblock = w - 1`; Blockscout lists keep their own `next_page_params` and only advance when all their fetched rows were emitted (otherwise the same page is re-fetched and filtered by `w`). Degenerate case: when one list has more than `limit` rows in a single block, the page emits that block and skips what is left of it (`w = L`).
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### R
[Section titled “R”](#r)
`R`
## Properties
[Section titled “Properties”](#properties)
### next
[Section titled “next”](#next)
> **next**: `unknown`
Defined in: history-evm/src/paginate.ts:20
Explorer cursor for the next page of this list; `null` when exhausted.
***
### rows
[Section titled “rows”](#rows)
> **rows**: `R`\[]
Defined in: history-evm/src/paginate.ts:18
# PageCursor
Defined in: history-evm/src/cursor.ts:15
Page cursor: the block window the next page continues below, plus the per-list explorer cursors (Blockscout `next_page_params`; unused by Etherscan, which pages with `endblock`). Base64 of JSON, opaque to callers. `w` is exclusive: the next page returns rows with `block < w`.
## Extends
[Section titled “Extends”](#extends)
* [`WindowCursor`](/api/anywalletkit/history-evm/interfaces/windowcursor/)
## Properties
[Section titled “Properties”](#properties)
### b
[Section titled “b”](#b)
> **b**: [`HistoryBackend`](/api/anywalletkit/history-evm/type-aliases/historybackend/)
Defined in: history-evm/src/cursor.ts:17
***
### lists
[Section titled “lists”](#lists)
> **lists**: `Record`<`string`, `unknown`>
Defined in: history-evm/src/cursor.ts:12
list key → explorer cursor; `null` = that list is exhausted.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WindowCursor`](/api/anywalletkit/history-evm/interfaces/windowcursor/).[`lists`](/api/anywalletkit/history-evm/interfaces/windowcursor/#lists)
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: history-evm/src/cursor.ts:16
***
### w?
[Section titled “w?”](#w)
> `optional` **w?**: `number`
Defined in: history-evm/src/cursor.ts:10
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WindowCursor`](/api/anywalletkit/history-evm/interfaces/windowcursor/).[`w`](/api/anywalletkit/history-evm/interfaces/windowcursor/#w)
# TxRow
Defined in: history-evm/src/rows.ts:12
Explorer rows normalized to one shape per list, whatever the backend (Etherscan `txlist`/`tokentx`/`txlistinternal`, Blockscout `transactions`/`token-transfers`/`internal-transactions`). `mergeRows` folds the three lists into one `EvmChainTx` per hash.
## Properties
[Section titled “Properties”](#properties)
### block
[Section titled “block”](#block)
> **block**: `number`
Defined in: history-evm/src/rows.ts:14
***
### contractAddress?
[Section titled “contractAddress?”](#contractaddress)
> `optional` **contractAddress?**: `string`
Defined in: history-evm/src/rows.ts:26
Address created by this tx, when it was a deployment.
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: history-evm/src/rows.ts:24
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: history-evm/src/rows.ts:17
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: history-evm/src/rows.ts:13
***
### input
[Section titled “input”](#input)
> **input**: `string`
Defined in: history-evm/src/rows.ts:22
`0x` when the tx carries no calldata.
***
### raw
[Section titled “raw”](#raw)
> **raw**: `unknown`
Defined in: history-evm/src/rows.ts:27
***
### status
[Section titled “status”](#status)
> **status**: `"confirmed"` | `"failed"` | `"pending"`
Defined in: history-evm/src/rows.ts:23
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: history-evm/src/rows.ts:16
Unix seconds.
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: history-evm/src/rows.ts:19
Null for contract creation.
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: history-evm/src/rows.ts:20
# WindowCursor
Defined in: history-evm/src/cursor.ts:9
Page cursor: the block window the next page continues below, plus the per-list explorer cursors (Blockscout `next_page_params`; unused by Etherscan, which pages with `endblock`). Base64 of JSON, opaque to callers. `w` is exclusive: the next page returns rows with `block < w`.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`PageCursor`](/api/anywalletkit/history-evm/interfaces/pagecursor/)
## Properties
[Section titled “Properties”](#properties)
### lists
[Section titled “lists”](#lists)
> **lists**: `Record`<`string`, `unknown`>
Defined in: history-evm/src/cursor.ts:12
list key → explorer cursor; `null` = that list is exhausted.
***
### w?
[Section titled “w?”](#w)
> `optional` **w?**: `number`
Defined in: history-evm/src/cursor.ts:10
# ExplorerFailureKind
> **ExplorerFailureKind** = `"rate-limit"` | `"unavailable"` | `"http"` | `"network"`
Defined in: history-evm/src/errors.ts:17
Internal: how one backend call failed, so the source can decide between retry and fallback.
# FetchLike
> **FetchLike** = (`input`, `init?`) => `Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; `text`: `Promise`<`string`>; }>
Defined in: history-evm/src/types.ts:7
The subset of WHATWG `fetch` this package uses; lets tests and hosts inject their own.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### init?
[Section titled “init?”](#init)
#### body?
[Section titled “body?”](#body)
`string`
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; `text`: `Promise`<`string`>; }>
# HistoryBackend
> **HistoryBackend** = `"etherscan"` | `"blockscout-pro"` | `"alchemy"` | `"routescan"` | `"blockscout"`
Defined in: history-evm/src/types.ts:4
Which explorer family answered. `routescan` = keyless Etherscan-format mirror; `alchemy` = Alchemy Transfers API + JSON-RPC.
# RawRow
> **RawRow** = `Record`<`string`, `unknown`>
Defined in: history-evm/src/rpc-rows.ts:10
An untyped JSON object as an explorer or RPC returns it, before parsing.
# ALCHEMY_INTERNAL_CHAIN_IDS
> `const` **ALCHEMY_INTERNAL_CHAIN_IDS**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:131
Where `alchemy_getAssetTransfers` accepts the `internal` category. Docs (alchemy-getassettransfers, 2026-10-14): “Internal transfer data is available only on Ethereum Mainnet, Polygon Mainnet, Base Mainnet, Arc Mainnet, and Arc Testnet.” Verified live that day on 1 and 8453.
# ALCHEMY_NETWORKS
> `const` **ALCHEMY_NETWORKS**: `Readonly`<`Record`<`number`, `string`>>
Defined in: history-evm/src/chains.ts:85
Alchemy network slugs (`https://.g.alchemy.com/v2/`), one per supported chain id. Verified 2026-10-14 by calling `eth_chainId` on every slug with a free-tier key: an existing slug answers either the chain id or ` is not enabled for this app` (a non-existent slug does not resolve). Arc 5042 is included for the Transfers API table even though it is not a wallet chain yet.
# ALCHEMY_TRANSFERS_CHAIN_IDS
> `const` **ALCHEMY_TRANSFERS_CHAIN_IDS**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:121
Chains whose Alchemy docs page (`https://www.alchemy.com/rpc/.md`, read 2026-10-14) lists “Transfers API” under “Supported on …”. The backend is only added for these unless `alchemyNetwork` is passed explicitly. “Not currently supported: … Transfers API” that day: Sonic 146, Plasma 9745, MegaETH 4326, Sei 1329, X Layer 196; Plume 98866 has no Alchemy docs page.
# ALCHEMY_URL_TEMPLATE
> `const` **ALCHEMY_URL_TEMPLATE**: `"https://{network}.g.alchemy.com/v2/{key}"` = `'https://{network}.g.alchemy.com/v2/{key}'`
Defined in: history-evm/src/chains.ts:134
Alchemy endpoint template; `{network}` and `{key}` are filled per chain.
# BLOCKSCOUT_PRO_API
> `const` **BLOCKSCOUT_PRO_API**: `"https://api.blockscout.com/v2/api"` = `'https://api.blockscout.com/v2/api'`
Defined in: history-evm/src/chains.ts:18
Blockscout PRO multichain API (Etherscan-format, `chain_id=` + `apikey=`); docs:
# BLOCKSCOUT_PRO_CHAIN_IDS
> `const` **BLOCKSCOUT_PRO_CHAIN_IDS**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:24
Chains listed in Blockscout’s PRO prod config (github.com/blockscout/backend-configs pro-api/prod/chains-config.json, read 2026-10-14). The docs say “all chains”; the backend is tried for every chain when a key is set and falls through on an “unsupported chain” answer, so this list is documentation, not a gate.
# BLOCKSCOUT_URLS
> `const` **BLOCKSCOUT_URLS**: `Readonly`<`Record`<`number`, `string`>>
Defined in: history-evm/src/chains.ts:51
Public Blockscout (or Blockscout-compatible `/api/v2`) instances that answered `200` JSON on `/api/v2/addresses//transactions` and `/api/v2/transactions` on 2026-10-14. Base, Arbitrum and Polygon Blockscouts sit behind a Cloudflare JS challenge (403 for non-browser clients) and are left out on purpose; Linea, Sonic, Berachain, Monad, HyperEVM, Sei, Plasma, Robinhood and BSC have no public Blockscout we could find.
# ETHERSCAN_COMPAT_URLS
> `const` **ETHERSCAN_COMPAT_URLS**: `Readonly`<`Record`<`number`, `string`>>
Defined in: history-evm/src/chains.ts:71
Keyless Etherscan-format mirrors (Routescan). Same response shape as Etherscan v1/v2, no `chainid`/`apikey` parameters. Verified 2026-10-14: `status: "1"` for 1 and 43114, `No transactions found` (served) for 9745; `chain not supported` for every other id of ours.
# ETHERSCAN_V2_API
> `const` **ETHERSCAN_V2_API**: `"https://api.etherscan.io/v2/api"` = `'https://api.etherscan.io/v2/api'`
Defined in: history-evm/src/chains.ts:14
Etherscan v2 multichain API root.
# ETHERSCAN_V2_CHAIN_IDS_FALLBACK
> `const` **ETHERSCAN_V2_CHAIN_IDS_FALLBACK**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:39
Chain ids `https://api.etherscan.io/v2/chainlist` listed on 2026-10-14 (63 chains total; only ours kept). Used when the live chainlist cannot be fetched. NOT listed that day: Scroll 534352, zkSync Era 324, Ink 57073, Plume 98866, X Layer 196.
Note (same day): Etherscan v2 answers `Missing/Invalid API Key` without a key on every chain, and `Free API access is not supported for this chain` with a free-plan key on Base 8453, OP 10, BSC 56, Avalanche 43114 and Gnosis 100; Celo 42220 shares a community quota (`Community Free API Limit reached`). Those answers are surfaced as `HistoryUnavailableError` reasons and trigger the fallbacks below.
# ETHERSCAN_V2_CHAINLIST
> `const` **ETHERSCAN_V2_CHAINLIST**: `"https://api.etherscan.io/v2/chainlist"` = `'https://api.etherscan.io/v2/chainlist'`
Defined in: history-evm/src/chains.ts:16
Etherscan v2 list of the chains it serves.
# EXPLORER_TX_BASE
> `const` **EXPLORER_TX_BASE**: `Readonly`<`Record`<`number`, `string`>>
Defined in: history-evm/src/chains.ts:144
Human explorer, `/tx/` appended. Etherscan family where it exists, else the Blockscout / vendor explorer.
# NO_EXPLORER_CHAIN_IDS
> `const` **NO_EXPLORER_CHAIN_IDS**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:141
Chains with no explorer API at all (neither Etherscan v2 nor a public Blockscout / Routescan). `listActivity` returns an empty page with a `note` instead of throwing. X Layer only has OKLink (own API, key required).
# SUPPORTED_CHAIN_IDS
> `const` **SUPPORTED_CHAIN_IDS**: readonly `number`\[]
Defined in: history-evm/src/chains.ts:8
Every EVM chain id the SDK’s wallet / swap layers support.
# TRANSFER_TOPIC
> `const` **TRANSFER_TOPIC**: `"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"` = `'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'`
Defined in: history-evm/src/rpc-rows.ts:13
keccak256(“Transfer(address,address,uint256)”)
# @anywalletkit/keyring
# @anywalletkit/keyring
[Section titled “@anywalletkit/keyring”](#anywalletkitkeyring)
[](https://www.npmjs.com/package/@anywalletkit/keyring)
Many accounts from many key sources, the way MetaMask, Phantom or Tonkeeper do it:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/keyring
# or: pnpm add @anywalletkit/keyring · yarn add @anywalletkit/keyring
```
On npm: [@anywalletkit/keyring](https://www.npmjs.com/package/@anywalletkit/keyring), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
* **a BIP-39 seed** (created or imported, optional passphrase) → accounts 0, 1, 2… on every registered chain;
* **an imported private key** → exactly one account on one chain;
* **a TON-native 24-word mnemonic** (Tonkeeper, Tonhub, MyTonWallet) → one TON account.
```ts
import { Keyring } from '@anywalletkit/keyring'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
const keyring = await Keyring.load({
storage, // KeyringStorage: names, addresses, flags — no secrets
secrets, // SecretStorage: one secure-storage entry per source
chains: { evm: { Manager: WalletManagerEvm, config: { provider } }, solana: { Manager: WalletManagerSolana, config: { rpcUrl } } },
})
const { mnemonic } = await keyring.createMnemonic() // show the backup screen once
const next = await keyring.addAccount(keyring.listSources()[0]!.id)
await keyring.importMnemonic(words, { discover: { isUsed } }) // restore: adds used accounts 1, 2, …
await keyring.previewPrivateKey('solana', key) // show the address first
await keyring.importPrivateKey('solana', key)
await keyring.withAccount(next.id, 'evm', (account) => account.sendTransaction(tx))
// A chain registered after an account was created: derive what it lacks (one secret read per source).
keyring.missingChains(next.id) // ['zcash'] — no secret read
await keyring.completeAddresses(next.sourceId)
```
## Derivation (what changes per account)
[Section titled “Derivation (what changes per account)”](#derivation-what-changes-per-account)
| chain | account `i` | same accounts as |
| ------ | -------------------------- | ---------------------------------------------------------- |
| EVM | `m/44'/60'/0'/0/i` | MetaMask, Rabby, Trust, Rainbow |
| Solana | `m/44'/501'/i'/0'` | Phantom, Solflare, Backpack |
| TON | `m/44'/607'/i'` (V5R1) | Trust (BIP-39); Tonkeeper words → `importTonMnemonic` |
| Tron | `m/44'/195'/0'/0/i` | TronLink, Trust |
| BTC | `m/84'/0'/0'/0/i` (P2WPKH) | BIP-84 wallets, address index `i` |
| NEAR | `m/44'/397'/i'` | MyNearWallet, Meteor (implicit) |
| Zcash | `m/44'/133'/0'/0/i` | Zashi, YWallet, Ledger, Trezor (transparent t1… receivers) |
Golden vectors for i = 0..4 are in `test/vectors.test.ts`; account 0 matches the public reference vectors and the chain managers’ own derivation (no existing address moves).
## Private-key formats
[Section titled “Private-key formats”](#private-key-formats)
EVM / Tron: hex · BTC: compressed WIF or hex · Solana: base58 64-byte secret, the JSON byte array, or a base58 32-byte seed · TON: hex seed or 64-byte secret · NEAR: `ed25519:` · Zcash: WIF or 32-byte hex (like BTC). A 64-byte ed25519 secret must match its embedded public key.
Not yet: TON V4R2/V3R2 wallet versions for an imported key (V5R1 only), BTC P2TR/P2PKH scanning for an imported WIF (the BTC manager’s configured address type is used), non-English BIP-39 wordlists.
## Security model
[Section titled “Security model”](#security-model)
* The SDK holds no secret between calls. Each call that signs reads the source’s secret from `SecretStorage`, builds the chain manager, and the returned handle zeroizes the key on `dispose()` (`withAccount` disposes for you).
* `KeyringStorage` only ever sees public data: labels, addresses, indexes, flags and a fingerprint (a hash of the master *public* key, or of the imported key’s public key).
* Duplicates are caught by that fingerprint — the same seed, the same seed + passphrase, or the same key in another format — without keeping anything secret around.
* Error messages never echo words, keys or passphrases.
* `removeSource` saves the metadata (with the id as a pending delete) before it deletes the secret, so a failed save never strands a source without its key; a failed delete is retried on the next `Keyring.load`. `SecretStorage.delete` must resolve for an id that is not there.
* Parallel imports are serialized: the duplicate check and the secret write run in one queued change, so the same phrase imported twice at once lands once.
* `exportSecret()` returns the secret for a backup screen: gate it behind biometrics in the app.
## Classes
[Section titled “Classes”](#classes)
* [Keyring](/api/anywalletkit/keyring/classes/keyring/)
* [KeyringError](/api/anywalletkit/keyring/classes/keyringerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AccountHandle](/api/anywalletkit/keyring/interfaces/accounthandle/)
* [AccountMeta](/api/anywalletkit/keyring/interfaces/accountmeta/)
* [ChainSpec](/api/anywalletkit/keyring/interfaces/chainspec/)
* [DiscoverOptions](/api/anywalletkit/keyring/interfaces/discoveroptions/)
* [FormattedPrivateKey](/api/anywalletkit/keyring/interfaces/formattedprivatekey/)
* [KeyringChain](/api/anywalletkit/keyring/interfaces/keyringchain/)
* [KeyringOptions](/api/anywalletkit/keyring/interfaces/keyringoptions/)
* [KeyringState](/api/anywalletkit/keyring/interfaces/keyringstate/)
* [KeyringStorage](/api/anywalletkit/keyring/interfaces/keyringstorage/)
* [ParsedKey](/api/anywalletkit/keyring/interfaces/parsedkey/)
* [SecretStorage](/api/anywalletkit/keyring/interfaces/secretstorage/)
* [SourceMeta](/api/anywalletkit/keyring/interfaces/sourcemeta/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ChainKey](/api/anywalletkit/keyring/type-aliases/chainkey/)
* [KeyringErrorCode](/api/anywalletkit/keyring/type-aliases/keyringerrorcode/)
* [KeyringManagerClass](/api/anywalletkit/keyring/type-aliases/keyringmanagerclass/)
* [PrivateKeyFormat](/api/anywalletkit/keyring/type-aliases/privatekeyformat/)
* [SourceType](/api/anywalletkit/keyring/type-aliases/sourcetype/)
## Variables
[Section titled “Variables”](#variables)
* [CHAIN_KEYS](/api/anywalletkit/keyring/variables/chain_keys/)
* [CHAIN_SPECS](/api/anywalletkit/keyring/variables/chain_specs/)
## Functions
[Section titled “Functions”](#functions)
* [formatPrivateKey](/api/anywalletkit/keyring/functions/formatprivatekey/)
* [isChainKey](/api/anywalletkit/keyring/functions/ischainkey/)
* [keyFingerprint](/api/anywalletkit/keyring/functions/keyfingerprint/)
* [parsePrivateKey](/api/anywalletkit/keyring/functions/parseprivatekey/)
* [publicKeyOf](/api/anywalletkit/keyring/functions/publickeyof/)
# Keyring
Defined in: keyring.ts:183
Many accounts from many key sources:
* a BIP-39 seed (generated or imported, optional passphrase) → accounts 0, 1, 2… on every chain;
* an imported private key → exactly one account on one chain;
* a TON-native 24-word mnemonic (Tonkeeper) → one TON account.
Metadata goes through `KeyringStorage`, each source’s secret through `SecretStorage` (one entry per source). Listing accounts never touches a secret; signing reads one, hands back an [AccountHandle](/api/anywalletkit/keyring/interfaces/accounthandle/), and the caller disposes it.
## Accessors
[Section titled “Accessors”](#accessors)
### activeAccount
[Section titled “activeAccount”](#activeaccount)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **activeAccount**(): [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/) | `null`
Defined in: keyring.ts:249
The account the app shows, or `null` when the keyring is empty.
##### Returns
[Section titled “Returns”](#returns)
[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/) | `null`
***
### chains
[Section titled “chains”](#chains)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **chains**(): [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)\[]
Defined in: keyring.ts:220
The chains registered in [KeyringOptions.chains](/api/anywalletkit/keyring/interfaces/keyringoptions/#chains).
##### Returns
[Section titled “Returns”](#returns-1)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)\[]
***
### state
[Section titled “state”](#state)
#### Get Signature
[Section titled “Get Signature”](#get-signature-2)
> **get** **state**(): [`KeyringState`](/api/anywalletkit/keyring/interfaces/keyringstate/)
Defined in: keyring.ts:215
A copy of the whole state.
##### Returns
[Section titled “Returns”](#returns-2)
[`KeyringState`](/api/anywalletkit/keyring/interfaces/keyringstate/)
## Methods
[Section titled “Methods”](#methods)
### addAccount()
[Section titled “addAccount()”](#addaccount)
> **addAccount**(`sourceId`, `options?`): `Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)>
Defined in: keyring.ts:426
Next account of a seed: the lowest index above every one it has (hidden included).
#### Parameters
[Section titled “Parameters”](#parameters)
##### sourceId
[Section titled “sourceId”](#sourceid)
`string`
##### options?
[Section titled “options?”](#options)
###### name?
[Section titled “name?”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)>
***
### completeAddresses()
[Section titled “completeAddresses()”](#completeaddresses)
> **completeAddresses**(`sourceId`): `Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]>
Defined in: keyring.ts:459
Derive the addresses every seed account of `sourceId` lacks (see [missingChains](/api/anywalletkit/keyring/classes/keyring/#missingchains)) and store them. One secret read for the whole source; accounts that are complete are untouched. Returns the accounts that changed.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### sourceId
[Section titled “sourceId”](#sourceid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]>
***
### createMnemonic()
[Section titled “createMnemonic()”](#createmnemonic)
> **createMnemonic**(`options?`): `Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `mnemonic`: `string`; `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
Defined in: keyring.ts:257
Generate a new seed and its account 0. Returns the phrase once so the app can show the backup screen.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options?
[Section titled “options?”](#options-1)
###### label?
[Section titled “label?”](#label)
`string`
###### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `mnemonic`: `string`; `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
***
### discoverAccounts()
[Section titled “discoverAccounts()”](#discoveraccounts)
> **discoverAccounts**(`sourceId`, `options`): `Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]>
Defined in: keyring.ts:482
Restore-time discovery: walk indexes above the source’s highest one, add every account `isUsed` says has activity, stop after `gapLimit` (default 1, as MetaMask / Phantom do) unused accounts in a row or at `maxIndex`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### sourceId
[Section titled “sourceId”](#sourceid-2)
`string`
##### options
[Section titled “options”](#options-2)
[`DiscoverOptions`](/api/anywalletkit/keyring/interfaces/discoveroptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]>
***
### exportPrivateKey()
[Section titled “exportPrivateKey()”](#exportprivatekey)
> **exportPrivateKey**(`accountId`, `chain`): `Promise`<{ `address`: `string`; `chain`: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/); `compatibleWith`: `string`; `format`: [`PrivateKeyFormat`](/api/anywalletkit/keyring/type-aliases/privatekeyformat/); `path?`: `string`; `privateKey`: `string`; }>
Defined in: keyring.ts:380
One account’s private key on one chain, in the format that chain’s wallets import (see [formatPrivateKey](/api/anywalletkit/keyring/functions/formatprivatekey/)) — for “Export private key” behind biometrics, like the phrase.
* Seed account: derived at the account’s own path (as the chain manager derives it).
* Imported key: the key itself, on its chain only.
* TON-native 24 words: refused — export the words ([exportSecret](/api/anywalletkit/keyring/classes/keyring/#exportsecret)); TON wallets import only those.
Before returning, a wallet is built from the exported key and its address must equal the account’s address on that chain; otherwise nothing is returned. Reads the secret once.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### accountId
[Section titled “accountId”](#accountid)
`string`
##### chain
[Section titled “chain”](#chain)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<{ `address`: `string`; `chain`: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/); `compatibleWith`: `string`; `format`: [`PrivateKeyFormat`](/api/anywalletkit/keyring/type-aliases/privatekeyformat/); `path?`: `string`; `privateKey`: `string`; }>
***
### exportSecret()
[Section titled “exportSecret()”](#exportsecret)
> **exportSecret**(`sourceId`): `Promise`<{ `chain?`: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/); `passphrase?`: `string`; `secret`: `string`; `type`: [`SourceType`](/api/anywalletkit/keyring/type-aliases/sourcetype/); }>
Defined in: keyring.ts:356
The source’s secret for a backup screen — gate it behind biometrics in the app.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### sourceId
[Section titled “sourceId”](#sourceid-3)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<{ `chain?`: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/); `passphrase?`: `string`; `secret`: `string`; `type`: [`SourceType`](/api/anywalletkit/keyring/type-aliases/sourcetype/); }>
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**<`A`>(`accountId`, `chain`): `Promise`<[`AccountHandle`](/api/anywalletkit/keyring/interfaces/accounthandle/)<`A`>>
Defined in: keyring.ts:549
The live account for `accountId` on `chain`. Reads the source’s secret, builds the chain manager, returns the account; `dispose()` zeroizes it. Prefer [withAccount](/api/anywalletkit/keyring/classes/keyring/#withaccount), which disposes for you.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### A
[Section titled “A”](#a)
`A` *extends* `IWalletAccount` = `IWalletAccount`
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### accountId
[Section titled “accountId”](#accountid-1)
`string`
##### chain
[Section titled “chain”](#chain-1)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`AccountHandle`](/api/anywalletkit/keyring/interfaces/accounthandle/)<`A`>>
***
### getAccountMeta()
[Section titled “getAccountMeta()”](#getaccountmeta)
> **getAccountMeta**(`accountId`): [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)
Defined in: keyring.ts:244
One account’s metadata.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### accountId
[Section titled “accountId”](#accountid-2)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)
#### Throws
[Section titled “Throws”](#throws)
[KeyringError](/api/anywalletkit/keyring/classes/keyringerror/) `not-found` for an unknown id.
***
### importMnemonic()
[Section titled “importMnemonic()”](#importmnemonic)
> **importMnemonic**(`mnemonic`, `options?`): `Promise`<{ `accounts`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]; `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
Defined in: keyring.ts:267
Import a BIP-39 seed. Adds account 0, then — with `discover` — every further account `isUsed` reports, stopping after `gapLimit` unused ones in a row.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### mnemonic
[Section titled “mnemonic”](#mnemonic)
`string`
##### options?
[Section titled “options?”](#options-3)
###### adoptId?
[Section titled “adoptId?”](#adoptid)
`string`
Adopt a seed the app ALREADY keeps in SecretStorage under this id (a wallet that predates the keyring): the source takes this id and nothing is written to SecretStorage — or deleted from it if the import fails. The id is read once (one prompt) and must hold this phrase and passphrase, as `{"type":"mnemonic","mnemonic":…}`; anything else is refused.
###### discover?
[Section titled “discover?”](#discover)
[`DiscoverOptions`](/api/anywalletkit/keyring/interfaces/discoveroptions/)
###### label?
[Section titled “label?”](#label-1)
`string`
###### passphrase?
[Section titled “passphrase?”](#passphrase)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `accounts`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]; `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
***
### importPrivateKey()
[Section titled “importPrivateKey()”](#importprivatekey)
> **importPrivateKey**(`chain`, `key`, `options?`): `Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
Defined in: keyring.ts:316
Import one private key as a single account on `chain`.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### chain
[Section titled “chain”](#chain-2)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
##### key
[Section titled “key”](#key)
`string`
##### options?
[Section titled “options?”](#options-4)
###### label?
[Section titled “label?”](#label-2)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
***
### importTonMnemonic()
[Section titled “importTonMnemonic()”](#importtonmnemonic)
> **importTonMnemonic**(`words`, `options?`): `Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
Defined in: keyring.ts:331
Import a TON-native 24-word mnemonic (Tonkeeper, Tonhub, MyTonWallet): one TON account with the address those wallets show. Needs the TON chain registered with `WalletManagerTon` (it carries `fromTonMnemonic`).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### words
[Section titled “words”](#words-1)
`string`
##### options?
[Section titled “options?”](#options-5)
###### label?
[Section titled “label?”](#label-3)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<{ `account`: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/); `source`: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/); }>
***
### listAccounts()
[Section titled “listAccounts()”](#listaccounts)
> **listAccounts**(`options?`): [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]
Defined in: keyring.ts:233
Accounts in creation order, without secrets. Hidden ones only with `includeHidden`; pass `sourceId` for one source’s accounts.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### options?
[Section titled “options?”](#options-6)
###### includeHidden?
[Section titled “includeHidden?”](#includehidden)
`boolean`
###### sourceId?
[Section titled “sourceId?”](#sourceid-4)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
[`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]
***
### listSources()
[Section titled “listSources()”](#listsources)
> **listSources**(): [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/)\[]
Defined in: keyring.ts:225
Every key source, without secrets.
#### Returns
[Section titled “Returns”](#returns-15)
[`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/)\[]
***
### missingChains()
[Section titled “missingChains()”](#missingchains)
> **missingChains**(`accountId`): [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)\[]
Defined in: keyring.ts:447
Registered chains a seed account has no stored address for — a chain that joined the keyring after the account was created. Empty for an imported key (one chain by construction). No secret is read.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### accountId
[Section titled “accountId”](#accountid-3)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)\[]
***
### previewPrivateKey()
[Section titled “previewPrivateKey()”](#previewprivatekey)
> **previewPrivateKey**(`chain`, `key`): `Promise`<`string`>
Defined in: keyring.ts:310
The address a private key would import as — shown to the user before `importPrivateKey`. Stores nothing.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### chain
[Section titled “chain”](#chain-3)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
##### key
[Section titled “key”](#key-1)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`string`>
***
### removeSource()
[Section titled “removeSource()”](#removesource)
> **removeSource**(`sourceId`): `Promise`<`void`>
Defined in: keyring.ts:344
Remove a source, its accounts and its secret. The metadata goes first, with the id written down as a pending delete; only then is the secret deleted. A failed save leaves everything as it was; a failed (or interrupted) delete is retried on the next `Keyring.load`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### sourceId
[Section titled “sourceId”](#sourceid-5)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`void`>
***
### renameAccount()
[Section titled “renameAccount()”](#renameaccount)
> **renameAccount**(`accountId`, `name`): `Promise`<`void`>
Defined in: keyring.ts:511
Rename an account. The name is trimmed.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### accountId
[Section titled “accountId”](#accountid-4)
`string`
##### name
[Section titled “name”](#name-1)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`void`>
#### Throws
[Section titled “Throws”](#throws-1)
[KeyringError](/api/anywalletkit/keyring/classes/keyringerror/) `invalid-input` when the name is empty or longer than 64 characters.
***
### setActiveAccount()
[Section titled “setActiveAccount()”](#setactiveaccount)
> **setActiveAccount**(`accountId`): `Promise`<`void`>
Defined in: keyring.ts:534
Make an account the active one.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### accountId
[Section titled “accountId”](#accountid-5)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`void`>
#### Throws
[Section titled “Throws”](#throws-2)
[KeyringError](/api/anywalletkit/keyring/classes/keyringerror/) `unsupported` when the account is hidden.
***
### setHidden()
[Section titled “setHidden()”](#sethidden)
> **setHidden**(`accountId`, `hidden`): `Promise`<`void`>
Defined in: keyring.ts:520
Hide or show an account. Hiding the active one moves “active” to the first visible account.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### accountId
[Section titled “accountId”](#accountid-6)
`string`
##### hidden
[Section titled “hidden”](#hidden)
`boolean`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`void`>
***
### withAccount()
[Section titled “withAccount()”](#withaccount)
> **withAccount**<`T`, `A`>(`accountId`, `chain`, `fn`): `Promise`<`T`>
Defined in: keyring.ts:575
Run `fn` with the live account and dispose it afterwards, whatever happens.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters-1)
##### T
[Section titled “T”](#t)
`T`
##### A
[Section titled “A”](#a-1)
`A` *extends* `IWalletAccount` = `IWalletAccount`
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### accountId
[Section titled “accountId”](#accountid-7)
`string`
##### chain
[Section titled “chain”](#chain-4)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
##### fn
[Section titled “fn”](#fn)
(`account`) => `Promise`<`T`>
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`T`>
***
### load()
[Section titled “load()”](#load)
> `static` **load**(`options`): `Promise`<`Keyring`>
Defined in: keyring.ts:203
Open the keyring: read the stored state (or start empty) and remember the chains.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### options
[Section titled “options”](#options-7)
[`KeyringOptions`](/api/anywalletkit/keyring/interfaces/keyringoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`Keyring`>
#### Throws
[Section titled “Throws”](#throws-3)
[KeyringError](/api/anywalletkit/keyring/classes/keyringerror/) `invalid-input` when no chain is registered, `unsupported` for a stored state of an unknown version.
# KeyringError
Defined in: errors.ts:2
Bad input (seed, key, label) or a keyring rule (duplicate, unknown id). Messages are safe to show the user and never contain secrets.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KeyringError**(`message`, `code?`): `KeyringError`
Defined in: errors.ts:5
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
[`KeyringErrorCode`](/api/anywalletkit/keyring/type-aliases/keyringerrorcode/) = `'invalid-input'`
#### Returns
[Section titled “Returns”](#returns)
`KeyringError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`KeyringErrorCode`](/api/anywalletkit/keyring/type-aliases/keyringerrorcode/)
Defined in: errors.ts:4
Machine-readable reason; see [KeyringErrorCode](/api/anywalletkit/keyring/type-aliases/keyringerrorcode/).
# formatPrivateKey
> **formatPrivateKey**(`chain`, `privateKey`, `options?`): [`FormattedPrivateKey`](/api/anywalletkit/keyring/interfaces/formattedprivatekey/)
Defined in: keys.ts:148
The inverse of [parsePrivateKey](/api/anywalletkit/keyring/functions/parseprivatekey/), in the format each chain’s wallets import:
* EVM: `0x` + 64 hex (MetaMask, Rabby); Tron: 64 hex (TronLink).
* BTC, Zcash: compressed WIF (`K…` / `L…`; testnet `c…`). Electrum needs a `p2wpkh:` prefix to land on the same SegWit address.
* Solana: base58 of the 64-byte secret key (seed ‖ public key), as Phantom exports.
* NEAR: `ed25519:` + base58 of the 64-byte secret key (near-cli, MyNearWallet).
* TON: hex of the 64-byte secret key (seed ‖ public key). TON wallets themselves import only 24-word phrases.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
### options?
[Section titled “options?”](#options)
#### testnet?
[Section titled “testnet?”](#testnet)
`boolean`
## Returns
[Section titled “Returns”](#returns)
[`FormattedPrivateKey`](/api/anywalletkit/keyring/interfaces/formattedprivatekey/)
# isChainKey
> **isChainKey**(`value`): `value is ChainKey`
Defined in: chains.ts:40
Type guard: true when `value` is one of [CHAIN_KEYS](/api/anywalletkit/keyring/variables/chain_keys/).
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`string`
## Returns
[Section titled “Returns”](#returns)
`value is ChainKey`
# keyFingerprint
> **keyFingerprint**(`chain`, `publicKey`): `string`
Defined in: keys.ts:66
Duplicate check without keeping the secret: chain + a hash of the public key.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# parsePrivateKey
> **parsePrivateKey**(`chain`, `input`): [`ParsedKey`](/api/anywalletkit/keyring/interfaces/parsedkey/)
Defined in: keys.ts:27
Formats accepted per chain:
* EVM, Tron: 32-byte hex, with or without `0x`.
* BTC, Zcash: WIF (compressed, mainnet `K…`/`L…` or testnet `c…`), or 32-byte hex.
* Solana: base58 64-byte secret key (Phantom export), the JSON byte array (solana-keygen / Phantom “array” export), or a base58 32-byte seed.
* TON: hex of the 32-byte seed or the 64-byte secret key (seed ‖ public key).
* NEAR: `ed25519:` of the 64-byte secret key (or a 32-byte seed). A 64-byte ed25519 secret must carry its own public key — a mismatch is refused.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
### input
[Section titled “input”](#input)
`string`
## Returns
[Section titled “Returns”](#returns)
[`ParsedKey`](/api/anywalletkit/keyring/interfaces/parsedkey/)
# publicKeyOf
> **publicKeyOf**(`parsed`): `Uint8Array`
Defined in: keys.ts:61
Public key of a parsed key (33-byte compressed secp256k1, or 32-byte ed25519).
## Parameters
[Section titled “Parameters”](#parameters)
### parsed
[Section titled “parsed”](#parsed)
[`ParsedKey`](/api/anywalletkit/keyring/interfaces/parsedkey/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# AccountHandle
Defined in: keyring.ts:138
An account on one chain, live until `dispose()` — which zeroizes the key material it holds.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### A
[Section titled “A”](#a)
`A` *extends* `IWalletAccount` = `IWalletAccount`
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `A`
Defined in: keyring.ts:140
The live account. Do not use it after `dispose()`.
## Methods
[Section titled “Methods”](#methods)
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: keyring.ts:142
Zeroize the key material behind the account.
#### Returns
[Section titled “Returns”](#returns)
`void`
# AccountMeta
Defined in: keyring.ts:78
One account as stored in public metadata: its name, flags and addresses on every chain. Reading it never touches a secret.
## Properties
[Section titled “Properties”](#properties)
### addresses
[Section titled “addresses”](#addresses)
> **addresses**: `Partial`<`Record`<[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/), `string`>>
Defined in: keyring.ts:90
Public addresses per registered chain, computed once at creation.
***
### hidden
[Section titled “hidden”](#hidden)
> **hidden**: `boolean`
Defined in: keyring.ts:88
Hidden accounts are left out of `listAccounts()` unless `includeHidden` is set.
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: keyring.ts:80
`/` for a seed account, `` for a single-key one.
***
### index
[Section titled “index”](#index)
> **index**: `number` | `null`
Defined in: keyring.ts:84
BIP-44 account index; null for a single-key account.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: keyring.ts:86
Name shown to the user (1–64 characters).
***
### sourceId
[Section titled “sourceId”](#sourceid)
> **sourceId**: `string`
Defined in: keyring.ts:82
Source the account belongs to.
# ChainSpec
Defined in: chains.ts:7
How the keyring derives one chain’s accounts from a seed.
## Properties
[Section titled “Properties”](#properties)
### accountPath
[Section titled “accountPath”](#accountpath)
> **accountPath**: (`index`) => `string`
Defined in: chains.ts:17
Account `i`’s path, as the chain manager derives it (documentation and vectors).
#### Parameters
[Section titled “Parameters”](#parameters)
##### index
[Section titled “index”](#index)
`number`
#### Returns
[Section titled “Returns”](#returns)
`string`
***
### compatibleWith
[Section titled “compatibleWith”](#compatiblewith)
> **compatibleWith**: `string`
Defined in: chains.ts:19
Which wallets derive the same account `i` from the same BIP-39 seed.
***
### curve
[Section titled “curve”](#curve)
> **curve**: `SignerCurve`
Defined in: chains.ts:9
Curve of the chain’s keys: `secp256k1` or `ed25519`.
***
### root
[Section titled “root”](#root)
> **root**: `string`
Defined in: chains.ts:15
Where the seed signer handed to the chain manager sits. The manager derives `getAccount(i)` below it, so the result is the same as building the manager from the mnemonic (TON’s manager wants its own base path exactly).
# DiscoverOptions
Defined in: keyring.ts:773
Options for [Keyring.discoverAccounts](/api/anywalletkit/keyring/classes/keyring/#discoveraccounts): how to tell a used account and when to stop probing.
## Properties
[Section titled “Properties”](#properties)
### gapLimit?
[Section titled “gapLimit?”](#gaplimit)
> `optional` **gapLimit?**: `number`
Defined in: keyring.ts:777
Unused accounts in a row before stopping. Default 1 (MetaMask / Phantom); BIP-44 says 20 for addresses.
***
### isUsed
[Section titled “isUsed”](#isused)
> **isUsed**: (`addresses`, `index`) => `Promise`<`boolean`>
Defined in: keyring.ts:775
Whether account `index` (its addresses per chain) has balance or history. The app supplies it — the SDK has no indexer.
#### Parameters
[Section titled “Parameters”](#parameters)
##### addresses
[Section titled “addresses”](#addresses)
`Partial`<`Record`<[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/), `string`>>
##### index
[Section titled “index”](#index)
`number`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`boolean`>
***
### maxIndex?
[Section titled “maxIndex?”](#maxindex)
> `optional` **maxIndex?**: `number`
Defined in: keyring.ts:779
Highest index probed. Default 20.
# FormattedPrivateKey
Defined in: keys.ts:133
A private key written for export by [formatPrivateKey](/api/anywalletkit/keyring/functions/formatprivatekey/).
## Properties
[Section titled “Properties”](#properties)
### format
[Section titled “format”](#format)
> **format**: [`PrivateKeyFormat`](/api/anywalletkit/keyring/type-aliases/privatekeyformat/)
Defined in: keys.ts:135
How `value` is written.
***
### value
[Section titled “value”](#value)
> **value**: `string`
Defined in: keys.ts:137
The key as text. Show it once behind authentication; never log or persist it.
# KeyringChain
Defined in: keyring.ts:120
One chain registered with the keyring: the chain package’s manager class and its config.
## Properties
[Section titled “Properties”](#properties)
### config?
[Section titled “config?”](#config)
> `optional` **config?**: `object`
Defined in: keyring.ts:124
Passed to the manager as is (RPC endpoints, network).
***
### Manager
[Section titled “Manager”](#manager)
> **Manager**: [`KeyringManagerClass`](/api/anywalletkit/keyring/type-aliases/keyringmanagerclass/)
Defined in: keyring.ts:122
The chain package’s manager class, for example `WalletManagerEvm`.
# KeyringOptions
Defined in: keyring.ts:128
Options for [Keyring.load](/api/anywalletkit/keyring/classes/keyring/#load).
## Properties
[Section titled “Properties”](#properties)
### chains
[Section titled “chains”](#chains)
> **chains**: `Partial`<`Record`<[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/), [`KeyringChain`](/api/anywalletkit/keyring/interfaces/keyringchain/)>>
Defined in: keyring.ts:134
Chains every seed account spans, e.g. `{ evm: { Manager: WalletManagerEvm, config } }`.
***
### secrets
[Section titled “secrets”](#secrets)
> **secrets**: [`SecretStorage`](/api/anywalletkit/keyring/interfaces/secretstorage/)
Defined in: keyring.ts:132
Where each source’s secret is kept: secure storage behind biometrics.
***
### storage
[Section titled “storage”](#storage)
> **storage**: [`KeyringStorage`](/api/anywalletkit/keyring/interfaces/keyringstorage/)
Defined in: keyring.ts:130
Where public metadata is kept.
# KeyringState
Defined in: keyring.ts:97
Everything the keyring stores through `KeyringStorage`: sources, accounts and the active account. Contains no secrets.
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: [`AccountMeta`](/api/anywalletkit/keyring/interfaces/accountmeta/)\[]
Defined in: keyring.ts:103
Every account, hidden ones included.
***
### activeAccountId
[Section titled “activeAccountId”](#activeaccountid)
> **activeAccountId**: `string` | `null`
Defined in: keyring.ts:105
The account the app shows, or `null` when there is none.
***
### pendingSecretDeletes?
[Section titled “pendingSecretDeletes?”](#pendingsecretdeletes)
> `optional` **pendingSecretDeletes?**: `string`\[]
Defined in: keyring.ts:110
Removed sources whose secret is not deleted yet. `removeSource` writes the id here first, so a failed or interrupted delete is finished on the next `Keyring.load`.
***
### sources
[Section titled “sources”](#sources)
> **sources**: [`SourceMeta`](/api/anywalletkit/keyring/interfaces/sourcemeta/)\[]
Defined in: keyring.ts:101
Every key source.
***
### version
[Section titled “version”](#version)
> **version**: `1`
Defined in: keyring.ts:99
Format version; `Keyring.load` refuses any other.
# KeyringStorage
Defined in: keyring.ts:25
Public keyring metadata — names, addresses, flags. Never a secret. Plain storage is fine.
## Methods
[Section titled “Methods”](#methods)
### load()
[Section titled “load()”](#load)
> **load**(): `Promise`<[`KeyringState`](/api/anywalletkit/keyring/interfaces/keyringstate/) | `null`>
Defined in: keyring.ts:27
The stored state, or `null` on first run.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`KeyringState`](/api/anywalletkit/keyring/interfaces/keyringstate/) | `null`>
***
### save()
[Section titled “save()”](#save)
> **save**(`state`): `Promise`<`void`>
Defined in: keyring.ts:29
Persist the state after every change.
#### Parameters
[Section titled “Parameters”](#parameters)
##### state
[Section titled “state”](#state)
[`KeyringState`](/api/anywalletkit/keyring/interfaces/keyringstate/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
# ParsedKey
Defined in: keys.ts:10
A private key read by [parsePrivateKey](/api/anywalletkit/keyring/functions/parseprivatekey/), bound to the chain it was parsed for.
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
Defined in: keys.ts:12
Chain the key was parsed for.
***
### privateKey
[Section titled “privateKey”](#privatekey)
> **privateKey**: `Uint8Array`
Defined in: keys.ts:14
The 32-byte private key (secp256k1 scalar or ed25519 seed). The caller owns and zeroizes it.
# SecretStorage
Defined in: keyring.ts:37
One secret per source, kept by the app in secure storage (Keychain / Keystore behind biometrics). The keyring reads a secret only for the call that needs it and drops it right after; it never caches one.
## Methods
[Section titled “Methods”](#methods)
### delete()
[Section titled “delete()”](#delete)
> **delete**(`sourceId`): `Promise`<`void`>
Defined in: keyring.ts:48
Delete the secret when the source is removed. Must be idempotent: deleting an id that is not there resolves. The keyring retries a delete that failed (or was cut short) on the next load.
#### Parameters
[Section titled “Parameters”](#parameters)
##### sourceId
[Section titled “sourceId”](#sourceid)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`sourceId`): `Promise`<`string` | `null`>
Defined in: keyring.ts:41
The source’s secret, or `null` when it is missing (the keyring then throws `secret-missing`).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### sourceId
[Section titled “sourceId”](#sourceid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string` | `null`>
***
### set()
[Section titled “set()”](#set)
> **set**(`sourceId`, `secret`): `Promise`<`void`>
Defined in: keyring.ts:43
Store a new source’s secret. Called once, when the source is created or imported.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### sourceId
[Section titled “sourceId”](#sourceid-2)
`string`
##### secret
[Section titled “secret”](#secret)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
# SourceMeta
Defined in: keyring.ts:57
One key source as stored in public metadata. Never contains the secret.
## Properties
[Section titled “Properties”](#properties)
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)
Defined in: keyring.ts:67
privateKey / tonMnemonic: the one chain it signs on.
***
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: keyring.ts:71
Unix milliseconds when it was created or imported.
***
### fingerprint
[Section titled “fingerprint”](#fingerprint)
> **fingerprint**: `string`
Defined in: keyring.ts:65
Duplicate check: BIP-32 master fingerprint (+ passphrase) for a seed, chain + public-key hash for a key.
***
### hasPassphrase?
[Section titled “hasPassphrase?”](#haspassphrase)
> `optional` **hasPassphrase?**: `boolean`
Defined in: keyring.ts:69
mnemonic: a BIP-39 passphrase is part of the secret (the flag only, never the value).
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: keyring.ts:59
Stable id, also the key of the source’s secret in `SecretStorage`.
***
### label
[Section titled “label”](#label)
> **label**: `string`
Defined in: keyring.ts:63
Name shown to the user.
***
### type
[Section titled “type”](#type)
> **type**: [`SourceType`](/api/anywalletkit/keyring/type-aliases/sourcetype/)
Defined in: keyring.ts:61
What the source holds.
# ChainKey
> **ChainKey** = `"evm"` | `"solana"` | `"ton"` | `"tron"` | `"btc"` | `"near"` | `"zcash"`
Defined in: chains.ts:4
The chains a keyring account spans.
# KeyringErrorCode
> **KeyringErrorCode** = `"invalid-input"` | `"duplicate"` | `"not-found"` | `"unsupported"` | `"secret-missing"`
Defined in: errors.ts:17
Why a keyring call failed: bad input, a source that already exists, an unknown id, something the source cannot do (for example exporting a TON-native phrase as a key), or a secret missing from `SecretStorage`.
# KeyringManagerClass
> **KeyringManagerClass** = (`seedOrSigner`, `config`) => `WalletManager`<`IWalletAccount`, `object`>
Defined in: keyring.ts:117
A chain package’s manager class, as the kit registers it.
## Parameters
[Section titled “Parameters”](#parameters)
### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array` | `Signer`
### config
[Section titled “config”](#config)
`any`
## Returns
[Section titled “Returns”](#returns)
`WalletManager`<`IWalletAccount`, `object`>
# PrivateKeyFormat
> **PrivateKeyFormat** = `"hex"` | `"wif"` | `"base58"` | `"near"`
Defined in: keys.ts:130
How an exported key is written — the format other wallets import and `parsePrivateKey` reads back.
# SourceType
> **SourceType** = `"mnemonic"` | `"privateKey"` | `"tonMnemonic"`
Defined in: keyring.ts:54
What a source holds: a BIP-39 seed phrase, one imported private key, or TON-native 24 words.
# CHAIN_KEYS
> `const` **CHAIN_KEYS**: [`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/)\[]
Defined in: chains.ts:37
Every chain key the keyring knows, in a fixed order.
# CHAIN_SPECS
> `const` **CHAIN_SPECS**: `Readonly`<`Record`<[`ChainKey`](/api/anywalletkit/keyring/type-aliases/chainkey/), [`ChainSpec`](/api/anywalletkit/keyring/interfaces/chainspec/)>>
Defined in: chains.ts:26
Per-chain derivation. The index is the part that changes per account; every other segment is fixed. Golden vectors for i = 0..4 live in test/vectors.test.ts.
# @anywalletkit/kit
# @anywalletkit/kit
[Section titled “@anywalletkit/kit”](#anywalletkitkit)
[](https://www.npmjs.com/package/@anywalletkit/kit)
The orchestrator. Chain packages and protocol modules are registered; the kit hands out accounts by CAIP-2 chain id and protocols by name, all fed by one seed phrase (or its 64-byte seed) or one external `Signer`, all wrapped by the same policies. The phrase is turned into seed bytes in the constructor and never kept; no seed or key is ever an own property of a `Wallet`, manager, account or signer, so logs and serializers show no secret.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/kit
# or: pnpm add @anywalletkit/kit · yarn add @anywalletkit/kit
```
On npm: [@anywalletkit/kit](https://www.npmjs.com/package/@anywalletkit/kit), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import { Wallet } from '@anywalletkit/kit'
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import WalletManagerSolana from '@anywalletkit/wallet-solana'
const wallet = new Wallet(seedPhrase, {
policies: {
maxFee: { 'eip155:1': 10n ** 16n }, // 0.01 ETH
allowlist: { 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': [TREASURY] },
confirm: async (intent) => ui.confirm(intent), // last word before broadcast
},
})
wallet.registerWallet('eip155', WalletManagerEvm, { provider: ['https://rpc-a', 'https://rpc-b'] })
wallet.registerWallet('solana', WalletManagerSolana, { provider: SOL_RPC })
wallet.registerProtocol('lido', LidoProtocolEvm, { chain: 'eip155:1' })
const eth = await wallet.getAccount('eip155:1') // policies applied
await eth.transfer({ recipient: '0x…', amount: 10n ** 15n })
const lido = await wallet.getProtocol('lido')
wallet.dispose() // zeroizes the seed and every chain's keys; later calls throw
```
Policies run before anything is signed or broadcast, in this order: fee cap (quotes first, where the account can quote), allowlist, blocklist, `confirm`. `maxFee` (native base units) is checked on the quote of `sendTransaction`, `signTransaction` and `transfer`, then handed to the account as `WriteOptions.maxFee` so it holds for what is signed; `approve` (EVM), `sendSerialized` (Solana), `signRaw` (Tron), `revokeDelegation` and swap2’s `sendSerializedTransaction` hook get it the same way, checked by the account on the transaction it signs. Under a cap, a write that pays a fee but has nowhere to take one (`signBuilt`, `signCompiled`, `signTransactionMessage`) is refused; off-chain signatures are not capped. Every write surface of an account is covered — `sendTransaction`, `transfer`, `signTransaction` (a module that signs and broadcasts on its own cannot skip them), `sign`, NEAR’s `signNep413` and TON’s `signTonProof` / `signTonConnectData` (message signatures: `confirm` only, nothing moves), the approval surfaces `approve`, `signPermit` and EIP-2612 / Permit2 `signTypedData` (checked against the **spender**; `confirm` sees `kind: 'approval'` with `unlimited`), EIP-3009 `TransferWithAuthorization` / `ReceiveWithAuthorization`, ERC-2771 `ForwardRequest`, `MetaTransaction` and the 1inch LOP `Order` (`kind: 'send'`, judged by whom they pay), any other `signTypedData` (`kind: 'typedData'` with `destinationUnknown: true`: an allowlist refuses it, so does a blocklist without `confirm`; a blocklisted `verifyingContract` is refused), and chain-specific ones such as Tron’s `signRaw`, NEAR’s `signBuilt`, Solana’s `sendSerialized`. The rule is deny-by-default: any account method named `sign*` / `send*` / `approve*` / `revoke*` / `transfer*` is guarded unless it is listed in `UNGUARDED_WRITES`, so a new signing method in a chain package cannot bypass the policies by not being named. Reads are never intercepted. Nothing hands out a way around the wrapper: its `signer` is hidden, an account a method returns (NEAR’s `withAccountId`) comes back under the same policies, and `wallet.getManager(chain)` hands out guarded accounts (`getAccount`, `getAccountByPath`, `getNamedAccount`) and no seed or signer accessors. The wrappers hide the signer from descriptors and key listings too, refuse writes to the account (`_config` reads as a frozen copy), and under a `maxFee` rule refuse a `sign*` / `send*` helper the policies cannot quote. The boundary is what the wallet hands out: the `Wallet` object itself is the app’s — give modules and dApp bridges accounts, managers or protocols, never the `Wallet`. A protocol module always gets the wrapper, with policies or without: without any it is a wrapper with no rules (no limits, but no signer, no internal helpers and no writable settings). Chain accounts keep their signer in a private field, so not even the app’s own account (`getAccount` on a wallet without policies) has a `signer` property; `signerKind` says what holds the key.
The lists check every destination a write names (`intent.destinations`), not only the contract it calls: the recipient or spender inside standard token calls (ERC-20 / 721 / 1155 transfers, `approve`, `increaseAllowance`, `setApprovalForAll`, Permit2 `approve`, an on-chain EIP-2612 `permit`, ERC-677 `transferAndCall`), TRC-20 calls (by `parameters` and inside `raw_data_hex`), NEAR `ft_transfer(_call)` / `nft_transfer(_call)` / `storage_deposit` / `deleteAccount` (also in base64 borsh), TON jetton and NFT transfers (destination and excess receiver), the owner of the token account an SPL transfer pays (read through the account’s `getTokenAccountOwner`, only when a list or `confirm` applies), and whom a Solana Stake instruction pays or empowers. An allowlist must hold all of them. When part of a write cannot be read, the intent says `destinationUnknown`: an allowlist refuses it, and so does a blocklist with no `confirm` hook. `transfer` is judged by `recipient`, the field every chain pays. An approval is `unlimited` at type(uint128).max or above (core’s `isUnlimitedAllowance`), and when its amount cannot be read; a Permit2 batch lists every token in `intent.approvals`. The checks and the signature use one copy of the arguments, taken before the first check, and `confirm` gets its own: a getter, a `confirm` hook or a timer cannot change what is signed after it was judged.
A revoke is `kind: 'revoke'`: an `approve` / `signPermit` / EIP-2612 Permit of 0, raw revoke calldata (`approve(0x0, tokenId)`, `setApprovalForAll(…, false)`, Permit2 `lockdown`, or a batch of only these) and `revokeDelegation()`. Raw `approve(spender, 0)` is NOT a revoke: on an ERC-721 it approves `spender` for token #0, so it is checked as an approval of `spender`. It skips the allowlist and the spender’s blocklist entry (taking an allowance back from a blocklisted drainer must stay possible); the blocklist still applies to the contract called, the fee cap and `confirm` apply, and `confirm` sees `revokes: [{ token, spender }]`.
## Activity history
[Section titled “Activity history”](#activity-history)
`history()` is the wallet’s activity feed: one page across every chain that has a history source, newest first, every row described by the first registered protocol module whose `describeActivity` recognizes it (registration order), else by the generic fallback. Rows the source flagged as spam are hidden unless asked for.
```ts
import { createEvmHistory } from '@anywalletkit/history-evm'
const wallet = new Wallet(seedPhrase, {
activity: {
known: { 'eip155:8453': { '0x3fC9…7FAD': 'Uniswap Universal Router' } }, // subtitle for otherwise-anonymous contract calls
natives: { 'eip155:999999': { symbol: 'XYZ', decimals: 18 } }, // overrides the built-in table / swap2-assets catalog
onError: (e) => log.warn('activity', e), // a source down, a recognizer that threw, a journal write that failed
pendingTtl: 24 * 3600, // seconds a pending intent waits for its row (default)
},
})
wallet.registerWallet('eip155', WalletManagerEvm, { provider })
wallet.registerProtocol('aave', AaveProtocolEvm, { chain: 'eip155:8453' }) // every registered protocol is a recognizer
wallet.registerHistorySource(createEvmHistory({ chainId: 8453, etherscanApiKey }))
wallet.registerHistorySource(createEvmHistory({ chainId: 1, etherscanApiKey }))
const page = await wallet.history({ limit: 20 }) // account 0 on every chain with a source
const older = await wallet.history({ limit: 20, cursor: page.cursor })
// or explicit addresses / chains:
await wallet.history({ addresses: [{ chain: 'eip155:1', address }], includeSpam: true, since: lastRefresh })
const item = await wallet.describeTransaction(tx) // one ChainTx through the same pipeline, for a detail screen
```
`history(query)` → `{ items: FeedItem[], cursor?, errors? }`
* `query.addresses` (`{chain, address}[]`) or `query.index` (account index on every chain with a source, default 0); `chains` restricts; `limit` (default 20); `includeSpam`; `since` (unix seconds, for refresh); `cursor` from the previous page.
* `items` are `ActivityItem`s (`id = chain:hash`, `kind`, `title`, `subtitle`, `assetsOut` / `assetsIn` in base units with symbol and decimals, `counterparty`, `related`, `spam`, `fee`, `explorerUrl`) plus `intentId` when the row belongs to a journal intent and `approval` (`token`, `spender`, `amount`, `null` = unlimited) for `approve` / `revoke`.
* `cursor` packs every source’s own cursor into one opaque string; absent when every source is exhausted. Ordering is time desc, then chain, then hash. A source that returned a short page is never overtaken: older rows of other chains wait for its next page, so a row can never appear on a later page than a newer one. Sources with block-window pagination that answer empty pages are followed up to `maxEmptyHops` (default 3) per call.
* `errors` lists what failed this call (`stage: 'source' | 'recognizer' | 'journal'`, with `chain` / `module`). A failed source keeps its position in the cursor and is retried on the next call; a recognizer that throws is skipped for that row and the next recognizer / the fallback still runs. Nothing is silently dropped.
### Generic fallback
[Section titled “Generic fallback”](#generic-fallback)
`describeGeneric(tx, ctx, opts)` is exported and pure. From the owner’s point of view:
| kind | when | title / subtitle |
| -------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `send` | only own → others | “Sent USDC”, recipient label |
| `receive` | only others → own (also airdrops through someone else’s contract call) | “Received ETH”, sender label |
| `self` | own → own (two accounts of the wallet) | “Self-transfer”, moved amount in `assetsOut` |
| `approve` / `revoke` | owner called ERC-20 `approve` (0x095ea7b3); amount 0 = revoke, ≥ 2^255 = unlimited | “Approved USDC for Permit2”, `approval` filled |
| `contract` | any other call the owner made (amounts attached when something moved) | “Contract call”, `opts.known[chain][to]` label or `0x1234…abcd` |
| `unknown` | nothing moved, no call | “Transaction” |
Failed sends keep the intended amount (native value, or ERC-20 `transfer` calldata). Symbols and decimals come from the transfer rows, then the swap2-assets catalog, then the native table (`natives` option → built-in: GRAM on TON, SOL, TRX, BTC, NEAR → catalog natives for EVM chains → namespace default). `spam` is read from `raw.spam` / `tx.spam` (history-evm’s rules).
### Intent journal — the app-side contract
[Section titled “Intent journal — the app-side contract”](#intent-journal--the-app-side-contract)
On-chain rows cannot say “swapped USDC → ETH via 1Click” (the chain shows a USDC send to a deposit address), cannot pair a bridge’s two legs, and are not there until the explorer indexes them. The app records what it *meant* and the kit folds it in:
```ts
const journal = createMemoryIntentJournal() // or your own { list, put, remove } over SQLite / AsyncStorage
wallet.setIntentJournal(journal)
```
Write one `Intent` per user action, right after broadcast:
```ts
await journal.put({
id: crypto.randomUUID(), // or the provider's id (1Click deposit address, LI.FI route id)
kind: 'swap', // swap | bridge | stake | unstake | claim | supply | withdraw | borrow | repay | send | wrap | unwrap
createdAt: Math.floor(Date.now() / 1000),
chain: 'eip155:1', address: from, // where it started, who signed
hashes: [{ chain: 'eip155:1', hash: depositHash }], // source leg first; push the destination leg when the provider reports it
expect: { assetsOut: [{ token: USDC, amount, symbol: 'USDC', decimals: 6 }], assetsIn: [{ token: null, amount: quoteOut, symbol: 'ETH', decimals: 18 }] },
protocol: '@anywalletkit/protocol-swap2-near-intents',
subtitle: 'NEAR Intents',
status: 'pending',
})
```
What the app writes, per flow:
* **Swap / bridge (swap2)**: `kind` `swap` (same chain) or `bridge`, `hashes[0]` = the source transaction (deposit / router call), `expect` from the quote. When the provider’s status endpoint returns the destination hash, `put` the intent again with it appended to `hashes` (a relayer fill that is not the wallet’s own tx goes in `related`). For 1Click, where the user sends to a deposit address and the provider fills later, the deposit tx is `hashes[0]` and the fill hash is appended once `GET /status` returns it.
* **Earn (Aave / Morpho / Lido / Tonstakers / Jito …)**: `kind` `supply` / `withdraw` / `stake` / `unstake` / `claim`, `hashes[0]` the transaction, `protocol` the module name, `subtitle` the market label. Modules recognize these rows on their own; the intent matters only before the explorer indexes the row.
* **Send**: optional (`kind: 'send'`); useful for the pending row and for a contact label in `subtitle`.
* **Approvals**: not needed (the fallback and approvals module recognize them).
What `history()` does with the journal:
1. A row whose hash is in an intent inherits `kind`, `protocol`, `subtitle` and the expected assets **when the recognizer returned a generic item**; a recognizer’s verdict is kept. Every matched item carries `intentId` and `related` (the other legs).
2. A pending intent with no row on the first page is looked up with each leg’s `getTransaction` (explorer lag); found → emitted confirmed; not found → emitted at the top as `status: 'pending'`, `id: intent:`, titled from `expect`.
3. Two legs of one intent on the same page collapse into one item (the source leg), `assetsIn` from the destination row, `related` pointing at it; the destination row is dropped. Legs that fall on different pages each carry `intentId`; collapse by it in the app if you keep pages in memory.
4. Pending longer than `pendingTtl` (default 24 h) with no row → `status: 'failed'`, persisted. Failed intents keep showing at the top of the first page until the app `remove`s them (dismiss action).
5. Matched intents are written back as `confirmed` / `failed`. The kit never removes intents; prune confirmed ones older than your retention window.
Timestamps are unix seconds like `ChainTx.time`; amounts are base-unit bigints.
## Classes
[Section titled “Classes”](#classes)
* [InvalidCursorError](/api/anywalletkit/kit/classes/invalidcursorerror/)
* [PolicyViolationError](/api/anywalletkit/kit/classes/policyviolationerror/)
* [Wallet](/api/anywalletkit/kit/classes/wallet/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ActivityErrorReport](/api/anywalletkit/kit/interfaces/activityerrorreport/)
* [ActivityOptions](/api/anywalletkit/kit/interfaces/activityoptions/)
* [ActivityRecognizer](/api/anywalletkit/kit/interfaces/activityrecognizer/)
* [FeedAddress](/api/anywalletkit/kit/interfaces/feedaddress/)
* [FeedItem](/api/anywalletkit/kit/interfaces/feeditem/)
* [GenericActivityItem](/api/anywalletkit/kit/interfaces/genericactivityitem/)
* [GenericDescribeOptions](/api/anywalletkit/kit/interfaces/genericdescribeoptions/)
* [HistoryFeedPage](/api/anywalletkit/kit/interfaces/historyfeedpage/)
* [HistoryFeedQuery](/api/anywalletkit/kit/interfaces/historyfeedquery/)
* [Intent](/api/anywalletkit/kit/interfaces/intent/)
* [IntentJournal](/api/anywalletkit/kit/interfaces/intentjournal/)
* [NativeAsset](/api/anywalletkit/kit/interfaces/nativeasset/)
* [Policies](/api/anywalletkit/kit/interfaces/policies/)
* [SourceState](/api/anywalletkit/kit/interfaces/sourcestate/)
* [WalletOptions](/api/anywalletkit/kit/interfaces/walletoptions/)
* [WriteIntent](/api/anywalletkit/kit/interfaces/writeintent/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [FeedCursorState](/api/anywalletkit/kit/type-aliases/feedcursorstate/)
* [IntentStatus](/api/anywalletkit/kit/type-aliases/intentstatus/)
* [KnownLabels](/api/anywalletkit/kit/type-aliases/knownlabels/)
* [KnownWriteMethod](/api/anywalletkit/kit/type-aliases/knownwritemethod/)
* [ManagerClass](/api/anywalletkit/kit/type-aliases/managerclass/)
* [ProtocolClass](/api/anywalletkit/kit/type-aliases/protocolclass/)
* [WriteKind](/api/anywalletkit/kit/type-aliases/writekind/)
* [WriteMethod](/api/anywalletkit/kit/type-aliases/writemethod/)
## Variables
[Section titled “Variables”](#variables)
* [CHAIN_ALIASES](/api/anywalletkit/kit/variables/chain_aliases/)
* [DEFAULT_NATIVES](/api/anywalletkit/kit/variables/default_natives/)
* [ERC20_APPROVE](/api/anywalletkit/kit/variables/erc20_approve/)
* [ERC20_TRANSFER](/api/anywalletkit/kit/variables/erc20_transfer/)
* [ERC20_TRANSFER_FROM](/api/anywalletkit/kit/variables/erc20_transfer_from/)
* [GUARDED_PREFIXES](/api/anywalletkit/kit/variables/guarded_prefixes/)
* [GUARDED_WRITES](/api/anywalletkit/kit/variables/guarded_writes/)
* [UNGUARDED_WRITES](/api/anywalletkit/kit/variables/unguarded_writes/)
## Functions
[Section titled “Functions”](#functions)
* [addressLabel](/api/anywalletkit/kit/functions/addresslabel/)
* [applyIntent](/api/anywalletkit/kit/functions/applyintent/)
* [applyPolicies](/api/anywalletkit/kit/functions/applypolicies/)
* [assetLabel](/api/anywalletkit/kit/functions/assetlabel/)
* [assetMetaFor](/api/anywalletkit/kit/functions/assetmetafor/)
* [buildFeed](/api/anywalletkit/kit/functions/buildfeed/)
* [catalogChain](/api/anywalletkit/kit/functions/catalogchain/)
* [createMemoryIntentJournal](/api/anywalletkit/kit/functions/creatememoryintentjournal/)
* [describeGeneric](/api/anywalletkit/kit/functions/describegeneric/)
* [describeSingle](/api/anywalletkit/kit/functions/describesingle/)
* [describeWithRecognizers](/api/anywalletkit/kit/functions/describewithrecognizers/)
* [guardReturned](/api/anywalletkit/kit/functions/guardreturned/)
* [intentItem](/api/anywalletkit/kit/functions/intentitem/)
* [isGuardedWrite](/api/anywalletkit/kit/functions/isguardedwrite/)
* [isSignerLike](/api/anywalletkit/kit/functions/issignerlike/)
* [isSigningAccount](/api/anywalletkit/kit/functions/issigningaccount/)
* [isSpamTx](/api/anywalletkit/kit/functions/isspamtx/)
* [knownLabel](/api/anywalletkit/kit/functions/knownlabel/)
* [nativeOf](/api/anywalletkit/kit/functions/nativeof/)
* [resolvePrimaryType](/api/anywalletkit/kit/functions/resolveprimarytype/)
* [sameChain](/api/anywalletkit/kit/functions/samechain/)
* [selectorOf](/api/anywalletkit/kit/functions/selectorof/)
* [shortAddress](/api/anywalletkit/kit/functions/shortaddress/)
* [titleFor](/api/anywalletkit/kit/functions/titlefor/)
* [unpackCursor](/api/anywalletkit/kit/functions/unpackcursor/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [Wallet](/api/anywalletkit/kit/classes/wallet/)
# InvalidCursorError
Defined in: kit/src/activity/cursor.ts:41
Thrown by `history()` when the `cursor` passed back is not one the feed produced (edited, truncated or from another wallet build).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new InvalidCursorError**(`message?`): `InvalidCursorError`
Defined in: kit/src/activity/cursor.ts:42
#### Parameters
[Section titled “Parameters”](#parameters)
##### message?
[Section titled “message?”](#message)
`string` = `'The cursor is not one this feed produced.'`
#### Returns
[Section titled “Returns”](#returns)
`InvalidCursorError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# PolicyViolationError
Defined in: kit/src/policies.ts:243
Thrown before anything is signed when a write breaks a rule in [Policies](/api/anywalletkit/kit/interfaces/policies/). A rejected `confirm` throws `UserRejectedError` from core instead.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new PolicyViolationError**(`policy`, `message`): `PolicyViolationError`
Defined in: kit/src/policies.ts:250
#### Parameters
[Section titled “Parameters”](#parameters)
##### policy
[Section titled “policy”](#policy)
`"chain"` | `"maxFee"` | `"allowlist"` | `"blocklist"` | `"method"`
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`PolicyViolationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### policy
[Section titled “policy”](#policy-1)
> `readonly` **policy**: `"chain"` | `"maxFee"` | `"allowlist"` | `"blocklist"` | `"method"`
Defined in: kit/src/policies.ts:249
The rule that refused the write. `chain` means the account’s chain id is unknown, so no rule could be matched. `method` means the method is not part of the write surface the policies can read (see [GUARDED_WRITES](/api/anywalletkit/kit/variables/guarded_writes/)).
# Wallet
Defined in: kit/src/wallet.ts:61
The orchestrator. Register chain wallets by CAIP-2 namespace prefix (or exact chain id) and protocol modules by name; ask for accounts and protocols. One seed phrase (or external signer) feeds every registered chain. Policies wrap every account handed out. `dispose()` zeroizes everything.
A seed phrase is turned into the 64-byte seed in the constructor and the string is not kept (a JS string cannot be zeroized); each chain manager gets its own copy of the bytes. Pass the seed bytes instead of the phrase to never hand the words to the SDK at all.
```ts
const w = new Wallet(seed, { policies: { maxFee: { 'eip155:1': 10n ** 16n } } })
w.registerWallet('eip155', WalletManagerEvm, { provider: RPC })
w.registerWallet('solana', WalletManagerSolana, { provider: SOL_RPC })
w.registerProtocol('lido', LidoProtocolEvm, { chain: 'eip155:1' })
const eth = await w.getAccount('eip155:1')
const lido = await w.getProtocol('lido')
```
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Wallet**(`seedOrSigner`, `options?`): `Wallet`
Defined in: kit/src/wallet.ts:76
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### options?
[Section titled “options?”](#options)
[`WalletOptions`](/api/anywalletkit/kit/interfaces/walletoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`Wallet`
## Accessors
[Section titled “Accessors”](#accessors)
### chains
[Section titled “chains”](#chains)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **chains**(): `string`\[]
Defined in: kit/src/wallet.ts:124
Registered wallet keys.
##### Returns
[Section titled “Returns”](#returns-1)
`string`\[]
***
### historyChains
[Section titled “historyChains”](#historychains)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **historyChains**(): `string`\[]
Defined in: kit/src/wallet.ts:121
Chains with a registered history source.
##### Returns
[Section titled “Returns”](#returns-2)
`string`\[]
***
### protocols
[Section titled “protocols”](#protocols)
#### Get Signature
[Section titled “Get Signature”](#get-signature-2)
> **get** **protocols**(): `string`\[]
Defined in: kit/src/wallet.ts:126
Registered protocol names.
##### Returns
[Section titled “Returns”](#returns-3)
`string`\[]
## Methods
[Section titled “Methods”](#methods)
### describeTransaction()
[Section titled “describeTransaction()”](#describetransaction)
> **describeTransaction**(`tx`, `own?`, `index?`): `Promise`<[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)>
Defined in: kit/src/wallet.ts:290
One transaction through the same pipeline, for a detail screen. `own` defaults to the row’s own address.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### own?
[Section titled “own?”](#own)
`Iterable`<`string`> = `...`
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)>
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: kit/src/wallet.ts:297
Zeroize every manager and drop protocol instances.
#### Returns
[Section titled “Returns”](#returns-5)
`void`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**<`A`>(`chain`, `index?`): `Promise`<`A`>
Defined in: kit/src/wallet.ts:190
Account `index` on `chain`, wrapped with the wallet’s policies. Its writes are refused (`PolicyViolationError`, `policy: 'chain'`) when the account signs on another network than `chain` — one namespace registration with its RPC elsewhere — with or without policies; its reads (the address is the same across a family) keep working, so history and activity do.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### A
[Section titled “A”](#a)
`A` *extends* `IWalletAccount` = `IWalletAccount`
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### chain
[Section titled “chain”](#chain)
`string`
##### index?
[Section titled “index?”](#index-1)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`A`>
***
### getManager()
[Section titled “getManager()”](#getmanager)
> **getManager**<`M`>(`chain`): `M`
Defined in: kit/src/wallet.ts:151
The chain package’s manager (lazily constructed), behind the wallet’s policies: every account it hands out (`getAccount`, `getAccountByPath`, `getNamedAccount`…) is wrapped as [getAccount](/api/anywalletkit/kit/classes/wallet/#getaccount) wraps it, and its seed and signer accessors (`seedBytes`, `externalSigner`, `_`-prefixed state) are not reachable through it (round 3, H3).
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters-1)
##### M
[Section titled “M”](#m)
`M` *extends* `WalletManager`<`IWalletAccount`, `object`> = `WalletManager`<`IWalletAccount`, `object`>
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`M`
***
### getProtocol()
[Section titled “getProtocol()”](#getprotocol)
> **getProtocol**<`P`>(`name`, `index?`): `Promise`<`P`>
Defined in: kit/src/wallet.ts:227
The protocol instance (one per name), constructed over the account of its chain, never the raw account (see restrict).
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters-2)
##### P
[Section titled “P”](#p)
`P`
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### name
[Section titled “name”](#name)
`string`
##### index?
[Section titled “index?”](#index-2)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`P`>
***
### history()
[Section titled “history()”](#history)
> **history**(`query?`): `Promise`<[`HistoryFeedPage`](/api/anywalletkit/kit/interfaces/historyfeedpage/)>
Defined in: kit/src/wallet.ts:283
The activity feed: one page across every chain with a history source, newest first. Each row is described by the first registered protocol module that recognizes it, else by the generic fallback (send / receive / self / approve / revoke / contract); the intent journal adds pending rows, inherited kinds and cross-chain joins.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### query?
[Section titled “query?”](#query)
[`HistoryFeedQuery`](/api/anywalletkit/kit/interfaces/historyfeedquery/) = `{}`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`HistoryFeedPage`](/api/anywalletkit/kit/interfaces/historyfeedpage/)>
***
### registerHistorySource()
[Section titled “registerHistorySource()”](#registerhistorysource)
> **registerHistorySource**(`source`): `this`
Defined in: kit/src/wallet.ts:108
Register the history source of one chain (exact CAIP-2 id, one per chain).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### source
[Section titled “source”](#source)
`HistorySource`
#### Returns
[Section titled “Returns”](#returns-10)
`this`
***
### registerProtocol()
[Section titled “registerProtocol()”](#registerprotocol)
> **registerProtocol**<`P`, `C`>(`name`, `Protocol`, `options`): `this`
Defined in: kit/src/wallet.ts:101
Register a protocol module under a name, bound to the chain its account must come from.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters-3)
##### P
[Section titled “P”](#p-1)
`P`
##### C
[Section titled “C”](#c)
`C`
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### name
[Section titled “name”](#name-1)
`string`
##### Protocol
[Section titled “Protocol”](#protocol)
[`ProtocolClass`](/api/anywalletkit/kit/type-aliases/protocolclass/)<`P`, `C`>
##### options
[Section titled “options”](#options-1)
###### chain
[Section titled “chain”](#chain-2)
`string`
###### config?
[Section titled “config?”](#config)
`NoInfer`<`C`>
#### Returns
[Section titled “Returns”](#returns-11)
`this`
***
### registerWallet()
[Section titled “registerWallet()”](#registerwallet)
> **registerWallet**<`M`, `C`>(`key`, `Manager`, `config`): `this`
Defined in: kit/src/wallet.ts:94
Register a chain package under a CAIP-2 key: a full chain id (“eip155:1”) or a namespace (“eip155”, “solana”, “ton”, “tron”, “bip122”) that matches every chain id in it.
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters-4)
##### M
[Section titled “M”](#m-1)
`M` *extends* `WalletManager`<`IWalletAccount`, `object`>
##### C
[Section titled “C”](#c-1)
`C` *extends* `object`
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### key
[Section titled “key”](#key)
`string`
##### Manager
[Section titled “Manager”](#manager)
[`ManagerClass`](/api/anywalletkit/kit/type-aliases/managerclass/)<`M`, `C`>
##### config
[Section titled “config”](#config-1)
`NoInfer`<`C`>
#### Returns
[Section titled “Returns”](#returns-12)
`this`
***
### setIntentJournal()
[Section titled “setIntentJournal()”](#setintentjournal)
> **setIntentJournal**(`journal`): `this`
Defined in: kit/src/wallet.ts:115
The app’s intent journal (what it meant when it broadcast): `history()` folds it in. Pass `undefined` to detach.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### journal
[Section titled “journal”](#journal)
[`IntentJournal`](/api/anywalletkit/kit/interfaces/intentjournal/) | `undefined`
#### Returns
[Section titled “Returns”](#returns-13)
`this`
# addressLabel
> **addressLabel**(`known`, `chain`, `address`): `string`
Defined in: kit/src/activity/generic.ts:123
Label or shortened address.
## Parameters
[Section titled “Parameters”](#parameters)
### known
[Section titled “known”](#known)
[`KnownLabels`](/api/anywalletkit/kit/type-aliases/knownlabels/) | `undefined`
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# applyIntent
> **applyIntent**(`item`, `intent`, `opts?`): [`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
Defined in: kit/src/activity/feed.ts:152
Fold an intent into the item for one of its hashes: generic items inherit kind / protocol / subtitle / expected assets; every item learns its other legs.
## Parameters
[Section titled “Parameters”](#parameters)
### item
[Section titled “item”](#item)
[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
### intent
[Section titled “intent”](#intent)
[`Intent`](/api/anywalletkit/kit/interfaces/intent/)
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
# applyPolicies
> **applyPolicies**<`A`>(`account`, `policies`, `chain?`): `A`
Defined in: kit/src/policies.ts:818
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### A
[Section titled “A”](#a)
`A` *extends* `IWalletAccount`
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`A`
### policies
[Section titled “policies”](#policies)
[`Policies`](/api/anywalletkit/kit/interfaces/policies/)
### chain?
[Section titled “chain?”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`A`
# assetLabel
> **assetLabel**(`chain`, `a`, `opts?`): `string`
Defined in: kit/src/activity/generic.ts:190
Title label for an asset: symbol, the native coin, or a shortened token id.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### a
[Section titled “a”](#a)
`ActivityAsset`
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`string`
# assetMetaFor
> **assetMetaFor**(`tx`, `opts?`): (`token`) => `Partial`<`ActivityAsset`> | `undefined`
Defined in: kit/src/activity/generic.ts:158
Symbol / decimals per token: the transfers’ own metadata first, then the swap2-assets catalog, then the native table.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
(`token`) => `Partial`<`ActivityAsset`> | `undefined`
# buildFeed
> **buildFeed**(`input`): `Promise`<[`HistoryFeedPage`](/api/anywalletkit/kit/interfaces/historyfeedpage/)>
Defined in: kit/src/activity/feed.ts:218
One page of the merged feed.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`FeedInput`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`HistoryFeedPage`](/api/anywalletkit/kit/interfaces/historyfeedpage/)>
# catalogChain
> **catalogChain**(`chain`): `string`
Defined in: kit/src/activity/generic.ts:95
The catalog’s id for `chain` (itself when no alias exists).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# createMemoryIntentJournal
> **createMemoryIntentJournal**(`initial?`): [`IntentJournal`](/api/anywalletkit/kit/interfaces/intentjournal/) & `object`
Defined in: kit/src/activity/journal.ts:64
In-memory journal: tests, scripts, and apps that hydrate it from their own storage.
## Parameters
[Section titled “Parameters”](#parameters)
### initial?
[Section titled “initial?”](#initial)
[`Intent`](/api/anywalletkit/kit/interfaces/intent/)\[] = `[]`
## Returns
[Section titled “Returns”](#returns)
[`IntentJournal`](/api/anywalletkit/kit/interfaces/intentjournal/) & `object`
# describeGeneric
> **describeGeneric**(`tx`, `ctx`, `opts?`): [`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/)
Defined in: kit/src/activity/generic.ts:243
Describe `tx` when no protocol module claimed it. Never returns null: every row gets at least `unknown`. Spam rows (`raw.spam` / `tx.spam`) carry `spam: true`.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/)
# describeSingle
> **describeSingle**(`tx`, `own`, `recognizers`, `journal`, `opts`): `Promise`<[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)>
Defined in: kit/src/activity/feed.ts:458
One transaction through the same pipeline (recognizers → generic → intent inheritance), for detail screens.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### own
[Section titled “own”](#own)
`Set`<`string`>
### recognizers
[Section titled “recognizers”](#recognizers)
readonly [`ActivityRecognizer`](/api/anywalletkit/kit/interfaces/activityrecognizer/)\[]
### journal
[Section titled “journal”](#journal)
[`IntentJournal`](/api/anywalletkit/kit/interfaces/intentjournal/) | `undefined`
### opts
[Section titled “opts”](#opts)
[`ActivityOptions`](/api/anywalletkit/kit/interfaces/activityoptions/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)>
# describeWithRecognizers
> **describeWithRecognizers**(`tx`, `own`, `recognizers`, `opts`, `report?`): [`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
Defined in: kit/src/activity/feed.ts:123
Run the recognizers in order (first non-null wins, a throw is isolated) and fall back to the generic description.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### own
[Section titled “own”](#own)
`Set`<`string`>
### recognizers
[Section titled “recognizers”](#recognizers)
readonly [`ActivityRecognizer`](/api/anywalletkit/kit/interfaces/activityrecognizer/)\[]
### opts
[Section titled “opts”](#opts)
[`ActivityOptions`](/api/anywalletkit/kit/interfaces/activityoptions/)
### report?
[Section titled “report?”](#report)
(`r`) => `void`
## Returns
[Section titled “Returns”](#returns)
[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
# guardReturned
> **guardReturned**(`value`, `wrap`): `unknown`
Defined in: kit/src/policies.ts:810
What a method behind a policy wrapper returns: a signing account comes back wrapped (`wrap`), a signer not at all; a promise is mapped the same way once it settles. Anything else is as is.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
### wrap
[Section titled “wrap”](#wrap)
(`account`) => `unknown`
## Returns
[Section titled “Returns”](#returns)
`unknown`
# intentItem
> **intentItem**(`intent`, `status`, `opts?`): [`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
Defined in: kit/src/activity/feed.ts:168
The feed row for an intent that has no on-chain row (yet): `status` pending or failed, id `intent:`.
## Parameters
[Section titled “Parameters”](#parameters)
### intent
[Section titled “intent”](#intent)
[`Intent`](/api/anywalletkit/kit/interfaces/intent/)
### status
[Section titled “status”](#status)
`ChainTxStatus`
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
# isGuardedWrite
> **isGuardedWrite**(`name`): `boolean`
Defined in: kit/src/policies.ts:50
Is `name` a method the policies wrap (or, outside [GUARDED_WRITES](/api/anywalletkit/kit/variables/guarded_writes/), refuse)? Reads (`get…`, `quote…`, `describe…`) never match.
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isSignerLike
> **isSignerLike**(`v`): `boolean`
Defined in: kit/src/policies.ts:801
A `Signer` (`sign(bytes)` signs anything, unchecked): never handed out through a policy wrapper.
## Parameters
[Section titled “Parameters”](#parameters)
### v
[Section titled “v”](#v)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isSigningAccount
> **isSigningAccount**(`v`): `v is IWalletAccount`
Defined in: kit/src/policies.ts:794
A signing account — what [applyPolicies](/api/anywalletkit/kit/functions/applypolicies/) wraps: it has an address, a chain and a write method.
## Parameters
[Section titled “Parameters”](#parameters)
### v
[Section titled “v”](#v)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`v is IWalletAccount`
# isSpamTx
> **isSpamTx**(`tx`): `boolean`
Defined in: kit/src/activity/generic.ts:134
Source-flagged spam (`raw.spam` from history-evm, or the `spam` mirror on the row).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# knownLabel
> **knownLabel**(`known`, `chain`, `address`): `string` | `undefined`
Defined in: kit/src/activity/generic.ts:110
The caller’s label for an address on a chain, if any (EVM: case-insensitive).
## Parameters
[Section titled “Parameters”](#parameters)
### known
[Section titled “known”](#known)
[`KnownLabels`](/api/anywalletkit/kit/type-aliases/knownlabels/) | `undefined`
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string` | `null` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# nativeOf
> **nativeOf**(`chain`, `opts?`): [`NativeAsset`](/api/anywalletkit/kit/interfaces/nativeasset/)
Defined in: kit/src/activity/generic.ts:98
The native coin of `chain`: options → built-in table → swap2-assets catalog → namespace default.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`NativeAsset`](/api/anywalletkit/kit/interfaces/nativeasset/)
# resolvePrimaryType
> **resolvePrimaryType**(`typed`): `string`
Defined in: kit/src/policies.ts:398
The EIP-712 primary type exactly as wallet-evm’s signer picks it (scan F13): the explicit `primaryType`, else the unique type no other type references (`inferPrimaryType` in wallet-evm/read-only-account.ts). Ambiguous → throws, as the signer does — the policy must never judge a different struct than the one that gets signed.
## Parameters
[Section titled “Parameters”](#parameters)
### typed
[Section titled “typed”](#typed)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string`
# sameChain
> **sameChain**(`a`, `b`): `boolean`
Defined in: kit/src/chain-id.ts:42
Do two CAIP-2 ids name the same network (`solana:mainnet` = `solana:5eykt…`, `tron:728126428` = `tron:0x2b6653dc`)?
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
### b
[Section titled “b”](#b)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# selectorOf
> **selectorOf**(`call`): `string` | `undefined`
Defined in: kit/src/activity/generic.ts:126
4-byte selector of an EVM call, from `call.selector` or the calldata.
## Parameters
[Section titled “Parameters”](#parameters)
### call
[Section titled “call”](#call)
`ChainCall` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# shortAddress
> **shortAddress**(`a`): `string`
Defined in: kit/src/activity/generic.ts:107
`0x1234…abcd` (anything 14 chars or shorter prints whole).
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# titleFor
> **titleFor**(`kind`, `chain`, `assetsOut`, `assetsIn`, `opts?`): `string`
Defined in: kit/src/activity/generic.ts:214
A title for `kind` from what moved: “Swapped USDC → ETH”, “Bridged USDC”, “Received ETH”, “Staked ETH”… Used when an item inherits its kind from an intent and for pending intents.
## Parameters
[Section titled “Parameters”](#parameters)
### kind
[Section titled “kind”](#kind)
`ActivityKind`
### chain
[Section titled “chain”](#chain)
`string`
### assetsOut
[Section titled “assetsOut”](#assetsout)
`ActivityAsset`\[]
### assetsIn
[Section titled “assetsIn”](#assetsin)
`ActivityAsset`\[]
### opts?
[Section titled “opts?”](#opts)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`string`
# unpackCursor
> **unpackCursor**(`cursor`): [`FeedCursorState`](/api/anywalletkit/kit/type-aliases/feedcursorstate/) | `undefined`
Defined in: kit/src/activity/cursor.ts:46
Parse a cursor; `undefined` (first page) gives `undefined` so callers start every source at its newest page.
## Parameters
[Section titled “Parameters”](#parameters)
### cursor
[Section titled “cursor”](#cursor)
`string` | `undefined`
## Returns
[Section titled “Returns”](#returns)
[`FeedCursorState`](/api/anywalletkit/kit/type-aliases/feedcursorstate/) | `undefined`
# ActivityErrorReport
Defined in: kit/src/activity/feed.ts:25
One isolated failure while building a feed page. The rest of the page is still returned.
## Properties
[Section titled “Properties”](#properties)
### address?
[Section titled “address?”](#address)
> `optional` **address?**: `string`
Defined in: kit/src/activity/feed.ts:31
Address of the failing source, when it was a source.
***
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: `string`
Defined in: kit/src/activity/feed.ts:29
Chain of the failing source, when it was a source.
***
### error
[Section titled “error”](#error)
> **error**: `unknown`
Defined in: kit/src/activity/feed.ts:35
What was thrown.
***
### module?
[Section titled “module?”](#module)
> `optional` **module?**: `string`
Defined in: kit/src/activity/feed.ts:33
Recognizer name (registered protocol name) for `recognizer` failures.
***
### stage
[Section titled “stage”](#stage)
> **stage**: `"source"` | `"recognizer"` | `"journal"`
Defined in: kit/src/activity/feed.ts:27
Where it failed: reading a history source, a recognizer that threw, or the intent journal.
# ActivityOptions
Defined in: kit/src/activity/feed.ts:39
Options for the activity feed, set once with `WalletOptions.activity`.
## Extends
[Section titled “Extends”](#extends)
* [`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/)
## Properties
[Section titled “Properties”](#properties)
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: (`chain`, `hash`) => `string` | `undefined`
Defined in: kit/src/activity/generic.ts:32
Explorer URL for an item (the kit passes the chain’s `HistorySource.explorerTxUrl`).
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/).[`explorerUrl`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/#explorerurl)
***
### known?
[Section titled “known?”](#known)
> `optional` **known?**: [`KnownLabels`](/api/anywalletkit/kit/type-aliases/knownlabels/)
Defined in: kit/src/activity/generic.ts:28
Labels for contracts / counterparties the app trusts or names (“Uniswap v3 Router”), per chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/).[`known`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/#known)
***
### maxEmptyHops?
[Section titled “maxEmptyHops?”](#maxemptyhops)
> `optional` **maxEmptyHops?**: `number`
Defined in: kit/src/activity/feed.ts:47
Empty pages with a cursor (block-window sources) followed per source per call. Default 3.
***
### natives?
[Section titled “natives?”](#natives)
> `optional` **natives?**: `Record`<`string`, [`NativeAsset`](/api/anywalletkit/kit/interfaces/nativeasset/)>
Defined in: kit/src/activity/generic.ts:30
Native coin per CAIP-2 chain; overrides the built-in table and the swap2-assets catalog.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/).[`natives`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/#natives)
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: kit/src/activity/feed.ts:45
Clock in unix seconds (tests).
#### Returns
[Section titled “Returns”](#returns-1)
`number`
***
### onError?
[Section titled “onError?”](#onerror)
> `optional` **onError?**: (`report`) => `void`
Defined in: kit/src/activity/feed.ts:41
Called for every isolated failure (a source that errored, a recognizer that threw, a journal write that failed). Failures also ride in `HistoryFeedPage.errors`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### report
[Section titled “report”](#report)
[`ActivityErrorReport`](/api/anywalletkit/kit/interfaces/activityerrorreport/)
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### pendingTtl?
[Section titled “pendingTtl?”](#pendingttl)
> `optional` **pendingTtl?**: `number`
Defined in: kit/src/activity/feed.ts:43
Seconds a pending intent may wait for its row before it is marked failed. Default 86 400 (24 h).
***
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: (`chain`, `token`) => { `decimals`: `number`; `symbol`: `string`; } | `undefined`
Defined in: kit/src/activity/generic.ts:39
The app’s own token list (custom tokens the user added, `@anywalletkit/tokens`): ERC-20s outside the swap2-assets catalog. Used for symbols and decimals, and to know an `approve(x, 0)` on such a token is an ERC-20 revoke. Without it an unlisted token’s approval reads as “Approved 0x1234…”.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### chain
[Section titled “chain”](#chain-1)
`string`
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
{ `decimals`: `number`; `symbol`: `string`; } | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`GenericDescribeOptions`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/).[`tokens`](/api/anywalletkit/kit/interfaces/genericdescribeoptions/#tokens)
# ActivityRecognizer
Defined in: kit/src/activity/feed.ts:14
A protocol module as the feed sees it: a name for error reports and the pure `describeActivity`.
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: kit/src/activity/feed.ts:16
Module name, used in error reports.
## Methods
[Section titled “Methods”](#methods)
### describe()
[Section titled “describe()”](#describe)
> **describe**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: kit/src/activity/feed.ts:21
The module’s `describeActivity`: an item when the module recognizes the transaction, `null` otherwise. Must be pure.
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# FeedAddress
Defined in: kit/src/activity/feed.ts:51
One (chain, address) pair the feed reads history for.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: kit/src/activity/feed.ts:51
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: kit/src/activity/feed.ts:51
# FeedItem
Defined in: kit/src/activity/feed.ts:75
An activity item as the feed emits it.
## Extends
[Section titled “Extends”](#extends)
* [`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/)
## Properties
[Section titled “Properties”](#properties)
### approval?
[Section titled “approval?”](#approval)
> `optional` **approval?**: `object`
Defined in: kit/src/activity/generic.ts:45
For `approve` / `revoke`: the allowance that was set. `amount: null` = unlimited (≥ 2^255).
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
#### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`approval`](/api/anywalletkit/kit/interfaces/genericactivityitem/#approval)
***
### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: `ActivityAsset`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:275
What arrived.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`assetsIn`](/api/anywalletkit/kit/interfaces/genericactivityitem/#assetsin)
***
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `ActivityAsset`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:273
What left the wallet.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`assetsOut`](/api/anywalletkit/kit/interfaces/genericactivityitem/#assetsout)
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:257
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`chain`](/api/anywalletkit/kit/interfaces/genericactivityitem/#chain)
***
### counterparty?
[Section titled “counterparty?”](#counterparty)
> `optional` **counterparty?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:277
The other party: recipient, sender, spender, contract.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`counterparty`](/api/anywalletkit/kit/interfaces/genericactivityitem/#counterparty)
***
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:288
Link to the transaction in a block explorer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`explorerUrl`](/api/anywalletkit/kit/interfaces/genericactivityitem/#explorerurl)
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:286
Network fee paid, native base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`fee`](/api/anywalletkit/kit/interfaces/genericactivityitem/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:259
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`hash`](/api/anywalletkit/kit/interfaces/genericactivityitem/#hash)
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:255
`${chain}:${hash}` — unique across chains.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`id`](/api/anywalletkit/kit/interfaces/genericactivityitem/#id)
***
### intentId?
[Section titled “intentId?”](#intentid)
> `optional` **intentId?**: `string`
Defined in: kit/src/activity/feed.ts:77
Journal intent this row belongs to.
***
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: core/dist/index-QWdcwE6y.d.ts:265
What happened, from the owner’s side.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`kind`](/api/anywalletkit/kit/interfaces/genericactivityitem/#kind)
***
### protocol?
[Section titled “protocol?”](#protocol)
> `optional` **protocol?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:267
Registry module name that recognized it (e.g. “@anywalletkit/protocol-lending-aave-evm”); undefined for the generic fallback.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`protocol`](/api/anywalletkit/kit/interfaces/genericactivityitem/#protocol)
***
### related?
[Section titled “related?”](#related)
> `optional` **related?**: `object`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:279
For cross-chain operations: the other leg (chain + hash) when known.
#### chain
[Section titled “chain”](#chain-1)
> **chain**: `string`
#### hash
[Section titled “hash”](#hash-1)
> **hash**: `string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`related`](/api/anywalletkit/kit/interfaces/genericactivityitem/#related)
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:284
Source flagged it as spam / dust (unsolicited airdrop, zero-value transfer). The app hides these by default.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`spam`](/api/anywalletkit/kit/interfaces/genericactivityitem/#spam)
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:263
Whether the transaction succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`status`](/api/anywalletkit/kit/interfaces/genericactivityitem/#status)
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:271
Protocol / venue / counterparty label for the subtitle, e.g. “Aave v3 · Base”, “LI.FI”, “0x1234…abcd”.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`subtitle`](/api/anywalletkit/kit/interfaces/genericactivityitem/#subtitle)
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:261
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`time`](/api/anywalletkit/kit/interfaces/genericactivityitem/#time)
***
### title
[Section titled “title”](#title)
> **title**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:269
Short human title, e.g. “Supplied USDC”, “Swapped ETH → USDC”, “Sent USDT”.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`GenericActivityItem`](/api/anywalletkit/kit/interfaces/genericactivityitem/).[`title`](/api/anywalletkit/kit/interfaces/genericactivityitem/#title)
# GenericActivityItem
Defined in: kit/src/activity/generic.ts:43
What the generic fallback adds to an `ActivityItem`.
## Extends
[Section titled “Extends”](#extends)
* `ActivityItem`
## Extended by
[Section titled “Extended by”](#extended-by)
* [`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)
## Properties
[Section titled “Properties”](#properties)
### approval?
[Section titled “approval?”](#approval)
> `optional` **approval?**: `object`
Defined in: kit/src/activity/generic.ts:45
For `approve` / `revoke`: the allowance that was set. `amount: null` = unlimited (≥ 2^255).
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
#### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: `ActivityAsset`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:275
What arrived.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ActivityItem.assetsIn`
***
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `ActivityAsset`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:273
What left the wallet.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ActivityItem.assetsOut`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:257
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ActivityItem.chain`
***
### counterparty?
[Section titled “counterparty?”](#counterparty)
> `optional` **counterparty?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:277
The other party: recipient, sender, spender, contract.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ActivityItem.counterparty`
***
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:288
Link to the transaction in a block explorer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ActivityItem.explorerUrl`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:286
Network fee paid, native base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ActivityItem.fee`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:259
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ActivityItem.hash`
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:255
`${chain}:${hash}` — unique across chains.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ActivityItem.id`
***
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: core/dist/index-QWdcwE6y.d.ts:265
What happened, from the owner’s side.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ActivityItem.kind`
***
### protocol?
[Section titled “protocol?”](#protocol)
> `optional` **protocol?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:267
Registry module name that recognized it (e.g. “@anywalletkit/protocol-lending-aave-evm”); undefined for the generic fallback.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ActivityItem.protocol`
***
### related?
[Section titled “related?”](#related)
> `optional` **related?**: `object`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:279
For cross-chain operations: the other leg (chain + hash) when known.
#### chain
[Section titled “chain”](#chain-1)
> **chain**: `string`
#### hash
[Section titled “hash”](#hash-1)
> **hash**: `string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ActivityItem.related`
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:284
Source flagged it as spam / dust (unsolicited airdrop, zero-value transfer). The app hides these by default.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ActivityItem.spam`
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:263
Whether the transaction succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`ActivityItem.status`
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:271
Protocol / venue / counterparty label for the subtitle, e.g. “Aave v3 · Base”, “LI.FI”, “0x1234…abcd”.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`ActivityItem.subtitle`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:261
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`ActivityItem.time`
***
### title
[Section titled “title”](#title)
> **title**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:269
Short human title, e.g. “Supplied USDC”, “Swapped ETH → USDC”, “Sent USDT”.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`ActivityItem.title`
# GenericDescribeOptions
Defined in: kit/src/activity/generic.ts:26
Labels the generic describer uses when no module recognizes a transaction: known contract names, native coins, explorer links.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`ActivityOptions`](/api/anywalletkit/kit/interfaces/activityoptions/)
## Properties
[Section titled “Properties”](#properties)
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: (`chain`, `hash`) => `string` | `undefined`
Defined in: kit/src/activity/generic.ts:32
Explorer URL for an item (the kit passes the chain’s `HistorySource.explorerTxUrl`).
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
***
### known?
[Section titled “known?”](#known)
> `optional` **known?**: [`KnownLabels`](/api/anywalletkit/kit/type-aliases/knownlabels/)
Defined in: kit/src/activity/generic.ts:28
Labels for contracts / counterparties the app trusts or names (“Uniswap v3 Router”), per chain.
***
### natives?
[Section titled “natives?”](#natives)
> `optional` **natives?**: `Record`<`string`, [`NativeAsset`](/api/anywalletkit/kit/interfaces/nativeasset/)>
Defined in: kit/src/activity/generic.ts:30
Native coin per CAIP-2 chain; overrides the built-in table and the swap2-assets catalog.
***
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: (`chain`, `token`) => { `decimals`: `number`; `symbol`: `string`; } | `undefined`
Defined in: kit/src/activity/generic.ts:39
The app’s own token list (custom tokens the user added, `@anywalletkit/tokens`): ERC-20s outside the swap2-assets catalog. Used for symbols and decimals, and to know an `approve(x, 0)` on such a token is an ERC-20 revoke. Without it an unlisted token’s approval reads as “Approved 0x1234…”.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain-1)
`string`
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
{ `decimals`: `number`; `symbol`: `string`; } | `undefined`
# HistoryFeedPage
Defined in: kit/src/activity/feed.ts:81
One page of the activity feed, newest first.
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: kit/src/activity/feed.ts:85
Pass back to get the next (older) page; absent when every source is exhausted.
***
### errors?
[Section titled “errors?”](#errors)
> `optional` **errors?**: [`ActivityErrorReport`](/api/anywalletkit/kit/interfaces/activityerrorreport/)\[]
Defined in: kit/src/activity/feed.ts:87
Isolated failures of this call; the affected source keeps its position and is retried next call.
***
### items
[Section titled “items”](#items)
> **items**: [`FeedItem`](/api/anywalletkit/kit/interfaces/feeditem/)\[]
Defined in: kit/src/activity/feed.ts:83
Rows of this page, newest first, with readable titles.
# HistoryFeedQuery
Defined in: kit/src/activity/feed.ts:57
Query for `wallet.history()`: which addresses and chains, the page size and the cursor from the previous page.
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: [`FeedAddress`](/api/anywalletkit/kit/interfaces/feedaddress/)\[]
Defined in: kit/src/activity/feed.ts:59
Which (chain, address) pairs to read. Default: account `index` on every chain with a history source.
***
### chains?
[Section titled “chains?”](#chains)
> `optional` **chains?**: `string`\[]
Defined in: kit/src/activity/feed.ts:63
Restrict to these CAIP-2 chains.
***
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: kit/src/activity/feed.ts:65
Cursor from the previous page.
***
### includeSpam?
[Section titled “includeSpam?”](#includespam)
> `optional` **includeSpam?**: `boolean`
Defined in: kit/src/activity/feed.ts:69
Show rows the source flagged as spam. Default false.
***
### index?
[Section titled “index?”](#index)
> `optional` **index?**: `number`
Defined in: kit/src/activity/feed.ts:61
Account index resolved on every chain when `addresses` is omitted. Default 0.
***
### limit?
[Section titled “limit?”](#limit)
> `optional` **limit?**: `number`
Defined in: kit/src/activity/feed.ts:67
Items per page (default 20).
***
### since?
[Section titled “since?”](#since)
> `optional` **since?**: `number`
Defined in: kit/src/activity/feed.ts:71
Only transactions newer than this unix time (refresh).
# Intent
Defined in: kit/src/activity/journal.ts:25
One user action as the app saw it when it broadcast: kind, chain, the hashes it produced and what it expected to move. The feed shows it as a pending row and merges it into the on-chain rows once they appear.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: kit/src/activity/journal.ts:35
Wallet address that signed.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: kit/src/activity/journal.ts:33
Chain the action started on (CAIP-2) and the wallet address that signed.
***
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: kit/src/activity/journal.ts:31
Unix seconds when the user confirmed the action.
***
### expect?
[Section titled “expect?”](#expect)
> `optional` **expect?**: `object`
Defined in: kit/src/activity/journal.ts:39
What the app expected to leave / arrive (quote amounts), used while pending and when the recognizer saw nothing.
#### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: `ActivityAsset`\[]
#### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `ActivityAsset`\[]
***
### hashes
[Section titled “hashes”](#hashes)
> **hashes**: `object`\[]
Defined in: kit/src/activity/journal.ts:37
Every transaction hash this action produced or expects, source leg first. A cross-chain swap lists both legs once known.
#### chain
[Section titled “chain”](#chain-1)
> **chain**: `string`
#### hash
[Section titled “hash”](#hash)
> **hash**: `string`
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: kit/src/activity/journal.ts:27
App-chosen, unique: a UUID, or the provider’s own id (1Click deposit address, LI.FI route id…). Emitted as `intent:` while pending.
***
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: kit/src/activity/journal.ts:29
What the user did: `swap`, `bridge`, `send`, `supply`…
***
### protocol?
[Section titled “protocol?”](#protocol)
> `optional` **protocol?**: `string`
Defined in: kit/src/activity/journal.ts:41
Registry module name that executed it, e.g. “@anywalletkit/protocol-swap2-lifi”.
***
### related?
[Section titled “related?”](#related)
> `optional` **related?**: `object`\[]
Defined in: kit/src/activity/journal.ts:45
Other legs that are not this wallet’s own transactions (a relayer’s fill, a destination deposit).
#### chain
[Section titled “chain”](#chain-2)
> **chain**: `string`
#### hash
[Section titled “hash”](#hash-1)
> **hash**: `string`
***
### status
[Section titled “status”](#status)
> **status**: [`IntentStatus`](/api/anywalletkit/kit/type-aliases/intentstatus/)
Defined in: kit/src/activity/journal.ts:47
Current state; the feed updates it as rows arrive.
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: kit/src/activity/journal.ts:43
Venue / counterparty label, e.g. “LI.FI”, “Aave v3 · Base”.
# IntentJournal
Defined in: kit/src/activity/journal.ts:54
Storage for intents, implemented by the app (SQLite, AsyncStorage, a file). Pass it to `wallet.setIntentJournal()`; `createMemoryIntentJournal()` is the in-memory one.
## Methods
[Section titled “Methods”](#methods)
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`Intent`](/api/anywalletkit/kit/interfaces/intent/)\[]>
Defined in: kit/src/activity/journal.ts:56
Every intent the app still wants in the feed (pending, and confirmed ones until the app prunes them).
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`Intent`](/api/anywalletkit/kit/interfaces/intent/)\[]>
***
### put()
[Section titled “put()”](#put)
> **put**(`intent`): `Promise`<`void`>
Defined in: kit/src/activity/journal.ts:58
Insert or replace by `id`.
#### Parameters
[Section titled “Parameters”](#parameters)
##### intent
[Section titled “intent”](#intent)
[`Intent`](/api/anywalletkit/kit/interfaces/intent/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`id`): `Promise`<`void`>
Defined in: kit/src/activity/journal.ts:60
Delete by `id`; the app calls it to prune old confirmed intents.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
# NativeAsset
Defined in: kit/src/activity/generic.ts:17
Native coin of a chain, for titles and amounts.
## Properties
[Section titled “Properties”](#properties)
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: kit/src/activity/generic.ts:17
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: kit/src/activity/generic.ts:17
# Policies
Defined in: kit/src/policies.ts:224
Rules the kit checks before every signature and broadcast of an account it hands out. Keys of the per-chain records are CAIP-2 ids or namespace prefixes (`eip155`). A namespace key covers every chain of the family, and an exact id’s rules apply on top of it: every matching fee cap is checked, a destination must be on every matching allowlist, and any matching blocklist refuses. An id matches its network in any spelling: `solana:mainnet` = `solana:5eykt…`, `tron:728126428` = `tron:mainnet` = `tron:0x2b6653dc`, `bitcoin:mainnet` = `bip122:0000…`, `eip155:0x1` = `eip155:1`; the `bitcoin` namespace is `bip122`.
## Properties
[Section titled “Properties”](#properties)
### allowlist?
[Section titled “allowlist?”](#allowlist)
> `optional` **allowlist?**: `Record`<`string`, `string`\[]>
Defined in: kit/src/policies.ts:232
Per-chain allowlist of destinations (case-insensitive) — recipients, called contracts and approval spenders. Writes to anything else throw.
***
### blocklist?
[Section titled “blocklist?”](#blocklist)
> `optional` **blocklist?**: `Record`<`string`, `string`\[]>
Defined in: kit/src/policies.ts:234
Per-chain blocklist of destinations — recipients, called contracts and approval spenders.
***
### confirm?
[Section titled “confirm?”](#confirm)
> `optional` **confirm?**: (`intent`) => `boolean` | `Promise`<`boolean`>
Defined in: kit/src/policies.ts:236
Last word before broadcast: return false (or throw) to reject. Hook a confirmation UI here.
#### Parameters
[Section titled “Parameters”](#parameters)
##### intent
[Section titled “intent”](#intent)
[`WriteIntent`](/api/anywalletkit/kit/interfaces/writeintent/)
#### Returns
[Section titled “Returns”](#returns)
`boolean` | `Promise`<`boolean`>
***
### maxFee?
[Section titled “maxFee?”](#maxfee)
> `optional` **maxFee?**: `Record`<`string`, `number` | `bigint`>
Defined in: kit/src/policies.ts:230
Per-chain fee cap in native base units. A quote above it throws before `confirm`; the cap is then handed to the account as `WriteOptions.maxFee`, so chain packages check it again on the transaction they sign (EVM: gas limit with headroom × the signed gas price).
# SourceState
Defined in: kit/src/activity/cursor.ts:7
One opaque cursor for a feed that merges several chains. Per (chain, address) source it keeps the source’s own cursor for the page to fetch next and how many rows at the head of that page the previous call already emitted (a page is refetched and skipped when the merge consumed only part of it).
## Properties
[Section titled “Properties”](#properties)
### c?
[Section titled “c?”](#c)
> `optional` **c?**: `string`
Defined in: kit/src/activity/cursor.ts:9
Source cursor for the page to fetch (undefined = the newest page).
***
### l?
[Section titled “l?”](#l)
> `optional` **l?**: `string`
Defined in: kit/src/activity/cursor.ts:17
Id (`chain:hash`) of the last row of that page already emitted. When the page comes back shifted (new transactions landed at the head), the feed skips through this row instead of counting `n`, so nothing is shown twice.
***
### n
[Section titled “n”](#n)
> **n**: `number`
Defined in: kit/src/activity/cursor.ts:11
Rows at the head of that page already emitted.
# WalletOptions
Defined in: kit/src/wallet.ts:19
Options for [Wallet](/api/anywalletkit/kit/classes/wallet/).
## Properties
[Section titled “Properties”](#properties)
### activity?
[Section titled “activity?”](#activity)
> `optional` **activity?**: [`ActivityOptions`](/api/anywalletkit/kit/interfaces/activityoptions/)
Defined in: kit/src/wallet.ts:25
Activity feed options: known-contract labels per chain, native coins, error hook, pending-intent TTL.
***
### policies?
[Section titled “policies?”](#policies)
> `optional` **policies?**: [`Policies`](/api/anywalletkit/kit/interfaces/policies/)
Defined in: kit/src/wallet.ts:23
Safety rules applied to every account and protocol the wallet hands out; see [Policies](/api/anywalletkit/kit/interfaces/policies/).
# WriteIntent
Defined in: kit/src/policies.ts:152
What a policy sees before a write goes out. Amounts in base units when known.
## Properties
[Section titled “Properties”](#properties)
### amount?
[Section titled “amount?”](#amount)
> `optional` **amount?**: `bigint`
Defined in: kit/src/policies.ts:180
Amount when it can be read off the call (allowance for approvals).
***
### approvals?
[Section titled “approvals?”](#approvals)
> `optional` **approvals?**: `object`\[]
Defined in: kit/src/policies.ts:191
Approvals: every token the write grants, one entry each (a Permit2 batch carries several). `token` / `amount` above are set only when there is exactly one.
#### amount?
[Section titled “amount?”](#amount-1)
> `optional` **amount?**: `bigint`
#### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
#### unlimited
[Section titled “unlimited”](#unlimited)
> **unlimited**: `boolean`
***
### attachedValue?
[Section titled “attachedValue?”](#attachedvalue)
> `optional` **attachedValue?**: `bigint`
Defined in: kit/src/policies.ts:199
TON jetton `transfer()`: nanotons attached to the jetton-wallet call. The jetton wallet keeps the gas, forwards `forwardTonAmount` to the recipient and returns the rest to the response destination. Undefined when the caller did not set it (the wallet’s default applies).
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: kit/src/policies.ts:154
CAIP-2 chain id of the account that writes.
***
### deadline?
[Section titled “deadline?”](#deadline)
> `optional` **deadline?**: `bigint`
Defined in: kit/src/policies.ts:193
Approvals / permits: expiry as given (unix seconds).
***
### destinations
[Section titled “destinations”](#destinations)
> **destinations**: `string`\[]
Defined in: kit/src/policies.ts:170
Every destination the write goes to, read per chain shape (scan F16/F17): each EVM call’s `to`, the NEAR `receiverId` (also of a base64 borsh transaction), Tron recipient / contract / resource receiver decoded from `raw_data_hex` (never the optional JSON copy), every TON message, the recipients and programs of decoded Solana instructions. Approvals: the spender; revokes: the contracts called; message signatures: none. The allow/block lists check all of them.
***
### destinationUnknown
[Section titled “destinationUnknown”](#destinationunknown)
> **destinationUnknown**: `boolean`
Defined in: kit/src/policies.ts:176
Part of the write could not be read (an unknown shape, undecodable bytes, a lookup-table account): `destinations` may be incomplete. With a blocklist for the chain and no `confirm` hook the write is refused; with `confirm`, the hook sees this flag and decides; an allowlist refuses it.
***
### forwardTonAmount?
[Section titled “forwardTonAmount?”](#forwardtonamount)
> `optional` **forwardTonAmount?**: `bigint`
Defined in: kit/src/policies.ts:201
TON jetton `transfer()`: nanotons forwarded to the recipient with the transfer notification, when set.
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: kit/src/policies.ts:156
Account address the write originates from.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`WriteKind`](/api/anywalletkit/kit/type-aliases/writekind/)
Defined in: kit/src/policies.ts:160
What the write does; see [WriteKind](/api/anywalletkit/kit/type-aliases/writekind/).
***
### message
[Section titled “message”](#message)
> **message**: `boolean`
Defined in: kit/src/policies.ts:212
True for `kind: 'message'`: allow/block lists do not apply, only `confirm`. Typed data is judged by the lists (scan 2026-10-28 F7).
***
### method
[Section titled “method”](#method)
> **method**: [`WriteMethod`](/api/anywalletkit/kit/type-aliases/writemethod/)
Defined in: kit/src/policies.ts:158
The account method that was called.
***
### raw
[Section titled “raw”](#raw)
> **raw**: `unknown`
Defined in: kit/src/policies.ts:210
The raw argument (first argument of the call), for policies that need more.
***
### revokes?
[Section titled “revokes?”](#revokes)
> `optional` **revokes?**: `object`\[]
Defined in: kit/src/policies.ts:203
Revokes: what each one takes away (`spender` absent for a per-token NFT approval and an EIP-7702 delegation).
#### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
#### token
[Section titled “token”](#token-1)
> **token**: `string`
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: kit/src/policies.ts:162
Destination when it can be read off the call: recipient, called contract, or the SPENDER of an approval. Read off `to` / `recipient` as given (apps match on it); the lists use [WriteIntent.destinations](/api/anywalletkit/kit/interfaces/writeintent/#destinations).
***
### token?
[Section titled “token?”](#token-2)
> `optional` **token?**: `string`
Defined in: kit/src/policies.ts:178
Token identifier for token transfers and approvals; undefined = native.
***
### unlimited?
[Section titled “unlimited?”](#unlimited-1)
> `optional` **unlimited?**: `boolean`
Defined in: kit/src/policies.ts:186
Approvals: the allowance is unbounded — type(uint128).max or above (`isUnlimitedAllowance` in core), a DAI-style `allowed`, or an amount the policies cannot read (the worst case is shown). For a Permit2 batch: any of its entries.
***
### verifyingContract?
[Section titled “verifyingContract?”](#verifyingcontract)
> `optional` **verifyingContract?**: `string`
Defined in: kit/src/policies.ts:208
`signTypedData`: the domain’s `verifyingContract` as given. It is not one of `destinations` (an allowlist names spenders and recipients, not tokens), but a blocklist refuses it.
# FeedCursorState
> **FeedCursorState** = `Record`<`string`, [`SourceState`](/api/anywalletkit/kit/interfaces/sourcestate/)>
Defined in: kit/src/activity/cursor.ts:21
Source key → state; a key that is absent is exhausted.
# IntentStatus
> **IntentStatus** = `"pending"` | `"confirmed"` | `"failed"`
Defined in: kit/src/activity/journal.ts:18
Where an intent is: `pending` until its transactions are seen, then `confirmed`, or `failed` when it waited longer than `pendingTtl` or a leg failed.
# KnownLabels
> **KnownLabels** = `Record`<`string`, `Record`<`string`, `string`>>
Defined in: kit/src/activity/generic.ts:20
Address → label, per CAIP-2 chain (EVM addresses compared case-insensitively).
# KnownWriteMethod
> **KnownWriteMethod** = `"sendTransaction"` | `"transfer"` | `"signTransaction"` | `"sign"` | `"signTypedData"` | `"signPermit"` | `"approve"` | `"signRaw"` | `"signNep413"` | `"signBuilt"` | `"signTonProof"` | `"signTonConnectData"` | `"sendSerialized"` | `"signCompiled"` | `"signTransactionMessage"` | `"revokeDelegation"` | `"sendSerializedTransaction"`
Defined in: kit/src/policies.ts:18
Account methods the policies guard — everything that produces a signature or a broadcast. The known surface is listed; any other method whose name starts with `sign`, `send`, `approve`, `revoke` or `transfer` (camelCase boundary) is refused outright behind the wrapper: the policies cannot read what an unlisted method signs (a chain package’s internal helper takes its recipient somewhere the rules never look — scan 2026-10-27 F1), so a new signing method must be listed here, with its intent, before it is reachable. Opting a method out is an explicit, reviewed entry in [UNGUARDED_WRITES](/api/anywalletkit/kit/variables/unguarded_writes/).
# ManagerClass
> **ManagerClass**<`M`, `C`> = (`seedOrSigner`, `config`) => `M`
Defined in: kit/src/wallet.ts:8
A chain package’s manager class.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### M
[Section titled “M”](#m)
`M` *extends* `WalletManager`<`IWalletAccount`, `object`>
### C
[Section titled “C”](#c)
`C` *extends* `object`
## Parameters
[Section titled “Parameters”](#parameters)
### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array` | `Signer`
### config
[Section titled “config”](#config)
`C`
## Returns
[Section titled “Returns”](#returns)
`M`
# ProtocolClass
> **ProtocolClass**<`P`, `C`> = (`account`, `config`) => `P`
Defined in: kit/src/wallet.ts:12
A protocol module’s class: (account, config) → protocol.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### P
[Section titled “P”](#p)
`P`
### C
[Section titled “C”](#c)
`C` = `any`
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
### config
[Section titled “config”](#config)
`C`
## Returns
[Section titled “Returns”](#returns)
`P`
# WriteKind
> **WriteKind** = `"send"` | `"approval"` | `"typedData"` | `"message"` | `"revoke"`
Defined in: kit/src/policies.ts:127
What a write does, as the policies classify it. The kind decides which rules apply: lists and fee cap for `send`, a spender check for `approval`, `confirm` only for messages.
# WriteMethod
> **WriteMethod** = [`KnownWriteMethod`](/api/anywalletkit/kit/type-aliases/knownwritemethod/) | `string` & `object`
Defined in: kit/src/policies.ts:28
A method name the policies may see: one of [KnownWriteMethod](/api/anywalletkit/kit/type-aliases/knownwritemethod/), or any other name a chain package adds.
# CHAIN_ALIASES
> `const` **CHAIN_ALIASES**: `Readonly`<`Record`<`string`, `string`>>
Defined in: kit/src/activity/generic.ts:89
The wallet packages name non-EVM chains by genesis hash (CAIP-2 proper); the swap2-assets catalog and most apps use the short ids. Map the former to the latter for catalog lookups and labels.
# DEFAULT_NATIVES
> `const` **DEFAULT_NATIVES**: `Readonly`<`Record`<`string`, [`NativeAsset`](/api/anywalletkit/kit/interfaces/nativeasset/)>>
Defined in: kit/src/activity/generic.ts:68
Built-in native coins by exact CAIP-2 id (the swap2-assets catalog covers the EVM chains it lists).
# ERC20_APPROVE
> `const` **ERC20_APPROVE**: `"0x095ea7b3"` = `'0x095ea7b3'`
Defined in: kit/src/activity/generic.ts:49
Selector of ERC-20 `approve(address,uint256)`.
# ERC20_TRANSFER
> `const` **ERC20_TRANSFER**: `"0xa9059cbb"` = `'0xa9059cbb'`
Defined in: kit/src/activity/generic.ts:51
Selector of ERC-20 `transfer(address,uint256)`.
# ERC20_TRANSFER_FROM
> `const` **ERC20_TRANSFER_FROM**: `"0x23b872dd"` = `'0x23b872dd'`
Defined in: kit/src/activity/generic.ts:53
Selector of ERC-20 `transferFrom(address,address,uint256)`.
# GUARDED_PREFIXES
> `const` **GUARDED_PREFIXES**: readonly `string`\[]
Defined in: kit/src/policies.ts:42
Name prefixes that mark a write even when the method is not listed above (such a method is refused).
# GUARDED_WRITES
> `const` **GUARDED_WRITES**: readonly [`KnownWriteMethod`](/api/anywalletkit/kit/type-aliases/knownwritemethod/)\[]
Defined in: kit/src/policies.ts:34
The known write methods, wrapped on every account the kit hands out. Names outside this list are still guarded when they start with one of [GUARDED_PREFIXES](/api/anywalletkit/kit/variables/guarded_prefixes/).
# UNGUARDED_WRITES
> `const` **UNGUARDED_WRITES**: readonly `string`\[]
Defined in: kit/src/policies.ts:47
Explicit, reviewed opt-outs. A name here is NOT guarded even if it matches a prefix. `transferActions` (NEAR) builds the actions of a transfer and signs nothing.
# @anywalletkit/names-ens
# @anywalletkit/names-ens
[Section titled “@anywalletkit/names-ens”](#anywalletkitnames-ens)
[](https://www.npmjs.com/package/@anywalletkit/names-ens)
**ENS names for wallets built on Any Wallet Kit: `vitalik.eth`, `name.base.eth`, `alice.cb.id` → the address for one chain, verified primary names, avatars, and the warnings a user should see next to a name.**
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/names-ens @anywalletkit/core
# or: pnpm add @anywalletkit/names-ens @anywalletkit/core · yarn add @anywalletkit/names-ens @anywalletkit/core
```
On npm: [@anywalletkit/names-ens](https://www.npmjs.com/package/@anywalletkit/names-ens), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Implements the `NameResolver` interface from `@anywalletkit/core`, so SNS (`.sol`), TON DNS (`.ton`) and NEAR accounts can sit behind the same `nameResolvers([...])` later.
## What it does
[Section titled “What it does”](#what-it-does)
* **Normalization per ENSIP-15** (viem’s `normalize`, i.e. `@adraffy/ens-normalize`). Invalid names and illegal script mixtures are refused with the reason as the message, before any I/O.
* **Forward resolution** through the Universal Resolver: wildcard names (ENSIP-10) and off-chain resolvers via CCIP-Read (`cb.id`, `uni.eth`, Basenames) work out of the box.
* **One chain per call (ENSIP-9/11).** `resolve(name, 'eip155:8453')` reads the Base record (coin type `0x80000000 | 8453`), `bip122:…` reads the Bitcoin script record, `solana:…` the Solana key. A name with no record for that chain is `no-address-for-chain`. **It never falls back to the Ethereum address** — sending vitalik’s mainnet address to Base is the bug this guards against.
* **Reverse / primary name**, including L2 primary names (ENSIP-19) by coin type. A primary name counts only when it resolves forward to the same address.
* **Avatars** (ENSIP-12): https / ipfs / NFT, returned as a URL. Fetch it through your own proxy; the resolver never fetches the image.
* **Warnings** on every resolution: `confusable` (a label written in Cyrillic lookalikes of Latin letters), `mixed-script`, `punycode`.
* **Cache** with a TTL (default 5 min), bounded.
* **Signing-time check**: `assertNameUnchanged(resolver, name, chain, address)` re-resolves and throws `changed` if the address moved.
## Usage
[Section titled “Usage”](#usage)
```ts
import { ensResolver } from '@anywalletkit/names-ens'
import { assertNameUnchanged, isNameLike, NameError } from '@anywalletkit/core'
const ens = ensResolver({ rpcUrl: 'https://ethereum-rpc.publicnode.com' }) // or { client } (viem PublicClient on mainnet)
if (isNameLike(input) && ens.supports(input)) {
try {
const r = await ens.resolve(input, 'eip155:8453')
// r.address (checksummed), r.name (normalized), r.warnings[] to show
} catch (e) {
if (e instanceof NameError) console.log(e.code) // invalid-name | not-found | no-address-for-chain | unsupported | lookup-failed
}
}
await ens.reverse('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 'eip155:1') // 'vitalik.eth'
await ens.avatar('vitalik.eth') // 'https://euc.li/vitalik.eth'
// right before signing:
await assertNameUnchanged(ens, 'vitalik.eth', 'eip155:1', addressShownToUser)
```
Options: `client` / `rpcUrl` (mainnet; required), `ccip` (how gateways are asked, below), `cacheTtlMs`, `ipfsGateway` (point it at your proxy), `foreignTlds` (TLDs left to other resolvers; default `sol`, `near`, `ton`, `me`).
Offchain names (CCIP-Read, EIP-3668) make the device fetch gateway URLs that the name’s resolver chooses. The client built from `rpcUrl` asks only https gateway URLs whose host, as written, is not a private one (`ensCcipRead`: no `http://`, no localhost / LAN / link-local / CGNAT address in any spelling, redirects refused). Where the host resolves depends on the runtime: on **Node** (no `ccip.fetch`), each gateway goes through the pinned transport of `createEnsCcipHandler`, in process — every DNS answer checked, the connection pinned to it — so a public-looking name that resolves to 127.0.0.1 or a LAN address is not asked; a gateway host whose records mix public and private addresses is refused, and behind a corporate split-horizon DNS or an outbound proxy you pass `ccip.fetch`. In a **browser** (and any other runtime) the global fetch connects: the URL text is checked, the resolved address is not — there is no DNS-level isolation; use `ensCcipViaProxy` where that matters. React Native: below. **If you pass your own `client`, create it with `ccipRead: ensCcipRead`** (or `ccipRead: false`), or viem’s default fetches whatever URL a resolver names, `http://192.168.1.1/…` included. A gateway’s answer is read to at most `ccip.maxResponseBytes` (1 MiB; status and declared size are checked before any byte is read), and `ccip.timeoutMs` (10 s) covers each gateway’s request and whole answer.
`avatar` returns the `avatar` text record when it is an https URL on a public host, or an `ipfs://` one through `ipfsGateway` (an origin, `/ipfs/` appended, or a prefix ending in `/ipfs/`; `avatarUrl(record, gateway)` is the same filter). Everything else comes back `null`: NFT avatars (`eip155:1/erc721:…`; resolving one means fetching the metadata URL its issuer chose), and `http://`, `data:`, `ipns://` and `ar://` ones. Nothing is fetched to decide.
### React Native: CCIP-Read through your server
[Section titled “React Native: CCIP-Read through your server”](#react-native-ccip-read-through-your-server)
React Native’s fetch follows redirects whatever `redirect: 'error'` says, so a gateway’s redirect would send the device’s request to a LAN or loopback host before the final URL can be checked. There, offchain names are off by default: they fail with `lookup-failed`, `reason: 'ccip-proxy-required'`, and the message says what to set. The safe path is one route on your server:
```ts
// server (Node): POST /ccip, behind your auth and rate limits
import { createEnsCcipHandler } from '@anywalletkit/names-ens/server'
const ccip = createEnsCcipHandler() // { allowHosts, denyHosts, timeoutMs, maxResponseBytes, maxRequestBytes }
// in the route: const out = await ccip(JSON.parse(rawBody)); reply out.status with JSON out.body
// app (Hermes): the resolver asks gateways through that route
import { ensCcipViaProxy, ensResolver } from '@anywalletkit/names-ens'
const ens = ensResolver({
rpcUrl: ETHEREUM_RPC,
ccip: { fetch: ensCcipViaProxy('https://api.example.com/ccip', { headers: { authorization: `Bearer ${token}` } }) },
})
```
`createEnsCcipHandler` takes `{ url, method, body? }` (what `ensCcipViaProxy` sends) and returns `{ status, body }` (`{ data }` or `{ error }`). It asks only https gateways on public hosts; resolves the host and refuses it when any address is private, loopback, link-local, CGNAT, multicast or an IPv6 address carrying one (mapped, NAT64, 6to4); connects to the checked address with `node:https` (TLS still verifies the host name), so a second DNS answer cannot move it; never follows a redirect; applies a timeout (10 s) and an answer cap (1 MiB); sends GET, or POST with exactly `{ sender, data }`; forwards none of the caller’s headers or cookies. It does not authenticate or rate-limit: your route does. `lookup` and `fetch` options replace DNS and the connection in tests (with `fetch`, the connection is not pinned). The reference server in `examples/server` has it at `POST /ccip`.
`ensCcipViaProxy(proxyUrl, { headers, timeoutMs, fetch, allowInsecureProxyUrl })` needs an https proxy URL (http only for localhost with `allowInsecureProxyUrl`), uses no Node API and no `AbortSignal.timeout`, and turns the server’s refusal into the lookup’s error.
Without a server, `ccip: { allowRedirectFollowingFetch: true }` asks gateways directly: a redirecting gateway can then make the device send one blind request to a host on the user’s network. With your own client: `ccipRead: createEnsCcipRead({ … })`.
## Tests
[Section titled “Tests”](#tests)
`pnpm test` — unit tests over a stubbed client, the CCIP-Read proxy over local servers with stubbed DNS, plus the conformance `namesSuite`. `pnpm verify:live` — mainnet via a public RPC: vitalik.eth forward / reverse / avatar, `jesse.base.eth` through CCIP-Read on the Base coin type, a name without a Base record, unregistered and invalid names.
## Classes
[Section titled “Classes”](#classes)
* [EnsNameError](/api/anywalletkit/names-ens/classes/ensnameerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [EnsCcipOptions](/api/anywalletkit/names-ens/interfaces/ensccipoptions/)
* [EnsCcipProxyRequest](/api/anywalletkit/names-ens/interfaces/ensccipproxyrequest/)
* [EnsCcipViaProxyOptions](/api/anywalletkit/names-ens/interfaces/ensccipviaproxyoptions/)
* [EnsResolverOptions](/api/anywalletkit/names-ens/interfaces/ensresolveroptions/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [EnsNameErrorReason](/api/anywalletkit/names-ens/type-aliases/ensnameerrorreason/)
## Variables
[Section titled “Variables”](#variables)
* [BTC_CAIP2](/api/anywalletkit/names-ens/variables/btc_caip2/)
* [ensCcipRead](/api/anywalletkit/names-ens/variables/ensccipread/)
* [SOL_CAIP2](/api/anywalletkit/names-ens/variables/sol_caip2/)
## Functions
[Section titled “Functions”](#functions)
* [avatarUrl](/api/anywalletkit/names-ens/functions/avatarurl/)
* [coinTypeFor](/api/anywalletkit/names-ens/functions/cointypefor/)
* [createEnsCcipRead](/api/anywalletkit/names-ens/functions/createensccipread/)
* [decodeBtcScript](/api/anywalletkit/names-ens/functions/decodebtcscript/)
* [ensCcipRequest](/api/anywalletkit/names-ens/functions/enscciprequest/)
* [ensCcipViaProxy](/api/anywalletkit/names-ens/functions/ensccipviaproxy/)
* [ensResolver](/api/anywalletkit/names-ens/functions/ensresolver/)
* [warningsFor](/api/anywalletkit/names-ens/functions/warningsfor/)
# EnsNameError
Defined in: names-ens/src/ens.ts:47
## Extends
[Section titled “Extends”](#extends)
* `NameError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new EnsNameError**(`code`, `message`, `detail?`, `reason?`): `EnsNameError`
Defined in: names-ens/src/ens.ts:50
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`NameErrorCode`
##### message
[Section titled “message”](#message)
`string`
##### detail?
[Section titled “detail?”](#detail)
###### cause?
[Section titled “cause?”](#cause)
`unknown`
###### chain?
[Section titled “chain?”](#chain)
`string`
###### name?
[Section titled “name?”](#name)
`string`
##### reason?
[Section titled “reason?”](#reason)
`"ccip-proxy-required"`
#### Returns
[Section titled “Returns”](#returns)
`EnsNameError`
#### Overrides
[Section titled “Overrides”](#overrides)
`NameError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `NameErrorCode`
Defined in: core/dist/index.d.ts:332
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`NameError.code`
***
### detail
[Section titled “detail”](#detail-1)
> `readonly` **detail**: `object`
Defined in: core/dist/index.d.ts:333
#### cause?
[Section titled “cause?”](#cause-1)
> `optional` **cause?**: `unknown`
#### chain?
[Section titled “chain?”](#chain-1)
> `optional` **chain?**: `string`
#### name?
[Section titled “name?”](#name-1)
> `optional` **name?**: `string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`NameError.detail`
***
### name
[Section titled “name”](#name-2)
> `readonly` **name**: `"NameError"` = `"NameError"`
Defined in: core/dist/index.d.ts:338
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`NameError.name`
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `"ccip-proxy-required"` | `undefined`
Defined in: names-ens/src/ens.ts:49
Set when the cause is the app’s setup, not the name or the network: see [EnsNameErrorReason](/api/anywalletkit/names-ens/type-aliases/ensnameerrorreason/).
# avatarUrl
> **avatarUrl**(`record`, `ipfsGateway?`): `string` | `null`
Defined in: names-ens/src/ens.ts:241
An `avatar` text record as a URL an app may load: an https URL on a public host as written, or an `ipfs://` one through `ipfsGateway`. Anything else — an NFT reference (resolving it means fetching the NFT’s metadata URL, which its issuer chooses), `http://`, `data:`, a private host — is `null`: nothing is fetched to decide (scan 2026-10-27 modules, F37).
## Parameters
[Section titled “Parameters”](#parameters)
### record
[Section titled “record”](#record)
`string` | `null` | `undefined`
### ipfsGateway?
[Section titled “ipfsGateway?”](#ipfsgateway)
`string` = `'https://ipfs.io/ipfs/'`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# coinTypeFor
> **coinTypeFor**(`chain`): `bigint` | `null`
Defined in: names-ens/src/coins.ts:16
ENSIP-11: EVM chains other than mainnet use `0x80000000 | chainId`.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint` | `null`
# createEnsCcipRead
> **createEnsCcipRead**(`opts?`): `object`
Defined in: names-ens/src/ens.ts:228
viem’s `ccipRead` option with [ensCcipRequest](/api/anywalletkit/names-ens/functions/enscciprequest/) and `opts`: `createPublicClient({ chain: mainnet, transport, ccipRead: createEnsCcipRead({ fetch: viaMyServer }) })`.
## Parameters
[Section titled “Parameters”](#parameters)
### opts?
[Section titled “opts?”](#opts)
[`EnsCcipOptions`](/api/anywalletkit/names-ens/interfaces/ensccipoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`object`
### request
[Section titled “request”](#request)
> `readonly` **request**: (`p`) => `Promise`<`` `0x${string}` ``>
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### p
[Section titled “p”](#p)
`CcipRequestParameters`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`` `0x${string}` ``>
# decodeBtcScript
> **decodeBtcScript**(`script`, `name`): `string`
Defined in: names-ens/src/coins.ts:69
ENSIP-9 stores Bitcoin addresses as the scriptPubKey. P2PKH / P2SH / P2WPKH / P2WSH / P2TR.
## Parameters
[Section titled “Parameters”](#parameters)
### script
[Section titled “script”](#script)
`Uint8Array`
### name
[Section titled “name”](#name)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# ensCcipRequest
> **ensCcipRequest**(`__namedParameters`, `opts?`): `Promise`<`` `0x${string}` ``>
Defined in: names-ens/src/ens.ts:134
EIP-3668 (CCIP-Read) lookups as a wallet may make them (scan 2026-10-27 modules, F37): a name’s offchain resolver picks the gateway URLs, so only https URLs whose host is not, as written, a private one are asked — no `http://`, no localhost / LAN / link-local / CGNAT address in any spelling, no placeholder in the host — and a redirect is refused (`redirect: 'error'`). Same protocol as viem’s own: GET with `{data}` in the URL, POST `{data, sender}` otherwise, a hex `data` answer, at most `opts.maxResponseBytes`, within `opts.timeoutMs` per gateway.
Where the host resolves depends on the transport:
* `opts.fetch`: up to that fetch (e.g. `ensCcipViaProxy` to your server’s `createEnsCcipHandler`).
* Node, no `opts.fetch` (scan 2026-10-30 F17): the pinned transport of `createEnsCcipHandler`, in process — every DNS answer is checked and the connection is pinned to it, so a public-looking name that resolves to a private address is not asked. A gateway host whose records mix public and private addresses is refused; behind a corporate split-horizon DNS or an outbound proxy, pass `opts.fetch`.
* A browser and other runtimes: the global fetch. The URL text is checked, the resolved address is not: no DNS-level isolation. Ask gateways through your server (`ensCcipViaProxy`) where that matters.
* React Native: its fetch cannot refuse a redirect, and checking the final URL afterwards is too late (the redirected request has gone out: scan 2026-10-28 F13), so no gateway is asked unless `opts.fetch` handles redirects or `opts.allowRedirectFollowingFetch` accepts the risk.
## Parameters
[Section titled “Parameters”](#parameters)
### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
`CcipRequestParameters`
### opts?
[Section titled “opts?”](#opts)
[`EnsCcipOptions`](/api/anywalletkit/names-ens/interfaces/ensccipoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`` `0x${string}` ``>
# ensCcipViaProxy
> **ensCcipViaProxy**(`proxyUrl`, `opts?`): (`url`, `init`) => `Promise`<`Response`>
Defined in: names-ens/src/ccip-proxy.ts:38
`fetch` for [EnsCcipOptions.fetch](/api/anywalletkit/names-ens/interfaces/ensccipoptions/#fetch) through your server’s CCIP-Read route: `ensResolver({ rpcUrl, ccip: { fetch: ensCcipViaProxy('https://api.example.com/ccip', { headers }) } })`. The proxy URL must be https (or a local http one with `allowInsecureProxyUrl`).
## Parameters
[Section titled “Parameters”](#parameters)
### proxyUrl
[Section titled “proxyUrl”](#proxyurl)
`string`
### opts?
[Section titled “opts?”](#opts)
[`EnsCcipViaProxyOptions`](/api/anywalletkit/names-ens/interfaces/ensccipviaproxyoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
(`url`, `init`) => `Promise`<`Response`>
# ensResolver
> **ensResolver**(`opts`): `NameResolver`
Defined in: names-ens/src/ens.ts:256
Names ENS can serve: `.eth` and any DNS name (cb.id, uni.eth subnames, imported DNS).
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`EnsResolverOptions`](/api/anywalletkit/names-ens/interfaces/ensresolveroptions/)
## Returns
[Section titled “Returns”](#returns)
`NameResolver`
# warningsFor
> **warningsFor**(`name`): `NameWarning`\[]
Defined in: names-ens/src/warnings.ts:24
Warnings for a normalized name: punycode labels, mixed scripts, and letters that look like Latin ones.
## Parameters
[Section titled “Parameters”](#parameters)
### name
[Section titled “name”](#name)
`string`
## Returns
[Section titled “Returns”](#returns)
`NameWarning`\[]
# EnsCcipOptions
Defined in: names-ens/src/ens.ts:67
How `ensCcipRequest` / `createEnsCcipRead` reach CCIP-Read gateways.
## Properties
[Section titled “Properties”](#properties)
### allowRedirectFollowingFetch?
[Section titled “allowRedirectFollowingFetch?”](#allowredirectfollowingfetch)
> `optional` **allowRedirectFollowingFetch?**: `boolean`
Defined in: names-ens/src/ens.ts:83
Ask gateways with the global fetch even on a runtime whose fetch follows redirects whatever `redirect` says (React Native). Default false: there, without `fetch`, offchain (CCIP-Read) names do not resolve. true brings them back and accepts the trade-off: a gateway that answers with a redirect makes the device send one blind request (no answer is read) to the target, a LAN or loopback host included, before the redirect is noticed.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: (`url`, `init`) => `Promise`<`Response`>
Defined in: names-ens/src/ens.ts:76
The fetch used to ask gateways, in place of the default transport. Supply one that does not follow redirects: a native fetch that honours `redirect: 'manual'`/`'error'`, or one that sends the request to your own server’s CCIP-Read proxy (which refuses redirects and checks the address it connects to). Passing it says redirects are handled, so gateways are asked on every runtime, React Native included. The https check on the URL text still runs first; where the host resolves is then up to this fetch (on Node it replaces the pinned transport — pass it when gateways must go through a proxy or a split-horizon DNS you trust).
#### Parameters
[Section titled “Parameters”](#parameters)
##### url
[Section titled “url”](#url)
`string`
##### init
[Section titled “init”](#init)
`RequestInit`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
***
### maxResponseBytes?
[Section titled “maxResponseBytes?”](#maxresponsebytes)
> `optional` **maxResponseBytes?**: `number`
Defined in: names-ens/src/ens.ts:90
Largest gateway answer read, in bytes; a larger one (declared or streamed) is refused. Default 1 MiB.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: names-ens/src/ens.ts:88
For one gateway: the request and the whole answer. Default 10 s. Runs alongside the caller’s signal (viem passes none by default), so a gateway that never finishes its answer cannot hold the lookup.
# EnsCcipProxyRequest
Defined in: names-ens/src/ccip-proxy.ts:24
One gateway call as the proxy receives it.
## Properties
[Section titled “Properties”](#properties)
### body?
[Section titled “body?”](#body)
> `optional` **body?**: `object`
Defined in: names-ens/src/ccip-proxy.ts:28
POST only: the EIP-3668 body.
#### data
[Section titled “data”](#data)
> **data**: `string`
#### sender
[Section titled “sender”](#sender)
> **sender**: `string`
***
### method
[Section titled “method”](#method)
> **method**: `"GET"` | `"POST"`
Defined in: names-ens/src/ccip-proxy.ts:26
***
### url
[Section titled “url”](#url)
> **url**: `string`
Defined in: names-ens/src/ccip-proxy.ts:25
# EnsCcipViaProxyOptions
Defined in: names-ens/src/ccip-proxy.ts:12
The app side of `createEnsCcipHandler` (`@anywalletkit/names-ens/server`): a `fetch` for `ensResolver({ rpcUrl, ccip: { fetch } })` that sends each CCIP-Read gateway request to your server, which asks the gateway (https only, public addresses only, no redirects) and returns its answer. The device itself then only ever talks to your server, so a gateway’s redirect cannot reach the user’s network.
Runs on React Native / Hermes: fetch, JSON and timers only (no `URL`, no `AbortSignal.timeout`).
## Properties
[Section titled “Properties”](#properties)
### allowInsecureProxyUrl?
[Section titled “allowInsecureProxyUrl?”](#allowinsecureproxyurl)
> `optional` **allowInsecureProxyUrl?**: `boolean`
Defined in: names-ens/src/ccip-proxy.ts:20
Accept `http://` for a proxy on this machine (localhost, 127.0.0.1, \[::1]) during development. Default false.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: (`url`, `init`) => `Promise`<{ `status`: `number`; `text`: `Promise`<`string`>; }>
Defined in: names-ens/src/ccip-proxy.ts:18
The fetch that reaches your server. Default: the global one.
#### Parameters
[Section titled “Parameters”](#parameters)
##### url
[Section titled “url”](#url)
`string`
##### init
[Section titled “init”](#init)
`RequestInit`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<{ `status`: `number`; `text`: `Promise`<`string`>; }>
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Readonly`<`Record`<`string`, `string`>>
Defined in: names-ens/src/ccip-proxy.ts:14
Headers for your server, e.g. `{ authorization: 'Bearer …' }`. They go to the proxy only, never to the gateway.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: names-ens/src/ccip-proxy.ts:16
Per request, proxy round trip included. Default 15 s (the server’s own gateway timeout is 10 s).
# EnsResolverOptions
Defined in: names-ens/src/ens.ts:12
Options for `ensResolver`: an Ethereum-mainnet client or RPC URL, and caching.
## Properties
[Section titled “Properties”](#properties)
### cacheTtlMs?
[Section titled “cacheTtlMs?”](#cachettlms)
> `optional` **cacheTtlMs?**: `number`
Defined in: names-ens/src/ens.ts:29
Cache TTL for resolutions, reverse lookups and avatars. Default 5 min.
***
### ccip?
[Section titled “ccip?”](#ccip)
> `optional` **ccip?**: [`EnsCcipOptions`](/api/anywalletkit/names-ens/interfaces/ensccipoptions/)
Defined in: names-ens/src/ens.ts:27
How the client built from `rpcUrl` asks CCIP-Read gateways (see [EnsCcipOptions](/api/anywalletkit/names-ens/interfaces/ensccipoptions/)). On React Native, offchain names resolve only with `ccip.fetch` (one that refuses redirects, e.g. through your server) or `ccip.allowRedirectFollowingFetch`. With your own `client`, use `ccipRead: createEnsCcipRead(…)` instead.
***
### client?
[Section titled “client?”](#client)
> `optional` **client?**: `object`
Defined in: names-ens/src/ens.ts:19
A viem client on Ethereum mainnet (the registry + universal resolver live there). Create it with `ccipRead: ensCcipRead` (or `ccipRead: false`): with viem’s default, a name’s offchain resolver chooses URLs the user’s device fetches — `http://192.168.1.1/…` included. A client built from `rpcUrl` has it already.
***
### foreignTlds?
[Section titled “foreignTlds?”](#foreigntlds)
> `optional` **foreignTlds?**: readonly `string`\[]
Defined in: names-ens/src/ens.ts:36
TLDs this resolver should leave to others (`sol`, `near`, `ton` …). Default: those three plus `t.me`.
***
### ipfsGateway?
[Section titled “ipfsGateway?”](#ipfsgateway)
> `optional` **ipfsGateway?**: `string`
Defined in: names-ens/src/ens.ts:34
IPFS gateway for `ipfs://` avatars: an origin (`https://gw.example`, `/ipfs/` is appended, as viem did) or a prefix ending in `/ipfs/`. Default `https://ipfs.io/ipfs/`. Point it at your own proxy to keep users’ IPs private.
***
### rpcUrl?
[Section titled “rpcUrl?”](#rpcurl)
> `optional` **rpcUrl?**: `string`
Defined in: names-ens/src/ens.ts:21
…or a mainnet RPC URL to build one from. One of the two is required.
# EnsNameErrorReason
> **EnsNameErrorReason** = `"ccip-proxy-required"`
Defined in: names-ens/src/ens.ts:45
A finer reason than the NameErrorCode, for the developer rather than the user. `ccip-proxy-required`: an offchain (CCIP-Read) name on React Native with no `ccip` option set (code `lookup-failed`).
# BTC_CAIP2
> `const` **BTC_CAIP2**: `"bip122:000000000019d6689c085ae165831e93"` = `'bip122:000000000019d6689c085ae165831e93'`
Defined in: names-ens/src/coins.ts:11
CAIP-2 id of Bitcoin mainnet, for reading a name’s BTC record.
# ensCcipRead
> `const` **ensCcipRead**: `object`
Defined in: names-ens/src/ens.ts:233
viem’s `ccipRead` option with [ensCcipRequest](/api/anywalletkit/names-ens/functions/enscciprequest/)’s defaults: `createPublicClient({ chain: mainnet, transport, ccipRead: ensCcipRead })`.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### request
[Section titled “request”](#request)
> `readonly` **request**: (`p`) => `Promise`<`` `0x${string}` ``>
#### Parameters
[Section titled “Parameters”](#parameters)
##### p
[Section titled “p”](#p)
`CcipRequestParameters`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`` `0x${string}` ``>
# SOL_CAIP2
> `const` **SOL_CAIP2**: `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"` = `'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'`
Defined in: names-ens/src/coins.ts:13
CAIP-2 id of Solana mainnet, for reading a name’s SOL record.
# @anywalletkit/networks
# @anywalletkit/networks
[Section titled “@anywalletkit/networks”](#anywalletkitnetworks)
[](https://www.npmjs.com/package/@anywalletkit/networks)
One table of networks for every wallet build: the catalog mainnets with their public RPC failover lists, the default testnets for every chain family, the networks and RPCs the user adds, and a verifier that proves an endpoint serves the network it claims. The mobile app and the extension kit read the same table.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/networks
# or: pnpm add @anywalletkit/networks · yarn add @anywalletkit/networks
```
On npm: [@anywalletkit/networks](https://www.npmjs.com/package/@anywalletkit/networks), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Pure TypeScript, no runtime dependencies beyond `@anywalletkit/swap2-assets` (for `isCatalogChain`). Runs under Hermes (no `URL`, no `atob`, no `structuredClone`).
```ts
import { NetworksTable, verifyNetwork, parseAddChainParams, checkRpcUrl } from '@anywalletkit/networks'
const table = new NetworksTable(myJsonStorage) // AsyncStorage / chrome.storage / memoryJsonStorage()
await table.load() // once at cold start; before it rpcUrlsForSync / usesUserRpcSync throw (not-loaded)
await table.addRpc('eip155:8453', 'https://my.base.rpc')
await table.rpcUrlsFor('eip155:8453') // ['https://my.base.rpc', 'https://base-rpc.publicnode.com', …]
await table.setOnlyOwnRpc('eip155:8453', true) // → ['https://my.base.rpc'] (no public fallback)
table.rpcUrlsForSync('eip155:8453') // same, from memory — for a sync client factory
table.usesUserRpcSync('eip155:8453') // true → label the review sheet "Custom RPC — simulation not trusted"
const r = await verifyNetwork(await table.get('eip155:8453')!, { rpc: 'https://my.base.rpc' })
// { ok: true, latencyMs: 212, tip: 52896400, reported: '8453' } | { ok: false, error: 'chain-id-mismatch: Endpoint serves chain 1, not 8453.', reported: '1', … }
await table.markRpc('eip155:8453', 'https://my.base.rpc', r) // a failure parks the URL (skipped by rpcUrlsFor) with the reason
```
## Model
[Section titled “Model”](#model)
```ts
interface Network {
caip2: string // eip155:11155111, solana:EtWT…, bip122:, ton:-3, tron:nile, near:testnet, zcash:testnet
family: 'evm' | 'solana' | 'ton' | 'tron' | 'btc' | 'near' | 'zcash'
name: string; symbol: string; decimals: number
kind: 'catalog' | 'testnet' | 'custom'
rpcs: string[] // tried in order
explorer?: string
source: 'builtin' | 'user' | { origin: string; addedAt: number } // a site-added network carries its origin
onlyOwnRpc?: boolean // drop the public fallback
balancesViaOwnRpc?: boolean
enabled: boolean // testnets ship off
}
```
Rules the table enforces:
* a builtin entry (catalog mainnet or default testnet) cannot be removed; the user can only **prepend** RPCs and flip toggles — the shipped list stays as the fallback unless `onlyOwnRpc`;
* a custom network has no fallback by definition and needs at least one RPC; a stored custom entry for a builtin chain id is ignored (a site must not replace Ethereum’s endpoints);
* `rpcUrlsFor(caip2)` = healthy user RPCs, then the builtin list (unless `onlyOwnRpc` and at least one user RPC is healthy);
* `markRpc(caip2, url, result)` parks a failed user RPC with its error until it passes again or is removed — an endpoint that changes chain id under us is treated as poisoning, not as an outage;
* only the deltas are persisted (`NetworksState`: overrides per builtin, custom networks, issues, the http opt-in), so a shipped list update reaches every install.
## URL policy (owner decision 2)
[Section titled “URL policy (owner decision 2)”](#url-policy-owner-decision-2)
`checkRpcUrl(url, { allowHttpLocal })`: `https://` anywhere; `http://` only for private addresses — `localhost`, `*.local`, `*.internal`, `*.home.arpa`, `*.lan`, 0/8, 10/8, 100.64/10, `127/8`, 169.254/16, `172.16/12`, `192.168/16`, 198.18/15, IPv4 written any way a URL parser reads it (`127.1`, `2130706433`, `0x7f.0.0.1`), any host that is not printable ASCII (a URL parser maps `127.0.0.1` to 127.0.0.1), IPv6 loopback / ULA / link-local / multicast and the IPv4 inside a mapped, NAT64 or 6to4 address — **and** only with `allowHttpLocal` (the Advanced toggle, stored in the table). No credentials in the URL, and no backslash, tab, CR/LF or other control character anywhere in it (a WHATWG parser ends the host at `\` and drops tab/CR/LF, so the host fetch connects to would not be the one checked). `parseAddChainParams` never grants the local exception to a site.
`isPrivateHost(host)` is that test on its own, and `isPublicHttpsUrl(url)` the one for URLs a wallet fetches on someone else’s word (ENS gateways, avatars): https, no credentials, a public host. Both are also in `@anywalletkit/networks/url`, which does not load the catalog. A public name that resolves to a private address (DNS rebinding) is not caught by a host test.
## `verifyNetwork(network, { rpc?, fetch?, allowHttpLocal?, timeoutMs? })`
[Section titled “verifyNetwork(network, { rpc?, fetch?, allowHttpLocal?, timeoutMs? })”](#verifynetworknetwork--rpc-fetch-allowhttplocal-timeoutms-)
| family | identity (must match the CAIP-2 id) | tip |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- |
| evm | `eth_chainId` | `eth_blockNumber` |
| solana | `getGenesisHash` starts with the reference (`solana:mainnet` / `devnet` / `testnet` aliases resolve) | `getSlot` |
| ton | config param 19 (global id, parsed from the BOC) = `-239` / `-3` | `getMasterchainInfo` seqno |
| tron | genesis block id (`wallet/getblockbynum 0`) ends with the chain reference (`728126428` ≙ `0x2b6653dc`, `nile` ≙ `0xcd8690dc`, `shasta` ≙ `0x94a9059e`) | `wallet/getnowblock` |
| btc | Esplora `/block-height/0`, Blockbook `/api/v2/block-index/0` | `/blocks/tip/height` / `bestHeight` |
| zcash | same, plus Blockchair `dashboards/block/0` | `/stats` blocks |
| near | `status.chain_id` | `latest_block_height` |
Returns `{ ok, latencyMs, tip?, error?, reported? }` and never throws. Errors are prefixed with a code: `chain-id-mismatch`, `url-policy`, `redirected`, `http-`, `rpc-error`, `bad-json`, `timeout`, `unreachable`, `no-rpc`, `bad-network`. Redirects are refused (`redirect: 'error'`, and an answer whose `url` / `redirected` / 3xx status shows a redirect is `redirected: Endpoint redirected to ; enter the final URL`): the URL policy judged the address the user or site gave, not where it points. A custom `fetch` that cannot refuse redirects should report `url` or `redirected`, or the redirected request goes out before the check sees it. `http-` and `bad-json` carry no body text. Answer a site (`wallet_addEthereumChain`) with a generic error, not with `error`. `verifyRpcs(network)` checks every endpoint. `scripts/verify-live.mjs` runs the real thing against every builtin endpoint.
## Builtin table
[Section titled “Builtin table”](#builtin-table)
`CATALOG_NETWORKS` — the 30 EVM mainnets of the asset catalog (Ethereum, Base, BNB, Arbitrum, Optimism, Polygon, Avalanche, HyperEVM, Robinhood, zkSync, Celo, MegaETH, Unichain, Monad, Plasma, Linea, Gnosis, Sonic, World Chain, Sei, Ink, Plume, X Layer, Scroll, Berachain, Arc, Mantle, Katana, Morph, Flare) with the public failover lists, plus Solana, TON, Tron, Bitcoin, NEAR and Zcash with public endpoints (the mobile app prepends its keyed proxies through the table).
`DEFAULT_TESTNETS` (shipped `enabled: false`; endpoints and identities called on 2026-10-21):
| Network | caip2 | endpoints |
| ---------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Sepolia | `eip155:11155111` | ethereum-sepolia-rpc.publicnode.com, sepolia.drpc.org (rpc.sepolia.org no longer answers) |
| Base Sepolia | `eip155:84532` | sepolia.base.org, base-sepolia-rpc.publicnode.com |
| Arbitrum Sepolia | `eip155:421614` | sepolia-rollup.arbitrum.io/rpc, arbitrum-sepolia-rpc.publicnode.com |
| OP Sepolia | `eip155:11155420` | sepolia.optimism.io, optimism-sepolia-rpc.publicnode.com |
| Polygon Amoy | `eip155:80002` | polygon-amoy-bor-rpc.publicnode.com, polygon-amoy.drpc.org (rpc-amoy.polygon.technology no longer answers) |
| BSC testnet | `eip155:97` | bsc-testnet-rpc.publicnode.com, data-seed-prebsc-1-s1.bnbchain.org:8545 |
| Monad testnet | `eip155:10143` | testnet-rpc.monad.xyz |
| Solana devnet | `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1` (`wallet-solana` `CAIP2_GENESIS.devnet`) | api.devnet.solana.com |
| Bitcoin testnet4 | `bip122:00000000da84f2bafbbc53dee25a72ae` (genesis from mempool.space/testnet4) | mempool.space/testnet4/api — `wallet-btc`‘s `testnet` option (tb1…, coin type 1’) serves it; the package’s `CAIP2_GENESIS.testnet` is testnet3 |
| TON testnet | `ton:-3` | testnet.toncenter.com/api/v2/jsonRPC (global id -3 confirmed from config param 19) |
| Tron Nile | `tron:nile` (`wallet-tron` also takes `nile` / `tron:0xcd8690dc`) | nile.trongrid.io |
| NEAR testnet | `near:testnet` | rpc.testnet.near.org, test.rpc.fastnear.com |
| Zcash testnet | `zcash:testnet` | **none — unverified.** Blockchair has no zcash/testnet route and no other public API answered; the user supplies a Blockbook |
## EIP-3085
[Section titled “EIP-3085”](#eip-3085)
`parseAddChainParams(params, { known?, origin? })` turns a `wallet_addEthereumChain` request into a `Network` (`kind: 'custom'`, `source: { origin, addedAt }`) or the EIP-1193 error to answer with (`-32602` bad params, `4902` chain not in the catalog). https RPCs only; `nativeCurrency.decimals` must be 18. Pass `known` to accept chains outside the asset catalog.
## Classes
[Section titled “Classes”](#classes)
* [NetworkError](/api/anywalletkit/networks/classes/networkerror/)
* [NetworksTable](/api/anywalletkit/networks/classes/networkstable/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AddChainError](/api/anywalletkit/networks/interfaces/addchainerror/)
* [ChainDescriptor](/api/anywalletkit/networks/interfaces/chaindescriptor/)
* [FetchResponseLike](/api/anywalletkit/networks/interfaces/fetchresponselike/)
* [JsonStorage](/api/anywalletkit/networks/interfaces/jsonstorage/)
* [Network](/api/anywalletkit/networks/interfaces/network/)
* [NetworkEntry](/api/anywalletkit/networks/interfaces/networkentry/)
* [NetworkOverride](/api/anywalletkit/networks/interfaces/networkoverride/)
* [NetworksState](/api/anywalletkit/networks/interfaces/networksstate/)
* [ParseAddChainOptions](/api/anywalletkit/networks/interfaces/parseaddchainoptions/)
* [RpcIssue](/api/anywalletkit/networks/interfaces/rpcissue/)
* [UrlPolicyOptions](/api/anywalletkit/networks/interfaces/urlpolicyoptions/)
* [VerifyOptions](/api/anywalletkit/networks/interfaces/verifyoptions/)
* [VerifyResult](/api/anywalletkit/networks/interfaces/verifyresult/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [FetchLike](/api/anywalletkit/networks/type-aliases/fetchlike/)
* [NetworkFamily](/api/anywalletkit/networks/type-aliases/networkfamily/)
* [NetworkKind](/api/anywalletkit/networks/type-aliases/networkkind/)
* [NetworkSource](/api/anywalletkit/networks/type-aliases/networksource/)
* [UrlPolicyReason](/api/anywalletkit/networks/type-aliases/urlpolicyreason/)
* [UrlPolicyResult](/api/anywalletkit/networks/type-aliases/urlpolicyresult/)
## Variables
[Section titled “Variables”](#variables)
* [ADD_CHAIN_ERRORS](/api/anywalletkit/networks/variables/add_chain_errors/)
* [BTC_CHAIN](/api/anywalletkit/networks/variables/btc_chain/)
* [BTC_ESPLORA](/api/anywalletkit/networks/variables/btc_esplora/)
* [BTC_TESTNET4_CHAIN](/api/anywalletkit/networks/variables/btc_testnet4_chain/)
* [BUILTIN_NETWORKS](/api/anywalletkit/networks/variables/builtin_networks/)
* [CATALOG_NETWORKS](/api/anywalletkit/networks/variables/catalog_networks/)
* [DEFAULT_TESTNETS](/api/anywalletkit/networks/variables/default_testnets/)
* [EVM_MAINNETS](/api/anywalletkit/networks/variables/evm_mainnets/)
* [NEAR_CHAIN](/api/anywalletkit/networks/variables/near_chain/)
* [NEAR_PROVIDERS](/api/anywalletkit/networks/variables/near_providers/)
* [NEAR_TESTNET_CHAIN](/api/anywalletkit/networks/variables/near_testnet_chain/)
* [NON_EVM_CHAINS](/api/anywalletkit/networks/variables/non_evm_chains/)
* [NON_EVM_MAINNETS](/api/anywalletkit/networks/variables/non_evm_mainnets/)
* [SOLANA_CHAIN](/api/anywalletkit/networks/variables/solana_chain/)
* [SOLANA_DEVNET_CHAIN](/api/anywalletkit/networks/variables/solana_devnet_chain/)
* [SOLANA_RPCS](/api/anywalletkit/networks/variables/solana_rpcs/)
* [TON_CHAIN](/api/anywalletkit/networks/variables/ton_chain/)
* [TON_ENDPOINTS](/api/anywalletkit/networks/variables/ton_endpoints/)
* [TON_TESTNET_CHAIN](/api/anywalletkit/networks/variables/ton_testnet_chain/)
* [TRON_CHAIN](/api/anywalletkit/networks/variables/tron_chain/)
* [TRON_NILE_CHAIN](/api/anywalletkit/networks/variables/tron_nile_chain/)
* [TRON_PROVIDERS](/api/anywalletkit/networks/variables/tron_providers/)
* [ZCASH_CHAIN](/api/anywalletkit/networks/variables/zcash_chain/)
* [ZCASH_PROVIDERS](/api/anywalletkit/networks/variables/zcash_providers/)
* [ZCASH_TESTNET_CHAIN](/api/anywalletkit/networks/variables/zcash_testnet_chain/)
## Functions
[Section titled “Functions”](#functions)
* [builtinNetwork](/api/anywalletkit/networks/functions/builtinnetwork/)
* [caip2FromChainId](/api/anywalletkit/networks/functions/caip2fromchainid/)
* [chainHex](/api/anywalletkit/networks/functions/chainhex/)
* [checkRpcUrl](/api/anywalletkit/networks/functions/checkrpcurl/)
* [checkRpcUrls](/api/anywalletkit/networks/functions/checkrpcurls/)
* [expectedIdentity](/api/anywalletkit/networks/functions/expectedidentity/)
* [familyOf](/api/anywalletkit/networks/functions/familyof/)
* [isAddChainError](/api/anywalletkit/networks/functions/isaddchainerror/)
* [isCatalogChain](/api/anywalletkit/networks/functions/iscatalogchain/)
* [isPrivateHost](/api/anywalletkit/networks/functions/isprivatehost/)
* [isPublicHttpsUrl](/api/anywalletkit/networks/functions/ispublichttpsurl/)
* [memoryJsonStorage](/api/anywalletkit/networks/functions/memoryjsonstorage/)
* [nonEvmChain](/api/anywalletkit/networks/functions/nonevmchain/)
* [parseAddChainParams](/api/anywalletkit/networks/functions/parseaddchainparams/)
* [parseUrl](/api/anywalletkit/networks/functions/parseurl/)
* [tonGlobalIdFromBoc](/api/anywalletkit/networks/functions/tonglobalidfromboc/)
* [verifyNetwork](/api/anywalletkit/networks/functions/verifynetwork/)
* [verifyRpcs](/api/anywalletkit/networks/functions/verifyrpcs/)
# NetworkError
Defined in: table.ts:68
Thrown by [NetworksTable](/api/anywalletkit/networks/classes/networkstable/) writes: a built-in network cannot be removed or replaced, the network is unknown, a URL breaks the policy, the network is invalid, or the last RPC of a custom network would be removed; and by the sync endpoint readers before `load()` (`not-loaded`).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NetworkError**(`code`, `message`, `reason?`): `NetworkError`
Defined in: table.ts:69
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`"builtin"` | `"unknown-network"` | `"url-policy"` | `"bad-network"` | `"last-rpc"` | `"not-loaded"`
##### message
[Section titled “message”](#message)
`string`
##### reason?
[Section titled “reason?”](#reason)
[`UrlPolicyReason`](/api/anywalletkit/networks/type-aliases/urlpolicyreason/)
#### Returns
[Section titled “Returns”](#returns)
`NetworkError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `"builtin"` | `"unknown-network"` | `"url-policy"` | `"bad-network"` | `"last-rpc"` | `"not-loaded"`
Defined in: table.ts:69
***
### reason?
[Section titled “reason?”](#reason-1)
> `readonly` `optional` **reason?**: [`UrlPolicyReason`](/api/anywalletkit/networks/type-aliases/urlpolicyreason/)
Defined in: table.ts:69
# NetworksTable
Defined in: table.ts:84
The wallet’s networks and their endpoints: the shipped catalog and testnets plus what the user and sites added. Storage holds only the changes, so app updates with new endpoints reach every install. Call `load()` once at start; the `…Sync` readers answer from memory after that.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NetworksTable**(`storage`, `builtins?`): `NetworksTable`
Defined in: table.ts:90
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/networks/interfaces/jsonstorage/)<[`NetworksState`](/api/anywalletkit/networks/interfaces/networksstate/)>
##### builtins?
[Section titled “builtins?”](#builtins)
readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[] = `BUILTIN_NETWORKS`
#### Returns
[Section titled “Returns”](#returns)
`NetworksTable`
## Properties
[Section titled “Properties”](#properties)
### builtins
[Section titled “builtins”](#builtins-1)
> `readonly` **builtins**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[] = `BUILTIN_NETWORKS`
Defined in: table.ts:90
## Accessors
[Section titled “Accessors”](#accessors)
### loaded
[Section titled “loaded”](#loaded)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **loaded**(): `boolean`
Defined in: table.ts:98
Whether `load()` has completed — before that `listSync` / `getSync` answer builtin-only and the sync endpoint readers throw.
##### Returns
[Section titled “Returns”](#returns-1)
`boolean`
## Methods
[Section titled “Methods”](#methods)
### add()
[Section titled “add()”](#add)
> **add**(`network`): `Promise`<`void`>
Defined in: table.ts:188
Add a custom network. Refused for a builtin caip2 (prepend RPCs with `addRpc` instead) and for RPCs outside the URL policy.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### network
[Section titled “network”](#network)
[`Network`](/api/anywalletkit/networks/interfaces/network/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### addRpc()
[Section titled “addRpc()”](#addrpc)
> **addRpc**(`caip2`, `url`): `Promise`<`void`>
Defined in: table.ts:226
Add a user RPC after the existing user RPCs, before the shipped list. Check it with `checkRpcUrl` and `verifyNetwork` first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### caip2
[Section titled “caip2”](#caip2)
`string`
##### url
[Section titled “url”](#url)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
#### Throws
[Section titled “Throws”](#throws)
[NetworkError](/api/anywalletkit/networks/classes/networkerror/) `unknown-network`, or `url-policy` for a URL the policy refuses.
***
### allowHttpLocal()
[Section titled “allowHttpLocal()”](#allowhttplocal)
> **allowHttpLocal**(): `Promise`<`boolean`>
Defined in: table.ts:170
Whether `http://` RPCs on private addresses are accepted.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`boolean`>
***
### allowHttpLocalSync()
[Section titled “allowHttpLocalSync()”](#allowhttplocalsync)
> **allowHttpLocalSync**(): `boolean`
Defined in: table.ts:175
Same as `allowHttpLocal()` from memory.
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
***
### enable()
[Section titled “enable()”](#enable)
> **enable**(`caip2`, `enabled`): `Promise`<`void`>
Defined in: table.ts:249
Switch a network on or off (testnets ship off).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### caip2
[Section titled “caip2”](#caip2-1)
`string`
##### enabled
[Section titled “enabled”](#enabled)
`boolean`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`caip2`): `Promise`<[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/) | `null`>
Defined in: table.ts:126
One network, or `null` when unknown.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### caip2
[Section titled “caip2”](#caip2-2)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/) | `null`>
***
### getSync()
[Section titled “getSync()”](#getsync)
> **getSync**(`caip2`): [`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/) | `null`
Defined in: table.ts:131
Same as `get()` from memory.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2-3)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/) | `null`
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/)\[]>
Defined in: table.ts:115
Every network with its effective endpoints and issues.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/)\[]>
***
### listSync()
[Section titled “listSync()”](#listsync)
> **listSync**(): [`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/)\[]
Defined in: table.ts:121
Same as `list()` from memory; builtin table only before `load()`.
#### Returns
[Section titled “Returns”](#returns-10)
[`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/)\[]
***
### load()
[Section titled “load()”](#load)
> **load**(): `Promise`<`void`>
Defined in: table.ts:93
Read the stored state once; later calls answer from memory. Safe to call many times.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`void`>
***
### markRpc()
[Section titled “markRpc()”](#markrpc)
> **markRpc**(`caip2`, `url`, `result`, `now?`): `Promise`<`void`>
Defined in: table.ts:264
Record a verification result for one user RPC: a failure parks the URL (with the reason), a pass clears it.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### caip2
[Section titled “caip2”](#caip2-4)
`string`
##### url
[Section titled “url”](#url-1)
`string`
##### result
[Section titled “result”](#result)
[`VerifyResult`](/api/anywalletkit/networks/interfaces/verifyresult/)
##### now?
[Section titled “now?”](#now)
`number` = `...`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`void`>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`caip2`): `Promise`<`void`>
Defined in: table.ts:205
Remove a custom network. Builtins cannot be removed (disable them instead).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### caip2
[Section titled “caip2”](#caip2-5)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`void`>
***
### removeRpc()
[Section titled “removeRpc()”](#removerpc)
> **removeRpc**(`caip2`, `url`): `Promise`<`void`>
Defined in: table.ts:240
Remove a user RPC.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### caip2
[Section titled “caip2”](#caip2-6)
`string`
##### url
[Section titled “url”](#url-2)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`void`>
#### Throws
[Section titled “Throws”](#throws-1)
[NetworkError](/api/anywalletkit/networks/classes/networkerror/) `unknown-network`, or `last-rpc` for the last RPC of a custom network.
***
### reset()
[Section titled “reset()”](#reset)
> **reset**(): `Promise`<`void`>
Defined in: table.ts:274
Forget everything the user changed.
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`void`>
***
### rpcUrlsFor()
[Section titled “rpcUrlsFor()”](#rpcurlsfor)
> **rpcUrlsFor**(`caip2`): `Promise`<`string`\[]>
Defined in: table.ts:136
Endpoints to try, in order: healthy user RPCs, then the builtin list unless `onlyOwnRpc`. Empty for an unknown network.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### caip2
[Section titled “caip2”](#caip2-7)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`string`\[]>
***
### rpcUrlsForSync()
[Section titled “rpcUrlsForSync()”](#rpcurlsforsync)
> **rpcUrlsForSync**(`caip2`): `string`\[]
Defined in: table.ts:146
`rpcUrlsFor` from memory — what a sync consumer (a viem client factory) reads. Throws `NetworkError('not-loaded')` before `load()`: the builtin list would ignore the user’s own RPCs and their `onlyOwnRpc` choice.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### caip2
[Section titled “caip2”](#caip2-8)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`string`\[]
***
### setAllowHttpLocal()
[Section titled “setAllowHttpLocal()”](#setallowhttplocal)
> **setAllowHttpLocal**(`v`): `Promise`<`void`>
Defined in: table.ts:183
Turn the `http://` on private addresses setting on or off.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### v
[Section titled “v”](#v)
`boolean`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`void`>
***
### setBalancesViaOwnRpc()
[Section titled “setBalancesViaOwnRpc()”](#setbalancesviaownrpc)
> **setBalancesViaOwnRpc**(`caip2`, `balancesViaOwnRpc`): `Promise`<`void`>
Defined in: table.ts:259
Read balances over the user’s RPC instead of the app’s server.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### caip2
[Section titled “caip2”](#caip2-9)
`string`
##### balancesViaOwnRpc
[Section titled “balancesViaOwnRpc”](#balancesviaownrpc)
`boolean`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`void`>
***
### setOnlyOwnRpc()
[Section titled “setOnlyOwnRpc()”](#setonlyownrpc)
> **setOnlyOwnRpc**(`caip2`, `onlyOwnRpc`): `Promise`<`void`>
Defined in: table.ts:254
Use only the user’s RPCs for this network, dropping the shipped fallback.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### caip2
[Section titled “caip2”](#caip2-10)
`string`
##### onlyOwnRpc
[Section titled “onlyOwnRpc”](#onlyownrpc)
`boolean`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`void`>
***
### setRpcs()
[Section titled “setRpcs()”](#setrpcs)
> **setRpcs**(`caip2`, `rpcs`): `Promise`<`void`>
Defined in: table.ts:216
Replace the user’s RPC list for a network (prepended to the builtin list; the whole list for a custom network).
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### caip2
[Section titled “caip2”](#caip2-11)
`string`
##### rpcs
[Section titled “rpcs”](#rpcs)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`void`>
***
### subscribe()
[Section titled “subscribe()”](#subscribe)
> **subscribe**(`fn`): () => `void`
Defined in: table.ts:107
Fires after every write (UI refresh).
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### fn
[Section titled “fn”](#fn)
() => `void`
#### Returns
[Section titled “Returns”](#returns-22)
() => `void`
***
### usesUserRpc()
[Section titled “usesUserRpc()”](#usesuserrpc)
> **usesUserRpc**(`caip2`): `Promise`<`boolean`>
Defined in: table.ts:164
Same as `usesUserRpcSync()`, after loading.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### caip2
[Section titled “caip2”](#caip2-12)
`string`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`boolean`>
***
### usesUserRpcSync()
[Section titled “usesUserRpcSync()”](#usesuserrpcsync)
> **usesUserRpcSync**(`caip2`): `boolean`
Defined in: table.ts:156
Whether the first endpoint a consumer will use is user- or site-supplied (→ “Custom RPC — simulation not trusted”). Throws before `load()`.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### caip2
[Section titled “caip2”](#caip2-13)
`string`
#### Returns
[Section titled “Returns”](#returns-24)
`boolean`
# builtinNetwork
> **builtinNetwork**(`caip2`): [`Network`](/api/anywalletkit/networks/interfaces/network/) | `undefined`
Defined in: catalog.ts:180
A built-in network (catalog mainnet or default testnet) by id.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Network`](/api/anywalletkit/networks/interfaces/network/) | `undefined`
# caip2FromChainId
> **caip2FromChainId**(`value`): `string` | `null`
Defined in: catalog.ts:186
`0x1` / `1` → `eip155:1`; `null` for anything that is not a positive integer chain id.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# chainHex
> **chainHex**(`caip2`): `string`
Defined in: catalog.ts:183
`eip155:1` → `0x1`.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# checkRpcUrl
> **checkRpcUrl**(`input`, `opts?`): [`UrlPolicyResult`](/api/anywalletkit/networks/type-aliases/urlpolicyresult/)
Defined in: url.ts:162
Apply the policy to one endpoint URL.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### opts?
[Section titled “opts?”](#opts)
[`UrlPolicyOptions`](/api/anywalletkit/networks/interfaces/urlpolicyoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`UrlPolicyResult`](/api/anywalletkit/networks/type-aliases/urlpolicyresult/)
# checkRpcUrls
> **checkRpcUrls**(`urls`, `opts?`): { `ok`: `true`; `urls`: `string`\[]; } | { `message`: `string`; `ok`: `false`; `reason`: [`UrlPolicyReason`](/api/anywalletkit/networks/type-aliases/urlpolicyreason/); `url`: `string`; }
Defined in: url.ts:175
Every URL in the list passes the policy; returns the normalised list or the first failure.
## Parameters
[Section titled “Parameters”](#parameters)
### urls
[Section titled “urls”](#urls)
readonly `string`\[]
### opts?
[Section titled “opts?”](#opts)
[`UrlPolicyOptions`](/api/anywalletkit/networks/interfaces/urlpolicyoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
{ `ok`: `true`; `urls`: `string`\[]; } | { `message`: `string`; `ok`: `false`; `reason`: [`UrlPolicyReason`](/api/anywalletkit/networks/type-aliases/urlpolicyreason/); `url`: `string`; }
# expectedIdentity
> **expectedIdentity**(`caip2`): { `family`: `string`; `value`: `string`; } | `null`
Defined in: verify.ts:79
What the endpoint must report for this network, or null when the id is not one we can check.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
{ `family`: `string`; `value`: `string`; } | `null`
# familyOf
> **familyOf**(`caip2`): [`NetworkFamily`](/api/anywalletkit/networks/type-aliases/networkfamily/) | `null`
Defined in: catalog.ts:204
Chain family from a CAIP-2 namespace (`eip155`, `solana`, `ton`, `tron`, `bip122` / `bitcoin`, `near`, `zcash`).
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
[`NetworkFamily`](/api/anywalletkit/networks/type-aliases/networkfamily/) | `null`
# isAddChainError
> **isAddChainError**(`v`): `v is AddChainError`
Defined in: eip3085.ts:25
Type guard: did [parseAddChainParams](/api/anywalletkit/networks/functions/parseaddchainparams/) refuse?
## Parameters
[Section titled “Parameters”](#parameters)
### v
[Section titled “v”](#v)
[`Network`](/api/anywalletkit/networks/interfaces/network/) | [`AddChainError`](/api/anywalletkit/networks/interfaces/addchainerror/)
## Returns
[Section titled “Returns”](#returns)
`v is AddChainError`
# isCatalogChain
> **isCatalogChain**(`caip2`): `boolean`
Defined in: catalog.ts:199
Whether the asset catalog knows this chain — the gate for `wallet_addEthereumChain` on a catalog build.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isPrivateHost
> **isPrivateHost**(`host`): `boolean`
Defined in: url.ts:124
A host the wallet must not be pointed at from outside: the user’s own machine or network. Names: localhost, `*.localhost`, `*.local`, `*.internal`, `*.home.arpa`, `*.lan`. IPv4 in every form a URL parser accepts (`127.1`, `2130706433`, `0x7f.0.0.1`): 0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.0.0/24, 192.168/16, 198.18/15, multicast and reserved; a numeric host that is no valid IPv4 counts as private too. IPv6: unspecified, loopback, unique-local, link-local, multicast, and the IPv4 inside a mapped (`::ffff:…`), compatible, NAT64 (`64:ff9b::`) or 6to4 (`2002::`) address; and any host that is not printable ASCII, which a URL parser would map to one of these (scan 2026-10-27 modules, F37). A public name that resolves to a private address (DNS rebinding) is not caught here.
## Parameters
[Section titled “Parameters”](#parameters)
### host
[Section titled “host”](#host)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isPublicHttpsUrl
> **isPublicHttpsUrl**(`url`): `boolean`
Defined in: url.ts:156
A URL the wallet may fetch from the user’s device on behalf of someone else (an ENS gateway, an avatar): https, no credentials, and a public host — no `{…}` template in it, nothing [isPrivateHost](/api/anywalletkit/networks/functions/isprivatehost/) names.
## Parameters
[Section titled “Parameters”](#parameters)
### url
[Section titled “url”](#url)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# memoryJsonStorage
> **memoryJsonStorage**<`T`>(`initial?`): [`JsonStorage`](/api/anywalletkit/networks/interfaces/jsonstorage/)<`T`> & `object`
Defined in: types.ts:47
In-memory storage for tests and smoke runs.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Parameters
[Section titled “Parameters”](#parameters)
### initial?
[Section titled “initial?”](#initial)
`T` | `null`
## Returns
[Section titled “Returns”](#returns)
[`JsonStorage`](/api/anywalletkit/networks/interfaces/jsonstorage/)<`T`> & `object`
# nonEvmChain
> **nonEvmChain**(`caip2`): [`ChainDescriptor`](/api/anywalletkit/networks/interfaces/chaindescriptor/) | `undefined`
Defined in: catalog.ts:101
A non-EVM catalog chain by id.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
[`ChainDescriptor`](/api/anywalletkit/networks/interfaces/chaindescriptor/) | `undefined`
# parseAddChainParams
> **parseAddChainParams**(`params`, `opts?`): [`Network`](/api/anywalletkit/networks/interfaces/network/) | [`AddChainError`](/api/anywalletkit/networks/interfaces/addchainerror/)
Defined in: eip3085.ts:46
Turn `wallet_addEthereumChain` params into a [Network](/api/anywalletkit/networks/interfaces/network/), or into the EIP-1193 error to answer with (`-32602` bad params, `4902` a chain the wallet refuses).
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
`unknown`
### opts?
[Section titled “opts?”](#opts)
[`ParseAddChainOptions`](/api/anywalletkit/networks/interfaces/parseaddchainoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`Network`](/api/anywalletkit/networks/interfaces/network/) | [`AddChainError`](/api/anywalletkit/networks/interfaces/addchainerror/)
# parseUrl
> **parseUrl**(`input`): { `hasCredentials`: `boolean`; `host`: `string`; `port`: `number` | `null`; `rest`: `string`; `scheme`: `string`; } | `null`
Defined in: url.ts:28
`scheme://[user@]host[:port][/path]` → parts, or null. Hosts: DNS names, IPv4, bracketed IPv6. A URL with a backslash, a tab, CR/LF or another control character anywhere is refused: a WHATWG parser (browsers, Node, the extension) and OkHttp end the authority at `\` and drop tab/CR/LF, so `https://192.168.1.1\x` would be checked as one host and fetched from another (scan 2026-10-28 F12). \`\` also ends the authority here, should the refusal ever be relaxed.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
## Returns
[Section titled “Returns”](#returns)
{ `hasCredentials`: `boolean`; `host`: `string`; `port`: `number` | `null`; `rest`: `string`; `scheme`: `string`; } | `null`
# tonGlobalIdFromBoc
> **tonGlobalIdFromBoc**(`b64`): `number` | `null`
Defined in: verify.ts:228
The int32 a TON config-param-19 cell carries (BOC with one cell, 4 data bytes), base64 in. Hermes has no atob — decode by hand.
## Parameters
[Section titled “Parameters”](#parameters)
### b64
[Section titled “b64”](#b64)
`string`
## Returns
[Section titled “Returns”](#returns)
`number` | `null`
# verifyNetwork
> **verifyNetwork**(`network`, `opts?`): `Promise`<[`VerifyResult`](/api/anywalletkit/networks/interfaces/verifyresult/)>
Defined in: verify.ts:352
Check one endpoint (`opts.rpc`, default the network’s first) against the network’s declared identity. Never throws.
## Parameters
[Section titled “Parameters”](#parameters)
### network
[Section titled “network”](#network)
`Pick`<[`Network`](/api/anywalletkit/networks/interfaces/network/), `"caip2"` | `"family"` | `"rpcs"`>
### opts?
[Section titled “opts?”](#opts)
[`VerifyOptions`](/api/anywalletkit/networks/interfaces/verifyoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`VerifyResult`](/api/anywalletkit/networks/interfaces/verifyresult/)>
# verifyRpcs
> **verifyRpcs**(`network`, `opts?`): `Promise`<`object`\[]>
Defined in: verify.ts:384
Every endpoint of the network, in order, each checked on its own.
## Parameters
[Section titled “Parameters”](#parameters)
### network
[Section titled “network”](#network)
`Pick`<[`Network`](/api/anywalletkit/networks/interfaces/network/), `"caip2"` | `"family"` | `"rpcs"`>
### opts?
[Section titled “opts?”](#opts)
`Omit`<[`VerifyOptions`](/api/anywalletkit/networks/interfaces/verifyoptions/), `"rpc"`> = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`object`\[]>
# AddChainError
Defined in: eip3085.ts:19
The EIP-1193 error to answer a refused `wallet_addEthereumChain` with.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: `number`
Defined in: eip3085.ts:20
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: eip3085.ts:21
# ChainDescriptor
Defined in: catalog.ts:80
A non-EVM catalog chain: id, family, native currency and explorer links.
## Properties
[Section titled “Properties”](#properties)
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: catalog.ts:81
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: catalog.ts:85
***
### explorerAddress
[Section titled “explorerAddress”](#exploreraddress)
> **explorerAddress**: `string`
Defined in: catalog.ts:87
***
### explorerTx
[Section titled “explorerTx”](#explorertx)
> **explorerTx**: `string`
Defined in: catalog.ts:86
***
### key
[Section titled “key”](#key)
> **key**: `"solana"` | `"ton"` | `"tron"` | `"btc"` | `"near"` | `"zcash"`
Defined in: catalog.ts:82
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: catalog.ts:83
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: catalog.ts:84
# FetchResponseLike
Defined in: verify.ts:25
The part of a `fetch` response the verifier reads.
## Properties
[Section titled “Properties”](#properties)
### body?
[Section titled “body?”](#body)
> `optional` **body?**: { `cancel?`: `unknown`; `getReader?`: { `cancel`: `Promise`<`unknown`>; `read`: `Promise`<{ `done`: `boolean`; `value?`: `Uint8Array`<`ArrayBufferLike`>; }>; }; } | `null`
Defined in: verify.ts:36
A stream lets the verifier stop reading at MAX_RESPONSE_BYTES; without one the deadline bounds the read.
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `object`
Defined in: verify.ts:34
#### get()
[Section titled “get()”](#get)
> **get**(`name`): `string` | `null`
##### Parameters
[Section titled “Parameters”](#parameters)
###### name
[Section titled “name”](#name)
`string`
##### Returns
[Section titled “Returns”](#returns)
`string` | `null`
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: verify.ts:26
***
### redirected?
[Section titled “redirected?”](#redirected)
> `optional` **redirected?**: `boolean`
Defined in: verify.ts:31
***
### status
[Section titled “status”](#status)
> **status**: `number`
Defined in: verify.ts:27
***
### type?
[Section titled “type?”](#type)
> `optional` **type?**: `string`
Defined in: verify.ts:33
`opaqueredirect` for a redirect a browser stopped under `redirect: 'manual'`.
***
### url?
[Section titled “url?”](#url)
> `optional` **url?**: `string`
Defined in: verify.ts:30
The final URL, when the transport reports it: a different one means the request was redirected.
## Methods
[Section titled “Methods”](#methods)
### text()
[Section titled “text()”](#text)
> **text**(): `Promise`<`string`>
Defined in: verify.ts:28
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
# JsonStorage
Defined in: types.ts:39
One JSON value under one key — the shape every small store needs (chrome.storage, AsyncStorage, memory).
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(): `Promise`<`T` | `null`>
Defined in: types.ts:41
The stored value, or `null` on first run.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`T` | `null`>
***
### set()
[Section titled “set()”](#set)
> **set**(`value`): `Promise`<`void`>
Defined in: types.ts:43
Persist the value.
#### Parameters
[Section titled “Parameters”](#parameters)
##### value
[Section titled “value”](#value)
`T`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
# Network
Defined in: types.ts:11
One network: chain id, family, native currency, endpoints, explorer, and where it came from.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NetworkEntry`](/api/anywalletkit/networks/interfaces/networkentry/)
## Properties
[Section titled “Properties”](#properties)
### balancesViaOwnRpc?
[Section titled “balancesViaOwnRpc?”](#balancesviaownrpc)
> `optional` **balancesViaOwnRpc?**: `boolean`
Defined in: types.ts:33
Decision 3, phase 2 of the mobile work: read balances over the user’s RPC instead of the server.
***
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: types.ts:13
CAIP-2: `eip155:11155111`, `solana:EtWT…`, `bip122:`, `ton:-3`, `tron:nile`, `near:testnet`, `zcash:testnet`.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: types.ts:21
Decimals of the native currency.
***
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: `boolean`
Defined in: types.ts:35
Testnets ship disabled; a network whose verification failed is saved disabled.
***
### explorer?
[Section titled “explorer?”](#explorer)
> `optional` **explorer?**: `string`
Defined in: types.ts:27
Explorer base URL (no trailing slash).
***
### family
[Section titled “family”](#family)
> **family**: [`NetworkFamily`](/api/anywalletkit/networks/type-aliases/networkfamily/)
Defined in: types.ts:15
Chain family (`evm`, `solana`, `ton`, `tron`, `btc`, `near`, `zcash`).
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`NetworkKind`](/api/anywalletkit/networks/type-aliases/networkkind/)
Defined in: types.ts:23
A catalog mainnet, a default testnet, or a custom network.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: types.ts:17
Display name.
***
### onlyOwnRpc?
[Section titled “onlyOwnRpc?”](#onlyownrpc)
> `optional` **onlyOwnRpc?**: `boolean`
Defined in: types.ts:31
Decision 4: drop the public fallback — only the user’s RPCs are used (privacy / local node).
***
### rpcs
[Section titled “rpcs”](#rpcs)
> **rpcs**: `string`\[]
Defined in: types.ts:25
Endpoints, tried in order. For a builtin entry these are the public failover list; the table prepends the user’s own.
***
### source
[Section titled “source”](#source)
> **source**: [`NetworkSource`](/api/anywalletkit/networks/type-aliases/networksource/)
Defined in: types.ts:29
Who supplied it: built in, the user, or a site (with its origin).
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: types.ts:19
Native currency.
# NetworkEntry
Defined in: table.ts:54
A network as the table serves it: the model plus which RPCs are the user’s and which are skipped.
## Extends
[Section titled “Extends”](#extends)
* [`Network`](/api/anywalletkit/networks/interfaces/network/)
## Properties
[Section titled “Properties”](#properties)
### balancesViaOwnRpc?
[Section titled “balancesViaOwnRpc?”](#balancesviaownrpc)
> `optional` **balancesViaOwnRpc?**: `boolean`
Defined in: types.ts:33
Decision 3, phase 2 of the mobile work: read balances over the user’s RPC instead of the server.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`balancesViaOwnRpc`](/api/anywalletkit/networks/interfaces/network/#balancesviaownrpc)
***
### builtinRpcs
[Section titled “builtinRpcs”](#builtinrpcs)
> **builtinRpcs**: `string`\[]
Defined in: table.ts:58
The shipped list (empty for a custom network).
***
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: types.ts:13
CAIP-2: `eip155:11155111`, `solana:EtWT…`, `bip122:`, `ton:-3`, `tron:nile`, `near:testnet`, `zcash:testnet`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`caip2`](/api/anywalletkit/networks/interfaces/network/#caip2)
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: types.ts:21
Decimals of the native currency.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`decimals`](/api/anywalletkit/networks/interfaces/network/#decimals)
***
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: `boolean`
Defined in: types.ts:35
Testnets ship disabled; a network whose verification failed is saved disabled.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`enabled`](/api/anywalletkit/networks/interfaces/network/#enabled)
***
### explorer?
[Section titled “explorer?”](#explorer)
> `optional` **explorer?**: `string`
Defined in: types.ts:27
Explorer base URL (no trailing slash).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`explorer`](/api/anywalletkit/networks/interfaces/network/#explorer)
***
### family
[Section titled “family”](#family)
> **family**: [`NetworkFamily`](/api/anywalletkit/networks/type-aliases/networkfamily/)
Defined in: types.ts:15
Chain family (`evm`, `solana`, `ton`, `tron`, `btc`, `near`, `zcash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`family`](/api/anywalletkit/networks/interfaces/network/#family)
***
### issues
[Section titled “issues”](#issues)
> **issues**: `Record`<`string`, [`RpcIssue`](/api/anywalletkit/networks/interfaces/rpcissue/)>
Defined in: table.ts:60
User RPCs currently skipped, with the reason.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`NetworkKind`](/api/anywalletkit/networks/type-aliases/networkkind/)
Defined in: types.ts:23
A catalog mainnet, a default testnet, or a custom network.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`kind`](/api/anywalletkit/networks/interfaces/network/#kind)
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: types.ts:17
Display name.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`name`](/api/anywalletkit/networks/interfaces/network/#name)
***
### onlyOwnRpc?
[Section titled “onlyOwnRpc?”](#onlyownrpc)
> `optional` **onlyOwnRpc?**: `boolean`
Defined in: types.ts:31
Decision 4: drop the public fallback — only the user’s RPCs are used (privacy / local node).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`onlyOwnRpc`](/api/anywalletkit/networks/interfaces/network/#onlyownrpc)
***
### rpcs
[Section titled “rpcs”](#rpcs)
> **rpcs**: `string`\[]
Defined in: types.ts:25
Endpoints, tried in order. For a builtin entry these are the public failover list; the table prepends the user’s own.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`rpcs`](/api/anywalletkit/networks/interfaces/network/#rpcs)
***
### source
[Section titled “source”](#source)
> **source**: [`NetworkSource`](/api/anywalletkit/networks/type-aliases/networksource/)
Defined in: types.ts:29
Who supplied it: built in, the user, or a site (with its origin).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`source`](/api/anywalletkit/networks/interfaces/network/#source)
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: types.ts:19
Native currency.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`Network`](/api/anywalletkit/networks/interfaces/network/).[`symbol`](/api/anywalletkit/networks/interfaces/network/#symbol)
***
### userRpcs
[Section titled “userRpcs”](#userrpcs)
> **userRpcs**: `string`\[]
Defined in: table.ts:56
RPCs the user (or a site) supplied, in order. For a custom network this is every RPC.
# NetworkOverride
Defined in: table.ts:42
What the user changed on one built-in network.
## Properties
[Section titled “Properties”](#properties)
### balancesViaOwnRpc?
[Section titled “balancesViaOwnRpc?”](#balancesviaownrpc)
> `optional` **balancesViaOwnRpc?**: `boolean`
Defined in: table.ts:48
Read balances over the user’s RPC instead of the app’s server.
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: table.ts:50
Switched on or off by the user.
***
### onlyOwnRpc?
[Section titled “onlyOwnRpc?”](#onlyownrpc)
> `optional` **onlyOwnRpc?**: `boolean`
Defined in: table.ts:46
Use only `userRpcs`, never the shipped list.
***
### userRpcs?
[Section titled “userRpcs?”](#userrpcs)
> `optional` **userRpcs?**: `string`\[]
Defined in: table.ts:44
Endpoints tried before the shipped list.
# NetworksState
Defined in: table.ts:28
What the store persists: only deltas from the builtin table, so a shipped list update reaches every install.
## Properties
[Section titled “Properties”](#properties)
### allowHttpLocal
[Section titled “allowHttpLocal”](#allowhttplocal)
> **allowHttpLocal**: `boolean`
Defined in: table.ts:32
Accept `http://` RPCs on private addresses.
***
### custom
[Section titled “custom”](#custom)
> **custom**: [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: table.ts:36
User- or site-added networks (never a builtin caip2).
***
### issues
[Section titled “issues”](#issues)
> **issues**: `Record`<`string`, `Record`<`string`, [`RpcIssue`](/api/anywalletkit/networks/interfaces/rpcissue/)>>
Defined in: table.ts:38
Per caip2 → per URL: why a user RPC is skipped.
***
### overrides
[Section titled “overrides”](#overrides)
> **overrides**: `Record`<`string`, [`NetworkOverride`](/api/anywalletkit/networks/interfaces/networkoverride/)>
Defined in: table.ts:34
Per builtin caip2: the user’s additions and toggles.
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: table.ts:30
Format version.
# ParseAddChainOptions
Defined in: eip3085.ts:28
Options for [parseAddChainParams](/api/anywalletkit/networks/functions/parseaddchainparams/).
## Properties
[Section titled “Properties”](#properties)
### allowHttpLocal?
[Section titled “allowHttpLocal?”](#allowhttplocal)
> `optional` **allowHttpLocal?**: `boolean`
Defined in: eip3085.ts:35
Accept RPCs on private / local addresses (localhost, 10.x, 192.168.x, \*.local…) — https or http — from a site. Default false: a page must not point the wallet at the user’s own network. Pass the user’s “Allow http for local nodes” setting.
***
### known?
[Section titled “known?”](#known)
> `optional` **known?**: (`caip2`) => `boolean`
Defined in: eip3085.ts:36
#### Parameters
[Section titled “Parameters”](#parameters)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: eip3085.ts:39
#### Returns
[Section titled “Returns”](#returns-1)
`number`
***
### origin?
[Section titled “origin?”](#origin)
> `optional` **origin?**: `string`
Defined in: eip3085.ts:38
Site origin — recorded as the network’s `source` so every sheet on it says who supplied the RPC.
# RpcIssue
Defined in: table.ts:21
Why a user RPC is parked: the error and when it was seen.
## Properties
[Section titled “Properties”](#properties)
### at
[Section titled “at”](#at)
> **at**: `number`
Defined in: table.ts:23
***
### error
[Section titled “error”](#error)
> **error**: `string`
Defined in: table.ts:22
***
### reported?
[Section titled “reported?”](#reported)
> `optional` **reported?**: `string`
Defined in: table.ts:24
# UrlPolicyOptions
Defined in: url.ts:16
URL policy options.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`VerifyOptions`](/api/anywalletkit/networks/interfaces/verifyoptions/)
## Properties
[Section titled “Properties”](#properties)
### allowHttpLocal?
[Section titled “allowHttpLocal?”](#allowhttplocal)
> `optional` **allowHttpLocal?**: `boolean`
Defined in: url.ts:18
The Advanced toggle: accept `http://` for private addresses. Default false.
# VerifyOptions
Defined in: verify.ts:46
Options for `verifyNetwork`: transport, timeout, which endpoint, and the URL policy.
## Extends
[Section titled “Extends”](#extends)
* [`UrlPolicyOptions`](/api/anywalletkit/networks/interfaces/urlpolicyoptions/)
## Properties
[Section titled “Properties”](#properties)
### allowHttpLocal?
[Section titled “allowHttpLocal?”](#allowhttplocal)
> `optional` **allowHttpLocal?**: `boolean`
Defined in: url.ts:18
The Advanced toggle: accept `http://` for private addresses. Default false.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`UrlPolicyOptions`](/api/anywalletkit/networks/interfaces/urlpolicyoptions/).[`allowHttpLocal`](/api/anywalletkit/networks/interfaces/urlpolicyoptions/#allowhttplocal)
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/networks/type-aliases/fetchlike/)
Defined in: verify.ts:47
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: () => `number`
Defined in: verify.ts:52
#### Returns
[Section titled “Returns”](#returns)
`number`
***
### rpc?
[Section titled “rpc?”](#rpc)
> `optional` **rpc?**: `string`
Defined in: verify.ts:51
Which endpoint to check; default the network’s first.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: verify.ts:49
Per call; default 8 s.
# VerifyResult
Defined in: types.ts:58
Result of checking one endpoint against the network it claims to serve.
## Properties
[Section titled “Properties”](#properties)
### error?
[Section titled “error?”](#error)
> `optional` **error?**: `string`
Defined in: types.ts:65
Why the endpoint was refused (`chain-id-mismatch`, `url-policy`, `http-…`, `timeout`, …).
***
### latencyMs
[Section titled “latencyMs”](#latencyms)
> **latencyMs**: `number`
Defined in: types.ts:61
Round trip of the identity call.
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: types.ts:59
***
### reported?
[Section titled “reported?”](#reported)
> `optional` **reported?**: `string`
Defined in: types.ts:67
What the endpoint said it is (chain id, genesis, global id, chain name) — shown next to a mismatch.
***
### tip?
[Section titled “tip?”](#tip)
> `optional` **tip?**: `number`
Defined in: types.ts:63
Tip height / slot / seqno when the endpoint reported one.
# FetchLike
> **FetchLike** = (`url`, `init?`) => `Promise`<[`FetchResponseLike`](/api/anywalletkit/networks/interfaces/fetchresponselike/)>
Defined in: verify.ts:43
A `fetch`-compatible function; pass one to route checks through a proxy or a test double. The verifier asks for `redirect: 'error'`: a transport that cannot refuse redirects should at least report `url` / `redirected`, so a redirected answer is refused (the redirected request itself has then already gone out).
## Parameters
[Section titled “Parameters”](#parameters)
### url
[Section titled “url”](#url)
`string`
### init?
[Section titled “init?”](#init)
#### body?
[Section titled “body?”](#body)
`string`
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### redirect?
[Section titled “redirect?”](#redirect)
`"error"` | `"manual"` | `"follow"`
#### signal?
[Section titled “signal?”](#signal)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`FetchResponseLike`](/api/anywalletkit/networks/interfaces/fetchresponselike/)>
# NetworkFamily
> **NetworkFamily** = `"evm"` | `"solana"` | `"ton"` | `"tron"` | `"btc"` | `"near"` | `"zcash"`
Defined in: types.ts:2
Chain families a network can belong to — one per wallet package.
# NetworkKind
> **NetworkKind** = `"catalog"` | `"testnet"` | `"custom"`
Defined in: types.ts:5
`catalog`: a mainnet the asset catalog knows; `testnet`: a shipped test network (off until enabled); `custom`: added by the user or a site.
# NetworkSource
> **NetworkSource** = `"builtin"` | `"user"` | { `addedAt`: `number`; `origin`: `string`; }
Defined in: types.ts:8
Who supplied the entry. A site-added network (`wallet_addEthereumChain`) carries its origin so every sheet on it can say so.
# UrlPolicyReason
> **UrlPolicyReason** = `"not-a-url"` | `"scheme"` | `"credentials"` | `"http-not-local"` | `"http-not-allowed"`
Defined in: url.ts:10
Endpoint URL policy (owner decision 2, 2026-10-21): https only; `http://` accepted for local / private addresses only (localhost, 127/8, 10/8, 172.16/12, 192.168/16, `*.local`) and only behind the explicit “allow http for local nodes” opt-in. No credentials in the URL.
Parsed by hand — Hermes ships no `URL`.
# UrlPolicyResult
> **UrlPolicyResult** = { `local`: `boolean`; `ok`: `true`; `url`: `string`; } | { `message`: `string`; `ok`: `false`; `reason`: [`UrlPolicyReason`](/api/anywalletkit/networks/type-aliases/urlpolicyreason/); }
Defined in: url.ts:13
Result of `checkRpcUrl`: the normalized URL and whether it is local, or why it was refused.
# ADD_CHAIN_ERRORS
> `const` **ADD_CHAIN_ERRORS**: `object`
Defined in: eip3085.ts:12
EIP-1193 / EIP-1474 codes a provider answers `wallet_addEthereumChain` with.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### chainNotAdded
[Section titled “chainNotAdded”](#chainnotadded)
> `readonly` **chainNotAdded**: `4902` = `4902`
EIP-3326/3085: the chain is not in the wallet.
### invalidParams
[Section titled “invalidParams”](#invalidparams)
> `readonly` **invalidParams**: `-32602` = `-32602`
# BTC_CHAIN
> `const` **BTC_CHAIN**: `"bitcoin:mainnet"` = `'bitcoin:mainnet'`
Defined in: catalog.ts:72
Catalog id of Bitcoin mainnet.
# BTC_ESPLORA
> `const` **BTC_ESPLORA**: readonly `string`\[]
Defined in: catalog.ts:73
# BTC_TESTNET4_CHAIN
> `const` **BTC_TESTNET4_CHAIN**: `"bip122:00000000da84f2bafbbc53dee25a72ae"` = `'bip122:00000000da84f2bafbbc53dee25a72ae'`
Defined in: catalog.ts:138
Bitcoin testnet4 (genesis 00000000da84f2ba…, mempool.space/testnet4). `wallet-btc`‘s `testnet` option (tb1…, coin type 1’) serves it.
# BUILTIN_NETWORKS
> `const` **BUILTIN_NETWORKS**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: catalog.ts:177
Mainnets and default testnets: what a fresh `NetworksTable` starts with.
# CATALOG_NETWORKS
> `const` **CATALOG_NETWORKS**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: catalog.ts:131
Every mainnet: EVM then the other families.
# DEFAULT_TESTNETS
> `const` **DEFAULT_TESTNETS**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: catalog.ts:159
Testnets the table ships switched off.
# EVM_MAINNETS
> `const` **EVM_MAINNETS**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: catalog.ts:27
EVM mainnets — the same lists as the mobile app’s `RPC_URLS` and the extension’s `DEFAULT_NETWORKS`.
# NEAR_CHAIN
> `const` **NEAR_CHAIN**: `"near:mainnet"` = `'near:mainnet'`
Defined in: catalog.ts:74
# NEAR_PROVIDERS
> `const` **NEAR_PROVIDERS**: readonly `string`\[]
Defined in: catalog.ts:75
# NEAR_TESTNET_CHAIN
> `const` **NEAR_TESTNET_CHAIN**: `"near:testnet"` = `'near:testnet'`
Defined in: catalog.ts:142
# NON_EVM_CHAINS
> `const` **NON_EVM_CHAINS**: readonly [`ChainDescriptor`](/api/anywalletkit/networks/interfaces/chaindescriptor/)\[]
Defined in: catalog.ts:91
The non-EVM catalog chains.
# NON_EVM_MAINNETS
> `const` **NON_EVM_MAINNETS**: readonly [`Network`](/api/anywalletkit/networks/interfaces/network/)\[]
Defined in: catalog.ts:128
The non-EVM mainnets as networks, with their shipped endpoints.
# SOLANA_CHAIN
> `const` **SOLANA_CHAIN**: `"solana:mainnet"` = `'solana:mainnet'`
Defined in: catalog.ts:64
# SOLANA_DEVNET_CHAIN
> `const` **SOLANA_DEVNET_CHAIN**: `"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"` = `'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1'`
Defined in: catalog.ts:136
Solana devnet, as `@anywalletkit/wallet-solana` names it (`CAIP2_GENESIS.devnet`).
# SOLANA_RPCS
> `const` **SOLANA_RPCS**: readonly `string`\[]
Defined in: catalog.ts:66
Shipped Solana mainnet endpoints.
# TON_CHAIN
> `const` **TON_CHAIN**: `"ton:-239"` = `'ton:-239'`
Defined in: catalog.ts:67
# TON_ENDPOINTS
> `const` **TON_ENDPOINTS**: readonly `string`\[]
Defined in: catalog.ts:68
# TON_TESTNET_CHAIN
> `const` **TON_TESTNET_CHAIN**: `"ton:-3"` = `'ton:-3'`
Defined in: catalog.ts:139
# TRON_CHAIN
> `const` **TRON_CHAIN**: `"tron:728126428"` = `'tron:728126428'`
Defined in: catalog.ts:69
# TRON_NILE_CHAIN
> `const` **TRON_NILE_CHAIN**: `"tron:nile"` = `'tron:nile'`
Defined in: catalog.ts:141
Tron Nile. `wallet-tron` also accepts `nile` and the genesis form `tron:0xcd8690dc`.
# TRON_PROVIDERS
> `const` **TRON_PROVIDERS**: readonly `string`\[]
Defined in: catalog.ts:70
# ZCASH_CHAIN
> `const` **ZCASH_CHAIN**: `"zcash:mainnet"` = `'zcash:mainnet'`
Defined in: catalog.ts:76
# ZCASH_PROVIDERS
> `const` **ZCASH_PROVIDERS**: readonly `string`\[]
Defined in: catalog.ts:77
# ZCASH_TESTNET_CHAIN
> `const` **ZCASH_TESTNET_CHAIN**: `"zcash:testnet"` = `'zcash:testnet'`
Defined in: catalog.ts:143
# @anywalletkit/protocol-approvals-evm
# @anywalletkit/protocol-approvals-evm
[Section titled “@anywalletkit/protocol-approvals-evm”](#anywalletkitprotocol-approvals-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-approvals-evm)
**A simple package that lets [`@anywalletkit/wallet-evm`](https://www.npmjs.com/package/@anywalletkit/wallet-evm) accounts see and revoke the token approvals they have granted.**
Every swap, bridge, lending and staking module *creates* approvals (ERC-20 allowances to routers, Permit2 allowances, operator approvals on NFTs). None of them takes an approval back. This module does: it discovers what an account has granted, flags the risky grants, and revokes them through the account’s own methods, so a policy-governed account stays governed.
Supported on evm: ERC-20 allowances, ERC-721 per-token approvals, ERC-721 / ERC-1155 operator approvals (`setApprovalForAll`), Uniswap Permit2 allowances, and the account’s EIP-7702 delegation.
## Install
[Section titled “Install”](#install)
```bash
npm install @anywalletkit/protocol-approvals-evm
```
Peer: `@anywalletkit/core`. Runtime dependency: `viem`. Built with tsup (ESM + CJS + types in `dist/`); works on Node 20+ and React Native.
## Usage
[Section titled “Usage”](#usage)
```js
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import ApprovalsProtocolEvm from '@anywalletkit/protocol-approvals-evm'
const wallet = new Wallet(seed)
wallet.registerWallet('eip155:1', WalletManagerEvm, { provider: 'https://your-rpc', chainId: 1 })
wallet.registerProtocol('approvals', ApprovalsProtocolEvm, {
chain: 'eip155:1',
config: {
fromBlock: 21_000_000, // where the wallet was created — a cold scan from 0 is slow
blockRange: 10_000 // your RPC's eth_getLogs window (QuickNode: 10 000)
}
})
const approvals = await wallet.getProtocol('approvals')
const { approvals: list, coverage } = await approvals.getApprovals()
for (const a of list) {
console.log(a.standard, a.token, '→', a.spender, a.unlimited ? 'UNLIMITED' : a.amount, a.risks)
}
// erc20 0xdAC1…1ec7 → 0x1231…4EaE 0n [] (LI.FI, exact-amount, already consumed)
// erc20 0xdAC1…1ec7 → 0xD37B…7146 1000000000n [] (1 000 USD₮ still spendable)
// permit2 0xA0b8…eB48 → 0x3fC9…BB1c UNLIMITED ['unlimited']
await approvals.revoke(list[1]) // account.approve({ amount: 0 })
await approvals.revokeAll(list.filter((a) => a.risks.length))
```
Discovery asks `eth_getLogs` for every approval event with the owner in `topic1` and **no `address` filter**; most free public RPCs refuse that. Use your own node, a paid plan, or an indexer source (below). A read-only account (anything with `getAddress()`) is enough for `getApprovals`; `revoke` / `revokeAll` need a full account.
### With policies
[Section titled “With policies”](#with-policies)
Revokes are sent through `account.approve({amount: 0})`, `account.sendTransaction` and `account.revokeDelegation()`. On an account from the kit’s `Wallet.getAccount(...)` they pass the wallet’s policies like any other write. The kit treats them as `kind: 'revoke'`: the allowlist and the spender’s blocklist entry do not apply (a blocklisted drainer’s allowance can always be taken back), `confirm` and the fee cap do. `isRevokeCalldata(data)` and `isUnlimitedAmount(amount)` are exported for hosts that check calldata themselves; to let a whole transaction through a policy as a revoke, use `isRevokeTransaction(tx, { targets })` with the approvals your scan returned (or a `Map` or plain object from address to standard; it never throws): `approve(spender, 0)` counts only on an ERC-20 target, because on an ERC-721 it approves `spender` for token #0; `approve(0x0, id)` and `setApprovalForAll(operator, false)` count on NFT targets; without `targets` only Permit2 `lockdown` does. An `'erc20'` revoke asks the token’s ERC-165 first, through the protocol’s provider (`provider-required` without one), and is refused (`invalid-approval`) when the token is an ERC-721; `buildRevokeTransaction()` does not check. The protocol’s viem client has CCIP-Read off: a spam token’s `OffchainLookup` makes no fetch.
## How discovery works
[Section titled “How discovery works”](#how-discovery-works)
1. **Candidates from events.** One `eth_getLogs` per block range asks for every approval-shaped event with the owner in `topic1` and no `address` filter: ERC-20 / ERC-721 `Approval` (told apart by topic count), `ApprovalForAll`, Permit2 `Approval` / `Permit` / `Lockdown`. A range the node refuses is halved and retried; a single block that stays refused becomes a gap and `coverage.complete` turns false rather than the call failing.
2. **Truth from state.** Candidates are verified in one Multicall3 `aggregate3` (with a per-call fallback where Multicall3 is missing): `allowance`, `isApprovedForAll` + `supportsInterface(ERC-1155)`, `getApproved` + `ownerOf`, Permit2 `allowance`. Zero, expired and revoked entries are dropped unless `includeZero` is set.
3. **Risk flags.** `unlimited` (≥ 2^255, or `MaxUint160` for Permit2), `eoa-spender` (spender has no code), `expired` (Permit2, with `includeZero`).
4. **EIP-7702.** The account’s code is read; `0xef0100‖delegate` is reported as an `eip7702` approval and revoked with `account.revokeDelegation()`.
### Making it fast
[Section titled “Making it fast”](#making-it-fast)
A cold scan from block 0 through a 10 000-block RPC window is thousands of requests. Three knobs:
* `fromBlock` — the wallet’s creation block. Wallets created by your app know it.
* `cache` — `{ get(key), set(key, entry) }`; the module stores `{ fromBlock, toBlock, candidates }` (plain JSON) per `chainId:owner` and rescans only new blocks next time.
* `source: new EtherscanSource({ chainId, apiKey })` — Etherscan V2, one key for every chain it indexes, **one request for the whole history** (every log with the owner in `topic1`; the parser drops the owner’s transfers). The free tier covers Ethereum, Arbitrum, Polygon and others at 5 requests/s; Base, Optimism, BNB and Avalanche need a paid plan. Keep the key off the client: set `baseUrl` to your own proxy that appends it and `headers` for the proxy’s auth.
* `source: new BlockscoutSource({ chainId })` — the same query against a public Blockscout instance, no key: **one request for the whole history** (every log with the owner in `topic1`; the parser drops the owner’s transfers), no key. Keyless instances allow \~10 requests per window per instance and answer 429 with `x-ratelimit-reset`; the source waits for short resets and fails fast with the wait time for long ones. Pass `apiKey` (free at dev.blockscout.com) to lift the limit, `perTopic: true` to ask per event signature instead. Use it for the first scan of an imported wallet and let `RpcLogsSource` take over.
Measured on a real wallet on Ethereum (11 approval events over 4 M blocks): `RpcLogsSource` 398 requests / 121 s at a 10 000 window, `EtherscanSource` and `BlockscoutSource` 1 request / \~1 s.
### Spender labels
[Section titled “Spender labels”](#spender-labels)
```js
import ApprovalsProtocolEvm, { EtherscanLabels } from '@anywalletkit/protocol-approvals-evm'
const labels = new EtherscanLabels({ chainId: 1, apiKey, explorerUrl: 'https://etherscan.io' })
const approvals = new ApprovalsProtocolEvm(account, { labels })
// approval.spenderLabel → { name: 'THORChain_Router', url: 'https://etherscan.io/address/0xD37B…' }
```
`EtherscanLabels` resolves each unique spender once through `module=contract&action=getsourcecode` (a proxy is named after its implementation, so `0x6C96…` reads `OAdapterUpgradeable`, not `TransparentUpgradeableProxy`) and memoises the answer; pass `cache` to persist it. Unverified contracts and EOAs get no label. A label failure never fails the scan. Any object with `resolve(addresses) → { [lowercaseAddress]: { name, url? } }` works as `config.labels`.
Etherscan’s own “Token Approvals” page lists the **original** allowance from the `Approval` event and does not read the current allowance; USDT does not emit `Approval` when a spender uses the allowance, so approvals fully consumed by a swap or deposit stay listed there. This module reports the on-chain `allowance()`; pass `includeZero: true` to see the consumed ones too.
## API
[Section titled “API”](#api)
| Method | Account | Returns |
| ------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getSupportedStandards()` | read-only | `['erc20', 'erc721', 'erc721-token', 'erc1155', 'permit2', 'eip7702']` |
| `getApprovals(options?)` | read-only | `{ approvals: Approval[], coverage }` — `options`: `standards`, `tokens`, `spenders`, `includeZero`, `fromBlock`, `toBlock` |
| `quoteRevoke(approval)` | full | `{ fee }` via `account.quoteSendTransaction` |
| `revoke(approval)` | full | `{ hash, fee }` |
| `revokeAll(approvals)` | full | `RevokeResult[]` — Permit2 pairs fold into one `lockdown`; with `config.batch` every calldata revoke goes out as one `sendTransaction(tx[])` (ERC-4337 / 7702 accounts); a failed item carries `error` and the run continues |
| `buildRevokeTransaction(approval \| approvals[])` | none | `{ to, data, value }` for hosts that batch themselves |
`Approval`: `{ id, standard, chainId, token, spender, amount, unlimited, tokenId?, expiration?, grantedAt?, risks }`. `id` is `chainId:standard:token:spender[:tokenId]` and is stable across scans. Approval objects are plain (structured-clone safe).
### Config
[Section titled “Config”](#config)
| Option | Default | Meaning |
| ------------------- | --------------- | ------------------------------------------------------------- |
| `provider` | account’s | RPC URL or EIP-1193 provider |
| `chainId` | from RPC | skips `eth_chainId` |
| `fromBlock` | `0` | start of a cold scan |
| `blockRange` | `null` | pre-chunk `eth_getLogs`; null = whole range, split on refusal |
| `source` | `RpcLogsSource` | any `{ name, collect(owner, range) }` |
| `cache` | none | `{ get, set }` for incremental rescans |
| `multicall` | Multicall3 | address, or `false` for single calls |
| `batch` | `false` | account accepts `sendTransaction(tx[])` as one operation |
| `includeDelegation` | `true` | report the EIP-7702 delegation |
| `concurrency` | `4` | parallel RPC requests |
Errors are `ApprovalsError` with `reason` ∈ `account-required`, `provider-required`, `unsupported-standard`, `invalid-approval`, `source-failed`.
## Verification
[Section titled “Verification”](#verification)
```bash
pnpm test # vitest: 17 tests on an EIP-1193 double + the conformance suite
pnpm build && node scripts/verify-live.mjs … # the live script imports dist/
node scripts/verify-live.mjs 0x… https://rpc --chain 1 --range 10000 --from 22000000 [--include-zero]
LIVE_PK=0x… node scripts/verify-live.mjs 0x… https://rpc --revoke # real revoke + re-check
```
## Limitations
[Section titled “Limitations”](#limitations)
* Discovery depends on events: an allowance granted by a contract that emits no `Approval` (rare, non-compliant tokens) is invisible. Pass it in `options.spenders` / `tokens` with a custom source if you know it.
* Only the owner’s own approvals are listed. Allowances *received* by the account are not approvals it can revoke.
* The provider is taken from `account._config.provider` when not given — a private field of `@anywalletkit/wallet-evm` accounts.
## License
[Section titled “License”](#license)
Apache-2.0
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels approvals and revokes for a wallet’s history, offline and synchronously, on every EVM chain (`eip155:*`). Recognized by 4-byte selector on any contract (the called contract is the token): ERC-20 / ERC-721 `approve(address,uint256)` — a non-zero amount → `approve`; spender `0x0` → `revoke` (clears an NFT approval); `approve(spender, 0)` resets an ERC-20 allowance but APPROVES `spender` for token #0 on an ERC-721, so it is a `revoke` only on a known ERC-20 (`tokens` lists it with `decimals` above 0, or a transfer in the transaction is marked `erc20`), an `approve` on a known NFT (a transfer marked `erc721` / `erc1155`), and otherwise not claimed (null): the kit’s generic description then decides from its token catalog, and never calls an unknown contract’s zero approve a revoke; `setApprovalForAll(address,bool)` — false → `revoke`; Permit2 `approve(address,address,uint160,uint48)` — amount 0 → `revoke`; Permit2 `lockdown` → `revoke`. Calldata is needed for the spender and the amount; with a bare selector the item is still an `approve`. Titles read “Revoked USDT for 0x6c96…1dee” / “Approved USDC for Permit2” — pass `tokens` (lowercase address → `{ symbol, decimals }`) in the config to name tokens (with `decimals`, an ERC-20), well-known spenders (Permit2) are named by the module. Subtitle `"Token approval · "` or `"Permit2 · "`, `counterparty` the spender, no asset movements. Everything else yields null, so protocol calls fall through to the protocol modules.
Fixtures in `fixtures/activity/` are the test wallet’s USDT revoke (the module’s own 2026-09-14 run, `approve(spender, 0)`) and a USDC approve before a THORChain swap; `negatives/` holds a Lido submit, an SSV stake and a zero `approve` on an NFT contract the module does not know.
## Namespaces
[Section titled “Namespaces”](#namespaces)
* [STANDARDS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/)
## Classes
[Section titled “Classes”](#classes)
* [ApprovalsError](/api/anywalletkit/protocol-approvals-evm/classes/approvalserror/)
* [BlockscoutSource](/api/anywalletkit/protocol-approvals-evm/classes/blockscoutsource/)
* [default](/api/anywalletkit/protocol-approvals-evm/classes/default/)
* [EtherscanLabels](/api/anywalletkit/protocol-approvals-evm/classes/etherscanlabels/)
* [EtherscanSource](/api/anywalletkit/protocol-approvals-evm/classes/etherscansource/)
* [IApprovalsProtocol](/api/anywalletkit/protocol-approvals-evm/classes/iapprovalsprotocol/)
* [IndexerLogsSource](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/)
* [RpcLogsSource](/api/anywalletkit/protocol-approvals-evm/classes/rpclogssource/)
* [StateVerifier](/api/anywalletkit/protocol-approvals-evm/classes/stateverifier/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AccountLike](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
* [Approval](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
* [ApprovalsCache](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalscache/)
* [ApprovalsCoverage](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalscoverage/)
* [ApprovalSource](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/)
* [ApprovalsProtocolBase](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolbase/)
* [ApprovalsProtocolConstructor](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolconstructor/)
* [ApprovalsProtocolEvmConfig](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolevmconfig/)
* [ApprovalsResult](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)
* [BlockscoutSourceOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/blockscoutsourceoptions/)
* [CacheEntry](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/)
* [Candidate](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/)
* [CollectResult](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)
* [DescribeApprovalActivityOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/describeapprovalactivityoptions/)
* [Eip1193Provider](/api/anywalletkit/protocol-approvals-evm/interfaces/eip1193provider/)
* [EtherscanLabelsOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/etherscanlabelsoptions/)
* [EtherscanSourceOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/etherscansourceoptions/)
* [FetchResponseLike](/api/anywalletkit/protocol-approvals-evm/interfaces/fetchresponselike/)
* [GetApprovalsOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/getapprovalsoptions/)
* [IndexerQuery](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
* [IndexerSourceOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/)
* [LabelCache](/api/anywalletkit/protocol-approvals-evm/interfaces/labelcache/)
* [RawLog](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)
* [ReadOnlyAccountLike](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/)
* [RevokeResult](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)
* [RevokeTransaction](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/)
* [RpcLogsSourceOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/rpclogssourceoptions/)
* [SpenderLabel](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabel/)
* [SpenderLabelResolver](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabelresolver/)
* [StateVerifierOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/stateverifieroptions/)
* [VerifyOptions](/api/anywalletkit/protocol-approvals-evm/interfaces/verifyoptions/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ActivityTokens](/api/anywalletkit/protocol-approvals-evm/type-aliases/activitytokens/)
* [ApprovalRisk](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalrisk/)
* [ApprovalsErrorReason](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalserrorreason/)
* [ApprovalStandard](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)
* [EvmProvider](/api/anywalletkit/protocol-approvals-evm/type-aliases/evmprovider/)
* [FetchLike](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
* [RevokeTargets](/api/anywalletkit/protocol-approvals-evm/type-aliases/revoketargets/)
* [SendResult](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)
## Variables
[Section titled “Variables”](#variables)
* [ACTIVITY_CHAIN_NAMES](/api/anywalletkit/protocol-approvals-evm/variables/activity_chain_names/)
* [ApprovalsProtocol](/api/anywalletkit/protocol-approvals-evm/variables/approvalsprotocol/)
* [BLOCKSCOUT_HOSTS](/api/anywalletkit/protocol-approvals-evm/variables/blockscout_hosts/)
* [ETHERSCAN_V2_URL](/api/anywalletkit/protocol-approvals-evm/variables/etherscan_v2_url/)
## Functions
[Section titled “Functions”](#functions)
* [describeApprovalActivity](/api/anywalletkit/protocol-approvals-evm/functions/describeapprovalactivity/)
* [isRevokeCalldata](/api/anywalletkit/protocol-approvals-evm/functions/isrevokecalldata/)
* [isRevokeTransaction](/api/anywalletkit/protocol-approvals-evm/functions/isrevoketransaction/)
* [isUnlimitedAmount](/api/anywalletkit/protocol-approvals-evm/functions/isunlimitedamount/)
* [parseApprovalLog](/api/anywalletkit/protocol-approvals-evm/functions/parseapprovallog/)
# ApprovalsError
Defined in: core/dist/index-QWdcwE6y.d.ts:889
Thrown by approvals modules with a machine-readable [ApprovalsErrorReason](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalserrorreason/).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ApprovalsError**(`message`, `reason`, `details?`): `ApprovalsError`
Defined in: core/dist/index-QWdcwE6y.d.ts:894
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### reason
[Section titled “reason”](#reason)
[`ApprovalsErrorReason`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalserrorreason/)
##### details?
[Section titled “details?”](#details)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns)
`ApprovalsError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### details
[Section titled “details”](#details-1)
> `readonly` **details**: `Record`<`string`, `unknown`>
Defined in: core/dist/index-QWdcwE6y.d.ts:893
Extra context for logs (never secrets).
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: [`ApprovalsErrorReason`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalserrorreason/)
Defined in: core/dist/index-QWdcwE6y.d.ts:891
Machine-readable reason.
# BlockscoutSource
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:34
Discovery through a Blockscout instance: `GET /api?module=logs&action=getLogs&fromBlock&toBlock&topic1=`.
Keyless instances allow about 10 requests per window per client IP and answer 429 with `x-ratelimit-reset`, so the cold start is one request per chain (see [IndexerLogsSource](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/)). Pass `apiKey` (free at dev.blockscout.com) to lift the limit.
## Extends
[Section titled “Extends”](#extends)
* [`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BlockscoutSource**(`__namedParameters?`): `BlockscoutSource`
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:38
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
[`BlockscoutSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/blockscoutsourceoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`BlockscoutSource`
#### Overrides
[Section titled “Overrides”](#overrides)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`constructor`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_concurrency
[Section titled “\_concurrency”](#_concurrency)
> `protected` `readonly` **\_concurrency**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:63
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_concurrency`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_concurrency)
***
### \_fetch
[Section titled “\_fetch”](#_fetch)
> `protected` `readonly` **\_fetch**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:61
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_fetch`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_fetch)
***
### \_headers
[Section titled “\_headers”](#_headers)
> `protected` `readonly` **\_headers**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:62
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_headers`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_headers)
***
### \_maxRetryWait
[Section titled “\_maxRetryWait”](#_maxretrywait)
> `protected` `readonly` **\_maxRetryWait**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:66
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_maxRetryWait`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_maxretrywait)
***
### \_perTopic
[Section titled “\_perTopic”](#_pertopic)
> `protected` `readonly` **\_perTopic**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:60
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_perTopic`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_pertopic)
***
### \_retries
[Section titled “\_retries”](#_retries)
> `protected` `readonly` **\_retries**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:64
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_retries`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_retries)
***
### \_retryDelay
[Section titled “\_retryDelay”](#_retrydelay)
> `protected` `readonly` **\_retryDelay**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:65
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_retryDelay`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_retrydelay)
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `string`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:57
Source name reported in `coverage.source`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`name`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#name)
***
### requests
[Section titled “requests”](#requests)
> **requests**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:59
Requests issued by the last `collect` (diagnostics).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`requests`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#requests)
## Methods
[Section titled “Methods”](#methods)
### \_getLogs()
[Section titled “\_getLogs()”](#_getlogs)
> `protected` **\_getLogs**(`query`): `Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:129
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### query
[Section titled “query”](#query)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_getLogs`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_getlogs)
***
### \_url()
[Section titled “\_url()”](#_url)
> `protected` **\_url**(`__namedParameters`): `string`
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:46
The request URL for one query; implemented by each source.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-2)
`string`
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_url`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_url)
***
### collect()
[Section titled “collect()”](#collect)
> **collect**(`owner`, `__namedParameters`): `Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:86
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### owner
[Section titled “owner”](#owner)
`string`
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-2)
###### fromBlock
[Section titled “fromBlock”](#fromblock)
`number`
###### toBlock
[Section titled “toBlock”](#toblock)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`collect`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#collect)
# default
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:86
Token approvals for evm accounts: discover what the account has granted, flag the risky grants, revoke them.
Discovery: approval-shaped events with the owner in `topic1` (ERC-20 / ERC-721 `Approval`, `ApprovalForAll`, Permit2 `Approval` / `Permit` / `Lockdown`) give candidate pairs; the current state (`allowance`, `isApprovedForAll`, `getApproved`, Permit2 `allowance`, the account’s code for EIP-7702) is what gets reported. Revokes reuse the account’s own methods — `approve({amount: 0})`, `sendTransaction`, `revokeDelegation` — so on a policy-governed account (the kit’s `Wallet.getAccount(...)`) they pass the same policies as any other write.
## Extends
[Section titled “Extends”](#extends)
* [`ApprovalsProtocol`](/api/anywalletkit/protocol-approvals-evm/variables/approvalsprotocol/)<[`ApprovalsProtocolEvmConfig`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolevmconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `ApprovalsProtocolEvm`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:95
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/) | [`AccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
A @anywalletkit/wallet-evm account (or a read-only one for discovery).
##### config?
[Section titled “config?”](#config)
[`ApprovalsProtocolEvmConfig`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolevmconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`ApprovalsProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`ApprovalsProtocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `readonly` **\_account**: [`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/) | [`AccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:94
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ApprovalsProtocol._account`
***
### \_config
[Section titled “\_config”](#_config)
> `readonly` **\_config**: [`ApprovalsProtocolEvmConfig`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolevmconfig/)
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:95
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ApprovalsProtocol._config`
## Methods
[Section titled “Methods”](#methods)
### buildRevokeTransaction()
[Section titled “buildRevokeTransaction()”](#buildrevoketransaction)
> **buildRevokeTransaction**(`approval`): [`RevokeTransaction`](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/)
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:205
The raw transaction that revokes an approval (no account needed). Useful for hosts that build their own batches or policy conditions.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### approval
[Section titled “approval”](#approval)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/) | [`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]
Several Permit2 approvals fold into one `lockdown`.
#### Returns
[Section titled “Returns”](#returns-1)
[`RevokeTransaction`](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:348
Recognize approvals and revokes offline on any EVM chain: ERC-20 / ERC-721 `approve` (amount 0 → revoke), `setApprovalForAll`, Permit2 `approve` / `lockdown`. See `activity.ts` for the rule.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-1)
`ApprovalsProtocol.describeActivity`
***
### getApprovals()
[Section titled “getApprovals()”](#getapprovals)
> **getApprovals**(`options?`): `Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:151
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options?
[Section titled “options?”](#options)
[`GetApprovalsOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/getapprovalsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`ApprovalsProtocol.getApprovals`
***
### getSupportedStandards()
[Section titled “getSupportedStandards()”](#getsupportedstandards)
> **getSupportedStandards**(): `Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:147
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`ApprovalsProtocol.getSupportedStandards`
***
### quoteRevoke()
[Section titled “quoteRevoke()”](#quoterevoke)
> **quoteRevoke**(`approval`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:231
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### approval
[Section titled “approval”](#approval-1)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `fee`: `bigint`; }>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`ApprovalsProtocol.quoteRevoke`
***
### revoke()
[Section titled “revoke()”](#revoke)
> **revoke**(`approval`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:251
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### approval
[Section titled “approval”](#approval-2)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
#### Overrides
[Section titled “Overrides”](#overrides-5)
`ApprovalsProtocol.revoke`
***
### revokeAll()
[Section titled “revokeAll()”](#revokeall)
> **revokeAll**(`approvals`): `Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:290
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### approvals
[Section titled “approvals”](#approvals)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`ApprovalsProtocol.revokeAll`
# EtherscanLabels
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:34
Spender labels from Etherscan V2 `module=contract&action=getsourcecode`: the verified contract’s name, one request per unique spender, remembered for the life of the instance (pass `cache` to persist). Unverified contracts and EOAs resolve to nothing. Same key / proxy rules as [EtherscanSource](/api/anywalletkit/protocol-approvals-evm/classes/etherscansource/).
## Implements
[Section titled “Implements”](#implements)
* [`SpenderLabelResolver`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabelresolver/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new EtherscanLabels**(`__namedParameters?`): `EtherscanLabels`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:45
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
[`EtherscanLabelsOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/etherscanlabelsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`EtherscanLabels`
## Methods
[Section titled “Methods”](#methods)
### resolve()
[Section titled “resolve()”](#resolve)
> **resolve**(`addresses`): `Promise`<`Record`<`string`, [`SpenderLabel`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabel/)>>
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:59
Lowercase address → label; unknown addresses are absent.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### addresses
[Section titled “addresses”](#addresses)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Record`<`string`, [`SpenderLabel`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabel/)>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`SpenderLabelResolver`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabelresolver/).[`resolve`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabelresolver/#resolve)
# EtherscanSource
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:26
Discovery through the Etherscan V2 API: `GET /v2/api?chainid=&module=logs&action=getLogs&fromBlock&toBlock&topic1=&page=1&offset=1000&apikey=…`.
A key is required (the free tier covers Ethereum, Arbitrum, Polygon and more at 5 requests/s; Base, Optimism, BNB and Avalanche need a paid plan — the API answers “Free API access is not supported for this chain”). Keep the key server-side: point `baseUrl` at your own proxy that appends it, and pass `headers` for the proxy’s auth.
## Extends
[Section titled “Extends”](#extends)
* [`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new EtherscanSource**(`__namedParameters?`): `EtherscanSource`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:31
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
[`EtherscanSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/etherscansourceoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`EtherscanSource`
#### Overrides
[Section titled “Overrides”](#overrides)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`constructor`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_concurrency
[Section titled “\_concurrency”](#_concurrency)
> `protected` `readonly` **\_concurrency**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:63
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_concurrency`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_concurrency)
***
### \_fetch
[Section titled “\_fetch”](#_fetch)
> `protected` `readonly` **\_fetch**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:61
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_fetch`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_fetch)
***
### \_headers
[Section titled “\_headers”](#_headers)
> `protected` `readonly` **\_headers**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:62
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_headers`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_headers)
***
### \_maxRetryWait
[Section titled “\_maxRetryWait”](#_maxretrywait)
> `protected` `readonly` **\_maxRetryWait**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:66
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_maxRetryWait`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_maxretrywait)
***
### \_perTopic
[Section titled “\_perTopic”](#_pertopic)
> `protected` `readonly` **\_perTopic**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:60
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_perTopic`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_pertopic)
***
### \_retries
[Section titled “\_retries”](#_retries)
> `protected` `readonly` **\_retries**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:64
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_retries`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_retries)
***
### \_retryDelay
[Section titled “\_retryDelay”](#_retrydelay)
> `protected` `readonly` **\_retryDelay**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:65
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_retryDelay`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_retrydelay)
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `string`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:57
Source name reported in `coverage.source`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`name`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#name)
***
### requests
[Section titled “requests”](#requests)
> **requests**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:59
Requests issued by the last `collect` (diagnostics).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`requests`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#requests)
## Methods
[Section titled “Methods”](#methods)
### \_getLogs()
[Section titled “\_getLogs()”](#_getlogs)
> `protected` **\_getLogs**(`query`): `Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:129
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### query
[Section titled “query”](#query)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_getLogs`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_getlogs)
***
### \_url()
[Section titled “\_url()”](#_url)
> `protected` **\_url**(`__namedParameters`): `string`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:39
The request URL for one query; implemented by each source.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-2)
`string`
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`_url`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#_url)
***
### collect()
[Section titled “collect()”](#collect)
> **collect**(`owner`, `__namedParameters`): `Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:86
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### owner
[Section titled “owner”](#owner)
`string`
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-2)
###### fromBlock
[Section titled “fromBlock”](#fromblock)
`number`
###### toBlock
[Section titled “toBlock”](#toblock)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`IndexerLogsSource`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/).[`collect`](/api/anywalletkit/protocol-approvals-evm/classes/indexerlogssource/#collect)
# IApprovalsProtocol
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:63
The approvals protocol interface — the shape a chain implementation fills.
Revokes go through the account’s own methods (`approve`, `sendTransaction`, `revokeDelegation`), so on an account from the kit’s `Wallet.getAccount(...)` they pass the wallet’s policies like any other write.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new IApprovalsProtocol**(): `IApprovalsProtocol`
#### Returns
[Section titled “Returns”](#returns)
`IApprovalsProtocol`
## Methods
[Section titled “Methods”](#methods)
### getApprovals()
[Section titled “getApprovals()”](#getapprovals)
> **getApprovals**(`_options?`): `Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:68
Finds the approvals the account has granted. A read-only account is enough.
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_options?
[Section titled “\_options?”](#_options)
[`GetApprovalsOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/getapprovalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
***
### getSupportedStandards()
[Section titled “getSupportedStandards()”](#getsupportedstandards)
> **getSupportedStandards**(): `Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:65
The standards this implementation can discover and revoke.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
***
### quoteRevoke()
[Section titled “quoteRevoke()”](#quoterevoke)
> **quoteRevoke**(`_approval`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:71
Estimates the cost of revoking one approval.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_approval
[Section titled “\_approval”](#_approval)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `fee`: `bigint`; }>
***
### revoke()
[Section titled “revoke()”](#revoke)
> **revoke**(`_approval`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:74
Revokes one approval.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_approval
[Section titled “\_approval”](#_approval-1)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
***
### revokeAll()
[Section titled “revokeAll()”](#revokeall)
> **revokeAll**(`_approvals`): `Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:81
Revokes several approvals, folding what the chain lets it fold (Permit2 pairs into one `lockdown`, everything into one user operation on batching accounts). Never throws for a single failed item: see [RevokeResult.error](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/#error).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_approvals
[Section titled “\_approvals”](#_approvals)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
# IndexerLogsSource
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:55
Shared engine of the indexer-backed sources (Etherscan V2, Blockscout — both speak the Etherscan `module=logs&action=getLogs` dialect). One request per range asks for every log with the owner in `topic1`; the parser keeps the approval-shaped ones. A full page (1000 rows) or a “range too large” answer halves the range. Subclasses only build the URL.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`BlockscoutSource`](/api/anywalletkit/protocol-approvals-evm/classes/blockscoutsource/)
* [`EtherscanSource`](/api/anywalletkit/protocol-approvals-evm/classes/etherscansource/)
## Implements
[Section titled “Implements”](#implements)
* [`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new IndexerLogsSource**(`name`, `__namedParameters?`): `IndexerLogsSource`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:68
#### Parameters
[Section titled “Parameters”](#parameters)
##### name
[Section titled “name”](#name)
`string`
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`IndexerLogsSource`
## Properties
[Section titled “Properties”](#properties)
### \_concurrency
[Section titled “\_concurrency”](#_concurrency)
> `protected` `readonly` **\_concurrency**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:63
***
### \_fetch
[Section titled “\_fetch”](#_fetch)
> `protected` `readonly` **\_fetch**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:61
***
### \_headers
[Section titled “\_headers”](#_headers)
> `protected` `readonly` **\_headers**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:62
***
### \_maxRetryWait
[Section titled “\_maxRetryWait”](#_maxretrywait)
> `protected` `readonly` **\_maxRetryWait**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:66
***
### \_perTopic
[Section titled “\_perTopic”](#_pertopic)
> `protected` `readonly` **\_perTopic**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:60
***
### \_retries
[Section titled “\_retries”](#_retries)
> `protected` `readonly` **\_retries**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:64
***
### \_retryDelay
[Section titled “\_retryDelay”](#_retrydelay)
> `protected` `readonly` **\_retryDelay**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:65
***
### name
[Section titled “name”](#name-1)
> `readonly` **name**: `string`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:57
Source name reported in `coverage.source`.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/).[`name`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/#name)
***
### requests
[Section titled “requests”](#requests)
> **requests**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:59
Requests issued by the last `collect` (diagnostics).
## Methods
[Section titled “Methods”](#methods)
### \_getLogs()
[Section titled “\_getLogs()”](#_getlogs)
> `protected` **\_getLogs**(`query`): `Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:129
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### query
[Section titled “query”](#query)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)\[]>
***
### \_url()
[Section titled “\_url()”](#_url)
> `protected` **\_url**(`_query`): `string`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:82
The request URL for one query; implemented by each source.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_query
[Section titled “\_query”](#_query)
[`IndexerQuery`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexerquery/)
#### Returns
[Section titled “Returns”](#returns-2)
`string`
***
### collect()
[Section titled “collect()”](#collect)
> **collect**(`owner`, `__namedParameters`): `Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:86
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### owner
[Section titled “owner”](#owner)
`string`
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
###### fromBlock
[Section titled “fromBlock”](#fromblock)
`number`
###### toBlock
[Section titled “toBlock”](#toblock)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/).[`collect`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/#collect)
# RpcLogsSource
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:156
Discovers candidates from `eth_getLogs` alone — no indexer, no API key.
One request asks for every approval-shaped event with the owner in `topic1` and no `address` filter, so a range covers every token at once. A range the node refuses (“too many results”, “range too large”) is split in half and retried; a single block that is still refused becomes a gap (`complete: false`) instead of an exception, so a very active address degrades to “partial” rather than “nothing”.
## Implements
[Section titled “Implements”](#implements)
* [`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RpcLogsSource**(`__namedParameters`): `RpcLogsSource`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:166
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`RpcLogsSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/rpclogssourceoptions/)
#### Returns
[Section titled “Returns”](#returns)
`RpcLogsSource`
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> `readonly` **name**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:157
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/).[`name`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/#name)
***
### requests
[Section titled “requests”](#requests)
> **requests**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:159
How many `eth_getLogs` requests the last `collect` issued (diagnostics).
## Methods
[Section titled “Methods”](#methods)
### collect()
[Section titled “collect()”](#collect)
> **collect**(`owner`, `__namedParameters`): `Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:177
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### owner
[Section titled “owner”](#owner)
`string`
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
###### fromBlock
[Section titled “fromBlock”](#fromblock)
`number`
###### toBlock
[Section titled “toBlock”](#toblock)
`number`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/).[`collect`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/#collect)
# StateVerifier
Defined in: protocol-approvals-evm/src/state-verifier.ts:47
Turns candidates into approvals by reading the chain: the current allowance / operator flag / Permit2 allowance is the truth, the log that produced the candidate is only where it was granted. Reads are batched through Multicall3 (`aggregate3`, allowFailure) and fall back to one `eth_call` per read where Multicall3 is not deployed. Spender code is read once per unique spender to flag EOAs.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StateVerifier**(`__namedParameters`): `StateVerifier`
Defined in: protocol-approvals-evm/src/state-verifier.ts:54
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`StateVerifierOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/stateverifieroptions/)
#### Returns
[Section titled “Returns”](#returns)
`StateVerifier`
## Methods
[Section titled “Methods”](#methods)
### verify()
[Section titled “verify()”](#verify)
> **verify**(`owner`, `candidates`, `__namedParameters`): `Promise`<[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]>
Defined in: protocol-approvals-evm/src/state-verifier.ts:63
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### owner
[Section titled “owner”](#owner)
`string`
##### candidates
[Section titled “candidates”](#candidates)
[`Candidate`](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/)\[]
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
[`VerifyOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/verifyoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]>
# describeApprovalActivity
> **describeApprovalActivity**(`tx`, `ctx`, `options?`): `ActivityItem` | `null`
Defined in: protocol-approvals-evm/src/activity.ts:69
Describe `tx` if it is an approval or a revoke.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### options?
[Section titled “options?”](#options)
[`DescribeApprovalActivityOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/describeapprovalactivityoptions/) = `{}`
Optional token labels (lowercase address → symbol) for titles.
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# isRevokeCalldata
> **isRevokeCalldata**(`data`): `boolean`
Defined in: protocol-approvals-evm/src/calldata.ts:16
True when raw calldata is a revoke: `approve(spender, 0)`, `setApprovalForAll(operator, false)` or Permit2 `lockdown(...)`.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`string` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isRevokeTransaction
> **isRevokeTransaction**(`tx`, `__namedParameters?`): `boolean`
Defined in: protocol-approvals-evm/src/calldata.ts:61
True when a whole transaction is a revoke, not just its calldata: no native value, no EIP-7702 authorization, strict revoke calldata, and a target whose standard makes that calldata a revoke (scan 2026-10-27 modules, F31):
* Permit2 `lockdown` only to Permit2 (no `targets` needed);
* `approve(spender, 0)` only to a target the host knows as an ERC-20 — on an ERC-721 the same calldata APPROVES `spender` for token #0;
* `approve(0x0, id)` and `setApprovalForAll(operator, false)` to an NFT target (ERC-721 / ERC-1155), or to a bare-address target whose standard is unknown (neither grants anything on any standard).
Without `targets` only a `lockdown` is a revoke. Use this, not [isRevokeCalldata](/api/anywalletkit/protocol-approvals-evm/functions/isrevokecalldata/), to let a transaction through a policy.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
{ `authorizationList?`: `unknown`\[]; `data?`: `string`; `to?`: `string`; `type?`: `unknown`; `value?`: `unknown`; } | `undefined`
### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
#### targets?
[Section titled “targets?”](#targets)
[`RevokeTargets`](/api/anywalletkit/protocol-approvals-evm/type-aliases/revoketargets/)
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isUnlimitedAmount
> **isUnlimitedAmount**(`amount`, `threshold?`): `boolean`
Defined in: protocol-approvals-evm/src/calldata.ts:8
True when an `approve` amount should count as unlimited (>= 2^255 by default).
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`unknown`
### threshold?
[Section titled “threshold?”](#threshold)
`bigint` = `UNLIMITED_THRESHOLD`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# parseApprovalLog
> **parseApprovalLog**(`log`, `owner`): [`Candidate`](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/) | `null`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:71
Classifies one raw `eth_getLogs` entry. Returns null for logs that are not an approval granted BY the owner (e.g. a Permit2 event on a look-alike contract, or an ERC-721 `Approval` where the owner sits in another slot).
## Parameters
[Section titled “Parameters”](#parameters)
### log
[Section titled “log”](#log)
[`RawLog`](/api/anywalletkit/protocol-approvals-evm/interfaces/rawlog/)
### owner
[Section titled “owner”](#owner)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Candidate`](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/) | `null`
# AccountLike
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:47
Account surface the protocol writes through (a @anywalletkit/wallet-evm account, or anything shaped like one).
## Extends
[Section titled “Extends”](#extends)
* [`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/)
## Methods
[Section titled “Methods”](#methods)
### approve()?
[Section titled “approve()?”](#approve)
> `optional` **approve**(`options`): `Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:50
#### Parameters
[Section titled “Parameters”](#parameters)
##### options
[Section titled “options”](#options)
###### amount
[Section titled “amount”](#amount)
`bigint`
###### spender
[Section titled “spender”](#spender)
`string`
###### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:42
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/).[`getAddress`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/#getaddress)
***
### quoteRevokeDelegation()?
[Section titled “quoteRevokeDelegation()?”](#quoterevokedelegation)
> `optional` **quoteRevokeDelegation**(): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:53
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee`: `bigint`; }>
***
### quoteSendTransaction()?
[Section titled “quoteSendTransaction()?”](#quotesendtransaction)
> `optional` **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:49
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
[`RevokeTransaction`](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `fee`: `bigint`; }>
***
### revokeDelegation()?
[Section titled “revokeDelegation()?”](#revokedelegation)
> `optional` **revokeDelegation**(`options?`): `Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:52
Clears an EIP-7702 delegation. Behind the kit’s policies it receives `{ maxFee }` (the policy cap) to hold the transaction to.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options?
[Section titled “options?”](#options-1)
`WriteOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`): `Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:48
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-1)
[`RevokeTransaction`](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/) | [`RevokeTransaction`](/api/anywalletkit/protocol-approvals-evm/interfaces/revoketransaction/)\[]
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`SendResult`](/api/anywalletkit/protocol-approvals-evm/type-aliases/sendresult/)>
# Approval
Defined in: core/dist/index-QWdcwE6y.d.ts:807
One live approval the account granted.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:819
Allowance in base units; null for operator approvals and delegations.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `string` | `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:813
Chain it lives on.
***
### expiration?
[Section titled “expiration?”](#expiration)
> `optional` **expiration?**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:825
Unix seconds; Permit2 and authz only.
***
### grantedAt?
[Section titled “grantedAt?”](#grantedat)
> `optional` **grantedAt?**: `object`
Defined in: core/dist/index-QWdcwE6y.d.ts:827
Where the approval was granted, when the source knows.
#### block?
[Section titled “block?”](#block)
> `optional` **block?**: `number`
#### txHash?
[Section titled “txHash?”](#txhash)
> `optional` **txHash?**: `string`
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:809
Deterministic key: `chainId:standard:token:spender[:tokenId]`.
***
### risks
[Section titled “risks”](#risks)
> **risks**: [`ApprovalRisk`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalrisk/)\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:832
Every risk that applies; empty when none.
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:817
Who may spend: the spender, operator or delegate.
***
### spenderLabel?
[Section titled “spenderLabel?”](#spenderlabel)
> `optional` **spenderLabel?**: `object`
Defined in: core/dist/index-QWdcwE6y.d.ts:834
Known name of the spender, when a label source has one.
#### name
[Section titled “name”](#name)
> **name**: `string`
#### url?
[Section titled “url?”](#url)
> `optional` **url?**: `string`
***
### standard
[Section titled “standard”](#standard)
> **standard**: [`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)
Defined in: core/dist/index-QWdcwE6y.d.ts:811
Which kind of approval.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:815
Token contract (or mint); for `eip7702` the account itself.
***
### tokenId?
[Section titled “tokenId?”](#tokenid)
> `optional` **tokenId?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:823
NFT id, for a per-token approval.
***
### unlimited
[Section titled “unlimited”](#unlimited)
> **unlimited**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:821
The allowance is effectively unbounded.
# ApprovalsCache
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:27
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(`key`): [`CacheEntry`](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/) | `Promise`<[`CacheEntry`](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/) | `null` | `undefined`> | `null` | `undefined`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:28
#### Parameters
[Section titled “Parameters”](#parameters)
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns)
[`CacheEntry`](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/) | `Promise`<[`CacheEntry`](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/) | `null` | `undefined`> | `null` | `undefined`
***
### set()
[Section titled “set()”](#set)
> **set**(`key`, `value`): `void` | `Promise`<`void`>
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:29
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key-1)
`string`
##### value
[Section titled “value”](#value)
[`CacheEntry`](/api/anywalletkit/protocol-approvals-evm/interfaces/cacheentry/)
#### Returns
[Section titled “Returns”](#returns-1)
`void` | `Promise`<`void`>
# ApprovalsCoverage
Defined in: core/dist/index-QWdcwE6y.d.ts:840
How much history the scan covered. Show a warning when `complete` is false.
## Properties
[Section titled “Properties”](#properties)
### complete
[Section titled “complete”](#complete)
> **complete**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:848
False when some block range could not be scanned — the list may miss approvals.
***
### fromBlock?
[Section titled “fromBlock?”](#fromblock)
> `optional` **fromBlock?**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:844
First block scanned.
***
### gaps?
[Section titled “gaps?”](#gaps)
> `optional` **gaps?**: \[`number`, `number`]\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:850
Block ranges that could not be scanned.
***
### source
[Section titled “source”](#source)
> **source**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:842
`rpc-logs`, `state`, or a custom source name.
***
### toBlock?
[Section titled “toBlock?”](#toblock)
> `optional` **toBlock?**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:846
Last block scanned.
# ApprovalSource
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:30
Discovery source contract: turn a block range into candidate pairs.
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:31
## Methods
[Section titled “Methods”](#methods)
### collect()
[Section titled “collect()”](#collect)
> **collect**(`owner`, `range`): `Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:32
#### Parameters
[Section titled “Parameters”](#parameters)
##### owner
[Section titled “owner”](#owner)
`string`
##### range
[Section titled “range”](#range)
###### fromBlock
[Section titled “fromBlock”](#fromblock)
`number`
###### toBlock
[Section titled “toBlock”](#toblock)
`number`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`CollectResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/collectresult/)>
# ApprovalsProtocolBase
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:93
What an implementation inherits from core’s `ApprovalsProtocol` (`ProtocolBase` underneath): the account and config it was built with, the activity hook, and the five protocol methods throwing `NotImplementedError` until overridden.
Typed here for the minimal account surface this module needs (`{ getAddress }` for reads, plus `sendTransaction` & co. for writes) and the `{ hash, fee }` a revoke resolves to.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `readonly` **\_account**: [`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/) | [`AccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:94
***
### \_config
[Section titled “\_config”](#_config)
> `readonly` **\_config**: `TConfig`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:95
## Methods
[Section titled “Methods”](#methods)
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:102
Recognize this module’s transactions for a wallet’s history; null for anything else. Pure and synchronous.
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
***
### getApprovals()
[Section titled “getApprovals()”](#getapprovals)
> **getApprovals**(`options?`): `Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:97
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`GetApprovalsOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/getapprovalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ApprovalsResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsresult/)>
***
### getSupportedStandards()
[Section titled “getSupportedStandards()”](#getsupportedstandards)
> **getSupportedStandards**(): `Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:96
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]>
***
### quoteRevoke()
[Section titled “quoteRevoke()”](#quoterevoke)
> **quoteRevoke**(`approval`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:98
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### approval
[Section titled “approval”](#approval)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `fee`: `bigint`; }>
***
### revoke()
[Section titled “revoke()”](#revoke)
> **revoke**(`approval`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:99
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### approval
[Section titled “approval”](#approval-1)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
***
### revokeAll()
[Section titled “revokeAll()”](#revokeall)
> **revokeAll**(`approvals`): `Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:100
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### approvals
[Section titled “approvals”](#approvals)
[`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`RevokeResult`](/api/anywalletkit/protocol-approvals-evm/interfaces/revokeresult/)\[]>
# ApprovalsProtocolConstructor
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:105
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ApprovalsProtocolConstructor**<`TConfig`>(`account`, `config?`): [`ApprovalsProtocolBase`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolbase/)<`TConfig`>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:106
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`ReadOnlyAccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/readonlyaccountlike/) | [`AccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
##### config?
[Section titled “config?”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
[`ApprovalsProtocolBase`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolbase/)<`TConfig`>
# ApprovalsProtocolEvmConfig
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:32
## Properties
[Section titled “Properties”](#properties)
### batch?
[Section titled “batch?”](#batch)
> `optional` **batch?**: `boolean`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:50
The account accepts `sendTransaction(tx[])` as one operation (ERC-4337 / 7702-gasless accounts). Default false.
***
### blockRange?
[Section titled “blockRange?”](#blockrange)
> `optional` **blockRange?**: `number` | `null`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:42
Pre-chunk `eth_getLogs` to this many blocks (QuickNode: 10 000). Default null = try the whole range, split on refusal.
***
### cache?
[Section titled “cache?”](#cache)
> `optional` **cache?**: [`ApprovalsCache`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalscache/)
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:46
Persists candidates + last scanned block so rescans are incremental.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:36
Skips the `eth_chainId` round trip when known.
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:54
Parallel RPC requests for discovery and verification. Default 4.
***
### fromBlock?
[Section titled “fromBlock?”](#fromblock)
> `optional` **fromBlock?**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:40
Where a cold scan starts (the wallet’s creation block, ideally). Default 0.
***
### includeDelegation?
[Section titled “includeDelegation?”](#includedelegation)
> `optional` **includeDelegation?**: `boolean`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:52
Also report the account’s EIP-7702 delegation. Default true.
***
### labels?
[Section titled “labels?”](#labels)
> `optional` **labels?**: [`SpenderLabelResolver`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabelresolver/)
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:58
Spender label resolver (e.g. [EtherscanLabels](/api/anywalletkit/protocol-approvals-evm/classes/etherscanlabels/)); failures never fail the scan.
***
### multicall?
[Section titled “multicall?”](#multicall)
> `optional` **multicall?**: `string` | `false`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:48
Multicall3 address, or false for single `eth_call`s.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-approvals-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-approvals-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:34
RPC URL(s) or EIP-1193 provider(s); a list fails over in order. Defaults to the account’s.
***
### retryDelay?
[Section titled “retryDelay?”](#retrydelay)
> `optional` **retryDelay?**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:56
Milliseconds between retries of a transient `eth_getLogs` failure. Default 300.
***
### source?
[Section titled “source?”](#source)
> `optional` **source?**: [`ApprovalSource`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsource/)
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:44
A custom discovery source (an indexer); default [RpcLogsSource](/api/anywalletkit/protocol-approvals-evm/classes/rpclogssource/).
***
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: [`ActivityTokens`](/api/anywalletkit/protocol-approvals-evm/type-aliases/activitytokens/)
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:38
Token labels (lowercase address → symbol / decimals) for activity titles, e.g. “Approved USDC for Permit2”.
# ApprovalsResult
Defined in: core/dist/index-QWdcwE6y.d.ts:853
The approvals found and how complete the scan was.
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Approval`](/api/anywalletkit/protocol-approvals-evm/interfaces/approval/)\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:854
***
### coverage
[Section titled “coverage”](#coverage)
> **coverage**: [`ApprovalsCoverage`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalscoverage/)
Defined in: core/dist/index-QWdcwE6y.d.ts:855
# BlockscoutSourceOptions
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:17
## Extends
[Section titled “Extends”](#extends)
* [`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/)
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:22
Sent as `apikey`.
***
### baseUrl?
[Section titled “baseUrl?”](#baseurl)
> `optional` **baseUrl?**: `string`
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:19
Instance origin; defaults to [BLOCKSCOUT_HOSTS](/api/anywalletkit/protocol-approvals-evm/variables/blockscout_hosts/) for `chainId`.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:20
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:27
Parallel requests (default 1).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`concurrency`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#concurrency)
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:23
Fetch implementation (default global).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`fetch`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#fetch)
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:25
Extra request headers (an auth token for a proxy, say).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`headers`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#headers)
***
### maxRetryWait?
[Section titled “maxRetryWait?”](#maxretrywait)
> `optional` **maxRetryWait?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:33
A 429 whose reset is further away than this fails at once with the wait in the message (default 20 000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`maxRetryWait`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#maxretrywait)
***
### perTopic?
[Section titled “perTopic?”](#pertopic)
> `optional` **perTopic?**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:21
One request per event signature instead of one per range (default false).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`perTopic`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#pertopic)
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:29
Retries for transient errors and 429s (default 3).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`retries`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#retries)
***
### retryDelay?
[Section titled “retryDelay?”](#retrydelay)
> `optional` **retryDelay?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:31
Base delay between retries, doubled each time; a 429’s reset hint wins when longer (default 1000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`retryDelay`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#retrydelay)
# CacheEntry
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:18
## Properties
[Section titled “Properties”](#properties)
### candidates
[Section titled “candidates”](#candidates)
> **candidates**: [`Candidate`](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/)\[]
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:24
Plain JSON, safe to persist.
***
### fromBlock
[Section titled “fromBlock”](#fromblock)
> **fromBlock**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:20
Where the cached scan started.
***
### toBlock
[Section titled “toBlock”](#toblock)
> **toBlock**: `number`
Defined in: protocol-approvals-evm/src/approvals-protocol-evm.ts:22
The last block the cached scan covered.
# Candidate
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:11
A `(token, spender)` pair seen in the account’s approval events. Only a hint: the current on-chain state is what [StateVerifier](/api/anywalletkit/protocol-approvals-evm/classes/stateverifier/) reads. Plain JSON (no bigint) so hosts can persist it as the scan cache.
## Properties
[Section titled “Properties”](#properties)
### block
[Section titled “block”](#block)
> **block**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:17
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"erc20"` | `"erc721-token"` | `"permit2"` | `"nft-operator"`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:12
***
### logIndex
[Section titled “logIndex”](#logindex)
> **logIndex**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:19
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:14
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:13
***
### tokenId?
[Section titled “tokenId?”](#tokenid)
> `optional` **tokenId?**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:16
Decimal string, `erc721-token` only.
***
### txHash
[Section titled “txHash”](#txhash)
> **txHash**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:18
# CollectResult
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:22
## Properties
[Section titled “Properties”](#properties)
### candidates
[Section titled “candidates”](#candidates)
> **candidates**: [`Candidate`](/api/anywalletkit/protocol-approvals-evm/interfaces/candidate/)\[]
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:23
***
### complete
[Section titled “complete”](#complete)
> **complete**: `boolean`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:24
***
### gaps
[Section titled “gaps”](#gaps)
> **gaps**: \[`number`, `number`]\[]
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:26
Block ranges that stayed too large to fetch.
# DescribeApprovalActivityOptions
Defined in: protocol-approvals-evm/src/activity.ts:25
## Properties
[Section titled “Properties”](#properties)
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: [`ActivityTokens`](/api/anywalletkit/protocol-approvals-evm/type-aliases/activitytokens/)
Defined in: protocol-approvals-evm/src/activity.ts:26
# Eip1193Provider
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:24
An EIP-1193 provider: anything with `request({ method, params })` — viem’s `EIP1193Provider`, a wallet’s injected provider, a thin wrapper over a viem client.
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`args`): `Promise`<`unknown`>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:25
#### Parameters
[Section titled “Parameters”](#parameters)
##### args
[Section titled “args”](#args)
###### method
[Section titled “method”](#method)
`string`
###### params?
[Section titled “params?”](#params)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# EtherscanLabelsOptions
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:13
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:15
***
### baseUrl?
[Section titled “baseUrl?”](#baseurl)
> `optional` **baseUrl?**: `string`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:17
Endpoint or your own proxy (default [ETHERSCAN_V2_URL](/api/anywalletkit/protocol-approvals-evm/variables/etherscan_v2_url/)).
***
### cache?
[Section titled “cache?”](#cache)
> `optional` **cache?**: [`LabelCache`](/api/anywalletkit/protocol-approvals-evm/interfaces/labelcache/)
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:22
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:14
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:24
Parallel requests (default 2; the free tier allows 3–5/s).
***
### explorerUrl?
[Section titled “explorerUrl?”](#explorerurl)
> `optional` **explorerUrl?**: `string`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:19
Explorer origin for `url` (e.g. `https://etherscan.io`).
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:20
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:21
# EtherscanSourceOptions
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:7
## Extends
[Section titled “Extends”](#extends)
* [`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/)
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:11
Sent as `apikey` (omit when a proxy adds it).
***
### baseUrl?
[Section titled “baseUrl?”](#baseurl)
> `optional` **baseUrl?**: `string`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:13
Endpoint (default [ETHERSCAN_V2_URL](/api/anywalletkit/protocol-approvals-evm/variables/etherscan_v2_url/)); a proxy that forwards the same query works.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:9
Etherscan `chainid`.
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:27
Parallel requests (default 1).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`concurrency`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#concurrency)
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:23
Fetch implementation (default global).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`fetch`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#fetch)
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:25
Extra request headers (an auth token for a proxy, say).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`headers`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#headers)
***
### maxRetryWait?
[Section titled “maxRetryWait?”](#maxretrywait)
> `optional` **maxRetryWait?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:33
A 429 whose reset is further away than this fails at once with the wait in the message (default 20 000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`maxRetryWait`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#maxretrywait)
***
### perTopic?
[Section titled “perTopic?”](#pertopic)
> `optional` **perTopic?**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:21
One request per event signature instead of one per range (default false).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`perTopic`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#pertopic)
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:29
Retries for transient errors and 429s (default 3).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`retries`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#retries)
***
### retryDelay?
[Section titled “retryDelay?”](#retrydelay)
> `optional` **retryDelay?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:31
Base delay between retries, doubled each time; a 429’s reset hint wins when longer (default 1000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IndexerSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/).[`retryDelay`](/api/anywalletkit/protocol-approvals-evm/interfaces/indexersourceoptions/#retrydelay)
# FetchResponseLike
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:9
The part of a `fetch` Response the sources read.
## Properties
[Section titled “Properties”](#properties)
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `object`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:12
#### get()
[Section titled “get()”](#get)
> **get**(`name`): `string` | `null`
##### Parameters
[Section titled “Parameters”](#parameters)
###### name
[Section titled “name”](#name)
`string`
##### Returns
[Section titled “Returns”](#returns)
`string` | `null`
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:10
***
### status
[Section titled “status”](#status)
> **status**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:11
## Methods
[Section titled “Methods”](#methods)
### json()
[Section titled “json()”](#json)
> **json**(): `Promise`<`unknown`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:13
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`unknown`>
# GetApprovalsOptions
Defined in: core/dist/index-QWdcwE6y.d.ts:858
Filters for [IApprovalsProtocol.getApprovals](/api/anywalletkit/protocol-approvals-evm/classes/iapprovalsprotocol/#getapprovals).
## Properties
[Section titled “Properties”](#properties)
### fromBlock?
[Section titled “fromBlock?”](#fromblock)
> `optional` **fromBlock?**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:868
Scan from this block.
***
### includeZero?
[Section titled “includeZero?”](#includezero)
> `optional` **includeZero?**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:866
Also return approvals already set to zero.
***
### spenders?
[Section titled “spenders?”](#spenders)
> `optional` **spenders?**: `string`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:864
Only these spenders.
***
### standards?
[Section titled “standards?”](#standards)
> `optional` **standards?**: [`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/)\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:860
Only these kinds.
***
### toBlock?
[Section titled “toBlock?”](#toblock)
> `optional` **toBlock?**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:870
Scan up to this block.
***
### tokens?
[Section titled “tokens?”](#tokens)
> `optional` **tokens?**: `string`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:862
Only these token contracts or mints.
# IndexerQuery
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:37
What a subclass turns into a URL.
## Properties
[Section titled “Properties”](#properties)
### fromBlock
[Section titled “fromBlock”](#fromblock)
> **fromBlock**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:40
***
### toBlock
[Section titled “toBlock”](#toblock)
> **toBlock**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:41
***
### topic0
[Section titled “topic0”](#topic0)
> **topic0**: `string` | `null`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:38
***
### topic1
[Section titled “topic1”](#topic1)
> **topic1**: `string`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:39
# IndexerSourceOptions
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:19
## Extended by
[Section titled “Extended by”](#extended-by)
* [`BlockscoutSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/blockscoutsourceoptions/)
* [`EtherscanSourceOptions`](/api/anywalletkit/protocol-approvals-evm/interfaces/etherscansourceoptions/)
## Properties
[Section titled “Properties”](#properties)
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:27
Parallel requests (default 1).
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`FetchLike`](/api/anywalletkit/protocol-approvals-evm/type-aliases/fetchlike/)
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:23
Fetch implementation (default global).
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:25
Extra request headers (an auth token for a proxy, say).
***
### maxRetryWait?
[Section titled “maxRetryWait?”](#maxretrywait)
> `optional` **maxRetryWait?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:33
A 429 whose reset is further away than this fails at once with the wait in the message (default 20 000 ms).
***
### perTopic?
[Section titled “perTopic?”](#pertopic)
> `optional` **perTopic?**: `boolean`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:21
One request per event signature instead of one per range (default false).
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:29
Retries for transient errors and 429s (default 3).
***
### retryDelay?
[Section titled “retryDelay?”](#retrydelay)
> `optional` **retryDelay?**: `number`
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:31
Base delay between retries, doubled each time; a 429’s reset hint wins when longer (default 1000 ms).
# LabelCache
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:8
Persistent label cache; keys are `label::`.
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(`key`): `unknown`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:9
#### Parameters
[Section titled “Parameters”](#parameters)
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
***
### set()
[Section titled “set()”](#set)
> **set**(`key`, `value`): `unknown`
Defined in: protocol-approvals-evm/src/labels/etherscan.ts:10
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key-1)
`string`
##### value
[Section titled “value”](#value)
`unknown`
#### Returns
[Section titled “Returns”](#returns-1)
`unknown`
# RawLog
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:36
One `eth_getLogs` entry as a node or an indexer returns it (numbers may be hex strings).
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:37
***
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `string` | `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:40
***
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:39
***
### index?
[Section titled “index?”](#index)
> `optional` **index?**: `string` | `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:42
***
### logIndex?
[Section titled “logIndex?”](#logindex)
> `optional` **logIndex?**: `string` | `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:43
***
### topics
[Section titled “topics”](#topics)
> **topics**: `string`\[]
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:38
***
### transactionHash
[Section titled “transactionHash”](#transactionhash)
> **transactionHash**: `string`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:41
# ReadOnlyAccountLike
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:41
Minimal account surface the protocol reads from.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`AccountLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/accountlike/)
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:42
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
# RevokeResult
Defined in: core/dist/index-QWdcwE6y.d.ts:873
Outcome of one revoke transaction.
## Properties
[Section titled “Properties”](#properties)
### error?
[Section titled “error?”](#error)
> `optional` **error?**: `Error`
Defined in: core/dist/index-QWdcwE6y.d.ts:881
Why this item could not be revoked (`revokeAll` continues past failures).
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:879
Network fee paid.
***
### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:877
Transaction hash, when it was sent.
***
### ids
[Section titled “ids”](#ids)
> **ids**: `string`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:875
Ids of the approvals this transaction revoked.
# RevokeTransaction
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:31
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:33
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:32
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:34
# RpcLogsSourceOptions
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:46
## Properties
[Section titled “Properties”](#properties)
### blockRange?
[Section titled “blockRange?”](#blockrange)
> `optional` **blockRange?**: `number` | `null`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:50
Pre-chunk requests to this many blocks (QuickNode: 10 000). Null tries the whole range first.
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:52
Parallel `eth_getLogs` requests (default 4).
***
### provider
[Section titled “provider”](#provider)
> **provider**: `object`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:48
A viem public client.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:54
Retries for transient (non-range) errors (default 2).
***
### retryDelay?
[Section titled “retryDelay?”](#retrydelay)
> `optional` **retryDelay?**: `number`
Defined in: protocol-approvals-evm/src/sources/rpc-logs.ts:56
Milliseconds between those retries (default 300).
# SpenderLabel
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:13
Verified contract name of a spender, when a `labels` resolver is configured.
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:14
***
### url?
[Section titled “url?”](#url)
> `optional` **url?**: `string`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:15
# SpenderLabelResolver
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:18
## Methods
[Section titled “Methods”](#methods)
### resolve()
[Section titled “resolve()”](#resolve)
> **resolve**(`addresses`): `Promise`<`Record`<`string`, [`SpenderLabel`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabel/)>>
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:20
Lowercase address → label; unknown addresses are absent.
#### Parameters
[Section titled “Parameters”](#parameters)
##### addresses
[Section titled “addresses”](#addresses)
`string`\[]
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`Record`<`string`, [`SpenderLabel`](/api/anywalletkit/protocol-approvals-evm/interfaces/spenderlabel/)>>
# StateVerifierOptions
Defined in: protocol-approvals-evm/src/state-verifier.ts:10
## Properties
[Section titled “Properties”](#properties)
### batchSize?
[Section titled “batchSize?”](#batchsize)
> `optional` **batchSize?**: `number`
Defined in: protocol-approvals-evm/src/state-verifier.ts:16
Calls per `aggregate3` (default 200).
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-approvals-evm/src/state-verifier.ts:18
Parallel batches / code reads (default 4).
***
### multicall?
[Section titled “multicall?”](#multicall)
> `optional` **multicall?**: `string` | `false`
Defined in: protocol-approvals-evm/src/state-verifier.ts:14
Multicall3 address, or false to always use single calls.
***
### provider
[Section titled “provider”](#provider)
> **provider**: `object`
Defined in: protocol-approvals-evm/src/state-verifier.ts:12
A viem public client.
# VerifyOptions
Defined in: protocol-approvals-evm/src/state-verifier.ts:21
## Properties
[Section titled “Properties”](#properties)
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `string` | `number`
Defined in: protocol-approvals-evm/src/state-verifier.ts:22
***
### includeZero?
[Section titled “includeZero?”](#includezero)
> `optional` **includeZero?**: `boolean`
Defined in: protocol-approvals-evm/src/state-verifier.ts:24
Also return zero / expired entries (default false).
***
### now?
[Section titled “now?”](#now)
> `optional` **now?**: `number`
Defined in: protocol-approvals-evm/src/state-verifier.ts:26
Unix seconds “now” for Permit2 expirations (default: the clock).
# STANDARDS
## Variables
[Section titled “Variables”](#variables)
* [DISCOVERY_TOPICS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/discovery_topics/)
* [EIP7702_PREFIX](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/eip7702_prefix/)
* [ERC1155_INTERFACE_ID](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/erc1155_interface_id/)
* [ERC20_ABI](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/erc20_abi/)
* [ERC721_ABI](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/erc721_abi/)
* [ERC721_INTERFACE_ID](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/erc721_interface_id/)
* [MAX_UINT160](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/max_uint160/)
* [MAX_UINT256](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/max_uint256/)
* [MULTICALL3_ABI](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/multicall3_abi/)
* [MULTICALL3_ADDRESS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/multicall3_address/)
* [PERMIT2_ABI](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/permit2_abi/)
* [PERMIT2_ADDRESS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/permit2_address/)
* [SELECTORS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/selectors/)
* [TOPICS](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/topics/)
* [UNLIMITED_THRESHOLD](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/variables/unlimited_threshold/)
## Functions
[Section titled “Functions”](#functions)
* [ownerTopic](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/functions/ownertopic/)
* [topicAddress](/api/anywalletkit/protocol-approvals-evm/namespaces/standards/functions/topicaddress/)
# ownerTopic
> **ownerTopic**(`owner`): `` `0x${string}` ``
Defined in: protocol-approvals-evm/src/standards.ts:63
The owner as an indexed topic (left-padded to 32 bytes, lowercase).
## Parameters
[Section titled “Parameters”](#parameters)
### owner
[Section titled “owner”](#owner)
`string`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# topicAddress
> **topicAddress**(`topic`): `string`
Defined in: protocol-approvals-evm/src/standards.ts:68
The address packed in an indexed topic.
## Parameters
[Section titled “Parameters”](#parameters)
### topic
[Section titled “topic”](#topic)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# DISCOVERY_TOPICS
> `const` **DISCOVERY_TOPICS**: readonly `Hex`\[]
Defined in: protocol-approvals-evm/src/standards.ts:28
Every topic0 the discovery filter asks for (owner is topic1 in all of them).
# EIP7702_PREFIX
> `const` **EIP7702_PREFIX**: `"0xef0100"` = `'0xef0100'`
Defined in: protocol-approvals-evm/src/standards.ts:12
Code prefix of an EIP-7702 delegated account: 0xef0100 ‖ delegate.
# ERC1155_INTERFACE_ID
> `const` **ERC1155_INTERFACE_ID**: `"0xd9b67a26"` = `'0xd9b67a26'`
Defined in: protocol-approvals-evm/src/standards.ts:13
# ERC20_ABI
> `const` **ERC20_ABI**: readonly \[{ }, { }]
Defined in: protocol-approvals-evm/src/standards.ts:30
# ERC721_ABI
> `const` **ERC721_ABI**: readonly \[{ }, { }, { }, { }, { }, { }]
Defined in: protocol-approvals-evm/src/standards.ts:35
# ERC721_INTERFACE_ID
> `const` **ERC721_INTERFACE_ID**: `"0x80ac58cd"` = `'0x80ac58cd'`
Defined in: protocol-approvals-evm/src/standards.ts:14
# MAX_UINT160
> `const` **MAX_UINT160**: `bigint`
Defined in: protocol-approvals-evm/src/standards.ts:9
# MAX_UINT256
> `const` **MAX_UINT256**: `bigint`
Defined in: protocol-approvals-evm/src/standards.ts:10
# MULTICALL3_ABI
> `const` **MULTICALL3_ABI**: readonly \[{ }]
Defined in: protocol-approvals-evm/src/standards.ts:50
# MULTICALL3_ADDRESS
> `const` **MULTICALL3_ADDRESS**: `"0xcA11bde05977b3631167028862bE2a173976CA11"` = `'0xcA11bde05977b3631167028862bE2a173976CA11'`
Defined in: protocol-approvals-evm/src/standards.ts:6
Multicall3 — the same address on every major EVM chain.
# PERMIT2_ABI
> `const` **PERMIT2_ABI**: readonly \[{ }, { }, { }]
Defined in: protocol-approvals-evm/src/standards.ts:44
# PERMIT2_ADDRESS
> `const` **PERMIT2_ADDRESS**: `"0x000000000022D473030F116dDEE9F6B43aC78BA3"` = `'0x000000000022D473030F116dDEE9F6B43aC78BA3'`
Defined in: protocol-approvals-evm/src/standards.ts:4
Uniswap Permit2 — the same address on every EVM chain it is deployed to.
# SELECTORS
> `const` **SELECTORS**: `Readonly`<{ `approve`: `Hex`; `lockdown`: `Hex`; `setApprovalForAll`: `Hex`; }>
Defined in: protocol-approvals-evm/src/standards.ts:55
Function selectors a policy condition can recognise a revoke by.
# TOPICS
> `const` **TOPICS**: `Readonly`<{ `approval`: `Hex`; `approvalForAll`: `Hex`; `permit2Approval`: `Hex`; `permit2Lockdown`: `Hex`; `permit2Permit`: `Hex`; }>
Defined in: protocol-approvals-evm/src/standards.ts:20
Event signatures. `approval` is shared by ERC-20 and ERC-721 (3 vs 4 topics).
# UNLIMITED_THRESHOLD
> `const` **UNLIMITED_THRESHOLD**: `bigint`
Defined in: protocol-approvals-evm/src/standards.ts:8
An ERC-20 allowance at or above this is treated as unlimited (2^255).
# ActivityTokens
> **ActivityTokens** = `Record`<`string`, { `decimals?`: `number`; `symbol?`: `string`; }>
Defined in: protocol-approvals-evm/src/activity.ts:23
Token labels (lowercase address → symbol / decimals) for activity titles.
# ApprovalRisk
> **ApprovalRisk** = `"unlimited"` | `"eoa-spender"` | `"expired"` | `"permanent"`
Defined in: core/dist/index-QWdcwE6y.d.ts:805
Why an approval is flagged: an unlimited amount, a spender that is a plain address (not a contract), an expired permit still on record, or no expiry at all.
# ApprovalsErrorReason
> **ApprovalsErrorReason** = `"account-required"` | `"provider-required"` | `"unsupported-standard"` | `"invalid-approval"` | `"source-failed"`
Defined in: core/dist/index-QWdcwE6y.d.ts:887
Why an approvals call failed: a signing account or an RPC provider is missing, the standard is not supported, the approval object is invalid, or the history source failed.
# ApprovalStandard
> **ApprovalStandard** = `"erc20"` | `"erc721"` | `"erc721-token"` | `"erc1155"` | `"permit2"` | `"eip7702"` | `"trc20"` | `"spl"` | `"spl-2022"` | `"authz"`
Defined in: core/dist/index-QWdcwE6y.d.ts:800
Kinds of approval the approvals interface covers: EVM token allowances, NFT operators, Permit2, EIP-7702 delegations, and their Tron, Solana and Cosmos counterparts.
# EvmProvider
> **EvmProvider** = `string` | [`Eip1193Provider`](/api/anywalletkit/protocol-approvals-evm/interfaces/eip1193provider/)
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:29
RPC url, or an EIP-1193 provider.
# FetchLike
> **FetchLike** = (`url`, `init`) => `Promise`<[`FetchResponseLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/fetchresponselike/)>
Defined in: protocol-approvals-evm/src/sources/indexer-logs.ts:17
A `fetch` implementation (the global one, or a wrapper that adds a proxy’s auth).
## Parameters
[Section titled “Parameters”](#parameters)
### url
[Section titled “url”](#url)
`string`
### init
[Section titled “init”](#init)
#### headers
[Section titled “headers”](#headers)
`Record`<`string`, `string`>
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`FetchResponseLike`](/api/anywalletkit/protocol-approvals-evm/interfaces/fetchresponselike/)>
# RevokeTargets
> **RevokeTargets** = `Iterable`<{ `standard`: [`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/) | `string`; `token`: `string`; }> | `ReadonlyMap`<`string`, [`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/) | `string`> | `Readonly`<`Record`<`string`, [`ApprovalStandard`](/api/anywalletkit/protocol-approvals-evm/type-aliases/approvalstandard/) | `string`>> | `Iterable`<`string`>
Defined in: protocol-approvals-evm/src/calldata.ts:39
The token contracts a host’s own approvals scan reported, with their standards: the `Approval` list itself, a map from address to standard, or bare addresses (standard unknown).
# SendResult
> **SendResult** = { `fee?`: `bigint`; `hash`: `string`; } | `string`
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:38
What an account’s `sendTransaction` / `approve` / `revokeDelegation` may resolve to: a hash, or `{ hash, fee }`.
# ACTIVITY_CHAIN_NAMES
> `const` **ACTIVITY_CHAIN_NAMES**: `Readonly`<`Record`<`number`, `string`>>
Defined in: protocol-approvals-evm/src/activity.ts:33
Chain labels for the subtitle; anything else prints as `eip155:N`.
# ApprovalsProtocol
> `const` **ApprovalsProtocol**: [`ApprovalsProtocolConstructor`](/api/anywalletkit/protocol-approvals-evm/interfaces/approvalsprotocolconstructor/)
Defined in: protocol-approvals-evm/src/approvals-protocol.ts:113
Core’s `ApprovalsProtocol` base class (so `instanceof` and `ProtocolBase` plumbing hold), typed for this module’s account surface.
# BLOCKSCOUT_HOSTS
> `const` **BLOCKSCOUT_HOSTS**: `Readonly`<`Record`<`number`, `string`>>
Defined in: protocol-approvals-evm/src/sources/blockscout.ts:5
Public Blockscout instances (Etherscan-compatible `module=logs` API, no key).
# ETHERSCAN_V2_URL
> `const` **ETHERSCAN_V2_URL**: `"https://api.etherscan.io/v2/api"` = `'https://api.etherscan.io/v2/api'`
Defined in: protocol-approvals-evm/src/sources/etherscan.ts:5
Etherscan V2 — one endpoint and one key for every chain Etherscan indexes.
# @anywalletkit/protocol-lending-aave-evm
# @anywalletkit/protocol-lending-aave-evm
[Section titled “@anywalletkit/protocol-lending-aave-evm”](#anywalletkitprotocol-lending-aave-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-lending-aave-evm)
[Aave v3](https://aave.com/docs) for `@anywalletkit/wallet-evm` accounts: supply, withdraw, borrow (variable rate) and repay on any Aave v3 market, with the reads a wallet screen needs — reserves with rates and caps, the account’s health factor and borrowing power, the position. Implements core’s `LendingProtocol` (`supply / withdraw / borrow / repay` + quotes), like `@anywalletkit/protocol-lending-mellow-evm` does for vaults.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-lending-aave-evm @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-lending-aave-evm @anywalletkit/core · yarn add @anywalletkit/protocol-lending-aave-evm @anywalletkit/core
```
On npm: [@anywalletkit/protocol-lending-aave-evm](https://www.npmjs.com/package/@anywalletkit/protocol-lending-aave-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Written from the protocol’s own interfaces (aave-v3-origin) and the official address book (bgd-labs/aave-address-book); no Aave SDK, one dependency (viem).
## Markets
[Section titled “Markets”](#markets)
Every live Aave v3 market ships as a preset (`AAVE_MARKETS[chainId][key]`): Ethereum (`core`, `lido`, `etherfi`), Arbitrum, Optimism, Polygon, Base, Avalanche, BNB, Gnosis, Scroll, Linea, Sonic, Celo, Mantle, Soneium, Plasma, zkSync, Metis, Ink. A market not in the list takes `addressesProvider` and `pool` in the config: the Pool receives the approvals and permits, so it is never taken from the RPC alone, and a custom provider without `pool` is refused (a preset’s provider on its own chain picks up the shipped Pool).
Only the **PoolAddressesProvider** is trusted from configuration. The Pool, price oracle and data provider are read from it on-chain, and the preset’s Pool must match what the provider reports — a stale or wrong entry refuses instead of sending money to the wrong contract.
## Usage
[Section titled “Usage”](#usage)
```ts
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import { AaveProtocolEvm } from '@anywalletkit/protocol-lending-aave-evm'
const account = await new WalletManagerEvm(seed, { provider: 'https://…' }).getAccount(0)
const aave = new AaveProtocolEvm(account) // chain from the account, market 'core'
// new AaveProtocolEvm(account, { market: 'lido' }) // Ethereum Lido instance
// new AaveProtocolEvm(account, { chainId: 8453 }) // Base, with an explicit chain
const USDT = '0xdAC17F958D2ee523a2206206994597C13D831ec7'
await aave.getSupplyApy(USDT) // 3.9 (percent, compounded like Aave's UI)
await aave.quoteSupply({ token: USDT, amount: 100_000_000n }) // { fee, approvals, permit, supplyApy }
await aave.supply({ token: USDT, amount: 100_000_000n }) // approve (exact) → wait → Pool.supply
await aave.supply({ token: 'native', amount: 10n ** 17n }) // WrappedTokenGatewayV3.depositETH
await aave.borrow({ token: USDT, amount: 50_000_000n }) // variable rate, checked against borrowing power
await aave.repay({ token: USDT, amount: 'max' }) // whole debt (+0.1 % approved for accruing interest)
await aave.withdraw({ token: USDT, amount: 'max' }) // uint256.max → everything
await aave.setCollateral({ token: USDT, enabled: false })
const { account: data, supplies, borrows } = await aave.getPosition()
data.healthFactor // 2.6, or Infinity without debt
```
### What happens before money moves
[Section titled “What happens before money moves”](#what-happens-before-money-moves)
* The reserve must be active, not paused, and not frozen (frozen allows only withdraw and repay). Supply and borrow caps are checked against the aToken / debt-token supply.
* Borrows are compared with `getUserAccountData().availableBorrowsBase` at the oracle price, so an over-borrow is refused with the numbers instead of a bare revert. Credit delegation (`onBehalfOf`) is checked via `borrowAllowance`.
* Every main transaction is proven with `eth_call` from the account; Aave’s reverts — numeric codes on v3.0–3.3 (`'35'`), custom errors on v3.4+ (`HealthFactorLowerThanLiquidationThreshold()`) — become readable `AaveError`s with the code attached.
* ERC-20 allowances are **exact**, never unlimited; Ethereum’s USDT gets the `approve(0)` reset it demands. When the token supports EIP-2612 and the account can `signPermit` (wallet-evm does), supply and repay take the one-transaction `supplyWithPermit` / `repayWithPermit` road.
* Native legs go through WrappedTokenGatewayV3: `depositETH`, `withdrawETH` (after approving the aWETH to the gateway), `borrowETH` (after `approveDelegation` on the WETH debt token), `repayETH` (excess refunded). The gateway ABI is the v3.2+ one verified on Ethereum — `borrowETH` and `repayETH` no longer take a rate mode, unlike the protocol docs still show.
### Reads
[Section titled “Reads”](#reads)
| method | returns |
| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `getMarket()` | pool, oracle, data provider, base currency unit, gateway, wrapped native |
| `getReserves()` / `getReserve(token)` | configuration bits decoded (LTV, thresholds, caps, flags), rates (ray, APR, APY), aToken / debt token |
| `getUserAccountData(user?)` | collateral, debt, borrowing power in base currency; LTV, liquidation threshold, health factor |
| `getPosition()` | supplies (with the collateral flag) and borrows per reserve, plus the account data |
| `getAssetPrice(token)`, `getSupplyApy(token)`, `getBorrowApy(token)` | oracle price; APYs in percent |
Reserve reads go through Multicall3 (one round trip) and fall back to single calls where it is absent (zkSync).
## Config
[Section titled “Config”](#config)
| key | default | meaning |
| ------------------------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------- |
| `chainId` | account’s chain, else 1 | must match the account’s `eip155:N` |
| `market` | `'core'` | preset key for the chain |
| `addressesProvider`, `pool`, `wethGateway` | from the preset | explicit market (`pool` required with a custom `addressesProvider`); `wethGateway: null` disables native legs |
| `provider` | the account’s | RPC url(s) / EIP-1193 to read through |
| `usePermit` | `true` | one-transaction supply / repay when possible |
| `referralCode` | `0` | inactive on every market |
| `waitTimeoutMs` | 180 000 | how long an approval may take to mine |
| `multicall` | Multicall3 | address, or `false` |
## Tests
[Section titled “Tests”](#tests)
`pnpm test` — 38 offline tests over an in-memory Aave market (an EIP-1193 provider that decodes calldata: Pool, oracle, gateway, tokens, Multicall3, reverts in both dialects) plus the conformance suite. `pnpm verify:live` reads the Ethereum Core market through a public RPC: market discovery, reserves, prices, APYs, and proves a supply plan with `eth_call`.
## Status
[Section titled “Status”](#status)
2026-10-10: built, offline tests green, live read-only verification against Ethereum mainnet. No funded transaction through the module yet.
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels the module’s own transactions for a wallet’s history, offline and synchronously:
* **Recognized**: a call whose target is a known Aave v3 **Pool** or **WrappedTokenGatewayV3** — every preset market on the transaction’s chain (`AAVE_MARKETS`) plus the market the instance was configured with. The 4-byte selector picks the kind: `supply` / `supplyWithPermit` / `deposit` and `depositETH` → `supply`; `withdraw` / `withdrawETH` → `withdraw`; `borrow` / `borrowETH` → `borrow`; `repay` / `repayWithPermit` / `repayWithATokens` / `repayETH` → `repay`; `setUserUseReserveAsCollateral` / `setUserEMode` → `contract`. Any other method on an Aave contract is still returned as `contract` (“Aave v3 transaction”).
* **Title** is `" "` (“Supplied ETH”, “Withdrew USDC”): the principal asset is the `address asset` argument when calldata is present, else the token that moved in the action’s direction; the symbol comes from the source’s transfer metadata. **Subtitle** is `"Aave v3 · "`, `counterparty` the contract called, `protocol` the package name.
* **Assets**: `assetsIn` / `assetsOut` are the wallet’s net token movements from the receipt (aToken mints and burns included, so a supply shows the aToken arriving).
* **Null** for everything else: another protocol, a plain transfer, a chain without a market.
Fixtures in `fixtures/activity/` are the test wallet’s funded Base run (`depositETH` / `withdrawETH`, 2026-10-10) and run through the conformance suite’s activity half; `fixtures/activity/negatives/` holds look-alikes that must yield null.
## Classes
[Section titled “Classes”](#classes)
* [AaveError](/api/anywalletkit/protocol-lending-aave-evm/classes/aaveerror/)
* [AaveProtocolEvm](/api/anywalletkit/protocol-lending-aave-evm/classes/aaveprotocolevm/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AaveActivityAction](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveactivityaction/)
* [AaveBorrowOptions](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveborrowoptions/)
* [AaveMarket](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/)
* [AaveProtocolConfig](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveprotocolconfig/)
* [AaveRepayOptions](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaverepayoptions/)
* [AaveSupplyOptions](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavesupplyoptions/)
* [AaveWithdrawOptions](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavewithdrawoptions/)
* [AccountData](/api/anywalletkit/protocol-lending-aave-evm/interfaces/accountdata/)
* [ActivityMarket](/api/anywalletkit/protocol-lending-aave-evm/interfaces/activitymarket/)
* [BorrowPlan](/api/anywalletkit/protocol-lending-aave-evm/interfaces/borrowplan/)
* [MarketInfo](/api/anywalletkit/protocol-lending-aave-evm/interfaces/marketinfo/)
* [Position](/api/anywalletkit/protocol-lending-aave-evm/interfaces/position/)
* [RepayPlan](/api/anywalletkit/protocol-lending-aave-evm/interfaces/repayplan/)
* [ReserveConfiguration](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/)
* [ReserveInfo](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
* [SupplyPlan](/api/anywalletkit/protocol-lending-aave-evm/interfaces/supplyplan/)
* [Tx](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)
* [WithdrawPlan](/api/anywalletkit/protocol-lending-aave-evm/interfaces/withdrawplan/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [AaveLendingResult](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/aavelendingresult/)
* [AmountOption](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/amountoption/)
* [EvmProvider](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/evmprovider/)
## Variables
[Section titled “Variables”](#variables)
* [AAVE_CHAINS](/api/anywalletkit/protocol-lending-aave-evm/variables/aave_chains/)
* [AAVE_CUSTOM_ERRORS](/api/anywalletkit/protocol-lending-aave-evm/variables/aave_custom_errors/)
* [AAVE_ERROR_CODES](/api/anywalletkit/protocol-lending-aave-evm/variables/aave_error_codes/)
* [AAVE_MARKETS](/api/anywalletkit/protocol-lending-aave-evm/variables/aave_markets/)
* [ADDRESSES_PROVIDER_ABI](/api/anywalletkit/protocol-lending-aave-evm/variables/addresses_provider_abi/)
* [GATEWAY_ABI](/api/anywalletkit/protocol-lending-aave-evm/variables/gateway_abi/)
* [GATEWAY_ACTIONS](/api/anywalletkit/protocol-lending-aave-evm/variables/gateway_actions/)
* [MODULE_NAME](/api/anywalletkit/protocol-lending-aave-evm/variables/module_name/)
* [ORACLE_ABI](/api/anywalletkit/protocol-lending-aave-evm/variables/oracle_abi/)
* [POOL_ABI](/api/anywalletkit/protocol-lending-aave-evm/variables/pool_abi/)
* [POOL_ACTIONS](/api/anywalletkit/protocol-lending-aave-evm/variables/pool_actions/)
* [RAY](/api/anywalletkit/protocol-lending-aave-evm/variables/ray/)
* [SECONDS_PER_YEAR](/api/anywalletkit/protocol-lending-aave-evm/variables/seconds_per_year/)
* [VARIABLE_DEBT_ABI](/api/anywalletkit/protocol-lending-aave-evm/variables/variable_debt_abi/)
* [VARIABLE_RATE_MODE](/api/anywalletkit/protocol-lending-aave-evm/variables/variable_rate_mode/)
* [WAD](/api/anywalletkit/protocol-lending-aave-evm/variables/wad/)
## Functions
[Section titled “Functions”](#functions)
* [decodeAaveRevert](/api/anywalletkit/protocol-lending-aave-evm/functions/decodeaaverevert/)
* [describeAaveActivity](/api/anywalletkit/protocol-lending-aave-evm/functions/describeaaveactivity/)
* [healthFactorToNumber](/api/anywalletkit/protocol-lending-aave-evm/functions/healthfactortonumber/)
* [listMarkets](/api/anywalletkit/protocol-lending-aave-evm/functions/listmarkets/)
* [marketChainName](/api/anywalletkit/protocol-lending-aave-evm/functions/marketchainname/)
* [parseReserveConfiguration](/api/anywalletkit/protocol-lending-aave-evm/functions/parsereserveconfiguration/)
* [presetMarkets](/api/anywalletkit/protocol-lending-aave-evm/functions/presetmarkets/)
* [rayToAprPct](/api/anywalletkit/protocol-lending-aave-evm/functions/raytoaprpct/)
* [rayToApyPct](/api/anywalletkit/protocol-lending-aave-evm/functions/raytoapypct/)
* [userFlags](/api/anywalletkit/protocol-lending-aave-evm/functions/userflags/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [AaveProtocolEvm](/api/anywalletkit/protocol-lending-aave-evm/classes/aaveprotocolevm/)
# AaveError
Defined in: protocol-lending-aave-evm/src/errors.ts:7
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new AaveError**(`message`, `code?`): `AaveError`
Defined in: protocol-lending-aave-evm/src/errors.ts:10
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
`string`
#### Returns
[Section titled “Returns”](#returns)
`AaveError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `string` | `undefined`
Defined in: protocol-lending-aave-evm/src/errors.ts:9
Aave’s own identifier: the numeric code or the custom error name.
# AaveProtocolEvm
Defined in: protocol-lending-aave-evm/src/protocol.ts:137
Aave v3 for EVM wallet accounts: supply, withdraw, borrow (variable rate) and repay on any Aave v3 market, plus the reads a wallet screen needs — reserves with rates and caps, the account’s health factor, the position.
Nothing but the PoolAddressesProvider is trusted from configuration: the Pool, oracle and data provider are read from it on-chain and the preset’s Pool address must match. Before money moves, the module checks the reserve (active, not frozen or paused, borrowing enabled, caps) and proves the call with `eth_call` from the account, translating Aave’s revert codes and custom errors into readable messages. ERC-20 legs approve the exact amount (a one-transaction `supplyWithPermit` / `repayWithPermit` when the token and the account support EIP-2612); native legs go through WrappedTokenGatewayV3.
## Extends
[Section titled “Extends”](#extends)
* `LendingProtocol`<[`AaveProtocolConfig`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveprotocolconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new AaveProtocolEvm**(`account`, `config?`): `AaveProtocolEvm`
Defined in: protocol-lending-aave-evm/src/protocol.ts:153
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config?
[Section titled “config?”](#config)
[`AaveProtocolConfig`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveprotocolconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`AaveProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`LendingProtocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`LendingProtocol._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`AaveProtocolConfig`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveprotocolconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`LendingProtocol._config`
***
### addressesProvider
[Section titled “addressesProvider”](#addressesprovider)
> `readonly` **addressesProvider**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:140
***
### chainId
[Section titled “chainId”](#chainid)
> `readonly` **chainId**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:138
***
### preset
[Section titled “preset”](#preset)
> `readonly` **preset**: [`AaveMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/) | `null`
Defined in: protocol-lending-aave-evm/src/protocol.ts:139
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`o`): `Promise`<[`AaveLendingResult`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/aavelendingresult/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:664
Borrows `amount` of `token` at the variable rate against the account’s collateral (or against `onBehalfOf`’s, who must have delegated credit). Refused before sending when the amount exceeds the borrowing power.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### o
[Section titled “o”](#o)
[`AaveBorrowOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveborrowoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`AaveLendingResult`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/aavelendingresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`LendingProtocol.borrow`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-lending-aave-evm/src/protocol.ts:206
Recognize this protocol’s transactions offline: a call to a known Aave v3 Pool or WrappedTokenGatewayV3 (every preset market on the transaction’s chain, plus the market this instance is configured with). See `activity.ts` for the rule.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`LendingProtocol.describeActivity`
***
### getAssetPrice()
[Section titled “getAssetPrice()”](#getassetprice)
> **getAssetPrice**(`token`): `Promise`<`bigint`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:446
Oracle price in base currency units (8-decimal USD on every market today).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`bigint`>
***
### getBorrowApy()
[Section titled “getBorrowApy()”](#getborrowapy)
> **getBorrowApy**(`token`): `Promise`<`number`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:458
Variable borrow APY in percent.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
***
### getMarket()
[Section titled “getMarket()”](#getmarket)
> **getMarket**(): `Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/marketinfo/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:355
The market as the addresses provider reports it; the expected Pool (preset or config) must agree. Cached per instance.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/marketinfo/)>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(): `Promise`<[`Position`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/position/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:480
Supplied and borrowed balances per reserve, with the collateral flag, plus the account totals.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`Position`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/position/)>
***
### getReserve()
[Section titled “getReserve()”](#getreserve)
> **getReserve**(`token`): `Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:437
The reserve for a token (or the wrapped native for ‘native’).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)>
***
### getReserves()
[Section titled “getReserves()”](#getreserves)
> **getReserves**(`__namedParameters?`): `Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)\[]>
Defined in: protocol-lending-aave-evm/src/protocol.ts:388
Every reserve of the market with configuration, rates and token addresses. Cached `reserveTtlMs`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
###### refresh?
[Section titled “refresh?”](#refresh)
`boolean` = `false`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)\[]>
***
### getSupplyApy()
[Section titled “getSupplyApy()”](#getsupplyapy)
> **getSupplyApy**(`token`): `Promise`<`number`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:453
Supply APY in percent for a token (what Aave’s UI shows).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### token
[Section titled “token”](#token-3)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`number`>
***
### getUserAccountData()
[Section titled “getUserAccountData()”](#getuseraccountdata)
> **getUserAccountData**(`user?`): `Promise`<[`AccountData`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/accountdata/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:465
Pool.getUserAccountData for the account (or `user`), with the health factor as a number.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### user?
[Section titled “user?”](#user)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`AccountData`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/accountdata/)>
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:670
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### o
[Section titled “o”](#o-1)
[`AaveBorrowOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveborrowoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`LendingProtocol.quoteBorrow`
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:739
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### o
[Section titled “o”](#o-2)
[`AaveRepayOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaverepayoptions/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`LendingProtocol.quoteRepay`
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:554
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### o
[Section titled “o”](#o-3)
[`AaveSupplyOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavesupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-5)
`LendingProtocol.quoteSupply`
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:613
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### o
[Section titled “o”](#o-4)
[`AaveWithdrawOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavewithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`LendingProtocol.quoteWithdraw`
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`o`): `Promise`<`LendingResult` & `object` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:733
Repays `amount` (or ‘max’) of variable debt in `token` for the account or `onBehalfOf`. A full repayment approves (or sends, for native) the debt plus 0.1 % so the interest of the next seconds is covered; the Pool takes only what is owed and the gateway refunds the rest.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### o
[Section titled “o”](#o-5)
[`AaveRepayOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaverepayoptions/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`LendingResult` & `object` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
`LendingProtocol.repay`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`LendingProtocol.requireSigningAccount`
***
### resolveToken()
[Section titled “resolveToken()”](#resolvetoken)
> **resolveToken**(`token`): `Promise`<{ `asset`: `` `0x${string}` ``; `native`: `boolean`; }>
Defined in: protocol-lending-aave-evm/src/protocol.ts:426
‘native’ / zero address / ‘ETH’ → the gateway’s wrapped native; else a checksummed ERC-20.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### token
[Section titled “token”](#token-4)
`string` | `undefined`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<{ `asset`: `` `0x${string}` ``; `native`: `boolean`; }>
***
### setCollateral()
[Section titled “setCollateral()”](#setcollateral)
> **setCollateral**(`__namedParameters`): `Promise`<`LendingResult`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:748
Enable or disable a supplied asset as collateral (refused when it would break the health factor).
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
###### enabled
[Section titled “enabled”](#enabled)
`boolean`
###### token
[Section titled “token”](#token-5)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`LendingResult`>
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`o`): `Promise`<[`AaveLendingResult`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/aavelendingresult/)>
Defined in: protocol-lending-aave-evm/src/protocol.ts:548
Supplies `amount` of `token` (‘native’ goes through the gateway); aTokens land on `onBehalfOf` (default: the account). ERC-20 legs approve the exact amount first and wait for the receipt, or use one `supplyWithPermit` when the token and the account support permits.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### o
[Section titled “o”](#o-6)
[`AaveSupplyOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavesupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`AaveLendingResult`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/aavelendingresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-8)
`LendingProtocol.supply`
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`o`): `Promise`<`LendingResult` & `object` & `object`>
Defined in: protocol-lending-aave-evm/src/protocol.ts:607
Withdraws `amount` (or ‘max’) of a supplied token to `to` (default: the account). Refused by the protocol — and reported here before sending — when it would push the health factor below 1.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### o
[Section titled “o”](#o-7)
[`AaveWithdrawOptions`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavewithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`LendingResult` & `object` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-9)
`LendingProtocol.withdraw`
# decodeAaveRevert
> **decodeAaveRevert**(`data`): `object`
Defined in: protocol-lending-aave-evm/src/errors.ts:108
Revert bytes → Aave message (and code) when they are Aave’s; otherwise a generic reason.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`` `0x${string}` ``
## Returns
[Section titled “Returns”](#returns)
`object`
### code?
[Section titled “code?”](#code)
> `optional` **code?**: `string`
### message
[Section titled “message”](#message)
> **message**: `string`
# describeAaveActivity
> **describeAaveActivity**(`tx`, `ctx`, `markets`): `ActivityItem` | `null`
Defined in: protocol-lending-aave-evm/src/activity.ts:103
Describe `tx` if it is a call to one of `markets`. Returns null for anything else (another protocol, a plain transfer, a chain without a market).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### markets
[Section titled “markets”](#markets)
readonly [`ActivityMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/activitymarket/)\[]
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# healthFactorToNumber
> **healthFactorToNumber**(`hf`): `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:102
Health factor as a number; Aave returns uint256.max when there is no debt → Infinity.
## Parameters
[Section titled “Parameters”](#parameters)
### hf
[Section titled “hf”](#hf)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# listMarkets
> **listMarkets**(): [`AaveMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/)\[]
Defined in: protocol-lending-aave-evm/src/markets.ts:52
Every known market as a flat list.
## Returns
[Section titled “Returns”](#returns)
[`AaveMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/)\[]
# marketChainName
> **marketChainName**(`m`): `string`
Defined in: protocol-lending-aave-evm/src/activity.ts:75
“Aave V3 Base” → “Base”, “Aave V3 Ink (whitelabel)” → “Ink”.
## Parameters
[Section titled “Parameters”](#parameters)
### m
[Section titled “m”](#m)
[`AaveMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/)
## Returns
[Section titled “Returns”](#returns)
`string`
# parseReserveConfiguration
> **parseReserveConfiguration**(`data`): [`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/)
Defined in: protocol-lending-aave-evm/src/reserve.ts:36
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`bigint`
## Returns
[Section titled “Returns”](#returns)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/)
# presetMarkets
> **presetMarkets**(`chainId`): [`ActivityMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/activitymarket/)\[]
Defined in: protocol-lending-aave-evm/src/activity.ts:81
Every preset market on a chain.
## Parameters
[Section titled “Parameters”](#parameters)
### chainId
[Section titled “chainId”](#chainid)
`number`
## Returns
[Section titled “Returns”](#returns)
[`ActivityMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/activitymarket/)\[]
# rayToAprPct
> **rayToAprPct**(`rate`): `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:67
Ray rate → APR in percent.
## Parameters
[Section titled “Parameters”](#parameters)
### rate
[Section titled “rate”](#rate)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# rayToApyPct
> **rayToApyPct**(`rate`): `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:76
Ray rate → APY in percent, compounded per second the way the Aave UI shows it. expm1(n·log1p(x)) rather than pow(1 + x, n): with x ≈ 1e-9 and n = 31 536 000 the pow form depends on the engine’s libm (Hermes on Linux drifted past 0.01 %).
## Parameters
[Section titled “Parameters”](#parameters)
### rate
[Section titled “rate”](#rate)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# userFlags
> **userFlags**(`data`, `reserveId`): `object`
Defined in: protocol-lending-aave-evm/src/reserve.ts:61
UserConfigurationMap: bit 2·id = borrowing, bit 2·id + 1 = used as collateral.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`bigint`
### reserveId
[Section titled “reserveId”](#reserveid)
`number`
## Returns
[Section titled “Returns”](#returns)
`object`
### borrowing
[Section titled “borrowing”](#borrowing)
> **borrowing**: `boolean`
### collateral
[Section titled “collateral”](#collateral)
> **collateral**: `boolean`
# AaveActivityAction
Defined in: protocol-lending-aave-evm/src/activity.ts:21
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: protocol-lending-aave-evm/src/activity.ts:22
***
### native?
[Section titled “native?”](#native)
> `optional` **native?**: `boolean`
Defined in: protocol-lending-aave-evm/src/activity.ts:27
Gateway methods move the chain’s native coin.
***
### principal
[Section titled “principal”](#principal)
> **principal**: `"in"` | `"out"` | `"none"`
Defined in: protocol-lending-aave-evm/src/activity.ts:25
Which side of the net transfers holds the principal asset.
***
### verb
[Section titled “verb”](#verb)
> **verb**: `string`
Defined in: protocol-lending-aave-evm/src/activity.ts:23
# AaveBorrowOptions
Defined in: protocol-lending-aave-evm/src/protocol.ts:52
## Extends
[Section titled “Extends”](#extends)
* `BorrowOptions`
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:632
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`BorrowOptions.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:633
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`BorrowOptions.onBehalfOf`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:52
#### Overrides
[Section titled “Overrides”](#overrides)
`BorrowOptions.token`
# AaveMarket
Defined in: protocol-lending-aave-evm/src/markets.ts:8
## Properties
[Section titled “Properties”](#properties)
### addressesProvider
[Section titled “addressesProvider”](#addressesprovider)
> **addressesProvider**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/markets.ts:14
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-aave-evm/src/markets.ts:13
***
### dataProvider
[Section titled “dataProvider”](#dataprovider)
> **dataProvider**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/markets.ts:17
AaveProtocolDataProvider — informational, the module reads the Pool directly.
***
### key
[Section titled “key”](#key)
> **key**: `string`
Defined in: protocol-lending-aave-evm/src/markets.ts:10
Preset key: ‘core’ on every chain, plus ‘lido’ / ‘etherfi’ on Ethereum.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-aave-evm/src/markets.ts:12
Human name as the address book calls it.
***
### pool
[Section titled “pool”](#pool)
> **pool**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/markets.ts:15
***
### wethGateway?
[Section titled “wethGateway?”](#wethgateway)
> `optional` **wethGateway?**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/markets.ts:19
WrappedTokenGatewayV3 for the chain’s native coin; absent where Aave deployed none (Celo, Metis).
# AaveProtocolConfig
Defined in: protocol-lending-aave-evm/src/protocol.ts:20
## Properties
[Section titled “Properties”](#properties)
### addressesProvider?
[Section titled “addressesProvider?”](#addressesprovider)
> `optional` **addressesProvider?**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:26
A PoolAddressesProvider for a market not in the presets. The Pool is read from it; `pool` is then required.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:22
Chain the market lives on (default: the account’s `eip155:N`, else 1).
***
### market?
[Section titled “market?”](#market)
> `optional` **market?**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:24
Preset key in AAVE_MARKETS for the chain: ‘core’ (default), ‘lido’, ‘etherfi’.
***
### multicall?
[Section titled “multicall?”](#multicall)
> `optional` **multicall?**: `string` | `false`
Defined in: protocol-lending-aave-evm/src/protocol.ts:42
Multicall3 address, or `false` to read reserves one call at a time.
***
### permitTtlSeconds?
[Section titled “permitTtlSeconds?”](#permitttlseconds)
> `optional` **permitTtlSeconds?**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:38
Permit validity in seconds (default 1200).
***
### pool?
[Section titled “pool?”](#pool)
> `optional` **pool?**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:28
Expected Pool address; checked against what the addresses provider reports. Presets fill it; required with a custom `addressesProvider`.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:32
RPC url(s) or EIP-1193 provider(s) to read the chain through. Defaults to the account’s own.
***
### referralCode?
[Section titled “referralCode?”](#referralcode)
> `optional` **referralCode?**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:34
Aave referral code (inactive on every market today — 0).
***
### reserveTtlMs?
[Section titled “reserveTtlMs?”](#reservettlms)
> `optional` **reserveTtlMs?**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:44
Cache lifetime for the reserve list (default 30 000 ms).
***
### usePermit?
[Section titled “usePermit?”](#usepermit)
> `optional` **usePermit?**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:36
Use `supplyWithPermit` / `repayWithPermit` when the token and the account support EIP-2612 (default true).
***
### waitTimeoutMs?
[Section titled “waitTimeoutMs?”](#waittimeoutms)
> `optional` **waitTimeoutMs?**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:40
How long to wait for an approval to be mined before the main transaction (default 180 000 ms).
***
### wethGateway?
[Section titled “wethGateway?”](#wethgateway)
> `optional` **wethGateway?**: `string` | `null`
Defined in: protocol-lending-aave-evm/src/protocol.ts:30
WrappedTokenGatewayV3 for native-coin legs. `null` disables native support; presets fill it.
# AaveRepayOptions
Defined in: protocol-lending-aave-evm/src/protocol.ts:53
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`RepayOptions`, `"amount"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/amountoption/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:54
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:639
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.onBehalfOf`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:637
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.token`
***
### withATokens?
[Section titled “withATokens?”](#withatokens)
> `optional` **withATokens?**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:56
Burn aTokens of the same asset instead of pulling the underlying (`repayWithATokens`).
# AaveSupplyOptions
Defined in: protocol-lending-aave-evm/src/protocol.ts:50
## Extends
[Section titled “Extends”](#extends)
* `SupplyOptions`
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:620
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SupplyOptions.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:621
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SupplyOptions.onBehalfOf`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:50
#### Overrides
[Section titled “Overrides”](#overrides)
`SupplyOptions.token`
# AaveWithdrawOptions
Defined in: protocol-lending-aave-evm/src/protocol.ts:51
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`WithdrawOptions`, `"amount"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-aave-evm/type-aliases/amountoption/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:51
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:627
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.to`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:625
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.token`
# AccountData
Defined in: protocol-lending-aave-evm/src/protocol.ts:75
## Properties
[Section titled “Properties”](#properties)
### availableBorrowsBase
[Section titled “availableBorrowsBase”](#availableborrowsbase)
> **availableBorrowsBase**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:79
***
### currentLiquidationThreshold
[Section titled “currentLiquidationThreshold”](#currentliquidationthreshold)
> **currentLiquidationThreshold**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:81
Fractions: 0.8 = 80 %.
***
### healthFactor
[Section titled “healthFactor”](#healthfactor)
> **healthFactor**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:86
1.0 = liquidation line; Infinity without debt.
***
### healthFactorWad
[Section titled “healthFactorWad”](#healthfactorwad)
> **healthFactorWad**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:84
WAD; uint256.max without debt.
***
### ltv
[Section titled “ltv”](#ltv)
> **ltv**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:82
***
### totalCollateralBase
[Section titled “totalCollateralBase”](#totalcollateralbase)
> **totalCollateralBase**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:77
In base currency units (see MarketInfo.baseCurrencyUnit).
***
### totalDebtBase
[Section titled “totalDebtBase”](#totaldebtbase)
> **totalDebtBase**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:78
# ActivityMarket
Defined in: protocol-lending-aave-evm/src/activity.ts:62
A market as the recognizer needs it: Pool, optional gateway, display name.
## Properties
[Section titled “Properties”](#properties)
### chainName
[Section titled “chainName”](#chainname)
> **chainName**: `string`
Defined in: protocol-lending-aave-evm/src/activity.ts:66
Human chain label for the subtitle (“Base”, “Ethereum Lido”).
***
### pool
[Section titled “pool”](#pool)
> **pool**: `string`
Defined in: protocol-lending-aave-evm/src/activity.ts:63
***
### wethGateway?
[Section titled “wethGateway?”](#wethgateway)
> `optional` **wethGateway?**: `string`
Defined in: protocol-lending-aave-evm/src/activity.ts:64
# BorrowPlan
Defined in: protocol-lending-aave-evm/src/protocol.ts:97
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:97
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:97
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: [`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:97
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:97
# MarketInfo
Defined in: protocol-lending-aave-evm/src/protocol.ts:61
## Properties
[Section titled “Properties”](#properties)
### addressesProvider
[Section titled “addressesProvider”](#addressesprovider)
> **addressesProvider**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:64
***
### baseCurrencyUnit
[Section titled “baseCurrencyUnit”](#basecurrencyunit)
> **baseCurrencyUnit**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:69
Price decimals of the oracle (1e8 → USD with 8 decimals on every Aave market today).
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-aave-evm/src/protocol.ts:62
***
### dataProvider
[Section titled “dataProvider”](#dataprovider)
> **dataProvider**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:67
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-aave-evm/src/protocol.ts:63
***
### oracle
[Section titled “oracle”](#oracle)
> **oracle**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:66
***
### pool
[Section titled “pool”](#pool)
> **pool**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:65
***
### wethGateway
[Section titled “wethGateway”](#wethgateway)
> **wethGateway**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-aave-evm/src/protocol.ts:70
***
### wrappedNative
[Section titled “wrappedNative”](#wrappednative)
> **wrappedNative**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-aave-evm/src/protocol.ts:72
The wrapped native token the gateway supplies (WETH, WMATIC, WAVAX, …); null without a gateway.
# Position
Defined in: protocol-lending-aave-evm/src/protocol.ts:89
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: [`AccountData`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/accountdata/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:90
***
### borrows
[Section titled “borrows”](#borrows)
> **borrows**: `object`\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:92
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
#### token
[Section titled “token”](#token)
> **token**: `` `0x${string}` ``
#### variableDebtToken
[Section titled “variableDebtToken”](#variabledebttoken)
> **variableDebtToken**: `` `0x${string}` ``
***
### supplies
[Section titled “supplies”](#supplies)
> **supplies**: `object`\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:91
#### amount
[Section titled “amount”](#amount-1)
> **amount**: `bigint`
#### aToken
[Section titled “aToken”](#atoken)
> **aToken**: `` `0x${string}` ``
#### collateral
[Section titled “collateral”](#collateral)
> **collateral**: `boolean`
#### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number`
#### symbol
[Section titled “symbol”](#symbol-1)
> **symbol**: `string`
#### token
[Section titled “token”](#token-1)
> **token**: `` `0x${string}` ``
# RepayPlan
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
## Properties
[Section titled “Properties”](#properties)
### all
[Section titled “all”](#all)
> **all**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### debt
[Section titled “debt”](#debt)
> **debt**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### permit
[Section titled “permit”](#permit)
> **permit**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: [`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
***
### withATokens
[Section titled “withATokens”](#withatokens)
> **withATokens**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:98
# ReserveConfiguration
Defined in: protocol-lending-aave-evm/src/reserve.ts:13
## Extended by
[Section titled “Extended by”](#extended-by)
* [`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
## Properties
[Section titled “Properties”](#properties)
### active
[Section titled “active”](#active)
> **active**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:20
***
### borrowableInIsolation
[Section titled “borrowableInIsolation”](#borrowableinisolation)
> **borrowableInIsolation**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:24
***
### borrowCap
[Section titled “borrowCap”](#borrowcap)
> **borrowCap**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:29
Whole tokens; 0 = no cap.
***
### borrowingEnabled
[Section titled “borrowingEnabled”](#borrowingenabled)
> **borrowingEnabled**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:22
***
### debtCeiling
[Section titled “debtCeiling”](#debtceiling)
> **debtCeiling**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:33
Isolation-mode debt ceiling in base currency with 2 decimals; 0 = not isolated.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:19
***
### flashloanEnabled
[Section titled “flashloanEnabled”](#flashloanenabled)
> **flashloanEnabled**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:26
***
### frozen
[Section titled “frozen”](#frozen)
> **frozen**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:21
***
### liquidationBonus
[Section titled “liquidationBonus”](#liquidationbonus)
> **liquidationBonus**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:18
Bonus the liquidator receives, as a fraction over 1 (0.05 = 5 %).
***
### liquidationProtocolFee
[Section titled “liquidationProtocolFee”](#liquidationprotocolfee)
> **liquidationProtocolFee**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:31
***
### liquidationThreshold
[Section titled “liquidationThreshold”](#liquidationthreshold)
> **liquidationThreshold**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:16
***
### ltv
[Section titled “ltv”](#ltv)
> **ltv**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:15
Loan-to-value as a fraction (0.75 = 75 %). 0 means the asset cannot be collateral.
***
### paused
[Section titled “paused”](#paused)
> **paused**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:23
***
### reserveFactor
[Section titled “reserveFactor”](#reservefactor)
> **reserveFactor**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:27
***
### siloedBorrowing
[Section titled “siloedBorrowing”](#siloedborrowing)
> **siloedBorrowing**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:25
***
### supplyCap
[Section titled “supplyCap”](#supplycap)
> **supplyCap**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:30
# ReserveInfo
Defined in: protocol-lending-aave-evm/src/reserve.ts:81
## Extends
[Section titled “Extends”](#extends)
* [`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/)
## Properties
[Section titled “Properties”](#properties)
### accruedToTreasury
[Section titled “accruedToTreasury”](#accruedtotreasury)
> **accruedToTreasury**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:93
***
### active
[Section titled “active”](#active)
> **active**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:20
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`active`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#active)
***
### asset
[Section titled “asset”](#asset)
> **asset**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/reserve.ts:82
***
### aToken
[Section titled “aToken”](#atoken)
> **aToken**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/reserve.ts:85
***
### borrowableInIsolation
[Section titled “borrowableInIsolation”](#borrowableinisolation)
> **borrowableInIsolation**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:24
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`borrowableInIsolation`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#borrowableinisolation)
***
### borrowApr
[Section titled “borrowApr”](#borrowapr)
> **borrowApr**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:97
***
### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:98
***
### borrowCap
[Section titled “borrowCap”](#borrowcap)
> **borrowCap**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:29
Whole tokens; 0 = no cap.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`borrowCap`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#borrowcap)
***
### borrowingEnabled
[Section titled “borrowingEnabled”](#borrowingenabled)
> **borrowingEnabled**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:22
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`borrowingEnabled`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#borrowingenabled)
***
### debtCeiling
[Section titled “debtCeiling”](#debtceiling)
> **debtCeiling**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:33
Isolation-mode debt ceiling in base currency with 2 decimals; 0 = not isolated.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`debtCeiling`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#debtceiling)
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:19
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`decimals`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#decimals)
***
### flashloanEnabled
[Section titled “flashloanEnabled”](#flashloanenabled)
> **flashloanEnabled**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:26
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`flashloanEnabled`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#flashloanenabled)
***
### frozen
[Section titled “frozen”](#frozen)
> **frozen**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:21
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`frozen`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#frozen)
***
### id
[Section titled “id”](#id)
> **id**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:84
***
### isolationModeTotalDebt
[Section titled “isolationModeTotalDebt”](#isolationmodetotaldebt)
> **isolationModeTotalDebt**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:94
***
### lastUpdateTimestamp
[Section titled “lastUpdateTimestamp”](#lastupdatetimestamp)
> **lastUpdateTimestamp**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:92
***
### liquidationBonus
[Section titled “liquidationBonus”](#liquidationbonus)
> **liquidationBonus**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:18
Bonus the liquidator receives, as a fraction over 1 (0.05 = 5 %).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`liquidationBonus`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#liquidationbonus)
***
### liquidationProtocolFee
[Section titled “liquidationProtocolFee”](#liquidationprotocolfee)
> **liquidationProtocolFee**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:31
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`liquidationProtocolFee`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#liquidationprotocolfee)
***
### liquidationThreshold
[Section titled “liquidationThreshold”](#liquidationthreshold)
> **liquidationThreshold**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`liquidationThreshold`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#liquidationthreshold)
***
### liquidityIndex
[Section titled “liquidityIndex”](#liquidityindex)
> **liquidityIndex**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:90
***
### liquidityRate
[Section titled “liquidityRate”](#liquidityrate)
> **liquidityRate**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:88
Ray (1e27).
***
### ltv
[Section titled “ltv”](#ltv)
> **ltv**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:15
Loan-to-value as a fraction (0.75 = 75 %). 0 means the asset cannot be collateral.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`ltv`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#ltv)
***
### paused
[Section titled “paused”](#paused)
> **paused**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:23
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`paused`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#paused)
***
### reserveFactor
[Section titled “reserveFactor”](#reservefactor)
> **reserveFactor**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:27
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`reserveFactor`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#reservefactor)
***
### siloedBorrowing
[Section titled “siloedBorrowing”](#siloedborrowing)
> **siloedBorrowing**: `boolean`
Defined in: protocol-lending-aave-evm/src/reserve.ts:25
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`siloedBorrowing`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#siloedborrowing)
***
### supplyApr
[Section titled “supplyApr”](#supplyapr)
> **supplyApr**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:95
***
### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number`
Defined in: protocol-lending-aave-evm/src/reserve.ts:96
***
### supplyCap
[Section titled “supplyCap”](#supplycap)
> **supplyCap**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:30
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`ReserveConfiguration`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/).[`supplyCap`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveconfiguration/#supplycap)
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: protocol-lending-aave-evm/src/reserve.ts:83
***
### variableBorrowIndex
[Section titled “variableBorrowIndex”](#variableborrowindex)
> **variableBorrowIndex**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:91
***
### variableBorrowRate
[Section titled “variableBorrowRate”](#variableborrowrate)
> **variableBorrowRate**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:89
***
### variableDebtToken
[Section titled “variableDebtToken”](#variabledebttoken)
> **variableDebtToken**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/reserve.ts:86
# SupplyPlan
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
***
### permit
[Section titled “permit”](#permit)
> **permit**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: [`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:95
# Tx
Defined in: protocol-lending-aave-evm/src/protocol.ts:59
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:59
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:59
***
### to
[Section titled “to”](#to)
> **to**: `` `0x${string}` ``
Defined in: protocol-lending-aave-evm/src/protocol.ts:59
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:59
# WithdrawPlan
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
## Properties
[Section titled “Properties”](#properties)
### all
[Section titled “all”](#all)
> **all**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
***
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)\[]
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: [`ReserveInfo`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/reserveinfo/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`Tx`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/tx/)
Defined in: protocol-lending-aave-evm/src/protocol.ts:96
# AaveLendingResult
> **AaveLendingResult** = `LendingResult` & `object`
Defined in: protocol-lending-aave-evm/src/protocol.ts:100
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### approveHashes
[Section titled “approveHashes”](#approvehashes)
> **approveHashes**: `string`\[]
### permit?
[Section titled “permit?”](#permit)
> `optional` **permit?**: `boolean`
# AmountOption
> **AmountOption** = `bigint` | `number` | `"max"`
Defined in: protocol-lending-aave-evm/src/protocol.ts:48
Amount in base units, or ‘max’ for the whole position / whole debt.
# EvmProvider
> **EvmProvider** = `string` | `EIP1193Provider`
Defined in: protocol-lending-aave-evm/src/protocol.ts:18
# AAVE_CHAINS
> `const` **AAVE_CHAINS**: readonly `string`\[]
Defined in: protocol-lending-aave-evm/src/markets.ts:57
CAIP-2 ids of every chain with a known market (for module.json / capability checks).
# AAVE_CUSTOM_ERRORS
> `const` **AAVE_CUSTOM_ERRORS**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-lending-aave-evm/src/errors.ts:60
Custom errors of Errors.sol in Aave v3.4+ (name → message).
# AAVE_ERROR_CODES
> `const` **AAVE_ERROR_CODES**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-lending-aave-evm/src/errors.ts:18
Numeric codes of Errors.sol in Aave v3.0–3.3 (the user-facing ones).
# AAVE_MARKETS
> `const` **AAVE_MARKETS**: `Readonly`<`Record`<`number`, `Readonly`<`Record`<`string`, [`AaveMarket`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aavemarket/)>>>>
Defined in: protocol-lending-aave-evm/src/markets.ts:26
chainId → preset key → market.
# ADDRESSES_PROVIDER_ABI
> `const` **ADDRESSES_PROVIDER_ABI**: readonly \[{ }, { }, { }, { }]
Defined in: protocol-lending-aave-evm/src/abi.ts:27
# GATEWAY_ABI
> `const` **GATEWAY_ABI**: readonly \[{ }, { }, { }, { }, { }]
Defined in: protocol-lending-aave-evm/src/abi.ts:46
WrappedTokenGatewayV3 as deployed with Aave v3.2+ (verified ABI of the Ethereum gateway 0xd016…5722): `borrowETH` and `repayETH` no longer take an interest-rate mode — the protocol docs still show the older signatures. The first `address` argument of every method is unused (kept for ABI compat).
# GATEWAY_ACTIONS
> `const` **GATEWAY_ACTIONS**: `Readonly`<`Record`<`string`, [`AaveActivityAction`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveactivityaction/)>>
Defined in: protocol-lending-aave-evm/src/activity.ts:47
WrappedTokenGatewayV3 (v3.2+ signatures, see abi.ts).
# MODULE_NAME
> `const` **MODULE_NAME**: `"@anywalletkit/protocol-lending-aave-evm"` = `'@anywalletkit/protocol-lending-aave-evm'`
Defined in: protocol-lending-aave-evm/src/activity.ts:19
Registry name, as `module.json` carries it.
# ORACLE_ABI
> `const` **ORACLE_ABI**: readonly \[{ }, { }, { }]
Defined in: protocol-lending-aave-evm/src/abi.ts:34
# POOL_ABI
> `const` **POOL_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-lending-aave-evm/src/abi.ts:7
# POOL_ACTIONS
> `const` **POOL_ACTIONS**: `Readonly`<`Record`<`string`, [`AaveActivityAction`](/api/anywalletkit/protocol-lending-aave-evm/interfaces/aaveactivityaction/)>>
Defined in: protocol-lending-aave-evm/src/activity.ts:33
IPool (aave-v3-origin). Every method takes `address asset` as its first argument.
# RAY
> `const` **RAY**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:7
# SECONDS_PER_YEAR
> `const` **SECONDS_PER_YEAR**: `31536000` = `31_536_000`
Defined in: protocol-lending-aave-evm/src/reserve.ts:9
# VARIABLE_DEBT_ABI
> `const` **VARIABLE_DEBT_ABI**: readonly \[{ }, { }, { }, { }]
Defined in: protocol-lending-aave-evm/src/abi.ts:64
Variable debt tokens: credit delegation the gateway needs to borrow native on your behalf.
# VARIABLE_RATE_MODE
> `const` **VARIABLE_RATE_MODE**: `2n` = `2n`
Defined in: protocol-lending-aave-evm/src/abi.ts:72
Aave v3 borrows at the variable rate only (stable mode was removed in 3.2).
# WAD
> `const` **WAD**: `bigint`
Defined in: protocol-lending-aave-evm/src/reserve.ts:8
# @anywalletkit/protocol-lending-kamino-solana
# @anywalletkit/protocol-lending-kamino-solana
[Section titled “@anywalletkit/protocol-lending-kamino-solana”](#anywalletkitprotocol-lending-kamino-solana)
[](https://www.npmjs.com/package/@anywalletkit/protocol-lending-kamino-solana)
[Kamino](https://kamino.com/docs) for `@anywalletkit/wallet-solana` accounts, two `LendingProtocol`s in one package:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-lending-kamino-solana @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-lending-kamino-solana @anywalletkit/core · yarn add @anywalletkit/protocol-lending-kamino-solana @anywalletkit/core
```
On npm: [@anywalletkit/protocol-lending-kamino-solana](https://www.npmjs.com/package/@anywalletkit/protocol-lending-kamino-solana), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
* **`KaminoVaultProtocolSolana`** — one Kamino Earn vault (kVault): `supply` deposits the vault’s asset for shares (kept in the wallet, where the guard proves they arrive; `skipFarm: false` stakes them in the vault farm as the Kamino app does — the guard then pins the stake to this vault’s farm and the wallet’s farm state, but cannot count the shares), `withdraw` redeems shares for the asset. The simplest Earn product; `borrow` / `repay` reject.
* **`KaminoMarketProtocolSolana`** — one Kamino Lend market (the Main Market by default): `supply` / `withdraw` post and take collateral on the wallet’s obligation, `borrow` / `repay` take and return a reserve’s liquidity against it. Tokens are named by mint.
## How a transaction is trusted
[Section titled “How a transaction is trusted”](#how-a-transaction-is-trusted)
Kamino’s official API builds every transaction (`POST /ktx/…` — the same builder the Kamino app and SDK use: farms, lookup tables, obligation setup). The module never signs it as-is. The wallet’s serialized-transaction guard (`wallet-solana`’s `checkSerialized` / `sendSerialized`) proves it first:
1. every program it invokes is on the Kamino allowlist — Kamino Lend, kVault, Farms, the address-lookup-table program and the token / system / compute budget / memo programs, nothing else;
2. every instruction is one the operation takes (`marketRules` / `vaultRules`), with the accounts that decide where value goes pinned: the wallet, its vanilla obligation, the configured market or vault, the reserve and mint the call names, the wallet’s own token accounts, this vault’s farm. A deposit carries refreshes, set-up and the deposit; a withdrawal inside it, a borrow inside a repay, a token transfer, an `invest` or a reward harvest is refused (`unexpected-instruction`);
3. the compiled-transaction checks pass (this wallet is the fee payer, no foreign co-signers, no authority or delegate changes);
4. a simulation with post-state accounts shows exactly the balance changes the module declared: on a deposit the amount out and at most rent in SOL on top, on a withdrawal / borrow the asset in at the minimum (`slippageBps`, default 0.5 %) — a borrow at most what was asked — no other token account of ours touched.
Only after all four does the account sign. A first Lend deposit also pays the rent of the obligation, user metadata and a per-user lookup table (`firstDepositAllowanceLamports`, default 0.045 SOL); later ones only the usual `rentAllowanceLamports` (0.01 SOL). Whether it is a first deposit is read from the chain (does the vanilla obligation’s account exist).
The bounds come from the chain, read through the account (`getAccountInfos`, `@anywalletkit/wallet-solana` 0.4+): a vault’s share price from its state and the reserves it invests in, the wallet’s shares from its shares account and farm stake, a Lend ‘max’ from the obligation (debt with the reserve’s accrued interest), and the reserve the API names must be this market’s and lend that token. An API figure that disagrees — a `tokensPerShare` more than 1 % off, a reported deposit or debt that is not the obligation’s, any negative figure — is refused, never used. Reads (`getVault`, `getPosition`, APY, TVL) stay the API’s; mint decimals are read when the account has an RPC, else taken from a table of Kamino’s listed mints.
## Usage
[Section titled “Usage”](#usage)
```ts
import WalletManagerSolana from '@anywalletkit/wallet-solana'
import { KaminoApi, KaminoVaultProtocolSolana, KaminoMarketProtocolSolana } from '@anywalletkit/protocol-lending-kamino-solana'
const account = await new WalletManagerSolana(seed, { provider: 'https://…' }).getAccount(0)
const USDC = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
// Discovery: the USDC Earn vaults, biggest first
const api = new KaminoApi()
const vaults = (await api.listVaults()).filter((v) => v.tokenMint === USDC).sort((a, b) => Number(b.sharesIssued - a.sharesIssued))
// Earn vault
// `asset`: the API's answer must name it, and deposits need it (or a `token` per call). The vault's
// address, program and shares mint (the PDA ["shares", vault]) are checked too, before anything is built.
const vault = new KaminoVaultProtocolSolana(account, { vault: vaults[0].address, asset: USDC })
await vault.getVault() // asset, shares, APY (net, %), fees, TVL, minimums, allocations
await vault.quoteSupply({ amount: 5_000_000n }) // { fee, expectedShares } — built, proven, not signed
await vault.supply({ amount: 5_000_000n }) // { hash, fee }
await vault.getPosition() // { shares, stakedShares, unstakedShares, assets }
await vault.withdraw({ amount: 'max' }) // every share → asset, min = assets × (1 − slippage)
// Lend market
const market = new KaminoMarketProtocolSolana(account) // Main Market
await market.getReserves() // symbol, mint, supply / borrow APY (%), max LTV, TVL, utilization
await market.supply({ token: USDC, amount: 5_000_000n }) // collateral on the wallet's obligation
await market.borrow({ token: USDC, amount: 1_000_000n })
await market.getPosition() // { obligations, supplied: {mint: units}, borrowed }
await market.repay({ token: USDC, amount: 'max' })
await market.withdraw({ token: USDC, amount: 'max' })
```
A mint with several reserves in a market (the Main Market has four USDC reserves) resolves to the deepest one by supplied value; pin another with `reserves: { [mint]: reserveAddress }`.
## Config
[Section titled “Config”](#config)
| option | default | |
| ------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `api` | `https://api.kamino.finance` | endpoint or a `KaminoApi` |
| `slippageBps` | 50 | floor on what the wallet must receive (withdraw, borrow); ceiling on a repay |
| `rentAllowanceLamports` | 0.01 SOL | SOL a transaction may spend beyond the amount |
| `memo` | — | SPL memo the API adds |
| vault: `vault`, `asset`, `skipFarm` | — / — / true | the kVault; the asset it must take; keep shares in the wallet (`false`: stake them in this vault’s farm; the guard then proves the spend and pins the stake to the wallet’s farm state) |
| market: `market`, `reserves`, `firstDepositAllowanceLamports` | Main Market / — / 0.045 SOL | |
## Verify
[Section titled “Verify”](#verify)
`pnpm test` (fixtures copied from live API responses). `pnpm verify:live [address]` reads markets, reserves and vaults from the API, then builds a vault deposit and a Lend deposit for the address and runs both through the guard as a read-only account (no keys, no writes).
Program ids: Kamino Lend `KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD`, kVault `KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd`, Farms `FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr`. `instructionName()` names the Anchor instructions the API’s transactions carry, for review screens; `decodeVault` / `decodeReserve` / `decodeObligation` / `decodeFarmUser` read the accounts the bounds come from, and `vaultTokensPerShareWad` / `debtNow` compute from them what the module does.
## Classes
[Section titled “Classes”](#classes)
* [KaminoApi](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
* [KaminoBase](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/)
* [KaminoError](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoerror/)
* [KaminoMarketProtocolSolana](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminomarketprotocolsolana/)
* [KaminoVaultProtocolSolana](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminovaultprotocolsolana/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ApiLoanLeg](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiloanleg/)
* [ApiMarket](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/)
* [ApiObligation](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiobligation/)
* [ApiReserve](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/)
* [ApiVault](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)
* [ApiVaultAllocation](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultallocation/)
* [ApiVaultMetrics](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultmetrics/)
* [ApiVaultPosition](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultposition/)
* [ChainAccount](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/)
* [Expectation](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
* [InstructionRule](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)
* [KaminoBaseConfig](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/)
* [KaminoMarketConfig](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketconfig/)
* [KaminoMarketRepayOptions](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketrepayoptions/)
* [KaminoMarketWithdrawOptions](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketwithdrawoptions/)
* [KaminoVaultConfig](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultconfig/)
* [KaminoVaultSupplyOptions](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultsupplyoptions/)
* [KaminoVaultWithdrawOptions](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultwithdrawoptions/)
* [KtxLend](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxlend/)
* [KtxVaultDeposit](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxvaultdeposit/)
* [KtxVaultWithdraw](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxvaultwithdraw/)
* [MarketInfo](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketinfo/)
* [MarketPosition](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketposition/)
* [MarketQuote](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)
* [MarketRuleAccounts](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketruleaccounts/)
* [ObligationChain](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/obligationchain/)
* [ReserveChain](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)
* [ReserveInfo](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)
* [SerializedGuard](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
* [SolanaAccountSurface](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
* [VaultChain](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultchain/)
* [VaultInfo](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultinfo/)
* [VaultPosition](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultposition/)
* [VaultRuleAccounts](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultruleaccounts/)
* [VaultSupplyQuote](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultsupplyquote/)
* [VaultWithdrawQuote](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultwithdrawquote/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [AmountOption](/api/anywalletkit/protocol-lending-kamino-solana/type-aliases/amountoption/)
## Variables
[Section titled “Variables”](#variables)
* [ADDRESS_LOOKUP_TABLE_PROGRAM](/api/anywalletkit/protocol-lending-kamino-solana/variables/address_lookup_table_program/)
* [CHAIN_TOLERANCE_BPS](/api/anywalletkit/protocol-lending-kamino-solana/variables/chain_tolerance_bps/)
* [DEFAULT_FIRST_DEPOSIT_ALLOWANCE](/api/anywalletkit/protocol-lending-kamino-solana/variables/default_first_deposit_allowance/)
* [DEFAULT_RENT_ALLOWANCE](/api/anywalletkit/protocol-lending-kamino-solana/variables/default_rent_allowance/)
* [FARMS_PROGRAM](/api/anywalletkit/protocol-lending-kamino-solana/variables/farms_program/)
* [INSTRUCTION_NAMES](/api/anywalletkit/protocol-lending-kamino-solana/variables/instruction_names/)
* [IX](/api/anywalletkit/protocol-lending-kamino-solana/variables/ix/)
* [KAMINO_API](/api/anywalletkit/protocol-lending-kamino-solana/variables/kamino_api/)
* [KAMINO_PROGRAM_ALLOWLIST](/api/anywalletkit/protocol-lending-kamino-solana/variables/kamino_program_allowlist/)
* [KLEND_PROGRAM](/api/anywalletkit/protocol-lending-kamino-solana/variables/klend_program/)
* [KNOWN_DECIMALS](/api/anywalletkit/protocol-lending-kamino-solana/variables/known_decimals/)
* [KVAULT_PROGRAM](/api/anywalletkit/protocol-lending-kamino-solana/variables/kvault_program/)
* [MAIN_MARKET](/api/anywalletkit/protocol-lending-kamino-solana/variables/main_market/)
* [MEMO_PROGRAM](/api/anywalletkit/protocol-lending-kamino-solana/variables/memo_program/)
* [SOLANA_MAINNET](/api/anywalletkit/protocol-lending-kamino-solana/variables/solana_mainnet/)
* [WAD](/api/anywalletkit/protocol-lending-kamino-solana/variables/wad/)
* [~~WITHDRAW_ALL~~](/api/anywalletkit/protocol-lending-kamino-solana/variables/withdraw_all/)
* [WSOL_MINT](/api/anywalletkit/protocol-lending-kamino-solana/variables/wsol_mint/)
## Functions
[Section titled “Functions”](#functions)
* [associatedTokenAddress](/api/anywalletkit/protocol-lending-kamino-solana/functions/associatedtokenaddress/)
* [debtNow](/api/anywalletkit/protocol-lending-kamino-solana/functions/debtnow/)
* [decodeFarmUser](/api/anywalletkit/protocol-lending-kamino-solana/functions/decodefarmuser/)
* [decodeObligation](/api/anywalletkit/protocol-lending-kamino-solana/functions/decodeobligation/)
* [decodeReserve](/api/anywalletkit/protocol-lending-kamino-solana/functions/decodereserve/)
* [decodeVault](/api/anywalletkit/protocol-lending-kamino-solana/functions/decodevault/)
* [depositedLiquidity](/api/anywalletkit/protocol-lending-kamino-solana/functions/depositedliquidity/)
* [divWadUp](/api/anywalletkit/protocol-lending-kamino-solana/functions/divwadup/)
* [farmUserState](/api/anywalletkit/protocol-lending-kamino-solana/functions/farmuserstate/)
* [findProgramAddress](/api/anywalletkit/protocol-lending-kamino-solana/functions/findprogramaddress/)
* [fromDecimalString](/api/anywalletkit/protocol-lending-kamino-solana/functions/fromdecimalstring/)
* [instructionName](/api/anywalletkit/protocol-lending-kamino-solana/functions/instructionname/)
* [lessBps](/api/anywalletkit/protocol-lending-kamino-solana/functions/lessbps/)
* [marketRules](/api/anywalletkit/protocol-lending-kamino-solana/functions/marketrules/)
* [mulWad](/api/anywalletkit/protocol-lending-kamino-solana/functions/mulwad/)
* [plumbing](/api/anywalletkit/protocol-lending-kamino-solana/functions/plumbing/)
* [toAmount](/api/anywalletkit/protocol-lending-kamino-solana/functions/toamount/)
* [toDecimalString](/api/anywalletkit/protocol-lending-kamino-solana/functions/todecimalstring/)
* [toWad](/api/anywalletkit/protocol-lending-kamino-solana/functions/towad/)
* [vanillaObligation](/api/anywalletkit/protocol-lending-kamino-solana/functions/vanillaobligation/)
* [vaultRules](/api/anywalletkit/protocol-lending-kamino-solana/functions/vaultrules/)
* [vaultSharesMint](/api/anywalletkit/protocol-lending-kamino-solana/functions/vaultsharesmint/)
* [vaultTokensPerShareWad](/api/anywalletkit/protocol-lending-kamino-solana/functions/vaulttokenspersharewad/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [KaminoVaultProtocolSolana](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminovaultprotocolsolana/)
# KaminoApi
Defined in: protocol-lending-kamino-solana/src/api.ts:112
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KaminoApi**(`endpoint?`, `fetchImpl?`, `timeoutMs?`): `KaminoApi`
Defined in: protocol-lending-kamino-solana/src/api.ts:114
`timeoutMs` bounds each call (default 15 s): a silent API must not hang a read or a write’s build.
#### Parameters
[Section titled “Parameters”](#parameters)
##### endpoint?
[Section titled “endpoint?”](#endpoint)
`string` = `KAMINO_API`
##### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
##### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number` = `15_000`
#### Returns
[Section titled “Returns”](#returns)
`KaminoApi`
## Methods
[Section titled “Methods”](#methods)
### buildLendBorrow()
[Section titled “buildLendBorrow()”](#buildlendborrow)
> **buildLendBorrow**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:251
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### p
[Section titled “p”](#p)
[`KtxLend`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxlend/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
***
### buildLendDeposit()
[Section titled “buildLendDeposit()”](#buildlenddeposit)
> **buildLendDeposit**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### p
[Section titled “p”](#p-1)
[`KtxLend`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxlend/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string`>
***
### buildLendRepay()
[Section titled “buildLendRepay()”](#buildlendrepay)
> **buildLendRepay**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:252
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### p
[Section titled “p”](#p-2)
[`KtxLend`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxlend/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`string`>
***
### buildLendWithdraw()
[Section titled “buildLendWithdraw()”](#buildlendwithdraw)
> **buildLendWithdraw**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:250
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### p
[Section titled “p”](#p-3)
[`KtxLend`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxlend/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`string`>
***
### buildVaultDeposit()
[Section titled “buildVaultDeposit()”](#buildvaultdeposit)
> **buildVaultDeposit**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:246
Base64 unsigned v0 transaction: deposit `amount` (decimal, token units) into an Earn vault.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### p
[Section titled “p”](#p-4)
[`KtxVaultDeposit`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxvaultdeposit/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`string`>
***
### buildVaultWithdraw()
[Section titled “buildVaultWithdraw()”](#buildvaultwithdraw)
> **buildVaultWithdraw**(`p`): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/api.ts:248
Base64 unsigned v0 transaction: redeem `amount` SHARES (decimal).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### p
[Section titled “p”](#p-5)
[`KtxVaultWithdraw`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/ktxvaultwithdraw/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`string`>
***
### getReserves()
[Section titled “getReserves()”](#getreserves)
> **getReserves**(`market`): `Promise`<[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/)\[]>
Defined in: protocol-lending-kamino-solana/src/api.ts:154
A market’s reserves with live rates.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### market
[Section titled “market”](#market)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/)\[]>
***
### getUserObligations()
[Section titled “getUserObligations()”](#getuserobligations)
> **getUserObligations**(`market`, `user`): `Promise`<[`ApiObligation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiobligation/)\[]>
Defined in: protocol-lending-kamino-solana/src/api.ts:231
The user’s obligations (loans) in a market.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### market
[Section titled “market”](#market-1)
`string`
##### user
[Section titled “user”](#user)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`ApiObligation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiobligation/)\[]>
***
### getVault()
[Section titled “getVault()”](#getvault)
> **getVault**(`vault`): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)>
Defined in: protocol-lending-kamino-solana/src/api.ts:186
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### vault
[Section titled “vault”](#vault)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)>
***
### getVaultMetrics()
[Section titled “getVaultMetrics()”](#getvaultmetrics)
> **getVaultMetrics**(`vault`): `Promise`<[`ApiVaultMetrics`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultmetrics/)>
Defined in: protocol-lending-kamino-solana/src/api.ts:190
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### vault
[Section titled “vault”](#vault-1)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`ApiVaultMetrics`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultmetrics/)>
***
### getVaultPosition()
[Section titled “getVaultPosition()”](#getvaultposition)
> **getVaultPosition**(`user`, `vault`): `Promise`<[`ApiVaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultposition/)>
Defined in: protocol-lending-kamino-solana/src/api.ts:201
The user’s shares in one vault; a user the vault has never seen is a zero position.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### user
[Section titled “user”](#user-1)
`string`
##### vault
[Section titled “vault”](#vault-2)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`ApiVaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultposition/)>
***
### listMarkets()
[Section titled “listMarkets()”](#listmarkets)
> **listMarkets**(): `Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/)\[]>
Defined in: protocol-lending-kamino-solana/src/api.ts:145
Every Kamino Lend market (Main Market first).
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/)\[]>
***
### listVaultPositions()
[Section titled “listVaultPositions()”](#listvaultpositions)
> **listVaultPositions**(`user`): `Promise`<[`ApiVaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultposition/)\[]>
Defined in: protocol-lending-kamino-solana/src/api.ts:211
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### user
[Section titled “user”](#user-2)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`ApiVaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultposition/)\[]>
***
### listVaults()
[Section titled “listVaults()”](#listvaults)
> **listVaults**(): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)\[]>
Defined in: protocol-lending-kamino-solana/src/api.ts:181
Every Earn vault (kVault) on the mainnet program.
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)\[]>
# KaminoBase
Defined in: protocol-lending-kamino-solana/src/base.ts:71
## Extends
[Section titled “Extends”](#extends)
* `LendingProtocol`<`TConfig`>
## Extended by
[Section titled “Extended by”](#extended-by)
* [`KaminoVaultProtocolSolana`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminovaultprotocolsolana/)
* [`KaminoMarketProtocolSolana`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminomarketprotocolsolana/)
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* [`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KaminoBase**<`TConfig`>(`account`, `config`): `KaminoBase`<`TConfig`>
Defined in: protocol-lending-kamino-solana/src/base.ts:77
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
`KaminoBase`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
`LendingProtocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`KaminoVaultProtocolSolana`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminovaultprotocolsolana/).[`_account`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminovaultprotocolsolana/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`LendingProtocol._config`
***
### api
[Section titled “api”](#api)
> `readonly` **api**: [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:72
***
### rentAllowance
[Section titled “rentAllowance”](#rentallowance)
> `protected` `readonly` **rentAllowance**: `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:74
***
### slippageBps
[Section titled “slippageBps”](#slippagebps)
> `protected` `readonly` **slippageBps**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:73
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`_o`): `Promise`<`LendingResult`>
Defined in: core/dist/index-QWdcwE6y.d.ts:681
Borrow against collateral.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o
[Section titled “\_o”](#_o)
`BorrowOptions`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`LendingResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`LendingProtocol.borrow`
***
### decimals()
[Section titled “decimals()”](#decimals)
> `protected` **decimals**(`mint`): `Promise`<`number`>
Defined in: protocol-lending-kamino-solana/src/base.ts:104
Mint decimals: the account reads the mint when it can; well-known mints need no RPC.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### mint
[Section titled “mint”](#mint)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`LendingProtocol.describeActivity`
***
### guard()
[Section titled “guard()”](#guard)
> `protected` **guard**(`expect`, `instructions`): [`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
Defined in: protocol-lending-kamino-solana/src/base.ts:121
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### expect
[Section titled “expect”](#expect)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-4)
[`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
***
### me()
[Section titled “me()”](#me)
> `protected` **me**(): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/base.ts:98
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`string`>
***
### memo()
[Section titled “memo()”](#memo)
> `protected` **memo**(): `string` | `undefined`
Defined in: protocol-lending-kamino-solana/src/base.ts:169
#### Returns
[Section titled “Returns”](#returns-6)
`string` | `undefined`
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`_o`): `Promise`<`LendingQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:682
Network fee of `borrow`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-1)
`BorrowOptions`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`LendingQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`LendingProtocol.quoteBorrow`
***
### quoteBuilt()
[Section titled “quoteBuilt()”](#quotebuilt)
> `protected` **quoteBuilt**(`base64`, `expect`, `instructions`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:153
Simulate the built transaction through the account’s guard and return its fee; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### base64
[Section titled “base64”](#base64)
`string`
##### expect
[Section titled “expect”](#expect-1)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-1)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<{ `fee`: `bigint`; }>
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`_o`): `Promise`<`LendingQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:684
Network fee of `repay`.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_o
[Section titled “\_o”](#_o-2)
`RepayOptions`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`LendingQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`LendingProtocol.quoteRepay`
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`_o`): `Promise`<`LendingQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:678
Network fee of `supply`.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### \_o
[Section titled “\_o”](#_o-3)
`SupplyOptions`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`LendingQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`LendingProtocol.quoteSupply`
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`_o`): `Promise`<`LendingQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:680
Network fee of `withdraw`.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### \_o
[Section titled “\_o”](#_o-4)
`WithdrawOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`LendingQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`LendingProtocol.quoteWithdraw`
***
### readChain()
[Section titled “readChain()”](#readchain)
> `protected` **readChain**(`addresses`): `Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
Defined in: protocol-lending-kamino-solana/src/base.ts:127
Accounts from the chain through the wallet’s RPC, in the order asked (null where none exists).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
***
### receiveExpectation()
[Section titled “receiveExpectation()”](#receiveexpectation)
> `protected` **receiveExpectation**(`mint`, `expected`, `extraLamports?`, `max?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:146
The wallet must receive at least `expected × (1 − slippage)` of `mint` (and at most `max`, when given); rent is the only SOL it may lose.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### mint
[Section titled “mint”](#mint-1)
`string`
##### expected
[Section titled “expected”](#expected)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports)
`bigint` = `0n`
##### max?
[Section titled “max?”](#max)
`bigint`
#### Returns
[Section titled “Returns”](#returns-13)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`_o`): `Promise`<`LendingResult`>
Defined in: core/dist/index-QWdcwE6y.d.ts:683
Repay a borrow.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### \_o
[Section titled “\_o”](#_o-5)
`RepayOptions`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`LendingResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`LendingProtocol.repay`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`LendingProtocol.requireSigningAccount`
***
### requireSolana()
[Section titled “requireSolana()”](#requiresolana)
> `protected` **requireSolana**(): `void`
Defined in: protocol-lending-kamino-solana/src/base.ts:89
Refuse anything that is not a mainnet Solana account before an API call is made in its name.
#### Returns
[Section titled “Returns”](#returns-16)
`void`
***
### sendBuilt()
[Section titled “sendBuilt()”](#sendbuilt)
> `protected` **sendBuilt**(`base64`, `expect`, `instructions`, `method`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:161
Guard, sign and broadcast the built transaction; the account refuses before signing if the proof fails.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### expect
[Section titled “expect”](#expect-2)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-2)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
##### method
[Section titled “method”](#method)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
***
### spendExpectation()
[Section titled “spendExpectation()”](#spendexpectation)
> `protected` **spendExpectation**(`mint`, `amount`, `extraLamports?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:136
The wallet sends `amount` of `mint` (SOL counts on the lamport side) and may lose rent on top.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### mint
[Section titled “mint”](#mint-2)
`string`
##### amount
[Section titled “amount”](#amount)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports-1)
`bigint` = `0n`
#### Returns
[Section titled “Returns”](#returns-18)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`_o`): `Promise`<`LendingResult`>
Defined in: core/dist/index-QWdcwE6y.d.ts:677
Deposit into the market or vault. Sends an approval first when needed.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### \_o
[Section titled “\_o”](#_o-6)
`SupplyOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`LendingResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`LendingProtocol.supply`
***
### surface()
[Section titled “surface()”](#surface)
> `protected` **surface**(): [`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
Defined in: protocol-lending-kamino-solana/src/base.ts:94
#### Returns
[Section titled “Returns”](#returns-20)
[`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`_o`): `Promise`<`LendingResult`>
Defined in: core/dist/index-QWdcwE6y.d.ts:679
Withdraw a deposit.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### \_o
[Section titled “\_o”](#_o-7)
`WithdrawOptions`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`LendingResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`LendingProtocol.withdraw`
# KaminoError
Defined in: protocol-lending-kamino-solana/src/errors.ts:2
A refusal or failure inside the Kamino module; `code` carries Kamino’s API error code when there is one.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KaminoError**(`message`, `code?`): `KaminoError`
Defined in: protocol-lending-kamino-solana/src/errors.ts:4
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
`string`
#### Returns
[Section titled “Returns”](#returns)
`KaminoError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `string` | `undefined`
Defined in: protocol-lending-kamino-solana/src/errors.ts:3
# KaminoMarketProtocolSolana
Defined in: protocol-lending-kamino-solana/src/market.ts:67
A Kamino Lend market as a `LendingProtocol`: `supply` deposits a reserve’s token as collateral on the wallet’s obligation, `withdraw` takes it back, `borrow` / `repay` take and return a reserve’s liquidity against it.
Tokens are named by mint. The first deposit creates the obligation (plus user metadata and a per-user lookup table) and costs their rent, which the guard allows once; every transaction is proven before signing: only the instructions the operation takes, on the wallet’s vanilla obligation, the resolved reserve and the wallet’s own token account. The reserve is checked on chain, and ‘max’ amounts and the first-deposit allowance come from the obligation’s on-chain state.
## Extends
[Section titled “Extends”](#extends)
* [`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/)<[`KaminoMarketConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KaminoMarketProtocolSolana**(`account`, `config?`): `KaminoMarketProtocolSolana`
Defined in: protocol-lending-kamino-solana/src/market.ts:72
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config?
[Section titled “config?”](#config)
[`KaminoMarketConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`KaminoMarketProtocolSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`constructor`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`_account`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`KaminoMarketConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`_config`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#_config)
***
### api
[Section titled “api”](#api)
> `readonly` **api**: [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:72
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`api`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#api)
***
### market
[Section titled “market”](#market)
> `readonly` **market**: `string`
Defined in: protocol-lending-kamino-solana/src/market.ts:68
***
### rentAllowance
[Section titled “rentAllowance”](#rentallowance)
> `protected` `readonly` **rentAllowance**: `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:74
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`rentAllowance`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#rentallowance)
***
### slippageBps
[Section titled “slippageBps”](#slippagebps)
> `protected` `readonly` **slippageBps**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:73
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`slippageBps`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#slippagebps)
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/market.ts:241
Borrow against collateral.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### o
[Section titled “o”](#o)
`BorrowOptions`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`borrow`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#borrow)
***
### decimals()
[Section titled “decimals()”](#decimals)
> `protected` **decimals**(`mint`): `Promise`<`number`>
Defined in: protocol-lending-kamino-solana/src/base.ts:104
Mint decimals: the account reads the mint when it can; well-known mints need no RPC.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### mint
[Section titled “mint”](#mint)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`decimals`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#decimals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`describeActivity`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#describeactivity)
***
### getMarket()
[Section titled “getMarket()”](#getmarket)
> **getMarket**(): `Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketinfo/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:91
The market’s config entry plus its reserves.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketinfo/)>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(): `Promise`<[`MarketPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketposition/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:115
Obligations and per-mint totals.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`MarketPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketposition/)>
***
### getReserves()
[Section titled “getReserves()”](#getreserves)
> **getReserves**(): `Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)\[]>
Defined in: protocol-lending-kamino-solana/src/market.ts:80
Reserves with rates, cached for a minute.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)\[]>
***
### guard()
[Section titled “guard()”](#guard)
> `protected` **guard**(`expect`, `instructions`): [`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
Defined in: protocol-lending-kamino-solana/src/base.ts:121
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### expect
[Section titled “expect”](#expect)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-7)
[`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`guard`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#guard)
***
### me()
[Section titled “me()”](#me)
> `protected` **me**(): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/base.ts:98
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`string`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`me`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#me)
***
### memo()
[Section titled “memo()”](#memo)
> `protected` **memo**(): `string` | `undefined`
Defined in: protocol-lending-kamino-solana/src/base.ts:169
#### Returns
[Section titled “Returns”](#returns-9)
`string` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`memo`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#memo)
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`o`): `Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:232
Network fee of `borrow`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### o
[Section titled “o”](#o-1)
`BorrowOptions`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteBorrow`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quoteborrow)
***
### quoteBuilt()
[Section titled “quoteBuilt()”](#quotebuilt)
> `protected` **quoteBuilt**(`base64`, `expect`, `instructions`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:153
Simulate the built transaction through the account’s guard and return its fee; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### base64
[Section titled “base64”](#base64)
`string`
##### expect
[Section titled “expect”](#expect-1)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-1)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `fee`: `bigint`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteBuilt`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotebuilt)
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`o`): `Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:254
Network fee of `repay`.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### o
[Section titled “o”](#o-2)
[`KaminoMarketRepayOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketrepayoptions/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteRepay`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quoterepay)
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`o`): `Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:194
Network fee of `supply`.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### o
[Section titled “o”](#o-3)
`SupplyOptions`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteSupply`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotesupply)
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`o`): `Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:210
Network fee of `withdraw`.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### o
[Section titled “o”](#o-4)
[`KaminoMarketWithdrawOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`MarketQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteWithdraw`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotewithdraw)
***
### readChain()
[Section titled “readChain()”](#readchain)
> `protected` **readChain**(`addresses`): `Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
Defined in: protocol-lending-kamino-solana/src/base.ts:127
Accounts from the chain through the wallet’s RPC, in the order asked (null where none exists).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`readChain`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#readchain)
***
### receiveExpectation()
[Section titled “receiveExpectation()”](#receiveexpectation)
> `protected` **receiveExpectation**(`mint`, `expected`, `extraLamports?`, `max?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:146
The wallet must receive at least `expected × (1 − slippage)` of `mint` (and at most `max`, when given); rent is the only SOL it may lose.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### mint
[Section titled “mint”](#mint-1)
`string`
##### expected
[Section titled “expected”](#expected)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports)
`bigint` = `0n`
##### max?
[Section titled “max?”](#max)
`bigint`
#### Returns
[Section titled “Returns”](#returns-16)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`receiveExpectation`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#receiveexpectation)
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/market.ts:262
Repay a borrow.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### o
[Section titled “o”](#o-5)
[`KaminoMarketRepayOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketrepayoptions/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`repay`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#repay)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`requireSigningAccount`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#requiresigningaccount)
***
### requireSolana()
[Section titled “requireSolana()”](#requiresolana)
> `protected` **requireSolana**(): `void`
Defined in: protocol-lending-kamino-solana/src/base.ts:89
Refuse anything that is not a mainnet Solana account before an API call is made in its name.
#### Returns
[Section titled “Returns”](#returns-19)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`requireSolana`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#requiresolana)
***
### resolveReserve()
[Section titled “resolveReserve()”](#resolvereserve)
> **resolveReserve**(`mint`): `Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)>
Defined in: protocol-lending-kamino-solana/src/market.ts:99
The reserve a mint maps to: the pinned one, else the deepest by supplied value.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### mint
[Section titled “mint”](#mint-2)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)>
***
### sendBuilt()
[Section titled “sendBuilt()”](#sendbuilt)
> `protected` **sendBuilt**(`base64`, `expect`, `instructions`, `method`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:161
Guard, sign and broadcast the built transaction; the account refuses before signing if the proof fails.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### expect
[Section titled “expect”](#expect-2)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-2)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
##### method
[Section titled “method”](#method)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`sendBuilt`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#sendbuilt)
***
### spendExpectation()
[Section titled “spendExpectation()”](#spendexpectation)
> `protected` **spendExpectation**(`mint`, `amount`, `extraLamports?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:136
The wallet sends `amount` of `mint` (SOL counts on the lamport side) and may lose rent on top.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### mint
[Section titled “mint”](#mint-3)
`string`
##### amount
[Section titled “amount”](#amount)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports-1)
`bigint` = `0n`
#### Returns
[Section titled “Returns”](#returns-22)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`spendExpectation`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#spendexpectation)
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/market.ts:202
Deposit into the market or vault. Sends an approval first when needed.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### o
[Section titled “o”](#o-6)
`SupplyOptions`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`supply`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#supply)
***
### surface()
[Section titled “surface()”](#surface)
> `protected` **surface**(): [`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
Defined in: protocol-lending-kamino-solana/src/base.ts:94
#### Returns
[Section titled “Returns”](#returns-24)
[`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`surface`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#surface)
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/market.ts:219
Withdraw a deposit.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### o
[Section titled “o”](#o-7)
[`KaminoMarketWithdrawOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`withdraw`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#withdraw)
# KaminoVaultProtocolSolana
Defined in: protocol-lending-kamino-solana/src/vault.ts:98
A Kamino Earn vault (kVault) as a `LendingProtocol`: `supply` deposits the vault’s asset for shares (kept in the wallet; staked in the vault farm with `skipFarm: false`), `withdraw` redeems shares for the asset; `borrow` / `repay` reject, a vault does not lend to its depositors.
The transaction comes from Kamino’s API and is signed only after the wallet’s guard proves it carries only the instructions the operation takes, on this vault and the wallet’s own accounts, and moves exactly the declared balances (the deposit out, the asset in at the minimum, no other token account touched). The bounds come from the chain: the share price from the vault’s state and its reserves, the position from the wallet’s shares account and farm stake; the API’s price must agree with it. Reads (`getVault`, `getPosition`, APY, TVL) are the API’s.
## Extends
[Section titled “Extends”](#extends)
* [`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/)<[`KaminoVaultConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new KaminoVaultProtocolSolana**(`account`, `config`): `KaminoVaultProtocolSolana`
Defined in: protocol-lending-kamino-solana/src/vault.ts:102
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
[`KaminoVaultConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultconfig/)
#### Returns
[Section titled “Returns”](#returns)
`KaminoVaultProtocolSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`constructor`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`_account`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`KaminoVaultConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`_config`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#_config)
***
### api
[Section titled “api”](#api)
> `readonly` **api**: [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:72
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`api`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#api)
***
### rentAllowance
[Section titled “rentAllowance”](#rentallowance)
> `protected` `readonly` **rentAllowance**: `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:74
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`rentAllowance`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#rentallowance)
***
### slippageBps
[Section titled “slippageBps”](#slippagebps)
> `protected` `readonly` **slippageBps**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:73
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`slippageBps`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#slippagebps)
***
### vault
[Section titled “vault”](#vault)
> `readonly` **vault**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:99
## Methods
[Section titled “Methods”](#methods)
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:310
Borrow against collateral.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`borrow`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#borrow)
***
### decimals()
[Section titled “decimals()”](#decimals)
> `protected` **decimals**(`mint`): `Promise`<`number`>
Defined in: protocol-lending-kamino-solana/src/base.ts:104
Mint decimals: the account reads the mint when it can; well-known mints need no RPC.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### mint
[Section titled “mint”](#mint)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`decimals`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#decimals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`describeActivity`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#describeactivity)
***
### getApy()
[Section titled “getApy()”](#getapy)
> **getApy**(): `Promise`<`number`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:164
Net APY in percent.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(): `Promise`<[`VaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultposition/)>
Defined in: protocol-lending-kamino-solana/src/vault.ts:169
Shares (wallet + farm) and what they are worth now.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`VaultPosition`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultposition/)>
***
### getVault()
[Section titled “getVault()”](#getvault)
> **getVault**(): `Promise`<[`VaultInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultinfo/)>
Defined in: protocol-lending-kamino-solana/src/vault.ts:158
The vault as the API describes it: asset, shares, rate, fees, TVL.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`VaultInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultinfo/)>
***
### guard()
[Section titled “guard()”](#guard)
> `protected` **guard**(`expect`, `instructions`): [`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
Defined in: protocol-lending-kamino-solana/src/base.ts:121
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### expect
[Section titled “expect”](#expect)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-7)
[`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`guard`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#guard)
***
### me()
[Section titled “me()”](#me)
> `protected` **me**(): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/base.ts:98
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`string`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`me`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#me)
***
### memo()
[Section titled “memo()”](#memo)
> `protected` **memo**(): `string` | `undefined`
Defined in: protocol-lending-kamino-solana/src/base.ts:169
#### Returns
[Section titled “Returns”](#returns-9)
`string` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`memo`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#memo)
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(): `Promise`<`LendingQuote`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:311
Network fee of `borrow`.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`LendingQuote`>
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteBorrow`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quoteborrow)
***
### quoteBuilt()
[Section titled “quoteBuilt()”](#quotebuilt)
> `protected` **quoteBuilt**(`base64`, `expect`, `instructions`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:153
Simulate the built transaction through the account’s guard and return its fee; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### base64
[Section titled “base64”](#base64)
`string`
##### expect
[Section titled “expect”](#expect-1)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-1)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `fee`: `bigint`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteBuilt`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotebuilt)
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(): `Promise`<`LendingQuote`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:313
Network fee of `repay`.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`LendingQuote`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteRepay`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quoterepay)
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`o`): `Promise`<[`VaultSupplyQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultsupplyquote/)>
Defined in: protocol-lending-kamino-solana/src/vault.ts:250
Network fee of `supply`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### o
[Section titled “o”](#o)
[`KaminoVaultSupplyOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`VaultSupplyQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultsupplyquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteSupply`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotesupply)
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`o`): `Promise`<[`VaultWithdrawQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultwithdrawquote/)>
Defined in: protocol-lending-kamino-solana/src/vault.ts:295
Network fee of `withdraw`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### o
[Section titled “o”](#o-1)
[`KaminoVaultWithdrawOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`VaultWithdrawQuote`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultwithdrawquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`quoteWithdraw`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#quotewithdraw)
***
### readChain()
[Section titled “readChain()”](#readchain)
> `protected` **readChain**(`addresses`): `Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
Defined in: protocol-lending-kamino-solana/src/base.ts:127
Accounts from the chain through the wallet’s RPC, in the order asked (null where none exists).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`readChain`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#readchain)
***
### receiveExpectation()
[Section titled “receiveExpectation()”](#receiveexpectation)
> `protected` **receiveExpectation**(`mint`, `expected`, `extraLamports?`, `max?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:146
The wallet must receive at least `expected × (1 − slippage)` of `mint` (and at most `max`, when given); rent is the only SOL it may lose.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### mint
[Section titled “mint”](#mint-1)
`string`
##### expected
[Section titled “expected”](#expected)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports)
`bigint` = `0n`
##### max?
[Section titled “max?”](#max)
`bigint`
#### Returns
[Section titled “Returns”](#returns-16)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`receiveExpectation`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#receiveexpectation)
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:312
Repay a borrow.
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`repay`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#repay)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`requireSigningAccount`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#requiresigningaccount)
***
### requireSolana()
[Section titled “requireSolana()”](#requiresolana)
> `protected` **requireSolana**(): `void`
Defined in: protocol-lending-kamino-solana/src/base.ts:89
Refuse anything that is not a mainnet Solana account before an API call is made in its name.
#### Returns
[Section titled “Returns”](#returns-19)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`requireSolana`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#requiresolana)
***
### sendBuilt()
[Section titled “sendBuilt()”](#sendbuilt)
> `protected` **sendBuilt**(`base64`, `expect`, `instructions`, `method`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:161
Guard, sign and broadcast the built transaction; the account refuses before signing if the proof fails.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### expect
[Section titled “expect”](#expect-2)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
##### instructions
[Section titled “instructions”](#instructions-2)
readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
##### method
[Section titled “method”](#method)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`sendBuilt`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#sendbuilt)
***
### spendExpectation()
[Section titled “spendExpectation()”](#spendexpectation)
> `protected` **spendExpectation**(`mint`, `amount`, `extraLamports?`): [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:136
The wallet sends `amount` of `mint` (SOL counts on the lamport side) and may lose rent on top.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### mint
[Section titled “mint”](#mint-2)
`string`
##### amount
[Section titled “amount”](#amount)
`bigint`
##### extraLamports?
[Section titled “extraLamports?”](#extralamports-1)
`bigint` = `0n`
#### Returns
[Section titled “Returns”](#returns-21)
[`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`spendExpectation`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#spendexpectation)
***
### state()
[Section titled “state()”](#state)
> `protected` **state**(): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)>
Defined in: protocol-lending-kamino-solana/src/vault.ts:119
The vault’s static state (cached per instance), checked against what the API cannot choose: it is this vault, on the kVault program, its shares mint is the one the program derives for it, and it takes the configured asset. Mint decimals come from the chain when the account can read them (round 3, H7: a changed `sharesMint` turned the withdraw guard into a pass for any token).
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivault/)>
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:257
Deposit into the market or vault. Sends an approval first when needed.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### o
[Section titled “o”](#o-2)
[`KaminoVaultSupplyOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`supply`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#supply)
***
### surface()
[Section titled “surface()”](#surface)
> `protected` **surface**(): [`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
Defined in: protocol-lending-kamino-solana/src/base.ts:94
#### Returns
[Section titled “Returns”](#returns-24)
[`SolanaAccountSurface`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/solanaaccountsurface/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`surface`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#surface)
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`o`): `Promise`<`LendingResult`>
Defined in: protocol-lending-kamino-solana/src/vault.ts:303
Withdraw a deposit.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### o
[Section titled “o”](#o-3)
[`KaminoVaultWithdrawOptions`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<`LendingResult`>
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`KaminoBase`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/).[`withdraw`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminobase/#withdraw)
# associatedTokenAddress
> **associatedTokenAddress**(`owner`, `mint`, `tokenProgram`): `string`
Defined in: protocol-lending-kamino-solana/src/pda.ts:39
The associated token account of `owner` for `mint` under a token program (classic Token or Token-2022).
## Parameters
[Section titled “Parameters”](#parameters)
### owner
[Section titled “owner”](#owner)
`string`
### mint
[Section titled “mint”](#mint)
`string`
### tokenProgram
[Section titled “tokenProgram”](#tokenprogram)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# debtNow
> **debtNow**(`o`, `r`, `reserve`): `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:143
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
[`ObligationChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/obligationchain/)
### r
[Section titled “r”](#r)
[`ReserveChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)
### reserve
[Section titled “reserve”](#reserve)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# decodeFarmUser
> **decodeFarmUser**(`address`, `acc`): `object`
Defined in: protocol-lending-kamino-solana/src/chain.ts:151
A farm `UserState`: whose it is, which farm, and the shares staked (base units).
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### acc
[Section titled “acc”](#acc)
[`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`
## Returns
[Section titled “Returns”](#returns)
`object`
### farm
[Section titled “farm”](#farm)
> **farm**: `string`
### owner
[Section titled “owner”](#owner)
> **owner**: `string`
### staked
[Section titled “staked”](#staked)
> **staked**: `bigint`
# decodeObligation
> **decodeObligation**(`address`, `acc`): [`ObligationChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/obligationchain/)
Defined in: protocol-lending-kamino-solana/src/chain.ts:122
A klend `Obligation`.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### acc
[Section titled “acc”](#acc)
[`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`ObligationChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/obligationchain/)
# decodeReserve
> **decodeReserve**(`address`, `acc`): [`ReserveChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)
Defined in: protocol-lending-kamino-solana/src/chain.ts:99
A klend `Reserve`.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### acc
[Section titled “acc”](#acc)
[`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`ReserveChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)
# decodeVault
> **decodeVault**(`address`, `acc`): [`VaultChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultchain/)
Defined in: protocol-lending-kamino-solana/src/chain.ts:68
A kVault’s `VaultState`.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### acc
[Section titled “acc”](#acc)
[`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`VaultChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultchain/)
# depositedLiquidity
> **depositedLiquidity**(`o`, `r`, `reserve`): `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:139
What an obligation leg is worth in base units of the reserve’s token: deposits rounded down, debt (with the interest the reserve has accrued since) up.
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
[`ObligationChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/obligationchain/)
### r
[Section titled “r”](#r)
[`ReserveChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)
### reserve
[Section titled “reserve”](#reserve)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# divWadUp
> **divWadUp**(`a`, `wad`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:68
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`bigint`
### wad
[Section titled “wad”](#wad)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# farmUserState
> **farmUserState**(`farm`, `owner`, `farmsProgram?`): `string`
Defined in: protocol-lending-kamino-solana/src/pda.ts:44
A farm’s state for one staker: `["user", farm, owner]` under the farms program (checked against mainnet user states, 2026-10-28).
## Parameters
[Section titled “Parameters”](#parameters)
### farm
[Section titled “farm”](#farm)
`string`
### owner
[Section titled “owner”](#owner)
`string`
### farmsProgram?
[Section titled “farmsProgram?”](#farmsprogram)
`string` = `'FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr'`
## Returns
[Section titled “Returns”](#returns)
`string`
# findProgramAddress
> **findProgramAddress**(`seeds`, `programId`): `string`
Defined in: protocol-lending-kamino-solana/src/pda.ts:10
`findProgramAddress`: the first off-curve `sha256(seeds ‖ bump ‖ program ‖ "ProgramDerivedAddress")`, bump 255 → 0.
## Parameters
[Section titled “Parameters”](#parameters)
### seeds
[Section titled “seeds”](#seeds)
readonly `Uint8Array`<`ArrayBufferLike`>\[]
### programId
[Section titled “programId”](#programid)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# fromDecimalString
> **fromDecimalString**(`value`, `decimals`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:39
Decimal string → base units, rounded down (the API reports decimals; the chain counts base units). Every figure the API reports — amounts, rates, prices — is non-negative, so a sign is refused: a negative deposit or `tokensPerShare` turned the guard’s minimum into permission to drain (scan 2026-10-27 modules, F10/F11).
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`string` | `number`
### decimals
[Section titled “decimals”](#decimals)
`number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# instructionName
> **instructionName**(`programId`, `data`): `string` | `undefined`
Defined in: protocol-lending-kamino-solana/src/programs.ts:57
The instruction a Kamino program call is, from its data; undefined when unknown.
## Parameters
[Section titled “Parameters”](#parameters)
### programId
[Section titled “programId”](#programid)
`string`
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# lessBps
> **lessBps**(`amount`, `bps`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:71
`amount × (10_000 − bps) / 10_000`, rounded down.
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
### bps
[Section titled “bps”](#bps)
`number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# marketRules
> **marketRules**(`op`, `a`): [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
Defined in: protocol-lending-kamino-solana/src/policy.ts:76
A Lend operation: refreshes, the obligation’s farm set-up, and the one call the operation is — on this obligation, reserve, mint and ATA.
## Parameters
[Section titled “Parameters”](#parameters)
### op
[Section titled “op”](#op)
`"deposit"` | `"withdraw"` | `"borrow"` | `"repay"`
### a
[Section titled “a”](#a)
[`MarketRuleAccounts`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketruleaccounts/)
## Returns
[Section titled “Returns”](#returns)
[`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
# mulWad
> **mulWad**(`a`, `wad`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:67
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`bigint`
### wad
[Section titled “wad”](#wad)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# plumbing
> **plumbing**(`me`, `wsolAta`): [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
Defined in: protocol-lending-kamino-solana/src/policy.ts:50
What every Kamino transaction may carry around the protocol call: compute budget, memos, the wallet’s own associated token accounts, and SOL wrapped into (and unwrapped from) its wSOL account.
## Parameters
[Section titled “Parameters”](#parameters)
### me
[Section titled “me”](#me)
`string`
### wsolAta
[Section titled “wsolAta”](#wsolata)
`string`
## Returns
[Section titled “Returns”](#returns)
[`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
# toAmount
> **toAmount**(`amount`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:6
Base-unit amount: a positive bigint or safe integer.
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`string` | `number` | `bigint` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# toDecimalString
> **toDecimalString**(`amount`, `decimals`): `string`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:26
Base units → the decimal string Kamino’s API takes (“1.5” for 1_500_000n at 6 decimals).
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
### decimals
[Section titled “decimals”](#decimals)
`number`
## Returns
[Section titled “Returns”](#returns)
`string`
# toWad
> **toWad**(`value`): `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:66
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`string` | `number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# vanillaObligation
> **vanillaObligation**(`user`, `market`, `klendProgram?`): `string`
Defined in: protocol-lending-kamino-solana/src/pda.ts:28
The vanilla (plain lending) obligation of `user` in `market`: `[tag 0, id 0, user, market, default key, default key]` under klend — the one `/ktx/klend/*` deposits go through. Other obligation kinds (Multiply, Leverage…) live at other addresses.
## Parameters
[Section titled “Parameters”](#parameters)
### user
[Section titled “user”](#user)
`string`
### market
[Section titled “market”](#market)
`string`
### klendProgram?
[Section titled “klendProgram?”](#klendprogram)
`string` = `'KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD'`
## Returns
[Section titled “Returns”](#returns)
`string`
# vaultRules
> **vaultRules**(`op`, `a`, `opts`): [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
Defined in: protocol-lending-kamino-solana/src/policy.ts:123
An Earn vault operation: the deposit or redemption on this vault with the wallet’s accounts, and the farm steps around it.
## Parameters
[Section titled “Parameters”](#parameters)
### op
[Section titled “op”](#op)
`"deposit"` | `"withdraw"`
### a
[Section titled “a”](#a)
[`VaultRuleAccounts`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultruleaccounts/)
### opts
[Section titled “opts”](#opts)
#### stake
[Section titled “stake”](#stake)
`boolean`
## Returns
[Section titled “Returns”](#returns)
[`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
# vaultSharesMint
> **vaultSharesMint**(`vault`, `kvaultProgram`): `string`
Defined in: protocol-lending-kamino-solana/src/pda.ts:34
A kVault’s shares mint: `["shares", vault]` under the kVault program.
## Parameters
[Section titled “Parameters”](#parameters)
### vault
[Section titled “vault”](#vault)
`string`
### kvaultProgram
[Section titled “kvaultProgram”](#kvaultprogram)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# vaultTokensPerShareWad
> **vaultTokensPerShareWad**(`v`, `reserves`): `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:168
Assets per share in token units, as a WAD (what the API’s `tokensPerShare` means): the vault’s idle tokens plus what its cTokens redeem for at each reserve’s rate, less pending fees, over the shares issued. An empty vault prices a share at one token.
## Parameters
[Section titled “Parameters”](#parameters)
### v
[Section titled “v”](#v)
[`VaultChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/vaultchain/)
### reserves
[Section titled “reserves”](#reserves)
`ReadonlyMap`<`string`, [`ReserveChain`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reservechain/)>
## Returns
[Section titled “Returns”](#returns)
`bigint`
# ApiLoanLeg
Defined in: protocol-lending-kamino-solana/src/api.ts:88
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:88
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:88
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:88
***
### valueUsd
[Section titled “valueUsd”](#valueusd)
> **valueUsd**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:88
# ApiMarket
Defined in: protocol-lending-kamino-solana/src/api.ts:19
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MarketInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/marketinfo/)
## Properties
[Section titled “Properties”](#properties)
### description
[Section titled “description”](#description)
> **description**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:22
***
### isCurated
[Section titled “isCurated”](#iscurated)
> **isCurated**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:24
***
### isPrimary
[Section titled “isPrimary”](#isprimary)
> **isPrimary**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:23
***
### lendingMarket
[Section titled “lendingMarket”](#lendingmarket)
> **lendingMarket**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:20
***
### lookupTable
[Section titled “lookupTable”](#lookuptable)
> **lookupTable**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/api.ts:25
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:21
# ApiObligation
Defined in: protocol-lending-kamino-solana/src/api.ts:89
## Properties
[Section titled “Properties”](#properties)
### borrows
[Section titled “borrows”](#borrows)
> **borrows**: [`ApiLoanLeg`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiloanleg/)\[]
Defined in: protocol-lending-kamino-solana/src/api.ts:95
***
### currentLtv
[Section titled “currentLtv”](#currentltv)
> **currentLtv**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:97
Fractions.
***
### deposits
[Section titled “deposits”](#deposits)
> **deposits**: [`ApiLoanLeg`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiloanleg/)\[]
Defined in: protocol-lending-kamino-solana/src/api.ts:94
***
### elevationGroup
[Section titled “elevationGroup”](#elevationgroup)
> **elevationGroup**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:93
***
### liquidationLtv
[Section titled “liquidationLtv”](#liquidationltv)
> **liquidationLtv**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:99
***
### market
[Section titled “market”](#market)
> **market**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:91
***
### maxLtv
[Section titled “maxLtv”](#maxltv)
> **maxLtv**: `number` | `null`
Defined in: protocol-lending-kamino-solana/src/api.ts:98
***
### obligation
[Section titled “obligation”](#obligation)
> **obligation**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:90
***
### raw
[Section titled “raw”](#raw)
> **raw**: `unknown`
Defined in: protocol-lending-kamino-solana/src/api.ts:100
***
### user
[Section titled “user”](#user)
> **user**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:92
# ApiReserve
Defined in: protocol-lending-kamino-solana/src/api.ts:28
## Extended by
[Section titled “Extended by”](#extended-by)
* [`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)
## Properties
[Section titled “Properties”](#properties)
### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:36
***
### maxLtv
[Section titled “maxLtv”](#maxltv)
> **maxLtv**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:33
Fraction (0.74).
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:31
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:29
***
### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:35
Percent.
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:30
***
### totalBorrow
[Section titled “totalBorrow”](#totalborrow)
> **totalBorrow**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:39
***
### totalBorrowUsd
[Section titled “totalBorrowUsd”](#totalborrowusd)
> **totalBorrowUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:41
***
### totalSupply
[Section titled “totalSupply”](#totalsupply)
> **totalSupply**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:38
Decimal strings in token units.
***
### totalSupplyUsd
[Section titled “totalSupplyUsd”](#totalsupplyusd)
> **totalSupplyUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:40
# ApiVault
Defined in: protocol-lending-kamino-solana/src/api.ts:46
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:47
***
### allocations
[Section titled “allocations”](#allocations)
> **allocations**: [`ApiVaultAllocation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultallocation/)\[]
Defined in: protocol-lending-kamino-solana/src/api.ts:64
***
### managementFeeBps
[Section titled “managementFeeBps”](#managementfeebps)
> **managementFeeBps**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:61
***
### minDepositAmount
[Section titled “minDepositAmount”](#mindepositamount)
> **minDepositAmount**: `bigint`
Defined in: protocol-lending-kamino-solana/src/api.ts:58
***
### minWithdrawAmount
[Section titled “minWithdrawAmount”](#minwithdrawamount)
> **minWithdrawAmount**: `bigint`
Defined in: protocol-lending-kamino-solana/src/api.ts:59
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:49
***
### performanceFeeBps
[Section titled “performanceFeeBps”](#performancefeebps)
> **performanceFeeBps**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:60
***
### programId
[Section titled “programId”](#programid)
> **programId**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:48
***
### sharesIssued
[Section titled “sharesIssued”](#sharesissued)
> **sharesIssued**: `bigint`
Defined in: protocol-lending-kamino-solana/src/api.ts:57
***
### sharesMint
[Section titled “sharesMint”](#sharesmint)
> **sharesMint**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:53
***
### sharesMintDecimals
[Section titled “sharesMintDecimals”](#sharesmintdecimals)
> **sharesMintDecimals**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:54
***
### tokenAvailable
[Section titled “tokenAvailable”](#tokenavailable)
> **tokenAvailable**: `bigint`
Defined in: protocol-lending-kamino-solana/src/api.ts:56
Base units.
***
### tokenMint
[Section titled “tokenMint”](#tokenmint)
> **tokenMint**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:50
***
### tokenMintDecimals
[Section titled “tokenMintDecimals”](#tokenmintdecimals)
> **tokenMintDecimals**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:51
***
### tokenProgram
[Section titled “tokenProgram”](#tokenprogram)
> **tokenProgram**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:52
***
### vaultFarm
[Section titled “vaultFarm”](#vaultfarm)
> **vaultFarm**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/api.ts:62
***
### vaultLookupTable
[Section titled “vaultLookupTable”](#vaultlookuptable)
> **vaultLookupTable**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/api.ts:63
# ApiVaultAllocation
Defined in: protocol-lending-kamino-solana/src/api.ts:44
## Properties
[Section titled “Properties”](#properties)
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:44
***
### targetAllocationWeight
[Section titled “targetAllocationWeight”](#targetallocationweight)
> **targetAllocationWeight**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:44
***
### tokenAllocationCap
[Section titled “tokenAllocationCap”](#tokenallocationcap)
> **tokenAllocationCap**: `bigint`
Defined in: protocol-lending-kamino-solana/src/api.ts:44
# ApiVaultMetrics
Defined in: protocol-lending-kamino-solana/src/api.ts:67
## Properties
[Section titled “Properties”](#properties)
### apy
[Section titled “apy”](#apy)
> **apy**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:69
Percent, net of fees.
***
### apy24h
[Section titled “apy24h”](#apy24h)
> **apy24h**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:70
***
### apy30d
[Section titled “apy30d”](#apy30d)
> **apy30d**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:72
***
### apy7d
[Section titled “apy7d”](#apy7d)
> **apy7d**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:71
***
### apyActual
[Section titled “apyActual”](#apyactual)
> **apyActual**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:73
***
### apyFarmRewards
[Section titled “apyFarmRewards”](#apyfarmrewards)
> **apyFarmRewards**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:74
***
### numberOfHolders
[Section titled “numberOfHolders”](#numberofholders)
> **numberOfHolders**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:83
***
### sharePrice
[Section titled “sharePrice”](#shareprice)
> **sharePrice**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:77
***
### sharesIssued
[Section titled “sharesIssued”](#sharesissued)
> **sharesIssued**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:82
***
### tokenPrice
[Section titled “tokenPrice”](#tokenprice)
> **tokenPrice**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:76
Decimal strings.
***
### tokensAvailable
[Section titled “tokensAvailable”](#tokensavailable)
> **tokensAvailable**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:79
***
### tokensInvested
[Section titled “tokensInvested”](#tokensinvested)
> **tokensInvested**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:80
***
### tokensInvestedUsd
[Section titled “tokensInvestedUsd”](#tokensinvestedusd)
> **tokensInvestedUsd**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:81
***
### tokensPerShare
[Section titled “tokensPerShare”](#tokenspershare)
> **tokensPerShare**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:78
# ApiVaultPosition
Defined in: protocol-lending-kamino-solana/src/api.ts:86
## Properties
[Section titled “Properties”](#properties)
### stakedShares
[Section titled “stakedShares”](#stakedshares)
> **stakedShares**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:86
***
### totalShares
[Section titled “totalShares”](#totalshares)
> **totalShares**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:86
***
### unstakedShares
[Section titled “unstakedShares”](#unstakedshares)
> **unstakedShares**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:86
***
### vaultAddress
[Section titled “vaultAddress”](#vaultaddress)
> **vaultAddress**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:86
# ChainAccount
Defined in: protocol-lending-kamino-solana/src/chain.ts:13
An account as the wallet’s RPC returns it.
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `Uint8Array`
Defined in: protocol-lending-kamino-solana/src/chain.ts:13
***
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:13
***
### owner
[Section titled “owner”](#owner)
> **owner**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:13
# Expectation
Defined in: protocol-lending-kamino-solana/src/base.ts:53
What the guard proves before signing (mirrors wallet-solana’s `SerializedExpectation`).
## Properties
[Section titled “Properties”](#properties)
### maxLamportsOut
[Section titled “maxLamportsOut”](#maxlamportsout)
> **maxLamportsOut**: `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:54
***
### maxTokenOut?
[Section titled “maxTokenOut?”](#maxtokenout)
> `optional` **maxTokenOut?**: `object`
Defined in: protocol-lending-kamino-solana/src/base.ts:56
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### mint
[Section titled “mint”](#mint)
> **mint**: `string`
***
### tokenIn?
[Section titled “tokenIn?”](#tokenin)
> `optional` **tokenIn?**: `object`
Defined in: protocol-lending-kamino-solana/src/base.ts:55
#### maxAmount?
[Section titled “maxAmount?”](#maxamount)
> `optional` **maxAmount?**: `bigint`
#### minAmount
[Section titled “minAmount”](#minamount)
> **minAmount**: `bigint`
#### mint
[Section titled “mint”](#mint-1)
> **mint**: `string`
# InstructionRule
Defined in: protocol-lending-kamino-solana/src/policy.ts:14
Mirrors wallet-solana’s `SerializedInstructionRule`.
## Properties
[Section titled “Properties”](#properties)
### accounts?
[Section titled “accounts?”](#accounts)
> `optional` **accounts?**: `Readonly`<`Record`<`number`, `string` | readonly `string`\[]>>
Defined in: protocol-lending-kamino-solana/src/policy.ts:21
Accounts by position: this address or one of these.
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:17
Hex the data starts with.
***
### dataLength?
[Section titled “dataLength?”](#datalength)
> `optional` **dataLength?**: `number`
Defined in: protocol-lending-kamino-solana/src/policy.ts:19
Exact data length in bytes.
***
### program
[Section titled “program”](#program)
> **program**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:15
# KaminoBaseConfig
Defined in: protocol-lending-kamino-solana/src/base.ts:37
## Extended by
[Section titled “Extended by”](#extended-by)
* [`KaminoVaultConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminovaultconfig/)
* [`KaminoMarketConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminomarketconfig/)
## Properties
[Section titled “Properties”](#properties)
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:39
API endpoint or a prepared client (default api.kamino.finance).
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-lending-kamino-solana/src/base.ts:41
fetch implementation for the API (default global fetch).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/base.ts:49
SPL memo (≤ 64 bytes) the API adds to every transaction.
***
### rentAllowanceLamports?
[Section titled “rentAllowanceLamports?”](#rentallowancelamports)
> `optional` **rentAllowanceLamports?**: `number` | `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:47
SOL the transaction may spend on rent and fees beyond the amount (default 0.01 SOL).
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:45
Tolerance on what the wallet must receive on withdrawals / borrows, in basis points (default 50).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:43
Per-call timeout for the API, in ms (default 15 000). Ignored when `api` is a prepared client.
# KaminoMarketConfig
Defined in: protocol-lending-kamino-solana/src/market.ts:11
## Extends
[Section titled “Extends”](#extends)
* [`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/)
## Properties
[Section titled “Properties”](#properties)
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:39
API endpoint or a prepared client (default api.kamino.finance).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`api`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#api)
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-lending-kamino-solana/src/base.ts:41
fetch implementation for the API (default global fetch).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`fetch`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#fetch)
***
### firstDepositAllowanceLamports?
[Section titled “firstDepositAllowanceLamports?”](#firstdepositallowancelamports)
> `optional` **firstDepositAllowanceLamports?**: `number` | `bigint`
Defined in: protocol-lending-kamino-solana/src/market.ts:21
SOL a FIRST deposit may spend on the obligation, user metadata, lookup table and ATAs (default 0.045 SOL).
***
### market?
[Section titled “market?”](#market)
> `optional` **market?**: `string`
Defined in: protocol-lending-kamino-solana/src/market.ts:13
The lending market (default: Kamino’s Main Market).
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/base.ts:49
SPL memo (≤ 64 bytes) the API adds to every transaction.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`memo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#memo)
***
### rentAllowanceLamports?
[Section titled “rentAllowanceLamports?”](#rentallowancelamports)
> `optional` **rentAllowanceLamports?**: `number` | `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:47
SOL the transaction may spend on rent and fees beyond the amount (default 0.01 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`rentAllowanceLamports`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#rentallowancelamports)
***
### reserves?
[Section titled “reserves?”](#reserves)
> `optional` **reserves?**: `Record`<`string`, `string`>
Defined in: protocol-lending-kamino-solana/src/market.ts:19
Pin the reserve a token maps to. Without it the reserve with the most supplied value for that mint is used (the Main Market has several USDC reserves: the big one and small isolated ones).
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:45
Tolerance on what the wallet must receive on withdrawals / borrows, in basis points (default 50).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`slippageBps`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#slippagebps)
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:43
Per-call timeout for the API, in ms (default 15 000). Ignored when `api` is a prepared client.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`timeoutMs`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#timeoutms)
# KaminoMarketRepayOptions
Defined in: protocol-lending-kamino-solana/src/market.ts:25
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`RepayOptions`, `"amount"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-kamino-solana/type-aliases/amountoption/)
Defined in: protocol-lending-kamino-solana/src/market.ts:25
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:639
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.onBehalfOf`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:637
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.token`
# KaminoMarketWithdrawOptions
Defined in: protocol-lending-kamino-solana/src/market.ts:24
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`WithdrawOptions`, `"amount"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-kamino-solana/type-aliases/amountoption/)
Defined in: protocol-lending-kamino-solana/src/market.ts:24
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:627
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.to`
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:625
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.token`
# KaminoVaultConfig
Defined in: protocol-lending-kamino-solana/src/vault.ts:11
## Extends
[Section titled “Extends”](#extends)
* [`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/)
## Properties
[Section titled “Properties”](#properties)
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | [`KaminoApi`](/api/anywalletkit/protocol-lending-kamino-solana/classes/kaminoapi/)
Defined in: protocol-lending-kamino-solana/src/base.ts:39
API endpoint or a prepared client (default api.kamino.finance).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`api`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#api)
***
### asset?
[Section titled “asset?”](#asset)
> `optional` **asset?**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:25
The mint the vault takes and pays out. The API’s answer must name it; `supply` needs it here or as its `token`, so a changed API answer cannot make the wallet deposit another asset.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-lending-kamino-solana/src/base.ts:41
fetch implementation for the API (default global fetch).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`fetch`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#fetch)
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/base.ts:49
SPL memo (≤ 64 bytes) the API adds to every transaction.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`memo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#memo)
***
### rentAllowanceLamports?
[Section titled “rentAllowanceLamports?”](#rentallowancelamports)
> `optional` **rentAllowanceLamports?**: `number` | `bigint`
Defined in: protocol-lending-kamino-solana/src/base.ts:47
SOL the transaction may spend on rent and fees beyond the amount (default 0.01 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`rentAllowanceLamports`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#rentallowancelamports)
***
### skipFarm?
[Section titled “skipFarm?”](#skipfarm)
> `optional` **skipFarm?**: `boolean`
Defined in: protocol-lending-kamino-solana/src/vault.ts:20
Keep the shares in the wallet (default true). The guard then proves the shares arrive. With `false` they are staked in the vault farm, as the Kamino app does: they never reach the wallet, so the guard can only bound what leaves it; the instruction rules pin the stake to this vault’s farm (from the chain) and the wallet’s own farm state.
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:45
Tolerance on what the wallet must receive on withdrawals / borrows, in basis points (default 50).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`slippageBps`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#slippagebps)
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-lending-kamino-solana/src/base.ts:43
Per-call timeout for the API, in ms (default 15 000). Ignored when `api` is a prepared client.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`KaminoBaseConfig`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/).[`timeoutMs`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/kaminobaseconfig/#timeoutms)
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:13
The Earn vault (kVault) address.
# KaminoVaultSupplyOptions
Defined in: protocol-lending-kamino-solana/src/vault.ts:28
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`SupplyOptions`, `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:620
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:621
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.onBehalfOf`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:28
# KaminoVaultWithdrawOptions
Defined in: protocol-lending-kamino-solana/src/vault.ts:29
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`WithdrawOptions`, `"amount"` | `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-kamino-solana/type-aliases/amountoption/)
Defined in: protocol-lending-kamino-solana/src/vault.ts:29
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:627
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.to`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:29
# KtxLend
Defined in: protocol-lending-kamino-solana/src/api.ts:105
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:105
***
### market
[Section titled “market”](#market)
> **market**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:105
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:105
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:105
***
### wallet
[Section titled “wallet”](#wallet)
> **wallet**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:105
# KtxVaultDeposit
Defined in: protocol-lending-kamino-solana/src/api.ts:103
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:103
***
### kvault
[Section titled “kvault”](#kvault)
> **kvault**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:103
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:103
***
### skipFarm?
[Section titled “skipFarm?”](#skipfarm)
> `optional` **skipFarm?**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:103
***
### wallet
[Section titled “wallet”](#wallet)
> **wallet**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:103
# KtxVaultWithdraw
Defined in: protocol-lending-kamino-solana/src/api.ts:104
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:104
***
### closeUserState?
[Section titled “closeUserState?”](#closeuserstate)
> `optional` **closeUserState?**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:104
***
### kvault
[Section titled “kvault”](#kvault)
> **kvault**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:104
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:104
***
### wallet
[Section titled “wallet”](#wallet)
> **wallet**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:104
# MarketInfo
Defined in: protocol-lending-kamino-solana/src/market.ts:32
## Extends
[Section titled “Extends”](#extends)
* [`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/)
## Properties
[Section titled “Properties”](#properties)
### description
[Section titled “description”](#description)
> **description**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:22
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`description`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#description)
***
### isCurated
[Section titled “isCurated”](#iscurated)
> **isCurated**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:24
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`isCurated`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#iscurated)
***
### isPrimary
[Section titled “isPrimary”](#isprimary)
> **isPrimary**: `boolean`
Defined in: protocol-lending-kamino-solana/src/api.ts:23
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`isPrimary`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#isprimary)
***
### lendingMarket
[Section titled “lendingMarket”](#lendingmarket)
> **lendingMarket**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:20
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`lendingMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#lendingmarket)
***
### lookupTable
[Section titled “lookupTable”](#lookuptable)
> **lookupTable**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/api.ts:25
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`lookupTable`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#lookuptable)
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:21
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`ApiMarket`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/).[`name`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apimarket/#name)
***
### reserves
[Section titled “reserves”](#reserves)
> **reserves**: [`ReserveInfo`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/reserveinfo/)\[]
Defined in: protocol-lending-kamino-solana/src/market.ts:32
# MarketPosition
Defined in: protocol-lending-kamino-solana/src/market.ts:34
## Properties
[Section titled “Properties”](#properties)
### borrowed
[Section titled “borrowed”](#borrowed)
> **borrowed**: `Record`<`string`, `bigint`>
Defined in: protocol-lending-kamino-solana/src/market.ts:39
***
### obligations
[Section titled “obligations”](#obligations)
> **obligations**: [`ApiObligation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apiobligation/)\[]
Defined in: protocol-lending-kamino-solana/src/market.ts:36
The obligations (loans) the wallet has in this market; an empty list means no position.
***
### supplied
[Section titled “supplied”](#supplied)
> **supplied**: `Record`<`string`, `bigint`>
Defined in: protocol-lending-kamino-solana/src/market.ts:38
Base units per mint, summed over obligations.
# MarketQuote
Defined in: protocol-lending-kamino-solana/src/market.ts:42
## Extends
[Section titled “Extends”](#extends)
* `LendingQuote`
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:644
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`LendingQuote.fee`
***
### minReceived?
[Section titled “minReceived?”](#minreceived)
> `optional` **minReceived?**: `bigint`
Defined in: protocol-lending-kamino-solana/src/market.ts:42
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/market.ts:42
# MarketRuleAccounts
Defined in: protocol-lending-kamino-solana/src/policy.ts:64
## Properties
[Section titled “Properties”](#properties)
### ata
[Section titled “ata”](#ata)
> **ata**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:71
The wallet’s token account for `mint` (the one the reserve’s token program derives).
***
### market
[Section titled “market”](#market)
> **market**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:66
***
### me
[Section titled “me”](#me)
> **me**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:65
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:69
***
### obligation
[Section titled “obligation”](#obligation)
> **obligation**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:67
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:68
***
### wsolAta
[Section titled “wsolAta”](#wsolata)
> **wsolAta**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:72
# ObligationChain
Defined in: protocol-lending-kamino-solana/src/chain.ts:114
## Properties
[Section titled “Properties”](#properties)
### borrows
[Section titled “borrows”](#borrows)
> **borrows**: `object`\[]
Defined in: protocol-lending-kamino-solana/src/chain.ts:118
#### borrowedSf
[Section titled “borrowedSf”](#borrowedsf)
> **borrowedSf**: `bigint`
#### cumulativeBorrowRate
[Section titled “cumulativeBorrowRate”](#cumulativeborrowrate)
> **cumulativeBorrowRate**: `bigint`
#### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
***
### deposits
[Section titled “deposits”](#deposits)
> **deposits**: `object`\[]
Defined in: protocol-lending-kamino-solana/src/chain.ts:117
#### ctokens
[Section titled “ctokens”](#ctokens)
> **ctokens**: `bigint`
#### reserve
[Section titled “reserve”](#reserve-1)
> **reserve**: `string`
***
### lendingMarket
[Section titled “lendingMarket”](#lendingmarket)
> **lendingMarket**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:115
***
### owner
[Section titled “owner”](#owner)
> **owner**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:116
# ReserveChain
Defined in: protocol-lending-kamino-solana/src/chain.ts:85
## Properties
[Section titled “Properties”](#properties)
### collateralSupply
[Section titled “collateralSupply”](#collateralsupply)
> **collateralSupply**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:93
cTokens issued against it.
***
### cumulativeBorrowRate
[Section titled “cumulativeBorrowRate”](#cumulativeborrowrate)
> **cumulativeBorrowRate**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:95
Cumulative borrow rate (scaled by SF) at the reserve’s last refresh.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocol-lending-kamino-solana/src/chain.ts:88
***
### lendingMarket
[Section titled “lendingMarket”](#lendingmarket)
> **lendingMarket**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:86
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:87
***
### tokenProgram
[Section titled “tokenProgram”](#tokenprogram)
> **tokenProgram**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:89
***
### totalLiquiditySf
[Section titled “totalLiquiditySf”](#totalliquiditysf)
> **totalLiquiditySf**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:91
Liquidity the reserve owes its depositors (available + borrowed − fees), scaled by SF.
# ReserveInfo
Defined in: protocol-lending-kamino-solana/src/market.ts:27
## Extends
[Section titled “Extends”](#extends)
* [`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/)
## Properties
[Section titled “Properties”](#properties)
### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:36
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`borrowApy`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#borrowapy)
***
### maxLtv
[Section titled “maxLtv”](#maxltv)
> **maxLtv**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:33
Fraction (0.74).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`maxLtv`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#maxltv)
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:31
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`mint`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#mint)
***
### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:29
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`reserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#reserve)
***
### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:35
Percent.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`supplyApy`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#supplyapy)
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:30
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`symbol`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#symbol)
***
### totalBorrow
[Section titled “totalBorrow”](#totalborrow)
> **totalBorrow**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:39
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`totalBorrow`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#totalborrow)
***
### totalBorrowUsd
[Section titled “totalBorrowUsd”](#totalborrowusd)
> **totalBorrowUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:41
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`totalBorrowUsd`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#totalborrowusd)
***
### totalSupply
[Section titled “totalSupply”](#totalsupply)
> **totalSupply**: `string`
Defined in: protocol-lending-kamino-solana/src/api.ts:38
Decimal strings in token units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`totalSupply`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#totalsupply)
***
### totalSupplyUsd
[Section titled “totalSupplyUsd”](#totalsupplyusd)
> **totalSupplyUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/api.ts:40
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`ApiReserve`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/).[`totalSupplyUsd`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apireserve/#totalsupplyusd)
***
### utilization
[Section titled “utilization”](#utilization)
> **utilization**: `number`
Defined in: protocol-lending-kamino-solana/src/market.ts:29
Fraction borrowed of what is supplied.
# SerializedGuard
Defined in: protocol-lending-kamino-solana/src/base.ts:59
## Properties
[Section titled “Properties”](#properties)
### expect
[Section titled “expect”](#expect)
> **expect**: [`Expectation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/expectation/)
Defined in: protocol-lending-kamino-solana/src/base.ts:59
***
### instructions
[Section titled “instructions”](#instructions)
> **instructions**: readonly [`InstructionRule`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/instructionrule/)\[]
Defined in: protocol-lending-kamino-solana/src/base.ts:59
***
### programAllowlist
[Section titled “programAllowlist”](#programallowlist)
> **programAllowlist**: readonly `string`\[]
Defined in: protocol-lending-kamino-solana/src/base.ts:59
# SolanaAccountSurface
Defined in: protocol-lending-kamino-solana/src/base.ts:62
The surface of a `@anywalletkit/wallet-solana` account this module needs.
## Methods
[Section titled “Methods”](#methods)
### checkSerialized()?
[Section titled “checkSerialized()?”](#checkserialized)
> `optional` **checkSerialized**(`base64`, `guard`): `Promise`<{ `quote`: { `fee`: `bigint`; }; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:64
#### Parameters
[Section titled “Parameters”](#parameters)
##### base64
[Section titled “base64”](#base64)
`string`
##### guard
[Section titled “guard”](#guard)
[`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<{ `quote`: { `fee`: `bigint`; }; }>
***
### getAccountInfos()?
[Section titled “getAccountInfos()?”](#getaccountinfos)
> `optional` **getAccountInfos**(`addresses`): `Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
Defined in: protocol-lending-kamino-solana/src/base.ts:68
Raw accounts in the order asked (wallet-solana 0.4+): the chain state the API’s figures are checked against.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<([`ChainAccount`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/chainaccount/) | `null`)\[]>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-lending-kamino-solana/src/base.ts:63
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string`>
***
### getMintInfo()?
[Section titled “getMintInfo()?”](#getmintinfo)
> `optional` **getMintInfo**(`mint`): `Promise`<{ `decimals`: `number`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:66
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### mint
[Section titled “mint”](#mint)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `decimals`: `number`; }>
***
### sendSerialized()?
[Section titled “sendSerialized()?”](#sendserialized)
> `optional` **sendSerialized**(`base64`, `guard`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-kamino-solana/src/base.ts:65
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### guard
[Section titled “guard”](#guard-1)
[`SerializedGuard`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/serializedguard/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
# VaultChain
Defined in: protocol-lending-kamino-solana/src/chain.ts:51
## Properties
[Section titled “Properties”](#properties)
### allocations
[Section titled “allocations”](#allocations)
> **allocations**: `object`\[]
Defined in: protocol-lending-kamino-solana/src/chain.ts:61
Reserves the vault has invested in and the collateral (cTokens) it holds in each.
#### ctokens
[Section titled “ctokens”](#ctokens)
> **ctokens**: `bigint`
#### reserve
[Section titled “reserve”](#reserve)
> **reserve**: `string`
***
### farm
[Section titled “farm”](#farm)
> **farm**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/chain.ts:64
***
### minDeposit
[Section titled “minDeposit”](#mindeposit)
> **minDeposit**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:62
***
### minWithdraw
[Section titled “minWithdraw”](#minwithdraw)
> **minWithdraw**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:63
***
### pendingFeesSf
[Section titled “pendingFeesSf”](#pendingfeessf)
> **pendingFeesSf**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:59
***
### sharesDecimals
[Section titled “sharesDecimals”](#sharesdecimals)
> **sharesDecimals**: `number`
Defined in: protocol-lending-kamino-solana/src/chain.ts:56
***
### sharesIssued
[Section titled “sharesIssued”](#sharesissued)
> **sharesIssued**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:58
***
### sharesMint
[Section titled “sharesMint”](#sharesmint)
> **sharesMint**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:55
***
### tokenAvailable
[Section titled “tokenAvailable”](#tokenavailable)
> **tokenAvailable**: `bigint`
Defined in: protocol-lending-kamino-solana/src/chain.ts:57
***
### tokenDecimals
[Section titled “tokenDecimals”](#tokendecimals)
> **tokenDecimals**: `number`
Defined in: protocol-lending-kamino-solana/src/chain.ts:53
***
### tokenMint
[Section titled “tokenMint”](#tokenmint)
> **tokenMint**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:52
***
### tokenProgram
[Section titled “tokenProgram”](#tokenprogram)
> **tokenProgram**: `string`
Defined in: protocol-lending-kamino-solana/src/chain.ts:54
# VaultInfo
Defined in: protocol-lending-kamino-solana/src/vault.ts:31
## Properties
[Section titled “Properties”](#properties)
### allocations
[Section titled “allocations”](#allocations)
> **allocations**: [`ApiVaultAllocation`](/api/anywalletkit/protocol-lending-kamino-solana/interfaces/apivaultallocation/)\[]
Defined in: protocol-lending-kamino-solana/src/vault.ts:55
***
### apy
[Section titled “apy”](#apy)
> **apy**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:46
Percent, net of fees; `apy` is the live rate, the others trailing windows.
***
### apy30d
[Section titled “apy30d”](#apy30d)
> **apy30d**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:48
***
### apy7d
[Section titled “apy7d”](#apy7d)
> **apy7d**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:47
***
### apyFarmRewards
[Section titled “apyFarmRewards”](#apyfarmrewards)
> **apyFarmRewards**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:49
***
### asset
[Section titled “asset”](#asset)
> **asset**: `object`
Defined in: protocol-lending-kamino-solana/src/vault.ts:35
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### mint
[Section titled “mint”](#mint)
> **mint**: `string`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### farm
[Section titled “farm”](#farm)
> **farm**: `string` | `null`
Defined in: protocol-lending-kamino-solana/src/vault.ts:54
***
### fees
[Section titled “fees”](#fees)
> **fees**: `object`
Defined in: protocol-lending-kamino-solana/src/vault.ts:50
#### managementBps
[Section titled “managementBps”](#managementbps)
> **managementBps**: `number`
#### performanceBps
[Section titled “performanceBps”](#performancebps)
> **performanceBps**: `number`
***
### holders
[Section titled “holders”](#holders)
> **holders**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:53
***
### minDeposit
[Section titled “minDeposit”](#mindeposit)
> **minDeposit**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:51
***
### minWithdraw
[Section titled “minWithdraw”](#minwithdraw)
> **minWithdraw**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:52
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:34
***
### programId
[Section titled “programId”](#programid)
> **programId**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:33
***
### sharePriceUsd
[Section titled “sharePriceUsd”](#sharepriceusd)
> **sharePriceUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:44
***
### shares
[Section titled “shares”](#shares)
> **shares**: `object`
Defined in: protocol-lending-kamino-solana/src/vault.ts:36
#### decimals
[Section titled “decimals”](#decimals-1)
> **decimals**: `number`
#### mint
[Section titled “mint”](#mint-1)
> **mint**: `string`
***
### sharesIssued
[Section titled “sharesIssued”](#sharesissued)
> **sharesIssued**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:39
***
### tokenPriceUsd
[Section titled “tokenPriceUsd”](#tokenpriceusd)
> **tokenPriceUsd**: `number`
Defined in: protocol-lending-kamino-solana/src/vault.ts:43
USD per asset token and per share, as the API reports them.
***
### tokensPerShareWad
[Section titled “tokensPerShareWad”](#tokenspersharewad)
> **tokensPerShareWad**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:41
Assets per 1e18 shares (both in token units), for display.
***
### totalAssets
[Section titled “totalAssets”](#totalassets)
> **totalAssets**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:38
Base units of the asset the vault manages (available + invested), and shares issued.
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-kamino-solana/src/vault.ts:32
# VaultPosition
Defined in: protocol-lending-kamino-solana/src/vault.ts:58
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:64
Asset base units the shares are worth now.
***
### shares
[Section titled “shares”](#shares)
> **shares**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:62
***
### stakedShares
[Section titled “stakedShares”](#stakedshares)
> **stakedShares**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:61
***
### unstakedShares
[Section titled “unstakedShares”](#unstakedshares)
> **unstakedShares**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:60
Share base units: in the wallet, staked in the vault farm, and both.
# VaultRuleAccounts
Defined in: protocol-lending-kamino-solana/src/policy.ts:108
## Properties
[Section titled “Properties”](#properties)
### farm
[Section titled “farm”](#farm)
> **farm**: { `farm`: `string`; `userState`: `string`; } | `null`
Defined in: protocol-lending-kamino-solana/src/policy.ts:118
The vault’s farm and the wallet’s state in it, when the vault has a farm.
***
### me
[Section titled “me”](#me)
> **me**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:109
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:111
***
### sharesAtas
[Section titled “sharesAtas”](#sharesatas)
> **sharesAtas**: readonly `string`\[]
Defined in: protocol-lending-kamino-solana/src/policy.ts:116
The wallet’s shares accounts: the Token program’s derivation, then Token-2022’s.
***
### sharesMint
[Section titled “sharesMint”](#sharesmint)
> **sharesMint**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:112
***
### tokenAta
[Section titled “tokenAta”](#tokenata)
> **tokenAta**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:114
The wallet’s token account for the vault’s asset.
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:110
***
### wsolAta
[Section titled “wsolAta”](#wsolata)
> **wsolAta**: `string`
Defined in: protocol-lending-kamino-solana/src/policy.ts:119
# VaultSupplyQuote
Defined in: protocol-lending-kamino-solana/src/vault.ts:67
## Extends
[Section titled “Extends”](#extends)
* `LendingQuote`
## Properties
[Section titled “Properties”](#properties)
### expectedShares
[Section titled “expectedShares”](#expectedshares)
> **expectedShares**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:67
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:644
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`LendingQuote.fee`
# VaultWithdrawQuote
Defined in: protocol-lending-kamino-solana/src/vault.ts:68
## Extends
[Section titled “Extends”](#extends)
* `LendingQuote`
## Properties
[Section titled “Properties”](#properties)
### expectedAssets
[Section titled “expectedAssets”](#expectedassets)
> **expectedAssets**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:68
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:644
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`LendingQuote.fee`
***
### minAssets
[Section titled “minAssets”](#minassets)
> **minAssets**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:68
***
### shares
[Section titled “shares”](#shares)
> **shares**: `bigint`
Defined in: protocol-lending-kamino-solana/src/vault.ts:68
# AmountOption
> **AmountOption** = `bigint` | `number` | `"max"`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:3
# ADDRESS_LOOKUP_TABLE_PROGRAM
> `const` **ADDRESS_LOOKUP_TABLE_PROGRAM**: `"AddressLookupTab1e1111111111111111111111111"` = `'AddressLookupTab1e1111111111111111111111111'`
Defined in: protocol-lending-kamino-solana/src/programs.ts:10
A first Lend deposit creates a per-user lookup table (the user pays its rent, stays its authority).
# CHAIN_TOLERANCE_BPS
> `const` **CHAIN_TOLERANCE_BPS**: `100n` = `100n`
Defined in: protocol-lending-kamino-solana/src/chain.ts:20
How far the API’s figures may sit from the chain’s before the operation is refused, in basis points.
# DEFAULT_FIRST_DEPOSIT_ALLOWANCE
> `const` **DEFAULT_FIRST_DEPOSIT_ALLOWANCE**: `45000000n` = `45_000_000n`
Defined in: protocol-lending-kamino-solana/src/base.ts:18
Extra SOL a first Lend deposit needs: obligation (\~0.024), user metadata, lookup table, ATAs.
# DEFAULT_RENT_ALLOWANCE
> `const` **DEFAULT_RENT_ALLOWANCE**: `10000000n` = `10_000_000n`
Defined in: protocol-lending-kamino-solana/src/base.ts:16
SOL allowance for rent (ATAs, farm user state) and priority fees on top of the amount itself.
# FARMS_PROGRAM
> `const` **FARMS_PROGRAM**: `"FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr"` = `'FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr'`
Defined in: protocol-lending-kamino-solana/src/programs.ts:8
# INSTRUCTION_NAMES
> `const` **INSTRUCTION_NAMES**: `Readonly`<`Record`<`string`, `Readonly`<`Record`<`string`, `string`>>>>
Defined in: protocol-lending-kamino-solana/src/programs.ts:25
Anchor discriminator (first 8 bytes, hex) → instruction, per program.
# IX
> `const` **IX**: `Readonly`<{ `borrowV2`: `"a1808ff5abc7c206"`; `depositV2`: `"d8e0bf1bcc9766af"`; `farmInitializeUser`: `"6f11b9fa3c7a26fe"`; `farmStake`: `"ceb0ca12c8d1b36c"`; `farmUnstake`: `"5a5f6b2acd7c32e1"`; `farmWithdrawUnstaked`: `"2466bb31dc248443"`; `initObligation`: `"fb0ae74c1b0b9f60"`; `initObligationFarmsForReserve`: `"883f0fbad398a8a4"`; `initUserMetadata`: `"75a9b045c5170fa2"`; `refreshObligation`: `"218493e497c04859"`; `refreshObligationFarmsForReserve`: `"8c90fd150a4af803"`; `refreshReserve`: `"02da8aeb4fc91966"`; `repayV2`: `"74aed54cb435d290"`; `requestElevationGroup`: `"2477fb8122f00793"`; `vaultDeposit`: `"f223c68952e1f2b6"`; `vaultWithdraw`: `"b712469c946da122"`; `vaultWithdrawFromAvailable`: `"1383709baadc2239"`; `withdrawV2`: `"eb34779895c51407"`; }>
Defined in: protocol-lending-kamino-solana/src/policy.ts:25
Anchor discriminators of the instructions the rules allow.
# KAMINO_API
> `const` **KAMINO_API**: `"https://api.kamino.finance"` = `'https://api.kamino.finance'`
Defined in: protocol-lending-kamino-solana/src/api.ts:9
# KAMINO_PROGRAM_ALLOWLIST
> `const` **KAMINO_PROGRAM_ALLOWLIST**: readonly `string`\[]
Defined in: protocol-lending-kamino-solana/src/programs.ts:19
Every program a Kamino Earn / Lend transaction from the API may call; anything else is refused before signing.
# KLEND_PROGRAM
> `const` **KLEND_PROGRAM**: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` = `'KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD'`
Defined in: protocol-lending-kamino-solana/src/programs.ts:6
# KNOWN_DECIMALS
> `const` **KNOWN_DECIMALS**: `Readonly`<`Record`<`string`, `number`>>
Defined in: protocol-lending-kamino-solana/src/base.ts:21
Decimals of mints Kamino lists, for accounts that cannot read mints (fixtures, read-only without RPC).
# KVAULT_PROGRAM
> `const` **KVAULT_PROGRAM**: `"KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"` = `'KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd'`
Defined in: protocol-lending-kamino-solana/src/programs.ts:7
# MAIN_MARKET
> `const` **MAIN_MARKET**: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` = `'7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'`
Defined in: protocol-lending-kamino-solana/src/api.ts:11
Kamino’s Main Market.
# MEMO_PROGRAM
> `const` **MEMO_PROGRAM**: `"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"` = `'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'`
Defined in: protocol-lending-kamino-solana/src/programs.ts:11
# SOLANA_MAINNET
> `const` **SOLANA_MAINNET**: `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"` = `'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'`
Defined in: protocol-lending-kamino-solana/src/base.ts:13
# WAD
> `const` **WAD**: `bigint`
Defined in: protocol-lending-kamino-solana/src/amounts.ts:65
Fixed-point helper: `value` (decimal string) scaled by 1e18.
# WITHDRAW_ALL
> `const` **WITHDRAW_ALL**: `"18446744073709551615"` = `'18446744073709551615'`
Defined in: protocol-lending-kamino-solana/src/api.ts:17
u64::MAX as a decimal share count.
Deprecated
The API scales `amount` by the shares’ decimals and now refuses this as above u64 (2026-10-28, `DECIMAL_TO_LAMPORTS_OVERFLOW`); `withdraw({ amount: 'max' })` passes the wallet’s exact share count, read from the chain, instead.
# WSOL_MINT
> `const` **WSOL_MINT**: `"So11111111111111111111111111111111111111112"` = `'So11111111111111111111111111111111111111112'`
Defined in: protocol-lending-kamino-solana/src/base.ts:14
# @anywalletkit/protocol-lending-mellow-evm
# @anywalletkit/protocol-lending-mellow-evm
[Section titled “@anywalletkit/protocol-lending-mellow-evm”](#anywalletkitprotocol-lending-mellow-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-lending-mellow-evm)
A simple package that lets `@anywalletkit/wallet-evm` wallet accounts use [Mellow](https://mellow.finance) **Core Vaults** — Lido’s Earn vaults ([EarnETH, EarnUSD, stRATEGY](https://stake.lido.fi/earn)) and any other vault on the same contracts: supply through the vault’s synchronous or asynchronous deposit queue, redeem and claim through the redeem queue, read the position, fees, oracle reports and APY.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-lending-mellow-evm @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-lending-mellow-evm @anywalletkit/core · yarn add @anywalletkit/protocol-lending-mellow-evm @anywalletkit/core
```
On npm: [@anywalletkit/protocol-lending-mellow-evm](https://www.npmjs.com/package/@anywalletkit/protocol-lending-mellow-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Built on the `LendingProtocol` type in `@anywalletkit/core`, the way the Morpho module expresses ERC-4626 vaults: `supply` puts an asset into the vault, `withdraw` takes it out. Mellow’s withdrawal is two-phase (request → oracle report → claim), so the module adds `getWithdrawalRequests` / `claimWithdrawals` on top; `borrow` / `repay` reject — a vault does not lend.
The mechanics are extracted from a production wallet (React Native/Hermes) where deposit (sync and async), cancel, claim-shares, redeem and claim were exercised with real funds on EarnETH and EarnUSD through the direct port this module was lifted from. Verification status of the module itself (2026-09-07): 12 offline tests; `verify:live` discovers both Lido vaults on-chain and finds exactly the queue addresses that production wallet had hard-coded, and proves the supply / redeem plans with `eth_call`. The wallet now runs on the module; a funded cycle through it is the next step.
## What a Mellow Core Vault is
[Section titled “What a Mellow Core Vault is”](#what-a-mellow-core-vault-is)
A Core Vault holds LP money that a **curator** allocates across DeFi (Aave, Uniswap, Pendle, Morpho, …) through sub-vaults whose calls are restricted by an on-chain verifier. LPs hold vault **shares** (`earnETH`, `earnUSD`, …), priced by the vault’s **oracle** once per report (Lido’s vaults: at most every 20 hours). Money moves through per-asset **queues** the vault lists itself:
* **Deposit, synchronous queue** — shares are minted in the same transaction at the latest report’s price; reverts when the report is stale. The module tries it first (`instant: true`) after proving the call with `eth_call`.
* **Deposit, asynchronous queue** — one open request per account, priced by the next report at least `depositInterval` after it (1 h on Lido’s vaults). Once priced, the shares count in the balance without any action; `claimShares` only moves them physically. Cancellable until priced.
* **Redeem queue** — `redeem(shares)` burns shares at once; the request is *not* cancellable; the next report at least `redeemInterval` later (1–2 days on Lido’s vaults) prices it, the curator pulls liquidity, then `claim` pays the asset. Lido quotes “instant to \~72 h”.
Fees (in shares, read from the vault’s FeeManager): deposit, redeem, performance and a yearly protocol fee. Lido EarnETH today: 15 % performance, 0.2 %/yr protocol, no deposit / redeem fee.
Nothing is configured by hand for a preset: the vault reports its share manager, oracle, fee manager, assets and queues on-chain, and the module classifies each queue by the methods it answers (an async deposit queue has `requestOf`, a redeem queue has `requestsOf`; signature-based queues are skipped). Every queue call (deposits, redemptions, cancels and claims) goes only to a queue the package pins, though: the preset’s shipped `queues` (re-checked against the chain on 2026-10-28). The RPC’s `queueAt` picks among them and is never the authority — a user-added or tampered RPC naming its own queue is refused before any approval. A custom `vault`, or a preset’s vault passed by address without `preset`, takes the expected queue addresses in `queues: {deposit, redeem}`, and the same option admits a queue Mellow adds before the package catches up.
## Usage
[Section titled “Usage”](#usage)
```js
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import MellowProtocolEvm from '@anywalletkit/protocol-lending-mellow-evm'
const wallet = new WalletManagerEvm(seed, { provider: 'https://ethereum-rpc.publicnode.com' })
const account = await wallet.getAccount(0)
const earnUsd = new MellowProtocolEvm(account, { preset: 'lido-earn-usd' }) // or { vault: '0x…' }
// What the vault is: components, assets and queues (discovered on-chain), fees, oracle parameters
const vault = await earnUsd.getVaultData()
// Supply 100 USDT — approve (awaited) + deposit; sync queue when it can mint at once, else the async request
const USDT = '0xdAC17F958D2ee523a2206206994597C13D831ec7'
const { fee, sharesOut, instant } = await earnUsd.quoteSupply({ token: USDT, amount: 100_000_000n })
const { hash } = await earnUsd.supply({ token: USDT, amount: 100_000_000n })
// Position: shares, value at the latest report, what sits in the queues
const position = await earnUsd.getPosition({ token: USDT })
// Withdraw half — amount is in SHARES; the request burns them now, the payout comes after the next report
await earnUsd.withdraw({ token: USDT, amount: position.shares / 2n })
// Later: what is claimable, then claim (one transaction per payout asset)
const { requests, claimable } = await earnUsd.getWithdrawalRequests()
if (claimable.length) await earnUsd.claimWithdrawals({ token: USDT })
// Decoration
await earnUsd.getApr() // percent, from Mellow's registry
await earnUsd.getStats() // { apy, tvlUsd, withdrawAvgSeconds }
```
Presets: `lido-earn-eth`, `lido-earn-usd`, and — gated by a deposit whitelist at the time of writing — `lido-strategy`, `lido-conservative-earn-usd`, `lido-experimental-earn-usd` (see `note` on each entry of `MELLOW_ADDRESS_MAP`). Native ETH is `token: 'native'` (EarnETH). A read-only account (`{ getAddress }`) is enough for every view; writes need an account with `sendTransaction({ to, data, value })`.
### Configuration
[Section titled “Configuration”](#configuration)
```js
new MellowProtocolEvm(account, {
vault: '0x6a37…249e', // any Core Vault; or preset: 'lido-earn-eth' | 'lido-earn-usd'
provider: eip1193OrUrl, // default: the account's provider
instant: true, // sync deposit queue first, async fallback
referral: '0x…', // forwarded to the deposit queues
registry: 'https://api.mellow.finance/v1/vaults' | null, // APY / TVL / withdrawal time — decoration only
maxRedeemRequests: 50
})
```
## Fail-closed rules
[Section titled “Fail-closed rules”](#fail-closed-rules)
* a queue is used only after the vault confirms it (`hasQueue`), its direction (`isDepositQueue`) and that it is not paused — right before the transaction, not from a cached list;
* a suspicious oracle report (deviation above the vault’s threshold) refuses supply and withdraw quotes instead of pricing blindly;
* a vault with a deposit whitelist, minting or burning paused is refused;
* a second async deposit request is refused while one is open (the contract would revert anyway; the module says why);
* the sync deposit is proven with `eth_call` before it is sent — and proven again after an approval was mined, falling back to the async queue if the report went stale in between;
* Ethereum’s USDT gets its allowance reset to zero before a raise;
* `withdraw` amounts are shares, the only unit known before the report; the quoted payout is an estimate at the latest report, after the redeem fee.
## Build and tests
[Section titled “Build and tests”](#build-and-tests)
TypeScript, built with `tsup` to `dist/` (ESM + CJS + types); one runtime dependency (viem) for the RPC client and ABI coding.
```plaintext
npm run build # tsup → dist/
npm test # vitest: unit tests over a stubbed EIP-1193 provider (selectors of the real contracts) + conformance
npm run verify:live # on-chain discovery vs. the known Lido deployments, position reads, eth_call proofs — no keys
```
## License
[Section titled “License”](#license)
Apache-2.0
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels Mellow transactions for a wallet’s history, offline and synchronously. Deposits and redemptions are calls on a vault’s **queues** (DepositQueue / RedeemQueue), which the module normally discovers on-chain, so the offline rule is: the selector is a queue method — `deposit(uint224,address,bytes32[])` → `supply` “Deposited ”, `cancelDepositRequest()` → `withdraw` “Cancelled deposit of ”, DepositQueue `claim(address)` → `claim` “Claimed ”, `redeem(uint256)` → `withdraw` “Requested withdrawal of ”, RedeemQueue `claim(address,uint32[])` → `claim` “Claimed ” — **and** either the called contract is a queue a preset listed when it was last verified (`MELLOW_ADDRESS_MAP[1][key].queues`, read on 2026-10-14) or the receipt touches a known vault / share token (a preset’s `vault` / `shareManager`, or the vault this instance targets). Writes never use the recorded queues; they are for recognizing history only. Subtitle `"Mellow · Ethereum"`, `counterparty` the queue; `assetsIn` / `assetsOut` are the wallet’s net movements with preset share tokens labelled (earnETH, earnUSD, …).
Fixtures in `fixtures/activity/` are the test wallet’s funded runs (EarnETH deposit ETH + claim shares, EarnUSD deposit USDT, redeem, claim, cancelDepositRequest; 2026-09-01 … 09-11); `negatives/` holds a Lido submit and an SSV stake.
## Classes
[Section titled “Classes”](#classes)
* [default](/api/anywalletkit/protocol-lending-mellow-evm/classes/default/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [DepositQueueInfo](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/depositqueueinfo/)
* [Eip1193Like](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/eip1193like/)
* [MellowAccount](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowaccount/)
* [MellowAction](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowaction/)
* [MellowActivityInstance](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowactivityinstance/)
* [MellowCall](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowcall/)
* [MellowProtocolConfig](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowprotocolconfig/)
* [MellowTx](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowtx/)
* [MellowVaultPreset](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowvaultpreset/)
* [OracleReport](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/oraclereport/)
* [PendingDeposit](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/pendingdeposit/)
* [Position](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/position/)
* [QueueInfo](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/)
* [RedeemQueueInfo](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemqueueinfo/)
* [RedeemRequest](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemrequest/)
* [Stats](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/stats/)
* [SupplyOptions](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyoptions/)
* [SupplyPlan](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyplan/)
* [SupplyResult](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyresult/)
* [VaultAsset](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/vaultasset/)
* [VaultData](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/vaultdata/)
* [WithdrawalRequestsView](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawalrequestsview/)
* [WithdrawOptions](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawoptions/)
* [WithdrawPlan](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawplan/)
* [WithdrawResult](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawresult/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [EvmProvider](/api/anywalletkit/protocol-lending-mellow-evm/type-aliases/evmprovider/)
## Variables
[Section titled “Variables”](#variables)
* [DEFAULT_REGISTRY](/api/anywalletkit/protocol-lending-mellow-evm/variables/default_registry/)
* [MELLOW_ACTIONS](/api/anywalletkit/protocol-lending-mellow-evm/variables/mellow_actions/)
* [MELLOW_ADDRESS_MAP](/api/anywalletkit/protocol-lending-mellow-evm/variables/mellow_address_map/)
* [NATIVE_ASSET](/api/anywalletkit/protocol-lending-mellow-evm/variables/native_asset/)
## Functions
[Section titled “Functions”](#functions)
* [describeMellowActivity](/api/anywalletkit/protocol-lending-mellow-evm/functions/describemellowactivity/)
* [toAsset](/api/anywalletkit/protocol-lending-mellow-evm/functions/toasset/)
# default
Defined in: protocol-lending-mellow-evm/src/protocol.ts:296
Mellow Core Vaults for EVM wallet accounts — Lido’s Earn vaults (EarnETH, EarnUSD, stRATEGY) and any other vault on the same contracts.
A Core Vault holds LP money that a curator allocates across DeFi through verified sub-vault calls; LPs hold vault **shares** (earnETH, earnUSD, …) priced by the vault’s oracle once per report (\~daily). Money moves through per-asset queues the vault itself lists on-chain:
* **supply** — `deposit` into the asset’s queue. The synchronous queue mints shares in the same transaction at the last report’s price (used first when `instant` is on); the asynchronous queue records a request that the next report prices, after which the shares are counted in the account’s balance without any further action (`claimShares` only moves them physically). One open async request per account; cancellable until it is priced (`cancelSupply`).
* **withdraw** — `redeem(shares)` on the asset’s redeem queue: the shares burn at once, the request is *not* cancellable, the next report at least `redeemInterval` later prices it, the curator pulls liquidity, and `claimWithdrawals` pays the asset out. That second phase is what makes this a two-step withdraw; `getWithdrawalRequests` reports the queue.
Reads run through the account’s provider (viem). Every queue is found on-chain (`getQueueCount` / `queueAt`, classified by the methods it answers) and re-verified against the vault (`hasQueue`, direction, pause) before money touches it; a suspicious oracle report or a whitelist gate refuses instead of pricing blindly. Mellow’s registry only decorates.
`borrow` / `repay` reject: a vault does not lend.
## Extends
[Section titled “Extends”](#extends)
* `LendingProtocol`<[`MellowProtocolConfig`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowprotocolconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `MellowProtocolEvm`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:316
Creates a new interface to a Mellow Core Vault for evm blockchains.
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`MellowAccount`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowaccount/)
The wallet account (a @anywalletkit/wallet-evm account, or a read-only `{ getAddress }` one for views).
##### config?
[Section titled “config?”](#config)
[`MellowProtocolConfig`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowprotocolconfig/) = `{}`
The protocol’s configuration.
#### Returns
[Section titled “Returns”](#returns)
`MellowProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`LendingProtocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`LendingProtocol._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`MellowProtocolConfig`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowprotocolconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`LendingProtocol._config`
***
### vault
[Section titled “vault”](#vault)
> `readonly` **vault**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:298
The vault this protocol talks to.
## Methods
[Section titled “Methods”](#methods)
### \_getSupplyPlan()
[Section titled “\_getSupplyPlan()”](#_getsupplyplan)
> `protected` **\_getSupplyPlan**(`token`, `amount`, `__namedParameters?`): `Promise`<[`SupplyPlan`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyplan/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:636
The transaction(s) a supply needs and the queue it goes to.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token)
`string`
The asset.
##### amount
[Section titled “amount”](#amount)
`bigint`
The amount (base units).
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters)
###### instant?
[Section titled “instant?”](#instant)
`boolean` = `...`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`SupplyPlan`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyplan/)>
***
### \_getWithdrawPlan()
[Section titled “\_getWithdrawPlan()”](#_getwithdrawplan)
> `protected` **\_getWithdrawPlan**(`token`, `shares`): `Promise`<[`WithdrawPlan`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawplan/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:776
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### token
[Section titled “token”](#token-1)
`string`
The payout asset.
##### shares
[Section titled “shares”](#shares)
`bigint`
Shares to redeem.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`WithdrawPlan`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawplan/)>
***
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`_options`): `Promise`<`never`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:875
Always rejects: a Mellow vault does not lend.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_options
[Section titled “\_options”](#_options)
`unknown`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`LendingProtocol.borrow`
***
### cancelSupply()
[Section titled “cancelSupply()”](#cancelsupply)
> **cancelSupply**(`__namedParameters?`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:744
Cancels the account’s open asynchronous deposit request for an asset (only before a report prices it).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters-1)
###### token?
[Section titled “token?”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
***
### claimShares()
[Section titled “claimShares()”](#claimshares)
> **claimShares**(`__namedParameters?`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:760
Moves shares a report already priced from the asset’s deposit queue to the account. Optional — balances count them either way; cheap and idempotent.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters-2)
###### token?
[Section titled “token?”](#token-3)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
***
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<{ `assets`: `object`\[]; `fee`: `bigint`; `hashes`: `string`\[]; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:848
Claims processed redemptions — the asset lands on the account. One transaction per payout asset; `token` picks one, otherwise every asset with claimable requests is swept in sequence.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options?
[Section titled “options?”](#options)
Restrict to a payout asset and/or specific request timestamps.
###### timestamps?
[Section titled “timestamps?”](#timestamps)
`number`\[]
###### token?
[Section titled “token?”](#token-4)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `assets`: `object`\[]; `fee`: `bigint`; `hashes`: `string`\[]; }>
The transactions sent and what they claim.
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:934
Recognize Mellow queue transactions offline (`deposit`, `cancelDepositRequest`, `claim` on deposit queues; `redeem`, `claim` on redeem queues) for the preset vaults and the vault this instance targets. See `activity.ts` for the rule.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-7)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`LendingProtocol.describeActivity`
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:923
The vault’s APY in percent, from Mellow’s registry.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`number`>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(`options?`): `Promise`<[`Position`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/position/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:556
The account’s position: shares, their value in `token` at the latest report, and what sits in the queues.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### options?
[Section titled “options?”](#options-1)
Asset to value the shares in (default native, or the first vault asset when the vault has no native leg).
###### token?
[Section titled “token?”](#token-5)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`Position`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/position/)>
***
### getReport()
[Section titled “getReport()”](#getreport)
> **getReport**(`token?`): `Promise`<[`OracleReport`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/oraclereport/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:493
The oracle’s latest report for an asset: shares per one unit of the asset (1e18 fixed point).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### token?
[Section titled “token?”](#token-6)
`string`
The asset (default native).
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`OracleReport`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/oraclereport/)>
***
### getShares()
[Section titled “getShares()”](#getshares)
> **getShares**(): `Promise`<`bigint`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:544
Vault shares the account holds (18 decimals), including shares priced by a report but not yet physically claimed.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`bigint`>
***
### getStats()
[Section titled “getStats()”](#getstats)
> **getStats**(): `Promise`<[`Stats`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/stats/) | `null`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:899
The vault’s entry in Mellow’s registry: APY, TVL, average withdrawal time. Null when the registry is disabled, unreachable, or does not list the vault.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`Stats`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/stats/) | `null`>
***
### getVaultData()
[Section titled “getVaultData()”](#getvaultdata)
> **getVaultData**(`__namedParameters?`): `Promise`<[`VaultData`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/vaultdata/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:413
The vault’s components, assets and queues as the chain reports them, plus the fee and oracle parameters. Cached per instance (queues change rarely); pass `{ refresh: true }` to re-read.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### \_\_namedParameters?
[Section titled “\_\_namedParameters?”](#__namedparameters-3)
###### refresh?
[Section titled “refresh?”](#refresh)
`boolean` = `false`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`VaultData`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/vaultdata/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawalrequestsview/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:822
The account’s redemption queue across every payout asset: requests newest first, shares still waiting, and what is claimable per asset.
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawalrequestsview/)>
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`_options`): `Promise`<`never`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:880
Always rejects.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### \_options
[Section titled “\_options”](#_options-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`LendingProtocol.quoteBorrow`
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`_options`): `Promise`<`never`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:890
Always rejects.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### \_options
[Section titled “\_options”](#_options-2)
`unknown`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`LendingProtocol.quoteRepay`
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`__namedParameters`): `Promise`<{ `fee`: `bigint`; `instant`: `boolean`; `queue`: `string`; `sharesOut`: `bigint`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:736
Quotes a supply: network fee (approvals included), shares at the latest report, and the queue it would take.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-4)
[`SupplyOptions`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyoptions/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<{ `fee`: `bigint`; `instant`: `boolean`; `queue`: `string`; `sharesOut`: `bigint`; }>
#### Overrides
[Section titled “Overrides”](#overrides-5)
`LendingProtocol.quoteSupply`
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`__namedParameters`): `Promise`<{ `assetsOut`: `bigint`; `fee`: `bigint`; `queue`: `string`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:813
Quotes a redemption request: network fee and the payout at the latest report (after the redeem fee).
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-5)
[`WithdrawOptions`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<{ `assetsOut`: `bigint`; `fee`: `bigint`; `queue`: `string`; }>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`LendingProtocol.quoteWithdraw`
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`_options`): `Promise`<`never`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:885
Always rejects.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### \_options
[Section titled “\_options”](#_options-3)
`unknown`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
`LendingProtocol.repay`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`LendingProtocol.requireSigningAccount`
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`options`): `Promise`<[`SupplyResult`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyresult/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:701
Supplies an asset to the vault. ERC-20 legs approve first (awaited to a mined receipt); the synchronous queue is used when it can mint at once, otherwise the request enters the asynchronous queue and the next report prices it.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### options
[Section titled “options”](#options-2)
[`SupplyOptions`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyoptions/)
`token` (address or ‘native’) and `amount` in base units. `onBehalfOf` is not supported.
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`SupplyResult`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/supplyresult/)>
The result, whether shares minted at once, and the queue used.
#### Overrides
[Section titled “Overrides”](#overrides-8)
`LendingProtocol.supply`
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`options`): `Promise`<[`WithdrawResult`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawresult/)>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:802
Requests a redemption: `amount` is in **shares** (the only unit known before the report); they burn at once and the request is not cancellable. The payout in `token` becomes claimable after the next report that is at least `redeemInterval` later and the curator’s liquidity handling — see [getWithdrawalRequests](/api/anywalletkit/protocol-lending-mellow-evm/classes/default/#getwithdrawalrequests) and [claimWithdrawals](/api/anywalletkit/protocol-lending-mellow-evm/classes/default/#claimwithdrawals).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### options
[Section titled “options”](#options-3)
[`WithdrawOptions`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawoptions/)
`token` = payout asset, `amount` = shares. `to` is not supported.
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`WithdrawResult`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/withdrawresult/)>
The result, the queue and the estimated payout.
#### Overrides
[Section titled “Overrides”](#overrides-9)
`LendingProtocol.withdraw`
# describeMellowActivity
> **describeMellowActivity**(`tx`, `ctx`, `__namedParameters`): `ActivityItem` | `null`
Defined in: protocol-lending-mellow-evm/src/activity.ts:61
Describe `tx` if it is a call on a Mellow queue of a known vault.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`MellowActivityInstance`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowactivityinstance/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# toAsset
> **toAsset**(`token?`): `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:248
Normalizes a token option to the vault’s asset id: ‘native’ / the zero address / the ERC-7528 placeholder all mean ETH. Returns a checksummed address.
## Parameters
[Section titled “Parameters”](#parameters)
### token?
[Section titled “token?”](#token)
`string` | `null`
## Returns
[Section titled “Returns”](#returns)
`string`
# DepositQueueInfo
Defined in: protocol-lending-mellow-evm/src/protocol.ts:108
## Extends
[Section titled “Extends”](#extends)
* [`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/)
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:105
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/).[`address`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/#address)
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"async"` | `"sync"`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:109
***
### paused
[Section titled “paused”](#paused)
> **paused**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:106
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/).[`paused`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/#paused)
# Eip1193Like
Defined in: protocol-lending-mellow-evm/src/protocol.ts:43
A minimal EIP-1193 provider: anything with `request({ method, params })`.
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`args`): `Promise`<`unknown`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:44
#### Parameters
[Section titled “Parameters”](#parameters)
##### args
[Section titled “args”](#args)
###### method
[Section titled “method”](#method)
`string`
###### params?
[Section titled “params?”](#params)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# MellowAccount
Defined in: protocol-lending-mellow-evm/src/protocol.ts:59
The account surface this module uses. `getAddress` is enough for every view; writes need `sendTransaction` (and `quoteSendTransaction` for fee quotes). A full `@anywalletkit/wallet-evm` account satisfies it.
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:60
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### quoteSendTransaction()?
[Section titled “quoteSendTransaction()?”](#quotesendtransaction)
> `optional` **quoteSendTransaction**(`tx`): `Promise`<{ `fee?`: `string` | `number` | `bigint`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:62
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
[`MellowTx`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowtx/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `fee?`: `string` | `number` | `bigint`; }>
***
### sendTransaction()?
[Section titled “sendTransaction()?”](#sendtransaction)
> `optional` **sendTransaction**(`tx`): `Promise`<{ `fee?`: `string` | `number` | `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-mellow-evm/src/protocol.ts:61
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx-1)
[`MellowTx`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowtx/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee?`: `string` | `number` | `bigint`; `hash`: `string`; }>
# MellowAction
Defined in: protocol-lending-mellow-evm/src/activity.ts:22
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: protocol-lending-mellow-evm/src/activity.ts:23
***
### principal
[Section titled “principal”](#principal)
> **principal**: `"in"` | `"out"` | `"none"`
Defined in: protocol-lending-mellow-evm/src/activity.ts:26
Which side of the wallet’s net transfers names the asset in the title.
***
### verb
[Section titled “verb”](#verb)
> **verb**: `string`
Defined in: protocol-lending-mellow-evm/src/activity.ts:24
# MellowActivityInstance
Defined in: protocol-lending-mellow-evm/src/activity.ts:45
The vault this instance targets (its share token when known).
## Properties
[Section titled “Properties”](#properties)
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-mellow-evm/src/activity.ts:46
***
### shareManager?
[Section titled “shareManager?”](#sharemanager)
> `optional` **shareManager?**: `string` | `null`
Defined in: protocol-lending-mellow-evm/src/activity.ts:48
***
### vault?
[Section titled “vault?”](#vault)
> `optional` **vault?**: `string`
Defined in: protocol-lending-mellow-evm/src/activity.ts:47
# MellowCall
Defined in: protocol-lending-mellow-evm/src/protocol.ts:52
A fully specified call: `value` always present.
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:52
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:52
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:52
# MellowProtocolConfig
Defined in: protocol-lending-mellow-evm/src/protocol.ts:205
## Properties
[Section titled “Properties”](#properties)
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:211
The chain the vault lives on (default 1). Only used to pick presets and label errors.
***
### instant?
[Section titled “instant?”](#instant)
> `optional` **instant?**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:217
Try the vault’s synchronous deposit queue first (shares in the same transaction), fall back to the async queue (default true).
***
### maxRedeemRequests?
[Section titled “maxRedeemRequests?”](#maxredeemrequests)
> `optional` **maxRedeemRequests?**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:221
How many redeem requests to read per queue (default 50).
***
### preset?
[Section titled “preset?”](#preset)
> `optional` **preset?**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:209
A key of `MELLOW_ADDRESS_MAP` (e.g. ‘lido-earn-eth’, ‘lido-earn-usd’).
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-lending-mellow-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-lending-mellow-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:213
RPC url(s) or EIP-1193 provider(s) to read the chain through; a list fails over in order. Defaults to the account’s own provider.
***
### queues?
[Section titled “queues?”](#queues)
> `optional` **queues?**: `object`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:227
The deposit / redeem queues money may go to (scan 2026-10-27 modules, F25/F26). Required for a custom `vault`; a preset ships its own list (`MELLOW_ADDRESS_MAP[...].queues`) and these addresses are added to it — a queue Mellow adds after a release, say. A queue the RPC names that is not pinned is refused before any approval.
#### deposit?
[Section titled “deposit?”](#deposit)
> `optional` **deposit?**: readonly `string`\[]
#### redeem?
[Section titled “redeem?”](#redeem)
> `optional` **redeem?**: readonly `string`\[]
***
### referral?
[Section titled “referral?”](#referral)
> `optional` **referral?**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:219
Referral address forwarded to the deposit queues (default zero address).
***
### registry?
[Section titled “registry?”](#registry)
> `optional` **registry?**: `string` | `null`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:215
Mellow’s vault registry URL for APY / TVL / withdrawal time (decoration). `null` disables it.
***
### vault?
[Section titled “vault?”](#vault)
> `optional` **vault?**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:207
The Core Vault address. Required unless `preset` names a known vault.
# MellowTx
Defined in: protocol-lending-mellow-evm/src/protocol.ts:50
A transaction as the module hands it to the account (approvals carry no `value`).
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:50
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:50
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:50
# MellowVaultPreset
Defined in: protocol-lending-mellow-evm/src/address-map.ts:2
A known Core Vault: everything but the address is discovered on-chain; the rest decorates.
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:8
Display name.
***
### note?
[Section titled “note?”](#note)
> `optional` **note?**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:20
Caveats known at the time the preset was added.
***
### queues?
[Section titled “queues?”](#queues)
> `optional` **queues?**: `object`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:18
Deposit / redeem queues the vault listed when the preset was last verified (2026-10-28: identical to the chain). Writes go only to these (scan 2026-10-27 modules, F25/F26) — the RPC’s `queueAt` picks among them, never beyond — and `describeActivity` recognizes past transactions by them.
#### deposit
[Section titled “deposit”](#deposit)
> **deposit**: `string`\[]
#### redeem
[Section titled “redeem”](#redeem)
> **redeem**: `string`\[]
***
### registryId
[Section titled “registryId”](#registryid)
> **registryId**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:6
The vault’s id in Mellow’s registry (APY / TVL decoration).
***
### shareManager?
[Section titled “shareManager?”](#sharemanager)
> `optional` **shareManager?**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:12
The TokenizedShareManager, i.e. the ERC-20 share token (read from `vault.shareManager()`).
***
### shareSymbol
[Section titled “shareSymbol”](#sharesymbol)
> **shareSymbol**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:10
The share token’s ticker.
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-mellow-evm/src/address-map.ts:4
The Core Vault address (everything else is discovered on-chain).
# OracleReport
Defined in: protocol-lending-mellow-evm/src/protocol.ts:136
## Properties
[Section titled “Properties”](#properties)
### priceD18
[Section titled “priceD18”](#priced18)
> **priceD18**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:138
Shares per one unit of the asset, 1e18 fixed point.
***
### suspicious
[Section titled “suspicious”](#suspicious)
> **suspicious**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:141
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:140
Unix seconds.
# PendingDeposit
Defined in: protocol-lending-mellow-evm/src/protocol.ts:144
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:148
***
### queue
[Section titled “queue”](#queue)
> **queue**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:146
***
### requestedAt
[Section titled “requestedAt”](#requestedat)
> **requestedAt**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:147
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:145
# Position
Defined in: protocol-lending-mellow-evm/src/protocol.ts:162
## Properties
[Section titled “Properties”](#properties)
### claimableShares
[Section titled “claimableShares”](#claimableshares)
> **claimableShares**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:172
***
### pendingDeposits
[Section titled “pendingDeposits”](#pendingdeposits)
> **pendingDeposits**: [`PendingDeposit`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/pendingdeposit/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:173
***
### priceD18
[Section titled “priceD18”](#priced18)
> **priceD18**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:167
***
### redeemRequests
[Section titled “redeemRequests”](#redeemrequests)
> **redeemRequests**: [`RedeemRequest`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemrequest/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:174
***
### reportAt
[Section titled “reportAt”](#reportat)
> **reportAt**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:170
***
### shares
[Section titled “shares”](#shares)
> **shares**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:164
Shares held (18 decimals), including those priced but not yet claimed.
***
### suspicious
[Section titled “suspicious”](#suspicious)
> **suspicious**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:171
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:166
Asset the shares are valued in.
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:169
Value of the shares in `token` at the latest report.
# QueueInfo
Defined in: protocol-lending-mellow-evm/src/protocol.ts:104
## Extended by
[Section titled “Extended by”](#extended-by)
* [`DepositQueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/depositqueueinfo/)
* [`RedeemQueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemqueueinfo/)
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:105
***
### paused
[Section titled “paused”](#paused)
> **paused**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:106
# RedeemQueueInfo
Defined in: protocol-lending-mellow-evm/src/protocol.ts:111
## Extends
[Section titled “Extends”](#extends)
* [`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/)
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:105
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/).[`address`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/#address)
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"async"` | `"signature"`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:112
***
### paused
[Section titled “paused”](#paused)
> **paused**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:106
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`QueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/).[`paused`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/queueinfo/#paused)
# RedeemRequest
Defined in: protocol-lending-mellow-evm/src/protocol.ts:151
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:159
Priced after the report; 0 until then.
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:157
***
### queue
[Section titled “queue”](#queue)
> **queue**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:153
***
### shares
[Section titled “shares”](#shares)
> **shares**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:156
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:155
Unix seconds — the request’s id inside its queue.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:152
# Stats
Defined in: protocol-lending-mellow-evm/src/protocol.ts:183
## Properties
[Section titled “Properties”](#properties)
### apy
[Section titled “apy”](#apy)
> **apy**: `number` | `null`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:186
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:184
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:185
***
### tvlUsd
[Section titled “tvlUsd”](#tvlusd)
> **tvlUsd**: `number` | `null`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:187
***
### withdrawAvgSeconds
[Section titled “withdrawAvgSeconds”](#withdrawavgseconds)
> **withdrawAvgSeconds**: `number` | `null`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:188
# SupplyOptions
Defined in: protocol-lending-mellow-evm/src/protocol.ts:66
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:70
Amount in the asset’s base units.
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:72
Not supported — the queues credit the depositor.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:68
Asset address, or “native” for ETH.
# SupplyPlan
Defined in: protocol-lending-mellow-evm/src/protocol.ts:191
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: `object`\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:193
#### data
[Section titled “data”](#data)
> **data**: `string`
#### to
[Section titled “to”](#to)
> **to**: `string`
***
### instant
[Section titled “instant”](#instant)
> **instant**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:196
***
### queue
[Section titled “queue”](#queue)
> **queue**: [`DepositQueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/depositqueueinfo/)
Defined in: protocol-lending-mellow-evm/src/protocol.ts:192
***
### sharesOut
[Section titled “sharesOut”](#sharesout)
> **sharesOut**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:195
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`MellowCall`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowcall/)
Defined in: protocol-lending-mellow-evm/src/protocol.ts:194
# SupplyResult
Defined in: protocol-lending-mellow-evm/src/protocol.ts:75
## Properties
[Section titled “Properties”](#properties)
### approveHashes
[Section titled “approveHashes”](#approvehashes)
> **approveHashes**: `string`\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:83
Approval transactions sent (awaited) before the deposit.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:77
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:76
***
### instant
[Section titled “instant”](#instant)
> **instant**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:79
True when the synchronous queue minted shares in this transaction.
***
### queue
[Section titled “queue”](#queue)
> **queue**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:81
The deposit queue used.
# VaultAsset
Defined in: protocol-lending-mellow-evm/src/protocol.ts:115
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:116
***
### depositQueues
[Section titled “depositQueues”](#depositqueues)
> **depositQueues**: [`DepositQueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/depositqueueinfo/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:118
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:117
***
### redeemQueues
[Section titled “redeemQueues”](#redeemqueues)
> **redeemQueues**: [`RedeemQueueInfo`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemqueueinfo/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:119
# VaultData
Defined in: protocol-lending-mellow-evm/src/protocol.ts:122
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: [`VaultAsset`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/vaultasset/)\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:128
***
### feeManager
[Section titled “feeManager”](#feemanager)
> **feeManager**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:125
***
### fees
[Section titled “fees”](#fees)
> **fees**: `object`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:130
Percent.
#### depositPct
[Section titled “depositPct”](#depositpct)
> **depositPct**: `number`
#### performancePct
[Section titled “performancePct”](#performancepct)
> **performancePct**: `number`
#### protocolPct
[Section titled “protocolPct”](#protocolpct)
> **protocolPct**: `number`
#### redeemPct
[Section titled “redeemPct”](#redeempct)
> **redeemPct**: `number`
***
### flags
[Section titled “flags”](#flags)
> **flags**: `object`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:133
#### hasBurnPause
[Section titled “hasBurnPause”](#hasburnpause)
> **hasBurnPause**: `boolean`
#### hasMintPause
[Section titled “hasMintPause”](#hasmintpause)
> **hasMintPause**: `boolean`
#### hasWhitelist
[Section titled “hasWhitelist”](#haswhitelist)
> **hasWhitelist**: `boolean`
***
### oracle
[Section titled “oracle”](#oracle)
> **oracle**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:126
***
### oracleParams
[Section titled “oracleParams”](#oracleparams)
> **oracleParams**: `object`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:132
Seconds.
#### depositInterval
[Section titled “depositInterval”](#depositinterval)
> **depositInterval**: `number`
#### redeemInterval
[Section titled “redeemInterval”](#redeeminterval)
> **redeemInterval**: `number`
#### timeout
[Section titled “timeout”](#timeout)
> **timeout**: `number`
***
### riskManager
[Section titled “riskManager”](#riskmanager)
> **riskManager**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:127
***
### shareManager
[Section titled “shareManager”](#sharemanager)
> **shareManager**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:124
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:123
# WithdrawalRequestsView
Defined in: protocol-lending-mellow-evm/src/protocol.ts:177
## Properties
[Section titled “Properties”](#properties)
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `object`\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:180
#### assets
[Section titled “assets”](#assets)
> **assets**: `bigint`
#### queue
[Section titled “queue”](#queue)
> **queue**: `string`
#### timestamps
[Section titled “timestamps”](#timestamps)
> **timestamps**: `number`\[]
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### pendingShares
[Section titled “pendingShares”](#pendingshares)
> **pendingShares**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:179
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`RedeemRequest`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/redeemrequest/) & `object`\[]
Defined in: protocol-lending-mellow-evm/src/protocol.ts:178
# WithdrawOptions
Defined in: protocol-lending-mellow-evm/src/protocol.ts:86
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:90
Vault SHARES to redeem (18 decimals).
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:92
Not supported — the redeem queue pays the requesting account.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:88
Payout asset address, or “native”.
# WithdrawPlan
Defined in: protocol-lending-mellow-evm/src/protocol.ts:199
## Properties
[Section titled “Properties”](#properties)
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:202
***
### queue
[Section titled “queue”](#queue)
> **queue**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:200
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`MellowCall`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowcall/)
Defined in: protocol-lending-mellow-evm/src/protocol.ts:201
# WithdrawResult
Defined in: protocol-lending-mellow-evm/src/protocol.ts:95
## Properties
[Section titled “Properties”](#properties)
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:101
Estimated payout at the latest report, after the redeem fee.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:97
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:96
***
### queue
[Section titled “queue”](#queue)
> **queue**: `string`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:99
The redeem queue used.
# EvmProvider
> **EvmProvider** = `string` | [`Eip1193Like`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/eip1193like/)
Defined in: protocol-lending-mellow-evm/src/protocol.ts:47
An RPC url or an EIP-1193 provider.
# DEFAULT_REGISTRY
> `const` **DEFAULT_REGISTRY**: `"https://api.mellow.finance/v1/vaults"` = `'https://api.mellow.finance/v1/vaults'`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:36
Mellow’s public vault registry — APY / TVL / withdrawal time (decoration only).
# MELLOW_ACTIONS
> `const` **MELLOW_ACTIONS**: `Readonly`<`Record`<`string`, [`MellowAction`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowaction/)>>
Defined in: protocol-lending-mellow-evm/src/activity.ts:33
Queue selector → action. `principal` says which side of the wallet’s net transfers names the asset in the title.
# MELLOW_ADDRESS_MAP
> `const` **MELLOW_ADDRESS_MAP**: `Record`<`number`, `Record`<`string`, [`MellowVaultPreset`](/api/anywalletkit/protocol-lending-mellow-evm/interfaces/mellowvaultpreset/)>>
Defined in: protocol-lending-mellow-evm/src/address-map.ts:30
Known Core Vaults by chain id and key. Presets are a convenience: any vault on the same contracts works by passing its address as `vault`. Addresses verified against the on-chain vault getters on 2026-09-07; `shareManager` and `queues` read from the same getters on 2026-10-14, queues re-checked on 2026-10-28 (every preset: no queue added or gone).
# NATIVE_ASSET
> `const` **NATIVE_ASSET**: `"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"` = `'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'`
Defined in: protocol-lending-mellow-evm/src/protocol.ts:34
The vault’s id for native ETH (the ERC-7528 placeholder).
# @anywalletkit/protocol-lending-morpho-evm
# @anywalletkit/protocol-lending-morpho-evm
[Section titled “@anywalletkit/protocol-lending-morpho-evm”](#anywalletkitprotocol-lending-morpho-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-lending-morpho-evm)
[Morpho](https://docs.morpho.org) for `@anywalletkit/wallet-evm` accounts, two `LendingProtocol`s in one package:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-lending-morpho-evm @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-lending-morpho-evm @anywalletkit/core · yarn add @anywalletkit/protocol-lending-morpho-evm @anywalletkit/core
```
On npm: [@anywalletkit/protocol-lending-morpho-evm](https://www.npmjs.com/package/@anywalletkit/protocol-lending-morpho-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
* **`MorphoVaultProtocolEvm`** — a Morpho Vault (MetaMorpho / Vault V1, or Vault V2): `supply` deposits the vault’s asset for shares, `withdraw` redeems them. The simplest Earn product; `borrow` / `repay` reject.
* **`MorphoMarketProtocolEvm`** — one Morpho Blue market: `supply` / `withdraw` lend the loan token, `supplyCollateral` / `withdrawCollateral` post and take collateral, `borrow` / `repay` take and return the loan token against it.
Written from the protocol’s own interfaces (morpho-blue, metamorpho, vault-v2) with the shares and interest maths ported from `SharesMathLib` / `MathLib` / `Morpho._accrueInterest`; one dependency (viem). The Morpho GraphQL API is used only for discovery and decoration (listing, APY, TVL); every money path reads the chain.
## Chains
[Section titled “Chains”](#chains)
Ethereum, Base, Arbitrum, OP Mainnet, Polygon, Unichain, HyperEVM, Katana, Monad, Robinhood Chain (`MORPHO_CHAINS`). The Morpho (Blue) addresses come from docs.morpho.org; the vault factories are the ones behind every vault the Morpho API lists (the docs carry no factory table). Other chains take `morpho` in the config.
## Usage
[Section titled “Usage”](#usage)
```ts
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import { MorphoVaultProtocolEvm, MorphoMarketProtocolEvm, MorphoApi } from '@anywalletkit/protocol-lending-morpho-evm'
const account = await new WalletManagerEvm(seed, { provider: 'https://base-rpc…' }).getAccount(0)
// Discovery (API): the listed USDC vaults on Base, biggest first
const api = new MorphoApi()
const [best] = await api.listVaults({ chainId: 8453, asset: USDC })
// Vault
const vault = new MorphoVaultProtocolEvm(account, { vault: best.address })
await vault.getVault() // verified against Morpho's factories; asset, fees, timelock…
await vault.getApy() // 4.1 (net, percent, from the API)
await vault.supply({ amount: 5_000_000n }) // exact approve → deposit(assets, me)
await vault.getPosition() // { shares, assets, withdrawable }
await vault.withdraw({ amount: 'max' }) // redeem(every share) — refused up front if the vault lacks liquidity
// Market (Blue)
const market = new MorphoMarketProtocolEvm(account, { market: '0x9103…1836' }) // id or MarketParams
const m = await market.getMarket() // loan/collateral tokens, LLTV, price, state accrued to now, APYs, liquidity
await market.supplyCollateral({ amount: 10n ** 7n }) // 0.1 cbBTC
await market.borrow({ amount: 3_000_000_000n }) // 3 000 USDC — refused if above LLTV or market liquidity
await market.getPosition() // debt (rounded up), collateral value, health factor, liquidation price
await market.repay({ amount: 'max' }) // by shares, no dust; allowance = debt + 0.1 %
await market.withdrawCollateral({ amount: 'max' })
```
### Safety before money moves
[Section titled “Safety before money moves”](#safety-before-money-moves)
* **Vault identity.** `getVault()` asks the chain’s Morpho vault factories (`isMetaMorpho` / `isVaultV2`) whether they created the address, and a V1 vault’s `MORPHO()` must be the chain’s singleton. An unknown address is refused unless `allowUnverifiedVault: true`.
* **Vault limits.** V1: deposits are checked against `maxDeposit` (caps), withdrawals against `maxWithdraw` / `maxRedeem` (vault liquidity) — the error says how much *is* possible right now. V2 answers 0 from every max\* view, so its transfer gates are read (`canReceiveShares` / `canSendAssets` in, `canSendShares` / `canReceiveAssets` out) and caps and liquidity are left to the `eth_call` proof that runs before every send.
* **Market identity.** An id is resolved with `idToMarketParams`, and the RPC’s answer must hash back to the id or it is refused; params given in config are hashed to the id and the market must exist (`lastUpdate ≠ 0`). The golden test derives the live Base cbBTC/USDC id from its params.
* **Market state.** `market()` is accrued to now exactly as `accrueInterest` would (Taylor-compounded borrow rate from the IRM, fee shares), so supplied / borrowed assets, health and liquidity are current, not last-touch.
* **Health.** Borrows and collateral withdrawals are checked against `collateral × price / 1e36 × LLTV`; liquidity against supply − borrow. `onBehalfOf` borrows need `isAuthorized`.
* **Proof.** Every main transaction is `eth_call`ed from the account; Morpho’s revert strings (`insufficient liquidity`, `insufficient collateral`, …) and the vaults’ custom errors (`AllCapsReached`, `ERC4626ExceededMaxWithdraw`, V2 `CannotReceiveShares`, …) become readable `MorphoError`s.
* **Approvals** are exact (never unlimited), with the `approve(0)` reset Ethereum’s USDT demands. Morpho has no native-coin path: wrap first.
### Reads
[Section titled “Reads”](#reads)
| | returns |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `vault.getVault()` | version, factory, name, asset, totalAssets, share price, fees, timelock, curator |
| `vault.getPosition()` | shares, assets, withdrawable now |
| `vault.getApy()`, `vault.getStats()` | net APY %, API record |
| `market.getMarket()` | params, tokens, LLTV, oracle price (1e36), accrued state, liquidity, utilization, borrow/supply APY |
| `market.getPosition(user?)` | supply/borrow shares and assets, collateral, collateral value, max borrow, health factor, LTV, liquidation price |
| `MorphoApi.listVaults / listMarkets / vault / marketById` | discovery, biggest first, `listed: true` |
## Tests
[Section titled “Tests”](#tests)
`pnpm test` — 27 offline tests over an in-memory Morpho on Base (Blue singleton with the real cbBTC/USDC market params, IRM, oracle, a MetaMorpho vault behind the v1.0 factory, a look-alike vault, Multicall3, reverts) plus the conformance suite for both protocols. `pnpm verify:live` reads Base through a public RPC and the API.
## Status
[Section titled “Status”](#status)
2026-10-10: built, offline tests green, live read-only verification on Base. No funded transaction through the module yet (plan: 5 USDC into a Base vault, withdraw).
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels Morpho transactions for a wallet’s history, offline and synchronously (shared by both classes through `MorphoBase`):
* **Blue** is recognized **by address**: the called contract is the Morpho singleton of the transaction’s chain (`MORPHO_CHAINS`, or the `morpho` this instance was configured with) and the selector is `supply` / `withdraw` / `borrow` / `repay` / `supplyCollateral` / `withdrawCollateral` (→ `supply` / `withdraw` / `borrow` / `repay`) or `setAuthorization` (→ `contract`). The principal asset is `MarketParams.loanToken` from calldata when present.
* **Vaults** (MetaMorpho / Vault V1, Vault V2) cannot be listed offline — they come from factories and the `isMetaMorpho` / `isVaultV2` proof needs a node — so the rule is: the selector is an ERC-4626 entry point (`deposit` / `mint` → `supply`, `withdraw` / `redeem` → `withdraw`) **and** the called contract is itself the share token the receipt shows minted to (deposit) or burned from (withdraw) one of the wallet’s addresses, on a chain with a Morpho deployment. The vault a `MorphoVaultProtocolEvm` instance is configured with is accepted by address alone. *Caveat:* any ERC-4626 vault on a Morpho chain satisfies the generic rule; the kit asks modules in registry order, so a module that knows a specific vault should be registered before this one.
* **Title** `" "` (“Deposited USDC”, “Withdrew USDC”; the share token is never the principal), **subtitle** `"Morpho · "` / `"Morpho Vault · "`, `counterparty` the contract called, `protocol` the package name; `assetsIn` / `assetsOut` are the wallet’s net movements (shares included).
* **Null** otherwise.
Fixtures in `fixtures/activity/` are public Base transactions (a Moonwell Flagship USDC vault `deposit` / `redeem` by one account, a Blue `supply` / `withdraw` by another; the test wallet has not run Morpho yet), `negatives/` an Aave gateway deposit and a plain USDC transfer.
## Classes
[Section titled “Classes”](#classes)
* [MorphoApi](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphoapi/)
* [MorphoError](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphoerror/)
* [MorphoMarketProtocolEvm](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphomarketprotocolevm/)
* [MorphoVaultProtocolEvm](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphovaultprotocolevm/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ApiMarket](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/)
* [ApiVault](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/)
* [MarketInfo](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketinfo/)
* [MarketParams](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketparams/)
* [MarketPosition](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketposition/)
* [MarketState](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
* [MorphoActivityAction](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivityaction/)
* [MorphoActivityContext](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivitycontext/)
* [MorphoBaseConfig](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/)
* [MorphoChain](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphochain/)
* [MorphoMarketBorrowOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketborrowoptions/)
* [MorphoMarketConfig](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketconfig/)
* [MorphoMarketRepayOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketrepayoptions/)
* [MorphoMarketSupplyOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketsupplyoptions/)
* [MorphoMarketWithdrawOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketwithdrawoptions/)
* [MorphoVaultConfig](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultconfig/)
* [MorphoVaultSupplyOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultsupplyoptions/)
* [MorphoVaultWithdrawOptions](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultwithdrawoptions/)
* [Tx](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
* [VaultInfo](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultinfo/)
* [VaultPosition](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultposition/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [AmountOption](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
* [EvmProvider](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/)
## Variables
[Section titled “Variables”](#variables)
* [BLUE_ACTIONS](/api/anywalletkit/protocol-lending-morpho-evm/variables/blue_actions/)
* [BLUE_ERRORS](/api/anywalletkit/protocol-lending-morpho-evm/variables/blue_errors/)
* [ERC4626_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/erc4626_abi/)
* [IRM_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/irm_abi/)
* [MODULE_NAME](/api/anywalletkit/protocol-lending-morpho-evm/variables/module_name/)
* [MORPHO_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/morpho_abi/)
* [MORPHO_API](/api/anywalletkit/protocol-lending-morpho-evm/variables/morpho_api/)
* [MORPHO_CHAIN_IDS](/api/anywalletkit/protocol-lending-morpho-evm/variables/morpho_chain_ids/)
* [MORPHO_CHAINS](/api/anywalletkit/protocol-lending-morpho-evm/variables/morpho_chains/)
* [ORACLE_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/oracle_abi/)
* [ORACLE_PRICE_SCALE](/api/anywalletkit/protocol-lending-morpho-evm/variables/oracle_price_scale/)
* [SECONDS_PER_YEAR](/api/anywalletkit/protocol-lending-morpho-evm/variables/seconds_per_year/)
* [VAULT_ACTIONS](/api/anywalletkit/protocol-lending-morpho-evm/variables/vault_actions/)
* [VAULT_V1_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/vault_v1_abi/)
* [VAULT_V2_ABI](/api/anywalletkit/protocol-lending-morpho-evm/variables/vault_v2_abi/)
* [VIRTUAL_ASSETS](/api/anywalletkit/protocol-lending-morpho-evm/variables/virtual_assets/)
* [VIRTUAL_SHARES](/api/anywalletkit/protocol-lending-morpho-evm/variables/virtual_shares/)
* [WAD](/api/anywalletkit/protocol-lending-morpho-evm/variables/wad/)
## Functions
[Section titled “Functions”](#functions)
* [accrue](/api/anywalletkit/protocol-lending-morpho-evm/functions/accrue/)
* [collateralValue](/api/anywalletkit/protocol-lending-morpho-evm/functions/collateralvalue/)
* [decodeMorphoRevert](/api/anywalletkit/protocol-lending-morpho-evm/functions/decodemorphorevert/)
* [describeMorphoActivity](/api/anywalletkit/protocol-lending-morpho-evm/functions/describemorphoactivity/)
* [marketId](/api/anywalletkit/protocol-lending-morpho-evm/functions/marketid/)
* [maxBorrow](/api/anywalletkit/protocol-lending-morpho-evm/functions/maxborrow/)
* [presetContext](/api/anywalletkit/protocol-lending-morpho-evm/functions/presetcontext/)
* [rateToApyPct](/api/anywalletkit/protocol-lending-morpho-evm/functions/ratetoapypct/)
* [supplyApyPct](/api/anywalletkit/protocol-lending-morpho-evm/functions/supplyapypct/)
* [toAssetsDown](/api/anywalletkit/protocol-lending-morpho-evm/functions/toassetsdown/)
* [toAssetsUp](/api/anywalletkit/protocol-lending-morpho-evm/functions/toassetsup/)
* [toSharesDown](/api/anywalletkit/protocol-lending-morpho-evm/functions/tosharesdown/)
* [toSharesUp](/api/anywalletkit/protocol-lending-morpho-evm/functions/tosharesup/)
* [wTaylorCompounded](/api/anywalletkit/protocol-lending-morpho-evm/functions/wtaylorcompounded/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [MorphoVaultProtocolEvm](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphovaultprotocolevm/)
# MorphoApi
Defined in: protocol-lending-morpho-evm/src/api.ts:49
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MorphoApi**(`endpoint?`, `fetchImpl?`): `MorphoApi`
Defined in: protocol-lending-morpho-evm/src/api.ts:50
#### Parameters
[Section titled “Parameters”](#parameters)
##### endpoint?
[Section titled “endpoint?”](#endpoint)
`string` = `MORPHO_API`
##### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
#### Returns
[Section titled “Returns”](#returns)
`MorphoApi`
## Methods
[Section titled “Methods”](#methods)
### listMarkets()
[Section titled “listMarkets()”](#listmarkets)
> **listMarkets**(`o`): `Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/)\[]>
Defined in: protocol-lending-morpho-evm/src/api.ts:123
Listed Blue markets on a chain, optionally filtered by loan / collateral token, biggest first.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### o
[Section titled “o”](#o)
###### chainId
[Section titled “chainId”](#chainid)
`number`
###### collateralToken?
[Section titled “collateralToken?”](#collateraltoken)
`` `0x${string}` ``
###### first?
[Section titled “first?”](#first)
`number`
###### loanToken?
[Section titled “loanToken?”](#loantoken)
`` `0x${string}` ``
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/)\[]>
***
### listVaults()
[Section titled “listVaults()”](#listvaults)
> **listVaults**(`o`): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/)\[]>
Defined in: protocol-lending-morpho-evm/src/api.ts:79
Listed vaults on a chain (both generations), optionally for one deposit asset, biggest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### o
[Section titled “o”](#o-1)
###### asset?
[Section titled “asset?”](#asset)
`` `0x${string}` ``
###### chainId
[Section titled “chainId”](#chainid-1)
`number`
###### first?
[Section titled “first?”](#first-1)
`number`
###### version?
[Section titled “version?”](#version)
`"v1"` | `"v2"`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/)\[]>
***
### marketById()
[Section titled “marketById()”](#marketbyid)
> **marketById**(`id`, `chainId`): `Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/) | `null`>
Defined in: protocol-lending-morpho-evm/src/api.ts:134
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### id
[Section titled “id”](#id)
`` `0x${string}` ``
##### chainId
[Section titled “chainId”](#chainid-2)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/) | `null`>
***
### vault()
[Section titled “vault()”](#vault)
> **vault**(`address`, `chainId`): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/) | `null`>
Defined in: protocol-lending-morpho-evm/src/api.ts:99
One vault by address, whichever generation it is; null when the API does not know it.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address)
`` `0x${string}` ``
##### chainId
[Section titled “chainId”](#chainid-3)
`number`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/) | `null`>
# MorphoError
Defined in: protocol-lending-morpho-evm/src/errors.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MorphoError**(`message`, `code?`): `MorphoError`
Defined in: protocol-lending-morpho-evm/src/errors.ts:8
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
`string`
#### Returns
[Section titled “Returns”](#returns)
`MorphoError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `string` | `undefined`
Defined in: protocol-lending-morpho-evm/src/errors.ts:7
# MorphoMarketProtocolEvm
Defined in: protocol-lending-morpho-evm/src/market.ts:75
One Morpho Blue market as a `LendingProtocol`: `supply` / `withdraw` lend the loan token to the market (shares appreciate with borrowers’ interest), `borrow` / `repay` take and return the loan token against the collateral the account posts with `supplyCollateral` / `withdrawCollateral`.
The market is resolved on-chain from its id or params (`idToMarketParams`, `market().lastUpdate != 0`), state is read with interest accrued to now the way `accrueInterest` would, and every write is checked against the market’s liquidity and the position’s health (oracle price × LLTV) before `eth_call` proves it. Morpho’s revert strings are translated.
## Extends
[Section titled “Extends”](#extends)
* `MorphoBase`<[`MorphoMarketConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MorphoMarketProtocolEvm**(`account`, `config`): `MorphoMarketProtocolEvm`
Defined in: protocol-lending-morpho-evm/src/market.ts:80
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
[`MorphoMarketConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketconfig/)
#### Returns
[Section titled “Returns”](#returns)
`MorphoMarketProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`MorphoBase.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`MorphoBase._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`MorphoMarketConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`MorphoBase._config`
***
### api
[Section titled “api”](#api)
> `protected` `readonly` **api**: [`MorphoApi`](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphoapi/) | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:51
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`MorphoBase.api`
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: [`MorphoChain`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphochain/)
Defined in: protocol-lending-morpho-evm/src/base.ts:50
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`MorphoBase.chain`
***
### chainId
[Section titled “chainId”](#chainid)
> `readonly` **chainId**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:49
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`MorphoBase.chainId`
## Accessors
[Section titled “Accessors”](#accessors)
### activityVault
[Section titled “activityVault”](#activityvault)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** `protected` **activityVault**(): `string` | `undefined`
Defined in: protocol-lending-morpho-evm/src/base.ts:77
A vault this instance targets (the vault protocol sets it); accepted by address in `describeActivity`.
##### Returns
[Section titled “Returns”](#returns-1)
`string` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`MorphoBase.activityVault`
***
### client
[Section titled “client”](#client)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** `protected` **client**(): `object`
Defined in: protocol-lending-morpho-evm/src/base.ts:99
##### Returns
[Section titled “Returns”](#returns-2)
`object`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`MorphoBase.client`
***
### id
[Section titled “id”](#id)
#### Get Signature
[Section titled “Get Signature”](#get-signature-2)
> **get** **id**(): `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/market.ts:99
The market id.
##### Returns
[Section titled “Returns”](#returns-3)
`` `0x${string}` ``
## Methods
[Section titled “Methods”](#methods)
### approvals()
[Section titled “approvals()”](#approvals)
> `protected` **approvals**(`token`, `spender`, `amount`): `Promise`<[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]>
Defined in: protocol-lending-morpho-evm/src/base.ts:160
Exact-amount ERC-20 approvals, with the approve(0) reset Ethereum’s USDT demands before a raise.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token)
`` `0x${string}` ``
##### spender
[Section titled “spender”](#spender)
`` `0x${string}` ``
##### amount
[Section titled “amount”](#amount)
`bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`MorphoBase.approvals`
***
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:318
Borrows `amount` of the loan token against the account’s collateral (or `onBehalfOf`’s, with authorization) to `to`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### o
[Section titled “o”](#o)
[`MorphoMarketBorrowOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketborrowoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`MorphoBase.borrow`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:84
Recognize Morpho transactions offline: Blue by the singleton’s address (preset for the transaction’s chain, or this instance’s), vaults by ERC-4626 selector + the called contract’s shares minted to / burned from the wallet. See `activity.ts`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-6)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`MorphoBase.describeActivity`
***
### encode()
[Section titled “encode()”](#encode)
> `protected` **encode**(`abi`, `functionName`, `args`): `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/base.ts:108
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### abi
[Section titled “abi”](#abi)
readonly `unknown`\[]
##### functionName
[Section titled “functionName”](#functionname)
`string`
##### args
[Section titled “args”](#args)
readonly `unknown`\[]
#### Returns
[Section titled “Returns”](#returns-7)
`` `0x${string}` ``
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`MorphoBase.encode`
***
### execute()
[Section titled “execute()”](#execute)
> `protected` **execute**(`plan`, `action`): `Promise`<{ `approveHashes`: `string`\[]; `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:171
Approvals (each awaited to a receipt), then the main transaction, proven first.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### plan
[Section titled “plan”](#plan)
###### approvals
[Section titled “approvals”](#approvals-1)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]
###### tx
[Section titled “tx”](#tx-1)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
##### action
[Section titled “action”](#action)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<{ `approveHashes`: `string`\[]; `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`MorphoBase.execute`
***
### getMarket()
[Section titled “getMarket()”](#getmarket)
> **getMarket**(): `Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketinfo/)>
Defined in: protocol-lending-morpho-evm/src/market.ts:126
The market with interest accrued to now, oracle price and rates.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`MarketInfo`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketinfo/)>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(`user?`): `Promise`<[`MarketPosition`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketposition/)>
Defined in: protocol-lending-morpho-evm/src/market.ts:145
The account’s (or `user`’s) position with health computed at the current oracle price.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### user?
[Section titled “user?”](#user)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`MarketPosition`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketposition/)>
***
### getStats()
[Section titled “getStats()”](#getstats)
> **getStats**(): `Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/) | `null`>
Defined in: protocol-lending-morpho-evm/src/market.ts:165
The market’s API record (APY, listed, TVL) — decoration; null without API.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`ApiMarket`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apimarket/) | `null`>
***
### me()
[Section titled “me()”](#me)
> `protected` **me**(): `Promise`<`` `0x${string}` ``>
Defined in: protocol-lending-morpho-evm/src/base.ts:112
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`` `0x${string}` ``>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`MorphoBase.me`
***
### previewSupplyShares()
[Section titled “previewSupplyShares()”](#previewsupplyshares)
> **previewSupplyShares**(`assets`): `Promise`<`bigint`>
Defined in: protocol-lending-morpho-evm/src/market.ts:373
Shares the market would mint for `assets` supplied now (for previews).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### assets
[Section titled “assets”](#assets)
`bigint`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`bigint`>
***
### prove()
[Section titled “prove()”](#prove)
> `protected` **prove**(`tx`, `action`): `Promise`<`void`>
Defined in: protocol-lending-morpho-evm/src/base.ts:142
`eth_call` from the account; a Morpho / vault revert becomes a readable MorphoError.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### tx
[Section titled “tx”](#tx-2)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
##### action
[Section titled “action”](#action-1)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`MorphoBase.prove`
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:325
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### o
[Section titled “o”](#o-1)
[`MorphoMarketBorrowOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketborrowoptions/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`MorphoBase.quoteBorrow`
***
### quoteFee()
[Section titled “quoteFee()”](#quotefee)
> `protected` **quoteFee**(`txs`): `Promise`<`bigint`>
Defined in: protocol-lending-morpho-evm/src/base.ts:150
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### txs
[Section titled “txs”](#txs)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`MorphoBase.quoteFee`
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:358
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### o
[Section titled “o”](#o-2)
[`MorphoMarketRepayOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketrepayoptions/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`MorphoBase.quoteRepay`
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:196
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### o
[Section titled “o”](#o-3)
[`MorphoMarketSupplyOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`MorphoBase.quoteSupply`
***
### quoteSupplyCollateral()
[Section titled “quoteSupplyCollateral()”](#quotesupplycollateral)
> **quoteSupplyCollateral**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:254
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### o
[Section titled “o”](#o-4)
###### amount
[Section titled “amount”](#amount-1)
`number` | `bigint`
###### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`LendingQuote` & `object`>
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:228
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### o
[Section titled “o”](#o-5)
[`MorphoMarketWithdrawOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-5)
`MorphoBase.quoteWithdraw`
***
### quoteWithdrawCollateral()
[Section titled “quoteWithdrawCollateral()”](#quotewithdrawcollateral)
> **quoteWithdrawCollateral**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:286
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### o
[Section titled “o”](#o-6)
###### amount
[Section titled “amount”](#amount-2)
[`AmountOption`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
###### to?
[Section titled “to?”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`LendingQuote` & `object`>
***
### read()
[Section titled “read()”](#read)
> `protected` **read**<`T`>(`address`, `abi`, `functionName`, `args?`): `Promise`<`T`>
Defined in: protocol-lending-morpho-evm/src/base.ts:104
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T`
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### address
[Section titled “address”](#address)
`` `0x${string}` ``
##### abi
[Section titled “abi”](#abi-1)
readonly `unknown`\[]
##### functionName
[Section titled “functionName”](#functionname-1)
`string`
##### args?
[Section titled “args?”](#args-1)
readonly `unknown`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`T`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`MorphoBase.read`
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:352
Repays `amount` of the loan token (or ‘max’ → all borrow shares) for the account or `onBehalfOf`.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### o
[Section titled “o”](#o-7)
[`MorphoMarketRepayOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketrepayoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`MorphoBase.repay`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-24)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`MorphoBase.requireSigningAccount`
***
### send()
[Section titled “send()”](#send)
> `protected` **send**(`tx`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:120
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### tx
[Section titled “tx”](#tx-3)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`MorphoBase.send`
***
### setAuthorization()
[Section titled “setAuthorization()”](#setauthorization)
> **setAuthorization**(`__namedParameters`): `Promise`<`LendingResult`>
Defined in: protocol-lending-morpho-evm/src/market.ts:365
Lets (or stops letting) `manager` act on the account’s positions on this chain’s Morpho (all markets).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
###### enabled
[Section titled “enabled”](#enabled)
`boolean`
###### manager
[Section titled “manager”](#manager)
`string`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`LendingResult`>
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:191
Lends `amount` of the loan token to the market; supply shares go to `onBehalfOf` (default: the account).
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### o
[Section titled “o”](#o-8)
[`MorphoMarketSupplyOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
`MorphoBase.supply`
***
### supplyCollateral()
[Section titled “supplyCollateral()”](#supplycollateral)
> **supplyCollateral**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:249
Posts collateral for `onBehalfOf` (default: the account). Collateral earns nothing; it backs borrows.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### o
[Section titled “o”](#o-9)
###### amount
[Section titled “amount”](#amount-3)
`number` | `bigint`
###### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof-1)
`string`
#### Returns
[Section titled “Returns”](#returns-28)
`Promise`<`LendingResult` & `object`>
***
### tokenMeta()
[Section titled “tokenMeta()”](#tokenmeta)
> `protected` **tokenMeta**(`token`): `Promise`<{ `decimals`: `number`; `symbol`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:185
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### token
[Section titled “token”](#token-1)
`` `0x${string}` ``
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<{ `decimals`: `number`; `symbol`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`MorphoBase.tokenMeta`
***
### wait()
[Section titled “wait()”](#wait)
> `protected` **wait**(`hash`): `Promise`<`void`>
Defined in: protocol-lending-morpho-evm/src/base.ts:128
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`MorphoBase.wait`
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:221
Withdraws supplied loan tokens (`amount` or ‘max’ → by shares) to `to` (default: the account).
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### o
[Section titled “o”](#o-10)
[`MorphoMarketWithdrawOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-31)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-8)
`MorphoBase.withdraw`
***
### withdrawCollateral()
[Section titled “withdrawCollateral()”](#withdrawcollateral)
> **withdrawCollateral**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/market.ts:279
Takes collateral back (`amount` or ‘max’); refused when the remaining collateral would not cover the debt.
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### o
[Section titled “o”](#o-11)
###### amount
[Section titled “amount”](#amount-4)
[`AmountOption`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
###### to?
[Section titled “to?”](#to-1)
`string`
#### Returns
[Section titled “Returns”](#returns-32)
`Promise`<`LendingResult` & `object`>
***
### writable()
[Section titled “writable()”](#writable)
> `protected` **writable**(`method`): `IWalletAccount`
Defined in: protocol-lending-morpho-evm/src/base.ts:116
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### method
[Section titled “method”](#method)
`string`
#### Returns
[Section titled “Returns”](#returns-33)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`MorphoBase.writable`
# MorphoVaultProtocolEvm
Defined in: protocol-lending-morpho-evm/src/vault.ts:60
A Morpho vault — MetaMorpho (Vault V1) or Vault V2 — as a `LendingProtocol`: `supply` deposits the vault’s asset for shares, `withdraw` redeems them; `borrow` / `repay` reject, a vault does not lend to its depositors.
The vault is identified on-chain: one of the chain’s Morpho vault factories must acknowledge it (`isMetaMorpho` / `isVaultV2`), its `asset()` must be the token supplied, and deposits / withdrawals are checked before anything is sent, then proven with `eth_call`: a V1 vault against `maxDeposit` / `maxWithdraw` (caps, liquidity); a V2 vault — whose max\* views answer 0 for everyone — against its transfer gates, with the `eth_call` proof deciding caps and liquidity (V2 enforces them by reverting). APY and TVL come from the Morpho API as decoration.
## Extends
[Section titled “Extends”](#extends)
* `MorphoBase`<[`MorphoVaultConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MorphoVaultProtocolEvm**(`account`, `config`): `MorphoVaultProtocolEvm`
Defined in: protocol-lending-morpho-evm/src/vault.ts:66
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
[`MorphoVaultConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultconfig/)
#### Returns
[Section titled “Returns”](#returns)
`MorphoVaultProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`MorphoBase.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`MorphoBase._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`MorphoVaultConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`MorphoBase._config`
***
### api
[Section titled “api”](#api)
> `protected` `readonly` **api**: [`MorphoApi`](/api/anywalletkit/protocol-lending-morpho-evm/classes/morphoapi/) | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:51
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`MorphoBase.api`
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: [`MorphoChain`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphochain/)
Defined in: protocol-lending-morpho-evm/src/base.ts:50
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`MorphoBase.chain`
***
### chainId
[Section titled “chainId”](#chainid)
> `readonly` **chainId**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:49
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`MorphoBase.chainId`
***
### vault
[Section titled “vault”](#vault)
> `readonly` **vault**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/vault.ts:61
## Accessors
[Section titled “Accessors”](#accessors)
### activityVault
[Section titled “activityVault”](#activityvault)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** `protected` **activityVault**(): `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:64
A vault this instance targets (the vault protocol sets it); accepted by address in `describeActivity`.
##### Returns
[Section titled “Returns”](#returns-1)
`string`
#### Overrides
[Section titled “Overrides”](#overrides-1)
`MorphoBase.activityVault`
***
### client
[Section titled “client”](#client)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** `protected` **client**(): `object`
Defined in: protocol-lending-morpho-evm/src/base.ts:99
##### Returns
[Section titled “Returns”](#returns-2)
`object`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`MorphoBase.client`
## Methods
[Section titled “Methods”](#methods)
### approvals()
[Section titled “approvals()”](#approvals)
> `protected` **approvals**(`token`, `spender`, `amount`): `Promise`<[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]>
Defined in: protocol-lending-morpho-evm/src/base.ts:160
Exact-amount ERC-20 approvals, with the approve(0) reset Ethereum’s USDT demands before a raise.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token)
`` `0x${string}` ``
##### spender
[Section titled “spender”](#spender)
`` `0x${string}` ``
##### amount
[Section titled “amount”](#amount)
`bigint`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`MorphoBase.approvals`
***
### borrow()
[Section titled “borrow()”](#borrow)
> **borrow**(): `Promise`<`never`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:259
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`MorphoBase.borrow`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:84
Recognize Morpho transactions offline: Blue by the singleton’s address (preset for the transaction’s chain, or this instance’s), vaults by ERC-4626 selector + the called contract’s shares minted to / burned from the wallet. See `activity.ts`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-5)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`MorphoBase.describeActivity`
***
### encode()
[Section titled “encode()”](#encode)
> `protected` **encode**(`abi`, `functionName`, `args`): `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/base.ts:108
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### abi
[Section titled “abi”](#abi)
readonly `unknown`\[]
##### functionName
[Section titled “functionName”](#functionname)
`string`
##### args
[Section titled “args”](#args)
readonly `unknown`\[]
#### Returns
[Section titled “Returns”](#returns-6)
`` `0x${string}` ``
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`MorphoBase.encode`
***
### execute()
[Section titled “execute()”](#execute)
> `protected` **execute**(`plan`, `action`): `Promise`<{ `approveHashes`: `string`\[]; `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:171
Approvals (each awaited to a receipt), then the main transaction, proven first.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### plan
[Section titled “plan”](#plan)
###### approvals
[Section titled “approvals”](#approvals-1)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]
###### tx
[Section titled “tx”](#tx-1)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
##### action
[Section titled “action”](#action)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<{ `approveHashes`: `string`\[]; `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`MorphoBase.execute`
***
### getApy()
[Section titled “getApy()”](#getapy)
> **getApy**(): `Promise`<`number`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:155
Net APY in percent from the Morpho API (after fees, incl. rewards).
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`number`>
***
### getPosition()
[Section titled “getPosition()”](#getposition)
> **getPosition**(): `Promise`<[`VaultPosition`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultposition/)>
Defined in: protocol-lending-morpho-evm/src/vault.ts:127
Shares, their current value, and what is withdrawable right now.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`VaultPosition`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultposition/)>
***
### getStats()
[Section titled “getStats()”](#getstats)
> **getStats**(): `Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/) | `null`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:149
The vault’s API record (name, APY, TVL, listed) — null without API or when the API does not know the vault.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`ApiVault`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/apivault/) | `null`>
***
### getVault()
[Section titled “getVault()”](#getvault)
> **getVault**(): `Promise`<[`VaultInfo`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultinfo/)>
Defined in: protocol-lending-morpho-evm/src/vault.ts:73
The vault as the chain describes it (cached per instance). Refuses an unverified vault unless allowed.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`VaultInfo`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/vaultinfo/)>
***
### me()
[Section titled “me()”](#me)
> `protected` **me**(): `Promise`<`` `0x${string}` ``>
Defined in: protocol-lending-morpho-evm/src/base.ts:112
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`` `0x${string}` ``>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`MorphoBase.me`
***
### prove()
[Section titled “prove()”](#prove)
> `protected` **prove**(`tx`, `action`): `Promise`<`void`>
Defined in: protocol-lending-morpho-evm/src/base.ts:142
`eth_call` from the account; a Morpho / vault revert becomes a readable MorphoError.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### tx
[Section titled “tx”](#tx-2)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
##### action
[Section titled “action”](#action-1)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`MorphoBase.prove`
***
### quoteBorrow()
[Section titled “quoteBorrow()”](#quoteborrow)
> **quoteBorrow**(): `Promise`<`never`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:260
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`MorphoBase.quoteBorrow`
***
### quoteFee()
[Section titled “quoteFee()”](#quotefee)
> `protected` **quoteFee**(`txs`): `Promise`<`bigint`>
Defined in: protocol-lending-morpho-evm/src/base.ts:150
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### txs
[Section titled “txs”](#txs)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)\[]
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`MorphoBase.quoteFee`
***
### quoteRepay()
[Section titled “quoteRepay()”](#quoterepay)
> **quoteRepay**(): `Promise`<`never`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:262
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`MorphoBase.quoteRepay`
***
### quoteSupply()
[Section titled “quoteSupply()”](#quotesupply)
> **quoteSupply**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:210
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### o
[Section titled “o”](#o)
[`MorphoVaultSupplyOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-5)
`MorphoBase.quoteSupply`
***
### quoteWithdraw()
[Section titled “quoteWithdraw()”](#quotewithdraw)
> **quoteWithdraw**(`o`): `Promise`<`LendingQuote` & `object`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:253
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### o
[Section titled “o”](#o-1)
[`MorphoVaultWithdrawOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`LendingQuote` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`MorphoBase.quoteWithdraw`
***
### read()
[Section titled “read()”](#read)
> `protected` **read**<`T`>(`address`, `abi`, `functionName`, `args?`): `Promise`<`T`>
Defined in: protocol-lending-morpho-evm/src/base.ts:104
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T`
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### address
[Section titled “address”](#address)
`` `0x${string}` ``
##### abi
[Section titled “abi”](#abi-1)
readonly `unknown`\[]
##### functionName
[Section titled “functionName”](#functionname-1)
`string`
##### args?
[Section titled “args?”](#args-1)
readonly `unknown`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`T`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`MorphoBase.read`
***
### repay()
[Section titled “repay()”](#repay)
> **repay**(): `Promise`<`never`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:261
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-7)
`MorphoBase.repay`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`MorphoBase.requireSigningAccount`
***
### send()
[Section titled “send()”](#send)
> `protected` **send**(`tx`): `Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:120
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### tx
[Section titled “tx”](#tx-3)
[`Tx`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/tx/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<{ `fee`: `bigint`; `hash`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`MorphoBase.send`
***
### supply()
[Section titled “supply()”](#supply)
> **supply**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:204
Deposits the vault’s asset (`token` may be omitted) for shares minted to `onBehalfOf` (default: the account).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### o
[Section titled “o”](#o-2)
[`MorphoVaultSupplyOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultsupplyoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-8)
`MorphoBase.supply`
***
### tokenMeta()
[Section titled “tokenMeta()”](#tokenmeta)
> `protected` **tokenMeta**(`token`): `Promise`<{ `decimals`: `number`; `symbol`: `string`; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:185
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### token
[Section titled “token”](#token-1)
`` `0x${string}` ``
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<{ `decimals`: `number`; `symbol`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`MorphoBase.tokenMeta`
***
### wait()
[Section titled “wait()”](#wait)
> `protected` **wait**(`hash`): `Promise`<`void`>
Defined in: protocol-lending-morpho-evm/src/base.ts:128
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`MorphoBase.wait`
***
### withdraw()
[Section titled “withdraw()”](#withdraw)
> **withdraw**(`o`): `Promise`<`LendingResult` & `object`>
Defined in: protocol-lending-morpho-evm/src/vault.ts:245
Withdraws `amount` of the asset (or ‘max’ → redeem every share) to `to` (default: the account).
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### o
[Section titled “o”](#o-3)
[`MorphoVaultWithdrawOptions`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultwithdrawoptions/)
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`LendingResult` & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-9)
`MorphoBase.withdraw`
***
### writable()
[Section titled “writable()”](#writable)
> `protected` **writable**(`method`): `IWalletAccount`
Defined in: protocol-lending-morpho-evm/src/base.ts:116
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### method
[Section titled “method”](#method)
`string`
#### Returns
[Section titled “Returns”](#returns-27)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`MorphoBase.writable`
# accrue
> **accrue**(`m`, `borrowRate`, `now`): [`MarketState`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
Defined in: protocol-lending-morpho-evm/src/math.ts:45
The market state after the interest Morpho would accrue at `now` (what `accrueInterest` does): borrow and supply assets grow by the compounded borrow rate, the fee’s share of the interest mints supply shares.
## Parameters
[Section titled “Parameters”](#parameters)
### m
[Section titled “m”](#m)
[`MarketState`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
### borrowRate
[Section titled “borrowRate”](#borrowrate)
`bigint`
### now
[Section titled “now”](#now)
`bigint`
## Returns
[Section titled “Returns”](#returns)
[`MarketState`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
# collateralValue
> **collateralValue**(`collateral`, `price`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:73
Loan-token value of `collateral` at the oracle price (1e36 scale), rounded down.
## Parameters
[Section titled “Parameters”](#parameters)
### collateral
[Section titled “collateral”](#collateral)
`bigint`
### price
[Section titled “price”](#price)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# decodeMorphoRevert
> **decodeMorphoRevert**(`data`): `object`
Defined in: protocol-lending-morpho-evm/src/errors.ts:64
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`` `0x${string}` ``
## Returns
[Section titled “Returns”](#returns)
`object`
### code?
[Section titled “code?”](#code)
> `optional` **code?**: `string`
### message
[Section titled “message”](#message)
> **message**: `string`
# describeMorphoActivity
> **describeMorphoActivity**(`tx`, `ctx`, `m`): `ActivityItem` | `null`
Defined in: protocol-lending-morpho-evm/src/activity.ts:87
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### m
[Section titled “m”](#m)
[`MorphoActivityContext`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivitycontext/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# marketId
> **marketId**(`p`): `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/math.ts:33
`Id` = keccak256(abi.encode(marketParams)).
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
[`MarketParams`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketparams/)
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# maxBorrow
> **maxBorrow**(`collateral`, `price`, `lltv`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:76
The most a position may owe: collateral value × LLTV.
## Parameters
[Section titled “Parameters”](#parameters)
### collateral
[Section titled “collateral”](#collateral)
`bigint`
### price
[Section titled “price”](#price)
`bigint`
### lltv
[Section titled “lltv”](#lltv)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# presetContext
> **presetContext**(`chainId`): [`MorphoActivityContext`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivitycontext/) | `undefined`
Defined in: protocol-lending-morpho-evm/src/activity.ts:121
Preset context for a chain id (undefined when Morpho is not deployed there).
## Parameters
[Section titled “Parameters”](#parameters)
### chainId
[Section titled “chainId”](#chainid)
`number`
## Returns
[Section titled “Returns”](#returns)
[`MorphoActivityContext`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivitycontext/) | `undefined`
# rateToApyPct
> **rateToApyPct**(`ratePerSecond`): `number`
Defined in: protocol-lending-morpho-evm/src/math.ts:60
Per-second WAD rate → APY in percent (continuous compounding, as the Morpho UI shows).
## Parameters
[Section titled “Parameters”](#parameters)
### ratePerSecond
[Section titled “ratePerSecond”](#ratepersecond)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# supplyApyPct
> **supplyApyPct**(`borrowApyPct`, `m`): `number`
Defined in: protocol-lending-morpho-evm/src/math.ts:66
Supply APY = borrow APY × utilization × (1 − fee).
## Parameters
[Section titled “Parameters”](#parameters)
### borrowApyPct
[Section titled “borrowApyPct”](#borrowapypct)
`number`
### m
[Section titled “m”](#m)
[`MarketState`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
## Returns
[Section titled “Returns”](#returns)
`number`
# toAssetsDown
> **toAssetsDown**(`shares`, `totalAssets`, `totalShares`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:20
## Parameters
[Section titled “Parameters”](#parameters)
### shares
[Section titled “shares”](#shares)
`bigint`
### totalAssets
[Section titled “totalAssets”](#totalassets)
`bigint`
### totalShares
[Section titled “totalShares”](#totalshares)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# toAssetsUp
> **toAssetsUp**(`shares`, `totalAssets`, `totalShares`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:22
## Parameters
[Section titled “Parameters”](#parameters)
### shares
[Section titled “shares”](#shares)
`bigint`
### totalAssets
[Section titled “totalAssets”](#totalassets)
`bigint`
### totalShares
[Section titled “totalShares”](#totalshares)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# toSharesDown
> **toSharesDown**(`assets`, `totalAssets`, `totalShares`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:19
## Parameters
[Section titled “Parameters”](#parameters)
### assets
[Section titled “assets”](#assets)
`bigint`
### totalAssets
[Section titled “totalAssets”](#totalassets)
`bigint`
### totalShares
[Section titled “totalShares”](#totalshares)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# toSharesUp
> **toSharesUp**(`assets`, `totalAssets`, `totalShares`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:21
## Parameters
[Section titled “Parameters”](#parameters)
### assets
[Section titled “assets”](#assets)
`bigint`
### totalAssets
[Section titled “totalAssets”](#totalassets)
`bigint`
### totalShares
[Section titled “totalShares”](#totalshares)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# wTaylorCompounded
> **wTaylorCompounded**(`x`, `n`): `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:25
Third-order Taylor expansion of e^(x·n) − 1, as Morpho compounds interest.
## Parameters
[Section titled “Parameters”](#parameters)
### x
[Section titled “x”](#x)
`bigint`
### n
[Section titled “n”](#n)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# ApiMarket
Defined in: protocol-lending-morpho-evm/src/api.ts:26
## Properties
[Section titled “Properties”](#properties)
### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:36
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-morpho-evm/src/api.ts:28
***
### collateralAsset
[Section titled “collateralAsset”](#collateralasset)
> **collateralAsset**: { `address`: `` `0x${string}` ``; `decimals`: `number`; `symbol`: `string`; } | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:31
***
### id
[Section titled “id”](#id)
> **id**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/api.ts:27
***
### irm
[Section titled “irm”](#irm)
> **irm**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/api.ts:33
***
### liquidityAssets
[Section titled “liquidityAssets”](#liquidityassets)
> **liquidityAssets**: `bigint` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:39
***
### listed
[Section titled “listed”](#listed)
> **listed**: `boolean`
Defined in: protocol-lending-morpho-evm/src/api.ts:29
***
### lltv
[Section titled “lltv”](#lltv)
> **lltv**: `bigint`
Defined in: protocol-lending-morpho-evm/src/api.ts:34
***
### loanAsset
[Section titled “loanAsset”](#loanasset)
> **loanAsset**: `object`
Defined in: protocol-lending-morpho-evm/src/api.ts:30
#### address
[Section titled “address”](#address)
> **address**: `` `0x${string}` ``
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### oracle
[Section titled “oracle”](#oracle)
> **oracle**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:32
***
### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:35
***
### supplyAssetsUsd
[Section titled “supplyAssetsUsd”](#supplyassetsusd)
> **supplyAssetsUsd**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:38
***
### utilization
[Section titled “utilization”](#utilization)
> **utilization**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:37
# ApiVault
Defined in: protocol-lending-morpho-evm/src/api.ts:8
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/api.ts:9
***
### apy
[Section titled “apy”](#apy)
> **apy**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:18
Percent. `netApy` is after fees and including rewards; `apy` is the gross native rate.
***
### asset
[Section titled “asset”](#asset)
> **asset**: `object`
Defined in: protocol-lending-morpho-evm/src/api.ts:16
#### address
[Section titled “address”](#address-1)
> **address**: `` `0x${string}` ``
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-morpho-evm/src/api.ts:10
***
### factory
[Section titled “factory”](#factory)
> **factory**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:15
***
### fee
[Section titled “fee”](#fee)
> **fee**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:23
Fraction (0.1 = 10 % of yield). V2 reports the performance fee here.
***
### listed
[Section titled “listed”](#listed)
> **listed**: `boolean`
Defined in: protocol-lending-morpho-evm/src/api.ts:14
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-morpho-evm/src/api.ts:11
***
### netApy
[Section titled “netApy”](#netapy)
> **netApy**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:19
***
### symbol
[Section titled “symbol”](#symbol-1)
> **symbol**: `string`
Defined in: protocol-lending-morpho-evm/src/api.ts:12
***
### totalAssets
[Section titled “totalAssets”](#totalassets)
> **totalAssets**: `bigint` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:20
***
### totalAssetsUsd
[Section titled “totalAssetsUsd”](#totalassetsusd)
> **totalAssetsUsd**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/api.ts:21
***
### version
[Section titled “version”](#version)
> **version**: `"v1"` | `"v2"`
Defined in: protocol-lending-morpho-evm/src/api.ts:13
# MarketInfo
Defined in: protocol-lending-morpho-evm/src/market.ts:22
## Properties
[Section titled “Properties”](#properties)
### borrowApy
[Section titled “borrowApy”](#borrowapy)
> **borrowApy**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:38
***
### borrowRate
[Section titled “borrowRate”](#borrowrate)
> **borrowRate**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:37
Per-second WAD borrow rate from the IRM.
***
### collateral
[Section titled “collateral”](#collateral)
> **collateral**: { `address`: `` `0x${string}` ``; `decimals`: `number`; `symbol`: `string`; } | `null`
Defined in: protocol-lending-morpho-evm/src/market.ts:26
***
### fee
[Section titled “fee”](#fee)
> **fee**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:41
Protocol fee on interest, fraction.
***
### id
[Section titled “id”](#id)
> **id**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/market.ts:23
***
### liquidity
[Section titled “liquidity”](#liquidity)
> **liquidity**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:34
Loan tokens available to borrow / withdraw right now.
***
### lltv
[Section titled “lltv”](#lltv)
> **lltv**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:28
Fraction (0.86 = 86 %).
***
### loan
[Section titled “loan”](#loan)
> **loan**: `object`
Defined in: protocol-lending-morpho-evm/src/market.ts:25
#### address
[Section titled “address”](#address)
> **address**: `` `0x${string}` ``
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### params
[Section titled “params”](#params)
> **params**: [`MarketParams`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketparams/)
Defined in: protocol-lending-morpho-evm/src/market.ts:24
***
### price
[Section titled “price”](#price)
> **price**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:30
Oracle price of 1 collateral in loan units, 1e36 scale.
***
### state
[Section titled “state”](#state)
> **state**: [`MarketState`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/marketstate/)
Defined in: protocol-lending-morpho-evm/src/market.ts:32
State with interest accrued to now.
***
### supplyApy
[Section titled “supplyApy”](#supplyapy)
> **supplyApy**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:39
***
### utilization
[Section titled “utilization”](#utilization)
> **utilization**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:35
# MarketParams
Defined in: protocol-lending-morpho-evm/src/math.ts:13
## Properties
[Section titled “Properties”](#properties)
### collateralToken
[Section titled “collateralToken”](#collateraltoken)
> **collateralToken**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/math.ts:13
***
### irm
[Section titled “irm”](#irm)
> **irm**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/math.ts:13
***
### lltv
[Section titled “lltv”](#lltv)
> **lltv**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:13
***
### loanToken
[Section titled “loanToken”](#loantoken)
> **loanToken**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/math.ts:13
***
### oracle
[Section titled “oracle”](#oracle)
> **oracle**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/math.ts:13
# MarketPosition
Defined in: protocol-lending-morpho-evm/src/market.ts:44
## Properties
[Section titled “Properties”](#properties)
### borrowAssets
[Section titled “borrowAssets”](#borrowassets)
> **borrowAssets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:49
Rounded up, as Morpho counts debt.
***
### borrowShares
[Section titled “borrowShares”](#borrowshares)
> **borrowShares**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:47
***
### collateral
[Section titled “collateral”](#collateral)
> **collateral**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:50
***
### collateralValue
[Section titled “collateralValue”](#collateralvalue)
> **collateralValue**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:52
Loan-token value of the collateral.
***
### healthFactor
[Section titled “healthFactor”](#healthfactor)
> **healthFactor**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:56
maxBorrow / borrowAssets; Infinity without debt. 1.0 = liquidatable.
***
### liquidationPrice
[Section titled “liquidationPrice”](#liquidationprice)
> **liquidationPrice**: `bigint` | `null`
Defined in: protocol-lending-morpho-evm/src/market.ts:60
Collateral price (loan per collateral, 1e36 scale) at which the position becomes liquidatable; null without debt.
***
### ltv
[Section titled “ltv”](#ltv)
> **ltv**: `number`
Defined in: protocol-lending-morpho-evm/src/market.ts:58
borrowAssets / collateralValue.
***
### maxBorrow
[Section titled “maxBorrow”](#maxborrow)
> **maxBorrow**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:54
The most the position may owe at the current price.
***
### supplyAssets
[Section titled “supplyAssets”](#supplyassets)
> **supplyAssets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:46
***
### supplyShares
[Section titled “supplyShares”](#supplyshares)
> **supplyShares**: `bigint`
Defined in: protocol-lending-morpho-evm/src/market.ts:45
# MarketState
Defined in: protocol-lending-morpho-evm/src/math.ts:14
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
***
### lastUpdate
[Section titled “lastUpdate”](#lastupdate)
> **lastUpdate**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
***
### totalBorrowAssets
[Section titled “totalBorrowAssets”](#totalborrowassets)
> **totalBorrowAssets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
***
### totalBorrowShares
[Section titled “totalBorrowShares”](#totalborrowshares)
> **totalBorrowShares**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
***
### totalSupplyAssets
[Section titled “totalSupplyAssets”](#totalsupplyassets)
> **totalSupplyAssets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
***
### totalSupplyShares
[Section titled “totalSupplyShares”](#totalsupplyshares)
> **totalSupplyShares**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:14
# MorphoActivityAction
Defined in: protocol-lending-morpho-evm/src/activity.ts:33
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: protocol-lending-morpho-evm/src/activity.ts:33
***
### principal
[Section titled “principal”](#principal)
> **principal**: `"in"` | `"out"` | `"none"`
Defined in: protocol-lending-morpho-evm/src/activity.ts:33
***
### verb
[Section titled “verb”](#verb)
> **verb**: `string`
Defined in: protocol-lending-morpho-evm/src/activity.ts:33
# MorphoActivityContext
Defined in: protocol-lending-morpho-evm/src/activity.ts:78
## Properties
[Section titled “Properties”](#properties)
### chainName
[Section titled “chainName”](#chainname)
> **chainName**: `string`
Defined in: protocol-lending-morpho-evm/src/activity.ts:84
Human chain label for the subtitle.
***
### morpho?
[Section titled “morpho?”](#morpho)
> `optional` **morpho?**: `string`
Defined in: protocol-lending-morpho-evm/src/activity.ts:80
Morpho (Blue) singleton for the transaction’s chain, when known.
***
### vault?
[Section titled “vault?”](#vault)
> `optional` **vault?**: `string`
Defined in: protocol-lending-morpho-evm/src/activity.ts:82
A vault this instance is configured with: accepted by address.
# MorphoBaseConfig
Defined in: protocol-lending-morpho-evm/src/base.ts:17
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MorphoVaultConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphovaultconfig/)
* [`MorphoMarketConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphomarketconfig/)
## Properties
[Section titled “Properties”](#properties)
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:25
Morpho API endpoint for APY / listing, or `null` to disable (default: api.morpho.org).
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:19
Chain (default: the account’s `eip155:N`, else 1). Must have a Morpho deployment.
***
### morpho?
[Section titled “morpho?”](#morpho)
> `optional` **morpho?**: `string`
Defined in: protocol-lending-morpho-evm/src/base.ts:21
Override the Morpho (Blue) singleton for a chain not in the presets.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-lending-morpho-evm/src/base.ts:23
RPC url(s) / EIP-1193 provider(s) to read through. Defaults to the account’s own.
***
### waitTimeoutMs?
[Section titled “waitTimeoutMs?”](#waittimeoutms)
> `optional` **waitTimeoutMs?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:27
How long an approval may take to mine before the main transaction (default 180 000 ms).
# MorphoChain
Defined in: protocol-lending-morpho-evm/src/chains.ts:10
## Properties
[Section titled “Properties”](#properties)
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-lending-morpho-evm/src/chains.ts:11
***
### morpho
[Section titled “morpho”](#morpho)
> **morpho**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/chains.ts:14
Morpho (Blue) singleton.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-morpho-evm/src/chains.ts:12
***
### vaultV1Factories
[Section titled “vaultV1Factories”](#vaultv1factories)
> **vaultV1Factories**: `` `0x${string}` ``\[]
Defined in: protocol-lending-morpho-evm/src/chains.ts:16
MetaMorpho / Vault V1 factories (v1.0 and v1.1 where both exist).
***
### vaultV2Factories
[Section titled “vaultV2Factories”](#vaultv2factories)
> **vaultV2Factories**: `` `0x${string}` ``\[]
Defined in: protocol-lending-morpho-evm/src/chains.ts:18
Vault V2 factory.
# MorphoMarketBorrowOptions
Defined in: protocol-lending-morpho-evm/src/market.ts:19
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`BorrowOptions`, `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:632
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:633
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.onBehalfOf`
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocol-lending-morpho-evm/src/market.ts:19
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/market.ts:19
# MorphoMarketConfig
Defined in: protocol-lending-morpho-evm/src/market.ts:12
## Extends
[Section titled “Extends”](#extends)
* [`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/)
## Properties
[Section titled “Properties”](#properties)
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:25
Morpho API endpoint for APY / listing, or `null` to disable (default: api.morpho.org).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`api`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#api)
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:19
Chain (default: the account’s `eip155:N`, else 1). Must have a Morpho deployment.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`chainId`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#chainid)
***
### market
[Section titled “market”](#market)
> **market**: `` `0x${string}` `` | { `collateralToken`: `string`; `irm`: `string`; `lltv`: `string` | `number` | `bigint`; `loanToken`: `string`; `oracle`: `string`; }
Defined in: protocol-lending-morpho-evm/src/market.ts:14
The market: its 32-byte id, or the full MarketParams.
***
### morpho?
[Section titled “morpho?”](#morpho)
> `optional` **morpho?**: `string`
Defined in: protocol-lending-morpho-evm/src/base.ts:21
Override the Morpho (Blue) singleton for a chain not in the presets.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`morpho`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#morpho)
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-lending-morpho-evm/src/base.ts:23
RPC url(s) / EIP-1193 provider(s) to read through. Defaults to the account’s own.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`provider`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#provider)
***
### waitTimeoutMs?
[Section titled “waitTimeoutMs?”](#waittimeoutms)
> `optional` **waitTimeoutMs?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:27
How long an approval may take to mine before the main transaction (default 180 000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`waitTimeoutMs`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#waittimeoutms)
# MorphoMarketRepayOptions
Defined in: protocol-lending-morpho-evm/src/market.ts:20
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`RepayOptions`, `"amount"` | `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
Defined in: protocol-lending-morpho-evm/src/market.ts:20
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:639
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.onBehalfOf`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/market.ts:20
# MorphoMarketSupplyOptions
Defined in: protocol-lending-morpho-evm/src/market.ts:17
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`SupplyOptions`, `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:620
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:621
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.onBehalfOf`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/market.ts:17
# MorphoMarketWithdrawOptions
Defined in: protocol-lending-morpho-evm/src/market.ts:18
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`WithdrawOptions`, `"amount"` | `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
Defined in: protocol-lending-morpho-evm/src/market.ts:18
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:627
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.to`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/market.ts:18
# MorphoVaultConfig
Defined in: protocol-lending-morpho-evm/src/vault.ts:8
## Extends
[Section titled “Extends”](#extends)
* [`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/)
## Properties
[Section titled “Properties”](#properties)
### allowUnverifiedVault?
[Section titled “allowUnverifiedVault?”](#allowunverifiedvault)
> `optional` **allowUnverifiedVault?**: `boolean`
Defined in: protocol-lending-morpho-evm/src/vault.ts:12
Accept a vault no known Morpho factory acknowledges (default false).
***
### api?
[Section titled “api?”](#api)
> `optional` **api?**: `string` | `null`
Defined in: protocol-lending-morpho-evm/src/base.ts:25
Morpho API endpoint for APY / listing, or `null` to disable (default: api.morpho.org).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`api`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#api)
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:19
Chain (default: the account’s `eip155:N`, else 1). Must have a Morpho deployment.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`chainId`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#chainid)
***
### morpho?
[Section titled “morpho?”](#morpho)
> `optional` **morpho?**: `string`
Defined in: protocol-lending-morpho-evm/src/base.ts:21
Override the Morpho (Blue) singleton for a chain not in the presets.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`morpho`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#morpho)
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-lending-morpho-evm/src/base.ts:23
RPC url(s) / EIP-1193 provider(s) to read through. Defaults to the account’s own.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`provider`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#provider)
***
### vault
[Section titled “vault”](#vault)
> **vault**: `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:10
The vault (MetaMorpho / Vault V1, or Vault V2).
***
### waitTimeoutMs?
[Section titled “waitTimeoutMs?”](#waittimeoutms)
> `optional` **waitTimeoutMs?**: `number`
Defined in: protocol-lending-morpho-evm/src/base.ts:27
How long an approval may take to mine before the main transaction (default 180 000 ms).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`MorphoBaseConfig`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/).[`waitTimeoutMs`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphobaseconfig/#waittimeoutms)
# MorphoVaultSupplyOptions
Defined in: protocol-lending-morpho-evm/src/vault.ts:15
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`SupplyOptions`, `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:620
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.amount`
***
### onBehalfOf?
[Section titled “onBehalfOf?”](#onbehalfof)
> `optional` **onBehalfOf?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:621
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Omit.onBehalfOf`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:15
# MorphoVaultWithdrawOptions
Defined in: protocol-lending-morpho-evm/src/vault.ts:16
## Extends
[Section titled “Extends”](#extends)
* `Omit`<`WithdrawOptions`, `"amount"` | `"token"`>
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: [`AmountOption`](/api/anywalletkit/protocol-lending-morpho-evm/type-aliases/amountoption/)
Defined in: protocol-lending-morpho-evm/src/vault.ts:16
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:627
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Omit.to`
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:16
# Tx
Defined in: protocol-lending-morpho-evm/src/base.ts:30
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/base.ts:30
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `bigint`
Defined in: protocol-lending-morpho-evm/src/base.ts:30
***
### to
[Section titled “to”](#to)
> **to**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/base.ts:30
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-lending-morpho-evm/src/base.ts:30
# VaultInfo
Defined in: protocol-lending-morpho-evm/src/vault.ts:18
## Properties
[Section titled “Properties”](#properties)
### asset
[Section titled “asset”](#asset)
> **asset**: `object`
Defined in: protocol-lending-morpho-evm/src/vault.ts:26
#### address
[Section titled “address”](#address)
> **address**: `` `0x${string}` ``
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### curator
[Section titled “curator”](#curator)
> **curator**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-morpho-evm/src/vault.ts:35
***
### decimals
[Section titled “decimals”](#decimals-1)
> **decimals**: `number`
Defined in: protocol-lending-morpho-evm/src/vault.ts:25
Share decimals (asset decimals + offset on V1).
***
### factory
[Section titled “factory”](#factory)
> **factory**: `` `0x${string}` `` | `null`
Defined in: protocol-lending-morpho-evm/src/vault.ts:21
***
### fees
[Section titled “fees”](#fees)
> **fees**: `object`
Defined in: protocol-lending-morpho-evm/src/vault.ts:32
Fractions: V1 = performance fee; V2 = performance + management.
#### management
[Section titled “management”](#management)
> **management**: `number`
#### performance
[Section titled “performance”](#performance)
> **performance**: `number`
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:22
***
### sharePriceWad
[Section titled “sharePriceWad”](#sharepricewad)
> **sharePriceWad**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:30
Assets per 1e18 shares, for display.
***
### symbol
[Section titled “symbol”](#symbol-1)
> **symbol**: `string`
Defined in: protocol-lending-morpho-evm/src/vault.ts:23
***
### timelockSeconds
[Section titled “timelockSeconds”](#timelockseconds)
> **timelockSeconds**: `number` | `null`
Defined in: protocol-lending-morpho-evm/src/vault.ts:34
V1 timelock in seconds; null on V2.
***
### totalAssets
[Section titled “totalAssets”](#totalassets)
> **totalAssets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:27
***
### totalSupply
[Section titled “totalSupply”](#totalsupply)
> **totalSupply**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:28
***
### vault
[Section titled “vault”](#vault)
> **vault**: `` `0x${string}` ``
Defined in: protocol-lending-morpho-evm/src/vault.ts:19
***
### version
[Section titled “version”](#version)
> **version**: `"v1"` | `"v2"` | `"unverified"`
Defined in: protocol-lending-morpho-evm/src/vault.ts:20
# VaultPosition
Defined in: protocol-lending-morpho-evm/src/vault.ts:38
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:41
Assets the shares are worth now.
***
### shares
[Section titled “shares”](#shares)
> **shares**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:39
***
### withdrawable
[Section titled “withdrawable”](#withdrawable)
> **withdrawable**: `bigint`
Defined in: protocol-lending-morpho-evm/src/vault.ts:43
Assets the vault can pay out to this account right now (liquidity-bound).
# AmountOption
> **AmountOption** = `bigint` | `number` | `"max"`
Defined in: protocol-lending-morpho-evm/src/base.ts:35
# EvmProvider
> **EvmProvider** = `string` | `EIP1193Provider`
Defined in: protocol-lending-morpho-evm/src/base.ts:15
# BLUE_ACTIONS
> `const` **BLUE_ACTIONS**: `Readonly`<`Record`<`string`, [`MorphoActivityAction`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivityaction/)>>
Defined in: protocol-lending-morpho-evm/src/activity.ts:36
Morpho Blue (IMorpho).
# BLUE_ERRORS
> `const` **BLUE_ERRORS**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-lending-morpho-evm/src/errors.ts:16
Morpho Blue ErrorsLib strings → what they mean for a wallet.
# ERC4626_ABI
> `const` **ERC4626_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:34
ERC-4626 + ERC-20 surface every Morpho vault (V1 and V2) exposes.
# IRM_ABI
> `const` **IRM_ABI**: readonly \[{ }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:25
# MODULE_NAME
> `const` **MODULE_NAME**: `"@anywalletkit/protocol-lending-morpho-evm"` = `'@anywalletkit/protocol-lending-morpho-evm'`
Defined in: protocol-lending-morpho-evm/src/activity.ts:27
Registry name, as `module.json` carries it.
# MORPHO_ABI
> `const` **MORPHO_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:7
# MORPHO_API
> `const` **MORPHO_API**: `"https://api.morpho.org/graphql"` = `'https://api.morpho.org/graphql'`
Defined in: protocol-lending-morpho-evm/src/chains.ts:59
Default Morpho API endpoint (decoration and discovery only; no key, 750 req/min).
# MORPHO_CHAIN_IDS
> `const` **MORPHO_CHAIN_IDS**: readonly `string`\[]
Defined in: protocol-lending-morpho-evm/src/chains.ts:56
# MORPHO_CHAINS
> `const` **MORPHO_CHAINS**: `Readonly`<`Record`<`number`, [`MorphoChain`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphochain/)>>
Defined in: protocol-lending-morpho-evm/src/chains.ts:24
# ORACLE_ABI
> `const` **ORACLE_ABI**: readonly \[{ }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:31
# ORACLE_PRICE_SCALE
> `const` **ORACLE_PRICE_SCALE**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:10
# SECONDS_PER_YEAR
> `const` **SECONDS_PER_YEAR**: `31536000` = `31_536_000`
Defined in: protocol-lending-morpho-evm/src/math.ts:11
# VAULT_ACTIONS
> `const` **VAULT_ACTIONS**: `Readonly`<`Record`<`string`, [`MorphoActivityAction`](/api/anywalletkit/protocol-lending-morpho-evm/interfaces/morphoactivityaction/) & `object`>>
Defined in: protocol-lending-morpho-evm/src/activity.ts:47
ERC-4626 entry points shared by MetaMorpho / Vault V1 and Vault V2.
# VAULT_V1_ABI
> `const` **VAULT_V1_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:57
MetaMorpho (Vault V1) extras.
# VAULT_V2_ABI
> `const` **VAULT_V2_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-lending-morpho-evm/src/abi.ts:69
Vault V2 extras: fees and the transfer gates a deposit / withdrawal must pass.
# VIRTUAL_ASSETS
> `const` **VIRTUAL_ASSETS**: `1n` = `1n`
Defined in: protocol-lending-morpho-evm/src/math.ts:9
# VIRTUAL_SHARES
> `const` **VIRTUAL_SHARES**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:8
# WAD
> `const` **WAD**: `bigint`
Defined in: protocol-lending-morpho-evm/src/math.ts:7
# @anywalletkit/protocol-staking-lido-evm
# @anywalletkit/protocol-staking-lido-evm
[Section titled “@anywalletkit/protocol-staking-lido-evm”](#anywalletkitprotocol-staking-lido-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-staking-lido-evm)
A simple package that lets `@anywalletkit/wallet-evm` wallet accounts stake through the [Lido](https://lido.fi) protocol: stake ETH → stETH, exit through the two-phase withdrawal queue, wrap/unwrap the non-rebasing wstETH form, and read APR and reward history.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-staking-lido-evm @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-staking-lido-evm @anywalletkit/core · yarn add @anywalletkit/protocol-staking-lido-evm @anywalletkit/core
```
On npm: [@anywalletkit/protocol-staking-lido-evm](https://www.npmjs.com/package/@anywalletkit/protocol-staking-lido-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Built as the first implementation of the **`StakingProtocol` type** in `@anywalletkit/core`. The base class lives in `@anywalletkit/core`; `src/staking-protocol.ts` keeps the runtime `IStakingProtocol` marker and the option / result types this module documents. See “The interface” below for why staking is not lending.
The mechanics are extracted from a production wallet (web + React Native/Hermes) where every flow is exercised with real funds.
Written in TypeScript on [viem](https://viem.sh) (the only runtime dependency) and built with tsup to `dist/` (ESM + CJS + `.d.ts`).
## Usage
[Section titled “Usage”](#usage)
```js
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import LidoProtocolEvm from '@anywalletkit/protocol-staking-lido-evm'
const wallet = new WalletManagerEvm(seed, { provider: 'https://rpc.example.org' })
const account = await wallet.getAccount(0)
const lido = new LidoProtocolEvm(account, {
referral: '0x…' // optional: Lido Rewards-Share referral, defaults to zero address
})
// Stake — stETH lands on the account 1:1
const { hash, fee } = await lido.stake({ amount: 10n ** 18n })
// Exit, phase 1: queue the withdrawal (permit-first — ONE transaction)
await lido.requestWithdrawal({ amount: 10n ** 18n, token: 'stETH' })
// …days later — exit, phase 2: claim finalized requests as ETH
const { claimableIds } = await lido.getWithdrawalRequests()
if (claimableIds.length) await lido.claimWithdrawals({ ids: claimableIds })
// Views
await lido.getStakedBalance() // { balance, wrappedBalance, rate, total }
await lido.getApr() // 2.72 (percent, 7d SMA)
```
Lido-specific extras beyond the interface:
```js
await lido.wrap({ amount }) // stETH → wstETH (approve awaited + wrap)
await lido.unwrap({ amount }) // wstETH → stETH (single tx)
await lido.getWithdrawalEta(ids) // Map from Lido's queue API
await lido.getRewards() // lifetime rewards + average APR
await lido.getRewardHistory({ limit: 14 }) // daily rebase events, newest first
```
## Why the withdrawal path looks the way it does
[Section titled “Why the withdrawal path looks the way it does”](#why-the-withdrawal-path-looks-the-way-it-does)
Every one of these choices was paid for in production:
* **Permit-first**: `requestWithdrawal` signs one EIP-2612 permit and rides it inside `requestWithdrawalsWithPermit` — a single transaction (and on mobile, a single biometric prompt) instead of approve + request.
* **Proven before broadcast**: the permit path is simulated with `eth_call` first. A bad signature must fall back, not burn gas.
* **The fallback awaits its approval**: in the approve + request path the approval is waited to a mined receipt, because the request’s gas estimate reverts against an unmined allowance.
* **Verified permit domains**: stETH signs as version “2”, wstETH as version “1” — both checked against the tokens’ on-chain `DOMAIN_SEPARATOR`. A wrong version recovers to a different signer and reverts with no readable reason.
* **Per-request caps**: the queue takes at most 1000 stETH per request; over-cap amounts split into several requests inside the same transaction (wstETH capped at 800 per request — 1000 is stETH-equivalent and the rate drifts upward).
* **Up-front guards**: `stake` checks `isStakingPaused` and `getCurrentStakeLimit` before estimating gas, because the raw revert carries no readable reason for either.
* **Structural account checks**: writability is `typeof account.sendTransaction === 'function'`, not `instanceof` — a duplicated copy of the account package fails `instanceof` while the account works fine.
* **No `AbortSignal.timeout` / `AbortSignal.any`**: Hermes (React Native) ships `AbortController` but not those statics; nothing here depends on them.
* **REST endpoints are configuration**: APR, queue ETAs and reward history come from Lido’s public frontend APIs (`eth-api.lido.fi`, `wq-api.lido.fi`, `reward-history-backend.lido.fi`), all overridable via `config.endpoints`. On-chain flows never depend on them: ETA and rewards are decoration and degrade to empty results, never throws.
## Configuration
[Section titled “Configuration”](#configuration)
```js
new LidoProtocolEvm(account, {
provider, // RPC url or EIP-1193; defaults to the account's provider
chainId, // default 1; other chains must supply the fields below
referral, // forwarded to submit() — Lido Rewards-Share integrators earn on stake flow
addresses, // { stEth, wstEth, withdrawalQueue }
permitDomains, // { stEth: { name, version }, wstEth: { name, version } }
endpoints // { apr, withdrawalQueueApi, rewardHistory }
})
```
Only mainnet ships as a default deployment — deliberately. Testnets (e.g. Hoodi) must be configured explicitly so nobody stakes against an unverified address a default quietly supplied.
## The interface
[Section titled “The interface”](#the-interface)
`IStakingProtocol`: `stake` / `quoteStake`, `requestWithdrawal` / `quoteRequestWithdrawal`, `getWithdrawalRequests`, `claimWithdrawals` / `quoteClaimWithdrawals`, `getStakedBalance`, `getApr`.
Staking is not lending: a lending `withdraw` is synchronous, while unstaking is a two-phase exchange — a request enters a queue, finalizes out of band (usually days), and only then can be claimed for the native token. Modelling that as `ILendingProtocol.withdraw` would produce a method that returns with no money received, and would stub out `borrow`/`repay` as unsupported. The honest interface names the queue. Wrap/unwrap, ETAs and reward history stay provider-specific extras so the core stays implementable by other liquid staking protocols.
## Tests
[Section titled “Tests”](#tests)
```plaintext
pnpm build # tsup → dist/
pnpm test # offline unit + conformance tests (vitest, stubbed EIP-1193 provider)
pnpm verify:live # read-only checks against mainnet (views, REST, eth_call simulation; needs dist/)
```
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels Lido transactions for a wallet’s history, offline and synchronously. A transaction is Lido’s when it calls one of the three contracts the instance is configured with (`stEth`, `wstEth`, `withdrawalQueue` — mainnet by default) on that chain, and the selector is: stETH `submit` → `stake` “Staked ETH”; wstETH `wrap` → `wrap` “Wrapped stETH”, `unwrap` → `unwrap` “Unwrapped wstETH”; WithdrawalQueue `requestWithdrawals` / `…WithPermit` / `…WstETH` / `…WstETHWithPermit` → `unstake` “Requested withdrawal”, `claimWithdrawals` / `claimWithdrawalsTo` / `claimWithdrawal` → `claim` “Claimed ETH”. Selectors are computed from the signatures at module load (`LIDO_ACTIONS`). `approve` / `transfer` on stETH or wstETH are not Lido operations and yield null, as does everything else. Subtitle `"Lido · Ethereum"`, `counterparty` the contract called; `assetsIn` / `assetsOut` are the wallet’s net movements from the receipt with stETH / wstETH / unstETH labelled by the module.
Fixtures in `fixtures/activity/` are the test wallet’s funded run (submit, wrap, unwrap, requestWithdrawalsWithPermit, claimWithdrawals; 2026-08-31 … 09-04); `negatives/` holds an SSV stake and a USDT approve.
## Classes
[Section titled “Classes”](#classes)
* [default](/api/anywalletkit/protocol-staking-lido-evm/classes/default/)
* [IStakingProtocol](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/)
* [StakingProtocol](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ClaimWithdrawalsOptions](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsoptions/)
* [ClaimWithdrawalsResult](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/)
* [Eip1193Provider](/api/anywalletkit/protocol-staking-lido-evm/interfaces/eip1193provider/)
* [LidoAction](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoaction/)
* [LidoActivityDeployment](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoactivitydeployment/)
* [LidoDeployment](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidodeployment/)
* [LidoPermitDomain](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidopermitdomain/)
* [LidoProtocolConfig](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoprotocolconfig/)
* [LidoTx](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidotx/)
* [RewardEvent](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardevent/)
* [RewardTotals](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardtotals/)
* [StakedBalance](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakedbalance/)
* [StakeOptions](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
* [StakeResult](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)
* [StakingWalletAccount](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakingwalletaccount/)
* [WithdrawalRequest](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequest/)
* [WithdrawalRequestOptions](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestoptions/)
* [WithdrawalRequestResult](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)
* [WithdrawalRequestsView](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestsview/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [LidoContractKey](/api/anywalletkit/protocol-staking-lido-evm/type-aliases/lidocontractkey/)
* [LidoProvider](/api/anywalletkit/protocol-staking-lido-evm/type-aliases/lidoprovider/)
## Variables
[Section titled “Variables”](#variables)
* [LIDO_ACTIONS](/api/anywalletkit/protocol-staking-lido-evm/variables/lido_actions/)
* [LIDO_ADDRESS_MAP](/api/anywalletkit/protocol-staking-lido-evm/variables/lido_address_map/)
## Functions
[Section titled “Functions”](#functions)
* [describeLidoActivity](/api/anywalletkit/protocol-staking-lido-evm/functions/describelidoactivity/)
* [splitWithdrawalAmounts](/api/anywalletkit/protocol-staking-lido-evm/functions/splitwithdrawalamounts/)
# default
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:185
Lido liquid staking for EVM wallet accounts: stake ETH → stETH, exit through the two-phase withdrawal queue (request → finalization → claim), wrap to and unwrap from the non-rebasing wstETH form, and read APR / rewards.
Withdrawal requests are permit-first: one EIP-2612 signature rides inside the request transaction, so the whole exit costs a single transaction. The permit is PROVEN with an eth_call before broadcasting — a bad signature must fall back to the two-transaction approve + request path, not burn gas. The fallback’s approval is awaited to a mined receipt before the request is sent, because the request’s gas estimate reverts against an unmined allowance.
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/)<[`LidoProtocolConfig`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoprotocolconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `LidoProtocolEvm`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:200
Creates a new interface to the Lido protocol for evm blockchains.
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`StakingWalletAccount`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakingwalletaccount/)
The wallet account to use to interact with the protocol (a @anywalletkit/wallet-evm account, or a read-only account for views).
##### config?
[Section titled “config?”](#config)
[`LidoProtocolConfig`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoprotocolconfig/) = `{}`
The protocol’s configuration.
#### Returns
[Section titled “Returns”](#returns)
`LidoProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`LidoProtocolConfig`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoprotocolconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_config`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_config)
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:496
Claims finalized withdrawal requests — ETH lands on the account.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#claimwithdrawals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:696
Recognize this deployment’s Lido transactions offline (stETH `submit`, wstETH `wrap` / `unwrap`, WithdrawalQueue `requestWithdrawals*` / `claimWithdrawals*`). See `lido-activity.ts` for the rule.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`describeActivity`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#describeactivity)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:533
Lido’s 7-day SMA staking APR, in percent.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getapr)
***
### getRewardHistory()
[Section titled “getRewardHistory()”](#getrewardhistory)
> **getRewardHistory**(`options?`): `Promise`<[`RewardEvent`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardevent/)\[]>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:673
Daily rebase reward history for the account, newest first. Decoration: failures return an empty array, never throw.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options?
[Section titled “options?”](#options-1)
The history’s options.
###### limit?
[Section titled “limit?”](#limit)
`number` = `14`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`RewardEvent`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardevent/)\[]>
Rebase events (reward in stETH base unit, timestamp unix seconds).
***
### getRewards()
[Section titled “getRewards()”](#getrewards)
> **getRewards**(): `Promise`<[`RewardTotals`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardtotals/) | `null`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:649
Lifetime staking rewards for the account, from the same backend stake.lido.fi uses. Decoration: failures return null, never throw.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`RewardTotals`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/rewardtotals/) | `null`>
Lifetime stETH rewards (base unit) and average APR (percent).
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakedbalance/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:514
The account’s staked position: stETH, wstETH and the live rate.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakedbalance/)>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getstakedbalance)
***
### getWithdrawalEta()
[Section titled “getWithdrawalEta()”](#getwithdrawaleta)
> **getWithdrawalEta**(`ids`): `Promise`<`Map`<`string`, `number`>>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:602
Finalization ETA per queued request, in seconds, from Lido’s withdrawal queue API. Decoration: failures return an empty map, never throw.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### ids
[Section titled “ids”](#ids)
`bigint`\[]
The request ids.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Map`<`string`, `number`>>
Request id (as string) → ETA seconds. Finalized requests are absent.
***
### getWithdrawalEtaForAmount()
[Section titled “getWithdrawalEtaForAmount()”](#getwithdrawaletaforamount)
> **getWithdrawalEtaForAmount**(`amount`): `Promise`<`number` | `null`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:629
Rough finalization ETA for a NEW withdrawal request of the given size, in seconds, from Lido’s withdrawal queue API (which takes ETHER units). Decoration: failures return null, never throw.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### amount
[Section titled “amount”](#amount)
`number` | `bigint`
The amount to withdraw (in base unit).
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`number` | `null`>
ETA seconds, or null.
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestsview/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:433
The account’s live withdrawal queue.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestsview/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:505
Quotes the costs of a claim operation.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options?
[Section titled “options?”](#options-2)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`__namedParameters`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:416
Quotes the costs of a withdrawal request, assuming the queue already holds an allowance (the executed request needs none — it carries a permit).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`__namedParameters`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:293
Quotes the costs of a stake operation.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-1)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/), `"hash"`>>
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`__namedParameters`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:354
Queues stETH or wstETH for withdrawal through the Lido queue. Permit-first (one signature, one transaction); falls back to approve + request if the permit leg fails. Over-cap amounts split into several requests inside the same transaction.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-9)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requestwithdrawal)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requireSigningAccount`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requiresigningaccount)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`__namedParameters`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:283
Stakes ETH — stETH lands on the account 1:1.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-10)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#stake)
***
### unwrap()
[Section titled “unwrap()”](#unwrap)
> **unwrap**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:584
Unwraps wstETH back to stETH — a single transaction, no approval needed.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
The unwrap’s options (amount in wstETH base unit).
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
***
### wrap()
[Section titled “wrap()”](#wrap)
> **wrap**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:555
Wraps stETH into the non-rebasing wstETH. wstETH has no wrap-with-permit, so this is approve (awaited to a mined receipt) + wrap.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### options
[Section titled “options”](#options-4)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
The wrap’s options (amount in stETH base unit).
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
The wrap’s result (approveHash null if the allowance already covered it).
# IStakingProtocol
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:69
The staking interface as a runtime marker class: every method throws NotImplementedError.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new IStakingProtocol**(): `IStakingProtocol`
#### Returns
[Section titled “Returns”](#returns)
`IStakingProtocol`
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/)>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:102
Claims finalized withdrawal requests — native tokens land on the account.
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_options?
[Section titled “\_options?”](#_options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/)>
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:117
The protocol’s current staking APR, in percent (e.g. 2.7 for 2.7%).
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakedbalance/)>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:112
The account’s staked position.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakedbalance/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestsview/)>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:97
The account’s live withdrawal queue: open requests, pending and claimable.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestsview/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:107
Quotes the costs of a claim operation.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_options?
[Section titled “\_options?”](#_options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`_options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:92
Quotes the costs of a withdrawal request.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_options
[Section titled “\_options”](#_options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`_options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:78
Quotes the costs of a stake operation.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_options
[Section titled “\_options”](#_options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/), `"hash"`>>
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`_options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:87
Queues staked tokens for withdrawal. The request finalizes out of band; once [IStakingProtocol#getWithdrawalRequests](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/#getwithdrawalrequests) reports it claimable, [IStakingProtocol#claimWithdrawals](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/#claimwithdrawals) exchanges it for native tokens.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_options
[Section titled “\_options”](#_options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequestresult/)>
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`_options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:73
Stakes native tokens into the protocol; staked tokens land on the account.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_options
[Section titled “\_options”](#_options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/stakeresult/)>
# StakingProtocol
Defined in: core/dist/index-QWdcwE6y.d.ts:783
Base class for staking modules: holds the account and config, and throws `NotImplementedError` for every method a module leaves out.
## Extends
[Section titled “Extends”](#extends)
* `ProtocolBase`<`TConfig`>
## Extended by
[Section titled “Extended by”](#extended-by)
* [`default`](/api/anywalletkit/protocol-staking-lido-evm/classes/default/)
* [`NativeStakingProtocolMonad`](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/)
* [`NativeStakingProtocolSolana`](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/)
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* `IStakingProtocol`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StakingProtocol**<`TConfig`>(`account`, `config?`): `StakingProtocol`<`TConfig`>
Defined in: core/dist/index-QWdcwE6y.d.ts:784
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config?
[Section titled “config?”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
`StakingProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
`ProtocolBase.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ProtocolBase._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ProtocolBase._config`
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_o?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:790
Claim finalized requests; the native coin returns to the account.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o?
[Section titled “\_o?”](#_o)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IStakingProtocol.claimWithdrawals`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ProtocolBase.describeActivity`
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: core/dist/index-QWdcwE6y.d.ts:793
APR in percent: 2.5 = 2.5 % (every staking module and app reads it this way).
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IStakingProtocol.getApr`
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:792
The account’s staked position.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IStakingProtocol.getStakedBalance`
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<`WithdrawalRequestsView`>
Defined in: core/dist/index-QWdcwE6y.d.ts:789
The account’s open requests, and which are claimable.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`WithdrawalRequestsView`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IStakingProtocol.getWithdrawalRequests`
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_o?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:791
Network fee of [IStakingProtocol.claimWithdrawals](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/#claimwithdrawals).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_o?
[Section titled “\_o?”](#_o-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IStakingProtocol.quoteClaimWithdrawals`
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`_o`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:788
Network fee of [IStakingProtocol.requestWithdrawal](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/#requestwithdrawal).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_o
[Section titled “\_o”](#_o-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IStakingProtocol.quoteRequestWithdrawal`
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`_o`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:786
Network fee of [IStakingProtocol.stake](/api/anywalletkit/protocol-staking-lido-evm/classes/istakingprotocol/#stake); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IStakingProtocol.quoteStake`
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`_o`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:787
Put staked tokens in the withdrawal queue. Sends an approval first when the protocol needs one.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_o
[Section titled “\_o”](#_o-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IStakingProtocol.requestWithdrawal`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ProtocolBase.requireSigningAccount`
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`_o`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:785
Stake native coin and receive the protocol’s staked token.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### \_o
[Section titled “\_o”](#_o-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IStakingProtocol.stake`
# describeLidoActivity
> **describeLidoActivity**(`tx`, `ctx`, `__namedParameters`): `ActivityItem` | `null`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:68
Describe `tx` if it is a call to this deployment’s stETH / wstETH / WithdrawalQueue.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`LidoActivityDeployment`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoactivitydeployment/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# splitWithdrawalAmounts
> **splitWithdrawalAmounts**(`amount`, `cap`): `bigint`\[]
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:120
Splits an over-cap withdrawal into the per-request chunks the queue enforces: N full caps followed by the remainder.
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
The total amount to withdraw (in base unit).
### cap
[Section titled “cap”](#cap)
`bigint`
The queue’s per-request maximum.
## Returns
[Section titled “Returns”](#returns)
`bigint`\[]
The request amounts.
# ClaimWithdrawalsOptions
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:49
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:51
Defaults to every claimable request.
# ClaimWithdrawalsResult
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:54
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:56
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:55
# Eip1193Provider
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:33
The EIP-1193 surface the module reads the chain through when no RPC url is given.
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`args`): `Promise`<`unknown`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### args
[Section titled “args”](#args)
###### method
[Section titled “method”](#method)
`string`
###### params?
[Section titled “params?”](#params)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# LidoAction
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:32
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:32
***
### title
[Section titled “title”](#title)
> **title**: `string`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:32
# LidoActivityDeployment
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:60
The deployment the recognizer matches calls against.
## Properties
[Section titled “Properties”](#properties)
### addresses
[Section titled “addresses”](#addresses)
> **addresses**: `object`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:62
#### stEth?
[Section titled “stEth?”](#steth)
> `optional` **stEth?**: `string`
#### withdrawalQueue?
[Section titled “withdrawalQueue?”](#withdrawalqueue)
> `optional` **withdrawalQueue?**: `string`
#### wstEth?
[Section titled “wstEth?”](#wsteth)
> `optional` **wstEth?**: `string`
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:61
# LidoDeployment
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:3
## Properties
[Section titled “Properties”](#properties)
### endpoints
[Section titled “endpoints”](#endpoints)
> **endpoints**: `object`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:8
#### apr
[Section titled “apr”](#apr)
> **apr**: `string`
#### rewardHistory
[Section titled “rewardHistory”](#rewardhistory)
> **rewardHistory**: `string`
#### withdrawalQueueApi
[Section titled “withdrawalQueueApi”](#withdrawalqueueapi)
> **withdrawalQueueApi**: `string`
***
### permitDomains
[Section titled “permitDomains”](#permitdomains)
> **permitDomains**: `object`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:7
#### stEth
[Section titled “stEth”](#steth)
> **stEth**: [`LidoPermitDomain`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidopermitdomain/)
#### wstEth
[Section titled “wstEth”](#wsteth)
> **wstEth**: [`LidoPermitDomain`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidopermitdomain/)
***
### stEth
[Section titled “stEth”](#steth-1)
> **stEth**: `string`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:4
***
### withdrawalQueue
[Section titled “withdrawalQueue”](#withdrawalqueue)
> **withdrawalQueue**: `string`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:6
***
### wstEth
[Section titled “wstEth”](#wsteth-1)
> **wstEth**: `string`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:5
# LidoPermitDomain
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:1
## Properties
[Section titled “Properties”](#properties)
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:1
***
### version
[Section titled “version”](#version)
> **version**: `string`
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:1
# LidoProtocolConfig
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:64
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: `object`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:71
#### stEth?
[Section titled “stEth?”](#steth)
> `optional` **stEth?**: `string`
#### withdrawalQueue?
[Section titled “withdrawalQueue?”](#withdrawalqueue)
> `optional` **withdrawalQueue?**: `string`
#### wstEth?
[Section titled “wstEth?”](#wsteth)
> `optional` **wstEth?**: `string`
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:68
Default 1. Other chains must also pass addresses and permitDomains.
***
### endpoints?
[Section titled “endpoints?”](#endpoints)
> `optional` **endpoints?**: `object`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:76
#### apr?
[Section titled “apr?”](#apr)
> `optional` **apr?**: `string`
#### rewardHistory?
[Section titled “rewardHistory?”](#rewardhistory)
> `optional` **rewardHistory?**: `string`
#### withdrawalQueueApi?
[Section titled “withdrawalQueueApi?”](#withdrawalqueueapi)
> `optional` **withdrawalQueueApi?**: `string`
***
### permitDomains?
[Section titled “permitDomains?”](#permitdomains)
> `optional` **permitDomains?**: `object`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:72
#### stEth?
[Section titled “stEth?”](#steth-1)
> `optional` **stEth?**: [`LidoPermitDomain`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidopermitdomain/)
#### wstEth?
[Section titled “wstEth?”](#wsteth-1)
> `optional` **wstEth?**: [`LidoPermitDomain`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidopermitdomain/)
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`LidoProvider`](/api/anywalletkit/protocol-staking-lido-evm/type-aliases/lidoprovider/) | [`LidoProvider`](/api/anywalletkit/protocol-staking-lido-evm/type-aliases/lidoprovider/)\[]
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:66
RPC url(s) or EIP-1193 provider(s); a list fails over in order. Defaults to the account’s provider.
***
### referral?
[Section titled “referral?”](#referral)
> `optional` **referral?**: `string`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:70
Lido Rewards-Share referral forwarded to submit(). Defaults to the zero address.
# LidoTx
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:41
A transaction as the module hands it to the account.
## Properties
[Section titled “Properties”](#properties)
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:43
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:42
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `bigint`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:44
# RewardEvent
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:84
## Properties
[Section titled “Properties”](#properties)
### apr
[Section titled “apr”](#apr)
> **apr**: `number` | `null`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:89
***
### reward
[Section titled “reward”](#reward)
> **reward**: `bigint`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:88
Base units.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:86
Unix seconds.
# RewardTotals
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:79
## Properties
[Section titled “Properties”](#properties)
### averageApr
[Section titled “averageApr”](#averageapr)
> **averageApr**: `number` | `null`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:81
***
### totalRewards
[Section titled “totalRewards”](#totalrewards)
> **totalRewards**: `bigint`
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:80
# StakedBalance
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:59
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:60
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:63
Primary staked tokens per wrapped token, 1e18 fixed point.
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:65
Whole position in primary staked tokens.
***
### wrappedBalance
[Section titled “wrappedBalance”](#wrappedbalance)
> **wrappedBalance**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:61
# StakeOptions
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:7
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:9
Amount in base units (wei).
# StakeResult
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:12
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:14
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:13
# StakingWalletAccount
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:51
The account surface the protocol needs. Writable methods are optional — views work with a read-only account that only implements getAddress.
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:52
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### quoteSendTransaction()?
[Section titled “quoteSendTransaction()?”](#quotesendtransaction)
> `optional` **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:59
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
[`LidoTx`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidotx/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `fee`: `bigint`; }>
***
### sendTransaction()?
[Section titled “sendTransaction()?”](#sendtransaction)
> `optional` **sendTransaction**(`tx`): `Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:58
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx-1)
[`LidoTx`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidotx/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
***
### signTypedData()?
[Section titled “signTypedData()?”](#signtypeddata)
> `optional` **signTypedData**(`typedData`): `Promise`<`string`>
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:53
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### typedData
[Section titled “typedData”](#typeddata)
###### domain
[Section titled “domain”](#domain)
`Record`<`string`, `unknown`>
###### message
[Section titled “message”](#message)
`Record`<`string`, `unknown`>
###### types
[Section titled “types”](#types)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`string`>
# WithdrawalRequest
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:31
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:34
Staked-token amount locked in this request (base units).
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:37
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:32
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:36
Unix seconds at which the request was created.
# WithdrawalRequestOptions
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:17
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:18
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `"stETH"` | `"wstETH"`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:20
Which staked-token form to withdraw. Defaults to “stETH”.
# WithdrawalRequestResult
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:23
## Properties
[Section titled “Properties”](#properties)
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `string` | `null`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:28
Hash of the approval transaction if the two-transaction fallback ran.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:26
Total gas cost, including a prior approval transaction if one was needed.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:24
# WithdrawalRequestsView
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:40
## Properties
[Section titled “Properties”](#properties)
### claimableAmount
[Section titled “claimableAmount”](#claimableamount)
> **claimableAmount**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:44
***
### claimableIds
[Section titled “claimableIds”](#claimableids)
> **claimableIds**: `bigint`\[]
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:46
Ascending, as the claim call expects.
***
### pendingAmount
[Section titled “pendingAmount”](#pendingamount)
> **pendingAmount**: `bigint`
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:43
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/withdrawalrequest/)\[]
Defined in: protocol-staking-lido-evm/src/staking-protocol.ts:42
Open (unclaimed) requests, newest first.
# LidoContractKey
> **LidoContractKey** = `"stEth"` | `"wstEth"` | `"withdrawalQueue"`
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:30
# LidoProvider
> **LidoProvider** = `string` | [`Eip1193Provider`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/eip1193provider/)
Defined in: protocol-staking-lido-evm/src/lido-protocol-evm.ts:38
RPC url or EIP-1193 provider.
# LIDO_ACTIONS
> `const` **LIDO_ACTIONS**: `Readonly`<`Record`<[`LidoContractKey`](/api/anywalletkit/protocol-staking-lido-evm/type-aliases/lidocontractkey/), `Readonly`<`Record`<`string`, [`LidoAction`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidoaction/)>>>>
Defined in: protocol-staking-lido-evm/src/lido-activity.ts:38
Selector → action, per contract. Computed from the signatures above at module load.
# LIDO_ADDRESS_MAP
> `const` **LIDO_ADDRESS_MAP**: `Record`<`number`, [`LidoDeployment`](/api/anywalletkit/protocol-staking-lido-evm/interfaces/lidodeployment/)>
Defined in: protocol-staking-lido-evm/src/lido-address-map.ts:26
Lido contract addresses and EIP-2612 permit domains, keyed by chain id.
The permit domain versions are NOT guessable from the token names: they were verified against each token’s on-chain DOMAIN_SEPARATOR (stETH signs as version “2”, wstETH as version “1”). A wrong version produces a signature that recovers to a different address — the permit call reverts with no useful message, and the protocol silently falls back to the two-transaction approve + request path.
Only mainnet ships as a default: other deployments (e.g. the Hoodi testnet) must be passed explicitly through the protocol’s `config.addresses` / `config.permitDomains` so that nobody stakes against an unverified address that a default quietly supplied.
# @anywalletkit/protocol-staking-native-monad
# @anywalletkit/protocol-staking-native-monad
[Section titled “@anywalletkit/protocol-staking-native-monad”](#anywalletkitprotocol-staking-native-monad)
Native MON staking for `@anywalletkit/wallet-evm` accounts on Monad (chain 143, testnet 10143): delegations straight to the validators **your app lists**, through Monad’s staking precompile at `0x0000000000000000000000000000000000001000`. No pool, no token, no extra contract.
```sh
npm install @anywalletkit/protocol-staking-native-monad @anywalletkit/wallet-evm
```
## Usage
[Section titled “Usage”](#usage)
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerEvm } from '@anywalletkit/wallet-evm'
import { NativeStakingProtocolMonad } from '@anywalletkit/protocol-staking-native-monad'
const wallet = new Wallet(seedPhrase)
wallet.registerWallet('eip155:143', WalletManagerEvm, { provider: ['https://rpc.monad.xyz'], chainId: 143 })
const account = await wallet.getAccount('eip155:143')
// Your own validator(s):
const staking = new NativeStakingProtocolMonad(account, { validators: [{ id: 12n, name: 'Our validator' }] })
await staking.stake({ amount: 10n ** 18n }) // delegate(12), 1 MON
await staking.requestWithdrawal({ amount: 10n ** 18n }) // undelegate into a free slot
// … one epoch after the stake deactivates …
await staking.claimWithdrawals() // withdraw every ready request
// Or let users pick from the active set:
const open = new NativeStakingProtocolMonad(account, { validators: 'any' })
const validators = await open.listValidators() // by stake: commission, active, apr, eligible, refusals
await open.stake({ amount: 10n ** 18n, validator: validators[0].id })
```
Amounts are wei (bigint). Without `provider` in the config, reads go to the account’s own RPC.
## Config
[Section titled “Config”](#config)
| Option | Default | |
| ------------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `validators` | — (required) | Validator ids (bigint / number / `{ id, name }`), or `'any'`. No list, no module. |
| `defaultValidator` | the only listed id | Used when a call names no validator; with several listed and no default, calls must name one. |
| `maxCommission` | `10` | Percent. Checked against a fresh read of the validator (current and upcoming commission, compared in the precompile’s 1e18 scale) at every delegation and compound. |
| `allowInactive` | `false` | Delegate to validators outside the consensus set or flagged by the precompile (their stake earns nothing). |
| `chainId` | the account’s | Pin 143 or 10143. The account and the read RPC must both be on it. Pin it when you list validator ids: ids differ between mainnet and testnet. |
| `provider` | the account’s RPC | URL, list (failover) or EIP-1193 provider, for reads and simulation. |
| `reserveBalance` | 10 MON | Left on the wallet by `stake`; at least 10 MON, Monad’s reserve balance (value transfers that dip below it revert). |
| `maxWithdrawId` | `255` | Highest withdrawal slot used and scanned. |
| `withdrawScan` | `'gap'` | `'gap'` reads withdrawal slots from 0 and stops 32 empty slots past the last used one; `'full'` reads all 256 per validator. |
| `concurrency` | `6` | Reads in flight (public Monad RPCs cap requests per second; batching counts each call). |
| `enrich` | — | `(ids) => ({ [id]: { apr, name, … } })`: an explorer’s APR, names, logos. Decoration only. |
| `stakingAddress` / `timeoutMs` | `0x…1000` / 15 s | |
## Methods
[Section titled “Methods”](#methods)
| Shared `StakingProtocol` | What it does on Monad |
| -------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `stake({ amount, validator? })` | `delegate(validatorId)` with the amount as value |
| `requestWithdrawal({ amount, validator?, withdrawId? })` | `undelegate(validatorId, amount, withdrawId)`; the lowest free slot by default |
| `getWithdrawalRequests({ validator?, validators? })` | pending withdrawals; `id` = `validatorId << 8 \| withdrawId` |
| `claimWithdrawals({ ids?, validators? })` | `withdraw(validatorId, withdrawId)` per ready request (one transaction each) |
| `getStakedBalance()` | `balance` = active stake, `total` = active + activating; `unclaimedRewards` apart |
| `getApr({ validator? })` | `enrich`’s APR, or the estimate below |
Monad extras: `compound` / `claimRewards` (+ quotes), `getEpoch()` → `{ epoch, inEpochDelayPeriod, activatesAtEpoch }`, `listValidators`, `getValidator`, `listPositions`, `nextWithdrawId`, `getNetworkStats`, `getMaxStakeable`. Every write has a `quote*` twin that signs nothing.
## Timing
[Section titled “Timing”](#timing)
* A stake (or a compound) becomes active in epoch n+1, or n+2 when sent after the epoch’s boundary block (`getEpoch().inEpochDelayPeriod`). Epochs are about 4 hours; they are counted in rounds, not blocks, so the module always asks `getEpoch()`.
* Only active stake can be undelegated. Stake that is still activating shows in `activating` / `activatingNext` with its epoch.
* An undelegated amount deactivates at n+1 (or n+2) and can be withdrawn one epoch later (`withdrawableAtEpoch`). Rewards keep accruing until then and are paid with the withdrawal.
* `claimRewards` pays at once; `compound` follows the stake timing.
## APR
[Section titled “APR”](#apr)
`apr` is 18 MON per block × blocks per year ÷ the consensus set’s stake × (1 − commission). The block time is measured over the last 50 000 blocks; the stake is summed over the consensus set (one read per validator, cached). It assumes the validator proposes its share of blocks; pass `enrich` for a measured figure.
## Safety
[Section titled “Safety”](#safety)
* Fail-closed before anything is signed: unlisted, unknown, inactive or over-commission validators; amounts under 1 gwei or above the active stake; a stake that would leave less than the reserve; withdrawal slots in use or all 256 taken; requests not yet open; an account or read RPC that is not on Monad (or on the pinned chain).
* Every write is simulated with `eth_call` as the wallet first, and the precompile’s revert comes back in plain words (`withdrawal not ready`, `insufficient stake`, `reserve balance violation`, …).
* The module never uses multicall, STATICCALL or EIP-7702 against the precompile (all revert there).
* Policies: the transactions go to `0x0000000000000000000000000000000000001000`; an `allowlist` must include it.
* **Full exits.** Once the wallet’s stake with a validator reaches zero, the precompile drops that validator from `getDelegations`, while the withdrawal is still pending. The module still looks at the listed validators and those this instance undelegated from; in `'any'` mode keep the `id` that `requestWithdrawal` returns (`claimWithdrawals({ ids })` always works) or pass the validator in `validators` (the activity feed has it).
* Reading withdrawals costs one `eth_call` per slot: the gap scan reads about 36 slots for a validator without withdrawals; `withdrawScan: 'full'` reads all 256. Pass `validator` to read one position.
* Validator data for display is cached for a minute; every write decision reads the validator again.
## Testing
[Section titled “Testing”](#testing)
* `pnpm test`: selectors and topics against Monad’s published values, id packing, timing rules, every operation and refusal over an in-memory precompile, conformance with recorded mainnet transactions (delegate, undelegate, withdraw, compound, claimRewards).
* `pnpm verify:live [rpcUrl] [chainId]`: mainnet reads, then every write planned for real delegators found from recent events and simulated by the module and by the wallet. Nothing is signed. There is no forked testing: the precompile has no code to fork.
## Classes
[Section titled “Classes”](#classes)
* [NativeStakingProtocolMonad](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [DelegatorPosition](/api/anywalletkit/protocol-staking-native-monad/interfaces/delegatorposition/)
* [Eip1193Provider](/api/anywalletkit/protocol-staking-native-monad/interfaces/eip1193provider/)
* [MonadClaimOptions](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimoptions/)
* [MonadClaimQuote](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/)
* [MonadClaimResult](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimresult/)
* [MonadEpoch](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadepoch/)
* [MonadNetworkStats](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadnetworkstats/)
* [MonadRewardsOptions](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsoptions/)
* [MonadRewardsQuote](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)
* [MonadRewardsResult](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)
* [MonadStakeOptions](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeoptions/)
* [MonadStakeQuote](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/)
* [MonadStakeResult](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeresult/)
* [MonadUnstakeOptions](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeoptions/)
* [MonadUnstakeQuote](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/)
* [MonadUnstakeResult](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeresult/)
* [MonadWithdrawalRequest](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadwithdrawalrequest/)
* [MonadWithdrawalScanOptions](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadwithdrawalscanoptions/)
* [NativeStakingMonadConfig](/api/anywalletkit/protocol-staking-native-monad/interfaces/nativestakingmonadconfig/)
* [ValidatorConfig](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorconfig/)
* [ValidatorExtra](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)
* [ValidatorInfo](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [MonadChainId](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadchainid/)
* [MonadProvider](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadprovider/)
* [MonadWithdrawalRequestsView](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadwithdrawalrequestsview/)
* [NormalizedValidators](/api/anywalletkit/protocol-staking-native-monad/type-aliases/normalizedvalidators/)
* [ValidatorEnricher](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorenricher/)
* [ValidatorRefusal](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorrefusal/)
* [ValidatorsOption](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorsoption/)
## Variables
[Section titled “Variables”](#variables)
* [ACTIVE_VALIDATOR_STAKE](/api/anywalletkit/protocol-staking-native-monad/variables/active_validator_stake/)
* [ACTIVE_VALSET_SIZE](/api/anywalletkit/protocol-staking-native-monad/variables/active_valset_size/)
* [BLOCK_REWARD](/api/anywalletkit/protocol-staking-native-monad/variables/block_reward/)
* [BOUNDARY_BLOCK_PERIOD](/api/anywalletkit/protocol-staking-native-monad/variables/boundary_block_period/)
* [DEFAULT_CONCURRENCY](/api/anywalletkit/protocol-staking-native-monad/variables/default_concurrency/)
* [DEFAULT_MAX_COMMISSION](/api/anywalletkit/protocol-staking-native-monad/variables/default_max_commission/)
* [DEFAULT_TIMEOUT_MS](/api/anywalletkit/protocol-staking-native-monad/variables/default_timeout_ms/)
* [DUST_THRESHOLD](/api/anywalletkit/protocol-staking-native-monad/variables/dust_threshold/)
* [EPOCH_DELAY_ROUNDS](/api/anywalletkit/protocol-staking-native-monad/variables/epoch_delay_rounds/)
* [MAX_COMMISSION](/api/anywalletkit/protocol-staking-native-monad/variables/max_commission/)
* [MAX_WITHDRAW_ID](/api/anywalletkit/protocol-staking-native-monad/variables/max_withdraw_id/)
* [MIN_AUTH_ADDRESS_STAKE](/api/anywalletkit/protocol-staking-native-monad/variables/min_auth_address_stake/)
* [MODULE_NAME](/api/anywalletkit/protocol-staking-native-monad/variables/module_name/)
* [MONAD_CHAIN_IDS](/api/anywalletkit/protocol-staking-native-monad/variables/monad_chain_ids/)
* [MONAD_MAINNET](/api/anywalletkit/protocol-staking-native-monad/variables/monad_mainnet/)
* [MONAD_TESTNET](/api/anywalletkit/protocol-staking-native-monad/variables/monad_testnet/)
* [PAGINATED_RESULTS_SIZE](/api/anywalletkit/protocol-staking-native-monad/variables/paginated_results_size/)
* [REVERTS](/api/anywalletkit/protocol-staking-native-monad/variables/reverts/)
* [SELECTORS](/api/anywalletkit/protocol-staking-native-monad/variables/selectors/)
* [STAKING_ABI](/api/anywalletkit/protocol-staking-native-monad/variables/staking_abi/)
* [STAKING_PRECOMPILE](/api/anywalletkit/protocol-staking-native-monad/variables/staking_precompile/)
* [TOPICS](/api/anywalletkit/protocol-staking-native-monad/variables/topics/)
* [USER_RESERVE_BALANCE](/api/anywalletkit/protocol-staking-native-monad/variables/user_reserve_balance/)
* [WITHDRAW_SCAN_GAP](/api/anywalletkit/protocol-staking-native-monad/variables/withdraw_scan_gap/)
* [WITHDRAWAL_DELAY](/api/anywalletkit/protocol-staking-native-monad/variables/withdrawal_delay/)
## Functions
[Section titled “Functions”](#functions)
* [activatesAtEpoch](/api/anywalletkit/protocol-staking-native-monad/functions/activatesatepoch/)
* [commissionToPercent](/api/anywalletkit/protocol-staking-native-monad/functions/commissiontopercent/)
* [createReadClient](/api/anywalletkit/protocol-staking-native-monad/functions/createreadclient/)
* [describeMonadStakingActivity](/api/anywalletkit/protocol-staking-native-monad/functions/describemonadstakingactivity/)
* [describeRevert](/api/anywalletkit/protocol-staking-native-monad/functions/describerevert/)
* [normalizeValidators](/api/anywalletkit/protocol-staking-native-monad/functions/normalizevalidators/)
* [packWithdrawalId](/api/anywalletkit/protocol-staking-native-monad/functions/packwithdrawalid/)
* [paginate](/api/anywalletkit/protocol-staking-native-monad/functions/paginate/)
* [percentToCommission](/api/anywalletkit/protocol-staking-native-monad/functions/percenttocommission/)
* [pool](/api/anywalletkit/protocol-staking-native-monad/functions/pool/)
* [toValidatorId](/api/anywalletkit/protocol-staking-native-monad/functions/tovalidatorid/)
* [toWithdrawId](/api/anywalletkit/protocol-staking-native-monad/functions/towithdrawid/)
* [unpackWithdrawalId](/api/anywalletkit/protocol-staking-native-monad/functions/unpackwithdrawalid/)
* [withdrawableAtEpoch](/api/anywalletkit/protocol-staking-native-monad/functions/withdrawableatepoch/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [NativeStakingProtocolMonad](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/)
# NativeStakingProtocolMonad
Defined in: protocol-staking-native-monad/src/protocol.ts:215
Native MON staking on Monad: delegations straight to validators through the staking precompile (0x…1000). No pool, no token: the position is the wallet’s `DelInfo` per validator.
* `stake` is `delegate(validatorId)` with the amount as value. It becomes active at the next epoch (n+1), or n+2 when sent after the boundary block (`getEpoch().activatesAtEpoch`).
* `requestWithdrawal` is `undelegate(validatorId, amount, withdrawId)` with the lowest free slot (0..255). Only active stake can be undelegated. The MON can be withdrawn one epoch after it deactivates (`withdrawableAtEpoch`).
* `claimWithdrawals` sends `withdraw(validatorId, withdrawId)` for each ready request (the precompile takes one per transaction). Rewards are separate: `claimRewards` / `compound`.
Fail-closed before anything is signed: the validator must be listed (or `'any'`), exist, be in the consensus set in good standing and charge at most `maxCommission`; amounts respect the 1 gwei minimum, the active stake and Monad’s 10 MON reserve balance; withdrawal slots must be free; the account and the read RPC must both be on Monad. Every write is simulated with `eth_call` first and a revert comes back in plain words.
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/)<[`NativeStakingMonadConfig`](/api/anywalletkit/protocol-staking-native-monad/interfaces/nativestakingmonadconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NativeStakingProtocolMonad**(`account`, `config`): `NativeStakingProtocolMonad`
Defined in: protocol-staking-native-monad/src/protocol.ts:235
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
[`NativeStakingMonadConfig`](/api/anywalletkit/protocol-staking-native-monad/interfaces/nativestakingmonadconfig/)
#### Returns
[Section titled “Returns”](#returns)
`NativeStakingProtocolMonad`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`NativeStakingMonadConfig`](/api/anywalletkit/protocol-staking-native-monad/interfaces/nativestakingmonadconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_config`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_config)
***
### defaultValidator
[Section titled “defaultValidator”](#defaultvalidator)
> `readonly` **defaultValidator**: `bigint` | `undefined`
Defined in: protocol-staking-native-monad/src/protocol.ts:217
***
### maxCommission
[Section titled “maxCommission”](#maxcommission)
> `readonly` **maxCommission**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:218
***
### maxWithdrawId
[Section titled “maxWithdrawId”](#maxwithdrawid)
> `readonly` **maxWithdrawId**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:221
***
### reserveBalance
[Section titled “reserveBalance”](#reservebalance)
> `readonly` **reserveBalance**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:220
***
### stakingAddress
[Section titled “stakingAddress”](#stakingaddress)
> `readonly` **stakingAddress**: `` `0x${string}` ``
Defined in: protocol-staking-native-monad/src/protocol.ts:219
***
### validators
[Section titled “validators”](#validators)
> `readonly` **validators**: [`NormalizedValidators`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/normalizedvalidators/)
Defined in: protocol-staking-native-monad/src/protocol.ts:216
***
### withdrawScan
[Section titled “withdrawScan”](#withdrawscan)
> `readonly` **withdrawScan**: `"multicall"` | `"gap"` | `"full"`
Defined in: protocol-staking-native-monad/src/protocol.ts:225
## Methods
[Section titled “Methods”](#methods)
### claimRewards()
[Section titled “claimRewards()”](#claimrewards)
> **claimRewards**(`options?`): `Promise`<[`MonadRewardsResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:858
Sends the rewards earned with a validator to the wallet, right away.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`MonadRewardsOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`MonadRewardsResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)>
***
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`MonadClaimResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimresult/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:798
Withdraws ready requests (all, or `ids`): one `withdraw` transaction each, sent in order. If one fails midway, the error carries `sent` (the hashes that went out).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options?
[Section titled “options?”](#options-1)
[`MonadClaimOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`MonadClaimResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#claimwithdrawals)
***
### compound()
[Section titled “compound()”](#compound)
> **compound**(`options?`): `Promise`<[`MonadRewardsResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:843
Re-delegates the rewards earned with a validator (active from `activatesAtEpoch`).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options?
[Section titled “options?”](#options-2)
[`MonadRewardsOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`MonadRewardsResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)>
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:866
Labels staking-precompile transactions (stake, unstake, withdraw, compound, claim rewards) offline; see `activity.ts`.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-4)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`describeActivity`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#describeactivity)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(`options?`): `Promise`<`number`>
Defined in: protocol-staking-native-monad/src/protocol.ts:496
APR in percent for a validator (`validator`, else the default): `enrich`’s figure when it gives one, else 18 MON × blocks per year ÷ consensus stake × (1 − commission). Without a validator in `'any'` mode: the network figure before commission.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options?
[Section titled “options?”](#options-3)
###### validator?
[Section titled “validator?”](#validator)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`number`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getapr)
***
### getEpoch()
[Section titled “getEpoch()”](#getepoch)
> **getEpoch**(): `Promise`<[`MonadEpoch`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadepoch/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:350
The current epoch, whether the boundary block has passed, and the epoch a change made now takes effect in.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`MonadEpoch`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadepoch/)>
***
### getMaxStakeable()
[Section titled “getMaxStakeable()”](#getmaxstakeable)
> **getMaxStakeable**(): `Promise`<`bigint`>
Defined in: protocol-staking-native-monad/src/protocol.ts:567
The most `stake` can take now: balance − reserve balance (the gas is paid out of the reserve, as Monad allows); 0 below 1 gwei.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`bigint`>
***
### getNetworkStats()
[Section titled “getNetworkStats()”](#getnetworkstats)
> **getNetworkStats**(): `Promise`<[`MonadNetworkStats`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadnetworkstats/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:423
Network figures for the APR estimate: the consensus set’s total stake (one `getValidator` per validator, cached) and the block time measured over the last 50 000 blocks. Cached 10 minutes.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`MonadNetworkStats`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadnetworkstats/)>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/) & `object`>
Defined in: protocol-staking-native-monad/src/protocol.ts:555
The position: `balance` is active stake, `total` active plus activating (rewards are not in it until compounded; they are in `unclaimedRewards`). No wrapped form (`rate` 0).
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/) & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getstakedbalance)
***
### getValidator()
[Section titled “getValidator()”](#getvalidator)
> **getValidator**(`id`): `Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:446
One validator, read fresh: stake, commission, standing, APR, and whether the module may delegate to it.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(`options?`): `Promise`<[`MonadWithdrawalRequestsView`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadwithdrawalrequestsview/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:639
Pending withdrawals. `id` is `validatorId << 8 | withdrawId`; `claimable` once the epoch is past the stake’s deactivation (`withdrawableAtEpoch`); `timestamp` is 0 (the precompile does not keep it).
Validators looked at: the wallet’s delegations, the configured list, validators this instance undelegated from, and `validators`. A validator the wallet fully exited drops out of `getDelegations`, so in `'any'` mode pass it (from the activity feed or the `id` that `requestWithdrawal` returned) or its withdrawal is not found. `validator` reads just one.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### options?
[Section titled “options?”](#options-4)
[`MonadWithdrawalScanOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadwithdrawalscanoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`MonadWithdrawalRequestsView`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadwithdrawalrequestsview/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getwithdrawalrequests)
***
### listPositions()
[Section titled “listPositions()”](#listpositions)
> **listPositions**(`options?`): `Promise`<[`DelegatorPosition`](/api/anywalletkit/protocol-staking-native-monad/interfaces/delegatorposition/)\[]>
Defined in: protocol-staking-native-monad/src/protocol.ts:542
The wallet’s positions — every validator it has stake with, plus the configured ones, the ones it unstaked from and `options.validators` — with pending stake and unclaimed rewards; a validator with nothing there is left out. `validator.apr` is filled only once `getNetworkStats()` has run (it costs \~200 reads).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### options?
[Section titled “options?”](#options-5)
###### validators?
[Section titled “validators?”](#validators-1)
readonly (`number` | `bigint`)\[]
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`DelegatorPosition`](/api/anywalletkit/protocol-staking-native-monad/interfaces/delegatorposition/)\[]>
***
### listValidators()
[Section titled “listValidators()”](#listvalidators)
> **listValidators**(`options?`): `Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)\[]>
Defined in: protocol-staking-native-monad/src/protocol.ts:461
The validators to offer: the configured list in its order, or in `'any'` mode the consensus set by stake (`limit` to cut it). Each says whether it can take stake now and why not.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-6)
###### limit?
[Section titled “limit?”](#limit)
`number`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)\[]>
***
### nextWithdrawId()
[Section titled “nextWithdrawId()”](#nextwithdrawid)
> **nextWithdrawId**(`validatorId`): `Promise`<`number` | `null`>
Defined in: protocol-staking-native-monad/src/protocol.ts:580
The lowest free withdrawal slot for this validator (null when all are in use).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### validatorId
[Section titled “validatorId”](#validatorid)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`number` | `null`>
***
### quoteClaimRewards()
[Section titled “quoteClaimRewards()”](#quoteclaimrewards)
> **quoteClaimRewards**(`options?`): `Promise`<[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:851
Network fee of [claimRewards](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/#claimrewards); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### options?
[Section titled “options?”](#options-7)
[`MonadRewardsOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<[`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:784
Total fee and amount of a claim (one `withdraw` per request); nothing is signed. Each transaction is simulated.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options?
[Section titled “options?”](#options-8)
[`MonadClaimOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteCompound()
[Section titled “quoteCompound()”](#quotecompound)
> **quoteCompound**(`options?`): `Promise`<[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:836
Network fee of [compound](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/#compound); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### options?
[Section titled “options?”](#options-9)
[`MonadRewardsOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:736
Network fee and slot of an unstake; nothing is signed. The transaction is simulated.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-10)
[`MonadUnstakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/)>
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:684
Network fee and details of a stake; nothing is signed. The transaction is simulated.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-11)
[`MonadStakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/)>
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`MonadUnstakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeresult/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:747
Undelegates `amount` wei of active stake into a withdrawal slot; claim it with `claimWithdrawals` once it opens. Keep the returned `id`: after a full exit the validator no longer shows in `getDelegations`, and `claimWithdrawals({ ids: [id] })` always works.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-12)
[`MonadUnstakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`MonadUnstakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-9)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requestwithdrawal)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requireSigningAccount`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requiresigningaccount)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`MonadStakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeresult/)>
Defined in: protocol-staking-native-monad/src/protocol.ts:691
Delegates `amount` wei of MON to a validator (`delegate`, the amount as value).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### options
[Section titled “options”](#options-13)
[`MonadStakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`MonadStakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-10)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#stake)
# activatesAtEpoch
> **activatesAtEpoch**(`epoch`): `bigint`
Defined in: protocol-staking-native-monad/src/encode.ts:52
The epoch a stake change made now takes effect in: n+1 before the boundary block, n+2 after it.
## Parameters
[Section titled “Parameters”](#parameters)
### epoch
[Section titled “epoch”](#epoch)
#### epoch
[Section titled “epoch”](#epoch-1)
`bigint`
#### inEpochDelayPeriod
[Section titled “inEpochDelayPeriod”](#inepochdelayperiod)
`boolean`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# commissionToPercent
> **commissionToPercent**(`commission`): `number`
Defined in: protocol-staking-native-monad/src/encode.ts:39
Commission in the precompile’s 1e18 scale → percent (5e16 → 5).
## Parameters
[Section titled “Parameters”](#parameters)
### commission
[Section titled “commission”](#commission)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# createReadClient
> **createReadClient**(`providers`, `timeoutMs?`): { } | `undefined`
Defined in: protocol-staking-native-monad/src/rpc.ts:17
A viem client over one provider or a list (fails over in order, like the account’s own client).
## Parameters
[Section titled “Parameters”](#parameters)
### providers
[Section titled “providers”](#providers)
[`MonadProvider`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadprovider/)\[]
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number` = `DEFAULT_TIMEOUT_MS`
## Returns
[Section titled “Returns”](#returns)
{ } | `undefined`
# describeMonadStakingActivity
> **describeMonadStakingActivity**(`tx`, `ctx`, `options?`): `ActivityItem` | `null`
Defined in: protocol-staking-native-monad/src/activity.ts:51
Describes a Monad staking transaction for the wallet’s feed, or returns null when it is not one.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### options?
[Section titled “options?”](#options)
#### stakingAddress?
[Section titled “stakingAddress?”](#stakingaddress)
`string`
#### validators?
[Section titled “validators?”](#validators)
readonly `object`\[]
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# describeRevert
> **describeRevert**(`error`): `Error`
Defined in: protocol-staking-native-monad/src/protocol.ts:176
Turns a precompile revert into a plain-language error (the cause is kept).
## Parameters
[Section titled “Parameters”](#parameters)
### error
[Section titled “error”](#error)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`Error`
# normalizeValidators
> **normalizeValidators**(`option`): [`NormalizedValidators`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/normalizedvalidators/)
Defined in: protocol-staking-native-monad/src/validators.ts:64
Validates the `validators` option: required, ids valid, duplicates dropped.
## Parameters
[Section titled “Parameters”](#parameters)
### option
[Section titled “option”](#option)
[`ValidatorsOption`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorsoption/) | `undefined`
## Returns
[Section titled “Returns”](#returns)
[`NormalizedValidators`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/normalizedvalidators/)
# packWithdrawalId
> **packWithdrawalId**(`validatorId`, `withdrawId`): `bigint`
Defined in: protocol-staking-native-monad/src/encode.ts:27
Packs (validatorId, withdrawId) into one withdrawal-request id: `validatorId << 8 | withdrawId`, so `claimWithdrawals({ ids })` never mixes up the same slot number on two validators.
## Parameters
[Section titled “Parameters”](#parameters)
### validatorId
[Section titled “validatorId”](#validatorid)
`bigint`
### withdrawId
[Section titled “withdrawId”](#withdrawid)
`number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# paginate
> **paginate**<`C`>(`page`, `first`, `maxPages?`): `Promise`<`bigint`\[]>
Defined in: protocol-staking-native-monad/src/rpc.ts:49
Reads every page of a paginated precompile getter: `(isDone, next, ids)`, following `next` until `isDone`. Pages are shorter than the documented 100 in practice; the guard stops a node that never says done.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### C
[Section titled “C”](#c)
`C` *extends* `number` | `bigint`
## Parameters
[Section titled “Parameters”](#parameters)
### page
[Section titled “page”](#page)
(`start`) => `Promise`\
### first
[Section titled “first”](#first)
`C`
### maxPages?
[Section titled “maxPages?”](#maxpages)
`number` = `50`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`bigint`\[]>
# percentToCommission
> **percentToCommission**(`percent`): `bigint`
Defined in: protocol-staking-native-monad/src/encode.ts:46
Percent → the precompile’s 1e18 scale (5 → 5e16).
## Parameters
[Section titled “Parameters”](#parameters)
### percent
[Section titled “percent”](#percent)
`number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# pool
> **pool**<`T`, `R`>(`items`, `limit`, `fn`): `Promise`<`R`\[]>
Defined in: protocol-staking-native-monad/src/rpc.ts:24
Maps `items` with at most `limit` calls in flight, keeping the order.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
### R
[Section titled “R”](#r)
`R`
## Parameters
[Section titled “Parameters”](#parameters)
### items
[Section titled “items”](#items)
readonly `T`\[]
### limit
[Section titled “limit”](#limit)
`number`
### fn
[Section titled “fn”](#fn)
(`item`, `index`) => `Promise`<`R`>
## Returns
[Section titled “Returns”](#returns)
`Promise`<`R`\[]>
# toValidatorId
> **toValidatorId**(`value`, `what?`): `bigint`
Defined in: protocol-staking-native-monad/src/encode.ts:7
A validator id as the precompile takes it (uint64). Accepts bigint or a safe non-negative integer.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
### what?
[Section titled “what?”](#what)
`string` = `'validator'`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# toWithdrawId
> **toWithdrawId**(`value`): `number`
Defined in: protocol-staking-native-monad/src/encode.ts:16
A withdrawal slot (uint8).
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`number`
# unpackWithdrawalId
> **unpackWithdrawalId**(`id`): `object`
Defined in: protocol-staking-native-monad/src/encode.ts:32
The inverse of [packWithdrawalId](/api/anywalletkit/protocol-staking-native-monad/functions/packwithdrawalid/).
## Parameters
[Section titled “Parameters”](#parameters)
### id
[Section titled “id”](#id)
`number` | `bigint`
## Returns
[Section titled “Returns”](#returns)
`object`
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
# withdrawableAtEpoch
> **withdrawableAtEpoch**(`withdrawEpoch`): `bigint`
Defined in: protocol-staking-native-monad/src/encode.ts:57
The first epoch a withdrawal can be claimed in (its `withdrawEpoch` is when the stake deactivates).
## Parameters
[Section titled “Parameters”](#parameters)
### withdrawEpoch
[Section titled “withdrawEpoch”](#withdrawepoch)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# DelegatorPosition
Defined in: protocol-staking-native-monad/src/protocol.ts:75
One delegation of the wallet. Amounts in wei.
## Properties
[Section titled “Properties”](#properties)
### activating
[Section titled “activating”](#activating)
> **activating**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:81
Becomes active at `activationEpoch`.
***
### activatingNext
[Section titled “activatingNext”](#activatingnext)
> **activatingNext**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:83
Becomes active at `nextActivationEpoch` (a delegation made after the boundary block).
***
### activationEpoch
[Section titled “activationEpoch”](#activationepoch)
> **activationEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:84
***
### active
[Section titled “active”](#active)
> **active**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:79
Active stake: earns rewards and can be undelegated.
***
### name
[Section titled “name”](#name)
> **name**: `string` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:77
***
### nextActivationEpoch
[Section titled “nextActivationEpoch”](#nextactivationepoch)
> **nextActivationEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:85
***
### unclaimedRewards
[Section titled “unclaimedRewards”](#unclaimedrewards)
> **unclaimedRewards**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:87
Rewards earned and not yet claimed or compounded.
***
### validator
[Section titled “validator”](#validator)
> **validator**: [`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)
Defined in: protocol-staking-native-monad/src/protocol.ts:88
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:76
# Eip1193Provider
Defined in: protocol-staking-native-monad/src/rpc.ts:4
The EIP-1193 surface reads can go through when no RPC url is given.
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`args`): `Promise`<`unknown`>
Defined in: protocol-staking-native-monad/src/rpc.ts:5
#### Parameters
[Section titled “Parameters”](#parameters)
##### args
[Section titled “args”](#args)
###### method
[Section titled “method”](#method)
`string`
###### params?
[Section titled “params?”](#params)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# MonadClaimOptions
Defined in: protocol-staking-native-monad/src/protocol.ts:132
Claim options: `ids` as `getWithdrawalRequests` returns them; `validators` adds validators to look at (see [NativeStakingProtocolMonad.getWithdrawalRequests](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/#getwithdrawalrequests)).
## Extends
[Section titled “Extends”](#extends)
* [`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:734
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/).[`ids`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/#ids)
***
### validators?
[Section titled “validators?”](#validators)
> `optional` **validators?**: (`number` | `bigint`)\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:132
# MonadClaimQuote
Defined in: protocol-staking-native-monad/src/protocol.ts:142
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadClaimResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimresult/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:145
***
### claims
[Section titled “claims”](#claims)
> **claims**: `object`\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:146
#### amount
[Section titled “amount”](#amount-1)
> **amount**: `bigint`
#### id
[Section titled “id”](#id)
> **id**: `bigint`
#### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
#### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:144
Total fee: one `withdraw` transaction per request (the precompile takes no batches).
# MonadClaimResult
Defined in: protocol-staking-native-monad/src/protocol.ts:148
## Extends
[Section titled “Extends”](#extends)
* [`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:145
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/).[`amount`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/#amount)
***
### claims
[Section titled “claims”](#claims)
> **claims**: `object`\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:146
#### amount
[Section titled “amount”](#amount-1)
> **amount**: `bigint`
#### id
[Section titled “id”](#id)
> **id**: `bigint`
#### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
#### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/).[`claims`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/#claims)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:144
Total fee: one `withdraw` transaction per request (the precompile takes no batches).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MonadClaimQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/).[`fee`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimquote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-monad/src/protocol.ts:148
***
### hashes
[Section titled “hashes”](#hashes)
> **hashes**: `string`\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:148
# MonadEpoch
Defined in: protocol-staking-native-monad/src/protocol.ts:72
The epoch clock and when a change made now takes effect.
## Properties
[Section titled “Properties”](#properties)
### activatesAtEpoch
[Section titled “activatesAtEpoch”](#activatesatepoch)
> **activatesAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:72
***
### epoch
[Section titled “epoch”](#epoch)
> **epoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:72
***
### inEpochDelayPeriod
[Section titled “inEpochDelayPeriod”](#inepochdelayperiod)
> **inEpochDelayPeriod**: `boolean`
Defined in: protocol-staking-native-monad/src/protocol.ts:72
# MonadNetworkStats
Defined in: protocol-staking-native-monad/src/protocol.ts:92
Network figures behind the APR estimate.
## Properties
[Section titled “Properties”](#properties)
### apr
[Section titled “apr”](#apr)
> **apr**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:98
Delegator APR before commission, percent: 18 MON × blocks per year ÷ consensus stake.
***
### blocksPerYear
[Section titled “blocksPerYear”](#blocksperyear)
> **blocksPerYear**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:96
***
### blockTimeMs
[Section titled “blockTimeMs”](#blocktimems)
> **blockTimeMs**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:95
***
### consensusValidators
[Section titled “consensusValidators”](#consensusvalidators)
> **consensusValidators**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:93
***
### totalConsensusStake
[Section titled “totalConsensusStake”](#totalconsensusstake)
> **totalConsensusStake**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:94
# MonadRewardsOptions
Defined in: protocol-staking-native-monad/src/protocol.ts:150
## Properties
[Section titled “Properties”](#properties)
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:150
# MonadRewardsQuote
Defined in: protocol-staking-native-monad/src/protocol.ts:151
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadRewardsResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsresult/)
## Properties
[Section titled “Properties”](#properties)
### activatesAtEpoch
[Section titled “activatesAtEpoch”](#activatesatepoch)
> **activatesAtEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
# MonadRewardsResult
Defined in: protocol-staking-native-monad/src/protocol.ts:152
## Extends
[Section titled “Extends”](#extends)
* [`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/)
## Properties
[Section titled “Properties”](#properties)
### activatesAtEpoch
[Section titled “activatesAtEpoch”](#activatesatepoch)
> **activatesAtEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/).[`activatesAtEpoch`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/#activatesatepoch)
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/).[`amount`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/#amount)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/).[`fee`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-monad/src/protocol.ts:152
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:151
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`MonadRewardsQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/).[`validatorId`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadrewardsquote/#validatorid)
# MonadStakeOptions
Defined in: protocol-staking-native-monad/src/protocol.ts:101
How much native coin to stake, in base units.
## Extends
[Section titled “Extends”](#extends)
* [`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:689
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/#amount)
***
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:101
# MonadStakeQuote
Defined in: protocol-staking-native-monad/src/protocol.ts:102
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadStakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeresult/)
## Properties
[Section titled “Properties”](#properties)
### activatesAtEpoch
[Section titled “activatesAtEpoch”](#activatesatepoch)
> **activatesAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
***
### validator
[Section titled “validator”](#validator)
> **validator**: [`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)
Defined in: protocol-staking-native-monad/src/protocol.ts:102
# MonadStakeResult
Defined in: protocol-staking-native-monad/src/protocol.ts:103
## Extends
[Section titled “Extends”](#extends)
* [`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/)
## Properties
[Section titled “Properties”](#properties)
### activatesAtEpoch
[Section titled “activatesAtEpoch”](#activatesatepoch)
> **activatesAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/).[`activatesAtEpoch`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/#activatesatepoch)
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/).[`amount`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/#amount)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:102
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/).[`fee`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-monad/src/protocol.ts:103
***
### validator
[Section titled “validator”](#validator)
> **validator**: [`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorinfo/)
Defined in: protocol-staking-native-monad/src/protocol.ts:102
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`MonadStakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/).[`validator`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakequote/#validator)
# MonadUnstakeOptions
Defined in: protocol-staking-native-monad/src/protocol.ts:105
How much staked token to put in the withdrawal queue.
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:698
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/#amount)
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:700
Which staked-token form to withdraw (e.g. “stETH” | “wstETH”). Defaults to the primary one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/).[`token`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/#token)
***
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:106
***
### withdrawId?
[Section titled “withdrawId?”](#withdrawid)
> `optional` **withdrawId?**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:108
Withdrawal slot 0..255; the lowest free one by default.
# MonadUnstakeQuote
Defined in: protocol-staking-native-monad/src/protocol.ts:110
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadUnstakeResult`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeresult/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:112
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:111
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:116
The request’s id for `claimWithdrawals({ ids })`: `validatorId << 8 | withdrawId`.
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:113
***
### withdrawableAtEpoch
[Section titled “withdrawableAtEpoch”](#withdrawableatepoch)
> **withdrawableAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:118
First epoch the MON can be claimed in (projection).
***
### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:114
# MonadUnstakeResult
Defined in: protocol-staking-native-monad/src/protocol.ts:120
## Extends
[Section titled “Extends”](#extends)
* [`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:112
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`amount`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#amount)
***
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `null`
Defined in: protocol-staking-native-monad/src/protocol.ts:120
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:111
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`fee`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-monad/src/protocol.ts:120
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:116
The request’s id for `claimWithdrawals({ ids })`: `validatorId << 8 | withdrawId`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`id`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#id)
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:113
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`validatorId`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#validatorid)
***
### withdrawableAtEpoch
[Section titled “withdrawableAtEpoch”](#withdrawableatepoch)
> **withdrawableAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:118
First epoch the MON can be claimed in (projection).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`withdrawableAtEpoch`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#withdrawableatepoch)
***
### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:114
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`MonadUnstakeQuote`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/).[`withdrawId`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakequote/#withdrawid)
# MonadWithdrawalRequest
Defined in: protocol-staking-native-monad/src/protocol.ts:123
One pending withdrawal. `id` packs the validator and the slot.
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:715
Amount requested, base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#amount)
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:719
Finalized and ready to claim.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`claimable`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#claimable)
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:713
Request id, as the claim call takes it.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`id`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#id)
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:717
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`timestamp`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#timestamp)
***
### validatorId
[Section titled “validatorId”](#validatorid)
> **validatorId**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:124
***
### withdrawableAtEpoch
[Section titled “withdrawableAtEpoch”](#withdrawableatepoch)
> **withdrawableAtEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:127
***
### withdrawEpoch
[Section titled “withdrawEpoch”](#withdrawepoch)
> **withdrawEpoch**: `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:126
***
### withdrawId
[Section titled “withdrawId”](#withdrawid)
> **withdrawId**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:125
# MonadWithdrawalScanOptions
Defined in: protocol-staking-native-monad/src/protocol.ts:135
Where to look for pending withdrawals.
## Properties
[Section titled “Properties”](#properties)
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:137
Only this validator.
***
### validators?
[Section titled “validators?”](#validators)
> `optional` **validators?**: (`number` | `bigint`)\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:139
Also these validators (e.g. from the wallet’s history or the app’s storage): a full exit drops a validator from `getDelegations`.
# NativeStakingMonadConfig
Defined in: protocol-staking-native-monad/src/protocol.ts:34
Configuration of [NativeStakingProtocolMonad](/api/anywalletkit/protocol-staking-native-monad/classes/nativestakingprotocolmonad/). Only `validators` is required.
## Properties
[Section titled “Properties”](#properties)
### allowInactive?
[Section titled “allowInactive?”](#allowinactive)
> `optional` **allowInactive?**: `boolean`
Defined in: protocol-staking-native-monad/src/protocol.ts:42
Allow validators outside the consensus set or flagged by the precompile (default false: their stake earns nothing).
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `143` | `10143`
Defined in: protocol-staking-native-monad/src/protocol.ts:44
Pin the network (143 mainnet, 10143 testnet). Default: the account’s, which must be one of them.
***
### concurrency?
[Section titled “concurrency?”](#concurrency)
> `optional` **concurrency?**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:54
Reads in flight at once (default 6).
***
### defaultValidator?
[Section titled “defaultValidator?”](#defaultvalidator)
> `optional` **defaultValidator?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:38
Used by `stake` when the call names no validator. A single-entry list is its own default.
***
### enrich?
[Section titled “enrich?”](#enrich)
> `optional` **enrich?**: [`ValidatorEnricher`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorenricher/)
Defined in: protocol-staking-native-monad/src/protocol.ts:68
Adds data to validators (APR, names) from an explorer or the app’s backend.
***
### maxCommission?
[Section titled “maxCommission?”](#maxcommission)
> `optional` **maxCommission?**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:40
Refuse validators whose commission is above this, percent (default 10). Read fresh from the precompile at every delegation and compound.
***
### maxWithdrawId?
[Section titled “maxWithdrawId?”](#maxwithdrawid)
> `optional` **maxWithdrawId?**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:56
Highest withdrawal id used and scanned (default 255).
***
### multicallAddress?
[Section titled “multicallAddress?”](#multicalladdress)
> `optional` **multicallAddress?**: `` `0x${string}` ``
Defined in: protocol-staking-native-monad/src/protocol.ts:66
Multicall3 for the `'multicall'` scan (default the canonical 0xcA11…CA11, deployed on Monad).
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`MonadProvider`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadprovider/) | [`MonadProvider`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/monadprovider/)\[]
Defined in: protocol-staking-native-monad/src/protocol.ts:46
RPC url(s) or EIP-1193 provider(s) for reads; a list fails over in order. Defaults to the account’s provider.
***
### reserveBalance?
[Section titled “reserveBalance?”](#reservebalance)
> `optional` **reserveBalance?**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/protocol.ts:52
MON `stake` leaves on the wallet: at least Monad’s 10 MON reserve balance (below it transfers revert), more if you like.
***
### stakingAddress?
[Section titled “stakingAddress?”](#stakingaddress)
> `optional` **stakingAddress?**: `` `0x${string}` ``
Defined in: protocol-staking-native-monad/src/protocol.ts:50
The staking precompile (default 0x…1000).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-staking-native-monad/src/protocol.ts:48
Per-request timeout for URL providers, ms (default 15 000).
***
### validators
[Section titled “validators”](#validators)
> **validators**: [`ValidatorsOption`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorsoption/)
Defined in: protocol-staking-native-monad/src/protocol.ts:36
Validator ids to delegate to, or `'any'`. Required: there is no default list.
***
### withdrawScan?
[Section titled “withdrawScan?”](#withdrawscan)
> `optional` **withdrawScan?**: `"multicall"` | `"gap"` | `"full"`
Defined in: protocol-staking-native-monad/src/protocol.ts:64
How pending withdrawals are found per validator. `'multicall'` (default) reads every slot up to `maxWithdrawId` in ONE `eth_call` through Multicall3 (falling back to `'full'` when that call fails); `'full'` reads every slot one call each (256 per validator); `'gap'` reads from 0 and stops 32 empty slots past the last used one — cheaper, but it misses a pending slot above a run of claimed ones (withdrawals 0–39 with 0–35 claimed: 36–39 are not found).
# ValidatorConfig
Defined in: protocol-staking-native-monad/src/validators.ts:4
A validator the module may delegate to.
## Properties
[Section titled “Properties”](#properties)
### id
[Section titled “id”](#id)
> **id**: `number` | `bigint`
Defined in: protocol-staking-native-monad/src/validators.ts:6
The validator id on the staking precompile.
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocol-staking-native-monad/src/validators.ts:8
Display name.
# ValidatorExtra
Defined in: protocol-staking-native-monad/src/validators.ts:19
Extra data an app attaches to validators (an explorer’s APY, a name, a logo).
## Indexable
[Section titled “Indexable”](#indexable)
> \[`key`: `string`]: `unknown`
## Properties
[Section titled “Properties”](#properties)
### apr?
[Section titled “apr?”](#apr)
> `optional` **apr?**: `number`
Defined in: protocol-staking-native-monad/src/validators.ts:21
APR in percent; replaces the module’s estimate.
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocol-staking-native-monad/src/validators.ts:22
# ValidatorInfo
Defined in: protocol-staking-native-monad/src/validators.ts:33
A validator as the precompile reports it, with the module’s verdict. Amounts in wei.
## Properties
[Section titled “Properties”](#properties)
### active
[Section titled “active”](#active)
> **active**: `boolean`
Defined in: protocol-staking-native-monad/src/validators.ts:49
In the consensus set this epoch and in good standing.
***
### apr
[Section titled “apr”](#apr)
> **apr**: `number` | `null`
Defined in: protocol-staking-native-monad/src/validators.ts:55
APR in percent: `enrich`’s when given, else the network estimate after commission.
***
### aprSource
[Section titled “aprSource”](#aprsource)
> **aprSource**: `"enrich"` | `"estimate"` | `null`
Defined in: protocol-staking-native-monad/src/validators.ts:56
***
### authAddress
[Section titled “authAddress”](#authaddress)
> **authAddress**: `string`
Defined in: protocol-staking-native-monad/src/validators.ts:37
The validator’s own delegator account (zero address when the id does not exist).
***
### commission
[Section titled “commission”](#commission)
> **commission**: `number`
Defined in: protocol-staking-native-monad/src/validators.ts:47
Commission set for the coming epochs (execution view), percent.
***
### consensusCommission
[Section titled “consensusCommission”](#consensuscommission)
> **consensusCommission**: `number`
Defined in: protocol-staking-native-monad/src/validators.ts:45
Commission now in force (consensus view), percent.
***
### consensusStake
[Section titled “consensusStake”](#consensusstake)
> **consensusStake**: `bigint`
Defined in: protocol-staking-native-monad/src/validators.ts:43
Stake in the current consensus set (0 when not producing blocks this epoch).
***
### eligible
[Section titled “eligible”](#eligible)
> **eligible**: `boolean`
Defined in: protocol-staking-native-monad/src/validators.ts:52
Can take new stake: listed, exists, active (unless allowInactive), commission within maxCommission.
***
### extra?
[Section titled “extra?”](#extra)
> `optional` **extra?**: [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)
Defined in: protocol-staking-native-monad/src/validators.ts:57
***
### flags
[Section titled “flags”](#flags)
> **flags**: `bigint`
Defined in: protocol-staking-native-monad/src/validators.ts:39
Precompile status flags; 0 = in good standing.
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocol-staking-native-monad/src/validators.ts:34
***
### listed
[Section titled “listed”](#listed)
> **listed**: `boolean`
Defined in: protocol-staking-native-monad/src/validators.ts:50
***
### name
[Section titled “name”](#name)
> **name**: `string` | `null`
Defined in: protocol-staking-native-monad/src/validators.ts:35
***
### refusals
[Section titled “refusals”](#refusals)
> **refusals**: [`ValidatorRefusal`](/api/anywalletkit/protocol-staking-native-monad/type-aliases/validatorrefusal/)\[]
Defined in: protocol-staking-native-monad/src/validators.ts:53
***
### stake
[Section titled “stake”](#stake)
> **stake**: `bigint`
Defined in: protocol-staking-native-monad/src/validators.ts:41
Execution view: the stake the next snapshot will see.
# MonadChainId
> **MonadChainId** = *typeof* [`MONAD_CHAIN_IDS`](/api/anywalletkit/protocol-staking-native-monad/variables/monad_chain_ids/)\[`number`]
Defined in: protocol-staking-native-monad/src/constants.ts:10
# MonadProvider
> **MonadProvider** = `string` | [`Eip1193Provider`](/api/anywalletkit/protocol-staking-native-monad/interfaces/eip1193provider/)
Defined in: protocol-staking-native-monad/src/rpc.ts:9
RPC url or EIP-1193 provider.
# MonadWithdrawalRequestsView
> **MonadWithdrawalRequestsView** = `Omit`<`WithdrawalRequestsView`, `"requests"`> & `object`
Defined in: protocol-staking-native-monad/src/protocol.ts:129
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### requests
[Section titled “requests”](#requests)
> **requests**: [`MonadWithdrawalRequest`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadwithdrawalrequest/)\[]
# NormalizedValidators
> **NormalizedValidators** = `"any"` | `object`\[]
Defined in: protocol-staking-native-monad/src/validators.ts:61
Normalized `validators` option.
# ValidatorEnricher
> **ValidatorEnricher** = (`ids`) => `Promise`<`Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)>> | `Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)>
Defined in: protocol-staking-native-monad/src/validators.ts:27
Supplies [ValidatorExtra](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/) per validator id (keys are decimal strings).
## Parameters
[Section titled “Parameters”](#parameters)
### ids
[Section titled “ids”](#ids)
`bigint`\[]
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)>> | `Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorextra/)>
# ValidatorRefusal
> **ValidatorRefusal** = `"not-listed"` | `"not-found"` | `"inactive"` | `"commission-above-max"`
Defined in: protocol-staking-native-monad/src/validators.ts:30
Why a validator cannot take new stake right now.
# ValidatorsOption
> **ValidatorsOption** = `"any"` | `ReadonlyArray`<`bigint` | `number` | [`ValidatorConfig`](/api/anywalletkit/protocol-staking-native-monad/interfaces/validatorconfig/)>
Defined in: protocol-staking-native-monad/src/validators.ts:16
Which validators the module delegates to: a list of ids (or `{ id, name }`), or `'any'` for a wallet that lets its users pick from the whole active set. There is no default: without it the module refuses to construct.
# ACTIVE_VALIDATOR_STAKE
> `const` **ACTIVE_VALIDATOR_STAKE**: `bigint`
Defined in: protocol-staking-native-monad/src/constants.ts:25
Total stake a validator needs for the active set.
# ACTIVE_VALSET_SIZE
> `const` **ACTIVE_VALSET_SIZE**: `200` = `200`
Defined in: protocol-staking-native-monad/src/constants.ts:27
Validators in the consensus (active) set.
# BLOCK_REWARD
> `const` **BLOCK_REWARD**: `bigint`
Defined in: protocol-staking-native-monad/src/constants.ts:29
MON minted per block, split between the proposer’s commission and its delegators.
# BOUNDARY_BLOCK_PERIOD
> `const` **BOUNDARY_BLOCK_PERIOD**: `50000n` = `50_000n`
Defined in: protocol-staking-native-monad/src/constants.ts:19
Blocks between boundary blocks (\~4 h 12 min); rounds, not blocks, define epochs, so never derive the epoch from it.
# DEFAULT_CONCURRENCY
> `const` **DEFAULT_CONCURRENCY**: `6` = `6`
Defined in: protocol-staking-native-monad/src/rpc.ts:14
Reads in flight at once: public Monad RPCs cap requests per second, and batching does not help (each call counts).
# DEFAULT_MAX_COMMISSION
> `const` **DEFAULT_MAX_COMMISSION**: `10` = `10`
Defined in: protocol-staking-native-monad/src/protocol.ts:19
Default cap on validator commission, percent.
# DEFAULT_TIMEOUT_MS
> `const` **DEFAULT_TIMEOUT_MS**: `15000` = `15_000`
Defined in: protocol-staking-native-monad/src/rpc.ts:12
Default per-request timeout for URL providers.
# DUST_THRESHOLD
> `const` **DUST_THRESHOLD**: `bigint`
Defined in: protocol-staking-native-monad/src/constants.ts:15
Smallest single delegation: 1 gwei.
# EPOCH_DELAY_ROUNDS
> `const` **EPOCH_DELAY_ROUNDS**: `5000n` = `5_000n`
Defined in: protocol-staking-native-monad/src/constants.ts:21
Rounds between the boundary block and the start of the next epoch.
# MAX_COMMISSION
> `const` **MAX_COMMISSION**: `bigint` = `MON`
Defined in: protocol-staking-native-monad/src/constants.ts:31
100 % commission, in the precompile’s 1e18 scale.
# MAX_WITHDRAW_ID
> `const` **MAX_WITHDRAW_ID**: `255` = `255`
Defined in: protocol-staking-native-monad/src/constants.ts:35
Withdrawal ids per (validator, delegator): 0..255.
# MIN_AUTH_ADDRESS_STAKE
> `const` **MIN_AUTH_ADDRESS_STAKE**: `bigint`
Defined in: protocol-staking-native-monad/src/constants.ts:23
Self-stake a validator’s auth address needs to stay eligible.
# MODULE_NAME
> `const` **MODULE_NAME**: `"@anywalletkit/protocol-staking-native-monad"` = `'@anywalletkit/protocol-staking-native-monad'`
Defined in: protocol-staking-native-monad/src/activity.ts:17
Registry name, as `module.json` carries it.
# MONAD_CHAIN_IDS
> `const` **MONAD_CHAIN_IDS**: readonly \[`143`, `10143`]
Defined in: protocol-staking-native-monad/src/constants.ts:9
# MONAD_MAINNET
> `const` **MONAD_MAINNET**: `143` = `143`
Defined in: protocol-staking-native-monad/src/constants.ts:7
Monad mainnet and testnet chain ids.
# MONAD_TESTNET
> `const` **MONAD_TESTNET**: `10143` = `10143`
Defined in: protocol-staking-native-monad/src/constants.ts:8
# PAGINATED_RESULTS_SIZE
> `const` **PAGINATED_RESULTS_SIZE**: `100` = `100`
Defined in: protocol-staking-native-monad/src/constants.ts:33
Largest page the paginated reads return.
# REVERTS
> `const` **REVERTS**: `ReadonlyArray`\
Defined in: protocol-staking-native-monad/src/abi.ts:43
Revert strings the precompile returns, with what to tell the user.
# SELECTORS
> `const` **SELECTORS**: `object`
Defined in: protocol-staking-native-monad/src/abi.ts:27
4-byte selectors of the delegator writes (as published by Monad, checked by the tests).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### claimRewards
[Section titled “claimRewards”](#claimrewards)
> `readonly` **claimRewards**: `"0xa76e2ca5"` = `'0xa76e2ca5'`
### compound
[Section titled “compound”](#compound)
> `readonly` **compound**: `"0xb34fea67"` = `'0xb34fea67'`
### delegate
[Section titled “delegate”](#delegate)
> `readonly` **delegate**: `"0x84994fec"` = `'0x84994fec'`
### undelegate
[Section titled “undelegate”](#undelegate)
> `readonly` **undelegate**: `"0x5cf41514"` = `'0x5cf41514'`
### withdraw
[Section titled “withdraw”](#withdraw)
> `readonly` **withdraw**: `"0xaed2ee73"` = `'0xaed2ee73'`
# STAKING_ABI
> `const` **STAKING_ABI**: readonly \[{ }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, { }]
Defined in: protocol-staking-native-monad/src/abi.ts:6
# STAKING_PRECOMPILE
> `const` **STAKING_PRECOMPILE**: `"0x0000000000000000000000000000000000001000"`
Defined in: protocol-staking-native-monad/src/constants.ts:4
The staking precompile. Only CALL works on it (no STATICCALL, DELEGATECALL, CALLCODE); `eth_call` is fine.
# TOPICS
> `const` **TOPICS**: `object`
Defined in: protocol-staking-native-monad/src/abi.ts:36
Event topics (keccak of the signature).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### Delegate
[Section titled “Delegate”](#delegate)
> `readonly` **Delegate**: `"0xe4d4df1e1827dd28252fd5c3cd7ebccd3da6e0aa31f74c828f3c8542af49d840"` = `'0xe4d4df1e1827dd28252fd5c3cd7ebccd3da6e0aa31f74c828f3c8542af49d840'`
### Undelegate
[Section titled “Undelegate”](#undelegate)
> `readonly` **Undelegate**: `"0x3e53c8b91747e1b72a44894db10f2a45fa632b161fdcdd3a17bd6be5482bac62"` = `'0x3e53c8b91747e1b72a44894db10f2a45fa632b161fdcdd3a17bd6be5482bac62'`
### Withdraw
[Section titled “Withdraw”](#withdraw)
> `readonly` **Withdraw**: `"0x63030e4238e1146c63f38f4ac81b2b23c8be28882e68b03f0887e50d0e9bb18f"` = `'0x63030e4238e1146c63f38f4ac81b2b23c8be28882e68b03f0887e50d0e9bb18f'`
# USER_RESERVE_BALANCE
> `const` **USER_RESERVE_BALANCE**: `bigint`
Defined in: protocol-staking-native-monad/src/constants.ts:40
Monad’s reserve balance: a transaction whose value spend leaves the sender below 10 MON reverts (outside the narrow “emptying transaction” exception, which simulation cannot see). Stakes keep it.
# WITHDRAW_SCAN_GAP
> `const` **WITHDRAW_SCAN_GAP**: `32` = `32`
Defined in: protocol-staking-native-monad/src/protocol.ts:27
Gap scan: stop after this many empty withdrawal slots past the last used one.
# WITHDRAWAL_DELAY
> `const` **WITHDRAWAL_DELAY**: `1n` = `1n`
Defined in: protocol-staking-native-monad/src/constants.ts:17
Epochs between a stake deactivating and the withdrawal opening.
# @anywalletkit/protocol-staking-native-solana
# @anywalletkit/protocol-staking-native-solana
[Section titled “@anywalletkit/protocol-staking-native-solana”](#anywalletkitprotocol-staking-native-solana)
Native SOL staking for `@anywalletkit/wallet-solana` accounts: SOL delegated straight to the validators **your app lists**, through Solana’s Stake program. No pool, no token, no third-party program. Each position is a stake account owned by the wallet.
```sh
npm install @anywalletkit/protocol-staking-native-solana @anywalletkit/wallet-solana
```
## Usage
[Section titled “Usage”](#usage)
```ts
import { Wallet } from '@anywalletkit/kit'
import { WalletManagerSolana } from '@anywalletkit/wallet-solana'
import { NativeStakingProtocolSolana } from '@anywalletkit/protocol-staking-native-solana'
const wallet = new Wallet(seedPhrase)
wallet.registerWallet('solana', WalletManagerSolana, { provider: SOLANA_RPC })
wallet.registerProtocol('sol-staking', NativeStakingProtocolSolana, {
chain: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
config: {
validators: [{ voteAccount: VOTE_A, name: 'Our validator' }, VOTE_B], // required
maxCommission: 10,
},
})
const staking = await wallet.getProtocol('sol-staking')
const validators = await staking.listValidators() // commission, delinquent, apr, eligible, refusals
await staking.quoteStake({ amount: 2_000_000_000n }) // fee, stake account, rent, readyEpoch; nothing signed
await staking.stake({ amount: 2_000_000_000n, validator: VOTE_A })
await staking.getStakeAccounts() // per account: status, amounts, validator, readyAt
await staking.getStakedBalance() // { balance, total, active, activating, deactivating, claimable }
await staking.requestWithdrawal({ amount: 1_000_000_000n }) // deactivate (split first when partial)
const q = await staking.getWithdrawalRequests()
if (q.claimableIds.length) await staking.claimWithdrawals({ ids: q.claimableIds })
```
Amounts are lamports (bigint). Without `provider` in the config, reads go to the account’s own RPC.
## Config
[Section titled “Config”](#config)
| Option | Default | |
| --------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `validators` | — (required) | Vote accounts (strings or `{ voteAccount, name }`), or `'any'` to let users pick from the whole cluster. No list, no module. |
| `defaultValidator` | first eligible of the list | Used when `stake` / `delegate` name none. Must be in the list. No default in `'any'` mode. |
| `maxCommission` | `10` | Percent. A validator above it is refused at delegation time (commission can change after you list it). |
| `allowDelinquent` | `false` | Delinquent validators earn their stake nothing. |
| `provider` | the account’s RPC | URL, list of URLs (failover), `@solana/rpc` client or `{ request(method, params) }`. |
| `discover` | `false` | Also list stake accounts other wallets created for the address (`getProgramAccounts`; the RPC must serve it). Only those the wallet is the withdraw authority of (`owned`) count in the position and can be unstaked, delegated or merged. |
| `seedPrefix` / `maxAccounts` | `stake:` / `32` | Stake accounts live at `create_with_seed(wallet, "", Stake)`, `i < maxAccounts`. |
| `feeReserve` | 0.005 SOL | Kept on the wallet by `stake`, so the user can still pay to unstake and claim. |
| `computeUnitLimit` / `computeUnitPrice` | wallet decides | Explicit compute budget; otherwise the wallet sets it from simulation and recent fees. |
| `enrich` | — | `(voteAccounts) => ({ [vote]: { apr, name, … } })`: an explorer’s APR (with MEV), names, scores. Decoration only. |
| `commitment` / `timeoutMs` / `fetch` | `confirmed` / 15 s / global | Reads. |
## How it works
[Section titled “How it works”](#how-it-works)
* **Stake** is one transaction: System `CreateAccountWithSeed` (amount + rent, base = the wallet), Stake `Initialize` (staker = withdrawer = the wallet, no lockup), `DelegateStake`. Only the wallet signs. It becomes active at the next epoch boundary (\~2 days). The minimum is the Stake program’s minimum delegation (1 SOL) plus about 0.0017 SOL of rent, which returns on withdrawal.
* **Statuses** come from the StakeHistory sysvar with the program’s own integer warm-up / cool-down math (9 % of the cluster per epoch), so `inactive` means the program will let every lamport out. Each account reports `effective`, `activating`, `deactivating`, `withdrawable`, and while it changes, `readyEpoch` / `readyAt`.
* **Unstake** deactivates whole accounts and splits at most one: an exact match first, else the plan with the fewest steps where the split part and what stays behind both keep the minimum delegation. The split part goes to a new seed account (prefunded with rent) and is deactivated. A stake deactivated in the epoch it was made is free at once.
* **Claim** withdraws fully inactive accounts to the wallet (the accounts close), up to 10 per transaction: with more ids or more ready accounts, `remaining` says how many are left for the next call.
* **Delegate** re-delegates an inactive account, or, in the epoch an account was deactivated, puts it back on its validator (undoes the unstake; the validator must still pass the policy). An account still activating moves only to a validator named in the call. **Merge** joins two inactive accounts, two fully active ones on the same validator, or two activated this epoch on the same validator.
* **APR**: `getApr()` / `ValidatorInfo.apr` is validator inflation × supply ÷ staked SOL × (1 − commission). It leaves out MEV and block-reward sharing; pass `enrich` for a fuller figure. `getRewards({ epochs })` lists the inflation rewards the wallet’s accounts actually received.
## Safety
[Section titled “Safety”](#safety)
* Fail-closed before anything is signed: unlisted, unknown, delinquent or over-commission validators; amounts under the minimum; a wallet that would drop under `feeReserve`; accounts the wallet is not the authority of; a lockup in force; merges the program would reject.
* Accounts the module creates have the wallet as staker and withdrawer and no lockup. It never sets a custodian, never changes an authority, and never acts on an account whose SOL another address withdraws (a `discover`ed account the wallet only manages).
* Seed slots: someone can send dust to a `stake:` address before the wallet uses it. Empty slots are used first. When only pre-funded ones are left, one is taken over with Transfer + AllocateWithSeed + Initialize; `wallet-solana` signs that by default because the same transaction makes the wallet the account’s staker and withdrawer (a wallet that refuses it gets an error that says so; `maxAccounts`, up to 100, opens new slots). Every write the module builds is tested against `wallet-solana`’s signing checks with the default config.
* StakeHistory from an RPC node that has not reached the current epoch is refused, so statuses are never computed from a stale sysvar.
* With a Solana `allowlist` policy, the kit checks each Stake instruction by whom it pays or empowers: allow the wallet’s own address, the stake accounts (`getStakeAccountAddress(i)`) and the vote accounts of the validators you list. Allowlisting the Stake program itself opens nothing.
## Testing
[Section titled “Testing”](#testing)
* `pnpm test`: codecs byte for byte against mainnet transactions, the activation math against hand-computed program cases, every operation over an in-memory node, conformance with recorded mainnet activity.
* `pnpm verify:live [address] [rpcUrl]`: reads on mainnet, then every write planned for a real wallet and simulated by the wallet (`simulateTransaction`, signatures off). Nothing is signed.
## Classes
[Section titled “Classes”](#classes)
* [NativeStakingProtocolSolana](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/)
* [RpcClient](/api/anywalletkit/protocol-staking-native-solana/classes/rpcclient/)
* [RpcError](/api/anywalletkit/protocol-staking-native-solana/classes/rpcerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AccountMeta](/api/anywalletkit/protocol-staking-native-solana/interfaces/accountmeta/)
* [ActivationStatus](/api/anywalletkit/protocol-staking-native-solana/interfaces/activationstatus/)
* [ClusterStake](/api/anywalletkit/protocol-staking-native-solana/interfaces/clusterstake/)
* [DelegateOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateoptions/)
* [DelegateQuote](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/)
* [DelegateResult](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateresult/)
* [Delegation](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegation/)
* [EpochClock](/api/anywalletkit/protocol-staking-native-solana/interfaces/epochclock/)
* [Instruction](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
* [MergeOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeoptions/)
* [MergeQuote](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/)
* [MergeResult](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeresult/)
* [NativeClaimOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimoptions/)
* [NativeClaimQuote](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/)
* [NativeClaimResult](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimresult/)
* [NativeRewards](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativerewards/)
* [NativeStakeOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeoptions/)
* [NativeStakeQuote](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/)
* [NativeStakeResult](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeresult/)
* [NativeStakingConfig](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakingconfig/)
* [NativeUnstakeOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeoptions/)
* [NativeUnstakeQuote](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/)
* [NativeUnstakeResult](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeresult/)
* [NativeWithdrawalRequest](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativewithdrawalrequest/)
* [RpcClientOptions](/api/anywalletkit/protocol-staking-native-solana/interfaces/rpcclientoptions/)
* [StakeAccountData](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountdata/)
* [StakeAccountInfo](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountinfo/)
* [UnstakeStep](/api/anywalletkit/protocol-staking-native-solana/interfaces/unstakestep/)
* [ValidatorConfig](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorconfig/)
* [ValidatorExtra](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)
* [ValidatorInfo](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [NativeWithdrawalRequestsView](/api/anywalletkit/protocol-staking-native-solana/type-aliases/nativewithdrawalrequestsview/)
* [Role](/api/anywalletkit/protocol-staking-native-solana/type-aliases/role/)
* [SolanaRpcSource](/api/anywalletkit/protocol-staking-native-solana/type-aliases/solanarpcsource/)
* [StakeAccountKind](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakeaccountkind/)
* [StakeHistory](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakehistory/)
* [StakeStatus](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakestatus/)
* [ValidatorEnricher](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorenricher/)
* [ValidatorRefusal](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorrefusal/)
* [ValidatorsOption](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorsoption/)
## Variables
[Section titled “Variables”](#variables)
* [COMPUTE_BUDGET_PROGRAM](/api/anywalletkit/protocol-staking-native-solana/variables/compute_budget_program/)
* [DEFAULT_FEE_RESERVE](/api/anywalletkit/protocol-staking-native-solana/variables/default_fee_reserve/)
* [DEFAULT_MAX_ACCOUNTS](/api/anywalletkit/protocol-staking-native-solana/variables/default_max_accounts/)
* [DEFAULT_MAX_COMMISSION](/api/anywalletkit/protocol-staking-native-solana/variables/default_max_commission/)
* [DEFAULT_SEED_PREFIX](/api/anywalletkit/protocol-staking-native-solana/variables/default_seed_prefix/)
* [DEFAULT_TIMEOUT_MS](/api/anywalletkit/protocol-staking-native-solana/variables/default_timeout_ms/)
* [LAMPORTS_PER_SOL](/api/anywalletkit/protocol-staking-native-solana/variables/lamports_per_sol/)
* [MAX_CLAIMS_PER_TX](/api/anywalletkit/protocol-staking-native-solana/variables/max_claims_per_tx/)
* [MAX_DEACTIVATIONS_PER_TX](/api/anywalletkit/protocol-staking-native-solana/variables/max_deactivations_per_tx/)
* [MAX_SEED_LENGTH](/api/anywalletkit/protocol-staking-native-solana/variables/max_seed_length/)
* [MODULE_NAME](/api/anywalletkit/protocol-staking-native-solana/variables/module_name/)
* [RATE_CHANGE_EPOCH](/api/anywalletkit/protocol-staking-native-solana/variables/rate_change_epoch/)
* [READONLY](/api/anywalletkit/protocol-staking-native-solana/variables/readonly/)
* [READONLY_SIGNER](/api/anywalletkit/protocol-staking-native-solana/variables/readonly_signer/)
* [SLOT_MS](/api/anywalletkit/protocol-staking-native-solana/variables/slot_ms/)
* [SOLANA_MAINNET](/api/anywalletkit/protocol-staking-native-solana/variables/solana_mainnet/)
* [STAKE_ACCOUNT_SPACE](/api/anywalletkit/protocol-staking-native-solana/variables/stake_account_space/)
* [STAKE_CONFIG](/api/anywalletkit/protocol-staking-native-solana/variables/stake_config/)
* [STAKE_IX](/api/anywalletkit/protocol-staking-native-solana/variables/stake_ix/)
* [STAKE_PROGRAM](/api/anywalletkit/protocol-staking-native-solana/variables/stake_program/)
* [SYSTEM_PROGRAM](/api/anywalletkit/protocol-staking-native-solana/variables/system_program/)
* [SYSVAR_CLOCK](/api/anywalletkit/protocol-staking-native-solana/variables/sysvar_clock/)
* [SYSVAR_RENT](/api/anywalletkit/protocol-staking-native-solana/variables/sysvar_rent/)
* [SYSVAR_STAKE_HISTORY](/api/anywalletkit/protocol-staking-native-solana/variables/sysvar_stake_history/)
* [U64_MAX](/api/anywalletkit/protocol-staking-native-solana/variables/u64_max/)
* [VOTE_PROGRAM](/api/anywalletkit/protocol-staking-native-solana/variables/vote_program/)
* [WRITABLE](/api/anywalletkit/protocol-staking-native-solana/variables/writable/)
* [WRITABLE_SIGNER](/api/anywalletkit/protocol-staking-native-solana/variables/writable_signer/)
## Functions
[Section titled “Functions”](#functions)
* [accountId](/api/anywalletkit/protocol-staking-native-solana/functions/accountid/)
* [activationStatus](/api/anywalletkit/protocol-staking-native-solana/functions/activationstatus/)
* [base58Decode](/api/anywalletkit/protocol-staking-native-solana/functions/base58decode/)
* [base58Encode](/api/anywalletkit/protocol-staking-native-solana/functions/base58encode/)
* [createWithSeed](/api/anywalletkit/protocol-staking-native-solana/functions/createwithseed/)
* [decodeStakeAccount](/api/anywalletkit/protocol-staking-native-solana/functions/decodestakeaccount/)
* [decodeStakeHistory](/api/anywalletkit/protocol-staking-native-solana/functions/decodestakehistory/)
* [describeNativeStakeActivity](/api/anywalletkit/protocol-staking-native-solana/functions/describenativestakeactivity/)
* [isAddress](/api/anywalletkit/protocol-staking-native-solana/functions/isaddress/)
* [ixCreateAccountWithSeed](/api/anywalletkit/protocol-staking-native-solana/functions/ixcreateaccountwithseed/)
* [ixDeactivate](/api/anywalletkit/protocol-staking-native-solana/functions/ixdeactivate/)
* [ixDelegate](/api/anywalletkit/protocol-staking-native-solana/functions/ixdelegate/)
* [ixInitialize](/api/anywalletkit/protocol-staking-native-solana/functions/ixinitialize/)
* [ixMerge](/api/anywalletkit/protocol-staking-native-solana/functions/ixmerge/)
* [ixSetComputeUnitLimit](/api/anywalletkit/protocol-staking-native-solana/functions/ixsetcomputeunitlimit/)
* [ixSetComputeUnitPrice](/api/anywalletkit/protocol-staking-native-solana/functions/ixsetcomputeunitprice/)
* [ixSplit](/api/anywalletkit/protocol-staking-native-solana/functions/ixsplit/)
* [ixWithdraw](/api/anywalletkit/protocol-staking-native-solana/functions/ixwithdraw/)
* [lockupInForce](/api/anywalletkit/protocol-staking-native-solana/functions/lockupinforce/)
* [settlesAt](/api/anywalletkit/protocol-staking-native-solana/functions/settlesat/)
* [stakeInstructionTag](/api/anywalletkit/protocol-staking-native-solana/functions/stakeinstructiontag/)
* [statusOf](/api/anywalletkit/protocol-staking-native-solana/functions/statusof/)
* [warmupCooldownRateBps](/api/anywalletkit/protocol-staking-native-solana/functions/warmupcooldownratebps/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [NativeStakingProtocolSolana](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/)
# NativeStakingProtocolSolana
Defined in: protocol-staking-native-solana/src/protocol.ts:287
Native staking on Solana: SOL delegated straight to validators the app chooses, through the Stake program. No pool, no token, no third-party program: each position is a stake account owned by the wallet (staker and withdrawer are always the wallet’s address).
* `stake` creates a stake account at a seed-derived address (`create_with_seed(wallet, "stake:")`, so only the wallet signs and the position can be rebuilt from the wallet alone), initializes it and delegates it, in one transaction. It becomes active at the next epoch boundary (\~2 days).
* `requestWithdrawal` deactivates whole accounts and, for a partial amount, splits it into a new account first. The SOL can be withdrawn once the cool-down ends (next epoch boundary).
* `claimWithdrawals` withdraws every lamport of fully inactive accounts back to the wallet.
* `delegate` re-delegates an inactive account, or undoes a deactivation made in the same epoch; `merge` joins two compatible accounts.
Fail-closed before anything is signed: the validator must be in the configured list (or the app chose `'any'`), voting, and within `maxCommission`; amounts respect the minimum delegation and the rent; the wallet keeps `feeReserve` for later fees. Statuses (activating / active / deactivating / inactive) are computed from the StakeHistory sysvar exactly as the program does.
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/)<[`NativeStakingConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakingconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NativeStakingProtocolSolana**(`account`, `config`): `NativeStakingProtocolSolana`
Defined in: protocol-staking-native-solana/src/protocol.ts:301
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config
[Section titled “config”](#config)
[`NativeStakingConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakingconfig/)
#### Returns
[Section titled “Returns”](#returns)
`NativeStakingProtocolSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`NativeStakingConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakingconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`_config`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#_config)
***
### defaultValidator
[Section titled “defaultValidator”](#defaultvalidator)
> `readonly` **defaultValidator**: `string` | `undefined`
Defined in: protocol-staking-native-solana/src/protocol.ts:290
***
### feeReserve
[Section titled “feeReserve”](#feereserve)
> `readonly` **feeReserve**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:294
***
### maxAccounts
[Section titled “maxAccounts”](#maxaccounts)
> `readonly` **maxAccounts**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:293
***
### maxCommission
[Section titled “maxCommission”](#maxcommission)
> `readonly` **maxCommission**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:291
***
### seedPrefix
[Section titled “seedPrefix”](#seedprefix)
> `readonly` **seedPrefix**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:292
***
### validators
[Section titled “validators”](#validators)
> `readonly` **validators**: `"any"` | readonly [`ValidatorConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorconfig/)\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:289
The configured validators, or `'any'`.
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`NativeClaimResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimresult/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:884
Withdraws every lamport of fully inactive stake accounts to the wallet (the accounts close).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`NativeClaimOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`NativeClaimResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#claimwithdrawals)
***
### delegate()
[Section titled “delegate()”](#delegate)
> **delegate**(`options`): `Promise`<[`DelegateResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateresult/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:926
Delegates an inactive stake account (to `validator`, or the default), or — for an account deactivated in the current epoch — puts it back on its validator, undoing the unstake.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-1)
[`DelegateOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`DelegateResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateresult/)>
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:978
Labels Stake-program transactions (stake, unstake, claim, delegate, merge) offline; see `activity.ts`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`describeActivity`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#describeactivity)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(`options?`): `Promise`<`number`>
Defined in: protocol-staking-native-solana/src/protocol.ts:655
APR in percent for a validator (`validator`, else the default or the first eligible one): the `enrich` figure when it gives one, else validator inflation × supply ÷ staked SOL × (1 − commission). With `'any'` and no validator: the cluster-wide figure before commission.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options?
[Section titled “options?”](#options-2)
###### validator?
[Section titled “validator?”](#validator)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getapr)
***
### getEpochInfo()
[Section titled “getEpochInfo()”](#getepochinfo)
> **getEpochInfo**(): `Promise`<[`EpochClock`](/api/anywalletkit/protocol-staking-native-solana/interfaces/epochclock/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:345
The epoch clock, with a projected end of the current epoch.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`EpochClock`](/api/anywalletkit/protocol-staking-native-solana/interfaces/epochclock/)>
***
### getMaxStakeable()
[Section titled “getMaxStakeable()”](#getmaxstakeable)
> **getMaxStakeable**(): `Promise`<`bigint`>
Defined in: protocol-staking-native-solana/src/protocol.ts:533
The most `stake` can take now: balance − account rent − fee reserve (0 when below the minimum delegation).
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`bigint`>
***
### getRewards()
[Section titled “getRewards()”](#getrewards)
> **getRewards**(`options?`): `Promise`<[`NativeRewards`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativerewards/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:667
Inflation rewards the wallet’s delegated stake accounts earned in the last `epochs` completed epochs (default 5). An epoch the node no longer serves is reported with its error, not dropped.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options?
[Section titled “options?”](#options-3)
###### epochs?
[Section titled “epochs?”](#epochs)
`number`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`NativeRewards`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativerewards/)>
***
### getStakeAccountAddress()
[Section titled “getStakeAccountAddress()”](#getstakeaccountaddress)
> **getStakeAccountAddress**(`index`): `Promise`<`string`>
Defined in: protocol-staking-native-solana/src/protocol.ts:392
Address of the wallet’s stake account in seed slot `index`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### index
[Section titled “index”](#index)
`number`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`string`>
***
### getStakeAccounts()
[Section titled “getStakeAccounts()”](#getstakeaccounts)
> **getStakeAccounts**(): `Promise`<[`StakeAccountInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountinfo/)\[]>
Defined in: protocol-staking-native-solana/src/protocol.ts:506
The wallet’s stake accounts: its seed slots, plus (with `discover`) accounts other wallets made for it. Each with its status, amounts, when it settles and what the wallet may do with it.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeAccountInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountinfo/)\[]>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/) & `object`>
Defined in: protocol-staking-native-solana/src/protocol.ts:517
The position: `balance` is the stake delegated and not being withdrawn (principal plus compounded rewards), `total` every lamport in the wallet’s stake accounts. There is no wrapped form (`rate` 0). Only accounts the wallet can withdraw count; `managedOnly` sums those it is just the stake authority of.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/) & `object`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getstakedbalance)
***
### getStakeParams()
[Section titled “getStakeParams()”](#getstakeparams)
> **getStakeParams**(): `Promise`<{ `minimumDelegation`: `bigint`; `rentExempt`: `bigint`; }>
Defined in: protocol-staking-native-solana/src/protocol.ts:353
Rent of a stake account and the minimum delegation, lamports (cached for 10 minutes).
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `minimumDelegation`: `bigint`; `rentExempt`: `bigint`; }>
***
### getValidator()
[Section titled “getValidator()”](#getvalidator)
> **getValidator**(`voteAccount`): `Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:610
One validator, live: commission, stake, delinquency, APR, and whether the module may delegate to it.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### voteAccount
[Section titled “voteAccount”](#voteaccount)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`NativeWithdrawalRequestsView`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/nativewithdrawalrequestsview/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:831
Stake accounts that are cooling down or ready to claim. `id` is [accountId](/api/anywalletkit/protocol-staking-native-solana/functions/accountid/); `amount` the account’s lamports (all of it returns on claim, rent included); `timestamp` is 0 (the chain does not record when a deactivation was sent).
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`NativeWithdrawalRequestsView`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/nativewithdrawalrequestsview/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#getwithdrawalrequests)
***
### listValidators()
[Section titled “listValidators()”](#listvalidators)
> **listValidators**(`options?`): `Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)\[]>
Defined in: protocol-staking-native-solana/src/protocol.ts:620
The validators to offer: the configured list in its order, or in `'any'` mode the cluster’s voting validators by stake (`limit` to cut it). Each says whether it can take stake now and why not.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### options?
[Section titled “options?”](#options-4)
###### limit?
[Section titled “limit?”](#limit)
`number`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)\[]>
***
### merge()
[Section titled “merge()”](#merge)
> **merge**(`options`): `Promise`<[`MergeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeresult/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:971
Merges `source` into `destination` (the source closes). Frees a seed slot and keeps the position tidy.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options
[Section titled “options”](#options-5)
[`MergeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeoptions/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`MergeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeresult/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:878
Network fee and amount of a claim; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### options?
[Section titled “options?”](#options-6)
[`NativeClaimOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/)>
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteDelegate()
[Section titled “quoteDelegate()”](#quotedelegate)
> **quoteDelegate**(`options`): `Promise`<[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:917
Network fee of [delegate](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/#delegate); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### options
[Section titled “options”](#options-7)
[`DelegateOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateoptions/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/)>
***
### quoteMerge()
[Section titled “quoteMerge()”](#quotemerge)
> **quoteMerge**(`options`): `Promise`<[`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:965
Network fee of [merge](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/#merge); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-8)
[`MergeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/)>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:811
Network fee and plan of an unstake; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### options
[Section titled “options”](#options-9)
[`NativeUnstakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/)>
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:743
Network fee and details of a stake; nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-10)
[`NativeStakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/)>
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`NativeUnstakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeresult/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:820
Unstakes `amount` lamports of delegated stake: deactivates whole accounts (an exact match first, then the largest that fit) and splits the remainder off one account. Claim after the cool-down.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-11)
[`NativeUnstakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeoptions/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`NativeUnstakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-9)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requestwithdrawal)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`requireSigningAccount`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#requiresigningaccount)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`NativeStakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeresult/)>
Defined in: protocol-staking-native-solana/src/protocol.ts:749
Stakes `amount` lamports with a validator: a new stake account, initialized and delegated in one transaction.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### options
[Section titled “options”](#options-12)
[`NativeStakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<[`NativeStakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-10)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-lido-evm/classes/stakingprotocol/#stake)
# RpcClient
Defined in: protocol-staking-native-solana/src/rpc.ts:56
Tries each source in order. Transport failures, timeouts and rate limits move on; a node-side rejection is final.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RpcClient**(`sources`, `options?`): `RpcClient`
Defined in: protocol-staking-native-solana/src/rpc.ts:61
#### Parameters
[Section titled “Parameters”](#parameters)
##### sources
[Section titled “sources”](#sources)
[`SolanaRpcSource`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/solanarpcsource/)\[]
##### options?
[Section titled “options?”](#options)
[`RpcClientOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/rpcclientoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`RpcClient`
## Accessors
[Section titled “Accessors”](#accessors)
### configured
[Section titled “configured”](#configured)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **configured**(): `boolean`
Defined in: protocol-staking-native-solana/src/rpc.ts:67
##### Returns
[Section titled “Returns”](#returns-1)
`boolean`
## Methods
[Section titled “Methods”](#methods)
### call()
[Section titled “call()”](#call)
> **call**<`T`>(`method`, `params?`): `Promise`<`T`>
Defined in: protocol-staking-native-solana/src/rpc.ts:71
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T` = `unknown`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### method
[Section titled “method”](#method)
`string`
##### params?
[Section titled “params?”](#params)
`unknown`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`T`>
# RpcError
Defined in: protocol-staking-native-solana/src/rpc.ts:14
A node-side rejection (bad params, unsupported method): trying another provider will not help.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RpcError**(`method`, `message`, `code?`): `RpcError`
Defined in: protocol-staking-native-solana/src/rpc.ts:16
#### Parameters
[Section titled “Parameters”](#parameters)
##### method
[Section titled “method”](#method)
`string`
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
`number`
#### Returns
[Section titled “Returns”](#returns)
`RpcError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `number` | `undefined`
Defined in: protocol-staking-native-solana/src/rpc.ts:15
# accountId
> **accountId**(`address`): `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:262
Stable u64 id of an account: its first 8 address bytes, big-endian.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# activationStatus
> **activationStatus**(`d`, `target`, `history`, `rateChangeEpoch`): [`ActivationStatus`](/api/anywalletkit/protocol-staking-native-solana/interfaces/activationstatus/)
Defined in: protocol-staking-native-solana/src/activation.ts:64
Effective, activating and deactivating stake of a delegation at `target` epoch.
## Parameters
[Section titled “Parameters”](#parameters)
### d
[Section titled “d”](#d)
[`Delegation`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegation/)
### target
[Section titled “target”](#target)
`bigint`
### history
[Section titled “history”](#history)
[`StakeHistory`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakehistory/)
### rateChangeEpoch
[Section titled “rateChangeEpoch”](#ratechangeepoch)
`bigint` | `null`
## Returns
[Section titled “Returns”](#returns)
[`ActivationStatus`](/api/anywalletkit/protocol-staking-native-solana/interfaces/activationstatus/)
# base58Decode
> **base58Decode**(`s`): `Uint8Array`
Defined in: protocol-staking-native-solana/src/address.ts:10
Base58 (Bitcoin alphabet) decode. Throws on a character outside the alphabet.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# base58Encode
> **base58Encode**(`bytes`): `string`
Defined in: protocol-staking-native-solana/src/address.ts:33
Base58 (Bitcoin alphabet) encode.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# createWithSeed
> **createWithSeed**(`base`, `seed`, `owner`): `string`
Defined in: protocol-staking-native-solana/src/address.ts:76
`Pubkey::create_with_seed`: `sha256(base ‖ seed ‖ owner)`. The address of an account created by System `CreateAccountWithSeed`, which only the base key has to sign.
## Parameters
[Section titled “Parameters”](#parameters)
### base
[Section titled “base”](#base)
`string`
### seed
[Section titled “seed”](#seed)
`string`
### owner
[Section titled “owner”](#owner)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# decodeStakeAccount
> **decodeStakeAccount**(`data`): [`StakeAccountData`](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountdata/)
Defined in: protocol-staking-native-solana/src/codec.ts:170
Decodes a stake account (bincode `StakeStateV2`: u32 tag, `Meta`, then `Stake` and flags for tag 2).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`StakeAccountData`](/api/anywalletkit/protocol-staking-native-solana/interfaces/stakeaccountdata/)
# decodeStakeHistory
> **decodeStakeHistory**(`data`): `Map`<`bigint`, [`ClusterStake`](/api/anywalletkit/protocol-staking-native-solana/interfaces/clusterstake/)>
Defined in: protocol-staking-native-solana/src/codec.ts:200
Decodes the StakeHistory sysvar: `Vec<(Epoch, StakeHistoryEntry)>`, newest first.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Map`<`bigint`, [`ClusterStake`](/api/anywalletkit/protocol-staking-native-solana/interfaces/clusterstake/)>
# describeNativeStakeActivity
> **describeNativeStakeActivity**(`tx`, `ctx`, `validators?`): `ActivityItem` | `null`
Defined in: protocol-staking-native-solana/src/activity.ts:93
Describes a native-staking transaction for the wallet’s feed, or returns null when it is not one.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### validators?
[Section titled “validators?”](#validators)
readonly [`ValidatorConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorconfig/)\[] = `[]`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# isAddress
> **isAddress**(`value`): `value is string`
Defined in: protocol-staking-native-solana/src/address.ts:57
A 32-byte Solana address in base58.
## Parameters
[Section titled “Parameters”](#parameters)
### value
[Section titled “value”](#value)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`value is string`
# ixCreateAccountWithSeed
> **ixCreateAccountWithSeed**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:62
System `CreateAccountWithSeed` (3). `base` signs; when it is the payer it is listed once.
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### base
[Section titled “base”](#base)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### newAccount
[Section titled “newAccount”](#newaccount)
`string`
#### owner
[Section titled “owner”](#owner)
`string`
#### payer
[Section titled “payer”](#payer)
`string`
#### seed
[Section titled “seed”](#seed)
`string`
#### space
[Section titled “space”](#space)
`number`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixDeactivate
> **ixDeactivate**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:122
Stake `Deactivate` (5). Accounts: \[stake W, clock, stake authority S].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixDelegate
> **ixDelegate**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:95
Stake `DelegateStake` (2). Accounts: \[stake W, vote, clock, stake history, stake config, stake authority S].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
#### vote
[Section titled “vote”](#vote)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixInitialize
> **ixInitialize**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:87
Stake `Initialize` (0): authorities set, no lockup. Accounts: \[stake W, rent].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### stake
[Section titled “stake”](#stake)
`string`
#### staker
[Section titled “staker”](#staker)
`string`
#### withdrawer
[Section titled “withdrawer”](#withdrawer)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixMerge
> **ixMerge**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:131
Stake `Merge` (7): `source` is drained into `destination`. Accounts: \[destination W, source W, clock, stake history, stake authority S].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### destination
[Section titled “destination”](#destination)
`string`
#### source
[Section titled “source”](#source)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixSetComputeUnitLimit
> **ixSetComputeUnitLimit**(`units`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:140
Compute Budget `SetComputeUnitLimit` (2).
## Parameters
[Section titled “Parameters”](#parameters)
### units
[Section titled “units”](#units)
`number`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixSetComputeUnitPrice
> **ixSetComputeUnitPrice**(`microLamports`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:145
Compute Budget `SetComputeUnitPrice` (3), micro-lamports per unit.
## Parameters
[Section titled “Parameters”](#parameters)
### microLamports
[Section titled “microLamports”](#microlamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixSplit
> **ixSplit**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:104
Stake `Split` (3). Accounts: \[source W, destination W, stake authority S].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### splitStake
[Section titled “splitStake”](#splitstake)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# ixWithdraw
> **ixWithdraw**(`p`): [`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
Defined in: protocol-staking-native-solana/src/codec.ts:113
Stake `Withdraw` (4). Accounts: \[stake W, recipient W, clock, stake history, withdraw authority S].
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### recipient
[Section titled “recipient”](#recipient)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
## Returns
[Section titled “Returns”](#returns)
[`Instruction`](/api/anywalletkit/protocol-staking-native-solana/interfaces/instruction/)
# lockupInForce
> **lockupInForce**(`lockup`, `epoch`, `unixTime`): `boolean`
Defined in: protocol-staking-native-solana/src/codec.ts:191
Is a lockup still in force at `epoch` / `unixTime` (seconds)? A lockup binds withdrawals and withdraw-authority changes.
## Parameters
[Section titled “Parameters”](#parameters)
### lockup
[Section titled “lockup”](#lockup)
{ `custodian`: `string`; `epoch`: `bigint`; `unixTimestamp`: `bigint`; } | `null`
### epoch
[Section titled “epoch”](#epoch)
`bigint`
### unixTime
[Section titled “unixTime”](#unixtime)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# settlesAt
> **settlesAt**(`d`, `current`, `history`, `rateChangeEpoch`, `horizon?`): `bigint` | `null`
Defined in: protocol-staking-native-solana/src/activation.ts:102
The first epoch at which the account settles — fully active after a delegation, fully inactive after a deactivation — projected by replaying the latest known cluster stake. Returns the current epoch when it has already settled and null when the projection does not settle within `horizon` epochs (only when a large share of the whole cluster is moving at once).
## Parameters
[Section titled “Parameters”](#parameters)
### d
[Section titled “d”](#d)
[`Delegation`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegation/)
### current
[Section titled “current”](#current)
`bigint`
### history
[Section titled “history”](#history)
[`StakeHistory`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakehistory/)
### rateChangeEpoch
[Section titled “rateChangeEpoch”](#ratechangeepoch)
`bigint` | `null`
### horizon?
[Section titled “horizon?”](#horizon)
`number` = `16`
## Returns
[Section titled “Returns”](#returns)
`bigint` | `null`
# stakeInstructionTag
> **stakeInstructionTag**(`data`): `number` | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:212
Decodes the u32 tag of a stake instruction’s data, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`number` | `null`
# statusOf
> **statusOf**(`s`): [`StakeStatus`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakestatus/)
Defined in: protocol-staking-native-solana/src/activation.ts:88
The lifecycle label of an activation status (a non-delegated account is `inactive`).
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
[`ActivationStatus`](/api/anywalletkit/protocol-staking-native-solana/interfaces/activationstatus/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`StakeStatus`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakestatus/)
# warmupCooldownRateBps
> **warmupCooldownRateBps**(`epoch`, `rateChangeEpoch`): `bigint`
Defined in: protocol-staking-native-solana/src/activation.ts:25
Warm-up / cool-down rate in basis points: 25 % before the `reduce_stake_warmup_cooldown` epoch, 9 % from it on.
## Parameters
[Section titled “Parameters”](#parameters)
### epoch
[Section titled “epoch”](#epoch)
`bigint`
### rateChangeEpoch
[Section titled “rateChangeEpoch”](#ratechangeepoch)
`bigint` | `null`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# AccountMeta
Defined in: protocol-staking-native-solana/src/codec.ts:18
One account of an instruction.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-staking-native-solana/src/codec.ts:18
***
### role
[Section titled “role”](#role)
> **role**: [`Role`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/role/)
Defined in: protocol-staking-native-solana/src/codec.ts:18
# ActivationStatus
Defined in: protocol-staking-native-solana/src/activation.ts:11
How much of a delegation is effective, still activating, or cooling down at an epoch.
## Properties
[Section titled “Properties”](#properties)
### activating
[Section titled “activating”](#activating)
> **activating**: `bigint`
Defined in: protocol-staking-native-solana/src/activation.ts:11
***
### deactivating
[Section titled “deactivating”](#deactivating)
> **deactivating**: `bigint`
Defined in: protocol-staking-native-solana/src/activation.ts:11
***
### effective
[Section titled “effective”](#effective)
> **effective**: `bigint`
Defined in: protocol-staking-native-solana/src/activation.ts:11
# ClusterStake
Defined in: protocol-staking-native-solana/src/codec.ts:197
One epoch of the cluster’s stake (lamports).
## Properties
[Section titled “Properties”](#properties)
### activating
[Section titled “activating”](#activating)
> **activating**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:197
***
### deactivating
[Section titled “deactivating”](#deactivating)
> **deactivating**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:197
***
### effective
[Section titled “effective”](#effective)
> **effective**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:197
# DelegateOptions
Defined in: protocol-staking-native-solana/src/protocol.ts:173
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:175
The stake account.
***
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:177
Vote account; defaults like `stake`. For `reactivate` it must be the current one (or omitted).
# DelegateQuote
Defined in: protocol-staking-native-solana/src/protocol.ts:179
## Extended by
[Section titled “Extended by”](#extended-by)
* [`DelegateResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegateresult/)
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:181
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:180
***
### mode
[Section titled “mode”](#mode)
> **mode**: `"delegate"` | `"reactivate"`
Defined in: protocol-staking-native-solana/src/protocol.ts:184
`delegate`: an inactive account starts warming up; `reactivate`: undoes a deactivation made this epoch.
***
### validator
[Section titled “validator”](#validator)
> **validator**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:182
# DelegateResult
Defined in: protocol-staking-native-solana/src/protocol.ts:186
## Extends
[Section titled “Extends”](#extends)
* [`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/)
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:181
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/).[`account`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/#account)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:180
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/).[`fee`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:186
***
### mode
[Section titled “mode”](#mode)
> **mode**: `"delegate"` | `"reactivate"`
Defined in: protocol-staking-native-solana/src/protocol.ts:184
`delegate`: an inactive account starts warming up; `reactivate`: undoes a deactivation made this epoch.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/).[`mode`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/#mode)
***
### validator
[Section titled “validator”](#validator)
> **validator**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:182
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`DelegateQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/).[`validator`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegatequote/#validator)
# Delegation
Defined in: protocol-staking-native-solana/src/codec.ts:155
A stake delegation. `deactivationEpoch` is u64::MAX while delegated; `activationEpoch` u64::MAX marks a bootstrap stake.
## Properties
[Section titled “Properties”](#properties)
### activationEpoch
[Section titled “activationEpoch”](#activationepoch)
> **activationEpoch**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:155
***
### deactivationEpoch
[Section titled “deactivationEpoch”](#deactivationepoch)
> **deactivationEpoch**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:155
***
### stake
[Section titled “stake”](#stake)
> **stake**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:155
***
### voter
[Section titled “voter”](#voter)
> **voter**: `string`
Defined in: protocol-staking-native-solana/src/codec.ts:155
# EpochClock
Defined in: protocol-staking-native-solana/src/protocol.ts:119
The epoch clock.
## Properties
[Section titled “Properties”](#properties)
### endsAt
[Section titled “endsAt”](#endsat)
> **endsAt**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:119
***
### epoch
[Section titled “epoch”](#epoch)
> **epoch**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:119
***
### progress
[Section titled “progress”](#progress)
> **progress**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:119
***
### slotIndex
[Section titled “slotIndex”](#slotindex)
> **slotIndex**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:119
***
### slotsInEpoch
[Section titled “slotsInEpoch”](#slotsinepoch)
> **slotsInEpoch**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:119
# Instruction
Defined in: protocol-staking-native-solana/src/codec.ts:20
An instruction in the shape `@solana/kit` transaction messages carry (what `wallet-solana` signs).
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: [`AccountMeta`](/api/anywalletkit/protocol-staking-native-solana/interfaces/accountmeta/)\[]
Defined in: protocol-staking-native-solana/src/codec.ts:20
***
### data
[Section titled “data”](#data)
> **data**: `Uint8Array`
Defined in: protocol-staking-native-solana/src/codec.ts:20
***
### programAddress
[Section titled “programAddress”](#programaddress)
> **programAddress**: `string`
Defined in: protocol-staking-native-solana/src/codec.ts:20
# MergeOptions
Defined in: protocol-staking-native-solana/src/protocol.ts:188
## Properties
[Section titled “Properties”](#properties)
### destination
[Section titled “destination”](#destination)
> **destination**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:190
Account that receives everything.
***
### source
[Section titled “source”](#source)
> **source**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:192
Account that is drained and closed.
# MergeQuote
Defined in: protocol-staking-native-solana/src/protocol.ts:194
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MergeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergeresult/)
## Properties
[Section titled “Properties”](#properties)
### destination
[Section titled “destination”](#destination)
> **destination**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
***
### source
[Section titled “source”](#source)
> **source**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
# MergeResult
Defined in: protocol-staking-native-solana/src/protocol.ts:195
## Extends
[Section titled “Extends”](#extends)
* [`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/)
## Properties
[Section titled “Properties”](#properties)
### destination
[Section titled “destination”](#destination)
> **destination**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/).[`destination`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/#destination)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/).[`fee`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:195
***
### source
[Section titled “source”](#source)
> **source**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:194
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`MergeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/).[`source`](/api/anywalletkit/protocol-staking-native-solana/interfaces/mergequote/#source)
# NativeClaimOptions
Defined in: protocol-staking-native-solana/src/protocol.ts:159
Which finalized requests to claim; all claimable ones when `ids` is omitted.
## Extends
[Section titled “Extends”](#extends)
* [`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
## Properties
[Section titled “Properties”](#properties)
### accounts?
[Section titled “accounts?”](#accounts)
> `optional` **accounts?**: `string`\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:161
Stake accounts to withdraw from, by address (alternative to `ids`).
***
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:734
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/).[`ids`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/#ids)
# NativeClaimQuote
Defined in: protocol-staking-native-solana/src/protocol.ts:163
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NativeClaimResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimresult/)
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `string`\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:167
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:166
Lamports that return to the wallet.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:164
***
### remaining
[Section titled “remaining”](#remaining)
> **remaining**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:169
Requested (or, without ids, claimable) accounts left for another call: one transaction takes at most [MAX_CLAIMS_PER_TX](/api/anywalletkit/protocol-staking-native-solana/variables/max_claims_per_tx/).
# NativeClaimResult
Defined in: protocol-staking-native-solana/src/protocol.ts:171
## Extends
[Section titled “Extends”](#extends)
* [`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/)
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `string`\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:167
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/).[`accounts`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/#accounts)
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:166
Lamports that return to the wallet.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/).[`amount`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/#amount)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:164
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/).[`fee`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:171
***
### remaining
[Section titled “remaining”](#remaining)
> **remaining**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:169
Requested (or, without ids, claimable) accounts left for another call: one transaction takes at most [MAX_CLAIMS_PER_TX](/api/anywalletkit/protocol-staking-native-solana/variables/max_claims_per_tx/).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`NativeClaimQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/).[`remaining`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimquote/#remaining)
# NativeRewards
Defined in: protocol-staking-native-solana/src/protocol.ts:209
Rewards the stake accounts earned per epoch.
## Properties
[Section titled “Properties”](#properties)
### epochs
[Section titled “epochs”](#epochs)
> **epochs**: ({ `accounts`: `object`\[]; `amount`: `bigint`; `epoch`: `bigint`; } | { `epoch`: `bigint`; `error`: `string`; })\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:212
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:211
Sum over the epochs that answered, lamports.
# NativeStakeOptions
Defined in: protocol-staking-native-solana/src/protocol.ts:121
How much native coin to stake, in base units.
## Extends
[Section titled “Extends”](#extends)
* [`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:689
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/#amount)
***
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:123
Vote account to delegate to; must be listed and eligible.
# NativeStakeQuote
Defined in: protocol-staking-native-solana/src/protocol.ts:125
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NativeStakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeresult/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:128
Lamports delegated.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:126
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:137
Epoch the stake becomes active (projection).
***
### rentExempt
[Section titled “rentExempt”](#rentexempt)
> **rentExempt**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:130
Rent the new stake account holds (returned on withdraw).
***
### seed
[Section titled “seed”](#seed)
> **seed**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:134
***
### stakeAccount
[Section titled “stakeAccount”](#stakeaccount)
> **stakeAccount**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:133
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:132
What leaves the wallet besides the fee: amount + rent.
***
### validator
[Section titled “validator”](#validator)
> **validator**: [`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)
Defined in: protocol-staking-native-solana/src/protocol.ts:135
# NativeStakeResult
Defined in: protocol-staking-native-solana/src/protocol.ts:139
## Extends
[Section titled “Extends”](#extends)
* [`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:128
Lamports delegated.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`amount`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#amount)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:126
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`fee`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:139
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:137
Epoch the stake becomes active (projection).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`readyEpoch`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#readyepoch)
***
### rentExempt
[Section titled “rentExempt”](#rentexempt)
> **rentExempt**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:130
Rent the new stake account holds (returned on withdraw).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`rentExempt`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#rentexempt)
***
### seed
[Section titled “seed”](#seed)
> **seed**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:134
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`seed`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#seed)
***
### stakeAccount
[Section titled “stakeAccount”](#stakeaccount)
> **stakeAccount**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:133
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`stakeAccount`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#stakeaccount)
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:132
What leaves the wallet besides the fee: amount + rent.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`total`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#total)
***
### validator
[Section titled “validator”](#validator)
> **validator**: [`ValidatorInfo`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorinfo/)
Defined in: protocol-staking-native-solana/src/protocol.ts:135
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`NativeStakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/).[`validator`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakequote/#validator)
# NativeStakingConfig
Defined in: protocol-staking-native-solana/src/protocol.ts:40
Configuration of [NativeStakingProtocolSolana](/api/anywalletkit/protocol-staking-native-solana/classes/nativestakingprotocolsolana/). Only `validators` is required.
## Properties
[Section titled “Properties”](#properties)
### allowDelinquent?
[Section titled “allowDelinquent?”](#allowdelinquent)
> `optional` **allowDelinquent?**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:48
Allow delegating to a delinquent validator (default false: its stake earns nothing).
***
### commitment?
[Section titled “commitment?”](#commitment)
> `optional` **commitment?**: `"processed"` | `"confirmed"` | `"finalized"`
Defined in: protocol-staking-native-solana/src/protocol.ts:52
Read commitment (default `confirmed`).
***
### computeUnitLimit?
[Section titled “computeUnitLimit?”](#computeunitlimit)
> `optional` **computeUnitLimit?**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:66
Explicit compute-unit limit. Without it the wallet sets one from simulation.
***
### computeUnitPrice?
[Section titled “computeUnitPrice?”](#computeunitprice)
> `optional` **computeUnitPrice?**: `number` | `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:68
Explicit priority fee, micro-lamports per unit. Without it the wallet picks one from recent fees.
***
### defaultValidator?
[Section titled “defaultValidator?”](#defaultvalidator)
> `optional` **defaultValidator?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:44
Vote account `stake` uses when the call names none. Without it: the first eligible validator of the list (no default in `'any'` mode).
***
### discover?
[Section titled “discover?”](#discover)
> `optional` **discover?**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:62
Also find stake accounts other wallets created for this address (`getProgramAccounts` by staker and withdrawer). Needs an RPC that serves it. Default false.
***
### enrich?
[Section titled “enrich?”](#enrich)
> `optional` **enrich?**: [`ValidatorEnricher`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorenricher/)
Defined in: protocol-staking-native-solana/src/protocol.ts:70
Adds data to validators (APR with MEV, names, scores) from an explorer or the app’s backend.
***
### feeReserve?
[Section titled “feeReserve?”](#feereserve)
> `optional` **feeReserve?**: `number` | `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:64
Lamports `stake` leaves on the wallet for later fees (default 0.005 SOL).
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-staking-native-solana/src/protocol.ts:56
`fetch` for URL providers (default the global one).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### maxAccounts?
[Section titled “maxAccounts?”](#maxaccounts)
> `optional` **maxAccounts?**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:60
Seed slots scanned (default 32, at most 100).
***
### maxCommission?
[Section titled “maxCommission?”](#maxcommission)
> `optional` **maxCommission?**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:46
Refuse to delegate to a validator whose commission is above this, percent (default 10). Checked live at every delegation.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`SolanaRpcSource`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/solanarpcsource/) | [`SolanaRpcSource`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/solanarpcsource/)\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:50
Where reads go: a URL, a list (tried in order), a `@solana/rpc` client or `{ request(method, params) }`. Defaults to the account’s own RPC.
***
### seedPrefix?
[Section titled “seedPrefix?”](#seedprefix)
> `optional` **seedPrefix?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:58
Seed prefix of the wallet’s stake accounts (default `stake:`). Changing it hides accounts made under the old prefix unless `discover` is on.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-staking-native-solana/src/protocol.ts:54
Per-request timeout for reads through a URL or a @solana/rpc client, ms (default 15 000). A `{ request }` provider keeps its own.
***
### validators
[Section titled “validators”](#validators)
> **validators**: [`ValidatorsOption`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorsoption/)
Defined in: protocol-staking-native-solana/src/protocol.ts:42
The validators to delegate to (vote accounts), or `'any'`. Required: there is no default list.
# NativeUnstakeOptions
Defined in: protocol-staking-native-solana/src/protocol.ts:141
How much staked token to put in the withdrawal queue.
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
## Properties
[Section titled “Properties”](#properties)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:143
Unstake from this stake account only.
***
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:698
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/#amount)
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:700
Which staked-token form to withdraw (e.g. “stETH” | “wstETH”). Defaults to the primary one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/).[`token`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/#token)
***
### validator?
[Section titled “validator?”](#validator)
> `optional` **validator?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:145
Unstake only stake delegated to this vote account.
# NativeUnstakeQuote
Defined in: protocol-staking-native-solana/src/protocol.ts:149
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NativeUnstakeResult`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeresult/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:151
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:150
***
### readyAt
[Section titled “readyAt”](#readyat)
> **readyAt**: `number` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:155
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:154
Epoch from which the unstaked SOL can be claimed (projection; the current one when it is immediate; null when the cluster is moving so much stake that it cannot be projected).
***
### steps
[Section titled “steps”](#steps)
> **steps**: [`UnstakeStep`](/api/anywalletkit/protocol-staking-native-solana/interfaces/unstakestep/)\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:152
# NativeUnstakeResult
Defined in: protocol-staking-native-solana/src/protocol.ts:157
## Extends
[Section titled “Extends”](#extends)
* [`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:151
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/).[`amount`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/#amount)
***
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:157
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:150
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/).[`fee`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/#fee)
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:157
***
### readyAt
[Section titled “readyAt”](#readyat)
> **readyAt**: `number` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:155
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/).[`readyAt`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/#readyat)
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:154
Epoch from which the unstaked SOL can be claimed (projection; the current one when it is immediate; null when the cluster is moving so much stake that it cannot be projected).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/).[`readyEpoch`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/#readyepoch)
***
### steps
[Section titled “steps”](#steps)
> **steps**: [`UnstakeStep`](/api/anywalletkit/protocol-staking-native-solana/interfaces/unstakestep/)\[]
Defined in: protocol-staking-native-solana/src/protocol.ts:152
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`NativeUnstakeQuote`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/).[`steps`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakequote/#steps)
# NativeWithdrawalRequest
Defined in: protocol-staking-native-solana/src/protocol.ts:198
A withdrawal request as this module reports it: one stake account that is cooling down or ready.
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/)
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:199
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:715
Amount requested, base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#amount)
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:719
Finalized and ready to claim.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`claimable`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#claimable)
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:713
Request id, as the claim call takes it.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`id`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#id)
***
### readyAt
[Section titled “readyAt”](#readyat)
> **readyAt**: `number` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:202
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:201
***
### status
[Section titled “status”](#status)
> **status**: [`StakeStatus`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakestatus/)
Defined in: protocol-staking-native-solana/src/protocol.ts:200
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:717
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`timestamp`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#timestamp)
# RpcClientOptions
Defined in: protocol-staking-native-solana/src/rpc.ts:50
## Properties
[Section titled “Properties”](#properties)
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-staking-native-solana/src/rpc.ts:52
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-staking-native-solana/src/rpc.ts:51
# StakeAccountData
Defined in: protocol-staking-native-solana/src/codec.ts:158
Decoded stake account.
## Properties
[Section titled “Properties”](#properties)
### creditsObserved
[Section titled “creditsObserved”](#creditsobserved)
> **creditsObserved**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:166
***
### delegation
[Section titled “delegation”](#delegation)
> **delegation**: [`Delegation`](/api/anywalletkit/protocol-staking-native-solana/interfaces/delegation/) | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:165
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`StakeAccountKind`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakeaccountkind/)
Defined in: protocol-staking-native-solana/src/codec.ts:159
***
### lockup
[Section titled “lockup”](#lockup)
> **lockup**: { `custodian`: `string`; `epoch`: `bigint`; `unixTimestamp`: `bigint`; } | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:164
`unixTimestamp` / `epoch` are 0 and `custodian` the default address when no lockup was set.
***
### rentExemptReserve
[Section titled “rentExemptReserve”](#rentexemptreserve)
> **rentExemptReserve**: `bigint`
Defined in: protocol-staking-native-solana/src/codec.ts:160
***
### staker
[Section titled “staker”](#staker)
> **staker**: `string` | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:161
***
### withdrawer
[Section titled “withdrawer”](#withdrawer)
> **withdrawer**: `string` | `null`
Defined in: protocol-staking-native-solana/src/codec.ts:162
# StakeAccountInfo
Defined in: protocol-staking-native-solana/src/protocol.ts:74
One of the wallet’s stake accounts. Amounts in lamports.
## Properties
[Section titled “Properties”](#properties)
### activating
[Section titled “activating”](#activating)
> **activating**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:91
***
### activationEpoch
[Section titled “activationEpoch”](#activationepoch)
> **activationEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:94
***
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:75
***
### canManage
[Section titled “canManage”](#canmanage)
> **canManage**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:111
The wallet is the stake authority (may delegate, deactivate, split, merge).
***
### canWithdraw
[Section titled “canWithdraw”](#canwithdraw)
> **canWithdraw**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:113
The wallet is the withdraw authority and no lockup is in force.
***
### deactivating
[Section titled “deactivating”](#deactivating)
> **deactivating**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:92
***
### deactivationEpoch
[Section titled “deactivationEpoch”](#deactivationepoch)
> **deactivationEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:95
***
### delegated
[Section titled “delegated”](#delegated)
> **delegated**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:89
`delegation.stake` while delegated or cooling down: principal plus compounded rewards. 0 once inactive (the field goes stale).
***
### effective
[Section titled “effective”](#effective)
> **effective**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:90
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:77
Stable id for `claimWithdrawals({ ids })`: the address’s first 8 bytes as a u64.
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"initialized"` | `"delegated"`
Defined in: protocol-staking-native-solana/src/protocol.ts:81
***
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:82
***
### lockup
[Section titled “lockup”](#lockup)
> **lockup**: { `custodian`: `string`; `epoch`: `bigint`; `unixTimestamp`: `bigint`; } | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:115
Lockup still in force, if any.
***
### owned
[Section titled “owned”](#owned)
> **owned**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:109
The wallet is the withdraw authority: the SOL is the wallet’s. Accounts `discover` finds where the wallet is only the stake authority are listed with `owned: false` and left out of the position and of every write.
***
### readyAt
[Section titled “readyAt”](#readyat)
> **readyAt**: `number` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:101
Projected unix ms of `readyEpoch`’s start.
***
### readyEpoch
[Section titled “readyEpoch”](#readyepoch)
> **readyEpoch**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:99
Epoch at which the current warm-up or cool-down completes (null when settled).
***
### seed
[Section titled “seed”](#seed)
> **seed**: `string` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:79
Seed and slot index for the module’s own accounts; null for discovered ones.
***
### seedIndex
[Section titled “seedIndex”](#seedindex)
> **seedIndex**: `number` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:80
***
### staker
[Section titled “staker”](#staker)
> **staker**: `string` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:102
***
### status
[Section titled “status”](#status)
> **status**: [`StakeStatus`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/stakestatus/)
Defined in: protocol-staking-native-solana/src/protocol.ts:93
***
### validator
[Section titled “validator”](#validator)
> **validator**: `string` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:84
Vote account it is delegated to (null when never delegated).
***
### validatorListed
[Section titled “validatorListed”](#validatorlisted)
> **validatorListed**: `boolean`
Defined in: protocol-staking-native-solana/src/protocol.ts:87
The validator is in the configured list (true in `'any'` mode).
***
### validatorName
[Section titled “validatorName”](#validatorname)
> **validatorName**: `string` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:85
***
### withdrawable
[Section titled “withdrawable”](#withdrawable)
> **withdrawable**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:97
What a withdraw could take now; equals `lamports` once fully inactive (the account closes).
***
### withdrawer
[Section titled “withdrawer”](#withdrawer)
> **withdrawer**: `string` | `null`
Defined in: protocol-staking-native-solana/src/protocol.ts:103
# UnstakeStep
Defined in: protocol-staking-native-solana/src/protocol.ts:148
One step of an unstake: deactivate a whole account, or split part of it into a new account and deactivate that.
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:148
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: protocol-staking-native-solana/src/protocol.ts:148
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"deactivate"` | `"split"`
Defined in: protocol-staking-native-solana/src/protocol.ts:148
***
### splitInto?
[Section titled “splitInto?”](#splitinto)
> `optional` **splitInto?**: `string`
Defined in: protocol-staking-native-solana/src/protocol.ts:148
# ValidatorConfig
Defined in: protocol-staking-native-solana/src/validators.ts:4
A validator the module may delegate to.
## Properties
[Section titled “Properties”](#properties)
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocol-staking-native-solana/src/validators.ts:8
Display name (falls back to `enrich`, then to the address).
***
### voteAccount
[Section titled “voteAccount”](#voteaccount)
> **voteAccount**: `string`
Defined in: protocol-staking-native-solana/src/validators.ts:6
The validator’s vote account: what a stake account delegates to.
# ValidatorExtra
Defined in: protocol-staking-native-solana/src/validators.ts:19
Extra data an app attaches to validators (an explorer’s APY with MEV, a score, a logo).
## Indexable
[Section titled “Indexable”](#indexable)
> \[`key`: `string`]: `unknown`
## Properties
[Section titled “Properties”](#properties)
### apr?
[Section titled “apr?”](#apr)
> `optional` **apr?**: `number`
Defined in: protocol-staking-native-solana/src/validators.ts:21
APR in percent (6.9 = 6.9 %); replaces the module’s inflation-only estimate.
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: protocol-staking-native-solana/src/validators.ts:22
# ValidatorInfo
Defined in: protocol-staking-native-solana/src/validators.ts:33
A validator as the chain reports it, with the module’s verdict.
## Properties
[Section titled “Properties”](#properties)
### activatedStake
[Section titled “activatedStake”](#activatedstake)
> **activatedStake**: `bigint`
Defined in: protocol-staking-native-solana/src/validators.ts:41
Stake active on the validator, lamports.
***
### apr
[Section titled “apr”](#apr)
> **apr**: `number` | `null`
Defined in: protocol-staking-native-solana/src/validators.ts:55
APR in percent: the `enrich` hook’s figure when given, else the module’s inflation estimate after commission.
***
### aprSource
[Section titled “aprSource”](#aprsource)
> **aprSource**: `"enrich"` | `"estimate"` | `null`
Defined in: protocol-staking-native-solana/src/validators.ts:57
Where `apr` came from.
***
### commission
[Section titled “commission”](#commission)
> **commission**: `number`
Defined in: protocol-staking-native-solana/src/validators.ts:39
Inflation-reward commission, percent.
***
### delinquent
[Section titled “delinquent”](#delinquent)
> **delinquent**: `boolean`
Defined in: protocol-staking-native-solana/src/validators.ts:43
Has not voted recently (the cluster stops paying rewards to its stake).
***
### eligible
[Section titled “eligible”](#eligible)
> **eligible**: `boolean`
Defined in: protocol-staking-native-solana/src/validators.ts:51
Can take new stake: listed, found, not delinquent, commission within `maxCommission`.
***
### epochCredits
[Section titled “epochCredits”](#epochcredits)
> **epochCredits**: `bigint` | `null`
Defined in: protocol-staking-native-solana/src/validators.ts:47
Vote credits earned in the latest epoch the node reports.
***
### extra?
[Section titled “extra?”](#extra)
> `optional` **extra?**: [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)
Defined in: protocol-staking-native-solana/src/validators.ts:59
Whatever `enrich` returned for it.
***
### lastVote
[Section titled “lastVote”](#lastvote)
> **lastVote**: `bigint`
Defined in: protocol-staking-native-solana/src/validators.ts:45
Last slot it voted on.
***
### listed
[Section titled “listed”](#listed)
> **listed**: `boolean`
Defined in: protocol-staking-native-solana/src/validators.ts:49
In the configured list (always true in `'any'` mode for validators the cluster knows).
***
### name
[Section titled “name”](#name)
> **name**: `string` | `null`
Defined in: protocol-staking-native-solana/src/validators.ts:37
***
### nodePubkey
[Section titled “nodePubkey”](#nodepubkey)
> **nodePubkey**: `string` | `null`
Defined in: protocol-staking-native-solana/src/validators.ts:36
Identity (node) key.
***
### refusals
[Section titled “refusals”](#refusals)
> **refusals**: [`ValidatorRefusal`](/api/anywalletkit/protocol-staking-native-solana/type-aliases/validatorrefusal/)\[]
Defined in: protocol-staking-native-solana/src/validators.ts:53
Why it is not eligible (empty when it is).
***
### voteAccount
[Section titled “voteAccount”](#voteaccount)
> **voteAccount**: `string`
Defined in: protocol-staking-native-solana/src/validators.ts:34
# NativeWithdrawalRequestsView
> **NativeWithdrawalRequestsView** = `Omit`<`WithdrawalRequestsView`, `"requests"`> & `object`
Defined in: protocol-staking-native-solana/src/protocol.ts:206
WithdrawalRequestsView with this module’s request rows.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### requests
[Section titled “requests”](#requests)
> **requests**: [`NativeWithdrawalRequest`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativewithdrawalrequest/)\[]
# Role
> **Role** = *typeof* [`READONLY`](/api/anywalletkit/protocol-staking-native-solana/variables/readonly/) | *typeof* [`WRITABLE`](/api/anywalletkit/protocol-staking-native-solana/variables/writable/) | *typeof* [`READONLY_SIGNER`](/api/anywalletkit/protocol-staking-native-solana/variables/readonly_signer/) | *typeof* [`WRITABLE_SIGNER`](/api/anywalletkit/protocol-staking-native-solana/variables/writable_signer/)
Defined in: protocol-staking-native-solana/src/codec.ts:15
# SolanaRpcSource
> **SolanaRpcSource** = `string` | { `request`: `Promise`<`unknown`>; } | `object`
Defined in: protocol-staking-native-solana/src/rpc.ts:5
Something that answers Solana JSON-RPC: a URL, a `@solana/rpc` client (what `wallet-solana` accounts hold), or `{ request(method, params) }`.
# StakeAccountKind
> **StakeAccountKind** = `"uninitialized"` | `"initialized"` | `"delegated"` | `"rewardsPool"`
Defined in: protocol-staking-native-solana/src/codec.ts:152
`StakeStateV2` tag.
# StakeHistory
> **StakeHistory** = `ReadonlyMap`<`bigint`, [`ClusterStake`](/api/anywalletkit/protocol-staking-native-solana/interfaces/clusterstake/)>
Defined in: protocol-staking-native-solana/src/activation.ts:17
Cluster stake per epoch (the StakeHistory sysvar).
# StakeStatus
> **StakeStatus** = `"activating"` | `"active"` | `"deactivating"` | `"inactive"`
Defined in: protocol-staking-native-solana/src/activation.ts:14
Where a stake account is in its lifecycle. `inactive` means nothing is delegated and every lamport can be withdrawn.
# ValidatorEnricher
> **ValidatorEnricher** = (`voteAccounts`) => `Promise`<`Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)>> | `Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)>
Defined in: protocol-staking-native-solana/src/validators.ts:27
Supplies [ValidatorExtra](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/) per vote account, e.g. from Stakewiz or the app’s backend. Called with the vote accounts a read needs.
## Parameters
[Section titled “Parameters”](#parameters)
### voteAccounts
[Section titled “voteAccounts”](#voteaccounts)
`string`\[]
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)>> | `Record`<`string`, [`ValidatorExtra`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorextra/)>
# ValidatorRefusal
> **ValidatorRefusal** = `"not-listed"` | `"not-found"` | `"delinquent"` | `"commission-above-max"`
Defined in: protocol-staking-native-solana/src/validators.ts:30
Why a validator cannot take new stake right now.
# ValidatorsOption
> **ValidatorsOption** = `ReadonlyArray`<`string` | [`ValidatorConfig`](/api/anywalletkit/protocol-staking-native-solana/interfaces/validatorconfig/)> | `"any"`
Defined in: protocol-staking-native-solana/src/validators.ts:16
Which validators the module delegates to. A list of vote accounts (or `{ voteAccount, name }`), or `'any'` for a wallet that lets its users pick from the whole cluster. There is no default: a module without this choice refuses to construct.
# COMPUTE_BUDGET_PROGRAM
> `const` **COMPUTE_BUDGET_PROGRAM**: `"ComputeBudget111111111111111111111111111111"` = `'ComputeBudget111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:8
# DEFAULT_FEE_RESERVE
> `const` **DEFAULT_FEE_RESERVE**: `5000000n` = `5_000_000n`
Defined in: protocol-staking-native-solana/src/protocol.ts:25
Lamports a stake leaves on the wallet for the fees of later transactions (unstake, claim): 0.005 SOL.
# DEFAULT_MAX_ACCOUNTS
> `const` **DEFAULT_MAX_ACCOUNTS**: `32` = `32`
Defined in: protocol-staking-native-solana/src/protocol.ts:23
Seed slots scanned per wallet (one `getMultipleAccounts`).
# DEFAULT_MAX_COMMISSION
> `const` **DEFAULT_MAX_COMMISSION**: `10` = `10`
Defined in: protocol-staking-native-solana/src/protocol.ts:27
Highest validator commission (percent) the module delegates to unless configured otherwise.
# DEFAULT_SEED_PREFIX
> `const` **DEFAULT_SEED_PREFIX**: `"stake:"` = `'stake:'`
Defined in: protocol-staking-native-solana/src/protocol.ts:21
Default seed prefix: stake accounts live at `create_with_seed(wallet, "stake:", Stake program)`.
# DEFAULT_TIMEOUT_MS
> `const` **DEFAULT_TIMEOUT_MS**: `15000` = `15_000`
Defined in: protocol-staking-native-solana/src/rpc.ts:11
Default request timeout for URL providers and @solana/rpc clients.
# LAMPORTS_PER_SOL
> `const` **LAMPORTS_PER_SOL**: `1000000000n` = `1_000_000_000n`
Defined in: protocol-staking-native-solana/src/constants.ts:28
# MAX_CLAIMS_PER_TX
> `const` **MAX_CLAIMS_PER_TX**: `10` = `10`
Defined in: protocol-staking-native-solana/src/protocol.ts:35
Withdrawals per claim transaction (keeps it well under the 1232-byte limit).
# MAX_DEACTIVATIONS_PER_TX
> `const` **MAX_DEACTIVATIONS_PER_TX**: `10` = `10`
Defined in: protocol-staking-native-solana/src/protocol.ts:37
Deactivations per unstake transaction.
# MAX_SEED_LENGTH
> `const` **MAX_SEED_LENGTH**: `32` = `32`
Defined in: protocol-staking-native-solana/src/constants.ts:26
Longest seed `CreateAccountWithSeed` accepts, in bytes.
# MODULE_NAME
> `const` **MODULE_NAME**: `"@anywalletkit/protocol-staking-native-solana"` = `'@anywalletkit/protocol-staking-native-solana'`
Defined in: protocol-staking-native-solana/src/activity.ts:18
Registry name, as `module.json` carries it.
# RATE_CHANGE_EPOCH
> `const` **RATE_CHANGE_EPOCH**: `0n` = `0n`
Defined in: protocol-staking-native-solana/src/constants.ts:21
Epoch from which warm-up and cool-down run at 9 % of the cluster per epoch. The stake program uses 0 (“as if it had always been 9 %”), which is exact for every present-day decision it makes; this module does the same, so its statuses match what the program will accept.
# READONLY
> `const` **READONLY**: `0`
Defined in: protocol-staking-native-solana/src/codec.ts:11
Account roles, numerically identical to `@solana/kit`’s `AccountRole`.
# READONLY_SIGNER
> `const` **READONLY_SIGNER**: `2`
Defined in: protocol-staking-native-solana/src/codec.ts:13
# SLOT_MS
> `const` **SLOT_MS**: `400` = `400`
Defined in: protocol-staking-native-solana/src/protocol.ts:29
Slot time used to project epoch boundaries.
# SOLANA_MAINNET
> `const` **SOLANA_MAINNET**: `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"` = `'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'`
Defined in: protocol-staking-native-solana/src/constants.ts:2
CAIP-2 id of Solana mainnet.
# STAKE_ACCOUNT_SPACE
> `const` **STAKE_ACCOUNT_SPACE**: `200` = `200`
Defined in: protocol-staking-native-solana/src/constants.ts:24
Size of a stake account (`StakeStateV2`).
# STAKE_CONFIG
> `const` **STAKE_CONFIG**: `"StakeConfig11111111111111111111111111111111"` = `'StakeConfig11111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:14
Legacy stake config account. The program ignores it but still accepts it in `DelegateStake`’s legacy layout.
# STAKE_IX
> `const` **STAKE_IX**: `object`
Defined in: protocol-staking-native-solana/src/codec.ts:23
Stake program instruction tags (`StakeInstruction`, bincode u32).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### authorize
[Section titled “authorize”](#authorize)
> `readonly` **authorize**: `1` = `1`
### deactivate
[Section titled “deactivate”](#deactivate)
> `readonly` **deactivate**: `5` = `5`
### deactivateDelinquent
[Section titled “deactivateDelinquent”](#deactivatedelinquent)
> `readonly` **deactivateDelinquent**: `14` = `14`
### delegate
[Section titled “delegate”](#delegate)
> `readonly` **delegate**: `2` = `2`
### initialize
[Section titled “initialize”](#initialize)
> `readonly` **initialize**: `0` = `0`
### initializeChecked
[Section titled “initializeChecked”](#initializechecked)
> `readonly` **initializeChecked**: `9` = `9`
### merge
[Section titled “merge”](#merge)
> `readonly` **merge**: `7` = `7`
### moveLamports
[Section titled “moveLamports”](#movelamports)
> `readonly` **moveLamports**: `17` = `17`
### moveStake
[Section titled “moveStake”](#movestake)
> `readonly` **moveStake**: `16` = `16`
### setLockup
[Section titled “setLockup”](#setlockup)
> `readonly` **setLockup**: `6` = `6`
### split
[Section titled “split”](#split)
> `readonly` **split**: `3` = `3`
### withdraw
[Section titled “withdraw”](#withdraw)
> `readonly` **withdraw**: `4` = `4`
# STAKE_PROGRAM
> `const` **STAKE_PROGRAM**: `"Stake11111111111111111111111111111111111111"` = `'Stake11111111111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:5
The native Stake program (Core BPF since 2025; still at the old address).
# SYSTEM_PROGRAM
> `const` **SYSTEM_PROGRAM**: `"11111111111111111111111111111111"` = `'11111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:6
# SYSVAR_CLOCK
> `const` **SYSVAR_CLOCK**: `"SysvarC1ock11111111111111111111111111111111"` = `'SysvarC1ock11111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:10
# SYSVAR_RENT
> `const` **SYSVAR_RENT**: `"SysvarRent111111111111111111111111111111111"` = `'SysvarRent111111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:11
# SYSVAR_STAKE_HISTORY
> `const` **SYSVAR_STAKE_HISTORY**: `"SysvarStakeHistory1111111111111111111111111"` = `'SysvarStakeHistory1111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:12
# U64_MAX
> `const` **U64_MAX**: `18446744073709551615n` = `0xffff_ffff_ffff_ffffn`
Defined in: protocol-staking-native-solana/src/constants.ts:29
# VOTE_PROGRAM
> `const` **VOTE_PROGRAM**: `"Vote111111111111111111111111111111111111111"` = `'Vote111111111111111111111111111111111111111'`
Defined in: protocol-staking-native-solana/src/constants.ts:7
# WRITABLE
> `const` **WRITABLE**: `1`
Defined in: protocol-staking-native-solana/src/codec.ts:12
# WRITABLE_SIGNER
> `const` **WRITABLE_SIGNER**: `3`
Defined in: protocol-staking-native-solana/src/codec.ts:14
# @anywalletkit/protocol-staking-spl-stake-pool-solana
# @anywalletkit/protocol-staking-spl-stake-pool-solana
[Section titled “@anywalletkit/protocol-staking-spl-stake-pool-solana”](#anywalletkitprotocol-staking-spl-stake-pool-solana)
[](https://www.npmjs.com/package/@anywalletkit/protocol-staking-spl-stake-pool-solana)
A simple package that lets `@anywalletkit/wallet-solana` wallet accounts stake through pools on the [SPL Stake Pool](https://github.com/solana-program/stake-pool) program — [Jito](https://www.jito.network) by default: stake SOL → JitoSOL, exit instantly from the reserve or through a stake account, claim, read rates, APY and earnings.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-staking-spl-stake-pool-solana @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-staking-spl-stake-pool-solana @anywalletkit/core · yarn add @anywalletkit/protocol-staking-spl-stake-pool-solana @anywalletkit/core
```
On npm: [@anywalletkit/protocol-staking-spl-stake-pool-solana](https://www.npmjs.com/package/@anywalletkit/protocol-staking-spl-stake-pool-solana), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Built as the **fourth implementation of the `StakingProtocol` type** in `@anywalletkit/core` — after Lido (ETH liquid staking), SSV (token staking with a cooldown) and Tonstakers (GRAM liquid staking) — and the second one off EVM. The base class in `src/staking-protocol.js` is the same file, byte-identical: the type is chain-agnostic, and Solana’s two-shape exit (instant vs. stake account + epoch boundary) fits its request → queue → claim contract.
The mechanics are extracted from a production wallet (React Native/Hermes). Verification status (2026-09-07, mainnet): **stake and instant exit ran with real funds** from the wallet (four transactions, amounts matched the module’s quotes to the lamport); the **delayed exit** (stake account + deactivate) is verified by `simulateTransaction` as a large holder, and the **claim** only by its instruction layout — a funded delayed → claim cycle needs a position of ≥ 1 SOL worth and is still to be run. `scripts/verify-live.mjs` re-checks every shape the account can afford, keys never involved.
## What an SPL stake pool and JitoSOL are
[Section titled “What an SPL stake pool and JitoSOL are”](#what-an-spl-stake-pool-and-jitosol-are)
An SPL stake pool holds stake accounts on many validators plus a reserve. The **pool token** (JitoSOL for Jito; bSOL and most validator LSTs use the same program) is the non-rebasing receipt whose SOL value is `total_lamports / pool_token_supply`, moved once per epoch (\~2 days) when the pool’s crank applies the epoch’s rewards. Jito adds MEV tips on top of inflation rewards.
* **Stake** is one `DepositSol` instruction: SOL goes to the reserve, tokens are minted at the rate (Jito: no deposit fee).
* **Instant exit** — `WithdrawSol`: burn tokens, SOL is paid from the reserve at once, minus the pool’s SOL withdrawal fee (Jito: 0.1 %). Only while the reserve holds enough (typically \~1 000 SOL).
* **Delayed exit** — `WithdrawStake`: burn tokens, the pool splits a validator stake account to a fresh stake account owned by the wallet (Jito: 0.1 % fee); this module deactivates it in the same transaction. After the epoch boundary the account is inactive and **claim** sweeps the SOL (and the account’s rent) back to the wallet. The stake program’s minimum delegation (1 SOL + rent) is the floor for this path.
The wallet’s stake accounts are derived with seeds (`createWithSeed(wallet, "-unstake:", StakeProgram)`, 8 slots), so the queue is recoverable from the wallet alone and no ephemeral keypair ever signs. A slot address someone pre-funded (SOL sent to the predictable seed address, where `CreateAccountWithSeed` would fail) is still used: the exit first moves that SOL back to the wallet with System `TransferWithSeed`, then creates the stake account there.
## Usage
[Section titled “Usage”](#usage)
```js
import WalletManagerSolana from '@anywalletkit/wallet-solana'
import SplStakePoolProtocolSolana from '@anywalletkit/protocol-staking-spl-stake-pool-solana'
const wallet = new WalletManagerSolana(seed, { provider: 'https://api.mainnet-beta.solana.com' })
const account = await wallet.getAccount(0)
const jito = new SplStakePoolProtocolSolana(account) // pool: 'jito' by default; reads ride the account's RPC
// Stake 1 SOL — JitoSOL lands at the pool rate (DepositSolWithSlippage, 0.5 % floor)
const { hash, fee } = await jito.stake({ amount: 10n ** 9n })
await jito.awaitConfirmation(hash)
// Exit: delayed (default — stake account, claim after the epoch boundary) or instant (reserve)
await jito.requestWithdrawal({ amount: 10n ** 9n }) // ≥ 1 SOL worth
await jito.requestWithdrawal({ amount: 5n * 10n ** 7n, mode: 'instant' })
// The queue, then the claim
const { requests, claimableIds } = await jito.getWithdrawalRequests()
if (claimableIds.length) await jito.claimWithdrawals({ ids: claimableIds })
// Views
await jito.getStakedBalance() // { balance: JitoSOL, rate: lamports per JitoSOL (1e9), total: lamports }
await jito.getPoolData() // rate, previousRate, updated, instantLiquidity, fees, minimumStakeLamports…
await jito.getApr() // percent — on-chain estimate, or your provider's figure via the `apr` hook
await jito.getRewards() // { earned, entryRate, deposited, minted, firstStakeAt } from the account's own deposits
```
### Configuration
[Section titled “Configuration”](#configuration)
```js
new SplStakePoolProtocolSolana(account, {
pool: 'jito', // or { name, pool, mint, symbol } for any pool on the program
provider: [url1, url2], // JSON-RPC URL(s), a @solana/rpc client, or { request(method, params) }
commitment: 'confirmed',
slippageBps: 50, // floor on quoted amounts (..WithSlippage instructions)
computeUnitLimit: 300_000,
computeUnitPrice: 50_000n, // micro-lamports per unit — ≈ 0.000015 SOL priority fee
unstakeSlots: 8, // delayed exits tracked per wallet
apr: async () => fetchJitoApy() // provider APY hook (Jito's stats include MEV); default: epoch-over-epoch estimate
})
```
A read-only account (`{ getAddress }`) is enough for every view; writes need an account with `sendTransaction`. The module hands the account a bare `{ version: 0, instructions }` message — `@anywalletkit/wallet-solana` sets the blockhash lifetime and the fee-payer signer, signs and broadcasts; the key never enters the module.
## Fail-closed rules
[Section titled “Fail-closed rules”](#fail-closed-rules)
Checked before any transaction is built:
* the configured mint must equal the on-chain pool’s mint; the pool account must be owned by the SPL Stake Pool program;
* the pool must be updated for the current epoch (`last_update_epoch == epoch`) — the program rejects every deposit and withdrawal otherwise;
* a delayed exit must yield at least `rent + minimum delegation` and leave the split-from validator account the same minimum (checked against the live balance, not only the last-update list), else the stake program’s `Split` fails;
* an instant exit must fit the reserve minus its rent;
* every amount goes out with a `..WithSlippage` floor (default 0.5 %);
* a pool that restricts SOL deposits or withdrawals to an authority is refused for that path rather than sent to fail.
## Why the instructions are hand-encoded
[Section titled “Why the instructions are hand-encoded”](#why-the-instructions-are-hand-encoded)
`@anywalletkit/wallet-solana` is built on `@solana/*` 3.x. The published stake-pool client wants web3.js v1 and `@solana-program/stake` wants kit ≥ 5; either would put a second Solana stack into the consumer’s bundle. The six instructions this module needs have stable, documented layouts (Stake Pool `DepositSol` 14 / `WithdrawStake` 10 / `WithdrawSol` 16 and their `..WithSlippage` variants 25 / 24 / 26, System `CreateAccountWithSeed` 3, Stake `Deactivate` 5 / `Withdraw` 4), verified against the program sources and by simulation — `src/spl-stake-pool-codec.js` encodes them with `@solana/addresses` and `@solana/instructions` only.
## Tests
[Section titled “Tests”](#tests)
```plaintext
npm test # unit tests over mainnet fixtures (pool state, validator list, stake account)
npm run verify:live # reads + simulateTransaction of every shape on mainnet, no keys
```
## License
[Section titled “License”](#license)
Apache-2.0
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels SPL Stake Pool transactions for a wallet’s history, offline and synchronously. A transaction is this module’s when the Stake Pool program `SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy` is among the programs it invoked (`call.programs` / `call.to`). The instruction tag — first byte of the stake-pool instruction’s base58 `call.data` when the source passes it — picks the kind: `DepositSol` 14 / `DepositSolWithSlippage` 25 → `stake` “Staked SOL”; `WithdrawSol` 16 / 26 → `unstake` “Unstaked JitoSOL” (instant); `WithdrawStake` 10 / 24 → `unstake` “Requested unstake of JitoSOL” (delayed). Without data, the pool-token movement decides (minted to the wallet → stake, burned → unstake, with SOL arriving → instant). Pool tokens of every preset (`SPL_STAKE_POOL_ADDRESS_MAP`) and of the instance’s pool are labelled and name the subtitle (`"Jito · Solana"`); an unknown pool on the same program is still recognized as `"SPL Stake Pool · Solana"`. `counterparty` is the pool account. Sweeping a finished delayed unstake (a Stake-program `withdraw` from a derived account) is not recognized — it carries no stake-pool instruction. `own` should contain the wallet **and** its token accounts: sources normalize SPL movements to owners, but a source that keeps token-account addresses still nets correctly when the ATA is in `own`.
Fixtures in `fixtures/activity/` are the test wallet’s funded Jito run (DepositSol ×2, WithdrawSol ×3; 2026-09-07 … 10-07, from `getTransaction` jsonParsed); `negatives/` holds a plain SOL transfer and a plain JitoSOL SPL transfer (shapes only).
## Namespaces
[Section titled “Namespaces”](#namespaces)
* [codec](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/)
## Classes
[Section titled “Classes”](#classes)
* [default](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/default/)
* [StakingProtocol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ClaimWithdrawalsOptions](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
* [ClaimWithdrawalsResult](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)
* [EpochInfo](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/epochinfo/)
* [IStakingProtocol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/)
* [PoolData](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/pooldata/)
* [PoolFee](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
* [Rewards](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rewards/)
* [RpcRequester](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rpcrequester/)
* [SplStakePoolProtocolConfig](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/splstakepoolprotocolconfig/)
* [StakeAccountData](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeaccountdata/)
* [StakedBalance](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)
* [StakeOptions](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
* [StakeParams](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeparams/)
* [StakePoolConfig](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolconfig/)
* [StakePoolState](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
* [StakeResult](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)
* [ValidatorStakeInfo](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/validatorstakeinfo/)
* [WithdrawalRequest](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequest/)
* [WithdrawalRequestOptions](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
* [WithdrawalRequestResult](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)
* [WithdrawalRequestsView](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)
* [WithdrawSource](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawsource/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [StakeActivation](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/stakeactivation/)
* [UnstakeMode](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/unstakemode/)
* [ValidatorStatus](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/validatorstatus/)
## Variables
[Section titled “Variables”](#variables)
* [DEFAULT_COMPUTE_UNIT_LIMIT](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/default_compute_unit_limit/)
* [DEFAULT_COMPUTE_UNIT_PRICE](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/default_compute_unit_price/)
* [DEFAULT_SLIPPAGE_BPS](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/default_slippage_bps/)
* [DEFAULT_UNSTAKE_SLOTS](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/default_unstake_slots/)
* [INSTRUCTION_ACTIONS](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/instruction_actions/)
* [SPL_STAKE_POOL_ADDRESS_MAP](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/variables/spl_stake_pool_address_map/)
## Functions
[Section titled “Functions”](#functions)
* [base58Decode](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/functions/base58decode/)
* [describeStakePoolActivity](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/functions/describestakepoolactivity/)
* [parseDepositSol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/functions/parsedepositsol/)
# default
Defined in: index.d.ts:296
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `SplStakePoolProtocolSolana`
Defined in: index.d.ts:297
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config?
[Section titled “config?”](#config)
[`SplStakePoolProtocolConfig`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/splstakepoolprotocolconfig/)
#### Returns
[Section titled “Returns”](#returns)
`SplStakePoolProtocolSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` **\_account**: `unknown`
Defined in: index.d.ts:229
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#_account)
***
### pool
[Section titled “pool”](#pool)
> `readonly` **pool**: [`StakePoolConfig`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolconfig/)
Defined in: index.d.ts:300
## Methods
[Section titled “Methods”](#methods)
### \_getClaimInstructions()
[Section titled “\_getClaimInstructions()”](#_getclaiminstructions)
> `protected` **\_getClaimInstructions**(`ids?`): `Promise`<{ `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `lamports`: `bigint`; }>
Defined in: index.d.ts:320
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### ids?
[Section titled “ids?”](#ids)
`bigint`\[]
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `lamports`: `bigint`; }>
***
### \_getStakeInstructions()
[Section titled “\_getStakeInstructions()”](#_getstakeinstructions)
> `protected` **\_getStakeInstructions**(`lamports`): `Promise`<{ `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `poolTokens`: `bigint`; }>
Defined in: index.d.ts:318
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `poolTokens`: `bigint`; }>
***
### \_getUnstakeInstructions()
[Section titled “\_getUnstakeInstructions()”](#_getunstakeinstructions)
> `protected` **\_getUnstakeInstructions**(`poolTokens`, `mode`): `Promise`<{ `feeTokens`: `bigint`; `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `lamportsOut`: `bigint`; `source`: [`WithdrawSource`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawsource/) | `null`; `stakeAccount`: `string` | `null`; }>
Defined in: index.d.ts:319
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
##### mode
[Section titled “mode”](#mode)
[`UnstakeMode`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/unstakemode/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<{ `feeTokens`: `bigint`; `instructions`: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]; `lamportsOut`: `bigint`; `source`: [`WithdrawSource`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawsource/) | `null`; `stakeAccount`: `string` | `null`; }>
***
### \_message()
[Section titled “\_message()”](#_message)
> `protected` **\_message**(`instructions`): `object`
Defined in: index.d.ts:316
The message handed to the account: compute budget, then the operation.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### instructions
[Section titled “instructions”](#instructions)
`Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]
#### Returns
[Section titled “Returns”](#returns-4)
`object`
##### instructions
[Section titled “instructions”](#instructions-1)
> **instructions**: `Instruction`<`string`, readonly (`AccountLookupMeta`<`string`, `string`> | `AccountMeta`<`string`>)\[]>\[]
##### version
[Section titled “version”](#version)
> **version**: `0`
***
### \_rpc()
[Section titled “\_rpc()”](#_rpc)
> `protected` **\_rpc**(`method`, `params?`): `Promise`<`any`>
Defined in: index.d.ts:317
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### method
[Section titled “method”](#method)
`string`
##### params?
[Section titled “params?”](#params)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`any`>
***
### awaitConfirmation()
[Section titled “awaitConfirmation()”](#awaitconfirmation)
> **awaitConfirmation**(`hash`, `options?`): `Promise`<`"confirmed"` | `"finalized"`>
Defined in: index.d.ts:309
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### hash
[Section titled “hash”](#hash)
`string`
##### options?
[Section titled “options?”](#options)
###### intervalMs?
[Section titled “intervalMs?”](#intervalms)
`number`
###### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`"confirmed"` | `"finalized"`>
***
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
Defined in: index.d.ts:313
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#claimwithdrawals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: index.d.ts:299
Recognize this module’s transactions for a wallet’s history; null for anything else. Pure and synchronous.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:238
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#getapr)
***
### getEpochInfo()
[Section titled “getEpochInfo()”](#getepochinfo)
> **getEpochInfo**(): `Promise`<[`EpochInfo`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/epochinfo/)>
Defined in: index.d.ts:301
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`EpochInfo`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/epochinfo/)>
***
### getInstantLiquidity()
[Section titled “getInstantLiquidity()”](#getinstantliquidity)
> **getInstantLiquidity**(): `Promise`<`bigint`>
Defined in: index.d.ts:307
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`bigint`>
***
### getNativeBalance()
[Section titled “getNativeBalance()”](#getnativebalance)
> **getNativeBalance**(): `Promise`<`bigint`>
Defined in: index.d.ts:304
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
***
### getPoolData()
[Section titled “getPoolData()”](#getpooldata)
> **getPoolData**(): `Promise`<[`PoolData`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/pooldata/)>
Defined in: index.d.ts:303
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`PoolData`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/pooldata/)>
***
### getRewards()
[Section titled “getRewards()”](#getrewards)
> **getRewards**(`options?`): `Promise`<[`Rewards`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rewards/) | `null`>
Defined in: index.d.ts:308
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
###### limit?
[Section titled “limit?”](#limit)
`number`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`Rewards`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rewards/) | `null`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
Defined in: index.d.ts:237
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#getstakedbalance)
***
### getStakeParams()
[Section titled “getStakeParams()”](#getstakeparams)
> **getStakeParams**(): `Promise`<[`StakeParams`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeparams/)>
Defined in: index.d.ts:302
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`StakeParams`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeparams/)>
***
### getTokenAccount()
[Section titled “getTokenAccount()”](#gettokenaccount)
> **getTokenAccount**(): `Promise`<`string`>
Defined in: index.d.ts:305
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`string`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(): `Promise`<`bigint`>
Defined in: index.d.ts:306
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`bigint`>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:234
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<{ `amount`: `bigint`; `fee`: `bigint`; }>
Defined in: index.d.ts:314
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### options?
[Section titled “options?”](#options-3)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<{ `amount`: `bigint`; `fee`: `bigint`; }>
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<{ `amountOut`: `bigint`; `fee`: `bigint`; `feeTokens`: `bigint`; }>
Defined in: index.d.ts:312
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<{ `amountOut`: `bigint`; `fee`: `bigint`; `feeTokens`: `bigint`; }>
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<{ `amountOut`: `bigint`; `fee`: `bigint`; }>
Defined in: index.d.ts:310
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<{ `amountOut`: `bigint`; `fee`: `bigint`; }>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:311
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### options
[Section titled “options”](#options-6)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#requestwithdrawal)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
Defined in: index.d.ts:230
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-7)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/stakingprotocol/#stake)
# StakingProtocol
Defined in: index.d.ts:227
## Extended by
[Section titled “Extended by”](#extended-by)
* [`default`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/classes/default/)
## Implements
[Section titled “Implements”](#implements)
* [`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StakingProtocol**(`account`): `StakingProtocol`
Defined in: index.d.ts:228
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`StakingProtocol`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` **\_account**: `unknown`
Defined in: index.d.ts:229
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
Defined in: index.d.ts:235
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#claimwithdrawals)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:238
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#getapr)
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
Defined in: index.d.ts:237
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#getstakedbalance)
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:234
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: index.d.ts:236
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: index.d.ts:233
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/), `"hash"`>>
Defined in: index.d.ts:231
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:232
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#requestwithdrawal)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
Defined in: index.d.ts:230
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/istakingprotocol/#stake)
# base58Decode
> **base58Decode**(`s`): `Uint8Array`
Defined in: index.d.ts:248
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# describeStakePoolActivity
> **describeStakePoolActivity**(`tx`, `ctx`, `instance?`): `ActivityItem` | `null`
Defined in: index.d.ts:323
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### instance?
[Section titled “instance?”](#instance)
#### pool?
[Section titled “pool?”](#pool)
[`StakePoolConfig`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolconfig/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# parseDepositSol
> **parseDepositSol**(`tx`, `wallet`, `ata`): { `lamports`: `bigint`; `minted`: `bigint`; } | `null`
Defined in: index.d.ts:247
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
### wallet
[Section titled “wallet”](#wallet)
`string`
### ata
[Section titled “ata”](#ata)
`string`
## Returns
[Section titled “Returns”](#returns)
{ `lamports`: `bigint`; `minted`: `bigint`; } | `null`
# ClaimWithdrawalsOptions
Defined in: index.d.ts:60
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: index.d.ts:62
Slot indexes to claim; default every claimable one.
# ClaimWithdrawalsResult
Defined in: index.d.ts:65
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: index.d.ts:69
Lamports swept back to the account.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:67
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:66
# EpochInfo
Defined in: index.d.ts:172
## Properties
[Section titled “Properties”](#properties)
### endsAt
[Section titled “endsAt”](#endsat)
> **endsAt**: `number`
Defined in: index.d.ts:179
Projected unix-ms of the epoch boundary.
***
### epoch
[Section titled “epoch”](#epoch)
> **epoch**: `bigint`
Defined in: index.d.ts:173
***
### progress
[Section titled “progress”](#progress)
> **progress**: `number`
Defined in: index.d.ts:177
0..1 through the epoch.
***
### slotIndex
[Section titled “slotIndex”](#slotindex)
> **slotIndex**: `number`
Defined in: index.d.ts:174
***
### slotsInEpoch
[Section titled “slotsInEpoch”](#slotsinepoch)
> **slotsInEpoch**: `number`
Defined in: index.d.ts:175
# IStakingProtocol
Defined in: index.d.ts:215
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
Defined in: index.d.ts:221
#### Parameters
[Section titled “Parameters”](#parameters)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/)>
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:224
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`number`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
Defined in: index.d.ts:223
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakedbalance/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:220
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestsview/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: index.d.ts:222
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/claimwithdrawalsresult/), `"hash"`>>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: index.d.ts:219
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/), `"hash"`>>
Defined in: index.d.ts:217
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/), `"hash"`>>
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:218
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequestresult/)>
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
Defined in: index.d.ts:216
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeresult/)>
# PoolData
Defined in: index.d.ts:150
## Properties
[Section titled “Properties”](#properties)
### epoch
[Section titled “epoch”](#epoch)
> **epoch**: `bigint`
Defined in: index.d.ts:153
***
### fees
[Section titled “fees”](#fees)
> **fees**: `object`
Defined in: index.d.ts:169
#### epochPct
[Section titled “epochPct”](#epochpct)
> **epochPct**: `number`
#### solDepositPct
[Section titled “solDepositPct”](#soldepositpct)
> **solDepositPct**: `number`
#### solWithdrawalPct
[Section titled “solWithdrawalPct”](#solwithdrawalpct)
> **solWithdrawalPct**: `number`
#### stakeWithdrawalPct
[Section titled “stakeWithdrawalPct”](#stakewithdrawalpct)
> **stakeWithdrawalPct**: `number`
***
### instantLiquidity
[Section titled “instantLiquidity”](#instantliquidity)
> **instantLiquidity**: `bigint`
Defined in: index.d.ts:164
Reserve minus its rent — what instant exits can pay.
***
### minimumDelegation
[Section titled “minimumDelegation”](#minimumdelegation)
> **minimumDelegation**: `bigint`
Defined in: index.d.ts:166
***
### minimumStakeLamports
[Section titled “minimumStakeLamports”](#minimumstakelamports)
> **minimumStakeLamports**: `bigint`
Defined in: index.d.ts:168
Smallest delayed exit (lamports out) the stake program accepts.
***
### poolTokenSupply
[Section titled “poolTokenSupply”](#pooltokensupply)
> **poolTokenSupply**: `bigint`
Defined in: index.d.ts:161
***
### previousRate
[Section titled “previousRate”](#previousrate)
> **previousRate**: `bigint`
Defined in: index.d.ts:159
The same rate one epoch earlier.
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: index.d.ts:157
Lamports per pool token now, 1e9 fixed point.
***
### rentExempt
[Section titled “rentExempt”](#rentexempt)
> **rentExempt**: `bigint`
Defined in: index.d.ts:165
***
### reserveLamports
[Section titled “reserveLamports”](#reservelamports)
> **reserveLamports**: `bigint`
Defined in: index.d.ts:162
***
### state
[Section titled “state”](#state)
> **state**: [`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
Defined in: index.d.ts:151
***
### totalLamports
[Section titled “totalLamports”](#totallamports)
> **totalLamports**: `bigint`
Defined in: index.d.ts:160
***
### updated
[Section titled “updated”](#updated)
> **updated**: `boolean`
Defined in: index.d.ts:155
Reconciled for the current epoch — deposits and exits go through.
***
### withdrawAuthority
[Section titled “withdrawAuthority”](#withdrawauthority)
> **withdrawAuthority**: `string`
Defined in: index.d.ts:152
# PoolFee
Defined in: index.d.ts:91
## Properties
[Section titled “Properties”](#properties)
### denominator
[Section titled “denominator”](#denominator)
> **denominator**: `bigint`
Defined in: index.d.ts:92
***
### numerator
[Section titled “numerator”](#numerator)
> **numerator**: `bigint`
Defined in: index.d.ts:93
# Rewards
Defined in: index.d.ts:188
## Properties
[Section titled “Properties”](#properties)
### deposited
[Section titled “deposited”](#deposited)
> **deposited**: `bigint`
Defined in: index.d.ts:191
***
### earned
[Section titled “earned”](#earned)
> **earned**: `bigint`
Defined in: index.d.ts:189
***
### entryRate
[Section titled “entryRate”](#entryrate)
> **entryRate**: `bigint`
Defined in: index.d.ts:190
***
### firstStakeAt
[Section titled “firstStakeAt”](#firststakeat)
> **firstStakeAt**: `number` | `null`
Defined in: index.d.ts:194
Unix seconds of the first deposit found, or null.
***
### minted
[Section titled “minted”](#minted)
> **minted**: `bigint`
Defined in: index.d.ts:192
# RpcRequester
Defined in: index.d.ts:197
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`method`, `params?`): `Promise`<`unknown`>
Defined in: index.d.ts:198
#### Parameters
[Section titled “Parameters”](#parameters)
##### method
[Section titled “method”](#method)
`string`
##### params?
[Section titled “params?”](#params)
`unknown`\[]
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# SplStakePoolProtocolConfig
Defined in: index.d.ts:201
## Properties
[Section titled “Properties”](#properties)
### apr?
[Section titled “apr?”](#apr)
> `optional` **apr?**: () => `Promise`<`number`>
Defined in: index.d.ts:212
Provider APY in percent (Jito stats, …); without it getApr estimates from the last two epochs.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`number`>
***
### commitment?
[Section titled “commitment?”](#commitment)
> `optional` **commitment?**: `"processed"` | `"confirmed"` | `"finalized"`
Defined in: index.d.ts:206
***
### computeUnitLimit?
[Section titled “computeUnitLimit?”](#computeunitlimit)
> `optional` **computeUnitLimit?**: `number`
Defined in: index.d.ts:208
***
### computeUnitPrice?
[Section titled “computeUnitPrice?”](#computeunitprice)
> `optional` **computeUnitPrice?**: `number` | `bigint`
Defined in: index.d.ts:209
***
### pool?
[Section titled “pool?”](#pool)
> `optional` **pool?**: `string` | [`StakePoolConfig`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolconfig/)
Defined in: index.d.ts:203
A key of SPL_STAKE_POOL_ADDRESS_MAP (“jito” by default) or an explicit pool.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: `string` | `object` | `string`\[] | [`RpcRequester`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rpcrequester/) | (`string` | `object` | [`RpcRequester`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/rpcrequester/))\[]
Defined in: index.d.ts:205
JSON-RPC URL(s), a @solana/rpc client, or a `{request}` object; default the account’s own RPC.
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: index.d.ts:207
***
### unstakeSlots?
[Section titled “unstakeSlots?”](#unstakeslots)
> `optional` **unstakeSlots?**: `number`
Defined in: index.d.ts:210
# StakeAccountData
Defined in: index.d.ts:135
## Properties
[Section titled “Properties”](#properties)
### delegation
[Section titled “delegation”](#delegation)
> **delegation**: { `activationEpoch`: `bigint`; `deactivationEpoch`: `bigint`; `stake`: `bigint`; `voter`: `Address`; } | `null`
Defined in: index.d.ts:140
***
### rentExemptReserve
[Section titled “rentExemptReserve”](#rentexemptreserve)
> **rentExemptReserve**: `bigint`
Defined in: index.d.ts:137
***
### staker
[Section titled “staker”](#staker)
> **staker**: `Address` | `null`
Defined in: index.d.ts:138
***
### state
[Section titled “state”](#state)
> **state**: `"uninitialized"` | `"initialized"` | `"stake"` | `"rewardsPool"`
Defined in: index.d.ts:136
***
### withdrawer
[Section titled “withdrawer”](#withdrawer)
> **withdrawer**: `Address` | `null`
Defined in: index.d.ts:139
# StakedBalance
Defined in: index.d.ts:72
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: index.d.ts:74
Pool tokens held (base units).
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: index.d.ts:78
Lamports per pool token, 1e9 fixed point.
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: index.d.ts:80
The position valued in lamports.
***
### wrappedBalance
[Section titled “wrappedBalance”](#wrappedbalance)
> **wrappedBalance**: `bigint`
Defined in: index.d.ts:76
Always 0n.
# StakeOptions
Defined in: index.d.ts:5
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: index.d.ts:7
SOL to deposit, in lamports.
# StakeParams
Defined in: index.d.ts:182
## Properties
[Section titled “Properties”](#properties)
### minimumDelegation
[Section titled “minimumDelegation”](#minimumdelegation)
> **minimumDelegation**: `bigint`
Defined in: index.d.ts:184
***
### minimumStakeLamports
[Section titled “minimumStakeLamports”](#minimumstakelamports)
> **minimumStakeLamports**: `bigint`
Defined in: index.d.ts:185
***
### rentExempt
[Section titled “rentExempt”](#rentexempt)
> **rentExempt**: `bigint`
Defined in: index.d.ts:183
# StakePoolConfig
Defined in: index.d.ts:83
## Properties
[Section titled “Properties”](#properties)
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: index.d.ts:87
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: index.d.ts:85
Short name; lower-cased into the seed of the wallet’s unstake accounts.
***
### pool
[Section titled “pool”](#pool)
> **pool**: `string`
Defined in: index.d.ts:86
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: index.d.ts:88
# StakePoolState
Defined in: index.d.ts:96
## Properties
[Section titled “Properties”](#properties)
### epochFee
[Section titled “epochFee”](#epochfee)
> **epochFee**: [`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
Defined in: index.d.ts:108
***
### lastEpochPoolTokenSupply
[Section titled “lastEpochPoolTokenSupply”](#lastepochpooltokensupply)
> **lastEpochPoolTokenSupply**: `bigint`
Defined in: index.d.ts:119
***
### lastEpochTotalLamports
[Section titled “lastEpochTotalLamports”](#lastepochtotallamports)
> **lastEpochTotalLamports**: `bigint`
Defined in: index.d.ts:120
***
### lastUpdateEpoch
[Section titled “lastUpdateEpoch”](#lastupdateepoch)
> **lastUpdateEpoch**: `bigint`
Defined in: index.d.ts:107
***
### manager
[Section titled “manager”](#manager)
> **manager**: `Address`
Defined in: index.d.ts:97
***
### managerFeeAccount
[Section titled “managerFeeAccount”](#managerfeeaccount)
> **managerFeeAccount**: `Address`
Defined in: index.d.ts:103
***
### poolMint
[Section titled “poolMint”](#poolmint)
> **poolMint**: `Address`
Defined in: index.d.ts:102
***
### poolTokenSupply
[Section titled “poolTokenSupply”](#pooltokensupply)
> **poolTokenSupply**: `bigint`
Defined in: index.d.ts:106
***
### preferredDepositValidator
[Section titled “preferredDepositValidator”](#preferreddepositvalidator)
> **preferredDepositValidator**: `Address` | `null`
Defined in: index.d.ts:109
***
### preferredWithdrawValidator
[Section titled “preferredWithdrawValidator”](#preferredwithdrawvalidator)
> **preferredWithdrawValidator**: `Address` | `null`
Defined in: index.d.ts:110
***
### reserveStake
[Section titled “reserveStake”](#reservestake)
> **reserveStake**: `Address`
Defined in: index.d.ts:101
***
### solDepositAuthority
[Section titled “solDepositAuthority”](#soldepositauthority)
> **solDepositAuthority**: `Address` | `null`
Defined in: index.d.ts:114
***
### solDepositFee
[Section titled “solDepositFee”](#soldepositfee)
> **solDepositFee**: [`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
Defined in: index.d.ts:115
***
### solReferralFee
[Section titled “solReferralFee”](#solreferralfee)
> **solReferralFee**: `number`
Defined in: index.d.ts:116
***
### solWithdrawalFee
[Section titled “solWithdrawalFee”](#solwithdrawalfee)
> **solWithdrawalFee**: [`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
Defined in: index.d.ts:118
***
### solWithdrawAuthority
[Section titled “solWithdrawAuthority”](#solwithdrawauthority)
> **solWithdrawAuthority**: `Address` | `null`
Defined in: index.d.ts:117
***
### stakeDepositAuthority
[Section titled “stakeDepositAuthority”](#stakedepositauthority)
> **stakeDepositAuthority**: `Address`
Defined in: index.d.ts:99
***
### stakeDepositFee
[Section titled “stakeDepositFee”](#stakedepositfee)
> **stakeDepositFee**: [`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
Defined in: index.d.ts:111
***
### staker
[Section titled “staker”](#staker)
> **staker**: `Address`
Defined in: index.d.ts:98
***
### stakeReferralFee
[Section titled “stakeReferralFee”](#stakereferralfee)
> **stakeReferralFee**: `number`
Defined in: index.d.ts:113
***
### stakeWithdrawalFee
[Section titled “stakeWithdrawalFee”](#stakewithdrawalfee)
> **stakeWithdrawalFee**: [`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
Defined in: index.d.ts:112
***
### tokenProgram
[Section titled “tokenProgram”](#tokenprogram)
> **tokenProgram**: `Address`
Defined in: index.d.ts:104
***
### totalLamports
[Section titled “totalLamports”](#totallamports)
> **totalLamports**: `bigint`
Defined in: index.d.ts:105
***
### validatorList
[Section titled “validatorList”](#validatorlist)
> **validatorList**: `Address`
Defined in: index.d.ts:100
# StakeResult
Defined in: index.d.ts:10
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:12
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:11
# ValidatorStakeInfo
Defined in: index.d.ts:125
## Properties
[Section titled “Properties”](#properties)
### activeStakeLamports
[Section titled “activeStakeLamports”](#activestakelamports)
> **activeStakeLamports**: `bigint`
Defined in: index.d.ts:126
***
### lastUpdateEpoch
[Section titled “lastUpdateEpoch”](#lastupdateepoch)
> **lastUpdateEpoch**: `bigint`
Defined in: index.d.ts:128
***
### status
[Section titled “status”](#status)
> **status**: [`ValidatorStatus`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/validatorstatus/)
Defined in: index.d.ts:131
***
### transientSeedSuffix
[Section titled “transientSeedSuffix”](#transientseedsuffix)
> **transientSeedSuffix**: `bigint`
Defined in: index.d.ts:129
***
### transientStakeLamports
[Section titled “transientStakeLamports”](#transientstakelamports)
> **transientStakeLamports**: `bigint`
Defined in: index.d.ts:127
***
### validatorSeedSuffix
[Section titled “validatorSeedSuffix”](#validatorseedsuffix)
> **validatorSeedSuffix**: `number`
Defined in: index.d.ts:130
***
### voteAccount
[Section titled “voteAccount”](#voteaccount)
> **voteAccount**: `Address`
Defined in: index.d.ts:132
# WithdrawalRequest
Defined in: index.d.ts:39
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: index.d.ts:48
***
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: index.d.ts:43
Lamports the stake account holds (rent included — all of it returns on claim).
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: index.d.ts:47
True once the stake account is fully inactive.
***
### deactivationEpoch
[Section titled “deactivationEpoch”](#deactivationepoch)
> **deactivationEpoch**: `bigint` | `null`
Defined in: index.d.ts:50
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: index.d.ts:41
The unstake slot index.
***
### status
[Section titled “status”](#status)
> **status**: [`StakeActivation`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/stakeactivation/)
Defined in: index.d.ts:49
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: index.d.ts:45
Not knowable from state alone; always 0.
# WithdrawalRequestOptions
Defined in: index.d.ts:17
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: index.d.ts:19
Pool tokens to burn, in base units (9 decimals).
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: [`UnstakeMode`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/unstakemode/)
Defined in: index.d.ts:23
Exit path — default “delayed”.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: index.d.ts:21
Accepted for interface parity; the pool token is the only staked form.
# WithdrawalRequestResult
Defined in: index.d.ts:26
## Properties
[Section titled “Properties”](#properties)
### amountOut
[Section titled “amountOut”](#amountout)
> **amountOut**: `bigint`
Defined in: index.d.ts:32
Lamports the exit yields after the pool fee (paid now for instant, into the stake account for delayed).
***
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `null`
Defined in: index.d.ts:30
Always null — a burn needs no approval.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:28
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:27
***
### stakeAccount
[Section titled “stakeAccount”](#stakeaccount)
> **stakeAccount**: `string` | `null`
Defined in: index.d.ts:34
The seed-derived stake account (delayed mode), else null.
# WithdrawalRequestsView
Defined in: index.d.ts:53
## Properties
[Section titled “Properties”](#properties)
### claimableAmount
[Section titled “claimableAmount”](#claimableamount)
> **claimableAmount**: `bigint`
Defined in: index.d.ts:56
***
### claimableIds
[Section titled “claimableIds”](#claimableids)
> **claimableIds**: `bigint`\[]
Defined in: index.d.ts:57
***
### pendingAmount
[Section titled “pendingAmount”](#pendingamount)
> **pendingAmount**: `bigint`
Defined in: index.d.ts:55
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawalrequest/)\[]
Defined in: index.d.ts:54
# WithdrawSource
Defined in: index.d.ts:143
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `Address`
Defined in: index.d.ts:145
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"validator"` | `"reserve"`
Defined in: index.d.ts:144
***
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
Defined in: index.d.ts:147
***
### voteAccount
[Section titled “voteAccount”](#voteaccount)
> **voteAccount**: `Address` | `null`
Defined in: index.d.ts:146
# codec
Pure SPL Stake Pool mechanics: decoders, arithmetic, PDAs and instruction encoders.
## Variables
[Section titled “Variables”](#variables)
* [ATA_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/ata_program/)
* [COMPUTE_BUDGET_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/compute_budget_program/)
* [POOL_MINIMUM_ACTIVE_STAKE](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/pool_minimum_active_stake/)
* [STAKE_ACCOUNT_SPACE](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/stake_account_space/)
* [STAKE_POOL_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/stake_pool_program/)
* [STAKE_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/stake_program/)
* [SYSTEM_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/system_program/)
* [SYSVAR_CLOCK](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/sysvar_clock/)
* [SYSVAR_STAKE_HISTORY](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/sysvar_stake_history/)
* [TOKEN_PROGRAM](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/variables/token_program/)
## Functions
[Section titled “Functions”](#functions)
* [addressToBytes](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/addresstobytes/)
* [applyFee](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/applyfee/)
* [bytesToAddress](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/bytestoaddress/)
* [decodeStakeAccount](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/decodestakeaccount/)
* [decodeStakePool](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/decodestakepool/)
* [decodeValidatorList](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/decodevalidatorlist/)
* [feePercent](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/feepercent/)
* [findAta](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/findata/)
* [findUnstakeAccount](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/findunstakeaccount/)
* [findValidatorStakeAccount](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/findvalidatorstakeaccount/)
* [findWithdrawAuthority](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/findwithdrawauthority/)
* [ixCreateAccountWithSeed](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixcreateaccountwithseed/)
* [ixCreateAtaIdempotent](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixcreateataidempotent/)
* [ixDepositSol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixdepositsol/)
* [ixSetComputeUnitLimit](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixsetcomputeunitlimit/)
* [ixSetComputeUnitPrice](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixsetcomputeunitprice/)
* [ixStakeDeactivate](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixstakedeactivate/)
* [ixStakeWithdraw](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixstakewithdraw/)
* [ixTransferWithSeed](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixtransferwithseed/)
* [ixWithdrawSol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixwithdrawsol/)
* [ixWithdrawStake](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/ixwithdrawstake/)
* [lamportsForPoolTokens](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/lamportsforpooltokens/)
* [minimumStakeLamports](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/minimumstakelamports/)
* [poolRate](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/poolrate/)
* [poolTokensForLamports](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/pooltokensforlamports/)
* [quoteDepositSol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/quotedepositsol/)
* [quoteWithdrawSol](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/quotewithdrawsol/)
* [quoteWithdrawStake](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/quotewithdrawstake/)
* [selectWithdrawSource](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/selectwithdrawsource/)
* [stakeActivation](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/stakeactivation/)
* [unstakeSeed](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/namespaces/codec/functions/unstakeseed/)
# addressToBytes
> **addressToBytes**(`address`): `Uint8Array`
Defined in: index.d.ts:262
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# applyFee
> **applyFee**(`fee`, `amount`): `bigint`
Defined in: index.d.ts:264
## Parameters
[Section titled “Parameters”](#parameters)
### fee
[Section titled “fee”](#fee)
[`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# bytesToAddress
> **bytesToAddress**(`bytes`): `Address`
Defined in: index.d.ts:263
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Address`
# decodeStakeAccount
> **decodeStakeAccount**(`data`): [`StakeAccountData`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeaccountdata/)
Defined in: index.d.ts:268
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`StakeAccountData`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeaccountdata/)
# decodeStakePool
> **decodeStakePool**(`data`): [`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
Defined in: index.d.ts:266
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
# decodeValidatorList
> **decodeValidatorList**(`data`): `object`
Defined in: index.d.ts:267
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`object`
### maxValidators
[Section titled “maxValidators”](#maxvalidators)
> **maxValidators**: `number`
### validators
[Section titled “validators”](#validators)
> **validators**: [`ValidatorStakeInfo`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/validatorstakeinfo/)\[]
# feePercent
> **feePercent**(`fee`): `number`
Defined in: index.d.ts:265
## Parameters
[Section titled “Parameters”](#parameters)
### fee
[Section titled “fee”](#fee)
[`PoolFee`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/poolfee/)
## Returns
[Section titled “Returns”](#returns)
`number`
# findAta
> **findAta**(`owner`, `mint`): `Promise`<`Address`>
Defined in: index.d.ts:279
## Parameters
[Section titled “Parameters”](#parameters)
### owner
[Section titled “owner”](#owner)
`string`
### mint
[Section titled “mint”](#mint)
`string`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Address`>
# findUnstakeAccount
> **findUnstakeAccount**(`wallet`, `poolName`, `index`): `Promise`<`Address`>
Defined in: index.d.ts:281
## Parameters
[Section titled “Parameters”](#parameters)
### wallet
[Section titled “wallet”](#wallet)
`string`
### poolName
[Section titled “poolName”](#poolname)
`string`
### index
[Section titled “index”](#index)
`number`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Address`>
# findValidatorStakeAccount
> **findValidatorStakeAccount**(`pool`, `voteAccount`, `seedSuffix`): `Promise`<`Address`>
Defined in: index.d.ts:278
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
`string`
### voteAccount
[Section titled “voteAccount”](#voteaccount)
`string`
### seedSuffix
[Section titled “seedSuffix”](#seedsuffix)
`number`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Address`>
# findWithdrawAuthority
> **findWithdrawAuthority**(`pool`): `Promise`<`Address`>
Defined in: index.d.ts:277
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
`string`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Address`>
# ixCreateAccountWithSeed
> **ixCreateAccountWithSeed**(`p`): `Instruction`
Defined in: index.d.ts:288
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### base
[Section titled “base”](#base)
`string`
#### from
[Section titled “from”](#from)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### newAccount
[Section titled “newAccount”](#newaccount)
`string`
#### owner
[Section titled “owner”](#owner)
`string`
#### seed
[Section titled “seed”](#seed)
`string`
#### space
[Section titled “space”](#space)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixCreateAtaIdempotent
> **ixCreateAtaIdempotent**(`p`): `Instruction`
Defined in: index.d.ts:284
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### ata
[Section titled “ata”](#ata)
`string`
#### mint
[Section titled “mint”](#mint)
`string`
#### owner
[Section titled “owner”](#owner)
`string`
#### payer
[Section titled “payer”](#payer)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixDepositSol
> **ixDepositSol**(`p`): `Instruction`
Defined in: index.d.ts:285
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### destination
[Section titled “destination”](#destination)
`string`
#### from
[Section titled “from”](#from)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### minimumPoolTokensOut?
[Section titled “minimumPoolTokensOut?”](#minimumpooltokensout)
`bigint`
#### pool
[Section titled “pool”](#pool)
`string`
#### state
[Section titled “state”](#state)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
#### withdrawAuthority
[Section titled “withdrawAuthority”](#withdrawauthority)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixSetComputeUnitLimit
> **ixSetComputeUnitLimit**(`units`): `Instruction`
Defined in: index.d.ts:282
## Parameters
[Section titled “Parameters”](#parameters)
### units
[Section titled “units”](#units)
`number`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixSetComputeUnitPrice
> **ixSetComputeUnitPrice**(`microLamports`): `Instruction`
Defined in: index.d.ts:283
## Parameters
[Section titled “Parameters”](#parameters)
### microLamports
[Section titled “microLamports”](#microlamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixStakeDeactivate
> **ixStakeDeactivate**(`p`): `Instruction`
Defined in: index.d.ts:291
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixStakeWithdraw
> **ixStakeWithdraw**(`p`): `Instruction`
Defined in: index.d.ts:292
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### authority
[Section titled “authority”](#authority)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### recipient
[Section titled “recipient”](#recipient)
`string`
#### stake
[Section titled “stake”](#stake)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixTransferWithSeed
> **ixTransferWithSeed**(`p`): `Instruction`
Defined in: index.d.ts:290
System TransferWithSeed (11): lamports out of a System-owned, data-less seed account; `fromOwner` is the program its address was derived with.
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### base
[Section titled “base”](#base)
`string`
#### from
[Section titled “from”](#from)
`string`
#### fromOwner
[Section titled “fromOwner”](#fromowner)
`string`
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### seed
[Section titled “seed”](#seed)
`string`
#### to
[Section titled “to”](#to)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixWithdrawSol
> **ixWithdrawSol**(`p`): `Instruction`
Defined in: index.d.ts:286
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### minimumLamportsOut?
[Section titled “minimumLamportsOut?”](#minimumlamportsout)
`bigint`
#### owner
[Section titled “owner”](#owner)
`string`
#### pool
[Section titled “pool”](#pool)
`string`
#### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
#### source
[Section titled “source”](#source)
`string`
#### state
[Section titled “state”](#state)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
#### withdrawAuthority
[Section titled “withdrawAuthority”](#withdrawauthority)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# ixWithdrawStake
> **ixWithdrawStake**(`p`): `Instruction`
Defined in: index.d.ts:287
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### minimumLamportsOut?
[Section titled “minimumLamportsOut?”](#minimumlamportsout)
`bigint`
#### owner
[Section titled “owner”](#owner)
`string`
#### pool
[Section titled “pool”](#pool)
`string`
#### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
#### source
[Section titled “source”](#source)
`string`
#### splitFrom
[Section titled “splitFrom”](#splitfrom)
`string`
#### splitTo
[Section titled “splitTo”](#splitto)
`string`
#### state
[Section titled “state”](#state)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
#### withdrawAuthority
[Section titled “withdrawAuthority”](#withdrawauthority)
`string`
## Returns
[Section titled “Returns”](#returns)
`Instruction`
# lamportsForPoolTokens
> **lamportsForPoolTokens**(`pool`, `poolTokens`): `bigint`
Defined in: index.d.ts:271
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
#### poolTokenSupply
[Section titled “poolTokenSupply”](#pooltokensupply)
`bigint`
#### totalLamports
[Section titled “totalLamports”](#totallamports)
`bigint`
### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# minimumStakeLamports
> **minimumStakeLamports**(`rentExempt`, `minimumDelegation`): `bigint`
Defined in: index.d.ts:276
## Parameters
[Section titled “Parameters”](#parameters)
### rentExempt
[Section titled “rentExempt”](#rentexempt)
`bigint`
### minimumDelegation
[Section titled “minimumDelegation”](#minimumdelegation)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# poolRate
> **poolRate**(`pool`): `bigint`
Defined in: index.d.ts:272
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
#### poolTokenSupply
[Section titled “poolTokenSupply”](#pooltokensupply)
`bigint`
#### totalLamports
[Section titled “totalLamports”](#totallamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# poolTokensForLamports
> **poolTokensForLamports**(`pool`, `lamports`): `bigint`
Defined in: index.d.ts:270
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
#### poolTokenSupply
[Section titled “poolTokenSupply”](#pooltokensupply)
`bigint`
#### totalLamports
[Section titled “totalLamports”](#totallamports)
`bigint`
### lamports
[Section titled “lamports”](#lamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# quoteDepositSol
> **quoteDepositSol**(`pool`, `lamports`): `object`
Defined in: index.d.ts:273
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
### lamports
[Section titled “lamports”](#lamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`object`
### feeTokens
[Section titled “feeTokens”](#feetokens)
> **feeTokens**: `bigint`
### poolTokens
[Section titled “poolTokens”](#pooltokens)
> **poolTokens**: `bigint`
# quoteWithdrawSol
> **quoteWithdrawSol**(`pool`, `poolTokens`): `object`
Defined in: index.d.ts:274
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`object`
### burnt
[Section titled “burnt”](#burnt)
> **burnt**: `bigint`
### feeTokens
[Section titled “feeTokens”](#feetokens)
> **feeTokens**: `bigint`
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
# quoteWithdrawStake
> **quoteWithdrawStake**(`pool`, `poolTokens`): `object`
Defined in: index.d.ts:275
## Parameters
[Section titled “Parameters”](#parameters)
### pool
[Section titled “pool”](#pool)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
### poolTokens
[Section titled “poolTokens”](#pooltokens)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`object`
### burnt
[Section titled “burnt”](#burnt)
> **burnt**: `bigint`
### feeTokens
[Section titled “feeTokens”](#feetokens)
> **feeTokens**: `bigint`
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
# selectWithdrawSource
> **selectWithdrawSource**(`p`): `Promise`<[`WithdrawSource`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawsource/)>
Defined in: index.d.ts:293
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
#### lamports
[Section titled “lamports”](#lamports)
`bigint`
#### minimumDelegation
[Section titled “minimumDelegation”](#minimumdelegation)
`bigint`
#### pool
[Section titled “pool”](#pool)
`string`
#### rentExempt
[Section titled “rentExempt”](#rentexempt)
`bigint`
#### reserveLamports
[Section titled “reserveLamports”](#reservelamports)
`bigint`
#### state
[Section titled “state”](#state)
[`StakePoolState`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolstate/)
#### validators
[Section titled “validators”](#validators)
[`ValidatorStakeInfo`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/validatorstakeinfo/)\[]
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`WithdrawSource`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/withdrawsource/)>
# stakeActivation
> **stakeActivation**(`account`, `epoch`): [`StakeActivation`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/stakeactivation/)
Defined in: index.d.ts:269
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
[`StakeAccountData`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakeaccountdata/)
### epoch
[Section titled “epoch”](#epoch)
`bigint`
## Returns
[Section titled “Returns”](#returns)
[`StakeActivation`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/type-aliases/stakeactivation/)
# unstakeSeed
> **unstakeSeed**(`poolName`, `index`): `string`
Defined in: index.d.ts:280
## Parameters
[Section titled “Parameters”](#parameters)
### poolName
[Section titled “poolName”](#poolname)
`string`
### index
[Section titled “index”](#index)
`number`
## Returns
[Section titled “Returns”](#returns)
`string`
# ATA_PROGRAM
> `const` **ATA_PROGRAM**: `Address`
Defined in: index.d.ts:256
# COMPUTE_BUDGET_PROGRAM
> `const` **COMPUTE_BUDGET_PROGRAM**: `Address`
Defined in: index.d.ts:257
# POOL_MINIMUM_ACTIVE_STAKE
> `const` **POOL_MINIMUM_ACTIVE_STAKE**: `bigint`
Defined in: index.d.ts:261
# STAKE_ACCOUNT_SPACE
> `const` **STAKE_ACCOUNT_SPACE**: `number`
Defined in: index.d.ts:260
# STAKE_POOL_PROGRAM
> `const` **STAKE_POOL_PROGRAM**: `Address`
Defined in: index.d.ts:252
# STAKE_PROGRAM
> `const` **STAKE_PROGRAM**: `Address`
Defined in: index.d.ts:253
# SYSTEM_PROGRAM
> `const` **SYSTEM_PROGRAM**: `Address`
Defined in: index.d.ts:254
# SYSVAR_CLOCK
> `const` **SYSVAR_CLOCK**: `Address`
Defined in: index.d.ts:258
# SYSVAR_STAKE_HISTORY
> `const` **SYSVAR_STAKE_HISTORY**: `Address`
Defined in: index.d.ts:259
# TOKEN_PROGRAM
> `const` **TOKEN_PROGRAM**: `Address`
Defined in: index.d.ts:255
# StakeActivation
> **StakeActivation** = `"inactive"` | `"activating"` | `"active"` | `"deactivating"`
Defined in: index.d.ts:37
# UnstakeMode
> **UnstakeMode** = `"instant"` | `"delayed"`
Defined in: index.d.ts:15
# ValidatorStatus
> **ValidatorStatus** = `"active"` | `"deactivatingTransient"` | `"readyForRemoval"` | `"deactivatingValidator"` | `"deactivatingAll"`
Defined in: index.d.ts:123
# DEFAULT_COMPUTE_UNIT_LIMIT
> `const` **DEFAULT_COMPUTE_UNIT_LIMIT**: `number`
Defined in: index.d.ts:242
# DEFAULT_COMPUTE_UNIT_PRICE
> `const` **DEFAULT_COMPUTE_UNIT_PRICE**: `bigint`
Defined in: index.d.ts:243
# DEFAULT_SLIPPAGE_BPS
> `const` **DEFAULT_SLIPPAGE_BPS**: `number`
Defined in: index.d.ts:244
# DEFAULT_UNSTAKE_SLOTS
> `const` **DEFAULT_UNSTAKE_SLOTS**: `number`
Defined in: index.d.ts:245
# INSTRUCTION_ACTIONS
> `const` **INSTRUCTION_ACTIONS**: `Readonly`<`Record`<`number`, { `kind`: `ActivityItem`\[`"kind"`]; `mode`: `"deposit"` | `"instant"` | `"delayed"`; `verb`: `string`; }>>
Defined in: index.d.ts:324
# SPL_STAKE_POOL_ADDRESS_MAP
> `const` **SPL_STAKE_POOL_ADDRESS_MAP**: `Record`<`string`, [`StakePoolConfig`](/api/anywalletkit/protocol-staking-spl-stake-pool-solana/interfaces/stakepoolconfig/)>
Defined in: index.d.ts:241
# @anywalletkit/protocol-staking-ssv-evm
# @anywalletkit/protocol-staking-ssv-evm
[Section titled “@anywalletkit/protocol-staking-ssv-evm”](#anywalletkitprotocol-staking-ssv-evm)
[](https://www.npmjs.com/package/@anywalletkit/protocol-staking-ssv-evm)
A simple package that lets `@anywalletkit/wallet-evm` wallet accounts stake through [SSV Network](https://ssv.network): stake SSV → cSSV, claim the ETH rewards, exit through the network’s cooldown, and read APR and network stats.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-staking-ssv-evm @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-staking-ssv-evm @anywalletkit/core · yarn add @anywalletkit/protocol-staking-ssv-evm @anywalletkit/core
```
On npm: [@anywalletkit/protocol-staking-ssv-evm](https://www.npmjs.com/package/@anywalletkit/protocol-staking-ssv-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Built as the **second implementation of the `StakingProtocol` type** in `@anywalletkit/core` (the first is `@anywalletkit/protocol-staking-lido-evm`). The base class lives in `@anywalletkit/core` (`src/staking-protocol.ts` here keeps the runtime `IStakingProtocol` marker and the module’s own types). A token-staking protocol with a cooldown exit fitting it unchanged is the point: the interface is not Lido-shaped.
The mechanics are extracted from a production wallet (React Native/Hermes) where every flow is exercised with real funds.
## What SSV Network and the SSV token are
[Section titled “What SSV Network and the SSV token are”](#what-ssv-network-and-the-ssv-token-are)
[SSV Network](https://ssv.network) is distributed validator technology (DVT) for Ethereum: a validator’s key is split among several independent operators, so staking keeps running when any one of them is down or misbehaves. A large share of Ethereum liquid staking runs its validators on it. Operators pay the network’s fees in ETH.
**SSV** is the network’s ERC-20 token. Since SSV Network v2 (mainnet, 2026) SSV holders can stake it: the network mints **cSSV** 1:1 — a transferable, non-rebasing receipt token — and cSSV holders receive a pro-rata share of the ETH fees, accrued block by block through an ETH-per-share index and claimable at any time without unstaking. Staked weight also delegates voting power to the network’s Effective Balance oracles. Getting the SSV back is a cooldown exit: `requestUnstake` burns cSSV into a cooldown entry (7 days at launch, DAO-tunable, not cancellable), `withdrawUnlocked` pays out every entry whose cooldown has ended. There is no slashing for stakers. The APR is ETH-denominated on an SSV-denominated stake, so it moves with SSV’s price.
## Usage
[Section titled “Usage”](#usage)
```js
import WalletManagerEvm from '@anywalletkit/wallet-evm'
import SsvProtocolEvm from '@anywalletkit/protocol-staking-ssv-evm'
const wallet = new WalletManagerEvm(seed, { provider: 'https://rpc.example.org' })
const account = await wallet.getAccount(0)
const ssv = new SsvProtocolEvm(account)
// Stake — approve (awaited) + stake on the first go, one transaction after
const { hash, fee, approveHash } = await ssv.stake({ amount: 10n ** 18n })
// Rewards accrue in ETH; claim any time, the stake stays put
await ssv.getClaimableRewards() // wei
await ssv.claimRewards()
// Exit, phase 1: burn cSSV into a cooldown entry (irreversible)
await ssv.requestWithdrawal({ amount: 10n ** 18n })
// …after the cooldown — exit, phase 2: withdraw every unlocked entry as SSV
const { claimableIds } = await ssv.getWithdrawalRequests()
if (claimableIds.length) await ssv.claimWithdrawals()
// Views
await ssv.getStakedBalance() // { balance: cSSV, wrappedBalance: 0n, rate: 1e18, total }
await ssv.getApr() // 23.8 (percent, from SSV Network's API)
```
SSV-specific extras beyond the interface:
```js
await ssv.getTokenBalance() // liquid SSV on the account
await ssv.getClaimableRewards() // accrued ETH (wei)
await ssv.claimRewards() // claimEthRewards()
await ssv.getCooldown() // seconds — read it, never hardcode 7 days
await ssv.getNetworkStats() // { totalStaked, rewardsPool, accEthPerShare }
await ssv.getAprHistory({ limit: 7 })// daily samples with SSV/ETH prices
```
## How it maps onto the interface
[Section titled “How it maps onto the interface”](#how-it-maps-onto-the-interface)
| `IStakingProtocol` | SSV Network |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `stake({ amount })` | allowance check → `approve` (awaited to a mined receipt) → `stake` on the SSVNetwork proxy; cSSV minted 1:1 |
| `requestWithdrawal({ amount })` | `requestUnstake` — burns cSSV into a cooldown entry; `token` ignored (single staked form) |
| `getWithdrawalRequests()` | `pendingUnstake` → entries with `id` = position, `unlockTime`, `claimable = unlockTime <= now`; amounts are **SSV** |
| `claimWithdrawals()` | `withdrawUnlocked` — pays **every** unlocked entry; `ids` are informational |
| `getStakedBalance()` | cSSV balance, `wrappedBalance` 0, `rate` 1e18 |
| `getApr()` | `api.ssv.network/…/apr/current` — the number stake.ssv.network shows |
Two honest differences from Lido are documented on the methods rather than papered over: the exit pays the staked token (SSV), not the chain’s native token, and the withdraw call is all-or-nothing on the network side.
## Why the write path looks the way it does
[Section titled “Why the write path looks the way it does”](#why-the-write-path-looks-the-way-it-does)
* **No permit anywhere**: neither SSV nor cSSV implements EIP-2612 (checked: `nonces` / `DOMAIN_SEPARATOR` revert on both). The first stake is therefore approve + stake; the approval is **awaited to a mined receipt** because `stake`’s gas estimate reverts against an unmined allowance. With a standing allowance it is one transaction.
* **Proven before broadcast**: every write is simulated with `eth_call` from the account first. The staking module reverts with bare custom errors — `StakeTooLow`, `UnstakeAmountExceedsBalance`, `NothingToWithdraw`, `NothingToClaim`, `InsufficientBalance`… — and `describeRevert` turns the 4-byte selector back into a named error, wherever the provider (viem) buried it (`error.data`, `info.error.data`, `cause`, or the message text). A user sees “no unstake request has finished its cooldown yet”, not “execution reverted”, and pays no gas for it.
* **Claim rounding**: `claimEthRewards` pays `accrued − accrued % 100000 wei` and reverts when that is zero; `claimRewards` checks `previewClaimableEth` against `ETH_CLAIM_UNIT` up front.
* **Unstable ids**: cooldown entries are addressed by position and `withdrawUnlocked` compacts the list — re-read `getWithdrawalRequests` after every write; nothing here caches ids.
* **Structural account checks**: writability is `typeof account.sendTransaction === 'function'`, not `instanceof`.
* **No `AbortSignal.timeout` / `AbortSignal.any`**: Hermes ships `AbortController` without those statics; nothing here depends on them.
* **REST is decoration**: APR and APR history come from the same API stake.ssv.network reads (CORS `*`), overridable via `config.endpoints`; the on-chain flows never depend on them, and `getAprHistory` degrades to an empty array.
## Configuration
[Section titled “Configuration”](#configuration)
```js
new SsvProtocolEvm(account, {
provider, // RPC url or EIP-1193; defaults to the account's provider
chainId, // default 1; other chains must supply addresses
addresses, // { network, views, ssvToken, cssvToken }
endpoints // { apr, aprHistory }
})
```
Only mainnet ships as a default deployment — deliberately. The Hoodi testnet addresses are listed in `src/ssv-address-map.ts` for explicit configuration, so nobody stakes against an address a default quietly supplied.
Mainnet contracts (verified on-chain against the live proxy, v2.0.0): SSVNetwork `0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1`, SSVNetworkViews `0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4`, SSV `0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54`, cSSV `0xe018D31F120A637828F46aFD6c64EC099d960546`.
## Tests
[Section titled “Tests”](#tests)
```plaintext
pnpm build # TypeScript → dist/ (tsup: ESM + CJS + d.ts); built on viem
pnpm test # offline unit tests (vitest, stubbed EIP-1193 provider) + conformance
pnpm verify:live # read-only checks against mainnet (views, API, eth_call proofs; needs a build)
```
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels SSV staking transactions for a wallet’s history, offline and synchronously. A transaction is SSV’s when it calls the `network` proxy the instance is configured with (mainnet by default) on that chain and the selector is `stake` → `stake` “Staked SSV”, `requestUnstake` → `unstake` “Requested unstake”, `withdrawUnlocked` → `claim` “Withdrew SSV”, `claimEthRewards` → `claim` “Claimed ETH rewards” (`SSV_ACTIONS`, selectors computed from the signatures at module load). Operator / cluster management calls on the same proxy, SSV `approve`s and anything else yield null. Subtitle `"SSV Network · Ethereum"`, `counterparty` the proxy; `assetsIn` / `assetsOut` are the wallet’s net movements (SSV, cSSV, ETH rewards) labelled by the module.
Fixtures in `fixtures/activity/` are the test wallet’s funded run (stake, requestUnstake ×2, withdrawUnlocked, claimEthRewards; 2026-09-03 … 10-07); `negatives/` holds a Lido submit and a USDT approve.
## Classes
[Section titled “Classes”](#classes)
* [default](/api/anywalletkit/protocol-staking-ssv-evm/classes/default/)
* [IStakingProtocol](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/)
* [StakingProtocol](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AprSample](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/aprsample/)
* [ClaimWithdrawalsOptions](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
* [ClaimWithdrawalsResult](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)
* [Eip1193Like](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/eip1193like/)
* [NetworkStats](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/networkstats/)
* [SsvActivityDeployment](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvactivitydeployment/)
* [SsvDeployment](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvdeployment/)
* [SsvProtocolConfig](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvprotocolconfig/)
* [SsvWithdrawalRequest](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvwithdrawalrequest/)
* [StakedBalance](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)
* [StakeOptions](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
* [StakeResult](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)
* [StakingWalletAccount](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakingwalletaccount/)
* [WithdrawalRequest](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/)
* [WithdrawalRequestOptions](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
* [WithdrawalRequestResult](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)
* [WithdrawalRequestsView](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestsview/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [EvmProvider](/api/anywalletkit/protocol-staking-ssv-evm/type-aliases/evmprovider/)
## Variables
[Section titled “Variables”](#variables)
* [ETH_CLAIM_UNIT](/api/anywalletkit/protocol-staking-ssv-evm/variables/eth_claim_unit/)
* [MINIMAL_STAKING_AMOUNT](/api/anywalletkit/protocol-staking-ssv-evm/variables/minimal_staking_amount/)
* [SSV_ACTIONS](/api/anywalletkit/protocol-staking-ssv-evm/variables/ssv_actions/)
* [SSV_ADDRESS_MAP](/api/anywalletkit/protocol-staking-ssv-evm/variables/ssv_address_map/)
* [SSV_ERRORS](/api/anywalletkit/protocol-staking-ssv-evm/variables/ssv_errors/)
## Functions
[Section titled “Functions”](#functions)
* [describeRevert](/api/anywalletkit/protocol-staking-ssv-evm/functions/describerevert/)
* [describeSsvActivity](/api/anywalletkit/protocol-staking-ssv-evm/functions/describessvactivity/)
# default
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:222
SSV Network token staking for EVM wallet accounts.
SSV Network is the distributed validator (DVT) infrastructure a large share of Ethereum staking runs on; SSV is its ERC-20 token, and cluster operators pay the network’s fees in ETH. Staking SSV mints cSSV 1:1 — a transferable, non-rebasing receipt token — and entitles the holder to a pro-rata share of those ETH fees, tracked through an ETH-per-share index and claimable at any time without unstaking. Getting the SSV back is a two-phase exit: a `requestUnstake` burns the cSSV into a cooldown entry (7 days at launch, DAO-tunable, not cancellable) and `withdrawUnlocked` pays out every entry whose cooldown has ended.
That two-phase shape is exactly the proposed `StakingProtocol` interface: `stake` → `requestWithdrawal` → `getWithdrawalRequests` → `claimWithdrawals`. Two honest differences from the Lido implementation are documented on the methods: the withdrawal pays SSV (the staked token, not the chain’s native token), and the claim call is all-or-nothing (`ids` are informational).
Neither SSV nor cSSV supports EIP-2612 permit, so the first stake is two transactions: approve (awaited to a mined receipt — `stake`’s gas estimate reverts against an unmined allowance) and then `stake`. Every write is proven with an `eth_call` before broadcasting, so a revert surfaces as the named custom error instead of burned gas.
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/)<[`SsvProtocolConfig`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvprotocolconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `SsvProtocolEvm`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:234
Creates a new interface to the SSV Network staking protocol for evm blockchains.
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`StakingWalletAccount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakingwalletaccount/)
The wallet account to use to interact with the protocol (a @anywalletkit/wallet-evm account, or a read-only / minimal `{ getAddress }` account for views).
##### config?
[Section titled “config?”](#config)
[`SsvProtocolConfig`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvprotocolconfig/) = `{}`
The protocol’s configuration.
#### Returns
[Section titled “Returns”](#returns)
`SsvProtocolEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`SsvProtocolConfig`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvprotocolconfig/)
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`_config`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#_config)
## Methods
[Section titled “Methods”](#methods)
### claimRewards()
[Section titled “claimRewards()”](#claimrewards)
> **claimRewards**(): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:567
Claims the accrued ETH rewards — ETH lands on the account, the staked position is untouched.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
The claim’s result.
***
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:461
Pays out every cooldown entry that has unlocked — SSV lands on the account. `withdrawUnlocked` is all-or-nothing on the network side, so `options.ids` cannot narrow the claim; they are accepted for interface parity and the call refuses only when nothing at all is unlocked.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_options?
[Section titled “\_options?”](#_options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
The claim’s options.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
The claim’s result.
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#claimwithdrawals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:650
Recognize this deployment’s SSV staking transactions offline (`stake`, `requestUnstake`, `withdrawUnlocked`, `claimEthRewards` on SSVNetwork). See `ssv-activity.ts` for the rule.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`describeActivity`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#describeactivity)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:502
The current APR in percent, from SSV Network’s API — the same number stake.ssv.network shows. It is ETH-denominated on an SSV-denominated stake, so it moves with SSV’s price.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
The APR.
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#getapr)
***
### getAprHistory()
[Section titled “getAprHistory()”](#getaprhistory)
> **getAprHistory**(`options?`): `Promise`<[`AprSample`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/aprsample/)\[]>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:620
Daily APR samples from SSV Network’s API, oldest first, with the SSV and ETH prices the API priced them at. Decoration: failures return an empty array, never throw.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options?
[Section titled “options?”](#options)
The history’s options.
###### limit?
[Section titled “limit?”](#limit)
`number` = `7`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`AprSample`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/aprsample/)\[]>
Samples (timestamp unix seconds, apr percent).
***
### getClaimableRewards()
[Section titled “getClaimableRewards()”](#getclaimablerewards)
> **getClaimableRewards**(): `Promise`<`bigint`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:546
ETH rewards accrued to the account and not yet claimed. Claims round down to `ETH_CLAIM_UNIT`; below it the network refuses the claim.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`bigint`>
ETH in wei.
***
### getCooldown()
[Section titled “getCooldown()”](#getcooldown)
> **getCooldown**(): `Promise`<`number`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:592
The network’s current unstake cooldown, in seconds (DAO-tunable — read it, never hardcode 7 days).
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`number`>
Cooldown seconds.
***
### getNetworkStats()
[Section titled “getNetworkStats()”](#getnetworkstats)
> **getNetworkStats**(): `Promise`<[`NetworkStats`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/networkstats/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:601
Network-wide staking figures.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`NetworkStats`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/networkstats/)>
Total cSSV supply (SSV base unit), the ETH pool backing claims (wei), and the cumulative ETH-per-share index (1e18 precision).
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:487
The account’s staked position. cSSV is the only staked form and it is 1:1 with SSV, so `wrappedBalance` is 0 and `rate` is exactly 1e18.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
The staked balances.
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#getstakedbalance)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(): `Promise`<`bigint`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:533
The account’s liquid (unstaked, stakeable) SSV balance.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
SSV in base unit.
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestsview/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:412
The account’s open cooldown entries. Ids are the entries’ positions in the network’s per-account list — stable until a withdrawal removes the unlocked ones, so re-read after every write rather than caching them. `timestamp` is derived (unlockTime − current cooldown); `unlockTime` is the on-chain value. Amounts are SSV: the exit pays the staked token, not ETH.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestsview/)>
The queue view.
#### Overrides
[Section titled “Overrides”](#overrides-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#getwithdrawalrequests)
***
### quoteClaimRewards()
[Section titled “quoteClaimRewards()”](#quoteclaimrewards)
> **quoteClaimRewards**(): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:580
Quotes the costs of a rewards claim.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
The claim’s costs.
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:475
Quotes the costs of a withdraw operation.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_options?
[Section titled “\_options?”](#_options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
The claim’s options.
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
The claim’s costs.
#### Overrides
[Section titled “Overrides”](#overrides-6)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:397
Quotes the costs of an unstake request.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-1)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
The request’s options.
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
The request’s costs.
#### Overrides
[Section titled “Overrides”](#overrides-7)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:366
Quotes the costs of a stake operation, assuming the network already holds an allowance (without one the estimate itself reverts).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-2)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
The stake’s options.
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
The stake’s costs.
#### Overrides
[Section titled “Overrides”](#overrides-8)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:382
Burns cSSV into a cooldown entry. Irreversible: the entry cannot be cancelled and stops earning immediately; the SSV unlocks after the network’s cooldown (see `getCooldown`). There is a single staked-token form, so `token` is accepted for interface parity and ignored.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### options
[Section titled “options”](#options-3)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
The request’s options (amount in cSSV base unit).
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
The request’s result (`approveHash` is always null — burning needs no approval).
#### Overrides
[Section titled “Overrides”](#overrides-9)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#requestwithdrawal)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`requireSigningAccount`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#requiresigningaccount)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/) & `object`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:326
Stakes SSV — cSSV lands on the account 1:1 and ETH rewards start accruing at once. Approves first when the allowance is short (the approval is awaited to a mined receipt), then proves and sends `stake`.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options
[Section titled “options”](#options-4)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
The stake’s options (amount in SSV base unit).
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/) & `object`>
The stake’s result; `fee` includes the approval when one ran.
#### Overrides
[Section titled “Overrides”](#overrides-10)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-ssv-evm/classes/stakingprotocol/#stake)
# IStakingProtocol
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:32
**`Interface`**
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new IStakingProtocol**(): `IStakingProtocol`
#### Returns
[Section titled “Returns”](#returns)
`IStakingProtocol`
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:91
Claims finalized withdrawal requests — native tokens land on the account.
#### Parameters
[Section titled “Parameters”](#parameters)
##### \_options?
[Section titled “\_options?”](#_options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
The claim’s options.
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
The claim’s result.
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:119
Returns the protocol’s current staking APR, in percent.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
The APR (e.g. 2.7 for 2.7%).
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:110
Returns the account’s staked position.
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
The staked balances.
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestsview/)>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:81
Returns the account’s live withdrawal queue: open requests, what is still pending and what is ready to claim.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestsview/)>
The queue view.
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:101
Quotes the costs of a claim operation.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_options?
[Section titled “\_options?”](#_options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
The claim’s options.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
The claim’s costs.
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`_options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:71
Quotes the costs of a withdrawal request.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_options
[Section titled “\_options”](#_options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
The request’s options.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
The request’s costs.
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`_options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:49
Quotes the costs of a stake operation.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_options
[Section titled “\_options”](#_options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
The stake’s options.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
The stake’s costs.
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`_options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:61
Queues staked tokens for withdrawal. The request finalizes out of band; once [IStakingProtocol#getWithdrawalRequests](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/#getwithdrawalrequests) reports it claimable, [IStakingProtocol#claimWithdrawals](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/#claimwithdrawals) exchanges it for native tokens.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_options
[Section titled “\_options”](#_options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
The request’s options.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
The request’s result.
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`_options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:39
Stakes native tokens into the protocol; staked tokens land on the account.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_options
[Section titled “\_options”](#_options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
The stake’s options.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
The stake’s result.
# StakingProtocol
Defined in: core/dist/index-QWdcwE6y.d.ts:783
Base class for staking modules: holds the account and config, and throws `NotImplementedError` for every method a module leaves out.
## Extends
[Section titled “Extends”](#extends)
* `ProtocolBase`<`TConfig`>
## Extended by
[Section titled “Extended by”](#extended-by)
* [`default`](/api/anywalletkit/protocol-staking-ssv-evm/classes/default/)
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### TConfig
[Section titled “TConfig”](#tconfig)
`TConfig` *extends* `object` = `Record`<`string`, `never`>
## Implements
[Section titled “Implements”](#implements)
* `IStakingProtocol`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StakingProtocol**<`TConfig`>(`account`, `config?`): `StakingProtocol`<`TConfig`>
Defined in: core/dist/index-QWdcwE6y.d.ts:784
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`IWalletAccountReadOnly` | `IWalletAccount`
##### config?
[Section titled “config?”](#config)
`TConfig`
#### Returns
[Section titled “Returns”](#returns)
`StakingProtocol`<`TConfig`>
#### Overrides
[Section titled “Overrides”](#overrides)
`ProtocolBase.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ProtocolBase._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `TConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ProtocolBase._config`
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`_o?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:790
Claim finalized requests; the native coin returns to the account.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### \_o?
[Section titled “\_o?”](#_o)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IStakingProtocol.claimWithdrawals`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ProtocolBase.describeActivity`
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: core/dist/index-QWdcwE6y.d.ts:793
APR in percent: 2.5 = 2.5 % (every staking module and app reads it this way).
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IStakingProtocol.getApr`
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:792
The account’s staked position.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakedbalance/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IStakingProtocol.getStakedBalance`
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<`WithdrawalRequestsView`>
Defined in: core/dist/index-QWdcwE6y.d.ts:789
The account’s open requests, and which are claimable.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`WithdrawalRequestsView`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IStakingProtocol.getWithdrawalRequests`
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`_o?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:791
Network fee of [IStakingProtocol.claimWithdrawals](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/#claimwithdrawals).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_o?
[Section titled “\_o?”](#_o-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IStakingProtocol.quoteClaimWithdrawals`
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`_o`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:788
Network fee of [IStakingProtocol.requestWithdrawal](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/#requestwithdrawal).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### \_o
[Section titled “\_o”](#_o-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IStakingProtocol.quoteRequestWithdrawal`
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`_o`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
Defined in: core/dist/index-QWdcwE6y.d.ts:786
Network fee of [IStakingProtocol.stake](/api/anywalletkit/protocol-staking-ssv-evm/classes/istakingprotocol/#stake); nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### \_o
[Section titled “\_o”](#_o-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/), `"hash"`>>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IStakingProtocol.quoteStake`
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`_o`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:787
Put staked tokens in the withdrawal queue. Sends an approval first when the protocol needs one.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### \_o
[Section titled “\_o”](#_o-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequestresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IStakingProtocol.requestWithdrawal`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ProtocolBase.requireSigningAccount`
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`_o`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
Defined in: core/dist/index-QWdcwE6y.d.ts:785
Stake native coin and receive the protocol’s staked token.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### \_o
[Section titled “\_o”](#_o-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/stakeresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IStakingProtocol.stake`
# describeRevert
> **describeRevert**(`error`): `Error` & `object`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:97
Turns a revert into an error that names the SSVStaking custom error. The provider buries the revert data in `error.data` or a few `info.error` / `error` / `cause` hops down (viem wraps the node’s error in CallExecutionError → ExecutionRevertedError → the raw RPC error); the selector also tends to appear in the message text — every place is checked. Unknown reverts pass through.
## Parameters
[Section titled “Parameters”](#parameters)
### error
[Section titled “error”](#error)
`unknown`
The error thrown by viem / the provider.
## Returns
[Section titled “Returns”](#returns)
`Error` & `object`
The error to surface.
# describeSsvActivity
> **describeSsvActivity**(`tx`, `ctx`, `__namedParameters`): `ActivityItem` | `null`
Defined in: protocol-staking-ssv-evm/src/ssv-activity.ts:35
Describe `tx` if it is a staking call on this deployment’s SSVNetwork.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### \_\_namedParameters
[Section titled “\_\_namedParameters”](#__namedparameters)
[`SsvActivityDeployment`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvactivitydeployment/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# AprSample
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:181
## Properties
[Section titled “Properties”](#properties)
### apr
[Section titled “apr”](#apr)
> **apr**: `number`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:185
Percent.
***
### ethPriceUsd
[Section titled “ethPriceUsd”](#ethpriceusd)
> **ethPriceUsd**: `number` | `null`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:187
***
### ssvPriceUsd
[Section titled “ssvPriceUsd”](#ssvpriceusd)
> **ssvPriceUsd**: `number` | `null`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:186
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:183
Unix seconds.
# ClaimWithdrawalsOptions
Defined in: core/dist/index-QWdcwE6y.d.ts:733
Which finalized requests to claim; all claimable ones when `ids` is omitted.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadClaimOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadclaimoptions/)
* [`NativeClaimOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeclaimoptions/)
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:734
# ClaimWithdrawalsResult
Defined in: core/dist/index-QWdcwE6y.d.ts:737
The claim transaction and the fee it paid.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:739
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:738
# Eip1193Like
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:138
An EIP-1193 provider as this module needs it: just `request`.
## Methods
[Section titled “Methods”](#methods)
### request()
[Section titled “request()”](#request)
> **request**(`args`): `Promise`<`unknown`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:139
#### Parameters
[Section titled “Parameters”](#parameters)
##### args
[Section titled “args”](#args)
###### method
[Section titled “method”](#method)
`string`
###### params?
[Section titled “params?”](#params)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# NetworkStats
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:175
## Properties
[Section titled “Properties”](#properties)
### accEthPerShare
[Section titled “accEthPerShare”](#accethpershare)
> **accEthPerShare**: `bigint`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:178
***
### rewardsPool
[Section titled “rewardsPool”](#rewardspool)
> **rewardsPool**: `bigint`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:177
***
### totalStaked
[Section titled “totalStaked”](#totalstaked)
> **totalStaked**: `bigint`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:176
# SsvActivityDeployment
Defined in: protocol-staking-ssv-evm/src/ssv-activity.ts:27
## Properties
[Section titled “Properties”](#properties)
### addresses
[Section titled “addresses”](#addresses)
> **addresses**: `object`
Defined in: protocol-staking-ssv-evm/src/ssv-activity.ts:29
#### cssvToken?
[Section titled “cssvToken?”](#cssvtoken)
> `optional` **cssvToken?**: `string`
#### network
[Section titled “network”](#network)
> **network**: `string`
#### ssvToken?
[Section titled “ssvToken?”](#ssvtoken)
> `optional` **ssvToken?**: `string`
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-staking-ssv-evm/src/ssv-activity.ts:28
# SsvDeployment
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:1
## Properties
[Section titled “Properties”](#properties)
### cssvToken
[Section titled “cssvToken”](#cssvtoken)
> **cssvToken**: `string`
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:5
***
### endpoints
[Section titled “endpoints”](#endpoints)
> **endpoints**: `object`
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:6
#### apr
[Section titled “apr”](#apr)
> **apr**: `string`
#### aprHistory
[Section titled “aprHistory”](#aprhistory)
> **aprHistory**: `string`
***
### network
[Section titled “network”](#network)
> **network**: `string`
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:2
***
### ssvToken
[Section titled “ssvToken”](#ssvtoken)
> **ssvToken**: `string`
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:4
***
### views
[Section titled “views”](#views)
> **views**: `string`
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:3
# SsvProtocolConfig
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:164
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: `object`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:170
Override for the contract addresses.
#### cssvToken?
[Section titled “cssvToken?”](#cssvtoken)
> `optional` **cssvToken?**: `string`
#### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
#### ssvToken?
[Section titled “ssvToken?”](#ssvtoken)
> `optional` **ssvToken?**: `string`
#### views?
[Section titled “views?”](#views)
> `optional` **views?**: `string`
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:168
The chain to operate on (default 1). Non-mainnet chains must also supply addresses (and endpoints for APR).
***
### endpoints?
[Section titled “endpoints?”](#endpoints)
> `optional` **endpoints?**: `object`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:172
Override for the REST endpoints.
#### apr?
[Section titled “apr?”](#apr)
> `optional` **apr?**: `string`
#### aprHistory?
[Section titled “aprHistory?”](#aprhistory)
> `optional` **aprHistory?**: `string`
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/protocol-staking-ssv-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/protocol-staking-ssv-evm/type-aliases/evmprovider/)\[]
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:166
RPC url(s) or EIP-1193 provider(s) to read the chain through; a list fails over in order. Defaults to the account’s own provider.
# SsvWithdrawalRequest
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:16
One request in the protocol’s withdrawal queue.
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:715
Amount requested, base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`amount`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#amount)
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:719
Finalized and ready to claim.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`claimable`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#claimable)
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:713
Request id, as the claim call takes it.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`id`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#id)
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:717
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/).[`timestamp`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/withdrawalrequest/#timestamp)
***
### unlockTime
[Section titled “unlockTime”](#unlocktime)
> **unlockTime**: `number`
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:18
Unix seconds at which the cooldown ends (on-chain value).
# StakedBalance
Defined in: core/dist/index-QWdcwE6y.d.ts:742
The account’s staked position. Amounts in base units.
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:744
Primary staked token held (for Lido, stETH).
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:748
Primary staked tokens per wrapped token, 1e18 fixed point (0n if none).
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:750
Whole position in primary staked tokens.
***
### wrappedBalance
[Section titled “wrappedBalance”](#wrappedbalance)
> **wrappedBalance**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:746
Non-rebasing wrapped form, 0n if the protocol has none.
# StakeOptions
Defined in: core/dist/index-QWdcwE6y.d.ts:688
How much native coin to stake, in base units.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadStakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadstakeoptions/)
* [`NativeStakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativestakeoptions/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:689
# StakeResult
Defined in: core/dist/index-QWdcwE6y.d.ts:692
The stake transaction and the fee it paid.
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:694
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:693
# StakingWalletAccount
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:155
The account surface the protocol needs. Writable methods are optional — views work with a read-only account that only implements getAddress.
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:156
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### quoteSendTransaction()?
[Section titled “quoteSendTransaction()?”](#quotesendtransaction)
> `optional` **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:158
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
###### data?
[Section titled “data?”](#data)
`string`
###### to
[Section titled “to”](#to)
`string`
###### value?
[Section titled “value?”](#value)
`bigint`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `fee`: `bigint`; }>
***
### sendTransaction()?
[Section titled “sendTransaction()?”](#sendtransaction)
> `optional` **sendTransaction**(`tx`): `Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:157
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx-1)
###### data?
[Section titled “data?”](#data-1)
`string`
###### to
[Section titled “to”](#to-1)
`string`
###### value?
[Section titled “value?”](#value-1)
`bigint`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
# WithdrawalRequest
Defined in: core/dist/index-QWdcwE6y.d.ts:711
One request in the protocol’s withdrawal queue.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`SsvWithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvwithdrawalrequest/)
* [`MonadWithdrawalRequest`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadwithdrawalrequest/)
* [`NativeWithdrawalRequest`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativewithdrawalrequest/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:715
Amount requested, base units.
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: core/dist/index-QWdcwE6y.d.ts:719
Finalized and ready to claim.
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:713
Request id, as the claim call takes it.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:717
Unix seconds.
# WithdrawalRequestOptions
Defined in: core/dist/index-QWdcwE6y.d.ts:697
How much staked token to put in the withdrawal queue.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`MonadUnstakeOptions`](/api/anywalletkit/protocol-staking-native-monad/interfaces/monadunstakeoptions/)
* [`NativeUnstakeOptions`](/api/anywalletkit/protocol-staking-native-solana/interfaces/nativeunstakeoptions/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:698
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:700
Which staked-token form to withdraw (e.g. “stETH” | “wstETH”). Defaults to the primary one.
# WithdrawalRequestResult
Defined in: core/dist/index-QWdcwE6y.d.ts:703
The withdrawal-request transaction.
## Properties
[Section titled “Properties”](#properties)
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:708
Hash of the approval sent first, or `null` when none was needed.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:706
Total gas, including a prior approval if the two-transaction fallback ran.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:704
# WithdrawalRequestsView
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:21
## Properties
[Section titled “Properties”](#properties)
### claimableAmount
[Section titled “claimableAmount”](#claimableamount)
> **claimableAmount**: `bigint`
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:27
SSV `withdrawUnlocked()` pays right now.
***
### claimableIds
[Section titled “claimableIds”](#claimableids)
> **claimableIds**: `bigint`\[]
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:28
***
### pendingAmount
[Section titled “pendingAmount”](#pendingamount)
> **pendingAmount**: `bigint`
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:25
SSV still cooling down.
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`SsvWithdrawalRequest`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvwithdrawalrequest/)\[]
Defined in: protocol-staking-ssv-evm/src/staking-protocol.ts:23
Open entries, latest unlock first.
# EvmProvider
> **EvmProvider** = `string` | [`Eip1193Like`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/eip1193like/)
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:143
RPC url or EIP-1193 provider.
# ETH_CLAIM_UNIT
> `const` **ETH_CLAIM_UNIT**: `100000n` = `100_000n`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:67
`claimEthRewards()` pays `accrued - accrued % ETH_CLAIM_UNIT` and reverts NothingToClaim when that rounds to zero (SSVCoreTypes.sol ETH_DEDUCTED_DIGITS).
# MINIMAL_STAKING_AMOUNT
> `const` **MINIMAL_STAKING_AMOUNT**: `1000000000n` = `1_000_000_000n`
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:63
`stake()` reverts StakeTooLow below this (1 gwei of SSV — SSVStaking.sol MINIMAL_STAKING_AMOUNT).
# SSV_ACTIONS
> `const` **SSV_ACTIONS**: `Readonly`<`Record`<`string`, { `kind`: `ActivityKind`; `title`: `string`; }>>
Defined in: protocol-staking-ssv-evm/src/ssv-activity.ts:18
Selector → action on SSVNetwork (contracts/modules/SSVStaking.sol, ssv-network v2.0.0).
# SSV_ADDRESS_MAP
> `const` **SSV_ADDRESS_MAP**: `Record`<`number`, [`SsvDeployment`](/api/anywalletkit/protocol-staking-ssv-evm/interfaces/ssvdeployment/)>
Defined in: protocol-staking-ssv-evm/src/ssv-address-map.ts:33
SSV Network contract addresses, keyed by chain id.
`network` is the SSVNetwork proxy — every staking write (stake, requestUnstake, withdrawUnlocked, claimEthRewards) is a call on it; the staking module behind the proxy is `contracts/modules/SSVStaking.sol` in ssvlabs/ssv-network v2.0.0. `views` is SSVNetworkViews, where every read lives (stakedBalanceOf, previewClaimableEth, pendingUnstake, cooldownDuration…). `ssvToken` is the SSV ERC-20 the account stakes, `cssvToken` the cSSV receipt token minted 1:1 (non-rebasing; rewards accrue through an ETH-per-share index).
All four mainnet addresses were verified against the live proxy (getVersion() = “v2.0.0”, cooldownDuration() = 604800, cSSV.totalSupply() == totalStaked()) before landing here; the ENS names ssvnetwork.eth / views.ssvnetwork.eth / ssv.ssvnetwork.eth / cssv.ssvnetwork.eth resolve to them.
Only mainnet ships as a default: other deployments (e.g. the Hoodi testnet — network 0x58410Bef803ECd7E63B23664C586A6DB72DAf59c, views 0x5AdDb3f1529C5ec70D77400499eE4bbF328368fe, SSV 0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e, cSSV 0x6e1a5d27361c666f681af06535c8Ac773E571d4d) must be passed explicitly through the protocol’s `config.addresses` so that nobody stakes against an unverified address that a default quietly supplied.
# SSV_ERRORS
> `const` **SSV_ERRORS**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-staking-ssv-evm/src/ssv-protocol-evm.ts:75
The staking module’s custom errors, keyed by 4-byte selector — the raw revert carries no text, so this is the only way to tell a user what happened. Selectors computed from contracts/modules/SSVStaking.sol and confirmed against the live proxy with eth_call.
# @anywalletkit/protocol-staking-tonstakers-ton
# @anywalletkit/protocol-staking-tonstakers-ton
[Section titled “@anywalletkit/protocol-staking-tonstakers-ton”](#anywalletkitprotocol-staking-tonstakers-ton)
[](https://www.npmjs.com/package/@anywalletkit/protocol-staking-tonstakers-ton)
A simple package that lets `@anywalletkit/wallet-ton` wallet accounts stake through [Tonstakers](https://tonstakers.com): stake GRAM → tsTON, exit instant / standard / best-rate, track payout bills, read rates, APY and earnings.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core · yarn add @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core
```
On npm: [@anywalletkit/protocol-staking-tonstakers-ton](https://www.npmjs.com/package/@anywalletkit/protocol-staking-tonstakers-ton), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Built as the **third implementation of the `StakingProtocol` type** in `@anywalletkit/core` — after Lido (ETH liquid staking) and SSV (token staking with a cooldown) — and the first one off EVM. The base class in `src/staking-protocol.js` is the same file, byte-identical; a TON liquid staking protocol fitting it is the point: the type is chain-agnostic.
The mechanics are extracted from a production wallet (React Native/Hermes) where every flow was exercised with real funds.
## What Tonstakers and tsTON are
[Section titled “What Tonstakers and tsTON are”](#what-tonstakers-and-tston-are)
The Open Network’s native token is **GRAM** (Toncoin was renamed Gram on 2026-06-15; the chain keeps the TON name). [Tonstakers](https://tonstakers.com) is TON’s largest liquid-staking pool (\~128M GRAM, \~140k stakers): the pool contract lends deposited GRAM to validators, and **tsTON** is the non-rebasing receipt jetton whose GRAM value grows with the pool’s rewards — the rate is the pool’s balance over the jetton supply and moves once per validation round (\~18h). Exits burn tsTON in one of three modes: **standard** (paid now from the pool’s free liquidity when there is enough, otherwise a payout bill settled after the round), **instant** (paid now or the message bounces — never a bill), **best rate** (always a bill, settled at the round-end projected rate). Bills are NFTs the pool pays out by itself; there is nothing to claim.
## Usage
[Section titled “Usage”](#usage)
```js
import WalletManagerTon from '@anywalletkit/wallet-ton'
import TonstakersProtocolTon from '@anywalletkit/protocol-staking-tonstakers-ton'
const wallet = new WalletManagerTon(seed, { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } })
const account = await wallet.getAccount(0)
const tonstakers = new TonstakersProtocolTon(account, {
partnerCode: 0x…n // optional: Tonstakers partner code for referral attribution
})
// Stake — tsTON lands at the pool rate; the message carries +1 GRAM the pool refunds
const { hash, fee } = await tonstakers.stake({ amount: 10n ** 9n })
// Exit: standard (default), instant (fill-or-kill) or bestRate (round-end rate)
await tonstakers.requestWithdrawal({ amount: 10n ** 9n, mode: 'instant' })
// Bills waiting for their round (settled automatically — nothing to claim)
const { requests, pendingAmount } = await tonstakers.getWithdrawalRequests()
// Views
await tonstakers.getStakedBalance() // { balance: tsTON, rate: GRAM per tsTON, total: GRAM value }
await tonstakers.getApr() // 12.86 (percent, tonapi)
```
Tonstakers-specific extras beyond the interface:
```js
await tonstakers.getPoolData() // halted, depositsOpen, balances, minter, payout collection, rates
await tonstakers.getRates() // { rate, projectedRate } — GRAM per tsTON, 1e9 fixed
await tonstakers.getInstantLiquidity() // GRAM the pool can pay instant exits from
await tonstakers.getJettonWallet() // the account's tsTON jetton wallet (derived, checked against the minter)
await tonstakers.getTokenBalance() // tsTON held
await tonstakers.getRewards() // earned GRAM = (rate − weighted entry rate) × tsTON
```
## How it maps onto the interface
[Section titled “How it maps onto the interface”](#how-it-maps-onto-the-interface)
| `IStakingProtocol` | Tonstakers |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `stake({ amount })` | one message to the pool: `amount + 1 GRAM`, body `op 0x47d54391 · query_id 1 · partner code` |
| `requestWithdrawal({ amount, mode })` | burn on the account’s tsTON jetton wallet: `1.05 GRAM` attached, body `op 0x595f07bc · amount · owner · {wait_till_round_end, fill_or_kill}` |
| `getWithdrawalRequests()` | the account’s payout-bill NFTs in the pool’s active payout collections (`claimable` always false) |
| `claimWithdrawals()` | **rejects** — bills are settled by the pool, not claimed |
| `getStakedBalance()` | tsTON balance, `rate` GRAM/tsTON, `total` = GRAM value |
| `getApr()` | tonapi’s staking-pool view (the number Tonstakers shows) |
Three honest deviations, documented on the methods rather than papered over: the exit has **modes** (an extra `mode` option), the second phase is **automatic** (so `claimWithdrawals` refuses instead of pretending), and `total` is the position’s **value in GRAM** — for a non-rebasing receipt the GRAM value is the figure that means anything.
## Why it looks the way it does
[Section titled “Why it looks the way it does”](#why-it-looks-the-way-it-does)
* **The official SDK only speaks TonConnect** (`tonstakers-sdk` builds and sends through a connector; no payload export). Its message builders — op codes, fee reserves, payload layout — are ported verbatim and ride the account’s own `sendTransaction({ to, value, body })`, which signs locally.
* **Friendly addresses on the wire**: the module hands the account `EQ…` forms, which carry the bounce flag; a raw `0:…` jetton-wallet address carries none.
* **Pool state is read on-chain** (`get_pool_full_data`, layout verified against mainnet), through the account’s TonClient with failover across configured clients. Public toncenter nodes intermittently answer exit code −13 on that getter, so each client gets two tries.
* **Instant exits are pre-checked** against the pool’s free balance (the contract would bounce them anyway, but a bounce carries no readable reason).
* **REST is decoration**: bills and APY come from the indexes the official SDK reads (tonapi, Tonstakers’ payout API), overridable or disable-able via `config.endpoints`; on-chain flows never depend on them, and `getRewards` degrades to null.
* **No `AbortSignal.timeout` / `.any`**, no `process.env` — Hermes and Bare friendly. Mainnet and testnet both ship pool and tsTON minter defaults.
* **The jetton wallet is derived, not trusted**: the account’s tsTON jetton wallet — the destination of every unstake’s 1.05 GRAM — is computed on the device from the minter’s pinned wallet code (`TONSTAKERS_JETTON_WALLET_CODES`, `deriveTonstakersJettonWallet`), and the minter’s `get_wallet_address` must agree or the call is refused. A minter with no pinned code (a custom `addresses.jetton`) needs `jettonWalletCode`, or the explicit `allowUnverifiedJettonWallet: true` to trust the node’s answer.
## Configuration
[Section titled “Configuration”](#configuration)
```js
new TonstakersProtocolTon(account, {
tonClient, // TonClient | { url, secretKey } | array of either; defaults to the account's
network, // '-239' mainnet (default) or '-3' testnet
addresses, // { pool, jetton }
jettonWalletCode, // Cell | base64 BOC — wallet code of a minter not pinned in the package
allowUnverifiedJettonWallet, // true: no known code, trust get_wallet_address (off by default)
partnerCode, // referral attribution in stake payloads
endpoints // { tonapi, withdrawalPayouts } — null disables the feature
})
```
Mainnet contracts (verified live): pool `EQCkWxfyhAkim3g2DjKQQg8T5P4g-Q1-K_jErGcDJZ4i-vqR`, tsTON minter `EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav`.
## Tests
[Section titled “Tests”](#tests)
```plaintext
npm test # offline unit tests (node:test, stubbed TonClient + account)
npm run verify:live # read-only checks against mainnet (pool getter, jetton wallet, APY, bills, message builders)
```
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, { own })` labels Tonstakers transactions for a wallet’s history, offline and synchronously, against the deployment the instance is configured with (pool + tsTON jetton master; addresses are compared in raw `wc:hex` form, so friendly and raw spellings both match). Three shapes: a message **to the pool** whose op is `OP_STAKE` 0x47d54391 (or undecoded) → `stake` “Staked GRAM” (net GRAM out — the fee reserve the pool returns is netted — tsTON minted in); a **burn** (op `OP_UNSTAKE` 0x595f07bc, read from `call.data` as hex / decimal or from `call.method`) with a tsTON jetton transfer leaving the wallet → `unstake` “Requested unstake” (the destination is the wallet’s own jetton wallet, which cannot be known statically, so the jetton movement is the proof); an **incoming** message from the pool carrying GRAM (op 0x0a77535c `tonstake_pool_withdrawal` when decoded, no call of ours) → `claim` “Received unstaked GRAM”. Subtitle `"Tonstakers · TON"`, `counterparty` the pool. Anything else — plain GRAM or jetton transfers, other pools — is null.
Fixtures in `fixtures/activity/` are the test wallet’s funded run (stake 3 GRAM, unstake 1 tsTON, the settled payout; 2026-09-04 … 10-07, amounts from tonapi events and raw transactions); `negatives/` holds a GRAM transfer in and a USD₮ jetton transfer out.
## Classes
[Section titled “Classes”](#classes)
* [default](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/default/)
* [IStakingProtocol](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/)
* [StakingProtocol](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ClaimWithdrawalsOptions](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
* [ClaimWithdrawalsResult](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/)
* [PoolData](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/pooldata/)
* [Rewards](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/rewards/)
* [StakedBalance](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)
* [StakeOptions](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
* [StakeResult](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)
* [StakingWalletAccount](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakingwalletaccount/)
* [TonClientConfig](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonclientconfig/)
* [TonstakersBill](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonstakersbill/)
* [TonstakersProtocolConfig](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonstakersprotocolconfig/)
* [WithdrawalRequest](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/)
* [WithdrawalRequestOptions](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
* [WithdrawalRequestResult](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)
* [WithdrawalRequestsView](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [UnstakeMode](/api/anywalletkit/protocol-staking-tonstakers-ton/type-aliases/unstakemode/)
## Variables
[Section titled “Variables”](#variables)
* [MIN_STAKE](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/min_stake/)
* [OP_STAKE](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/op_stake/)
* [OP_UNSTAKE](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/op_unstake/)
* [OP_WITHDRAWAL_PAYOUT](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/op_withdrawal_payout/)
* [STAKE_FEE_RESERVE](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/stake_fee_reserve/)
* [TONSTAKERS_ADDRESS_MAP](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/tonstakers_address_map/)
* [TONSTAKERS_JETTON_WALLET_CODES](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/tonstakers_jetton_wallet_codes/)
* [UNSTAKE_FEE_RESERVE](/api/anywalletkit/protocol-staking-tonstakers-ton/variables/unstake_fee_reserve/)
## Functions
[Section titled “Functions”](#functions)
* [buildStakeBody](/api/anywalletkit/protocol-staking-tonstakers-ton/functions/buildstakebody/)
* [buildUnstakeBody](/api/anywalletkit/protocol-staking-tonstakers-ton/functions/buildunstakebody/)
* [deriveTonstakersJettonWallet](/api/anywalletkit/protocol-staking-tonstakers-ton/functions/derivetonstakersjettonwallet/)
* [describeTonstakersActivity](/api/anywalletkit/protocol-staking-tonstakers-ton/functions/describetonstakersactivity/)
* [rawAddress](/api/anywalletkit/protocol-staking-tonstakers-ton/functions/rawaddress/)
# default
Defined in: index.d.ts:173
## Extends
[Section titled “Extends”](#extends)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new default**(`account`, `config?`): `TonstakersProtocolTon`
Defined in: index.d.ts:174
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`StakingWalletAccount`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakingwalletaccount/)
##### config?
[Section titled “config?”](#config)
[`TonstakersProtocolConfig`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonstakersprotocolconfig/)
#### Returns
[Section titled “Returns”](#returns)
`TonstakersProtocolTon`
#### Overrides
[Section titled “Overrides”](#overrides)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` **\_account**: [`StakingWalletAccount`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakingwalletaccount/)
Defined in: index.d.ts:150
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`_account`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#_account)
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<`never`>
Defined in: index.d.ts:184
Always rejects: the pool settles bills itself.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#claimwithdrawals)
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: index.d.ts:176
Recognize this module’s transactions for a wallet’s history; null for anything else. Pure and synchronous.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-2)
`ActivityItem` | `null`
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:146
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#getapr)
***
### getInstantLiquidity()
[Section titled “getInstantLiquidity()”](#getinstantliquidity)
> **getInstantLiquidity**(): `Promise`<`bigint`>
Defined in: index.d.ts:180
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`bigint`>
***
### getJettonWallet()
[Section titled “getJettonWallet()”](#getjettonwallet)
> **getJettonWallet**(): `Promise`<`Address`>
Defined in: index.d.ts:178
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Address`>
***
### getPoolData()
[Section titled “getPoolData()”](#getpooldata)
> **getPoolData**(): `Promise`<[`PoolData`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/pooldata/)>
Defined in: index.d.ts:177
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`PoolData`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/pooldata/)>
***
### getRates()
[Section titled “getRates()”](#getrates)
> **getRates**(): `Promise`<{ `projectedRate`: `bigint`; `rate`: `bigint`; }>
Defined in: index.d.ts:181
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<{ `projectedRate`: `bigint`; `rate`: `bigint`; }>
***
### getRewards()
[Section titled “getRewards()”](#getrewards)
> **getRewards**(): `Promise`<[`Rewards`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/rewards/) | `null`>
Defined in: index.d.ts:182
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`Rewards`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/rewards/) | `null`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
Defined in: index.d.ts:145
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#getstakedbalance)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(): `Promise`<`bigint`>
Defined in: index.d.ts:179
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:142
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`never`>
Defined in: index.d.ts:185
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`never`>
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: index.d.ts:141
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
Defined in: index.d.ts:139
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:140
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#requestwithdrawal)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
Defined in: index.d.ts:138
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/#stake)
# IStakingProtocol
Defined in: index.d.ts:137
## Extended by
[Section titled “Extended by”](#extended-by)
* [`StakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/stakingprotocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new IStakingProtocol**(): `IStakingProtocol`
#### Returns
[Section titled “Returns”](#returns)
`IStakingProtocol`
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/)>
Defined in: index.d.ts:143
#### Parameters
[Section titled “Parameters”](#parameters)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/)>
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:146
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
Defined in: index.d.ts:145
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:142
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: index.d.ts:144
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/), `"hash"`>>
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: index.d.ts:141
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
Defined in: index.d.ts:139
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:140
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
Defined in: index.d.ts:138
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
# StakingProtocol
Defined in: index.d.ts:149
## Extends
[Section titled “Extends”](#extends)
* [`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/)
## Extended by
[Section titled “Extended by”](#extended-by)
* [`default`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/default/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new StakingProtocol**(`account`): `StakingProtocol`
Defined in: index.d.ts:151
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
[`StakingWalletAccount`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakingwalletaccount/)
#### Returns
[Section titled “Returns”](#returns)
`StakingProtocol`
#### Overrides
[Section titled “Overrides”](#overrides)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`constructor`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` **\_account**: [`StakingWalletAccount`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakingwalletaccount/)
Defined in: index.d.ts:150
## Methods
[Section titled “Methods”](#methods)
### claimWithdrawals()
[Section titled “claimWithdrawals()”](#claimwithdrawals)
> **claimWithdrawals**(`options?`): `Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/)>
Defined in: index.d.ts:143
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options?
[Section titled “options?”](#options)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`claimWithdrawals`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#claimwithdrawals)
***
### getApr()
[Section titled “getApr()”](#getapr)
> **getApr**(): `Promise`<`number`>
Defined in: index.d.ts:146
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`getApr`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#getapr)
***
### getStakedBalance()
[Section titled “getStakedBalance()”](#getstakedbalance)
> **getStakedBalance**(): `Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
Defined in: index.d.ts:145
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`StakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakedbalance/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`getStakedBalance`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#getstakedbalance)
***
### getWithdrawalRequests()
[Section titled “getWithdrawalRequests()”](#getwithdrawalrequests)
> **getWithdrawalRequests**(): `Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
Defined in: index.d.ts:142
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WithdrawalRequestsView`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestsview/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`getWithdrawalRequests`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#getwithdrawalrequests)
***
### quoteClaimWithdrawals()
[Section titled “quoteClaimWithdrawals()”](#quoteclaimwithdrawals)
> **quoteClaimWithdrawals**(`options?`): `Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/), `"hash"`>>
Defined in: index.d.ts:144
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### options?
[Section titled “options?”](#options-1)
[`ClaimWithdrawalsOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsoptions/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`Omit`<[`ClaimWithdrawalsResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/claimwithdrawalsresult/), `"hash"`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`quoteClaimWithdrawals`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#quoteclaimwithdrawals)
***
### quoteRequestWithdrawal()
[Section titled “quoteRequestWithdrawal()”](#quoterequestwithdrawal)
> **quoteRequestWithdrawal**(`options`): `Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
Defined in: index.d.ts:141
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### options
[Section titled “options”](#options-2)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Omit`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/), `"hash"` | `"approveHash"`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`quoteRequestWithdrawal`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#quoterequestwithdrawal)
***
### quoteStake()
[Section titled “quoteStake()”](#quotestake)
> **quoteStake**(`options`): `Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
Defined in: index.d.ts:139
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-3)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`Omit`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/), `"hash"`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`quoteStake`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#quotestake)
***
### requestWithdrawal()
[Section titled “requestWithdrawal()”](#requestwithdrawal)
> **requestWithdrawal**(`options`): `Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
Defined in: index.d.ts:140
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### options
[Section titled “options”](#options-4)
[`WithdrawalRequestOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`WithdrawalRequestResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequestresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`requestWithdrawal`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#requestwithdrawal)
***
### stake()
[Section titled “stake()”](#stake)
> **stake**(`options`): `Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
Defined in: index.d.ts:138
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### options
[Section titled “options”](#options-5)
[`StakeOptions`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeoptions/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`StakeResult`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/stakeresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`IStakingProtocol`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/).[`stake`](/api/anywalletkit/protocol-staking-tonstakers-ton/classes/istakingprotocol/#stake)
# buildStakeBody
> **buildStakeBody**(`partnerCode`): `Cell`
Defined in: index.d.ts:159
## Parameters
[Section titled “Parameters”](#parameters)
### partnerCode
[Section titled “partnerCode”](#partnercode)
`number` | `bigint`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# buildUnstakeBody
> **buildUnstakeBody**(`amount`, `owner`, `mode?`): `Cell`
Defined in: index.d.ts:160
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
### owner
[Section titled “owner”](#owner)
`Address`
### mode?
[Section titled “mode?”](#mode)
[`UnstakeMode`](/api/anywalletkit/protocol-staking-tonstakers-ton/type-aliases/unstakemode/)
## Returns
[Section titled “Returns”](#returns)
`Cell`
# deriveTonstakersJettonWallet
> **deriveTonstakersJettonWallet**(`owner`, `minter`, `code`): `Address`
Defined in: index.d.ts:164
The owner’s tsTON jetton-wallet address under `minter`, from the wallet code and its initial data.
## Parameters
[Section titled “Parameters”](#parameters)
### owner
[Section titled “owner”](#owner)
`Address`
### minter
[Section titled “minter”](#minter)
`Address`
### code
[Section titled “code”](#code)
`Cell`
## Returns
[Section titled “Returns”](#returns)
`Address`
# describeTonstakersActivity
> **describeTonstakersActivity**(`tx`, `ctx`, `deployment`): `ActivityItem` | `null`
Defined in: index.d.ts:188
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### deployment
[Section titled “deployment”](#deployment)
#### addresses
[Section titled “addresses”](#addresses)
{ `jetton?`: `string`; `pool`: `string`; }
#### addresses.jetton?
[Section titled “addresses.jetton?”](#addressesjetton)
`string`
#### addresses.pool
[Section titled “addresses.pool”](#addressespool)
`string`
#### network
[Section titled “network”](#network)
`string` | `number`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# rawAddress
> **rawAddress**(`address`): `string` | `null`
Defined in: index.d.ts:190
Raw `wc:hex` form of any TON address spelling, or null when unparsable.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# ClaimWithdrawalsOptions
Defined in: index.d.ts:61
## Properties
[Section titled “Properties”](#properties)
### ids?
[Section titled “ids?”](#ids)
> `optional` **ids?**: `bigint`\[]
Defined in: index.d.ts:62
# ClaimWithdrawalsResult
Defined in: index.d.ts:65
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:67
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:66
# PoolData
Defined in: index.d.ts:81
## Properties
[Section titled “Properties”](#properties)
### depositsOpen
[Section titled “depositsOpen”](#depositsopen)
> **depositsOpen**: `boolean`
Defined in: index.d.ts:83
***
### halted
[Section titled “halted”](#halted)
> **halted**: `boolean`
Defined in: index.d.ts:82
***
### jettonMinter
[Section titled “jettonMinter”](#jettonminter)
> **jettonMinter**: `Address` | `null`
Defined in: index.d.ts:86
***
### projectedBalance
[Section titled “projectedBalance”](#projectedbalance)
> **projectedBalance**: `bigint`
Defined in: index.d.ts:88
***
### projectedRate
[Section titled “projectedRate”](#projectedrate)
> **projectedRate**: `bigint`
Defined in: index.d.ts:91
***
### projectedSupply
[Section titled “projectedSupply”](#projectedsupply)
> **projectedSupply**: `bigint`
Defined in: index.d.ts:89
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: index.d.ts:90
***
### supply
[Section titled “supply”](#supply)
> **supply**: `bigint`
Defined in: index.d.ts:85
***
### totalBalance
[Section titled “totalBalance”](#totalbalance)
> **totalBalance**: `bigint`
Defined in: index.d.ts:84
***
### withdrawalPayout
[Section titled “withdrawalPayout”](#withdrawalpayout)
> **withdrawalPayout**: `Address` | `null`
Defined in: index.d.ts:87
# Rewards
Defined in: index.d.ts:94
## Properties
[Section titled “Properties”](#properties)
### deposited
[Section titled “deposited”](#deposited)
> **deposited**: `bigint`
Defined in: index.d.ts:99
***
### earned
[Section titled “earned”](#earned)
> **earned**: `bigint`
Defined in: index.d.ts:96
GRAM earned on the tsTON still held, at the current rate (nanotons).
***
### entryRate
[Section titled “entryRate”](#entryrate)
> **entryRate**: `bigint`
Defined in: index.d.ts:98
Weighted average GRAM per tsTON the position was entered at (1e9 fixed).
***
### firstStakeAt
[Section titled “firstStakeAt”](#firststakeat)
> **firstStakeAt**: `number` | `null`
Defined in: index.d.ts:102
Unix seconds.
***
### minted
[Section titled “minted”](#minted)
> **minted**: `bigint`
Defined in: index.d.ts:100
# StakedBalance
Defined in: index.d.ts:70
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: index.d.ts:72
tsTON balance.
***
### rate
[Section titled “rate”](#rate)
> **rate**: `bigint`
Defined in: index.d.ts:76
GRAM per tsTON, 1e9 fixed point.
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: index.d.ts:78
The position valued in GRAM at `rate`.
***
### wrappedBalance
[Section titled “wrappedBalance”](#wrappedbalance)
> **wrappedBalance**: `bigint`
Defined in: index.d.ts:74
Always 0n.
# StakeOptions
Defined in: index.d.ts:4
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: index.d.ts:6
Amount in nanotons, excluding the 1 GRAM fee reserve the module attaches.
# StakeResult
Defined in: index.d.ts:9
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:11
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:10
# StakingWalletAccount
Defined in: index.d.ts:114
The account surface the protocol needs. Writable methods are optional — views work with a read-only account that only implements getAddress.
## Properties
[Section titled “Properties”](#properties)
### \_config?
[Section titled “\_config?”](#_config)
> `optional` **\_config?**: `object`
Defined in: index.d.ts:119
#### tonClient?
[Section titled “tonClient?”](#tonclient)
> `optional` **tonClient?**: `unknown`
***
### \_tonClient?
[Section titled “\_tonClient?”](#_tonclient)
> `optional` **\_tonClient?**: `unknown`
Defined in: index.d.ts:118
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: index.d.ts:115
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### quoteSendTransaction()?
[Section titled “quoteSendTransaction()?”](#quotesendtransaction)
> `optional` **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: index.d.ts:117
#### Parameters
[Section titled “Parameters”](#parameters)
##### tx
[Section titled “tx”](#tx)
###### body?
[Section titled “body?”](#body)
`Cell`
###### bounceable?
[Section titled “bounceable?”](#bounceable)
`boolean`
###### to
[Section titled “to”](#to)
`string`
###### value
[Section titled “value”](#value)
`bigint`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<{ `fee`: `bigint`; }>
***
### sendTransaction()?
[Section titled “sendTransaction()?”](#sendtransaction)
> `optional` **sendTransaction**(`tx`): `Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
Defined in: index.d.ts:116
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx-1)
###### body?
[Section titled “body?”](#body-1)
`Cell`
###### bounceable?
[Section titled “bounceable?”](#bounceable-1)
`boolean`
###### to
[Section titled “to”](#to-1)
`string`
###### value
[Section titled “value”](#value-1)
`bigint`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `fee?`: `bigint`; `hash`: `string`; }>
# TonClientConfig
Defined in: index.d.ts:105
## Properties
[Section titled “Properties”](#properties)
### secretKey?
[Section titled “secretKey?”](#secretkey)
> `optional` **secretKey?**: `string`
Defined in: index.d.ts:107
***
### url
[Section titled “url”](#url)
> **url**: `string`
Defined in: index.d.ts:106
# TonstakersBill
Defined in: index.d.ts:43
## Extends
[Section titled “Extends”](#extends)
* [`WithdrawalRequest`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: index.d.ts:36
tsTON the bill settles (base units).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/).[`amount`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/#amount)
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: index.d.ts:40
Always false: bills are settled by the pool, never claimed.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/).[`claimable`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/#claimable)
***
### estimatedPayout
[Section titled “estimatedPayout”](#estimatedpayout)
> **estimatedPayout**: `number`
Defined in: index.d.ts:49
Unix seconds — round end plus the pool’s settlement lag.
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: index.d.ts:34
The payout bill NFT’s index in its collection.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/).[`id`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/#id)
***
### nft
[Section titled “nft”](#nft)
> **nft**: `string`
Defined in: index.d.ts:45
Bill NFT address.
***
### roundEnd
[Section titled “roundEnd”](#roundend)
> **roundEnd**: `number`
Defined in: index.d.ts:47
Unix seconds — when the round ends.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: index.d.ts:38
Unix seconds — the round’s start.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WithdrawalRequest`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/).[`timestamp`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/withdrawalrequest/#timestamp)
# TonstakersProtocolConfig
Defined in: index.d.ts:122
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: `object`
Defined in: index.d.ts:127
#### jetton?
[Section titled “jetton?”](#jetton)
> `optional` **jetton?**: `string`
#### pool?
[Section titled “pool?”](#pool)
> `optional` **pool?**: `string`
***
### allowUnverifiedJettonWallet?
[Section titled “allowUnverifiedJettonWallet?”](#allowunverifiedjettonwallet)
> `optional` **allowUnverifiedJettonWallet?**: `boolean`
Defined in: index.d.ts:131
For a minter with no known code: trust the node’s get_wallet_address unchecked. Off by default.
***
### endpoints?
[Section titled “endpoints?”](#endpoints)
> `optional` **endpoints?**: `object`
Defined in: index.d.ts:134
Set a key to null to disable that feature.
#### tonapi?
[Section titled “tonapi?”](#tonapi)
> `optional` **tonapi?**: `string` | `null`
#### withdrawalPayouts?
[Section titled “withdrawalPayouts?”](#withdrawalpayouts)
> `optional` **withdrawalPayouts?**: `string` | `null`
***
### jettonWalletCode?
[Section titled “jettonWalletCode?”](#jettonwalletcode)
> `optional` **jettonWalletCode?**: `string` | `Cell`
Defined in: index.d.ts:129
Jetton-wallet code (Cell or base64 BOC) of a minter not in TONSTAKERS_JETTON_WALLET_CODES; the wallet is derived from it.
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
Defined in: index.d.ts:126
“-239” mainnet (default) or “-3” testnet.
***
### partnerCode?
[Section titled “partnerCode?”](#partnercode)
> `optional` **partnerCode?**: `number` | `bigint`
Defined in: index.d.ts:132
***
### tonClient?
[Section titled “tonClient?”](#tonclient)
> `optional` **tonClient?**: `unknown`
Defined in: index.d.ts:124
A @ton/ton TonClient, a {url, secretKey} config, or an array of either (tried in order). Defaults to the account’s client.
# WithdrawalRequest
Defined in: index.d.ts:32
## Extended by
[Section titled “Extended by”](#extended-by)
* [`TonstakersBill`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonstakersbill/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: index.d.ts:36
tsTON the bill settles (base units).
***
### claimable
[Section titled “claimable”](#claimable)
> **claimable**: `boolean`
Defined in: index.d.ts:40
Always false: bills are settled by the pool, never claimed.
***
### id
[Section titled “id”](#id)
> **id**: `bigint`
Defined in: index.d.ts:34
The payout bill NFT’s index in its collection.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: index.d.ts:38
Unix seconds — the round’s start.
# WithdrawalRequestOptions
Defined in: index.d.ts:16
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `number` | `bigint`
Defined in: index.d.ts:18
tsTON in base units.
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: [`UnstakeMode`](/api/anywalletkit/protocol-staking-tonstakers-ton/type-aliases/unstakemode/)
Defined in: index.d.ts:22
Exit path — default “standard”.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: index.d.ts:20
Accepted for interface parity; tsTON is the only staked form.
# WithdrawalRequestResult
Defined in: index.d.ts:25
## Properties
[Section titled “Properties”](#properties)
### approveHash
[Section titled “approveHash”](#approvehash)
> **approveHash**: `null`
Defined in: index.d.ts:29
Always null — a burn needs no approval.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: index.d.ts:27
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: index.d.ts:26
# WithdrawalRequestsView
Defined in: index.d.ts:52
## Properties
[Section titled “Properties”](#properties)
### claimableAmount
[Section titled “claimableAmount”](#claimableamount)
> **claimableAmount**: `bigint`
Defined in: index.d.ts:56
Always 0n.
***
### claimableIds
[Section titled “claimableIds”](#claimableids)
> **claimableIds**: `bigint`\[]
Defined in: index.d.ts:58
Always empty.
***
### pendingAmount
[Section titled “pendingAmount”](#pendingamount)
> **pendingAmount**: `bigint`
Defined in: index.d.ts:54
***
### requests
[Section titled “requests”](#requests)
> **requests**: [`TonstakersBill`](/api/anywalletkit/protocol-staking-tonstakers-ton/interfaces/tonstakersbill/)\[]
Defined in: index.d.ts:53
# UnstakeMode
> **UnstakeMode** = `"standard"` | `"instant"` | `"bestRate"`
Defined in: index.d.ts:14
# MIN_STAKE
> `const` **MIN_STAKE**: `bigint`
Defined in: index.d.ts:158
# OP_STAKE
> `const` **OP_STAKE**: `number`
Defined in: index.d.ts:154
# OP_UNSTAKE
> `const` **OP_UNSTAKE**: `number`
Defined in: index.d.ts:155
# OP_WITHDRAWAL_PAYOUT
> `const` **OP_WITHDRAWAL_PAYOUT**: `number`
Defined in: index.d.ts:191
# STAKE_FEE_RESERVE
> `const` **STAKE_FEE_RESERVE**: `bigint`
Defined in: index.d.ts:156
# TONSTAKERS_ADDRESS_MAP
> `const` **TONSTAKERS_ADDRESS_MAP**: `Record`<`string`, { `endpoints`: { `tonapi`: `string`; `withdrawalPayouts`: `string`; }; `jetton?`: `string`; `partnerCode`: `bigint`; `pool`: `string`; }>
Defined in: index.d.ts:166
# TONSTAKERS_JETTON_WALLET_CODES
> `const` **TONSTAKERS_JETTON_WALLET_CODES**: `Readonly`<`Record`<`string`, `string`>>
Defined in: index.d.ts:162
Pinned tsTON jetton-wallet code (base64 BOC) per minter raw address.
# UNSTAKE_FEE_RESERVE
> `const` **UNSTAKE_FEE_RESERVE**: `bigint`
Defined in: index.d.ts:157
# @anywalletkit/protocol-swap2-balancer
# @anywalletkit/protocol-swap2-balancer
[Section titled “@anywalletkit/protocol-swap2-balancer”](#anywalletkitprotocol-swap2-balancer)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-balancer)
Balancer v2 same-chain swaps as a swap2 module: Smart Order Router paths from the Balancer API, `queryBatchSwap` on the Vault for the on-chain quote, `batchSwap` execution, on the chains in `BALANCER_V2_CHAINS` (Vault `WETH()` verified before use). Standalone through `BalancerSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-balancer @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-balancer @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-balancer @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-balancer](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-balancer), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "balancer", baseUrl, ...balancerPins})`. The engine then lets the EVM route call and approve only the Balancer V2 Vault, never an address the backend names; without the pins the stub gets no EVM calldata route (fail closed). The pins carry `verifyQuote: balancerVerifyQuote`, which opens the Vault call on the device: only `batchSwap` of kind GIVEN_IN, no internal balances or pool `userData`, at most `BALANCER_MAX_SWAPS` hops, funds from this account to the recipient, the hops selling exactly the input of the source token, and limits of exactly the input in and the quote’s minimum out. `manageUserBalance`, `setRelayerApproval`, `swap` and every other Vault call are refused.
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` recognizes `batchSwap` `0x945bcec9` and `swap` `0x52bbbe29` on the Vault (`0xBA12…2C8`, the same address on every chain) on a chain this module serves, as `swap`, “Swapped A → B” from the owner’s net transfers (a native `value` leg included). Subtitle `Balancer v2 · `, counterparty = the Vault.
Fixtures (`fixtures/activity/`, public Ethereum transactions — the test wallet’s Balancer runs were quote-only on the matrix): Vault `swap` COW → GNO, `batchSwap` BAL → USDT (the call this module builds), `batchSwap` ETH → WNCG with native input; negatives: a Uniswap `exactInputSingle`, a LI.FI swap.
## Classes
[Section titled “Classes”](#classes)
* [BalancerSwap2Protocol](/api/anywalletkit/protocol-swap2-balancer/classes/balancerswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [BalancerProviderConfig](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/)
* [BalancerSwap2Config](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [BALANCER_MAX_SWAPS](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_max_swaps/)
* [BALANCER_MODULE](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_module/)
* [BALANCER_V2_CHAINS](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_v2_chains/)
* [BALANCER_V2_VAULT](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_v2_vault/)
* [BALANCER_VAULT_SELECTORS](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_vault_selectors/)
* [balancerPins](/api/anywalletkit/protocol-swap2-balancer/variables/balancerpins/)
## Functions
[Section titled “Functions”](#functions)
* [balancerProvider](/api/anywalletkit/protocol-swap2-balancer/functions/balancerprovider/)
* [balancerVerifyQuote](/api/anywalletkit/protocol-swap2-balancer/functions/balancerverifyquote/)
* [describeBalancerActivity](/api/anywalletkit/protocol-swap2-balancer/functions/describebalanceractivity/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [BalancerSwap2Protocol](/api/anywalletkit/protocol-swap2-balancer/classes/balancerswap2protocol/)
# BalancerSwap2Protocol
Defined in: protocol-swap2-balancer/src/protocol.ts:9
Balancer v2 as a standalone swap2 protocol (same-chain swaps on one account).
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BalancerSwap2Protocol**(`account`, `config`): `BalancerSwap2Protocol`
Defined in: protocol-swap2-balancer/src/protocol.ts:12
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`BalancerSwap2Config`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`BalancerSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-balancer/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-balancer/src/protocol.ts:17
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-balancer/src/protocol.ts:20
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# balancerProvider
> **balancerProvider**(`config`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-balancer/src/provider.ts:80
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# balancerVerifyQuote
> **balancerVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-balancer/src/provider.ts:316
The batch a Balancer quote’s Vault call makes, opened on the client against the app’s own request (scan 2026-10-28, F2): only `batchSwap` of kind GIVEN_IN on the Vault, with no internal balances and no pool `userData`, at most [BALANCER_MAX_SWAPS](/api/anywalletkit/protocol-swap2-balancer/variables/balancer_max_swaps/) hops; funds taken from the sender the provider names (the refund address, else the recipient) and paid to the recipient; every swap that brings in an amount sells the source token (the Vault’s ETH sentinel for a native input), the amounts adding up to exactly the input; one hop delivers the destination token; and the limits allow paying exactly the input and receiving at least the quote’s minimum, nothing of anything else. `manageUserBalance`, `swap`, `setRelayerApproval` and every other Vault call are refused. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# describeBalancerActivity
> **describeBalancerActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-balancer/src/activity.ts:19
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# BalancerProviderConfig
Defined in: protocol-swap2-balancer/src/provider.ts:53
## Extended by
[Section titled “Extended by”](#extended-by)
* [`BalancerSwap2Config`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-balancer/src/provider.ts:58
Balancer API (SOR) base URL — discovery only.
***
### deadlineSeconds?
[Section titled “deadlineSeconds?”](#deadlineseconds)
> `optional` **deadlineSeconds?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:61
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:59
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-balancer/src/provider.ts:54
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:60
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-balancer/src/provider.ts:56
JSON-RPC endpoints per EVM chain id (on-chain pricing + receipts).
# BalancerSwap2Config
Defined in: protocol-swap2-balancer/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-balancer/src/provider.ts:58
Balancer API (SOR) base URL — discovery only.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#apiurl)
***
### deadlineSeconds?
[Section titled “deadlineSeconds?”](#deadlineseconds)
> `optional` **deadlineSeconds?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:61
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`deadlineSeconds`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#deadlineseconds)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2EngineConfig.decodeTonBody`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:59
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`defaultSlippageBps`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#defaultslippagebps)
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-balancer/src/provider.ts:54
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-balancer/src/provider.ts:60
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-balancer/src/provider.ts:56
JSON-RPC endpoints per EVM chain id (on-chain pricing + receipts).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`BalancerProviderConfig`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-balancer/interfaces/balancerproviderconfig/#rpcurls)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.tonGasCeiling`
# BALANCER_MAX_SWAPS
> `const` **BALANCER_MAX_SWAPS**: `16` = `16`
Defined in: protocol-swap2-balancer/src/provider.ts:27
Most pool hops one batch may carry: the SOR’s splits are a handful; a batch past this is refused at quote and at preflight.
# BALANCER_MODULE
> `const` **BALANCER_MODULE**: `"@anywalletkit/protocol-swap2-balancer"` = `"@anywalletkit/protocol-swap2-balancer"`
Defined in: protocol-swap2-balancer/src/activity.ts:11
# BALANCER_V2_CHAINS
> `const` **BALANCER_V2_CHAINS**: `Readonly`<`Record`<`number`, { `api`: `string`; `weth`: `` `0x${string}` ``; }>>
Defined in: protocol-swap2-balancer/src/provider.ts:30
Chains where the v2 Vault is live, with the SOR API name and the Vault’s WETH() (verified on-chain 2026-10-13).
# BALANCER_V2_VAULT
> `const` **BALANCER_V2_VAULT**: `"0xBA12222222228d8Ba445958a75a0704d566BF2C8"` = `"0xBA12222222228d8Ba445958a75a0704d566BF2C8"`
Defined in: protocol-swap2-balancer/src/provider.ts:21
The same Balancer v2 Vault address on every chain it is deployed on.
# BALANCER_VAULT_SELECTORS
> `const` **BALANCER_VAULT_SELECTORS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-balancer/src/activity.ts:14
Vault swap entry points (`viem toFunctionSelector`, 2026-10-14).
# balancerPins
> `const` **balancerPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-balancer/src/provider.ts:379
The Balancer V2 Vault a swap calls and approves on the chains this provider serves, and [balancerVerifyQuote](/api/anywalletkit/protocol-swap2-balancer/functions/balancerverifyquote/) — the app’s pins for `remoteProvider({name: "balancer", baseUrl, ...balancerPins})` (scan 2026-10-27 modules, F8/F16; scan 2026-10-28, F2).
# @anywalletkit/protocol-swap2-cctp
# @anywalletkit/protocol-swap2-cctp
[Section titled “@anywalletkit/protocol-swap2-cctp”](#anywalletkitprotocol-swap2-cctp)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-cctp)
[Circle CCTP V2](https://developers.circle.com/cctp) as a swap2 provider: native USDC between EVM chains by **burn-and-mint** — no spread, no aggregator fee; Fast Transfer costs the fee Circle publishes per pair (around 1 bps), Standard is free and waits for source finality.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-cctp @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-cctp @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-cctp @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-cctp](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-cctp), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
CCTP is **two-phase**. `depositForBurn` on the source chain burns the USDC; Circle’s attestation service signs the message; `receiveMessage(message, attestation)` on the destination mints — and that second transaction is the user’s own, paid in the destination chain’s gas. The swap2 engine learned this with the package:
```ts
import {cctpProvider} from "@anywalletkit/protocol-swap2-cctp/provider";
import {RouterSwap2Protocol} from "@anywalletkit/protocol-swap2-router/swap2/router";
const swap2 = new RouterSwap2Protocol(baseAccount, {fromChain: "eip155:8453", providers: [cctpProvider({rpcUrls})]});
const res = await swap2.swap2({fromToken: "USDC", toToken: "USDC", toChain: 42161, fromTokenAmount: 10_000_000n, minAmountOut: 9_998_570n});
// … poll …
const status = await swap2.getSwap2Status(res.id); // "pending" → "action-required" once Circle attested
if (status.status === "action-required") {
const claimed = await swap2.claimSwap2(res.id, arbitrumAccount); // receiveMessage on Arbitrum, signed there
await swap2.getSwap2Status(claimed.id); // this id carries the claim hash: "completed" even without an Arbitrum RPC
}
```
`claimSwap2(id, destinationAccount)` is on every swap2 protocol (router or single-provider); providers opt in with `buildClaim(ref)`, which returns the destination transaction or `null` while the attestation is pending. `IntentStatus.claim = {chain, ready}` tells the app which chain the claim lives on. The remote provider forwards it as the `claim` action.
The engine sends a claim only to a contract the provider declares for that chain (`claimTargets`; CCTP: its MessageTransmitter) and refuses calldata that moves the account’s tokens or grants an allowance. A remote stub takes the list from the app, never from the server:
```ts
remoteProvider({name: "cctp", baseUrl, ...cctpPins}) // cctpPins from this package: TokenMessenger + MessageTransmitter
```
`cctpPins` also pins the burn: the TokenMessenger is the only contract the source leg may call and approve, and `cctpVerifyQuote` decodes the server’s `depositForBurn` on the device — the input amount, the destination domain, the recipient as `mintRecipient`, the source USDC, no destination caller, and a `maxFee` that leaves the quoted minimum. Without the pins the engine refuses the stub’s EVM routes.
## What the provider does
[Section titled “What the provider does”](#what-the-provider-does)
* **Mode** `auto` (default) takes Fast when the pair offers it and Circle’s Fast allowance covers the amount, else Standard; `fast` / `standard` force one. Fees come from `GET /v2/burn/USDC/fees/{src}/{dst}` (bps), the allowance from `GET /v2/fastBurn/USDC/allowance`.
* **Output is guaranteed**: `maxFee` in the calldata = published fee + a 10 % buffer (`feeBufferPct`), and Circle can deduct at most `maxFee`; the quote’s `minDestAmount` is `amount − maxFee`. The unused buffer is never charged.
* **Calldata is sealed in the quote** (recipient, native USDC of the source domain, destination domain, `maxFee`, finality threshold) and the engine executes exactly that; `approvalAddress` is the TokenMessengerV2.
* **Preflight with an RPC** (`rpcUrls`): the TokenMessengerV2 the calldata targets must point at the expected MessageTransmitterV2, whose `localDomain()` must be the source domain, and `getMinFeeAmount(amount)` must fit `maxFee`. Without an RPC the on-chain check is skipped.
* **Tracking**: `GET /v2/messages/{src}?transactionHash=` → `pending` while confirmations accrue, `action-required` once `status: complete` with the attestation, `completed` once the destination’s `usedNonces(nonce)` is set (needs the destination RPC; otherwise a recorded claim hash counts).
* **Claim**: `receiveMessage(message, attestation)` on the destination MessageTransmitterV2; the attested message must belong to the route’s domains. An expired Fast message (`expirationBlock` passed) is sent to `POST /v2/reattest/{nonce}` and reported not-ready until Circle re-signs.
* **Domains**: 17 EVM chains (Ethereum, Avalanche, OP, Arbitrum, Base, Polygon, Unichain, Linea, Sonic, World Chain, Monad, Sei, HyperEVM, Ink, Plume, Plasma, X Layer), the same TokenMessengerV2 / MessageTransmitterV2 on all of them, and each domain’s **native** USDC. Chains whose catalog USDC is not Circle’s (BSC, Gnosis USDC.e) are refused. Solana (domain 5) is not executed here yet: the engine runs calldata on EVM only.
## Tests
[Section titled “Tests”](#tests)
`pnpm test` — provider tests over a fake Circle API + fake JSON-RPC (fee maths, calldata binding, mode fallbacks, preflight refusals, the whole pending → action-required → completed lifecycle, claim building, expiry / re-attestation) and the conformance suite; the engine’s `claimSwap2` has its own tests in `protocol-swap2-core`. `pnpm verify:live` quotes USDC Base → Arbitrum $10 in both modes against the live API and preflights on Base.
## Status
[Section titled “Status”](#status)
2026-10-10: built, tests green, live quote + preflight verified. No funded transfer yet (plan: $10 USDC Base → Arbitrum, Fast and Standard, with the claim from the phone).
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` (on the provider; the protocol class and the router delegate to it) recognizes both halves of a CCTP V2 transfer on every domain in `config.ts`, by contract + 4-byte selector:
| Call | Contract | Kind | Title |
| ------------------------------------------------------------------------------------ | -------------------- | -------- | ------------------------ |
| `depositForBurn(uint256,uint32,bytes32,address,bytes32,uint256,uint32)` `0x8e0250ee` | TokenMessengerV2 | `bridge` | “Bridged USDC” |
| `receiveMessage(bytes,bytes)` `0x57ecfd28` | MessageTransmitterV2 | `bridge` | “Received USDC via CCTP” |
Assets come from the owner’s net transfers (the burn leaves the wallet; the mint lands on the `mintRecipient` even when a relayer paid the claim). Subtitle `CCTP · `, counterparty = the contract called. The other leg’s hash is only known through the kit’s intent journal / Circle’s attestation API, so `related` stays empty. Fixtures in `fixtures/activity/` are public Ethereum transactions (two burns, two claims) plus negatives (a LI.FI bridge, a THORChain deposit); the conformance suite runs them through `describeActivity`.
## Classes
[Section titled “Classes”](#classes)
* [CctpSwap2Protocol](/api/anywalletkit/protocol-swap2-cctp/classes/cctpswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [CctpDomain](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpdomain/)
* [CctpProviderConfig](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/)
* [CctpSwap2Config](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpswap2config/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [CctpMode](/api/anywalletkit/protocol-swap2-cctp/type-aliases/cctpmode/)
## Variables
[Section titled “Variables”](#variables)
* [cctp](/api/anywalletkit/protocol-swap2-cctp/variables/cctp/)
* [CCTP_API](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_api/)
* [CCTP_BY_DOMAIN](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_by_domain/)
* [CCTP_DEPOSIT_FOR_BURN](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_deposit_for_burn/)
* [CCTP_DOMAINS](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_domains/)
* [CCTP_MODULE](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_module/)
* [CCTP_RECEIVE_MESSAGE](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_receive_message/)
* [CCTP_SOLANA_DOMAIN](/api/anywalletkit/protocol-swap2-cctp/variables/cctp_solana_domain/)
* [cctpPins](/api/anywalletkit/protocol-swap2-cctp/variables/cctppins/)
* [FINALITY_FAST](/api/anywalletkit/protocol-swap2-cctp/variables/finality_fast/)
* [FINALITY_STANDARD](/api/anywalletkit/protocol-swap2-cctp/variables/finality_standard/)
* [MESSAGE_TRANSMITTER_V2](/api/anywalletkit/protocol-swap2-cctp/variables/message_transmitter_v2/)
* [TOKEN_MESSENGER_V2](/api/anywalletkit/protocol-swap2-cctp/variables/token_messenger_v2/)
## Functions
[Section titled “Functions”](#functions)
* [cctpClaimTargets](/api/anywalletkit/protocol-swap2-cctp/functions/cctpclaimtargets/)
* [cctpProvider](/api/anywalletkit/protocol-swap2-cctp/functions/cctpprovider/)
* [cctpVerifyQuote](/api/anywalletkit/protocol-swap2-cctp/functions/cctpverifyquote/)
* [describeCctpActivity](/api/anywalletkit/protocol-swap2-cctp/functions/describecctpactivity/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [CctpSwap2Protocol](/api/anywalletkit/protocol-swap2-cctp/classes/cctpswap2protocol/)
# CctpSwap2Protocol
Defined in: protocol-swap2-cctp/src/protocol.ts:9
Standalone CCTP swap2: USDC burn-and-mint between EVM chains, claim via `claimSwap2`.
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new CctpSwap2Protocol**(`account`, `config`): `CctpSwap2Protocol`
Defined in: protocol-swap2-cctp/src/protocol.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`CctpSwap2Config`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`CctpSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-cctp/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-cctp/src/protocol.ts:15
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-cctp/src/protocol.ts:18
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# cctpClaimTargets
> **cctpClaimTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-cctp/src/provider.ts:101
The contracts a CCTP claim may call on `chain`: its MessageTransmitter (`receiveMessage`). Pass it as `claimTargets` to a remote provider stub so the app, not the server, decides (round 3, M24).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
# cctpProvider
> **cctpProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-cctp/src/provider.ts:106
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# cctpVerifyQuote
> **cctpVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-cctp/src/provider.ts:376
A remote CCTP quote’s burn, decoded on the device against the app’s own request (scan 2026-10-30, F3): exactly `depositForBurn` on the source TokenMessengerV2 with no value, approving it; the input amount; the destination chain’s domain; the recipient as `mintRecipient`; the source domain’s native USDC; no destination caller; a Fast or Standard threshold; and a `maxFee` that leaves at least the quoted minimum and the caller’s floor. The reason it fails, or null. The engine then requires the build to repeat this quote’s call.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# describeCctpActivity
> **describeCctpActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-cctp/src/activity.ts:20
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# CctpDomain
Defined in: protocol-swap2-cctp/src/config.ts:9
## Properties
[Section titled “Properties”](#properties)
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: protocol-swap2-cctp/src/config.ts:10
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-swap2-cctp/src/config.ts:11
***
### domain
[Section titled “domain”](#domain)
> **domain**: `number`
Defined in: protocol-swap2-cctp/src/config.ts:12
***
### messageTransmitter
[Section titled “messageTransmitter”](#messagetransmitter)
> **messageTransmitter**: `string`
Defined in: protocol-swap2-cctp/src/config.ts:16
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-swap2-cctp/src/config.ts:13
***
### tokenMessenger
[Section titled “tokenMessenger”](#tokenmessenger)
> **tokenMessenger**: `string`
Defined in: protocol-swap2-cctp/src/config.ts:15
***
### usdc
[Section titled “usdc”](#usdc)
> **usdc**: `string`
Defined in: protocol-swap2-cctp/src/config.ts:14
# CctpProviderConfig
Defined in: protocol-swap2-cctp/src/provider.ts:52
## Extended by
[Section titled “Extended by”](#extended-by)
* [`CctpSwap2Config`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-cctp/src/provider.ts:55
Circle attestation API base (default ).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-cctp/src/provider.ts:53
***
### feeBufferPct?
[Section titled “feeBufferPct?”](#feebufferpct)
> `optional` **feeBufferPct?**: `number`
Defined in: protocol-swap2-cctp/src/provider.ts:59
Extra headroom on the published Fast fee, in percent of the fee (default 10). The excess is never charged.
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-cctp/src/provider.ts:69
Injectable for tests.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: [`CctpMode`](/api/anywalletkit/protocol-swap2-cctp/type-aliases/cctpmode/)
Defined in: protocol-swap2-cctp/src/provider.ts:57
Fast when offered and within the allowance (default), or force one path.
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-cctp/src/provider.ts:67
Local lifetime of a quote (fees are stable; default 60 s).
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-cctp/src/provider.ts:65
JSON-RPC URLs per CAIP-2 chain. Optional, but with them the provider verifies the contracts before the burn and detects the mint on the destination (`usedNonces`) so the status reaches “completed” by itself.
# CctpSwap2Config
Defined in: protocol-swap2-cctp/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-cctp/src/provider.ts:55
Circle attestation API base (default ).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#apiurl)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-cctp/src/provider.ts:53
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#enabled)
***
### feeBufferPct?
[Section titled “feeBufferPct?”](#feebufferpct)
> `optional` **feeBufferPct?**: `number`
Defined in: protocol-swap2-cctp/src/provider.ts:59
Extra headroom on the published Fast fee, in percent of the fee (default 10). The excess is never charged.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`feeBufferPct`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#feebufferpct)
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-cctp/src/provider.ts:69
Injectable for tests.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-2)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Response`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`fetchImpl`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#fetchimpl)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: [`CctpMode`](/api/anywalletkit/protocol-swap2-cctp/type-aliases/cctpmode/)
Defined in: protocol-swap2-cctp/src/provider.ts:57
Fast when offered and within the allowance (default), or force one path.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`mode`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#mode)
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-cctp/src/provider.ts:67
Local lifetime of a quote (fees are stable; default 60 s).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-4)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-cctp/src/provider.ts:65
JSON-RPC URLs per CAIP-2 chain. Optional, but with them the provider verifies the contracts before the burn and detects the mint on the destination (`usedNonces`) so the status reaches “completed” by itself.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`CctpProviderConfig`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpproviderconfig/#rpcurls)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.tonGasCeiling`
# CctpMode
> **CctpMode** = `"auto"` | `"fast"` | `"standard"`
Defined in: protocol-swap2-cctp/src/provider.ts:50
# cctp
> `const` **cctp**: `object`
Defined in: protocol-swap2-cctp/src/config.ts:67
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean`
# CCTP_API
> `const` **CCTP_API**: `"https://iris-api.circle.com"` = `"https://iris-api.circle.com"`
Defined in: protocol-swap2-cctp/src/config.ts:61
# CCTP_BY_DOMAIN
> `const` **CCTP_BY_DOMAIN**: `Readonly`<`Record`<`number`, [`CctpDomain`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpdomain/)>>
Defined in: protocol-swap2-cctp/src/config.ts:54
CCTP domain → entry.
# CCTP_DEPOSIT_FOR_BURN
> `const` **CCTP_DEPOSIT_FOR_BURN**: `"0x8e0250ee"` = `"0x8e0250ee"`
Defined in: protocol-swap2-cctp/src/activity.ts:16
depositForBurn(uint256,uint32,bytes32,address,bytes32,uint256,uint32) — TokenMessengerV2
# CCTP_DOMAINS
> `const` **CCTP_DOMAINS**: `Readonly`<`Record`<`string`, [`CctpDomain`](/api/anywalletkit/protocol-swap2-cctp/interfaces/cctpdomain/)>>
Defined in: protocol-swap2-cctp/src/config.ts:27
CAIP-2 → CCTP domain.
# CCTP_MODULE
> `const` **CCTP_MODULE**: `"@anywalletkit/protocol-swap2-cctp"` = `"@anywalletkit/protocol-swap2-cctp"`
Defined in: protocol-swap2-cctp/src/activity.ts:13
# CCTP_RECEIVE_MESSAGE
> `const` **CCTP_RECEIVE_MESSAGE**: `"0x57ecfd28"` = `"0x57ecfd28"`
Defined in: protocol-swap2-cctp/src/activity.ts:18
receiveMessage(bytes,bytes) — MessageTransmitterV2
# CCTP_SOLANA_DOMAIN
> `const` **CCTP_SOLANA_DOMAIN**: `5` = `5`
Defined in: protocol-swap2-cctp/src/config.ts:59
Solana is CCTP domain 5 (not executed by this package yet: the engine runs calldata on EVM only).
# cctpPins
> `const` **cctpPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/) & `object`
Defined in: protocol-swap2-cctp/src/provider.ts:426
The TokenMessenger a CCTP burn calls and approves, and the MessageTransmitter its claim calls, per chain, and [cctpVerifyQuote](/api/anywalletkit/protocol-swap2-cctp/functions/cctpverifyquote/) — the app’s pins for `remoteProvider({name: "cctp", baseUrl, ...cctpPins})` (scan 2026-10-27 modules, F8/F16; claims since round 3, M24; the burn’s arguments since scan 2026-10-30, F3).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### claimTargets()
[Section titled “claimTargets()”](#claimtargets)
> **claimTargets**(`chain`): readonly `string`\[]
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
# FINALITY_FAST
> `const` **FINALITY_FAST**: `1000` = `1000`
Defined in: protocol-swap2-cctp/src/config.ts:64
Finality thresholds the header carries: Fast Transfer (confirmed) vs Standard (finalized).
# FINALITY_STANDARD
> `const` **FINALITY_STANDARD**: `2000` = `2000`
Defined in: protocol-swap2-cctp/src/config.ts:65
# MESSAGE_TRANSMITTER_V2
> `const` **MESSAGE_TRANSMITTER_V2**: `"0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"` = `"0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"`
Defined in: protocol-swap2-cctp/src/config.ts:20
# TOKEN_MESSENGER_V2
> `const` **TOKEN_MESSENGER_V2**: `"0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d"` = `"0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d"`
Defined in: protocol-swap2-cctp/src/config.ts:19
# @anywalletkit/protocol-swap2-chainflip
# @anywalletkit/protocol-swap2-chainflip
[Section titled “@anywalletkit/protocol-swap2-chainflip”](#anywalletkitprotocol-swap2-chainflip)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-chainflip)
[Chainflip](https://docs.chainflip.io) vault swaps as a swap2 provider: native BTC / ETH / SOL / TRX and USDC / USDT between Ethereum, Arbitrum, Solana, Tron and Bitcoin, priced by Chainflip’s JIT AMM. Quotes and encoding come from Chainflip’s public backend (`chainflip-swap.chainflip.io`). You need no broker account, there is no API key, and the commission is 0 bps.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-chainflip @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-chainflip @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-chainflip @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-chainflip](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-chainflip), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import {chainflipProvider} from "@anywalletkit/protocol-swap2-chainflip/provider";
import {RouterSwap2Protocol} from "@anywalletkit/protocol-swap2-router/swap2/router";
const swap2 = new RouterSwap2Protocol(tronAccount, {fromChain: "tron:728126428", providers: [chainflipProvider()]});
const res = await swap2.swap2({fromToken: "USDT", toToken: "USDC", toChain: 42161, fromTokenAmount: 20_000_000n});
const status = await swap2.getSwap2Status(res.id); // pending → depositReceived → completed (+ egress tx) | refunded
```
| From (sources) | How the swap is sent |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| Ethereum, Arbitrum | `xSwapNative` / `xSwapToken` on the Chainflip Vault; tokens get an exact approval to the Vault first |
| Tron | TRC-20 USDT (or TRX) **to the Vault**, with the swap as a binary note in `raw_data.data` (`memoEncoding: "hex"`) |
Destinations: Ethereum (ETH, USDC, USDT, WBTC), Arbitrum (ETH, USDC, USDT), Solana (SOL, USDC, USDT), Tron (TRX, USDT) and Bitcoin (BTC). Solana and Bitcoin as **sources** are not wired yet.
## Why vault swaps and not deposit channels
[Section titled “Why vault swaps and not deposit channels”](#why-vault-swaps-and-not-deposit-channels)
A deposit channel is an address that Chainflip’s broker opens for you. The client cannot prove where that address forwards the funds: the backend has no lookup by deposit address. With a vault swap, the swap parameters are in the transaction itself — calldata on EVM, the note on Tron — so the wallet can decode and check them before signing. A Tron vault swap also skips the channel’s ingress cost (live 2026-10-20: $20 USDT → 19.48 USDC through the Vault vs −19.5 % through a channel).
## What is checked before signing
[Section titled “What is checked before signing”](#what-is-checked-before-signing)
The provider never forwards the encoder’s output blindly. `getQuote` decodes it (SCALE `VersionedCfParameters` V1, the Tron note, or the EVM Vault ABI) and refuses the quote unless all of the following hold:
* the target is the known Vault for the source chain (`CF_VAULTS`). On Tron it must be a TRC-20 `transfer(Vault, amountIn)` of the quoted token;
* the destination chain id, output asset id and destination address bytes match the request (EVM hex, Tron 20 B, Solana 32 B, BTC as ASCII);
* the refund address is the sender, and the swap is fill-or-kill: `minPriceX128 ≥ ceil(minOut · 2^128 / amountIn)`, retry ≤ 600 blocks, and the oracle slippage guard is what we asked for;
* there is no DCA, no boost, no broker commission and no affiliates.
The minimum output is either the caller’s `minAmountOut` or the expected amount less the slippage (`slippageBps`, or the backend’s recommendation when none is given). If the price can’t be met within the retry window, Chainflip refunds the input to the sender.
## Minimums
[Section titled “Minimums”](#minimums)
These are Chainflip’s per-asset ingress minimums. A smaller amount gets no quote. Ethereum USDC/USDT: $20. Arbitrum, Solana and Tron stables: $10. BTC: 40 000 sat. TRX: 30.
## Status
[Section titled “Status”](#status)
`trackIntent` reads `GET /v2/swaps/{sourceTxHash}`:
* 404 means the swap is not seen yet (pending);
* RECEIVING, SWAPPING and SENDING mean the deposit was received;
* COMPLETED returns the destination tx (`swapEgress.txRef`);
* FAILED returns `refunded` if a refund egress exists, otherwise `failed`.
The endpoint rate-limits (429); the provider retries once.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "chainflip", baseUrl, ...chainflipPins})`. The engine then lets the EVM route call and approve only the Chainflip Vault in `CF_VAULTS`, never an address the backend names; without the pins the stub gets no EVM calldata route (fail closed). The pins carry `verifyQuote: chainflipVerifyQuote`, the provider’s own decode run on the device: the EVM vault call, or the Tron note, must name the app’s destination, refund address and a minimum price that guarantees the quoted minimum. A Tron vault swap is a send to the Tron Vault, so the pins also open the stub to that deposit route (`depositAddressRoutes`); the verifier pins the Vault it pays.
## Config
[Section titled “Config”](#config)
```ts
chainflipProvider({
enabled: true, // default
apiUrl: "https://chainflip-swap.chainflip.io",
maxOraclePriceSlippageBps: 100, // oracle guard in the fill-or-kill params; default = the quote's recommendation, null = off
})
```
## Classes
[Section titled “Classes”](#classes)
* [ChainflipSwap2Protocol](/api/anywalletkit/protocol-swap2-chainflip/classes/chainflipswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [CfAsset](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfasset/)
* [CfParameters](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfparameters/)
* [ChainflipProviderConfig](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/)
* [ChainflipSwap2Config](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipswap2config/)
* [EvmVaultCall](/api/anywalletkit/protocol-swap2-chainflip/interfaces/evmvaultcall/)
* [TronNote](/api/anywalletkit/protocol-swap2-chainflip/interfaces/tronnote/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [CfChain](/api/anywalletkit/protocol-swap2-chainflip/type-aliases/cfchain/)
## Variables
[Section titled “Variables”](#variables)
* [CF_API_DEFAULT](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_api_default/)
* [CF_ASSETS](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_assets/)
* [CF_CHAINS](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_chains/)
* [CF_SOURCE_CHAINS](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_source_chains/)
* [CF_VAULTS](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_vaults/)
* [chainflip](/api/anywalletkit/protocol-swap2-chainflip/variables/chainflip/)
* [CHAINFLIP_MODULE](/api/anywalletkit/protocol-swap2-chainflip/variables/chainflip_module/)
* [chainflipPins](/api/anywalletkit/protocol-swap2-chainflip/variables/chainflippins/)
## Functions
[Section titled “Functions”](#functions)
* [cfAsset](/api/anywalletkit/protocol-swap2-chainflip/functions/cfasset/)
* [chainflipProvider](/api/anywalletkit/protocol-swap2-chainflip/functions/chainflipprovider/)
* [chainflipVerifyQuote](/api/anywalletkit/protocol-swap2-chainflip/functions/chainflipverifyquote/)
* [decodeCfParameters](/api/anywalletkit/protocol-swap2-chainflip/functions/decodecfparameters/)
* [decodeEvmVaultCall](/api/anywalletkit/protocol-swap2-chainflip/functions/decodeevmvaultcall/)
* [decodeTronNote](/api/anywalletkit/protocol-swap2-chainflip/functions/decodetronnote/)
* [describeChainflipActivity](/api/anywalletkit/protocol-swap2-chainflip/functions/describechainflipactivity/)
* [destAddressBytes](/api/anywalletkit/protocol-swap2-chainflip/functions/destaddressbytes/)
* [fromHex](/api/anywalletkit/protocol-swap2-chainflip/functions/fromhex/)
* [minOutOf](/api/anywalletkit/protocol-swap2-chainflip/functions/minoutof/)
* [minPriceX128For](/api/anywalletkit/protocol-swap2-chainflip/functions/minpricex128for/)
* [sameBytes](/api/anywalletkit/protocol-swap2-chainflip/functions/samebytes/)
* [toHex](/api/anywalletkit/protocol-swap2-chainflip/functions/tohex/)
* [tronToBytes](/api/anywalletkit/protocol-swap2-chainflip/functions/trontobytes/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [ChainflipSwap2Protocol](/api/anywalletkit/protocol-swap2-chainflip/classes/chainflipswap2protocol/)
# ChainflipSwap2Protocol
Defined in: protocol-swap2-chainflip/src/protocol.ts:9
Standalone Chainflip swap2: vault swaps from Ethereum, Arbitrum and Tron to every Chainflip chain.
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ChainflipSwap2Protocol**(`account`, `config`): `ChainflipSwap2Protocol`
Defined in: protocol-swap2-chainflip/src/protocol.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`ChainflipSwap2Config`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`ChainflipSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-chainflip/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-chainflip/src/protocol.ts:15
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-chainflip/src/protocol.ts:18
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# cfAsset
> **cfAsset**(`chain`, `token`): [`CfAsset`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfasset/) | `undefined`
Defined in: protocol-swap2-chainflip/src/config.ts:73
The Chainflip asset for a CAIP-2 chain + token (contract / mint, a native marker, or the asset symbol).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### token
[Section titled “token”](#token)
`string`
## Returns
[Section titled “Returns”](#returns)
[`CfAsset`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfasset/) | `undefined`
# chainflipProvider
> **chainflipProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-chainflip/src/provider.ts:47
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`ChainflipProviderConfig`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# chainflipVerifyQuote
> **chainflipVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-chainflip/src/config.ts:93
The provider’s own decode of a vault swap, run on the client against the app’s request (scan 2026-10-28, F9): an EVM source is a vault call (`xSwapNative` / `xSwapToken`) on the pinned Vault, a Tron source a send to the pinned Tron Vault whose note carries the swap; either way the destination chain, asset and address, the source token and amount, the refund address and a minimum price that guarantees the quoted minimum must be the app’s, with no DCA, boost, broker fee or affiliates. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# decodeCfParameters
> **decodeCfParameters**(`bytes`, `refundLen`): [`CfParameters`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfparameters/)
Defined in: protocol-swap2-chainflip/src/codec.ts:57
VersionedCfParameters V1. `refundLen` = 20 for EVM / Tron sources, 32 for Solana.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
### refundLen
[Section titled “refundLen”](#refundlen)
`20` | `32`
## Returns
[Section titled “Returns”](#returns)
[`CfParameters`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfparameters/)
# decodeEvmVaultCall
> **decodeEvmVaultCall**(`data`): [`EvmVaultCall`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/evmvaultcall/)
Defined in: protocol-swap2-chainflip/src/codec.ts:127
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`string`
## Returns
[Section titled “Returns”](#returns)
[`EvmVaultCall`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/evmvaultcall/)
# decodeTronNote
> **decodeTronNote**(`note`): [`TronNote`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/tronnote/)
Defined in: protocol-swap2-chainflip/src/codec.ts:95
The note a Tron vault swap carries in raw_data.data.
## Parameters
[Section titled “Parameters”](#parameters)
### note
[Section titled “note”](#note)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TronNote`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/tronnote/)
# describeChainflipActivity
> **describeChainflipActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-chainflip/src/activity.ts:17
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# destAddressBytes
> **destAddressBytes**(`chain`, `address`): `Uint8Array`
Defined in: protocol-swap2-chainflip/src/codec.ts:147
The raw bytes a destination address is encoded with, per destination chain (EVM / Tron 20, Solana 32, BTC ASCII).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# fromHex
> **fromHex**(`h`): `Uint8Array`
Defined in: protocol-swap2-chainflip/src/codec.ts:50
## Parameters
[Section titled “Parameters”](#parameters)
### h
[Section titled “h”](#h)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# minOutOf
> **minOutOf**(`amountIn`, `minPriceX128`): `bigint`
Defined in: protocol-swap2-chainflip/src/codec.ts:162
The output a min price guarantees for `amountIn` (floor).
## Parameters
[Section titled “Parameters”](#parameters)
### amountIn
[Section titled “amountIn”](#amountin)
`bigint`
### minPriceX128
[Section titled “minPriceX128”](#minpricex128)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# minPriceX128For
> **minPriceX128For**(`amountIn`, `minOut`): `bigint`
Defined in: protocol-swap2-chainflip/src/codec.ts:158
minPriceX128 for a guaranteed output: ceil(minOut × 2^128 / amountIn) (base units on both sides carry the decimals).
## Parameters
[Section titled “Parameters”](#parameters)
### amountIn
[Section titled “amountIn”](#amountin)
`bigint`
### minOut
[Section titled “minOut”](#minout)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# sameBytes
> **sameBytes**(`a`, `b`): `boolean`
Defined in: protocol-swap2-chainflip/src/codec.ts:155
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`Uint8Array`
### b
[Section titled “b”](#b)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# toHex
> **toHex**(`b`): `` `0x${string}` ``
Defined in: protocol-swap2-chainflip/src/codec.ts:49
## Parameters
[Section titled “Parameters”](#parameters)
### b
[Section titled “b”](#b)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# tronToBytes
> **tronToBytes**(`address`): `Uint8Array`
Defined in: protocol-swap2-chainflip/src/codec.ts:138
Tron base58check `T…` ↔ the 20 raw bytes Chainflip encodes (0x41 prefix dropped).
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# CfAsset
Defined in: protocol-swap2-chainflip/src/config.ts:16
## Properties
[Section titled “Properties”](#properties)
### asset
[Section titled “asset”](#asset)
> **asset**: `string`
Defined in: protocol-swap2-chainflip/src/config.ts:19
the API’s asset symbol
***
### chain
[Section titled “chain”](#chain)
> **chain**: [`CfChain`](/api/anywalletkit/protocol-swap2-chainflip/type-aliases/cfchain/)
Defined in: protocol-swap2-chainflip/src/config.ts:17
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: protocol-swap2-chainflip/src/config.ts:22
***
### id
[Section titled “id”](#id)
> **id**: `number`
Defined in: protocol-swap2-chainflip/src/config.ts:21
the u32 asset id inside vault encodings
***
### minDeposit
[Section titled “minDeposit”](#mindeposit)
> **minDeposit**: `bigint`
Defined in: protocol-swap2-chainflip/src/config.ts:26
smallest deposit the state chain accepts (base units)
***
### token
[Section titled “token”](#token)
> **token**: `string` | `null`
Defined in: protocol-swap2-chainflip/src/config.ts:24
token contract / mint on its chain, null for the native coin
# CfParameters
Defined in: protocol-swap2-chainflip/src/codec.ts:13
## Properties
[Section titled “Properties”](#properties)
### affiliates
[Section titled “affiliates”](#affiliates)
> **affiliates**: `object`\[]
Defined in: protocol-swap2-chainflip/src/codec.ts:25
#### account
[Section titled “account”](#account)
> **account**: `number`
#### feeBps
[Section titled “feeBps”](#feebps)
> **feeBps**: `number`
***
### boostFeeBps
[Section titled “boostFeeBps”](#boostfeebps)
> **boostFeeBps**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:23
***
### broker
[Section titled “broker”](#broker)
> **broker**: `object`
Defined in: protocol-swap2-chainflip/src/codec.ts:24
#### account
[Section titled “account”](#account-1)
> **account**: `` `0x${string}` ``
#### feeBps
[Section titled “feeBps”](#feebps-1)
> **feeBps**: `number`
***
### dca
[Section titled “dca”](#dca)
> **dca**: { `chunks`: `number`; `intervalBlocks`: `number`; } | `null`
Defined in: protocol-swap2-chainflip/src/codec.ts:22
***
### maxOraclePriceSlippageBps
[Section titled “maxOraclePriceSlippageBps”](#maxoraclepriceslippagebps)
> **maxOraclePriceSlippageBps**: `number` | `null`
Defined in: protocol-swap2-chainflip/src/codec.ts:21
***
### minPriceX128
[Section titled “minPriceX128”](#minpricex128)
> **minPriceX128**: `bigint`
Defined in: protocol-swap2-chainflip/src/codec.ts:19
minimum output price × 2^128, scaled by 10^(destDecimals − srcDecimals)
***
### refundAddress
[Section titled “refundAddress”](#refundaddress)
> **refundAddress**: `` `0x${string}` ``
Defined in: protocol-swap2-chainflip/src/codec.ts:17
raw refund address bytes (20 for EVM / Tron, 32 for Solana) as 0x-hex
***
### refundCcm
[Section titled “refundCcm”](#refundccm)
> **refundCcm**: `boolean`
Defined in: protocol-swap2-chainflip/src/codec.ts:20
***
### retryDurationBlocks
[Section titled “retryDurationBlocks”](#retrydurationblocks)
> **retryDurationBlocks**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:15
***
### version
[Section titled “version”](#version)
> **version**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:14
# ChainflipProviderConfig
Defined in: protocol-swap2-chainflip/src/provider.ts:25
## Extended by
[Section titled “Extended by”](#extended-by)
* [`ChainflipSwap2Config`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-chainflip/src/provider.ts:28
Backend base URL (default the public chainflip-swap.chainflip.io).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-chainflip/src/provider.ts:26
***
### maxOraclePriceSlippageBps?
[Section titled “maxOraclePriceSlippageBps?”](#maxoraclepriceslippagebps)
> `optional` **maxOraclePriceSlippageBps?**: `number` | `null`
Defined in: protocol-swap2-chainflip/src/provider.ts:30
Live-price (oracle) slippage guard in bps; null turns it off. Default: the quote’s recommendation.
# ChainflipSwap2Config
Defined in: protocol-swap2-chainflip/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`ChainflipProviderConfig`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-chainflip/src/provider.ts:28
Backend base URL (default the public chainflip-swap.chainflip.io).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ChainflipProviderConfig`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/#apiurl)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-chainflip/src/provider.ts:26
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`ChainflipProviderConfig`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxOraclePriceSlippageBps?
[Section titled “maxOraclePriceSlippageBps?”](#maxoraclepriceslippagebps)
> `optional` **maxOraclePriceSlippageBps?**: `number` | `null`
Defined in: protocol-swap2-chainflip/src/provider.ts:30
Live-price (oracle) slippage guard in bps; null turns it off. Default: the quote’s recommendation.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`ChainflipProviderConfig`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/).[`maxOraclePriceSlippageBps`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/chainflipproviderconfig/#maxoraclepriceslippagebps)
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.onExecutionPhase`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.reviewExecution`
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.tonGasCeiling`
# EvmVaultCall
Defined in: protocol-swap2-chainflip/src/codec.ts:117
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
Defined in: protocol-swap2-chainflip/src/codec.ts:123
***
### dstAddress
[Section titled “dstAddress”](#dstaddress)
> **dstAddress**: `Uint8Array`
Defined in: protocol-swap2-chainflip/src/codec.ts:120
***
### dstChain
[Section titled “dstChain”](#dstchain)
> **dstChain**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:119
***
### dstToken
[Section titled “dstToken”](#dsttoken)
> **dstToken**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:121
***
### native
[Section titled “native”](#native)
> **native**: `boolean`
Defined in: protocol-swap2-chainflip/src/codec.ts:118
***
### params
[Section titled “params”](#params)
> **params**: [`CfParameters`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfparameters/)
Defined in: protocol-swap2-chainflip/src/codec.ts:124
***
### srcToken
[Section titled “srcToken”](#srctoken)
> **srcToken**: `string` | `null`
Defined in: protocol-swap2-chainflip/src/codec.ts:122
# TronNote
Defined in: protocol-swap2-chainflip/src/codec.ts:82
## Properties
[Section titled “Properties”](#properties)
### ccm
[Section titled “ccm”](#ccm)
> **ccm**: `boolean`
Defined in: protocol-swap2-chainflip/src/codec.ts:87
***
### destAddress
[Section titled “destAddress”](#destaddress)
> **destAddress**: `Uint8Array`
Defined in: protocol-swap2-chainflip/src/codec.ts:86
***
### destTag
[Section titled “destTag”](#desttag)
> **destTag**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:85
EncodedAddress variant of the destination (Eth 0, Dot 1, Btc 2, Arb 3, Sol 4, Hub 5, Tron 6) and its raw bytes
***
### outputAsset
[Section titled “outputAsset”](#outputasset)
> **outputAsset**: `number`
Defined in: protocol-swap2-chainflip/src/codec.ts:83
***
### params
[Section titled “params”](#params)
> **params**: [`CfParameters`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfparameters/)
Defined in: protocol-swap2-chainflip/src/codec.ts:88
# CfChain
> **CfChain** = `"Ethereum"` | `"Bitcoin"` | `"Arbitrum"` | `"Solana"` | `"Tron"`
Defined in: protocol-swap2-chainflip/src/config.ts:14
# CF_API_DEFAULT
> `const` **CF_API_DEFAULT**: `"https://chainflip-swap.chainflip.io"` = `"https://chainflip-swap.chainflip.io"`
Defined in: protocol-swap2-chainflip/src/config.ts:67
# CF_ASSETS
> `const` **CF_ASSETS**: readonly [`CfAsset`](/api/anywalletkit/protocol-swap2-chainflip/interfaces/cfasset/)\[]
Defined in: protocol-swap2-chainflip/src/config.ts:41
# CF_CHAINS
> `const` **CF_CHAINS**: `Readonly`<`Record`<`string`, { `addrTag`: `number`; `id`: `number`; `name`: [`CfChain`](/api/anywalletkit/protocol-swap2-chainflip/type-aliases/cfchain/); }>>
Defined in: protocol-swap2-chainflip/src/config.ts:33
CAIP-2 → Chainflip chain: `id` = the ForeignChain number an EVM vault call names (`dstChain`), `addrTag` = the EncodedAddress variant a Tron note names (Eth 0, Dot 1, Btc 2, Arb 3, Sol 4, Hub 5, Tron 6) — two different enums.
# CF_SOURCE_CHAINS
> `const` **CF_SOURCE_CHAINS**: `Set`<`string`>
Defined in: protocol-swap2-chainflip/src/config.ts:65
Sources this release signs (vault swaps the engine can execute and the verifier can decode).
# CF_VAULTS
> `const` **CF_VAULTS**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-chainflip/src/config.ts:58
Vault contracts that receive vault swaps (the deposit transaction’s target).
# chainflip
> `const` **chainflip**: `object`
Defined in: protocol-swap2-chainflip/src/config.ts:81
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### supports
[Section titled “supports”](#supports)
> **supports**: (`from`, `to`) => `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### supportsChain
[Section titled “supportsChain”](#supportschain)
> **supportsChain**: (`chain`) => `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean`
# CHAINFLIP_MODULE
> `const` **CHAINFLIP_MODULE**: `"@anywalletkit/protocol-swap2-chainflip"` = `"@anywalletkit/protocol-swap2-chainflip"`
Defined in: protocol-swap2-chainflip/src/activity.ts:10
# chainflipPins
> `const` **chainflipPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-chainflip/src/config.ts:142
The Chainflip Vault a vault swap calls and approves on an EVM chain ([CF_VAULTS](/api/anywalletkit/protocol-swap2-chainflip/variables/cf_vaults/)), and [chainflipVerifyQuote](/api/anywalletkit/protocol-swap2-chainflip/functions/chainflipverifyquote/) — the app’s pins for `remoteProvider({name: "chainflip", baseUrl, ...chainflipPins})` (scan 2026-10-27 modules, F8/F16). A Tron vault swap is a send to the Tron Vault the verifier pins, so the stub is opened to that deposit route (`depositAddressRoutes`, scan 2026-10-28 F9); its note must ride as hex bytes.
# @anywalletkit/protocol-swap2-core
# @anywalletkit/protocol-swap2-core
[Section titled “@anywalletkit/protocol-swap2-core”](#anywalletkitprotocol-swap2-core)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-core)
The swap2 engine: one interface for swaps and bridges (“swap2”), and the execution safety every swap2 provider package relies on.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-core @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-core @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-core @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-core](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-core), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
* **`BaseSwap2Protocol` / `SingleProviderSwap2`** — a `Swap2Protocol` (from `@anywalletkit/core`) over a provider. It quotes, binds the execution to the quote, runs approvals, sends, and resumes status by id (`getSwap2Status`, `claimSwap2` for two-phase routes).
* **Safety checks.** Quote validation, a minimum-output floor, fee caps, a review gate before signing, and refusals that name their reason. Status ids look like `awk1..[.]` (`SWAP2_ID_PREFIX`).
* **`remoteProvider`** — runs a provider on your server (API keys, shared state) while the app keeps the keys and signs. The backend is not the authority over what the wallet signs: spread the provider package’s pins into the stub (`remoteProvider({name, baseUrl, ...lifiPins})`, `fyndPins`, `uniswapPins`, `cctpPins`…). The engine then lets an EVM route call only the pinned `callTargets`, approve only the pinned `spenders`, and runs the provider’s own `verifyQuote` (Fynd: `checkFyndTransaction`) on the client; a stub without pins gets no EVM calldata route at all (the router drops it with the reason), and neither does a stub whose pins name call targets but carry no check of the call itself — `verifyQuote`, or a `verifyBuild` the app supplies — since a pinned contract executes whatever its arguments say. Every shipped EVM pins export carries one. A route that pays an address the backend names — a deposit address, or a plain value send — runs only on a stub the app opened with `depositAddressRoutes: true` (`nearIntentsPins`; `thorchainPins()` and `chainflipPins` for their Tron vaults), on every chain. Every token call in a swap’s calldata, from any provider, must move the source token, at most the swap amount; operator and Permit2 approvals are never a swap’s main call. A typed (gasless) order is signed only when it is the swap’s own Limit Order Protocol `Order` — verifying contract = the approved settlement contract, maker = this account, the source token, exactly the input — never a `Permit*` or another typed message; a provider’s own check of the build can run on the client too (`verifyBuild`), and a remote stub’s typed order is signed only when it has one (Omniston: `omnistonVerifyBuild` opens the order with the `orderExtension` the build carries). A TON cell-body deposit (`bodyBoc`) is bound too: it attaches the input plus at most `tonGasCeiling` of gas (default 1 TON; a jetton source: the ceiling alone), a jetton source’s body must be a TEP-74 transfer of exactly the input from this account’s own jetton wallet (`getJettonWalletAddress`) with the excess returning here, the decoded body reaches the review (`cellBodyDecoded`), and a remote stub’s cell body needs the app’s own validator (`verifyBuild`). An absolute `baseUrl` must be `https:` (a same-origin path is fine; `allowInsecureBaseUrl` for local development). A provider with a claim step (CCTP) also takes `claimTargets` from the app: `claimSwap2` calls only those contracts.
* **`createSwap2Handler`** (`@anywalletkit/protocol-swap2-core/server`, server-only) — the other end of `remoteProvider`: validates every request, HMAC-seals only quotes that pass the engine’s own checks (`validQuote`: provider, input, floor, slippage, expiry; else 502) and builds only sealed, unexpired ones, puts an intent token on every swap id (tracking, claims and notices without it are refused), passes refusals through with URLs redacted; you supply `guard` (auth + rate limits, it sees the validated request) and, with per-user sign-in, `subject` (quotes and swap ids bound to the user). A reference server: [`examples/server`](https://github.com/ultratestbro/anywalletkit/tree/main/examples/server).
* **Tokens outside the catalog** — `allowUnlistedTokens: true` on the engine (and on `createSwap2Handler` for a remote engine) lets a swap name a token the catalog does not list by its EVM contract or Solana mint: the user’s own tokens. Off by default. The engine reads the token’s decimals with the account’s `getTokenInfo` and sends them as `sourceDecimals`; providers that trade any token resolve the source with `sourceAssetOf(params)`, the rest refuse it. Approvals and value binding are the same as for catalog tokens.
* **Errors** — `Swap2Error` and its subclasses (quote, validation, execution, fee limit, status…).
* **Activity helpers** — what `describeActivity` implementations share.
Providers live in their own packages: `@anywalletkit/protocol-swap2-near-intents`, `-lifi`, `-thorchain`, `-omniston`, `-cctp`, `-usdt0`, `-chainflip`, `-jupiter`, `-uniswap`, `-balancer`, `-wrap`. `@anywalletkit/protocol-swap2-router` auctions several of them.
Docs: [Swaps](https://docs.anywallet.tech/guides/swaps/)
Apache-2.0
## Classes
[Section titled “Classes”](#classes)
* [BaseSwap2Protocol](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/)
* [SingleProviderSwap2](/api/anywalletkit/protocol-swap2-core/classes/singleproviderswap2/)
* [Swap2ConfigurationError](/api/anywalletkit/protocol-swap2-core/classes/swap2configurationerror/)
* [Swap2Error](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
* [Swap2ExecutionError](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/)
* [Swap2FeeLimitError](/api/anywalletkit/protocol-swap2-core/classes/swap2feelimiterror/)
* [Swap2InFlightError](/api/anywalletkit/protocol-swap2-core/classes/swap2inflighterror/)
* [Swap2InsufficientGasError](/api/anywalletkit/protocol-swap2-core/classes/swap2insufficientgaserror/)
* [Swap2MaybeSentError](/api/anywalletkit/protocol-swap2-core/classes/swap2maybesenterror/)
* [Swap2QuoteError](/api/anywalletkit/protocol-swap2-core/classes/swap2quoteerror/)
* [Swap2StatusError](/api/anywalletkit/protocol-swap2-core/classes/swap2statuserror/)
* [Swap2UnsupportedOperationError](/api/anywalletkit/protocol-swap2-core/classes/swap2unsupportedoperationerror/)
* [Swap2ValidationError](/api/anywalletkit/protocol-swap2-core/classes/swap2validationerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [Asset](/api/anywalletkit/protocol-swap2-core/interfaces/asset/)
* [CrossChainProvider](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/)
* [IntentRef](/api/anywalletkit/protocol-swap2-core/interfaces/intentref/)
* [IntentStatus](/api/anywalletkit/protocol-swap2-core/interfaces/intentstatus/)
* [Quote](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
* [QuoteParams](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
* [RemotePins](/api/anywalletkit/protocol-swap2-core/interfaces/remotepins/)
* [RemoteProviderOptions](/api/anywalletkit/protocol-swap2-core/interfaces/remoteprovideroptions/)
* [RoutedQuote](/api/anywalletkit/protocol-swap2-core/interfaces/routedquote/)
* [ScoreWeights](/api/anywalletkit/protocol-swap2-core/interfaces/scoreweights/)
* [SerializedExecutionExpectation](/api/anywalletkit/protocol-swap2-core/interfaces/serializedexecutionexpectation/)
* [SlippageContext](/api/anywalletkit/protocol-swap2-core/interfaces/slippagecontext/)
* [SlippageOptions](/api/anywalletkit/protocol-swap2-core/interfaces/slippageoptions/)
* [SlippageSuggestion](/api/anywalletkit/protocol-swap2-core/interfaces/slippagesuggestion/)
* [Swap2EngineConfig](/api/anywalletkit/protocol-swap2-core/interfaces/swap2engineconfig/)
* [Swap2ExecutionPhaseDetail](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionphasedetail/)
* [Swap2ExecutionPlan](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionplan/)
* [SwapActivityOptions](/api/anywalletkit/protocol-swap2-core/interfaces/swapactivityoptions/)
* [TonBodySummary](/api/anywalletkit/protocol-swap2-core/interfaces/tonbodysummary/)
* [TxRequest](/api/anywalletkit/protocol-swap2-core/interfaces/txrequest/)
* [UnsignedTx](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [IntentState](/api/anywalletkit/protocol-swap2-core/type-aliases/intentstate/)
* [SlippageClass](/api/anywalletkit/protocol-swap2-core/type-aliases/slippageclass/)
* [Swap2Account](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2account/)
* [Swap2ErrorCode](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
* [Swap2ExecutionPhase](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2executionphase/)
## Variables
[Section titled “Variables”](#variables)
* [NATIVE_DECIMALS](/api/anywalletkit/protocol-swap2-core/variables/native_decimals/)
* [SWAP2_CHAIN_ALIASES](/api/anywalletkit/protocol-swap2-core/variables/swap2_chain_aliases/)
* [SWAP2_ID_PREFIX](/api/anywalletkit/protocol-swap2-core/variables/swap2_id_prefix/)
## Functions
[Section titled “Functions”](#functions)
* [assetLabel](/api/anywalletkit/protocol-swap2-core/functions/assetlabel/)
* [assetMetaFor](/api/anywalletkit/protocol-swap2-core/functions/assetmetafor/)
* [calledContract](/api/anywalletkit/protocol-swap2-core/functions/calledcontract/)
* [callsContract](/api/anywalletkit/protocol-swap2-core/functions/callscontract/)
* [callSelector](/api/anywalletkit/protocol-swap2-core/functions/callselector/)
* [chainLabel](/api/anywalletkit/protocol-swap2-core/functions/chainlabel/)
* [describeSwapLike](/api/anywalletkit/protocol-swap2-core/functions/describeswaplike/)
* [evmRef](/api/anywalletkit/protocol-swap2-core/functions/evmref/)
* [isEvm](/api/anywalletkit/protocol-swap2-core/functions/isevm/)
* [matchesCall](/api/anywalletkit/protocol-swap2-core/functions/matchescall/)
* [namespace](/api/anywalletkit/protocol-swap2-core/functions/namespace/)
* [nativeDecimals](/api/anywalletkit/protocol-swap2-core/functions/nativedecimals/)
* [nativeUnits](/api/anywalletkit/protocol-swap2-core/functions/nativeunits/)
* [ownerAssets](/api/anywalletkit/protocol-swap2-core/functions/ownerassets/)
* [redactUrls](/api/anywalletkit/protocol-swap2-core/functions/redacturls/)
* [remotePinRefusal](/api/anywalletkit/protocol-swap2-core/functions/remotepinrefusal/)
* [remoteProvider](/api/anywalletkit/protocol-swap2-core/functions/remoteprovider/)
* [shortAddress](/api/anywalletkit/protocol-swap2-core/functions/shortaddress/)
* [slippageClassOf](/api/anywalletkit/protocol-swap2-core/functions/slippageclassof/)
* [sourceAssetOf](/api/anywalletkit/protocol-swap2-core/functions/sourceassetof/)
* [suggestSlippage](/api/anywalletkit/protocol-swap2-core/functions/suggestslippage/)
* [swap2ChainId](/api/anywalletkit/protocol-swap2-core/functions/swap2chainid/)
* [tonRawAddress](/api/anywalletkit/protocol-swap2-core/functions/tonrawaddress/)
* [validQuote](/api/anywalletkit/protocol-swap2-core/functions/validquote/)
# BaseSwap2Protocol
Defined in: protocol-swap2-core/src/swap2/base.ts:716
Abstract swap2 protocol backed by the engine. Concrete subclasses bind either a single provider (contribution-shaped) or the router (aggregator).
## Extends
[Section titled “Extends”](#extends)
* `Swap2Protocol`
## Extended by
[Section titled “Extended by”](#extended-by)
* [`SingleProviderSwap2`](/api/anywalletkit/protocol-swap2-core/classes/singleproviderswap2/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BaseSwap2Protocol**(`account`, `config`): `BaseSwap2Protocol`
Defined in: protocol-swap2-core/src/swap2/base.ts:719
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`Swap2EngineConfig`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2engineconfig/)
#### Returns
[Section titled “Returns”](#returns)
`BaseSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`Swap2Protocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`SingleProviderSwap2`](/api/anywalletkit/protocol-swap2-core/classes/singleproviderswap2/).[`_account`](/api/anywalletkit/protocol-swap2-core/classes/singleproviderswap2/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2Protocol._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:717
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:851
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:842
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:880
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1675
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Swap2Protocol.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `abstract` `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:739
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/src/swap2/base.ts:1609
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`_tx`, `_ctx`): `ActivityItem` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:320
Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return `null` when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### \_tx
[Section titled “\_tx”](#_tx)
`ChainTx`
##### \_ctx
[Section titled “\_ctx”](#_ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-7)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`Swap2Protocol.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:742
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
[`Swap2ExecutionPhase`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2executionphase/)
##### detail?
[Section titled “detail?”](#detail)
[`Swap2ExecutionPhaseDetail`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionphasedetail/)
#### Returns
[Section titled “Returns”](#returns-8)
`void`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/src/swap2/base.ts:1713
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`Swap2SupportedChain`\[]>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`Swap2Protocol.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/src/swap2/base.ts:1724
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedToken`\[]>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`Swap2Protocol.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1592
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2StatusResult`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
`Swap2Protocol.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:733
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-12)
`string`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:754
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/src/swap2/base.ts:778
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`Swap2Options`>
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:752
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-15)
`boolean`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `abstract` `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/src/swap2/base.ts:737
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/) | `undefined`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2Protocol.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2Protocol.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/src/swap2/base.ts:932
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
[Swap2QuoteError](/api/anywalletkit/protocol-swap2-core/classes/swap2quoteerror/) when no route answers, with the provider’s own reason when it gave one.
#### Overrides
[Section titled “Overrides”](#overrides-5)
`Swap2Protocol.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2Protocol.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `abstract` `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/src/swap2/base.ts:728
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/src/swap2/base.ts:915
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-22)
`Swap2Quote` | `null`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/src/swap2/base.ts:910
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Options`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/src/swap2/base.ts:763
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`CcAsset` | `undefined`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1692
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<`SwapResult`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`Swap2Protocol.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/src/swap2/base.ts:953
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
[Swap2ExecutionError](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/) for a read-only account, [Swap2InFlightError](/api/anywalletkit/protocol-swap2-core/classes/swap2inflighterror/) for a double tap, [Swap2MaybeSentError](/api/anywalletkit/protocol-swap2-core/classes/swap2maybesenterror/) when the broadcast outcome is unknown (do not retry; track `hash`).
#### Overrides
[Section titled “Overrides”](#overrides-7)
`Swap2Protocol.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
Defined in: protocol-swap2-core/src/swap2/base.ts:802
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-27)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/src/swap2/base.ts:888
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-28)
`Swap2Quote`
# SingleProviderSwap2
Defined in: protocol-swap2-core/src/swap2/single.ts:8
A single-provider swap2: quoting/tracking route through one solver. The per-provider packages subclass this — the contribution unit shape.
## Extends
[Section titled “Extends”](#extends)
* [`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SingleProviderSwap2**(`account`, `config`): `SingleProviderSwap2`
Defined in: protocol-swap2-core/src/swap2/base.ts:719
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`Swap2EngineConfig`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2engineconfig/)
#### Returns
[Section titled “Returns”](#returns)
`SingleProviderSwap2`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`_account`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#_account)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`_config`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#_config)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:717
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`fromChain`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#fromchain)
***
### provider
[Section titled “provider”](#provider)
> `abstract` `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/)
Defined in: protocol-swap2-core/src/swap2/single.ts:9
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:851
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`assertFeeCaps`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#assertfeecaps)
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:842
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`assertFeeConfig`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#assertfeeconfig)
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:880
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`assertQuoteFeeCaps`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#assertquotefeecaps)
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1675
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`bridge`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#bridge)
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `abstract` `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:739
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`chainSupported`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#chainsupported)
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/src/swap2/base.ts:1609
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`claimSwap2`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#claimswap2)
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/src/swap2/single.ts:58
#### Returns
[Section titled “Returns”](#returns-7)
`void`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/src/swap2/single.ts:52
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`describeActivity`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#describeactivity)
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:742
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
[`Swap2ExecutionPhase`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2executionphase/)
##### detail?
[Section titled “detail?”](#detail)
[`Swap2ExecutionPhaseDetail`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionphasedetail/)
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`emitPhase`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#emitphase)
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/src/swap2/base.ts:1713
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`getSupportedChains`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#getsupportedchains)
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/src/swap2/base.ts:1724
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`getSupportedTokens`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#getsupportedtokens)
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1592
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`getSwap2Status`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#getswap2status)
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/src/swap2/single.ts:45
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`noRouteDetail`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#noroutedetail)
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:754
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`pairSupported`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#pairsupported)
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/src/swap2/base.ts:778
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`prepareOptions`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#prepareoptions)
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/src/swap2/single.ts:55
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`protocolEnabled`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#protocolenabled)
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/src/swap2/single.ts:48
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/) | `undefined`
#### Overrides
[Section titled “Overrides”](#overrides-3)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`providerFor`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#providerfor)
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`quoteBridge`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#quotebridge)
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`quoteSwap`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#quoteswap)
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/src/swap2/base.ts:932
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
[Swap2QuoteError](/api/anywalletkit/protocol-swap2-core/classes/swap2quoteerror/) when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`quoteSwap2`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#quoteswap2)
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`requireSigningAccount`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#requiresigningaccount)
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/src/swap2/single.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
#### Overrides
[Section titled “Overrides”](#overrides-4)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`resolveQuote`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#resolvequote)
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/src/swap2/base.ts:915
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`routeQuote`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#routequote)
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/src/swap2/base.ts:910
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`snapshotOf`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#snapshotof)
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/src/swap2/base.ts:763
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`sourceAsset`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#sourceasset)
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/src/swap2/base.ts:1692
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`swap`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#swap)
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/src/swap2/base.ts:953
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
[Swap2ExecutionError](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/) for a read-only account, [Swap2InFlightError](/api/anywalletkit/protocol-swap2-core/classes/swap2inflighterror/) for a double tap, [Swap2MaybeSentError](/api/anywalletkit/protocol-swap2-core/classes/swap2maybesenterror/) when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`swap2`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#swap2)
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
Defined in: protocol-swap2-core/src/swap2/base.ts:802
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`toParams`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#toparams)
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/src/swap2/base.ts:888
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`BaseSwap2Protocol`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/).[`toQuote`](/api/anywalletkit/protocol-swap2-core/classes/baseswap2protocol/#toquote)
# Swap2ConfigurationError
Defined in: protocol-swap2-core/src/errors.ts:22
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2ConfigurationError**(`message`, `options?`): `Swap2ConfigurationError`
Defined in: protocol-swap2-core/src/errors.ts:23
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2ConfigurationError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2Error
Defined in: protocol-swap2-core/src/errors.ts:15
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Extended by
[Section titled “Extended by”](#extended-by)
* [`Swap2ConfigurationError`](/api/anywalletkit/protocol-swap2-core/classes/swap2configurationerror/)
* [`Swap2ValidationError`](/api/anywalletkit/protocol-swap2-core/classes/swap2validationerror/)
* [`Swap2QuoteError`](/api/anywalletkit/protocol-swap2-core/classes/swap2quoteerror/)
* [`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/)
* [`Swap2UnsupportedOperationError`](/api/anywalletkit/protocol-swap2-core/classes/swap2unsupportedoperationerror/)
* [`Swap2FeeLimitError`](/api/anywalletkit/protocol-swap2-core/classes/swap2feelimiterror/)
* [`Swap2StatusError`](/api/anywalletkit/protocol-swap2-core/classes/swap2statuserror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2Error**(`message`, `code`, `options?`): `Swap2Error`
Defined in: protocol-swap2-core/src/errors.ts:16
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code
[Section titled “code”](#code)
[`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2Error`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
# Swap2ExecutionError
Defined in: protocol-swap2-core/src/errors.ts:31
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Extended by
[Section titled “Extended by”](#extended-by)
* [`Swap2InFlightError`](/api/anywalletkit/protocol-swap2-core/classes/swap2inflighterror/)
* [`Swap2InsufficientGasError`](/api/anywalletkit/protocol-swap2-core/classes/swap2insufficientgaserror/)
* [`Swap2MaybeSentError`](/api/anywalletkit/protocol-swap2-core/classes/swap2maybesenterror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2ExecutionError**(`message`, `options?`): `Swap2ExecutionError`
Defined in: protocol-swap2-core/src/errors.ts:32
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2ExecutionError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2FeeLimitError
Defined in: protocol-swap2-core/src/errors.ts:37
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2FeeLimitError**(`message`, `options?`): `Swap2FeeLimitError`
Defined in: protocol-swap2-core/src/errors.ts:38
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2FeeLimitError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2InFlightError
Defined in: protocol-swap2-core/src/errors.ts:44
An identical swap2() is still running on this account (double tap): nothing was sent for this call.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2InFlightError**(`message`, `options?`): `Swap2InFlightError`
Defined in: protocol-swap2-core/src/errors.ts:32
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2InFlightError`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#code)
# Swap2InsufficientGasError
Defined in: protocol-swap2-core/src/errors.ts:46
The account cannot pay the source leg’s gas (approvals + main call + value); nothing was signed.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2InsufficientGasError**(`message`, `options?`): `Swap2InsufficientGasError`
Defined in: protocol-swap2-core/src/errors.ts:32
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2InsufficientGasError`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#code)
# Swap2MaybeSentError
Defined in: protocol-swap2-core/src/errors.ts:52
The source broadcast failed AFTER the transaction may have reached the node (lost response, timeout). Do NOT retry: poll `getSwap2Status(id)` / the chain for `hash`. The approval is left in place (the deposit may spend it).
## Extends
[Section titled “Extends”](#extends)
* [`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2MaybeSentError**(`message`, `hash?`, `id?`, `options?`): `Swap2MaybeSentError`
Defined in: protocol-swap2-core/src/errors.ts:53
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### hash?
[Section titled “hash?”](#hash)
`string`
##### id?
[Section titled “id?”](#id)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2MaybeSentError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2ExecutionError`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2executionerror/#code)
***
### hash?
[Section titled “hash?”](#hash-1)
> `readonly` `optional` **hash?**: `string`
Defined in: protocol-swap2-core/src/errors.ts:53
***
### id?
[Section titled “id?”](#id-1)
> `readonly` `optional` **id?**: `string`
Defined in: protocol-swap2-core/src/errors.ts:53
# Swap2QuoteError
Defined in: protocol-swap2-core/src/errors.ts:28
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2QuoteError**(`message`, `options?`): `Swap2QuoteError`
Defined in: protocol-swap2-core/src/errors.ts:29
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2QuoteError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2StatusError
Defined in: protocol-swap2-core/src/errors.ts:40
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2StatusError**(`message`, `options?`): `Swap2StatusError`
Defined in: protocol-swap2-core/src/errors.ts:41
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2StatusError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2UnsupportedOperationError
Defined in: protocol-swap2-core/src/errors.ts:34
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2UnsupportedOperationError**(`message`, `options?`): `Swap2UnsupportedOperationError`
Defined in: protocol-swap2-core/src/errors.ts:35
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2UnsupportedOperationError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# Swap2ValidationError
Defined in: protocol-swap2-core/src/errors.ts:25
Public, machine-readable error base shared by every contribution package.
## Extends
[Section titled “Extends”](#extends)
* [`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Swap2ValidationError**(`message`, `options?`): `Swap2ValidationError`
Defined in: protocol-swap2-core/src/errors.ts:26
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
`ErrorOptions`
#### Returns
[Section titled “Returns”](#returns)
`Swap2ValidationError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`constructor`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#constructor)
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: [`Swap2ErrorCode`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2errorcode/)
Defined in: protocol-swap2-core/src/errors.ts:16
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Swap2Error`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/).[`code`](/api/anywalletkit/protocol-swap2-core/classes/swap2error/#code)
# assetLabel
> **assetLabel**(`tx`, `a`): `string`
Defined in: protocol-swap2-core/src/activity.ts:102
Symbol for a title: the asset’s symbol, the chain’s native coin, or a shortened address.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### a
[Section titled “a”](#a)
`ActivityAsset`
## Returns
[Section titled “Returns”](#returns)
`string`
# assetMetaFor
> **assetMetaFor**(`tx`): (`token`) => `Partial`<`ActivityAsset`> | `undefined`
Defined in: protocol-swap2-core/src/activity.ts:80
Symbol / decimals per token: what the transfers already carry first, then the swap2-assets catalog for the chain (native asset = `token === null`).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
## Returns
[Section titled “Returns”](#returns)
(`token`) => `Partial`<`ActivityAsset`> | `undefined`
# calledContract
> **calledContract**(`tx`): `string` | `null`
Defined in: protocol-swap2-core/src/activity.ts:24
The contract a transaction invoked (EVM `to`, Solana program, TON destination), lowercase for EVM.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# callsContract
> **callsContract**(`tx`, `contract`): `boolean`
Defined in: protocol-swap2-core/src/activity.ts:40
Does `tx` call `contract` (case-insensitive for EVM)?
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### contract
[Section titled “contract”](#contract)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# callSelector
> **callSelector**(`tx`): `string` | `undefined`
Defined in: protocol-swap2-core/src/activity.ts:31
4-byte selector of an EVM call (`0x`-prefixed, lowercase), from `call.selector` or the calldata.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# chainLabel
> **chainLabel**(`caip2`): `string`
Defined in: protocol-swap2-core/src/activity.ts:67
Human label of a chain for subtitles (“Base”, “Ethereum”), falling back to the CAIP-2 id.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# describeSwapLike
> **describeSwapLike**(`tx`, `ctx`, `o`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/src/activity.ts:146
Build the item once the caller has decided the transaction is this module’s. Returns null only when the owner moved nothing and no title was given — a recognized call that touched none of the owner’s balances is not activity.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### o
[Section titled “o”](#o)
[`SwapActivityOptions`](/api/anywalletkit/protocol-swap2-core/interfaces/swapactivityoptions/)
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# evmRef
> **evmRef**(`chain`): `number`
Defined in: protocol-swap2-core/src/util.ts:12
Numeric chain id of an `eip155:` CAIP-2 id.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`number`
# isEvm
> **isEvm**(`chain`): `boolean`
Defined in: protocol-swap2-core/src/util.ts:8
True for an `eip155:` chain id.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# matchesCall
> **matchesCall**(`tx`, `contracts`, `selectors?`): `boolean`
Defined in: protocol-swap2-core/src/activity.ts:47
Does `tx` call one of `contracts` with one of `selectors` (any selector when the set is empty)?
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### contracts
[Section titled “contracts”](#contracts)
`Iterable`<`string`>
### selectors?
[Section titled “selectors?”](#selectors)
`Iterable`<`string`, `any`, `any`>
## Returns
[Section titled “Returns”](#returns)
`boolean`
# namespace
> **namespace**(`chain`): `string`
Defined in: protocol-swap2-core/src/util.ts:4
Shared CAIP-2 helpers. Contribution packages never read deployment env.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# nativeDecimals
> **nativeDecimals**(`chain`): `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:134
Decimals of `chain`’s native coin in base units (18 unless the chain says otherwise).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`number`
# nativeUnits
> **nativeUnits**(`chain`, `whole`): `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:138
`whole` native coins (an integer, or a decimal string such as “0.005”) in `chain`’s base units.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### whole
[Section titled “whole”](#whole)
`string` | `number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# ownerAssets
> **ownerAssets**(`tx`, `ctx`): `object`
Defined in: protocol-swap2-core/src/activity.ts:109
Net movement for the owner, split into what left and what arrived, with symbols.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`object`
### assetsIn
[Section titled “assetsIn”](#assetsin)
> **assetsIn**: `ActivityAsset`\[]
### assetsOut
[Section titled “assetsOut”](#assetsout)
> **assetsOut**: `ActivityAsset`\[]
# redactUrls
> **redactUrls**(`text`): `string`
Defined in: protocol-swap2-core/src/util.ts:62
Remove URLs from text that may travel to a client (a refusal reason, a build error): transport errors carry the endpoint — and with a keyed RPC (QuickNode, Alchemy, Infura…) the key sits in its path (scan 2026-10-23 F8). What `/[a-z][a-z0-9+.-]{0,31}://[^\s"'<>]+/gi` would replace, found from each `://` instead of tried at every position: linear in the length of `text` whatever an API or a client puts in it (“a.a.a…” made the regex this replaced quadratic; scan 2026-10-27 modules, F34). A URL glued to a word loses its last 32 scheme characters and the rest.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# remotePinRefusal
> **remotePinRefusal**(`provider`, `q`, `chain`): `string` | `null`
Defined in: protocol-swap2-core/src/validate.ts:60
Why a remote provider’s quote cannot execute in this app, or null: its EVM transaction calls or approves an address the app did not pin (`remoteProvider` `callTargets` / `spenders`), or it pays an address the backend named — a deposit address or a plain value send — on a stub the app did not open to such routes (`depositAddressRoutes`, scan 2026-10-28 F9), or it is EVM calldata on a stub without the app’s own check of what that calldata does (`verifyQuote` / `verifyBuild`, scan 2026-10-30 F3). The router and the single-provider path drop such a quote with this reason, so the auction never picks a route execution would refuse (scan 2026-10-27 modules, F8/F9/F16); execution checks the build again, in full. Local providers are not judged here.
## Parameters
[Section titled “Parameters”](#parameters)
### provider
[Section titled “provider”](#provider)
`Pick`<[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/), `"name"` | `"remote"` | `"callTargets"` | `"spenders"` | `"depositAddressRoutes"` | `"verifiesQuotes"` | `"verifiesBuilds"`>
### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# remoteProvider
> **remoteProvider**(`opts`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/)
Defined in: protocol-swap2-core/src/remote.ts:91
A provider that runs on your server: quotes, deposits and tracking go to `baseUrl`, so API keys and affiliate settings never ship in the app. The engine still validates every quote and transaction locally before signing.
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`RemoteProviderOptions`](/api/anywalletkit/protocol-swap2-core/interfaces/remoteprovideroptions/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/)
# shortAddress
> **shortAddress**(`a`): `string`
Defined in: protocol-swap2-core/src/activity.ts:72
`0x1234…abcd` for an address the catalog does not name.
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# slippageClassOf
> **slippageClassOf**(`symbol`): [`SlippageClass`](/api/anywalletkit/protocol-swap2-core/type-aliases/slippageclass/)
Defined in: protocol-swap2-core/src/slippage.ts:55
Which bucket a symbol falls in. Unknown symbols are “other”.
## Parameters
[Section titled “Parameters”](#parameters)
### symbol
[Section titled “symbol”](#symbol)
`string`
## Returns
[Section titled “Returns”](#returns)
[`SlippageClass`](/api/anywalletkit/protocol-swap2-core/type-aliases/slippageclass/)
# sourceAssetOf
> **sourceAssetOf**(`params`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/src/util.ts:86
The source asset a provider is asked to sell: the catalog’s entry for `params.sourceToken`, or — only when the engine sent `sourceDecimals` (an unlisted token the user added) — an unlisted asset named by its contract / mint. Providers that can trade any token use this instead of the catalog lookup; the others keep refusing what the catalog does not list.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
`Pick`<[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/), `"sourceChain"` | `"sourceToken"` | `"sourceDecimals"`>
## Returns
[Section titled “Returns”](#returns)
`CcAsset` | `undefined`
# suggestSlippage
> **suggestSlippage**(`ctx`, `options?`): [`SlippageSuggestion`](/api/anywalletkit/protocol-swap2-core/interfaces/slippagesuggestion/)
Defined in: protocol-swap2-core/src/slippage.ts:77
## Parameters
[Section titled “Parameters”](#parameters)
### ctx
[Section titled “ctx”](#ctx)
[`SlippageContext`](/api/anywalletkit/protocol-swap2-core/interfaces/slippagecontext/)
### options?
[Section titled “options?”](#options)
[`SlippageOptions`](/api/anywalletkit/protocol-swap2-core/interfaces/slippageoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`SlippageSuggestion`](/api/anywalletkit/protocol-swap2-core/interfaces/slippagesuggestion/)
# swap2ChainId
> **swap2ChainId**(`chain`): `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:538
The swap2 id for `chain` (itself when it has no alias).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# tonRawAddress
> **tonRawAddress**(`address`): `string` | `null`
Defined in: protocol-swap2-core/src/util.ts:121
A TON address in raw form (`:<64 hex>`, lowercase) from a raw string, a user-friendly one (bounceable or not, checksum verified), or an address object (`toRawString()` / `workChain` + `hash`); null for anything else. Two spellings of one address compare equal in this form.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# validQuote
> **validQuote**(`q`, `params`, `provider`): `boolean`
Defined in: protocol-swap2-core/src/validate.ts:4
Shared quote validator used by both the aggregate and single-provider paths.
## Parameters
[Section titled “Parameters”](#parameters)
### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
### provider
[Section titled “provider”](#provider)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# Asset
Defined in: protocol-swap2-core/src/types.ts:9
A token on a chain, as providers see it.
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: protocol-swap2-core/src/types.ts:10
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-swap2-core/src/types.ts:11
# CrossChainProvider
Defined in: protocol-swap2-core/src/types.ts:220
Pluggable cross-chain provider. Adding a provider is “add a module”; the rest of the app references only this interface (never a specific provider).
## Properties
[Section titled “Properties”](#properties)
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `readonly` `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:279
Set by `remoteProvider` when the app opted in (`depositAddressRoutes`): this stub may send the input to an address its backend names. Without it the engine refuses a remote stub’s deposit-address and plain-value builds.
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `string`
Defined in: protocol-swap2-core/src/types.ts:222
Provider name, unique in a router.
***
### remote?
[Section titled “remote?”](#remote)
> `readonly` `optional` **remote?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:267
Set by `remoteProvider`: the quotes and builds come from a backend, not from code the app ships. The engine then takes the addresses an EVM transaction may call or approve only from [callTargets](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/#calltargets) / [spenders](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/#spenders) — the app’s pins — and refuses a calldata route or an approval it has no pin for (scan 2026-10-27 modules, F8/F9/F16).
***
### supportsSameChain?
[Section titled “supportsSameChain?”](#supportssamechain)
> `optional` **supportsSameChain?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:290
Explicit opt-in: provider can execute a same-chain swap.
***
### verifiesBuilds?
[Section titled “verifiesBuilds?”](#verifiesbuilds)
> `readonly` `optional` **verifiesBuilds?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:269
Set by `remoteProvider` when the app gave it `verifyBuild`: its builds are checked on the client.
***
### verifiesQuotes?
[Section titled “verifiesQuotes?”](#verifiesquotes)
> `readonly` `optional` **verifiesQuotes?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:274
Set by `remoteProvider` when the app gave it `verifyQuote`: its quotes’ transactions are checked on the client. A remote stub’s EVM calldata route needs this or [verifiesBuilds](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/#verifiesbuilds) (scan 2026-10-30, F3).
## Methods
[Section titled “Methods”](#methods)
### buildClaim()?
[Section titled “buildClaim()?”](#buildclaim)
> `optional` **buildClaim**(`ref`): `Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/) | `null`>
Defined in: protocol-swap2-core/src/types.ts:253
Two-phase routes: the destination-chain transaction that completes the delivery (CCTP `receiveMessage(message, attestation)`), or `null` while the attestation is not available yet. The engine executes it through a destination-chain account (`claimSwap2`); `tx.chain` names that chain.
#### Parameters
[Section titled “Parameters”](#parameters)
##### ref
[Section titled “ref”](#ref)
[`IntentRef`](/api/anywalletkit/protocol-swap2-core/interfaces/intentref/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/) | `null`>
***
### buildDeposit()
[Section titled “buildDeposit()”](#builddeposit)
> **buildDeposit**(`quote`): `Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)>
Defined in: protocol-swap2-core/src/types.ts:230
The source-leg transaction for a quote.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)>
***
### callTargets()?
[Section titled “callTargets()?”](#calltargets)
> `optional` **callTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/src/types.ts:281
Remote stubs: the contracts this provider’s EVM swaps may call on `chain` (the app’s list, e.g. `lifiPins`).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
readonly `string`\[]
***
### claimTargets()?
[Section titled “claimTargets()?”](#claimtargets)
> `optional` **claimTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/src/types.ts:260
The contracts a claim from [buildClaim](/api/anywalletkit/protocol-swap2-core/interfaces/crosschainprovider/#buildclaim) may call on `chain` (CAIP-2) — CCTP’s MessageTransmitter. `claimSwap2` refuses a claim to anything else, and a provider with a claim step must declare them (round 3, M24). Kept on the client: for a remote provider this is the app’s list, never the server’s.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
readonly `string`\[]
***
### close()?
[Section titled “close()?”](#close)
> `optional` **close**(): `void`
Defined in: protocol-swap2-core/src/types.ts:284
#### Returns
[Section titled “Returns”](#returns-4)
`void`
***
### describeActivity()?
[Section titled “describeActivity()?”](#describeactivity)
> `optional` **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/src/types.ts:298
Recognize one of this provider’s own transactions in an address’s history (contract + selector on EVM, settlement counterparty elsewhere) and describe it for the activity feed; null when it is not this provider’s. Pure and synchronous. The single-provider protocol classes and the router delegate `describeActivity` here.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-5)
`ActivityItem` | `null`
***
### enabled()
[Section titled “enabled()”](#enabled)
> **enabled**(): `boolean`
Defined in: protocol-swap2-core/src/types.ts:224
Master flag — providers ship “dark” (off) until validated with real funds.
#### Returns
[Section titled “Returns”](#returns-6)
`boolean`
***
### getQuote()
[Section titled “getQuote()”](#getquote)
> **getQuote**(`params`, `signal?`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/src/types.ts:228
A quote, or `null` with the reason passed to `params.onRefusal`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
##### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/) | `null`>
***
### notifyDeposit()?
[Section titled “notifyDeposit()?”](#notifydeposit)
> `optional` **notifyDeposit**(`intentId`, `txHash`): `Promise`<`void`>
Defined in: protocol-swap2-core/src/types.ts:244
Tell the provider the source funds were sent (tx hash / BoC). Required for NEAR Intents TON deposits — the HOT-bridge oracle can’t observe SIMPLE-mode deposits on uninitialized addresses without it. Best-effort elsewhere.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### intentId
[Section titled “intentId”](#intentid)
`string`
##### txHash
[Section titled “txHash”](#txhash)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`void`>
***
### preflightDeposit()?
[Section titled “preflightDeposit()?”](#preflightdeposit)
> `optional` **preflightDeposit**(`quote`, `tx`): `Promise`<`void`>
Defined in: protocol-swap2-core/src/types.ts:236
Last fail-closed check after any approval and immediately before the wallet signs/broadcasts the source leg. Providers whose execution target can rotate or halt (THORChain vaults/routers) must revalidate it here.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### tx
[Section titled “tx”](#tx-1)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`void`>
***
### registerSignedOrder()?
[Section titled “registerSignedOrder()?”](#registersignedorder)
> `optional` **registerSignedOrder**(`intentId`, `signature`): `Promise`<`void`>
Defined in: protocol-swap2-core/src/types.ts:246
Gasless typed-order providers: register the wallet’s EIP-712 signature.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### intentId
[Section titled “intentId”](#intentid-1)
`string`
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`void`>
***
### spenders()?
[Section titled “spenders()?”](#spenders)
> `optional` **spenders**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/src/types.ts:283
Remote stubs: the spenders this provider’s EVM swaps may be approved for on `chain` (the app’s list).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### chain
[Section titled “chain”](#chain-2)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
readonly `string`\[]
***
### supportsChain()?
[Section titled “supportsChain()?”](#supportschain)
> `optional` **supportsChain**(`caip2`): `boolean`
Defined in: protocol-swap2-core/src/types.ts:286
Optional discovery hook for custom providers.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
***
### supportsChainPair()?
[Section titled “supportsChainPair()?”](#supportschainpair)
> `optional` **supportsChainPair**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-core/src/types.ts:288
Optional pair-level discovery for aggregators.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
***
### supportsRoute()
[Section titled “supportsRoute()”](#supportsroute)
> **supportsRoute**(`from`, `to`): `boolean`
Defined in: protocol-swap2-core/src/types.ts:226
Cheap synchronous check: can this provider route `from` to `to`? No I/O.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### from
[Section titled “from”](#from)
[`Asset`](/api/anywalletkit/protocol-swap2-core/interfaces/asset/)
##### to
[Section titled “to”](#to)
[`Asset`](/api/anywalletkit/protocol-swap2-core/interfaces/asset/)
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
***
### trackIntent()
[Section titled “trackIntent()”](#trackintent)
> **trackIntent**(`ref`): `Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-core/interfaces/intentstatus/)>
Defined in: protocol-swap2-core/src/types.ts:238
Current status of a swap.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### ref
[Section titled “ref”](#ref-1)
[`IntentRef`](/api/anywalletkit/protocol-swap2-core/interfaces/intentref/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-core/interfaces/intentstatus/)>
# IntentRef
Defined in: protocol-swap2-core/src/types.ts:100
What trackIntent gets to work with (LI.FI tracks by the source tx hash).
## Properties
[Section titled “Properties”](#properties)
### destTxHash?
[Section titled “destTxHash?”](#desttxhash)
> `optional` **destTxHash?**: `string` | `null`
Defined in: protocol-swap2-core/src/types.ts:104
Two-phase routes: the destination-chain claim transaction, once sent.
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/src/types.ts:101
***
### sourceTxHash?
[Section titled “sourceTxHash?”](#sourcetxhash)
> `optional` **sourceTxHash?**: `string` | `null`
Defined in: protocol-swap2-core/src/types.ts:102
# IntentStatus
Defined in: protocol-swap2-core/src/types.ts:137
A provider’s answer to `trackIntent`.
## Properties
[Section titled “Properties”](#properties)
### claim?
[Section titled “claim?”](#claim)
> `optional` **claim?**: `object`
Defined in: protocol-swap2-core/src/types.ts:148
Two-phase routes (CCTP-style burn-and-mint): the delivery needs a second, user-signed transaction on the destination chain. `ready` means the provider can build it now (`buildClaim`); `state` is then “action-required”. Before that the route is “pending” with `ready: false`.
#### chain
[Section titled “chain”](#chain)
> **chain**: `string`
#### ready
[Section titled “ready”](#ready)
> **ready**: `boolean`
***
### depositReceived?
[Section titled “depositReceived?”](#depositreceived)
> `optional` **depositReceived?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:140
Still pending, but the source deposit has been observed (PROCESSING).
***
### destTxHash?
[Section titled “destTxHash?”](#desttxhash)
> `optional` **destTxHash?**: `string`
Defined in: protocol-swap2-core/src/types.ts:141
***
### state
[Section titled “state”](#state)
> **state**: [`IntentState`](/api/anywalletkit/protocol-swap2-core/type-aliases/intentstate/)
Defined in: protocol-swap2-core/src/types.ts:138
# Quote
Defined in: protocol-swap2-core/src/types.ts:74
A normalized quote from one provider.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`RoutedQuote`](/api/anywalletkit/protocol-swap2-core/interfaces/routedquote/)
## Properties
[Section titled “Properties”](#properties)
### depositAddress
[Section titled “depositAddress”](#depositaddress)
> **depositAddress**: `string`
Defined in: protocol-swap2-core/src/types.ts:79
***
### depositMemo
[Section titled “depositMemo”](#depositmemo)
> **depositMemo**: `string` | `null`
Defined in: protocol-swap2-core/src/types.ts:80
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:84
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/src/types.ts:90
Estimated time to delivery.
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `object`\[]
Defined in: protocol-swap2-core/src/types.ts:88
Honest itemized fees when the provider exposes base-unit amounts.
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
#### included
[Section titled “included”](#included)
> **included**: `boolean`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"protocol"` | `"network"` | `"affiliate"` | `"other"`
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/src/types.ts:86
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/src/types.ts:78
Provider’s id for this swap; tracked with `trackIntent`.
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:85
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/src/types.ts:76
Provider name.
***
### providerData?
[Section titled “providerData?”](#providerdata)
> `optional` **providerData?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/src/types.ts:96
Provider-owned, JSON-safe facts required to revalidate execution.
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/src/types.ts:92
Provider’s reliability hint, 0 to 1.
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:83
***
### txRequest?
[Section titled “txRequest?”](#txrequest)
> `optional` **txRequest?**: [`TxRequest`](/api/anywalletkit/protocol-swap2-core/interfaces/txrequest/)
Defined in: protocol-swap2-core/src/types.ts:82
Present instead of a usable depositAddress for calldata providers.
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/src/types.ts:94
Quote expiry, unix milliseconds.
# QuoteParams
Defined in: protocol-swap2-core/src/types.ts:15
What the engine asks a provider to quote. Amounts are base-unit strings; exact input only.
## Properties
[Section titled “Properties”](#properties)
### amountIn
[Section titled “amountIn”](#amountin)
> **amountIn**: `string`
Defined in: protocol-swap2-core/src/types.ts:30
***
### destAddress
[Section titled “destAddress”](#destaddress)
> **destAddress**: `string`
Defined in: protocol-swap2-core/src/types.ts:35
***
### destChain
[Section titled “destChain”](#destchain)
> **destChain**: `string`
Defined in: protocol-swap2-core/src/types.ts:28
***
### destToken
[Section titled “destToken”](#desttoken)
> **destToken**: `string`
Defined in: protocol-swap2-core/src/types.ts:29
***
### dry?
[Section titled “dry?”](#dry)
> `optional` **dry?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:39
Pricing preview only — no deposit address is created upstream.
***
### flex?
[Section titled “flex?”](#flex)
> `optional` **flex?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:45
Amount-flexible deposit (exchange flow): `amountIn` is only a pricing notional — the user may send any amount to the deposit address (1Click FLEX_INPUT). Providers that can’t do this return no quote.
***
### minAmountOut?
[Section titled “minAmountOut?”](#minamountout)
> `optional` **minAmountOut?**: `string`
Defined in: protocol-swap2-core/src/types.ts:32
Caller-supplied output floor in destination base units.
***
### onRefusal?
[Section titled “onRefusal?”](#onrefusal)
> `optional` **onRefusal?**: (`reason`) => `void`
Defined in: protocol-swap2-core/src/types.ts:19
Local-only (never serialized): called with the reason when the provider refuses to quote — a shared-instance “last refusal” field raced under concurrent quotes, so the reason rides per-call.
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### refundAddress?
[Section titled “refundAddress?”](#refundaddress)
> `optional` **refundAddress?**: `string`
Defined in: protocol-swap2-core/src/types.ts:37
Where a failed swap refunds on the source chain (the sender’s address).
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: protocol-swap2-core/src/types.ts:34
Maximum slippage accepted by the caller, expressed in basis points.
***
### sourceChain
[Section titled “sourceChain”](#sourcechain)
> **sourceChain**: `string`
Defined in: protocol-swap2-core/src/types.ts:20
***
### sourceDecimals?
[Section titled “sourceDecimals?”](#sourcedecimals)
> `optional` **sourceDecimals?**: `number`
Defined in: protocol-swap2-core/src/types.ts:27
Set only for a source token the catalog does not list: `sourceToken` is then its contract (EVM) or mint (Solana) and this its decimals. Providers that can trade any token resolve it with `resolveAsset(chain, sourceToken, {allowUnlisted: true, decimals})`; the others refuse it.
***
### sourceToken
[Section titled “sourceToken”](#sourcetoken)
> **sourceToken**: `string`
Defined in: protocol-swap2-core/src/types.ts:21
# RemotePins
Defined in: protocol-swap2-core/src/types.ts:197
The contracts a provider’s EVM swaps call and approve on a chain, shipped by the provider package (`lifiPins`, `fyndPins`, `uniswapPins`…) and handed to `remoteProvider({...pins})`: a backend’s build is checked against the app’s addresses, never against its own (scan 2026-10-27 modules, F8/F9/F16). An empty list means the provider has no EVM calldata route on that chain.
## Properties
[Section titled “Properties”](#properties)
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/src/types.ts:213
The provider’s routes pay an address the backend names — a deposit address, or a plain value send — instead of calling a pinned contract (`thorchainPins` for a Tron vault, NEAR Intents’ per-quote deposit addresses). Without it a remote stub’s deposit-address and plain-value routes are refused (scan 2026-10-28, F9).
## Methods
[Section titled “Methods”](#methods)
### callTargets()
[Section titled “callTargets()”](#calltargets)
> **callTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/src/types.ts:198
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
***
### spenders()
[Section titled “spenders()”](#spenders)
> **spenders**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/src/types.ts:199
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
readonly `string`\[]
***
### verifyBuild()?
[Section titled “verifyBuild()?”](#verifybuild)
> `optional` **verifyBuild**(`quote`, `tx`, `params?`): `string` | `Promise`<`string` | `null`> | `null`
Defined in: protocol-swap2-core/src/types.ts:207
A client-side check of a remote build (typed order, cell body) against its quote: the reason it fails, or null.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### tx
[Section titled “tx”](#tx)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)
##### params?
[Section titled “params?”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-2)
`string` | `Promise`<`string` | `null`> | `null`
***
### verifyQuote()?
[Section titled “verifyQuote()?”](#verifyquote)
> `optional` **verifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-core/src/types.ts:205
A client-side check of a remote quote’s transaction against the user’s own request — the provider’s local validator run again on this side (Fynd: `checkFyndTransaction`): the reason it fails, or null.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### params
[Section titled “params”](#params-1)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-3)
`string` | `null`
# RemoteProviderOptions
Defined in: protocol-swap2-core/src/remote.ts:26
HTTP-proxied `CrossChainProvider`: forwards every provider call to a backend that runs the real provider. This is how a BROWSER context (e.g. a wallet’s signing worker) executes the full swap2 layer — account binding, approvals, cell-body guards, id/status lifecycle — while provider secrets (API JWTs, affiliate config) and non-CORS REST endpoints stay server-side.
Wire protocol: POST {baseUrl}/{action} with a JSON body, one action per provider method: quote {provider, params: QuoteParams} → Quote | null build {provider, quote: Quote} → UnsignedTx preflight {provider, quote: Quote, tx: UnsignedTx} → {} track {provider, ref: IntentRef} → IntentStatus notify {provider, intentId, txHash} → {} register {provider, intentId, signature} → {} claim {provider, ref: IntentRef} → UnsignedTx | null supports {provider, from, to} → {supported: boolean}
`supportsRoute`/`enabled` need a SYNC answer, so they are config: pass the routes the backend advertises via `supports`, or leave the default allow-and-let-quote-decide behavior (a null quote is a clean miss).
## Properties
[Section titled “Properties”](#properties)
### allowInsecureBaseUrl?
[Section titled “allowInsecureBaseUrl?”](#allowinsecurebaseurl)
> `optional` **allowInsecureBaseUrl?**: `boolean`
Defined in: protocol-swap2-core/src/remote.ts:77
Allow a non-https absolute `baseUrl` (local development only). Quotes, builds and typed orders travel this channel; over plain http anyone on the path can rewrite them (scan 2026-10-27 modules, F4).
***
### baseUrl
[Section titled “baseUrl”](#baseurl)
> **baseUrl**: `string`
Defined in: protocol-swap2-core/src/remote.ts:30
Endpoint prefix, e.g. “/api/v2/swap2” (same-origin) or absolute URL.
***
### callTargets?
[Section titled “callTargets?”](#calltargets)
> `optional` **callTargets?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/src/remote.ts:53
The contracts this provider’s EVM swaps may call, and the spenders they may be approved for, per chain — the provider package’s pins (`lifiPins`, `fyndPins`, `uniswapPins`…, spread into these options). The app’s lists, not the server’s: without them the engine refuses this stub’s EVM calldata routes and approvals, so a compromised backend cannot name its own contract or spender (scan 2026-10-27 modules, F8/F9/F16). Deposit-address routes need `depositAddressRoutes`.
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
***
### claimTargets?
[Section titled “claimTargets?”](#claimtargets)
> `optional` **claimTargets?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/src/remote.ts:45
The contracts this provider’s claims may call, per chain (e.g. `cctpClaimTargets` from `@anywalletkit/protocol-swap2-cctp`). The app’s list, not the server’s: without it the engine refuses claims from this stub (round 3, M24).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
readonly `string`\[]
***
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/src/remote.ts:72
Let this stub’s routes send the input to an address the backend names: a deposit address (NEAR Intents, a THORChain or Chainflip Tron vault) or a plain value send. Off by default: such a route bypasses `callTargets`, so a compromised backend could name its own address (scan 2026-10-28, F9). Opt in only for a provider whose deposit addresses cannot be pinned, or whose `verifyQuote` / `verifyBuild` checks them (`thorchainPins`, `chainflipPins`).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: () => `boolean`
Defined in: protocol-swap2-core/src/remote.ts:34
Optional synchronous dark flag for accurate client-side discovery.
#### Returns
[Section titled “Returns”](#returns-2)
`boolean`
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-core/src/remote.ts:79
Defaults to globalThis.fetch — injectable for tests.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-2)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-3)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Response`>
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/src/remote.ts:81
Extra headers (e.g. auth) attached to every call.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-swap2-core/src/remote.ts:28
Provider name the backend multiplexes on (e.g. “near-intents”).
***
### spenders?
[Section titled “spenders?”](#spenders)
> `optional` **spenders?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/src/remote.ts:54
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### chain
[Section titled “chain”](#chain-2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
readonly `string`\[]
***
### supportsChain?
[Section titled “supportsChain?”](#supportschain)
> `optional` **supportsChain?**: (`caip2`) => `boolean`
Defined in: protocol-swap2-core/src/remote.ts:36
Optional chain-level discovery hooks mirrored from the backend.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`boolean`
***
### supportsChainPair?
[Section titled “supportsChainPair?”](#supportschainpair)
> `optional` **supportsChainPair?**: (`fromChain`, `toChain`) => `boolean`
Defined in: protocol-swap2-core/src/remote.ts:37
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### fromChain
[Section titled “fromChain”](#fromchain)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`boolean`
***
### supportsRoute?
[Section titled “supportsRoute?”](#supportsroute)
> `optional` **supportsRoute?**: (`from`, `to`) => `boolean`
Defined in: protocol-swap2-core/src/remote.ts:32
Sync capability gate; defaults to true (the backend quote decides).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### from
[Section titled “from”](#from)
[`Asset`](/api/anywalletkit/protocol-swap2-core/interfaces/asset/)
##### to
[Section titled “to”](#to)
[`Asset`](/api/anywalletkit/protocol-swap2-core/interfaces/asset/)
#### Returns
[Section titled “Returns”](#returns-8)
`boolean`
***
### supportsSameChain?
[Section titled “supportsSameChain?”](#supportssamechain)
> `optional` **supportsSameChain?**: `boolean`
Defined in: protocol-swap2-core/src/remote.ts:39
Explicit opt-in when the backend can execute same-chain swaps.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-swap2-core/src/remote.ts:83
Per-request fail-closed timeout. Defaults to 12 seconds.
***
### verifyBuild?
[Section titled “verifyBuild?”](#verifybuild)
> `optional` **verifyBuild?**: (`quote`, `tx`, `params?`) => `string` | `Promise`<`string` | `null`> | `null`
Defined in: protocol-swap2-core/src/remote.ts:65
The provider’s own check of a build on the client — a typed order, a cell body — against the quote it was built for: the reason it fails, or null. A build it refuses is never approved or signed.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
##### tx
[Section titled “tx”](#tx)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-core/interfaces/unsignedtx/)
##### params?
[Section titled “params?”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-9)
`string` | `Promise`<`string` | `null`> | `null`
***
### verifyQuote?
[Section titled “verifyQuote?”](#verifyquote)
> `optional` **verifyQuote?**: (`params`, `quote`) => `string` | `null`
Defined in: protocol-swap2-core/src/remote.ts:60
The provider’s own check of a quote’s transaction, run here on the client against the request the app sent (shipped with the pins, e.g. `fyndPins`): a quote it refuses never reaches the auction. The backend runs the same check, but the backend is what this guards against.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### params
[Section titled “params”](#params-1)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-core/interfaces/quoteparams/)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-10)
`string` | `null`
# RoutedQuote
Defined in: protocol-swap2-core/src/types.ts:108
The router’s chosen quote, tagged with how it scored.
## Extends
[Section titled “Extends”](#extends)
* [`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/)
## Properties
[Section titled “Properties”](#properties)
### depositAddress
[Section titled “depositAddress”](#depositaddress)
> **depositAddress**: `string`
Defined in: protocol-swap2-core/src/types.ts:79
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`depositAddress`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#depositaddress)
***
### depositMemo
[Section titled “depositMemo”](#depositmemo)
> **depositMemo**: `string` | `null`
Defined in: protocol-swap2-core/src/types.ts:80
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`depositMemo`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#depositmemo)
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:84
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`destAmount`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#destamount)
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/src/types.ts:90
Estimated time to delivery.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`etaSeconds`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#etaseconds)
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `object`\[]
Defined in: protocol-swap2-core/src/types.ts:88
Honest itemized fees when the provider exposes base-unit amounts.
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
#### included
[Section titled “included”](#included)
> **included**: `boolean`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"protocol"` | `"network"` | `"affiliate"` | `"other"`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`fees`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#fees)
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/src/types.ts:86
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`feeUsd`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#feeusd)
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/src/types.ts:78
Provider’s id for this swap; tracked with `trackIntent`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`intentId`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#intentid)
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:85
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`minDestAmount`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#mindestamount)
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/src/types.ts:76
Provider name.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`provider`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#provider)
***
### providerData?
[Section titled “providerData?”](#providerdata)
> `optional` **providerData?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/src/types.ts:96
Provider-owned, JSON-safe facts required to revalidate execution.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`providerData`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#providerdata)
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/src/types.ts:92
Provider’s reliability hint, 0 to 1.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`reliability`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#reliability)
***
### routeScore
[Section titled “routeScore”](#routescore)
> **routeScore**: `object`
Defined in: protocol-swap2-core/src/types.ts:109
#### candidates
[Section titled “candidates”](#candidates)
> **candidates**: `object`\[]
Every validated route: `score` is its value against the best (0..1).
#### score
[Section titled “score”](#score)
> **score**: `number`
#### weights
[Section titled “weights”](#weights)
> **weights**: [`ScoreWeights`](/api/anywalletkit/protocol-swap2-core/interfaces/scoreweights/)
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `string`
Defined in: protocol-swap2-core/src/types.ts:83
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`sourceAmount`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#sourceamount)
***
### txRequest?
[Section titled “txRequest?”](#txrequest)
> `optional` **txRequest?**: [`TxRequest`](/api/anywalletkit/protocol-swap2-core/interfaces/txrequest/)
Defined in: protocol-swap2-core/src/types.ts:82
Present instead of a usable depositAddress for calldata providers.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`txRequest`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#txrequest)
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/src/types.ts:94
Quote expiry, unix milliseconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`Quote`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/).[`validUntilMs`](/api/anywalletkit/protocol-swap2-core/interfaces/quote/#validuntilms)
# ScoreWeights
Defined in: protocol-swap2-core/src/types.ts:118
How the router weighs price, speed and reliability when it scores routes.
## Properties
[Section titled “Properties”](#properties)
### price
[Section titled “price”](#price)
> **price**: `number`
Defined in: protocol-swap2-core/src/types.ts:119
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/src/types.ts:121
***
### speed
[Section titled “speed”](#speed)
> **speed**: `number`
Defined in: protocol-swap2-core/src/types.ts:120
# SerializedExecutionExpectation
Defined in: protocol-swap2-core/src/swap2/base.ts:332
What a provider-serialized transaction is allowed to do with the bound account’s balances; derived from the validated quote and handed to the account’s `sendSerializedTransaction` hook, which must prove it (simulate with post-state balances) before signing. Amounts are base-unit strings.
## Properties
[Section titled “Properties”](#properties)
### maxValueOut
[Section titled “maxValueOut”](#maxvalueout)
> **maxValueOut**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:334
Most native coin the account may lose, fee excluded: swap input (native source) + allowance.
***
### source?
[Section titled “source?”](#source)
> `optional` **source?**: `object`
Defined in: protocol-swap2-core/src/swap2/base.ts:338
Token sources: the token the account may send and the exact swap input.
#### maxAmount
[Section titled “maxAmount”](#maxamount)
> **maxAmount**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### tokenIn?
[Section titled “tokenIn?”](#tokenin)
> `optional` **tokenIn?**: `object`
Defined in: protocol-swap2-core/src/swap2/base.ts:336
Same-chain swaps: the token the account must receive and the quoted minimum (zero address = native).
#### minAmount
[Section titled “minAmount”](#minamount)
> **minAmount**: `string`
#### token
[Section titled “token”](#token-1)
> **token**: `string`
# SlippageContext
Defined in: protocol-swap2-core/src/slippage.ts:22
## Properties
[Section titled “Properties”](#properties)
### etaSeconds?
[Section titled “etaSeconds?”](#etaseconds)
> `optional` **etaSeconds?**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:31
The route’s expected time to settle, in seconds.
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/src/slippage.ts:23
***
### fromSymbol
[Section titled “fromSymbol”](#fromsymbol)
> **fromSymbol**: `string`
Defined in: protocol-swap2-core/src/slippage.ts:26
Catalog symbols of the two sides, e.g. “USDC”, “ETH”, “cbBTC”.
***
### priceImpactBps?
[Section titled “priceImpactBps?”](#priceimpactbps)
> `optional` **priceImpactBps?**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:29
Price impact of this trade as the provider reports it, in bps.
***
### toChain
[Section titled “toChain”](#tochain)
> **toChain**: `string`
Defined in: protocol-swap2-core/src/slippage.ts:24
***
### toSymbol
[Section titled “toSymbol”](#tosymbol)
> **toSymbol**: `string`
Defined in: protocol-swap2-core/src/slippage.ts:27
***
### volatilityBps?
[Section titled “volatilityBps?”](#volatilitybps)
> `optional` **volatilityBps?**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:33
Recent price range of the more volatile side (e.g. over 1 h), in bps.
# SlippageOptions
Defined in: protocol-swap2-core/src/slippage.ts:36
## Properties
[Section titled “Properties”](#properties)
### maxBps?
[Section titled “maxBps?”](#maxbps)
> `optional` **maxBps?**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:40
Default 300 bps; anything above needs the user’s own choice.
***
### minBps?
[Section titled “minBps?”](#minbps)
> `optional` **minBps?**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:38
Default 5 bps.
# SlippageSuggestion
Defined in: protocol-swap2-core/src/slippage.ts:43
## Properties
[Section titled “Properties”](#properties)
### bps
[Section titled “bps”](#bps)
> **bps**: `number`
Defined in: protocol-swap2-core/src/slippage.ts:44
***
### capped
[Section titled “capped”](#capped)
> **capped**: `boolean`
Defined in: protocol-swap2-core/src/slippage.ts:48
True when the sum was cut down to `maxBps`.
***
### pair
[Section titled “pair”](#pair)
> **pair**: [`SlippageClass`](/api/anywalletkit/protocol-swap2-core/type-aliases/slippageclass/)
Defined in: protocol-swap2-core/src/slippage.ts:45
***
### parts
[Section titled “parts”](#parts)
> **parts**: `object`
Defined in: protocol-swap2-core/src/slippage.ts:46
#### base
[Section titled “base”](#base)
> **base**: `number`
#### impact
[Section titled “impact”](#impact)
> **impact**: `number`
#### time
[Section titled “time”](#time)
> **time**: `number`
#### volatility
[Section titled “volatility”](#volatility)
> **volatility**: `number`
# Swap2EngineConfig
Defined in: protocol-swap2-core/src/swap2/base.ts:237
## Extends
[Section titled “Extends”](#extends)
* `Swap2ProtocolConfig`
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:245
Optional account chain identity when the account does not expose a provider.
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:286
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/src/swap2/base.ts:253
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:239
CAIP-2 of the chain the bound account lives on (the swap2 source).
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2ProtocolConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2ProtocolConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/src/swap2/base.ts:241
Progress observer, see [Swap2ExecutionPhase](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2executionphase/).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
[`Swap2ExecutionPhase`](/api/anywalletkit/protocol-swap2-core/type-aliases/swap2executionphase/)
##### detail?
[Section titled “detail?”](#detail)
[`Swap2ExecutionPhaseDetail`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionphasedetail/)
#### Returns
[Section titled “Returns”](#returns-1)
`void`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/src/swap2/base.ts:277
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
[`Swap2ExecutionPlan`](/api/anywalletkit/protocol-swap2-core/interfaces/swap2executionplan/)
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:260
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/src/swap2/base.ts:243
Explicit escape hatch for adapters that can prove chain binding elsewhere.
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:266
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
# Swap2ExecutionPhaseDetail
Defined in: protocol-swap2-core/src/swap2/base.ts:181
## Properties
[Section titled “Properties”](#properties)
### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:186
broadcast: the source transaction hash.
***
### index?
[Section titled “index?”](#index)
> `optional` **index?**: `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:183
approving: which approval of how many (USDT on Ethereum needs two).
***
### total?
[Section titled “total?”](#total)
> `optional` **total?**: `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:184
# Swap2ExecutionPlan
Defined in: protocol-swap2-core/src/swap2/base.ts:297
What `swap2()` is about to sign, handed to [Swap2EngineConfig.reviewExecution](/api/anywalletkit/protocol-swap2-core/interfaces/swap2engineconfig/#reviewexecution).
## Properties
[Section titled “Properties”](#properties)
### approvals
[Section titled “approvals”](#approvals)
> **approvals**: `object`\[]
Defined in: protocol-swap2-core/src/swap2/base.ts:311
ERC-20 approvals sent first, in order (USDT on Ethereum resets to 0 first).
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
#### spender
[Section titled “spender”](#spender)
> **spender**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:305
***
### destChain
[Section titled “destChain”](#destchain)
> **destChain**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:300
***
### destToken
[Section titled “destToken”](#desttoken)
> **destToken**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:301
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:308
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:307
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:299
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:306
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:298
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:302
***
### refundAddress
[Section titled “refundAddress”](#refundaddress)
> **refundAddress**: `string`
Defined in: protocol-swap2-core/src/swap2/base.ts:303
***
### requoted?
[Section titled “requoted?”](#requoted)
> `optional` **requoted?**: `true`
Defined in: protocol-swap2-core/src/swap2/base.ts:317
`true` on a second review: the first quote expired while its approval was being mined, and the fresh one differs from what was reviewed (another payload, a worse output). The allowance is already in place, so `approvals` is empty; cancelling revokes it.
***
### source
[Section titled “source”](#source)
> **source**: { `cellBody?`: `boolean`; `cellBodyDecoded?`: [`TonBodySummary`](/api/anywalletkit/protocol-swap2-core/interfaces/tonbodysummary/); `chainId?`: `number`; `data?`: `string`; `gasLimit?`: `bigint`; `kind`: `"call"`; `memo?`: `string`; `memoEncoding?`: `"utf8"` | `"hex"`; `to`: `string`; `value`: `bigint`; } | { `amount`: `bigint`; `kind`: `"token-transfer"`; `memo?`: `string`; `memoEncoding?`: `"utf8"` | `"hex"`; `recipient`: `string`; `token`: `string`; } | { `kind`: `"serialized"`; `serializedTx`: `string`; } | { `kind`: `"typed-order"`; `typedData`: `string`; }
Defined in: protocol-swap2-core/src/swap2/base.ts:319
The source leg exactly as the account will receive it.
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `bigint`
Defined in: protocol-swap2-core/src/swap2/base.ts:304
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/src/swap2/base.ts:309
# SwapActivityOptions
Defined in: protocol-swap2-core/src/activity.ts:120
Labels a swap module passes when describing its own transactions in the activity feed.
## Properties
[Section titled “Properties”](#properties)
### counterparty?
[Section titled “counterparty?”](#counterparty)
> `optional` **counterparty?**: `string`
Defined in: protocol-swap2-core/src/activity.ts:134
Override the counterparty (default: the contract called).
***
### inSuffix?
[Section titled “inSuffix?”](#insuffix)
> `optional` **inSuffix?**: `string`
Defined in: protocol-swap2-core/src/activity.ts:138
Suffix for a one-legged inbound item, e.g. “via CCTP” → “Received USDC via CCTP”.
***
### kind
[Section titled “kind”](#kind)
> **kind**: `ActivityKind` | `"auto"`
Defined in: protocol-swap2-core/src/activity.ts:130
What the transaction is. `swap` / `bridge` get the automatic title (“Swapped A → B”, “Bridged A”, “Received A”); `auto` picks `swap` when both legs netted on this chain and `bridge` otherwise.
***
### outVerb?
[Section titled “outVerb?”](#outverb)
> `optional` **outVerb?**: `string`
Defined in: protocol-swap2-core/src/activity.ts:136
Verb for a one-legged outbound item (default “Bridged”).
***
### protocol
[Section titled “protocol”](#protocol)
> **protocol**: `string`
Defined in: protocol-swap2-core/src/activity.ts:122
Registry module name (`module.json` → `name`).
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: protocol-swap2-core/src/activity.ts:124
Venue label for the subtitle, e.g. “LI.FI”, “Uniswap v3 · Base”.
***
### title?
[Section titled “title?”](#title)
> `optional` **title?**: `string`
Defined in: protocol-swap2-core/src/activity.ts:132
Override the computed title.
# TonBodySummary
Defined in: protocol-swap2-core/src/swap2/base.ts:290
What a TON cell body does, as the engine read it before signing (scan 2026-10-27 modules, F13): its op, and the jetton transfer it is.
## Properties
[Section titled “Properties”](#properties)
### jettonTransfer?
[Section titled “jettonTransfer?”](#jettontransfer)
> `optional` **jettonTransfer?**: `object`
Defined in: protocol-swap2-core/src/swap2/base.ts:293
TEP-74 transfer from the account’s own jetton wallet: amount, where it goes, where the excess returns, the TON forwarded.
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### destination
[Section titled “destination”](#destination)
> **destination**: `string` | `null`
#### forwardTon
[Section titled “forwardTon”](#forwardton)
> **forwardTon**: `bigint`
#### responseDestination
[Section titled “responseDestination”](#responsedestination)
> **responseDestination**: `string` | `null`
***
### op
[Section titled “op”](#op)
> **op**: `number` | `null`
Defined in: protocol-swap2-core/src/swap2/base.ts:291
# TxRequest
Defined in: protocol-swap2-core/src/types.ts:53
Provider-built transaction for the CALLDATA execution model (LI.FI): the user’s wallet must execute this exact payload — a plain transfer to `to` would LOSE funds. Either an EVM request or a pre-serialized Solana tx.
## Properties
[Section titled “Properties”](#properties)
### approvalAddress?
[Section titled “approvalAddress?”](#approvaladdress)
> `optional` **approvalAddress?**: `string`
Defined in: protocol-swap2-core/src/types.ts:60
ERC-20 sources must approve this spender before executing.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-swap2-core/src/types.ts:57
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-swap2-core/src/types.ts:55
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `string`
Defined in: protocol-swap2-core/src/types.ts:58
***
### nativeFee?
[Section titled “nativeFee?”](#nativefee)
> `optional` **nativeFee?**: `string`
Defined in: protocol-swap2-core/src/types.ts:68
Native coin the route itself charges on top of the input (bridge messaging fees — Stargate/LayerZero-style), base units. A token source then sends exactly this as `value`; a native source sends input + this. Declared by the provider from the quote, sealed with it, and capped by the engine per chain.
***
### serializedTx?
[Section titled “serializedTx?”](#serializedtx)
> `optional` **serializedTx?**: `string`
Defined in: protocol-swap2-core/src/types.ts:70
Solana: base64-serialized transaction to sign & broadcast as-is.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocol-swap2-core/src/types.ts:54
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string`
Defined in: protocol-swap2-core/src/types.ts:56
# UnsignedTx
Defined in: protocol-swap2-core/src/types.ts:152
A provider’s source-leg transaction, before the engine checks and signs it.
## Properties
[Section titled “Properties”](#properties)
### approvalAddress?
[Section titled “approvalAddress?”](#approvaladdress)
> `optional` **approvalAddress?**: `string`
Defined in: protocol-swap2-core/src/types.ts:160
ERC-20 spender that must be approved before the calldata is sent.
***
### bodyBoc?
[Section titled “bodyBoc?”](#bodyboc)
> `optional` **bodyBoc?**: `string`
Defined in: protocol-swap2-core/src/types.ts:173
TON: serialized message-body CELL (base64 BoC) — e.g. an Omniston escrow payload. NOT interchangeable with `memo`: a memo is a text comment, while sending a BoC as text strands the swap. Executors must decode it to a Cell.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: protocol-swap2-core/src/types.ts:153
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-swap2-core/src/types.ts:157
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-swap2-core/src/types.ts:156
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `string`
Defined in: protocol-swap2-core/src/types.ts:158
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-swap2-core/src/types.ts:164
Native-chain memo/body required by the deposit protocol.
***
### memoEncoding?
[Section titled “memoEncoding?”](#memoencoding)
> `optional` **memoEncoding?**: `"utf8"` | `"hex"`
Defined in: protocol-swap2-core/src/types.ts:167
How `memo` becomes bytes on chains whose memo is a byte field (Tron `raw_data.data`): ‘utf8’ text (default) or ‘hex’ — a binary payload given as 0x-hex (a Chainflip vault-swap note).
***
### orderExtension?
[Section titled “orderExtension?”](#orderextension)
> `optional` **orderExtension?**: `string`
Defined in: protocol-swap2-core/src/types.ts:188
Typed-order execution: the order extension (0x-hex) the order’s salt commits to — a 1inch Limit Order Protocol order’s amount getters and post-interaction, where an HTLC order’s escrow terms live. Carried so an app can open a remote build on the client (`omnistonVerifyBuild`, scan 2026-10-28 F6); the signature covers it through the salt.
***
### serializedTx?
[Section titled “serializedTx?”](#serializedtx)
> `optional` **serializedTx?**: `string`
Defined in: protocol-swap2-core/src/types.ts:162
Provider-native serialized transaction (for accounts that expose a hook).
***
### stateInitBoc?
[Section titled “stateInitBoc?”](#stateinitboc)
> `optional` **stateInitBoc?**: `string`
Defined in: protocol-swap2-core/src/types.ts:175
TON: contract stateInit (base64 BoC) the message must carry, when present.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-swap2-core/src/types.ts:154
***
### typedData?
[Section titled “typedData?”](#typeddata)
> `optional` **typedData?**: `string`
Defined in: protocol-swap2-core/src/types.ts:182
GASLESS typed-order execution (Omniston EVM-source): the JSON EIP-712 payload the account must sign — there is NO source transaction. After signing, complete via `CrossChainProvider.registerSignedOrder`. When set, `approvalAddress` names the settlement contract that needs allowance.
***
### value
[Section titled “value”](#value)
> **value**: `string`
Defined in: protocol-swap2-core/src/types.ts:155
# IntentState
> **IntentState** = `"pending"` | `"action-required"` | `"refund-pending"` | `"partial"` | `"completed"` | `"failed"` | `"refunded"` | `"cancelled"` | `"expired"`
Defined in: protocol-swap2-core/src/types.ts:125
A swap’s state as the engine reports it; maps to `Swap2Status`.
# SlippageClass
> **SlippageClass** = `"stable"` | `"major"` | `"other"`
Defined in: protocol-swap2-core/src/slippage.ts:20
Auto slippage — how far below the quoted output a swap may settle before it reverts or refunds. Slippage covers price movement between the quote and execution, so it is sized by what moves the price in that window:
* the pair: stablecoin ↔ stablecoin barely moves, majors move a little, everything else more (the base);
* the trade’s own price impact: a large order in a thin pool is more exposed to the next trade landing first;
* time to settle: same-chain swaps land in seconds, cross-chain routes take minutes (ignored for stable ↔ stable, where the price does not drift);
* recent volatility of the more volatile side, when the app knows it.
The sum is clamped to \[minBps, maxBps]. A higher slippage is not free on a same-chain EVM swap: a sandwich bot can take up to all of it, so the bases stay small and room is added only where it is needed. Route policy lives in the app: it decides whether to use this, show it, and let the user override.
# Swap2Account
> **Swap2Account** = `unknown`
Defined in: protocol-swap2-core/src/swap2/base.ts:371
A bound wallet account, accepted opaquely: the write surface we need is reached through Swap2Signer. Passing `undefined` builds a quote-only protocol (no `swap2()` execution).
# Swap2ErrorCode
> **Swap2ErrorCode** = `"CONFIGURATION"` | `"VALIDATION"` | `"QUOTE"` | `"EXECUTION"` | `"UNSUPPORTED_OPERATION"` | `"FEE_LIMIT"` | `"STATUS"`
Defined in: protocol-swap2-core/src/errors.ts:5
Which stage of a swap failed: configuration, input validation, quote, execution, an unsupported operation, a fee ceiling, or status tracking.
# Swap2ExecutionPhase
> **Swap2ExecutionPhase** = `"approving"` | `"requoting"` | `"preflight"` | `"signing"` | `"broadcast"`
Defined in: protocol-swap2-core/src/swap2/base.ts:180
# NATIVE_DECIMALS
> `const` **NATIVE_DECIMALS**: `Readonly`<`Record`<`string`, `number`>>
Defined in: protocol-swap2-core/src/swap2/base.ts:129
Base-unit precision of a chain’s native coin — what `value`, `eth_getBalance` and a declared `nativeFee` are counted in. Every EVM chain the engine knows accounts for gas in 18-decimal units, Arc included: Arc’s gas token is USDC, but its native accounting is 18-decimal (“the native USDC gas token uses 18 decimals of precision, while the USDC ERC-20 interface uses 6” — docs.arc.network, gas-and-fees / contract-addresses, 2026-10-14). Arc is pinned here so the 6-decimal ERC-20 view can never leak into a ceiling: 10 USDC of fee headroom is 10 × 10^18 base units, not 10 × 10^6. A chain whose native accounting is genuinely not 18-decimal gets its own row and every cap below, declared in whole coins, scales with it.
# SWAP2_CHAIN_ALIASES
> `const` **SWAP2_CHAIN_ALIASES**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-core/src/swap2/base.ts:532
The wallet packages name non-EVM chains by genesis hash (CAIP-2 proper: `account.chain` of a Solana account is `solana:5eykt…`), while the swap2 catalog and every provider use the short ids. The engine takes either.
# SWAP2_ID_PREFIX
> `const` **SWAP2_ID_PREFIX**: `"awk1"` = `"awk1"`
Defined in: protocol-swap2-core/src/swap2/base.ts:465
Swap2 status ids are `awk1..[.]` (URI-encoded segments).
# @anywalletkit/protocol-swap2-fynd
# @anywalletkit/protocol-swap2-fynd
[Section titled “@anywalletkit/protocol-swap2-fynd”](#anywalletkitprotocol-swap2-fynd)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-fynd)
[Fynd](https://docs.fynd.xyz) — Propeller Heads’ DEX aggregator — as a same-chain swap2 provider for Any Wallet Kit. Exact-input swaps on Ethereum, Base, Arbitrum, BNB Chain, Polygon, Unichain and Robinhood Chain, routed over the pools Tycho indexes.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-fynd @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-fynd @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-fynd @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-fynd](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-fynd), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
> **Fynd License.** Quotes, routes and transactions produced by Fynd are licensed under the [Fynd License](https://github.com/propeller-heads/fynd/blob/main/LICENSE.md). In short:
>
> * every swap built from a Fynd quote must settle through the Tycho router for its chain (the [router registry](https://docs.propellerheads.xyz/tycho/for-solvers/execution/contract-addresses)), with its fees intact, and must not be re-routed around it;
> * the router may take a platform fee and keeps positive slippage;
> * if you earn revenue on such swaps (your own fees, spreads), Propeller Heads is owed a share of it, with reporting.
>
> This module only ever sends the router transaction Fynd encoded. Read the license before you ship it.
## What the module checks
[Section titled “What the module checks”](#what-the-module-checks)
Before anything is approved or signed, the encoded transaction is decoded and checked against the request:
* it targets the pinned TychoRouterV3 for that chain;
* the method is a plain `singleSwap`, `sequentialSwap` or `splitSwap` (no Permit2, no vault funds);
* it spends exactly the requested amount of the requested token, for the requested output token;
* it pays the user, not anyone else;
* the expected output and the minimum match the quote, and Fynd’s fee breakdown adds up;
* it carries no client fee.
The router reverts below the minimum. With `rpcUrls` set, the exact transaction is also simulated: at quote time for native input (no allowance needed), and right before broadcast for every swap.
**Why `uniswap_v4_hooks` is excluded by default.** On 2026-10-24 every Ethereum route the hosted API built through Uniswap v4 hook pools was quoted about 0.6–1% above the market and reverted when simulated (4 of 4 native-input pairs, and USDT → USDC). The same pairs without those pools executed (8 of 8 across Ethereum, Base and Arbitrum). A route through an excluded family is refused even if the server returns one. The hosted API has neither its own simulation nor its price guard enabled, so these checks are the wallet’s.
## Configure
[Section titled “Configure”](#configure)
```ts
import { fyndProvider } from '@anywalletkit/protocol-swap2-fynd'
const fynd = fyndProvider({
apiKey: process.env.FYND_API_KEY, // hosted API; keep it on your server (remoteProvider)
// selfHosted: { 8453: 'https://fynd-base.internal' }, // or your own `fynd serve` per chain
rpcUrls: { 8453: ['https://base.example/rpc'] }, // optional: pre-broadcast simulation + receipts
})
```
Behind `remoteProvider` (the API key on your server), the app wires the router pins and the transaction check: `remoteProvider({name: "fynd", baseUrl, ...fyndPins})`. The engine then accepts only the Tycho router in `FYND_CHAINS` as call target and spender, and re-runs `checkFyndTransaction` on the client against the app’s own request (input, tokens, recipient, minimum, no client fee) — a backend cannot point the swap anywhere else. Without the pins the stub gets no route.
| Option | Default | Meaning |
| -------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------- |
| `apiKey` | none | Hosted API key from Propeller Heads, sent as the raw `Authorization` header. |
| `baseUrl` | `https://fynd-api.propellerheads.xyz` | Hosted API; requests go to `{baseUrl}/v1/{chain}/quote`. |
| `selfHosted` | none | `{ chainId: url }` — your own Fynd servers; requests go to `{url}/v1/quote`, without a key. |
| `rpcUrls` | none | `{ chainId: [url…] }` for simulation and receipts. |
| `defaultSlippageBps` | `50` | Used when the caller passes none. |
| `quoteTtlMs` | `30000` | Fynd prices at one block; the engine re-checks this before broadcast. |
| `excludeProtocols` | `["uniswap_v4_hooks"]` | Liquidity Fynd must not route through (names, or family prefixes ending in `:`). |
A chain is served when it has a self-hosted server or the hosted API key is set.
## Not supported (yet)
[Section titled “Not supported (yet)”](#not-supported-yet)
* Exact-output swaps — Fynd only sells an exact input.
* A swap deadline. The router enforces a deadline only through a signed client-fee message; this module sends no client-fee parameters, so the on-chain protection is the minimum output.
* Integrator fees.
Apache-2.0 (this module’s code). Fynd outputs: the Fynd License.
## Classes
[Section titled “Classes”](#classes)
* [FyndSwap2Protocol](/api/anywalletkit/protocol-swap2-fynd/classes/fyndswap2protocol/)
* [FyndTransactionError](/api/anywalletkit/protocol-swap2-fynd/classes/fyndtransactionerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [EncodedTx](/api/anywalletkit/protocol-swap2-fynd/interfaces/encodedtx/)
* [ExpectedSwap](/api/anywalletkit/protocol-swap2-fynd/interfaces/expectedswap/)
* [FyndProviderConfig](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/)
* [FyndSwap2Config](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [FYND_CHAINS](/api/anywalletkit/protocol-swap2-fynd/variables/fynd_chains/)
* [FYND_DEFAULT_EXCLUDED_PROTOCOLS](/api/anywalletkit/protocol-swap2-fynd/variables/fynd_default_excluded_protocols/)
* [FYND_MODULE](/api/anywalletkit/protocol-swap2-fynd/variables/fynd_module/)
* [fyndPins](/api/anywalletkit/protocol-swap2-fynd/variables/fyndpins/)
* [ROUTER_NATIVE](/api/anywalletkit/protocol-swap2-fynd/variables/router_native/)
* [TYCHO_ROUTER_ABI](/api/anywalletkit/protocol-swap2-fynd/variables/tycho_router_abi/)
* [TYCHO_ROUTER_SELECTORS](/api/anywalletkit/protocol-swap2-fynd/variables/tycho_router_selectors/)
## Functions
[Section titled “Functions”](#functions)
* [checkFyndTransaction](/api/anywalletkit/protocol-swap2-fynd/functions/checkfyndtransaction/)
* [describeFyndActivity](/api/anywalletkit/protocol-swap2-fynd/functions/describefyndactivity/)
* [fyndProvider](/api/anywalletkit/protocol-swap2-fynd/functions/fyndprovider/)
* [fyndVerifyQuote](/api/anywalletkit/protocol-swap2-fynd/functions/fyndverifyquote/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [FyndSwap2Protocol](/api/anywalletkit/protocol-swap2-fynd/classes/fyndswap2protocol/)
# FyndSwap2Protocol
Defined in: protocol-swap2-fynd/src/protocol.ts:10
Fynd as a standalone swap2 protocol (same-chain swaps on one account).
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new FyndSwap2Protocol**(`account`, `config`): `FyndSwap2Protocol`
Defined in: protocol-swap2-fynd/src/protocol.ts:13
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`FyndSwap2Config`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`FyndSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-fynd/src/protocol.ts:11
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-fynd/src/protocol.ts:18
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-fynd/src/protocol.ts:23
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# FyndTransactionError
Defined in: protocol-swap2-fynd/src/router.ts:56
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new FyndTransactionError**(`message`): `FyndTransactionError`
Defined in: protocol-swap2-fynd/src/router.ts:57
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`FyndTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# checkFyndTransaction
> **checkFyndTransaction**(`tx`, `expected`): `object`
Defined in: protocol-swap2-fynd/src/router.ts:92
Refuses (throws [FyndTransactionError](/api/anywalletkit/protocol-swap2-fynd/classes/fyndtransactionerror/)) unless `tx` is exactly the swap the wallet asked for.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`EncodedTx`](/api/anywalletkit/protocol-swap2-fynd/interfaces/encodedtx/)
### expected
[Section titled “expected”](#expected)
[`ExpectedSwap`](/api/anywalletkit/protocol-swap2-fynd/interfaces/expectedswap/)
## Returns
[Section titled “Returns”](#returns)
`object`
### method
[Section titled “method”](#method)
> **method**: `"singleSwap"` | `"sequentialSwap"` | `"splitSwap"`
# describeFyndActivity
> **describeFyndActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-fynd/src/activity.ts:13
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# fyndProvider
> **fyndProvider**(`config`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-fynd/src/provider.ts:78
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# fyndVerifyQuote
> **fyndVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-fynd/src/router.ts:137
[checkFyndTransaction](/api/anywalletkit/protocol-swap2-fynd/functions/checkfyndtransaction/) on a remote quote, against the request this app sent: the pinned router, one chain, the exact input, the requested tokens, the app’s recipient, the quoted minimum and no client fee. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# EncodedTx
Defined in: protocol-swap2-fynd/src/router.ts:76
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-swap2-fynd/src/router.ts:79
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-swap2-fynd/src/router.ts:77
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: protocol-swap2-fynd/src/router.ts:78
# ExpectedSwap
Defined in: protocol-swap2-fynd/src/router.ts:63
## Properties
[Section titled “Properties”](#properties)
### amountIn
[Section titled “amountIn”](#amountin)
> **amountIn**: `bigint`
Defined in: protocol-swap2-fynd/src/router.ts:68
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-swap2-fynd/src/router.ts:64
***
### expectedAmountOut
[Section titled “expectedAmountOut”](#expectedamountout)
> **expectedAmountOut**: `bigint`
Defined in: protocol-swap2-fynd/src/router.ts:71
Fynd’s gross `amount_out` (before the router fee and slippage).
***
### minAmountOut
[Section titled “minAmountOut”](#minamountout)
> **minAmountOut**: `bigint`
Defined in: protocol-swap2-fynd/src/router.ts:73
Fynd’s `min_amount_received` — what the router enforces on-chain.
***
### receiver
[Section titled “receiver”](#receiver)
> **receiver**: `string`
Defined in: protocol-swap2-fynd/src/router.ts:69
***
### tokenIn
[Section titled “tokenIn”](#tokenin)
> **tokenIn**: `string`
Defined in: protocol-swap2-fynd/src/router.ts:66
ERC-20 address, or the zero address for the native coin.
***
### tokenOut
[Section titled “tokenOut”](#tokenout)
> **tokenOut**: `string`
Defined in: protocol-swap2-fynd/src/router.ts:67
# FyndProviderConfig
Defined in: protocol-swap2-fynd/src/provider.ts:43
## Extended by
[Section titled “Extended by”](#extended-by)
* [`FyndSwap2Config`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-fynd/src/provider.ts:46
Hosted API key (raw `Authorization` value). Server-side only.
***
### baseUrl?
[Section titled “baseUrl?”](#baseurl)
> `optional` **baseUrl?**: `string`
Defined in: protocol-swap2-fynd/src/provider.ts:48
Hosted API base URL; requests go to `{baseUrl}/v1/{chain}/quote`.
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:53
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-fynd/src/provider.ts:44
***
### excludeProtocols?
[Section titled “excludeProtocols?”](#excludeprotocols)
> `optional` **excludeProtocols?**: readonly `string`\[]
Defined in: protocol-swap2-fynd/src/provider.ts:57
Protocol names or family prefixes ending in “:” Fynd must not route through. Default [FYND_DEFAULT_EXCLUDED_PROTOCOLS](/api/anywalletkit/protocol-swap2-fynd/variables/fynd_default_excluded_protocols/).
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:54
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-fynd/src/provider.ts:52
JSON-RPC endpoints per chain id: pre-broadcast simulation and receipts. Optional.
***
### selfHosted?
[Section titled “selfHosted?”](#selfhosted)
> `optional` **selfHosted?**: `Readonly`<`Record`<`number`, `string`>>
Defined in: protocol-swap2-fynd/src/provider.ts:50
Your own Fynd servers per EVM chain id; requests go to `{url}/v1/quote`, no key. Takes precedence over the hosted API for that chain.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:55
# FyndSwap2Config
Defined in: protocol-swap2-fynd/src/protocol.ts:7
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-fynd/src/provider.ts:46
Hosted API key (raw `Authorization` value). Server-side only.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`apiKey`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#apikey)
***
### baseUrl?
[Section titled “baseUrl?”](#baseurl)
> `optional` **baseUrl?**: `string`
Defined in: protocol-swap2-fynd/src/provider.ts:48
Hosted API base URL; requests go to `{baseUrl}/v1/{chain}/quote`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`baseUrl`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#baseurl)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2EngineConfig.decodeTonBody`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:53
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`defaultSlippageBps`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#defaultslippagebps)
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-fynd/src/provider.ts:44
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#enabled)
***
### excludeProtocols?
[Section titled “excludeProtocols?”](#excludeprotocols)
> `optional` **excludeProtocols?**: readonly `string`\[]
Defined in: protocol-swap2-fynd/src/provider.ts:57
Protocol names or family prefixes ending in “:” Fynd must not route through. Default [FYND_DEFAULT_EXCLUDED_PROTOCOLS](/api/anywalletkit/protocol-swap2-fynd/variables/fynd_default_excluded_protocols/).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`excludeProtocols`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#excludeprotocols)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:54
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-fynd/src/provider.ts:52
JSON-RPC endpoints per chain id: pre-broadcast simulation and receipts. Optional.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#rpcurls)
***
### selfHosted?
[Section titled “selfHosted?”](#selfhosted)
> `optional` **selfHosted?**: `Readonly`<`Record`<`number`, `string`>>
Defined in: protocol-swap2-fynd/src/provider.ts:50
Your own Fynd servers per EVM chain id; requests go to `{url}/v1/quote`, no key. Takes precedence over the hosted API for that chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`selfHosted`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#selfhosted)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.skipAccountChainCheck`
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-swap2-fynd/src/provider.ts:55
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`FyndProviderConfig`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/).[`timeoutMs`](/api/anywalletkit/protocol-swap2-fynd/interfaces/fyndproviderconfig/#timeoutms)
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`Swap2EngineConfig.tonGasCeiling`
# FYND_CHAINS
> `const` **FYND_CHAINS**: `Readonly`<`Record`<`number`, { `name`: `string`; `router`: `` `0x${string}` ``; `slug`: `string`; }>>
Defined in: protocol-swap2-fynd/src/router.ts:16
Router registry: github.com/propeller-heads/tycho crates/tycho-execution/config/deployment_registry.json (TychoRouterV3, effective 2026-09-01).
# FYND_DEFAULT_EXCLUDED_PROTOCOLS
> `const` **FYND_DEFAULT_EXCLUDED_PROTOCOLS**: readonly `string`\[]
Defined in: protocol-swap2-fynd/src/provider.ts:33
Liquidity families left out of routing by default. 2026-10-24 on the hosted API: every Ethereum route through `uniswap_v4_hooks` was quoted \~0.6–1 % above the market and reverted when simulated (4 of 4 native-in pairs, also USDT → USDC), while the same pairs without it executed (8 of 8 across Ethereum, Base and Arbitrum). Override with `excludeProtocols`.
# FYND_MODULE
> `const` **FYND_MODULE**: `"@anywalletkit/protocol-swap2-fynd"` = `"@anywalletkit/protocol-swap2-fynd"`
Defined in: protocol-swap2-fynd/src/activity.ts:11
# fyndPins
> `const` **fyndPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-fynd/src/router.ts:167
The Tycho router a Fynd swap calls and approves on a chain, and [fyndVerifyQuote](/api/anywalletkit/protocol-swap2-fynd/functions/fyndverifyquote/) — the app’s side of `remoteProvider({name: "fynd", baseUrl, ...fyndPins})`, so a backend’s quote is checked against these routers and the app’s own request, never against itself (scan 2026-10-27 modules, F9).
# ROUTER_NATIVE
> `const` **ROUTER_NATIVE**: `"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"` = `"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"`
Defined in: protocol-swap2-fynd/src/router.ts:27
The router’s native-coin sentinel (lib/NativeETH.sol); Fynd’s API uses the zero address instead.
# TYCHO_ROUTER_ABI
> `const` **TYCHO_ROUTER_ABI**: readonly \[{ }, { }, { }]
Defined in: protocol-swap2-fynd/src/router.ts:35
The three entry points a wallet swap uses (plain `transferFrom` from the user).
# TYCHO_ROUTER_SELECTORS
> `const` **TYCHO_ROUTER_SELECTORS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-fynd/src/router.ts:42
Every swap entry point of the router (Permit2 and vault variants included) — for recognizing history.
# @anywalletkit/protocol-swap2-jupiter
# @anywalletkit/protocol-swap2-jupiter
[Section titled “@anywalletkit/protocol-swap2-jupiter”](#anywalletkitprotocol-swap2-jupiter)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-jupiter)
[Jupiter](https://developers.jup.ag/docs/swap) same-chain Solana swaps as a swap2 provider. It uses Swap API V2’s **Router** path (`GET /swap/v2/build`): Metis on-chain routing, raw instructions, and no Jupiter swap fee. Quotes work without an API key at 0.5 requests per second. Pass `apiKey` for your plan’s limit; the key is per organisation, so ship it on a server, not inside an app.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-jupiter @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-jupiter @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-jupiter @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-jupiter](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-jupiter), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import {jupiterProvider} from "@anywalletkit/protocol-swap2-jupiter/provider";
import {RouterSwap2Protocol} from "@anywalletkit/protocol-swap2-router/swap2/router";
const swap2 = new RouterSwap2Protocol(solanaAccount, {
fromChain: "solana:mainnet",
providers: [jupiterProvider({rpcUrls: ["https://your-solana-rpc"]})],
});
const res = await swap2.swap2({fromToken: "SOL", toToken: "USDC", toChain: "solana:mainnet", fromTokenAmount: 100_000_000n, slippageBps: 50});
```
The account must expose swap2’s `sendSerializedTransaction` hook (`@anywalletkit/wallet-solana`’s `sendSerialized` behind it): it simulates the transaction, proves the balance changes against the quote, signs, and broadcasts through its own RPC. Jupiter never lands the transaction.
## What is checked before the quote is handed out
[Section titled “What is checked before the quote is handed out”](#what-is-checked-before-the-quote-is-handed-out)
`/build` returns instructions; the transaction is assembled here, and only after all of the following hold:
* the instructions call only Jupiter v6 (`JUP6Lkb…`) and the plumbing a swap needs: compute budget, System, SPL Token / Token-2022, Associated Token;
* the taker is the only signer, and there is no tip instruction;
* every instruction besides the swap is one of the exact shapes a swap needs: CreateIdempotent of the taker’s own token account (the taker pays), a System transfer of exactly the input into the taker’s wSOL account (SOL source only, once), SyncNative on that account, CloseAccount of it back to the taker, an account initialized for the taker. Any other System / Token / Token-2022 / Associated Token instruction — a transfer elsewhere, a TransferChecked, a second Jupiter call — refuses the quote;
* the swap instruction is `route_v2` or `shared_accounts_route_v2` (ExactIn), and its own arguments — the ones the program enforces on-chain — say exactly our input amount, the quoted output in the answer, our slippage, and 0 bps platform fee and positive-slippage share;
* the answer names the mints and the amount we asked for, as a v0 transaction.
The minimum output (`minDestAmount`) is computed from the instruction: `quoted × (10 000 − slippage) / 10 000`, rounded down. A `minAmountOut` above it refuses the quote.
## Compute budget
[Section titled “Compute budget”](#compute-budget)
Jupiter’s compute-budget instructions are replaced by ours:
* **price**: Jupiter’s suggestion, capped by `maxComputeUnitPrice` (default 2 000 000 µlamports/CU);
* **limit**: 1.2× the units a simulation used when `rpcUrls` is set, otherwise 1 400 000. A failing simulation refuses the quote with the program’s error.
The quoted network fee is 5 000 lamports plus `price × limit`.
## Limits
[Section titled “Limits”](#limits)
* Solana → Solana only, and the recipient must be the signing wallet: Jupiter pays the taker’s own token account.
* If the wallet already holds wrapped SOL, the route unwraps all of it into SOL. wallet-solana’s guard counts the wallet’s own wSOL as its SOL, so this is neutral and never counted as swap output.
* Quotes live 30 seconds: the blockhash in a `/build` answer expires in about a minute.
* Status comes from `getSignatureStatuses` on `rpcUrls`; without them it stays `pending`, and the wallet’s own receipt is the source of truth.
## Config
[Section titled “Config”](#config)
```ts
jupiterProvider({
enabled: true, // default
apiUrl: "https://api.jup.ag/swap/v2", // default
apiKey: undefined, // Developer Platform key → x-api-key
rpcUrls: [], // compute-unit simulation + status
maxComputeUnitPrice: 2_000_000n, // µlamports per CU
computeUnitPricePercentile: undefined,// "medium" | "high" | "veryHigh" | bps
defaultSlippageBps: 50, // when the caller names none
});
```
## Activity
[Section titled “Activity”](#activity)
`describeActivity` recognizes a Solana transaction whose first non-plumbing program is Jupiter v6 and where the wallet both gave and received an asset: “Swapped A → B”, counterparty Jupiter. A route that only reaches Jupiter through another program, or a leg that only sends (a bridge’s pre-swap), is left to other modules. The fixtures are real mainnet swaps.
## Tests
[Section titled “Tests”](#tests)
* `tests/codec.test.ts` and `tests/provider.test.ts` replay recorded `/build` answers (`fixtures/build-2026-10-23.json`), including tampered ones.
* `tests/conformance.test.ts` runs the SDK’s module, activity and behaviour suites.
* `JUPITER_LIVE=1 pnpm test`: a live `/build` answer through wallet-solana’s guard on mainnet for a funded public wallet (simulation only, nothing signed).
## Classes
[Section titled “Classes”](#classes)
* [JupiterSwap2Protocol](/api/anywalletkit/protocol-swap2-jupiter/classes/jupiterswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AssembleInput](/api/anywalletkit/protocol-swap2-jupiter/interfaces/assembleinput/)
* [JupiterInstruction](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterinstruction/)
* [JupiterProviderConfig](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/)
* [JupiterSwap2Config](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswap2config/)
* [JupiterSwapArgs](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswapargs/)
## Variables
[Section titled “Variables”](#variables)
* [ATA_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/ata_program/)
* [COMPUTE_BUDGET_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/compute_budget_program/)
* [jupiter](/api/anywalletkit/protocol-swap2-jupiter/variables/jupiter/)
* [JUPITER_API_DEFAULT](/api/anywalletkit/protocol-swap2-jupiter/variables/jupiter_api_default/)
* [JUPITER_MODULE](/api/anywalletkit/protocol-swap2-jupiter/variables/jupiter_module/)
* [JUPITER_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/jupiter_program/)
* [JUPITER_TX_PROGRAMS](/api/anywalletkit/protocol-swap2-jupiter/variables/jupiter_tx_programs/)
* [ROUTE_V2](/api/anywalletkit/protocol-swap2-jupiter/variables/route_v2/)
* [SHARED_ACCOUNTS_ROUTE_V2](/api/anywalletkit/protocol-swap2-jupiter/variables/shared_accounts_route_v2/)
* [SOLANA_CAIP2](/api/anywalletkit/protocol-swap2-jupiter/variables/solana_caip2/)
* [SOLANA_CHAINS](/api/anywalletkit/protocol-swap2-jupiter/variables/solana_chains/)
* [SYSTEM_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/system_program/)
* [TOKEN_2022_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/token_2022_program/)
* [TOKEN_PROGRAM](/api/anywalletkit/protocol-swap2-jupiter/variables/token_program/)
* [WSOL_MINT](/api/anywalletkit/protocol-swap2-jupiter/variables/wsol_mint/)
## Functions
[Section titled “Functions”](#functions)
* [assembleTransaction](/api/anywalletkit/protocol-swap2-jupiter/functions/assembletransaction/)
* [decodeComputeBudget](/api/anywalletkit/protocol-swap2-jupiter/functions/decodecomputebudget/)
* [decodeSwapArgs](/api/anywalletkit/protocol-swap2-jupiter/functions/decodeswapargs/)
* [describeJupiterActivity](/api/anywalletkit/protocol-swap2-jupiter/functions/describejupiteractivity/)
* [fromBase64](/api/anywalletkit/protocol-swap2-jupiter/functions/frombase64/)
* [jupiterMint](/api/anywalletkit/protocol-swap2-jupiter/functions/jupitermint/)
* [jupiterProvider](/api/anywalletkit/protocol-swap2-jupiter/functions/jupiterprovider/)
* [minOutOf](/api/anywalletkit/protocol-swap2-jupiter/functions/minoutof/)
* [setComputeUnitLimit](/api/anywalletkit/protocol-swap2-jupiter/functions/setcomputeunitlimit/)
* [setComputeUnitPrice](/api/anywalletkit/protocol-swap2-jupiter/functions/setcomputeunitprice/)
* [toBase64](/api/anywalletkit/protocol-swap2-jupiter/functions/tobase64/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [JupiterSwap2Protocol](/api/anywalletkit/protocol-swap2-jupiter/classes/jupiterswap2protocol/)
# JupiterSwap2Protocol
Defined in: protocol-swap2-jupiter/src/protocol.ts:9
Standalone Jupiter swap2: same-chain Solana swaps (Metis routing, /build, no Jupiter fee).
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new JupiterSwap2Protocol**(`account`, `config`): `JupiterSwap2Protocol`
Defined in: protocol-swap2-jupiter/src/protocol.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`JupiterSwap2Config`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`JupiterSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-jupiter/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-jupiter/src/protocol.ts:15
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-jupiter/src/protocol.ts:18
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# assembleTransaction
> **assembleTransaction**(`input`): `string`
Defined in: protocol-swap2-jupiter/src/transaction.ts:41
The unsigned transaction as base64 wire bytes (what `TxRequest.serializedTx` carries).
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
[`AssembleInput`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/assembleinput/)
## Returns
[Section titled “Returns”](#returns)
`string`
# decodeComputeBudget
> **decodeComputeBudget**(`data`): `object`
Defined in: protocol-swap2-jupiter/src/codec.ts:53
ComputeBudget instructions: 2 = SetComputeUnitLimit(u32), 3 = SetComputeUnitPrice(u64 micro-lamports).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`object`
### limit?
[Section titled “limit?”](#limit)
> `optional` **limit?**: `number`
### price?
[Section titled “price?”](#price)
> `optional` **price?**: `bigint`
# decodeSwapArgs
> **decodeSwapArgs**(`data`): [`JupiterSwapArgs`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswapargs/)
Defined in: protocol-swap2-jupiter/src/codec.ts:32
Decode the swap instruction’s fixed arguments; throws for any other instruction (ExactOut, legacy v1 routes…).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`JupiterSwapArgs`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswapargs/)
# describeJupiterActivity
> **describeJupiterActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-jupiter/src/activity.ts:14
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# fromBase64
> **fromBase64**(`s`): `Uint8Array`
Defined in: protocol-swap2-jupiter/src/codec.ts:28
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# jupiterMint
> **jupiterMint**(`token`): `string` | `null`
Defined in: protocol-swap2-jupiter/src/config.ts:32
A swap2 token ref on Solana (catalog symbol, mint, or a native marker) → the mint Jupiter quotes; null when unknown.
## Parameters
[Section titled “Parameters”](#parameters)
### token
[Section titled “token”](#token)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# jupiterProvider
> **jupiterProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-jupiter/src/provider.ts:76
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# minOutOf
> **minOutOf**(`quotedOut`, `slippageBps`): `bigint`
Defined in: protocol-swap2-jupiter/src/codec.ts:48
The worst output the program accepts: quoted · (10 000 − slippage) / 10 000, rounded down (never above the on-chain check).
## Parameters
[Section titled “Parameters”](#parameters)
### quotedOut
[Section titled “quotedOut”](#quotedout)
`bigint`
### slippageBps
[Section titled “slippageBps”](#slippagebps)
`number`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# setComputeUnitLimit
> **setComputeUnitLimit**(`units`): `Uint8Array`
Defined in: protocol-swap2-jupiter/src/codec.ts:59
## Parameters
[Section titled “Parameters”](#parameters)
### units
[Section titled “units”](#units)
`number`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# setComputeUnitPrice
> **setComputeUnitPrice**(`microLamports`): `Uint8Array`
Defined in: protocol-swap2-jupiter/src/codec.ts:66
## Parameters
[Section titled “Parameters”](#parameters)
### microLamports
[Section titled “microLamports”](#microlamports)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# toBase64
> **toBase64**(`b`): `string`
Defined in: protocol-swap2-jupiter/src/codec.ts:29
## Parameters
[Section titled “Parameters”](#parameters)
### b
[Section titled “b”](#b)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# AssembleInput
Defined in: protocol-swap2-jupiter/src/transaction.ts:20
## Properties
[Section titled “Properties”](#properties)
### addressesByLookupTableAddress
[Section titled “addressesByLookupTableAddress”](#addressesbylookuptableaddress)
> **addressesByLookupTableAddress**: `Record`<`string`, `string`\[]> | `null` | `undefined`
Defined in: protocol-swap2-jupiter/src/transaction.ts:28
***
### blockhash
[Section titled “blockhash”](#blockhash)
> **blockhash**: `string` | `Uint8Array`<`ArrayBufferLike`>
Defined in: protocol-swap2-jupiter/src/transaction.ts:26
***
### computeUnitLimit
[Section titled “computeUnitLimit”](#computeunitlimit)
> **computeUnitLimit**: `number`
Defined in: protocol-swap2-jupiter/src/transaction.ts:24
***
### computeUnitPrice
[Section titled “computeUnitPrice”](#computeunitprice)
> **computeUnitPrice**: `bigint`
Defined in: protocol-swap2-jupiter/src/transaction.ts:25
***
### instructions
[Section titled “instructions”](#instructions)
> **instructions**: [`JupiterInstruction`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterinstruction/)\[]
Defined in: protocol-swap2-jupiter/src/transaction.ts:23
setup → swap → cleanup → other, in that order; compute-budget instructions are ours and come first.
***
### lastValidBlockHeight
[Section titled “lastValidBlockHeight”](#lastvalidblockheight)
> **lastValidBlockHeight**: `number` | `bigint`
Defined in: protocol-swap2-jupiter/src/transaction.ts:27
***
### taker
[Section titled “taker”](#taker)
> **taker**: `string`
Defined in: protocol-swap2-jupiter/src/transaction.ts:21
# JupiterInstruction
Defined in: protocol-swap2-jupiter/src/transaction.ts:14
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `object`\[]
Defined in: protocol-swap2-jupiter/src/transaction.ts:16
#### isSigner
[Section titled “isSigner”](#issigner)
> **isSigner**: `boolean`
#### isWritable
[Section titled “isWritable”](#iswritable)
> **isWritable**: `boolean`
#### pubkey
[Section titled “pubkey”](#pubkey)
> **pubkey**: `string`
***
### data
[Section titled “data”](#data)
> **data**: `string`
Defined in: protocol-swap2-jupiter/src/transaction.ts:17
***
### programId
[Section titled “programId”](#programid)
> **programId**: `string`
Defined in: protocol-swap2-jupiter/src/transaction.ts:15
# JupiterProviderConfig
Defined in: protocol-swap2-jupiter/src/provider.ts:36
## Extended by
[Section titled “Extended by”](#extended-by)
* [`JupiterSwap2Config`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:41
Jupiter Developer Platform key, sent as `x-api-key`. Keyless works at 0.5 RPS.
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:39
Swap API base (default ).
***
### computeUnitPricePercentile?
[Section titled “computeUnitPricePercentile?”](#computeunitpricepercentile)
> `optional` **computeUnitPricePercentile?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:47
Passed to /build: “medium” | “high” | “veryHigh” or a percentile in bps (default: Jupiter’s 50th percentile).
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-jupiter/src/provider.ts:49
Slippage when the caller names none, bps (default 50).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-jupiter/src/provider.ts:37
***
### maxComputeUnitPrice?
[Section titled “maxComputeUnitPrice?”](#maxcomputeunitprice)
> `optional` **maxComputeUnitPrice?**: `bigint`
Defined in: protocol-swap2-jupiter/src/provider.ts:45
Ceiling on the compute-unit price Jupiter suggests, micro-lamports (default 2 000 000).
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: readonly `string`\[]
Defined in: protocol-swap2-jupiter/src/provider.ts:43
Solana JSON-RPC endpoints: compute-unit simulation and status. Without them the limit is 1.4 M CU and status stays pending.
# JupiterSwap2Config
Defined in: protocol-swap2-jupiter/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:41
Jupiter Developer Platform key, sent as `x-api-key`. Keyless works at 0.5 RPS.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`apiKey`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#apikey)
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:39
Swap API base (default ).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#apiurl)
***
### computeUnitPricePercentile?
[Section titled “computeUnitPricePercentile?”](#computeunitpricepercentile)
> `optional` **computeUnitPricePercentile?**: `string`
Defined in: protocol-swap2-jupiter/src/provider.ts:47
Passed to /build: “medium” | “high” | “veryHigh” or a percentile in bps (default: Jupiter’s 50th percentile).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`computeUnitPricePercentile`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#computeunitpricepercentile)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.decodeTonBody`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-jupiter/src/provider.ts:49
Slippage when the caller names none, bps (default 50).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`defaultSlippageBps`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#defaultslippagebps)
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-jupiter/src/provider.ts:37
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.fromChain`
***
### maxComputeUnitPrice?
[Section titled “maxComputeUnitPrice?”](#maxcomputeunitprice)
> `optional` **maxComputeUnitPrice?**: `bigint`
Defined in: protocol-swap2-jupiter/src/provider.ts:45
Ceiling on the compute-unit price Jupiter suggests, micro-lamports (default 2 000 000).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`maxComputeUnitPrice`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#maxcomputeunitprice)
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.onExecutionPhase`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: readonly `string`\[]
Defined in: protocol-swap2-jupiter/src/provider.ts:43
Solana JSON-RPC endpoints: compute-unit simulation and status. Without them the limit is 1.4 M CU and status stays pending.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`JupiterProviderConfig`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-jupiter/interfaces/jupiterproviderconfig/#rpcurls)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.tonGasCeiling`
# JupiterSwapArgs
Defined in: protocol-swap2-jupiter/src/codec.ts:15
## Properties
[Section titled “Properties”](#properties)
### inAmount
[Section titled “inAmount”](#inamount)
> **inAmount**: `bigint`
Defined in: protocol-swap2-jupiter/src/codec.ts:17
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"route_v2"` | `"shared_accounts_route_v2"`
Defined in: protocol-swap2-jupiter/src/codec.ts:16
***
### platformFeeBps
[Section titled “platformFeeBps”](#platformfeebps)
> **platformFeeBps**: `number`
Defined in: protocol-swap2-jupiter/src/codec.ts:20
***
### positiveSlippageBps
[Section titled “positiveSlippageBps”](#positiveslippagebps)
> **positiveSlippageBps**: `number`
Defined in: protocol-swap2-jupiter/src/codec.ts:21
***
### quotedOutAmount
[Section titled “quotedOutAmount”](#quotedoutamount)
> **quotedOutAmount**: `bigint`
Defined in: protocol-swap2-jupiter/src/codec.ts:18
***
### slippageBps
[Section titled “slippageBps”](#slippagebps)
> **slippageBps**: `number`
Defined in: protocol-swap2-jupiter/src/codec.ts:19
# ATA_PROGRAM
> `const` **ATA_PROGRAM**: `"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"` = `"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"`
Defined in: protocol-swap2-jupiter/src/config.ts:17
# COMPUTE_BUDGET_PROGRAM
> `const` **COMPUTE_BUDGET_PROGRAM**: `"ComputeBudget111111111111111111111111111111"` = `"ComputeBudget111111111111111111111111111111"`
Defined in: protocol-swap2-jupiter/src/config.ts:13
# jupiter
> `const` **jupiter**: `object`
Defined in: protocol-swap2-jupiter/src/config.ts:41
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### supports
[Section titled “supports”](#supports)
> **supports**: (`from`, `to`) => `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### supportsChain
[Section titled “supportsChain”](#supportschain)
> **supportsChain**: (`chain`) => `chain is "solana:mainnet"`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`chain is "solana:mainnet"`
# JUPITER_API_DEFAULT
> `const` **JUPITER_API_DEFAULT**: `"https://api.jup.ag/swap/v2"` = `"https://api.jup.ag/swap/v2"`
Defined in: protocol-swap2-jupiter/src/config.ts:9
# JUPITER_MODULE
> `const` **JUPITER_MODULE**: `"@anywalletkit/protocol-swap2-jupiter"` = `"@anywalletkit/protocol-swap2-jupiter"`
Defined in: protocol-swap2-jupiter/src/activity.ts:12
# JUPITER_PROGRAM
> `const` **JUPITER_PROGRAM**: `"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"` = `"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"`
Defined in: protocol-swap2-jupiter/src/config.ts:12
Jupiter Aggregator v6 — the only program a swap instruction may target.
# JUPITER_TX_PROGRAMS
> `const` **JUPITER_TX_PROGRAMS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-jupiter/src/config.ts:22
Programs the /build instructions may invoke; anything else refuses the quote before the wallet sees it.
# ROUTE_V2
> `const` **ROUTE_V2**: `"bb64facc31c4af14"` = `"bb64facc31c4af14"`
Defined in: protocol-swap2-jupiter/src/codec.ts:11
`route_v2(in_amount u64, quoted_out_amount u64, slippage_bps u16, platform_fee_bps u16, positive_slippage_bps u16, route_plan Vec)`
# SHARED_ACCOUNTS_ROUTE_V2
> `const` **SHARED_ACCOUNTS_ROUTE_V2**: `"d19853937cfed8e9"` = `"d19853937cfed8e9"`
Defined in: protocol-swap2-jupiter/src/codec.ts:13
`shared_accounts_route_v2(id u8, …the same arguments…)`
# SOLANA_CAIP2
> `const` **SOLANA_CAIP2**: `"solana:mainnet"` = `"solana:mainnet"`
Defined in: protocol-swap2-jupiter/src/config.ts:25
swap2 names Solana `solana:mainnet`; wallet history uses the genesis-hash form.
# SOLANA_CHAINS
> `const` **SOLANA_CHAINS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-jupiter/src/config.ts:26
# SYSTEM_PROGRAM
> `const` **SYSTEM_PROGRAM**: `"11111111111111111111111111111111"` = `"11111111111111111111111111111111"`
Defined in: protocol-swap2-jupiter/src/config.ts:14
# TOKEN_2022_PROGRAM
> `const` **TOKEN_2022_PROGRAM**: `"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"` = `"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"`
Defined in: protocol-swap2-jupiter/src/config.ts:16
# TOKEN_PROGRAM
> `const` **TOKEN_PROGRAM**: `"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"` = `"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"`
Defined in: protocol-swap2-jupiter/src/config.ts:15
# WSOL_MINT
> `const` **WSOL_MINT**: `"So11111111111111111111111111111111111111112"` = `"So11111111111111111111111111111111111111112"`
Defined in: protocol-swap2-jupiter/src/config.ts:19
Wrapped SOL: Jupiter’s name for native SOL (it wraps / unwraps around the swap).
# @anywalletkit/protocol-swap2-lifi
# @anywalletkit/protocol-swap2-lifi
[Section titled “@anywalletkit/protocol-swap2-lifi”](#anywalletkitprotocol-swap2-lifi)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-lifi)
LI.FI REST cross-chain swaps and bridges as a swap2 module: EVM calldata routes through the LI.FI Diamond (Solana legs via guarded serialized transactions). Standalone through `LifiSwap2Protocol`, or as one provider of `@anywalletkit/protocol-swap2-router`.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-lifi @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-lifi @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-lifi @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-lifi](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-lifi), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## What is checked before a quote is used
[Section titled “What is checked before a quote is used”](#what-is-checked-before-a-quote-is-used)
The quote’s `action` must match the request (chains, tokens, amount, sender, recipient), the transaction must target the chain’s LI.FI Diamond, and the Diamond **calldata** is decoded and must do the same: a same-chain swap (GenericSwapFacet / V3) pays the reviewed recipient at least the reviewed minimum, spending the input token and delivering the requested one; a bridge call must be one of LI.FI’s listed `startBridgeTokensVia*` / `swapAndStartBridgeTokensVia*` entry points (packed calls are refused) and its `BridgeData` must name the reviewed recipient and chain and bridge the input token (or what its source swaps make of it). Refused, because the recipient cannot be read from the calldata: routes with a destination call, and EVM-source routes to a non-EVM chain. Unknown calldata is refused.
Every swap step is read, not only the ends: each must spend what the step before delivered, only steps that spend the input token may pull from the wallet (`requiresDeposit`), and together at most the input — a middle step pulling DAI under an old allowance is refused. The V3 entry points are bound to the asset kinds they move (`*ToNative` only for a native output, `*ToERC20` for a token, `NativeTo*` / `ERC20To*` for the matching input), since each counts its minimum in its own asset. A bridge without source swaps must bridge the input, less at most a 1 % bridge fee. `apiUrl` must be `https:` (`allowInsecureApiUrl` for local development).
Not checked: a bridge’s output. The destination minimum — and for some bridges (Relay, Across) what finally reaches the recipient — sits in bridge-specific data, so on cross-chain routes the reviewed minimum relies on LI.FI’s API (or your `apiUrl` proxy) answering honestly.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "lifi", baseUrl, ...lifiPins})`. The engine then lets the EVM route call and approve only the LI.FI Diamond of that chain, never an address the backend names, and `lifiVerifyQuote` decodes the server’s Diamond call on the device with the same check the provider runs on LI.FI’s answer (receiver, minimum, input token and amount, output token, destination chain; value and approval for the input kind). Without the pins the stub gets no EVM calldata route (fail closed).
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` recognizes any call into the LI.FI Diamond on an EVM chain this module routes — the documented Diamond per chain (`provider.ts`, `LIFI_DIAMONDS`) plus any `trustedTransactionTargets` you configured:
* GenericSwapFacetV3 selectors (`swapTokensSingleV3…` / `swapTokensMultipleV3…`, listed in `src/activity.ts`) → `swap`, “Swapped A → B” from the owner’s net transfers (native legs included, e.g. “Swapped USDT → ETH”).
* Every other facet (`swapAndStartBridgeTokensVia…`, `startBridgeTokensVia…`) is the source leg of a bridge → `bridge`, “Bridged A”. An inbound dust rebate in the same transaction (a Mayan WETH refund) does not turn it into a swap.
* Subtitle “LI.FI”, counterparty = the Diamond. The destination leg is paid on another chain by a third-party relayer and cannot be tied back offline, so `related` stays empty — the kit’s intent journal links the two legs.
Not recognized: Solana legs (no program-level marker in the normalized tx yet), and the destination side of a bridge (an ordinary transfer from a relayer).
Fixtures (`fixtures/activity/`, test wallet `0x8AbE…55bA` on Ethereum): two same-chain swaps (USDT → USDC, USDT → ETH), three bridge source legs (RelayDepository, Mayan with rebate, NEARIntents facet); negatives: a THORChain `depositWithExpiry`, a WETH9 `deposit()`.
## Classes
[Section titled “Classes”](#classes)
* [LifiSwap2Protocol](/api/anywalletkit/protocol-swap2-lifi/classes/lifiswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [LifiProviderConfig](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/)
* [LifiRouteChoice](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiroutechoice/)
* [LifiRouteOption](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifirouteoption/)
* [LifiSwap2Config](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [lifi](/api/anywalletkit/protocol-swap2-lifi/variables/lifi/)
* [LIFI_MODULE](/api/anywalletkit/protocol-swap2-lifi/variables/lifi_module/)
* [LIFI_SAME_CHAIN_SELECTORS](/api/anywalletkit/protocol-swap2-lifi/variables/lifi_same_chain_selectors/)
* [LIFI_SOLANA_CAIP2](/api/anywalletkit/protocol-swap2-lifi/variables/lifi_solana_caip2/)
* [lifiPins](/api/anywalletkit/protocol-swap2-lifi/variables/lifipins/)
## Functions
[Section titled “Functions”](#functions)
* [describeLifiActivity](/api/anywalletkit/protocol-swap2-lifi/functions/describelifiactivity/)
* [lifiProvider](/api/anywalletkit/protocol-swap2-lifi/functions/lifiprovider/)
* [lifiVerifyQuote](/api/anywalletkit/protocol-swap2-lifi/functions/lifiverifyquote/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [LifiSwap2Protocol](/api/anywalletkit/protocol-swap2-lifi/classes/lifiswap2protocol/)
# LifiSwap2Protocol
Defined in: protocol-swap2-lifi/src/protocol.ts:8
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new LifiSwap2Protocol**(`account`, `config`): `LifiSwap2Protocol`
Defined in: protocol-swap2-lifi/src/protocol.ts:10
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`LifiSwap2Config`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`LifiSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-lifi/src/protocol.ts:9
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-lifi/src/protocol.ts:14
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-lifi/src/protocol.ts:17
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeLifiActivity
> **describeLifiActivity**(`tx`, `ctx`, `isDiamond`): `ActivityItem` | `null`
Defined in: protocol-swap2-lifi/src/activity.ts:29
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### isDiamond
[Section titled “isDiamond”](#isdiamond)
(`chain`, `address`) => `boolean`
the provider’s trust check: the documented Diamond for the chain plus any `trustedTransactionTargets` the caller configured.
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# lifiProvider
> **lifiProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-lifi/src/provider.ts:263
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# lifiVerifyQuote
> **lifiVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-lifi/src/provider.ts:666
A remote LI.FI quote’s Diamond call, decoded on the device against the app’s own request (scan 2026-10-30, F3) — the same diamondCallMismatch the provider runs on LI.FI’s answer, with the expectation it builds: the input token and amount, the requested output token, the recipient, the quoted minimum (at least the caller’s floor), the destination chain. A native input is paid in value (any excess is the declared bridge fee); a token input attaches only that declared fee and approves the Diamond. A Solana source carries a serialized transaction instead, which the account proves before signing: not judged here. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# LifiProviderConfig
Defined in: protocol-swap2-lifi/src/provider.ts:171
Explicit constructor configuration; no deployment environment is read.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`LifiSwap2Config`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiswap2config/)
## Properties
[Section titled “Properties”](#properties)
### allowInsecureApiUrl?
[Section titled “allowInsecureApiUrl?”](#allowinsecureapiurl)
> `optional` **allowInsecureApiUrl?**: `boolean`
Defined in: protocol-swap2-lifi/src/provider.ts:179
Allow an `http:` `apiUrl` (local development only): the quotes and the Diamond calldata travel it, and over plain http anyone on the path rewrites them (scan 2026-10-27 modules, F20).
***
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:180
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:174
LI.FI REST base URL. Explicitly injectable for proxies and tests; must be https unless `allowInsecureApiUrl`.
***
### chooseRoute?
[Section titled “chooseRoute?”](#chooseroute)
> `optional` **chooseRoute?**: (`routes`, `params`) => [`LifiRouteChoice`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiroutechoice/) | `null` | `undefined`
Defined in: protocol-swap2-lifi/src/provider.ts:204
Route policy hook. When set, a cross-chain quote first asks LI.FI’s `/advanced/routes` for the candidates, hands them to this function and restricts `/quote` to what it returns (allowBridges / denyBridges / order). Returning null/undefined, or any failure of the routes call, leaves LI.FI’s default pick. The policy itself (tie band, max ETA, deny list) belongs to the app; the module only carries the choice.
#### Parameters
[Section titled “Parameters”](#parameters)
##### routes
[Section titled “routes”](#routes)
readonly [`LifiRouteOption`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifirouteoption/)\[]
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns)
[`LifiRouteChoice`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiroutechoice/) | `null` | `undefined`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:195
Slippage sent when the caller names none (bps, default 50 = LI.FI’s own documented default). Left unset, LI.FI picks it per request and it swings (0.9%–6% within a minute on Base ETH → Robinhood, 2026-10-12): the display quote’s minimum then sits above the live one and the execution floor refuses a route that hasn’t moved.
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-lifi/src/provider.ts:172
***
### integrator?
[Section titled “integrator?”](#integrator)
> `optional` **integrator?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:181
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:187
Fail-closed local lifetime for the provider’s documented \~60s quote window.
***
### trustedApprovalAddresses?
[Section titled “trustedApprovalAddresses?”](#trustedapprovaladdresses)
> `optional` **trustedApprovalAddresses?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-lifi/src/provider.ts:185
Additional audited ERC-20 spenders returned by LI.FI for direct routes.
***
### trustedTransactionTargets?
[Section titled “trustedTransactionTargets?”](#trustedtransactiontargets)
> `optional` **trustedTransactionTargets?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-lifi/src/provider.ts:183
Additional audited LI.FI entry points for networks whose Diamond differs.
# LifiRouteChoice
Defined in: protocol-swap2-lifi/src/provider.ts:221
What `/quote` is restricted to. LI.FI tool keys; an empty choice means LI.FI’s default.
## Properties
[Section titled “Properties”](#properties)
### allowBridges?
[Section titled “allowBridges?”](#allowbridges)
> `optional` **allowBridges?**: readonly `string`\[]
Defined in: protocol-swap2-lifi/src/provider.ts:222
***
### denyBridges?
[Section titled “denyBridges?”](#denybridges)
> `optional` **denyBridges?**: readonly `string`\[]
Defined in: protocol-swap2-lifi/src/provider.ts:223
***
### order?
[Section titled “order?”](#order)
> `optional` **order?**: `"CHEAPEST"` | `"FASTEST"`
Defined in: protocol-swap2-lifi/src/provider.ts:224
# LifiRouteOption
Defined in: protocol-swap2-lifi/src/provider.ts:208
One single-transaction candidate from `/advanced/routes`, as a route policy sees it.
## Properties
[Section titled “Properties”](#properties)
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:214
LI.FI’s execution-duration estimate, seconds.
***
### gasCostUsd
[Section titled “gasCostUsd”](#gascostusd)
> **gasCostUsd**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:215
***
### tags
[Section titled “tags”](#tags)
> **tags**: readonly `string`\[]
Defined in: protocol-swap2-lifi/src/provider.ts:217
LI.FI’s own labels: RECOMMENDED, CHEAPEST, FASTEST, …
***
### toAmount
[Section titled “toAmount”](#toamount)
> **toAmount**: `bigint`
Defined in: protocol-swap2-lifi/src/provider.ts:211
***
### toAmountMin
[Section titled “toAmountMin”](#toamountmin)
> **toAmountMin**: `bigint`
Defined in: protocol-swap2-lifi/src/provider.ts:212
***
### tool
[Section titled “tool”](#tool)
> **tool**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:210
LI.FI tool key of the bridge the route crosses with (e.g. “stargateV2”); a same-chain route carries its swap tool.
# LifiSwap2Config
Defined in: protocol-swap2-lifi/src/protocol.ts:6
Explicit constructor configuration; no deployment environment is read.
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowInsecureApiUrl?
[Section titled “allowInsecureApiUrl?”](#allowinsecureapiurl)
> `optional` **allowInsecureApiUrl?**: `boolean`
Defined in: protocol-swap2-lifi/src/provider.ts:179
Allow an `http:` `apiUrl` (local development only): the quotes and the Diamond calldata travel it, and over plain http anyone on the path rewrites them (scan 2026-10-27 modules, F20).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`allowInsecureApiUrl`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#allowinsecureapiurl)
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:180
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`apiKey`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#apikey)
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:174
LI.FI REST base URL. Explicitly injectable for proxies and tests; must be https unless `allowInsecureApiUrl`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#apiurl)
***
### chooseRoute?
[Section titled “chooseRoute?”](#chooseroute)
> `optional` **chooseRoute?**: (`routes`, `params`) => [`LifiRouteChoice`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiroutechoice/) | `null` | `undefined`
Defined in: protocol-swap2-lifi/src/provider.ts:204
Route policy hook. When set, a cross-chain quote first asks LI.FI’s `/advanced/routes` for the candidates, hands them to this function and restricts `/quote` to what it returns (allowBridges / denyBridges / order). Returning null/undefined, or any failure of the routes call, leaves LI.FI’s default pick. The policy itself (tie band, max ETA, deny list) belongs to the app; the module only carries the choice.
#### Parameters
[Section titled “Parameters”](#parameters)
##### routes
[Section titled “routes”](#routes)
readonly [`LifiRouteOption`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifirouteoption/)\[]
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns)
[`LifiRouteChoice`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiroutechoice/) | `null` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`chooseRoute`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#chooseroute)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`Swap2EngineConfig.decodeTonBody`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:195
Slippage sent when the caller names none (bps, default 50 = LI.FI’s own documented default). Left unset, LI.FI picks it per request and it swings (0.9%–6% within a minute on Base ETH → Robinhood, 2026-10-12): the display quote’s minimum then sits above the live one and the execution floor refuses a route that hasn’t moved.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`defaultSlippageBps`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#defaultslippagebps)
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-lifi/src/provider.ts:172
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.fromChain`
***
### integrator?
[Section titled “integrator?”](#integrator)
> `optional` **integrator?**: `string`
Defined in: protocol-swap2-lifi/src/provider.ts:181
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`integrator`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#integrator)
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-lifi/src/provider.ts:187
Fail-closed local lifetime for the provider’s documented \~60s quote window.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-3)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.reviewExecution`
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`Swap2EngineConfig.tonGasCeiling`
***
### trustedApprovalAddresses?
[Section titled “trustedApprovalAddresses?”](#trustedapprovaladdresses)
> `optional` **trustedApprovalAddresses?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-lifi/src/provider.ts:185
Additional audited ERC-20 spenders returned by LI.FI for direct routes.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`trustedApprovalAddresses`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#trustedapprovaladdresses)
***
### trustedTransactionTargets?
[Section titled “trustedTransactionTargets?”](#trustedtransactiontargets)
> `optional` **trustedTransactionTargets?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-lifi/src/provider.ts:183
Additional audited LI.FI entry points for networks whose Diamond differs.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`LifiProviderConfig`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/).[`trustedTransactionTargets`](/api/anywalletkit/protocol-swap2-lifi/interfaces/lifiproviderconfig/#trustedtransactiontargets)
# lifi
> `const` **lifi**: `object`
Defined in: protocol-swap2-lifi/src/config.ts:10
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### apiKey
[Section titled “apiKey”](#apikey)
> **apiKey**: () => `undefined`
#### Returns
[Section titled “Returns”](#returns)
`undefined`
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: () => `boolean`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean`
### integrator
[Section titled “integrator”](#integrator)
> **integrator**: () => `string`
#### Returns
[Section titled “Returns”](#returns-2)
`string`
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`boolean`
# LIFI_MODULE
> `const` **LIFI_MODULE**: `"@anywalletkit/protocol-swap2-lifi"` = `"@anywalletkit/protocol-swap2-lifi"`
Defined in: protocol-swap2-lifi/src/activity.ts:13
# LIFI_SAME_CHAIN_SELECTORS
> `const` **LIFI_SAME_CHAIN_SELECTORS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-lifi/src/activity.ts:16
GenericSwapFacetV3 — same-chain swaps (`viem toFunctionSelector`, 2026-10-14).
# LIFI_SOLANA_CAIP2
> `const` **LIFI_SOLANA_CAIP2**: `"solana:mainnet"` = `"solana:mainnet"`
Defined in: protocol-swap2-lifi/src/config.ts:8
The catalog’s Solana id; LI.FI numbers it 1151111081099710.
# lifiPins
> `const` **lifiPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-lifi/src/provider.ts:717
The LI.FI Diamond an EVM route calls and approves on a chain (the canonical one, or the chain’s own where it differs), and [lifiVerifyQuote](/api/anywalletkit/protocol-swap2-lifi/functions/lifiverifyquote/) — the app’s pins for `remoteProvider({name: "lifi", baseUrl, ...lifiPins})` (scan 2026-10-27 modules, F8/F16; the Diamond call itself since scan 2026-10-30, F3). Extra audited targets an app configures on the provider (`trustedTransactionTargets` / `trustedApprovalAddresses`) are added on the app side too.
# @anywalletkit/protocol-swap2-near-intents
# @anywalletkit/protocol-swap2-near-intents
[Section titled “@anywalletkit/protocol-swap2-near-intents”](#anywalletkitprotocol-swap2-near-intents)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-near-intents)
NEAR Intents (1Click) cross-chain swaps as a swap2 module: the wallet sends the source asset to a one-time deposit address, the solver network settles on NEAR and delivers on the destination chain. Standalone through `NearIntentsSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-near-intents @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-near-intents @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-near-intents @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-near-intents](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-near-intents), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "near_intents", baseUrl, ...nearIntentsPins})`. Every 1Click route pays a deposit address minted per quote, which nothing can pin ahead: `nearIntentsPins` call no contract, approve no spender, and open the stub to deposit-address routes (`depositAddressRoutes`). Without it the engine refuses them. The deposit address is your server’s word, so run the server you trust.
## Activity
[Section titled “Activity”](#activity)
Most 1Click legs leave no stable on-chain marker: the source leg is a plain transfer to a deposit address that exists for one swap, and the destination leg is a plain transfer from a solver / bridge account that changes per swap (on Ethereum the wallet’s arrivals came from Relay’s router or solver EOAs; on TON from fresh addresses). `describeActivity(tx, ctx)` therefore returns null for EVM / TON / Solana / Tron / BTC — the kit’s intent journal (the `intentId` returned by `swap2()`) ties those transfers back to the swap, and the generic fallback shows them as send / receive.
What it does recognize is the NEAR side, where the settlement contract is fixed: a NEP-141 transfer between the owner and `intents.near` →
* owner → `intents.near` (`ft_transfer_call` deposit): `bridge`, “Bridged wNEAR”;
* `intents.near` → owner (`execute_intents` / `ft_withdraw`): `bridge`, “Received JAMBO via NEAR Intents”.
Subtitle “NEAR Intents”, counterparty `intents.near`.
Fixtures (`fixtures/activity/`): two public NEAR transactions from nearblocks (a 20.5 wNEAR deposit through the `bridge-mng.near` relayer, a 231 JAMBO withdrawal — the test wallet has no NEAR account); negatives: the LI.FI Diamond’s NEARIntents facet on Ethereum (LI.FI’s transaction, not this module’s) and the test wallet’s own 13.9 USD₮ 1Click deposit on TON, which must stay unrecognized.
## Classes
[Section titled “Classes”](#classes)
* [NearIntentsSwap2Protocol](/api/anywalletkit/protocol-swap2-near-intents/classes/nearintentsswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [NearIntentsProviderConfig](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/)
* [NearIntentsSwap2Config](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsswap2config/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [NearIntentsSuspendedChains](/api/anywalletkit/protocol-swap2-near-intents/type-aliases/nearintentssuspendedchains/)
## Variables
[Section titled “Variables”](#variables)
* [NEAR_INTENTS_CONTRACT](/api/anywalletkit/protocol-swap2-near-intents/variables/near_intents_contract/)
* [NEAR_INTENTS_MODULE](/api/anywalletkit/protocol-swap2-near-intents/variables/near_intents_module/)
* [nearIntents](/api/anywalletkit/protocol-swap2-near-intents/variables/nearintents/)
* [nearIntentsPins](/api/anywalletkit/protocol-swap2-near-intents/variables/nearintentspins/)
## Functions
[Section titled “Functions”](#functions)
* [describeNearIntentsActivity](/api/anywalletkit/protocol-swap2-near-intents/functions/describenearintentsactivity/)
* [nearIntentsChainRefusal](/api/anywalletkit/protocol-swap2-near-intents/functions/nearintentschainrefusal/)
* [nearIntentsProvider](/api/anywalletkit/protocol-swap2-near-intents/functions/nearintentsprovider/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [NearIntentsSwap2Protocol](/api/anywalletkit/protocol-swap2-near-intents/classes/nearintentsswap2protocol/)
# NearIntentsSwap2Protocol
Defined in: protocol-swap2-near-intents/src/protocol.ts:8
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NearIntentsSwap2Protocol**(`account`, `config`): `NearIntentsSwap2Protocol`
Defined in: protocol-swap2-near-intents/src/protocol.ts:10
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`NearIntentsSwap2Config`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`NearIntentsSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-near-intents/src/protocol.ts:9
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-near-intents/src/protocol.ts:14
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-near-intents/src/protocol.ts:17
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeNearIntentsActivity
> **describeNearIntentsActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-near-intents/src/activity.ts:21
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# nearIntentsChainRefusal
> **nearIntentsChainRefusal**(`chain`, `suspended?`): `string` | `null`
Defined in: protocol-swap2-near-intents/src/config.ts:20
Why a chain is refused up front, or null when 1Click can serve it.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### suspended?
[Section titled “suspended?”](#suspended)
[`NearIntentsSuspendedChains`](/api/anywalletkit/protocol-swap2-near-intents/type-aliases/nearintentssuspendedchains/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# nearIntentsProvider
> **nearIntentsProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-near-intents/src/provider.ts:129
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# NearIntentsProviderConfig
Defined in: protocol-swap2-near-intents/src/provider.ts:119
Explicit constructor configuration; no deployment environment is read.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NearIntentsSwap2Config`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:121
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-near-intents/src/provider.ts:120
***
### feeBps?
[Section titled “feeBps?”](#feebps)
> `optional` **feeBps?**: `number`
Defined in: protocol-swap2-near-intents/src/provider.ts:124
***
### feeRecipient?
[Section titled “feeRecipient?”](#feerecipient)
> `optional` **feeRecipient?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:123
***
### jwt?
[Section titled “jwt?”](#jwt)
> `optional` **jwt?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:122
***
### suspendedChains?
[Section titled “suspendedChains?”](#suspendedchains)
> `optional` **suspendedChains?**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-near-intents/src/provider.ts:126
Corridors the app has paused (caip2 → reason): refused up front, by name, until the app lifts them.
# NearIntentsSwap2Config
Defined in: protocol-swap2-near-intents/src/protocol.ts:6
Explicit constructor configuration; no deployment environment is read.
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:121
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`apiUrl`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#apiurl)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-near-intents/src/provider.ts:120
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#enabled)
***
### feeBps?
[Section titled “feeBps?”](#feebps)
> `optional` **feeBps?**: `number`
Defined in: protocol-swap2-near-intents/src/provider.ts:124
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`feeBps`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#feebps)
***
### feeRecipient?
[Section titled “feeRecipient?”](#feerecipient)
> `optional` **feeRecipient?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:123
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`feeRecipient`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#feerecipient)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.fromChain`
***
### jwt?
[Section titled “jwt?”](#jwt)
> `optional` **jwt?**: `string`
Defined in: protocol-swap2-near-intents/src/provider.ts:122
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`jwt`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#jwt)
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.onExecutionPhase`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.reviewExecution`
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.skipAccountChainCheck`
***
### suspendedChains?
[Section titled “suspendedChains?”](#suspendedchains)
> `optional` **suspendedChains?**: `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-near-intents/src/provider.ts:126
Corridors the app has paused (caip2 → reason): refused up front, by name, until the app lifts them.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`NearIntentsProviderConfig`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/).[`suspendedChains`](/api/anywalletkit/protocol-swap2-near-intents/interfaces/nearintentsproviderconfig/#suspendedchains)
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.tonGasCeiling`
# NearIntentsSuspendedChains
> **NearIntentsSuspendedChains** = `Readonly`<`Record`<`string`, `string`>>
Defined in: protocol-swap2-near-intents/src/config.ts:17
Corridors the APP has paused (caip2 → why), passed in through the provider config: a venue-side degradation (1Click’s HOT omni-bridge assets answering “not available” for days) is an operational switch, not SDK knowledge — the wallet flips an env var and lifts it the same way when the venue recovers.
# NEAR_INTENTS_CONTRACT
> `const` **NEAR_INTENTS_CONTRACT**: `"intents.near"` = `"intents.near"`
Defined in: protocol-swap2-near-intents/src/activity.ts:19
The NEAR Intents verifier / settlement contract.
# NEAR_INTENTS_MODULE
> `const` **NEAR_INTENTS_MODULE**: `"@anywalletkit/protocol-swap2-near-intents"` = `"@anywalletkit/protocol-swap2-near-intents"`
Defined in: protocol-swap2-near-intents/src/activity.ts:16
# nearIntents
> `const` **nearIntents**: `object`
Defined in: protocol-swap2-near-intents/src/config.ts:32
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: () => `boolean`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`boolean`
# nearIntentsPins
> `const` **nearIntentsPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-near-intents/src/config.ts:58
The app’s side of a remote NEAR Intents stub: `remoteProvider({name: "near_intents", baseUrl, ...nearIntentsPins})`. Every 1Click route is a send to a deposit address minted per quote, so nothing can be pinned ahead: the stub calls no contract and approves no spender, and is opened to deposit-address routes (scan 2026-10-28, F9). The deposit address is your backend’s word — run the backend you trust.
# @anywalletkit/protocol-swap2-omniston
# @anywalletkit/protocol-swap2-omniston
[Section titled “@anywalletkit/protocol-swap2-omniston”](#anywalletkitprotocol-swap2-omniston)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-omniston)
STON.fi Omniston as a swap2 module: TON ↔ TON swaps settled on the STON.fi DEX, and TON ↔ EVM and EVM ↔ EVM stable orders settled through HTLC escrows (resolver Arbiter), over the Omniston WebSocket RFQ. Standalone through `OmnistonSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-omniston @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-omniston @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-omniston @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-omniston](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-omniston), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
EVM chains: Ethereum, BNB, Polygon, X Layer, HyperEVM, Robinhood, Base, Plasma, Arbitrum, Avalanche. ARC (in Omniston’s matrix) waits for the asset catalog; TRON needs its own order path and is not wired yet.
## Routes and their gates
[Section titled “Routes and their gates”](#routes-and-their-gates)
Every route is fail-closed until its allowlists and validators are configured:
* **TON → TON** (DEX swap): `trustedSettlementContracts["ton:-239"]`, `validateTonJettonWallet`, `validateTonSwapTarget`, `validateTonSwapLeg`. The built message’s DEX call is decoded in the package (STON.fi v1/v2 incl. pTON and cross-swap, DeDust v1, DeDust CPMM v2): receiver = destination, refunds/excess = trader, on-chain minimum ≥ the quote’s, no foreign referral; unknown layouts and split/multi-route quotes are refused by name. `validateTonSwapLeg` (supplied by `createOmnistonTonValidators`) confirms the routers’ ask wallets, pTON wallet ownership and DeDust pool pairs on chain. Without it the decoder cannot tell which token the DEX pays out, so the route is not advertised. `tonSwapPayloadCheck: "report"` traces `ton-swap-payload ` (incl. `legs-unverified`) instead of refusing (default `"enforce"`) — an explicit rollout opt-in. Behind `remoteProvider`, the app checks the built body itself: `remoteProvider({name: "omniston", baseUrl, verifyBuild: omnistonVerifyBuild({...createOmnistonTonValidators()})})`. A TON → TON swap body is opened with `checkTonSwapPayload` against the app’s own request (receiver, refund, on-chain minimum, input; the quote carries `routeSteps`) and the DEX it pays is confirmed with the app’s validators — `validateTonSwapTarget` and `validateTonSwapLeg`; without the leg check a TON swap body is refused. A TON → EVM escrow body goes to `verifyTonEscrowBuild`: the jetton amount, the trader as owner, the destination chain, address and token and the quote’s minimum delivery come from the app, the protocol contract from `trustedProtocolAddresses`, and the escrow code, authority key and timelocks are the audited ones. Without `verifyBuild` the engine refuses remote cell bodies.
* **TON → EVM** (HTLC order, the wallet pays a jetton escrow): factory allowlisted on both chains, `validateTonJettonWallet`, `validateTonEscrowPayload`, `validateEvmOutputPosition`.
* **EVM → TON** (gasless order): the wallet approves the Omniston order protocol (a 1inch Limit Order Protocol v4 fork, `trustedEvmOrderProtocols` per chain — a different table from the factories, since one address plays different roles on different chains) and signs an EIP-712 `Order`; `buildDeposit` returns a `typedData` `UnsignedTx` only after the order, the pinned v1beta8 extension and the serialized order details are verified against the quote, `registerSignedOrder` hands the signature to Omniston, and `trackIntent` discloses the HTLC secret only when `validateEvmInputPosition` (finalized `SrcEscrowCreated` + escrow state) AND `validateTonOutputPosition` (factory-deployed TON position with bound state, inside its completion window) both pass. Behind `remoteProvider` the order is built on your server, so the app pins the order protocols itself: `remoteProvider({name: "omniston", baseUrl, ...omnistonPins(trustedEvmOrderProtocols)})` — the same audited table. The engine then signs only an `Order` whose verifying contract is a pinned spender, whose maker is this account and that sells exactly the swap’s input of the source token; a `Permit` or any other typed message is refused. The rest of the order is the app’s to check, and the engine signs a remote typed order only with `verifyBuild`: `remoteProvider({name: "omniston", baseUrl, ...omnistonPins(AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS), verifyBuild: omnistonVerifyBuild({...createOmnistonTonValidators()})})`. The build carries the `orderExtension` the order’s salt commits to, and `omnistonVerifyBuild` opens both: the v4 domain on a trusted order protocol, the exact Order schema, `takingAmount` at least the quote’s minimum, a single-fill order with no allowed sender and an expiry minutes away, the pinned v1beta8 auction and fee terms, one trusted escrow factory (`trustedSettlementContracts`, default the audited table) as the extension target, the whitelisted resolver as the order’s receiver, the destination chain and token, the audited timelocks, the TON token and recipient and the quote id. The hashlock is the server’s: the server holds the HTLC secret. The same applies to EVM → EVM. `validateEvmTypedOrder` is exported for apps that hold the settlement data.
* **EVM → EVM** (gasless order, same order protocol as EVM → TON): the signed extension’s ExtraDataArgs name the destination chain, token and deposit and are checked against the quote. The EVM recipient is NOT in anything the wallet signs (it rides in the unsigned order details), so the secret is disclosed only when `validateEvmInputPosition` (source fill, including the destination complement) AND `validateEvmOutputPosition` (an escrow the trusted factory derives from immutables that pay the recipient) both pass. The destination escrow’s fee split must be exactly the quoted protocol and integrator fees, paid only to the quote’s `protocolFeeRecipientAddress` / integrator, its destination stages must be 1/120/180 s, and the secret is not released within 45 s of its cancellation stage (refusal reasons go to the validator’s `onRefusal`).
## Validators
[Section titled “Validators”](#validators)
`@anywalletkit/protocol-swap2-omniston/validators` ships the RPC/indexer-backed validators every route above needs, plus the audited contract tables: `createOmnistonEvmOutputValidator`, `createOmnistonEvmInputValidator`, `createOmnistonTonValidators` (TonAPI), `createOmnistonEvmDeliveryLocator` (feeds `locateEvmDelivery`: a completed EVM-destination order then carries `destTxHash`, the escrow’s payout to the recipient — Omniston’s feed names the escrow, not that transaction), `AUDITED_OMNISTON_SETTLEMENT_CONTRACTS`, `AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS`. No deployment env is read: pass your own endpoints as `rpcUrls` (CAIP-2 → URLs, tried before the public fallbacks) and `tonApiUrl` / `tonApiKey`. On serverless also inject durable `secretStore` / `quoteStore` — the HTLC secret must survive to the poll that discloses it. Give the quote store a `claim` (an atomic create-if-absent: Redis `SET NX`, a conditional KV put): the platform picks quote ids, and a context is never rebound to another user’s quote under the same id. A secret is disclosed only against the exact order it was locked to (its stored binding), so even a rebound context gets nothing.
The destination-escrow proof requires the escrow immutables to be found in the resolver’s calldata AND to derive, through the trusted factory’s `addressOfEscrowDst` (deployedAt stamped with the block timestamp), to the escrow address the factory announced; a decoy tuple or hidden immutables fail closed.
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` recognizes TON-side transactions by their counterparty (compared in raw form, so `EQ…`, `UQ…` and `0:…` all match), looking at the destination contract and both sides of every transfer:
* STON.fi DEX router (`STONFI_ROUTERS` in `src/activity.ts`; v2.2 `EQCS4UEa…cN3` is what the wallet’s swaps hit, v1 kept for older history) → `swap`, “Swapped GRAM → USD₮” / “Swapped USD₮ → GRAM”, subtitle “STON.fi · TON”.
* Omniston HTLC escrow (`OMNISTON_ESCROWS`, the Escrow Minter `EQAbWJ3Y…mrZ` that every live quote names as `srcProtocolContractAddress`) → `bridge`, “Bridged USD₮”, subtitle “Omniston · STON.fi”. The EVM leg is paid by the resolver and is not recognizable offline.
EVM → TON: the EVM leg is an off-chain signature (no transaction to recognize); the delivery is a jetton transfer from the same escrow contract and shows up as `bridge`. Nothing on EVM is recognized.
Fixtures (`fixtures/activity/`, test wallet `UQCbXJ1-…fQaq`, tonapi events): two STON.fi swaps (GRAM → USD₮, USD₮ → GRAM) and one escrow order (1.6 USD₮); negatives: a 1Click deposit on TON (a plain jetton transfer to a one-time address — must stay null) and an EVM LI.FI swap.
## Classes
[Section titled “Classes”](#classes)
* [OmnistonSwap2Protocol](/api/anywalletkit/protocol-swap2-omniston/classes/omnistonswap2protocol/)
* [TonSwapPayloadError](/api/anywalletkit/protocol-swap2-omniston/classes/tonswappayloaderror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [AssetId](/api/anywalletkit/protocol-swap2-omniston/interfaces/assetid/)
* [ChainAddress](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
* [EscrowMessage](/api/anywalletkit/protocol-swap2-omniston/interfaces/escrowmessage/)
* [HtlcSecretStore](/api/anywalletkit/protocol-swap2-omniston/interfaces/htlcsecretstore/)
* [ObservableLike](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)
* [OmnistonClientLike](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonclientlike/)
* [OmnistonProviderOptions](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/)
* [OmnistonQuote](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquote/)
* [OmnistonQuoteStore](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquotestore/)
* [OmnistonSwap2Config](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonswap2config/)
* [OrderExecution](/api/anywalletkit/protocol-swap2-omniston/interfaces/orderexecution/)
* [OrderSettlement](/api/anywalletkit/protocol-swap2-omniston/interfaces/ordersettlement/)
* [OrderSnapshot](/api/anywalletkit/protocol-swap2-omniston/interfaces/ordersnapshot/)
* [QuoteRequest](/api/anywalletkit/protocol-swap2-omniston/interfaces/quoterequest/)
* [SwapSettlement](/api/anywalletkit/protocol-swap2-omniston/interfaces/swapsettlement/)
* [TonSwapCheckInput](/api/anywalletkit/protocol-swap2-omniston/interfaces/tonswapcheckinput/)
* [TonSwapCheckResult](/api/anywalletkit/protocol-swap2-omniston/interfaces/tonswapcheckresult/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [OrderEvent](/api/anywalletkit/protocol-swap2-omniston/type-aliases/orderevent/)
* [RfqEvent](/api/anywalletkit/protocol-swap2-omniston/type-aliases/rfqevent/)
* [SwapTrackEvent](/api/anywalletkit/protocol-swap2-omniston/type-aliases/swaptrackevent/)
* [TonSwapLeg](/api/anywalletkit/protocol-swap2-omniston/type-aliases/tonswapleg/)
## Variables
[Section titled “Variables”](#variables)
* [omniston](/api/anywalletkit/protocol-swap2-omniston/variables/omniston/)
* [OMNISTON_ESCROWS](/api/anywalletkit/protocol-swap2-omniston/variables/omniston_escrows/)
* [OMNISTON_MODULE](/api/anywalletkit/protocol-swap2-omniston/variables/omniston_module/)
* [STONFI_ROUTERS](/api/anywalletkit/protocol-swap2-omniston/variables/stonfi_routers/)
* [TON_SWAP_PROTOCOL_LAYOUTS](/api/anywalletkit/protocol-swap2-omniston/variables/ton_swap_protocol_layouts/)
## Functions
[Section titled “Functions”](#functions)
* [checkTonSwapPayload](/api/anywalletkit/protocol-swap2-omniston/functions/checktonswappayload/)
* [describeOmnistonActivity](/api/anywalletkit/protocol-swap2-omniston/functions/describeomnistonactivity/)
* [encodeTypedMessage](/api/anywalletkit/protocol-swap2-omniston/functions/encodetypedmessage/)
* [inMemoryQuoteStore](/api/anywalletkit/protocol-swap2-omniston/functions/inmemoryquotestore/)
* [inMemorySecretStore](/api/anywalletkit/protocol-swap2-omniston/functions/inmemorysecretstore/)
* [omnistonPins](/api/anywalletkit/protocol-swap2-omniston/functions/omnistonpins/)
* [omnistonProvider](/api/anywalletkit/protocol-swap2-omniston/functions/omnistonprovider/)
* [omnistonVerifyBuild](/api/anywalletkit/protocol-swap2-omniston/functions/omnistonverifybuild/)
* [validateEvmToTonOrderExtension](/api/anywalletkit/protocol-swap2-omniston/functions/validateevmtotonorderextension/)
* [validateEvmTypedOrder](/api/anywalletkit/protocol-swap2-omniston/functions/validateevmtypedorder/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [OmnistonSwap2Protocol](/api/anywalletkit/protocol-swap2-omniston/classes/omnistonswap2protocol/)
# OmnistonSwap2Protocol
Defined in: protocol-swap2-omniston/src/protocol.ts:9
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new OmnistonSwap2Protocol**(`account`, `config`): `OmnistonSwap2Protocol`
Defined in: protocol-swap2-omniston/src/protocol.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`OmnistonSwap2Config`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`OmnistonSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-omniston/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-omniston/src/protocol.ts:15
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-omniston/src/protocol.ts:20
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# TonSwapPayloadError
Defined in: protocol-swap2-omniston/src/ton-swap.ts:109
A refusal with a stable, loggable reason code (never carries secrets).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TonSwapPayloadError**(`reason`, `detail?`): `TonSwapPayloadError`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:110
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
##### detail?
[Section titled “detail?”](#detail)
`string`
#### Returns
[Section titled “Returns”](#returns)
`TonSwapPayloadError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:110
# checkTonSwapPayload
> **checkTonSwapPayload**(`ctx`): [`TonSwapCheckResult`](/api/anywalletkit/protocol-swap2-omniston/interfaces/tonswapcheckresult/)
Defined in: protocol-swap2-omniston/src/ton-swap.ts:277
Decode and check a built TON same-chain swap message. Throws `TonSwapPayloadError` with a reason code on the first violated rule; returns the chain facts (`legs`) still to be confirmed by `validateTonSwapLeg`.
Rules (all protocols): one route of single-protocol steps; the body’s layout is the one the quoted protocol builds; the DEX call moves exactly the quoted input; the final receiver is the destination; refunds / excesses go to the trader; the final on-chain minimum is ≥ the quote’s minOutputAmount; no referral other than the configured integrator; no trailing data.
## Parameters
[Section titled “Parameters”](#parameters)
### ctx
[Section titled “ctx”](#ctx)
[`TonSwapCheckInput`](/api/anywalletkit/protocol-swap2-omniston/interfaces/tonswapcheckinput/)
## Returns
[Section titled “Returns”](#returns)
[`TonSwapCheckResult`](/api/anywalletkit/protocol-swap2-omniston/interfaces/tonswapcheckresult/)
# describeOmnistonActivity
> **describeOmnistonActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-omniston/src/activity.ts:59
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# encodeTypedMessage
> **encodeTypedMessage**(`td`): `Uint8Array`
Defined in: protocol-swap2-omniston/src/provider.ts:665
EIP-712 typed data → the ABI-encoded order struct `SignedOrderEvmV1` wants. Structs referenced in `types` become tuples, recursively.
## Parameters
[Section titled “Parameters”](#parameters)
### td
[Section titled “td”](#td)
#### message
[Section titled “message”](#message)
`unknown`
#### primaryType
[Section titled “primaryType”](#primarytype)
`string`
#### types
[Section titled “types”](#types)
`Record`<`string`, `object`\[]>
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# inMemoryQuoteStore
> **inMemoryQuoteStore**(): [`OmnistonQuoteStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquotestore/)
Defined in: protocol-swap2-omniston/src/provider.ts:154
Default quote store — long-lived processes and tests only.
## Returns
[Section titled “Returns”](#returns)
[`OmnistonQuoteStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquotestore/)
# inMemorySecretStore
> **inMemorySecretStore**(): [`HtlcSecretStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/htlcsecretstore/)
Defined in: protocol-swap2-omniston/src/provider.ts:165
Default store — suitable for long-lived processes and tests only.
## Returns
[Section titled “Returns”](#returns)
[`HtlcSecretStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/htlcsecretstore/)
# omnistonPins
> **omnistonPins**(`trustedEvmOrderProtocols`): [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-omniston/src/provider.ts:1655
The app’s side of `remoteProvider({name: "omniston", baseUrl, ...omnistonPins(trustedEvmOrderProtocols)})`: the audited order-protocol contracts per EVM chain — the list the provider’s `trustedEvmOrderProtocols` takes — are the only spenders, and so the only EIP-712 verifying contracts, a remote typed order may name (scan 2026-10-27 modules, F4). Omniston’s EVM orders call no contract from the wallet: there are no call targets.
## Parameters
[Section titled “Parameters”](#parameters)
### trustedEvmOrderProtocols
[Section titled “trustedEvmOrderProtocols”](#trustedevmorderprotocols)
`Readonly`<`Record`<`string`, readonly `string`\[]>>
## Returns
[Section titled “Returns”](#returns)
[`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
# omnistonProvider
> **omnistonProvider**(`opts?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-omniston/src/provider.ts:1868
## Parameters
[Section titled “Parameters”](#parameters)
### opts?
[Section titled “opts?”](#opts)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# omnistonVerifyBuild
> **omnistonVerifyBuild**(`hooks`): (`quote`, `tx`, `params?`) => `Promise`<`string` | `null`>
Defined in: protocol-swap2-omniston/src/provider.ts:1777
The app’s check of a remote Omniston TON build, for `remoteProvider({name: "omniston", baseUrl, verifyBuild: omnistonVerifyBuild({...createOmnistonTonValidators()})})` (scan 2026-10-27 modules, F7/F13/F18/F19):
* a TON → TON swap body is opened with `checkTonSwapPayload` against the app’s own request — receiver, refund / excess to the trader, the on-chain minimum, the input — and the DEX it pays is confirmed with the app’s validators (`validateTonSwapTarget`, `validateTonSwapLeg`);
* a TON → EVM escrow body (an Omniston order from TON) goes to `verifyTonEscrowBuild` with what the app knows: the input, the trader’s TON address, the destination chain, address and token, and the quote’s minimum delivery.
* an EVM typed order (EVM → TON, EVM → EVM) is opened with the order extension the build carries: price, receiver, traits, salt and the escrow terms are checked against the app’s request and the audited contracts (`trustedEvmOrderProtocols`, `trustedSettlementContracts`; default the audited tables), scan 2026-10-28 F6. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### hooks
[Section titled “hooks”](#hooks)
#### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
`string` | `null`
The integrator your backend’s Omniston provider uses: the only referral a body may name.
#### trustedEvmOrderProtocols?
[Section titled “trustedEvmOrderProtocols?”](#trustedevmorderprotocols)
`Readonly`<`Record`<`string`, readonly `string`\[]>>
EVM order protocols an EVM typed order may name, per chain. Default `AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS`.
#### trustedSettlementContracts?
[Section titled “trustedSettlementContracts?”](#trustedsettlementcontracts)
`Readonly`<`Record`<`string`, readonly `string`\[]>>
Escrow factories an EVM order’s extension may target, per chain. Default `AUDITED_OMNISTON_SETTLEMENT_CONTRACTS`.
#### validateTonSwapLeg?
[Section titled “validateTonSwapLeg?”](#validatetonswapleg)
(`leg`) => `boolean` | `Promise`<`boolean`>
The DEX pays out the quoted token (`createOmnistonTonValidators().validateTonSwapLeg`). Without it a TON swap body is refused.
#### validateTonSwapTarget
[Section titled “validateTonSwapTarget”](#validatetonswaptarget)
(`input`) => `boolean` | `Promise`<`boolean`>
#### verifyTonEscrowBuild?
[Section titled “verifyTonEscrowBuild?”](#verifytonescrowbuild)
(`input`) => `string` | `Promise`<`string` | `null`> | `null`
The app’s check of a TON → EVM escrow body (`createOmnistonTonValidators().verifyTonEscrowBuild`). Without it a TON → EVM build is refused.
## Returns
[Section titled “Returns”](#returns)
(`quote`, `tx`, `params?`) => `Promise`<`string` | `null`>
# validateEvmToTonOrderExtension
> **validateEvmToTonOrderExtension**(`extension`, `expected`): `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:931
Strict decoder for the currently observed Omniston v1beta8 EVM→TON 1inch extension profile. It deliberately rejects unknown auction/fee/timelock profiles: signing a merely well-formed extension is not enough because the resolver-controlled tail contains the actual on-chain HTLC terms.
This binds what the wallet signs to the quote; it does not by itself make the swap complete. Secret disclosure additionally needs the independently finalized EVM source-fill and TON output-position proofs (trackIntent). `dstSecurityDepositUnits` is the value the EVM deposits word carries — for a TON destination that word is 0 (the TON deposit is bound in the TON position).
## Parameters
[Section titled “Parameters”](#parameters)
### extension
[Section titled “extension”](#extension)
`Uint8Array`
### expected
[Section titled “expected”](#expected)
#### dstChainId?
[Section titled “dstChainId?”](#dstchainid)
`number`
EVM destination (EIP-155 id): ExtraDataArgs carry it and the destination ERC-20 (`outputTokenAddress`, `traderDstAddress` are EVM then). Absent = TON.
#### dstSecurityDepositUnits
[Section titled “dstSecurityDepositUnits”](#dstsecuritydepositunits)
`string`
#### initialResolverAddress
[Section titled “initialResolverAddress”](#initialresolveraddress)
`string`
#### integratorFeePips
[Section titled “integratorFeePips”](#integratorfeepips)
`number`
#### outputTokenAddress
[Section titled “outputTokenAddress”](#outputtokenaddress)
`string`
#### protocolFeePips
[Section titled “protocolFeePips”](#protocolfeepips)
`number`
#### quoteId
[Section titled “quoteId”](#quoteid)
`string`
#### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp)
`number`
#### secretHash
[Section titled “secretHash”](#secrethash)
`Uint8Array`
#### srcSecurityDepositUnits
[Section titled “srcSecurityDepositUnits”](#srcsecuritydepositunits)
`string`
#### takerAsset
[Section titled “takerAsset”](#takerasset)
`string`
#### traderDstAddress
[Section titled “traderDstAddress”](#traderdstaddress)
`string`
#### tradeStartDeadline
[Section titled “tradeStartDeadline”](#tradestartdeadline)
`number`
#### trustedTarget
[Section titled “trustedTarget”](#trustedtarget)
(`address`) => `boolean`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
# validateEvmTypedOrder
> **validateEvmTypedOrder**(`td`, `expected`): asserts td is { domain: { chainId: string | number; verifyingContract: string }; message: Record\; primaryType: string; types: Record\ }
Defined in: protocol-swap2-omniston/src/provider.ts:1040
The EVM order checks the provider runs on every build, exported so an app that holds the quote’s settlement data can run them itself (scan 2026-10-27 modules, F4): the 1inch Limit Order Protocol v4 domain on the settlement contract and chain, the exact Order schema, this owner as maker, the resolver as receiver, the input asset and amount, single-fill traits, the salt committing the order extension and the expiry at the trade-start deadline. Throws when any of it does not hold.
## Parameters
[Section titled “Parameters”](#parameters)
### td
[Section titled “td”](#td)
`unknown`
### expected
[Section titled “expected”](#expected)
#### chainId
[Section titled “chainId”](#chainid)
`number`
#### makerAsset
[Section titled “makerAsset”](#makerasset)
`string`
#### makingAmount
[Section titled “makingAmount”](#makingamount)
`string`
#### orderExtension
[Section titled “orderExtension”](#orderextension)
`Uint8Array`
#### owner
[Section titled “owner”](#owner)
`string`
#### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp)
`number`
#### receiver
[Section titled “receiver”](#receiver)
`string`
#### settlementContract
[Section titled “settlementContract”](#settlementcontract)
`string`
#### takingAmount
[Section titled “takingAmount”](#takingamount)
`string`
#### tradeStartDeadline
[Section titled “tradeStartDeadline”](#tradestartdeadline)
`number`
## Returns
[Section titled “Returns”](#returns)
asserts td is { domain: { chainId: string | number; verifyingContract: string }; message: Record\; primaryType: string; types: Record\ }
# AssetId
Defined in: protocol-swap2-omniston/src/provider.ts:182
Self-contained structural SDK types. Keeping these local prevents the optional Omniston peer from leaking into every consumer’s declaration graph.
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: `object`
Defined in: protocol-swap2-omniston/src/provider.ts:183
#### $case
[Section titled “$case”](#case)
> **$case**: `string`
#### value
[Section titled “value”](#value)
> **value**: `string` | { `kind?`: { `$case`: `string`; `value?`: `unknown`; }; }
# ChainAddress
Defined in: protocol-swap2-omniston/src/provider.ts:189
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: `object`
Defined in: protocol-swap2-omniston/src/provider.ts:190
#### $case
[Section titled “$case”](#case)
> **$case**: `string`
#### value
[Section titled “value”](#value)
> **value**: `string`
# EscrowMessage
Defined in: protocol-swap2-omniston/src/provider.ts:260
## Properties
[Section titled “Properties”](#properties)
### jettonWalletStateInit?
[Section titled “jettonWalletStateInit?”](#jettonwalletstateinit)
> `optional` **jettonWalletStateInit?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:264
***
### payload
[Section titled “payload”](#payload)
> **payload**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:263
***
### sendAmount
[Section titled “sendAmount”](#sendamount)
> **sendAmount**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:262
***
### targetAddress
[Section titled “targetAddress”](#targetaddress)
> **targetAddress**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:261
# HtlcSecretStore
Defined in: protocol-swap2-omniston/src/provider.ts:128
Persists HTLC secret preimages by quoteId between buildDeposit and the trackIntent poll that discloses them. Losing a secret does NOT lose funds — the escrow refunds after the HTLC timeout — but it does fail the swap.
## Methods
[Section titled “Methods”](#methods)
### clear()
[Section titled “clear()”](#clear)
> **clear**(`quoteId`): `void` | `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:131
#### Parameters
[Section titled “Parameters”](#parameters)
##### quoteId
[Section titled “quoteId”](#quoteid)
`string`
#### Returns
[Section titled “Returns”](#returns)
`void` | `Promise`<`void`>
***
### load()
[Section titled “load()”](#load)
> **load**(`quoteId`): `string`\[] | `Promise`<`string`\[] | `undefined`> | `undefined`
Defined in: protocol-swap2-omniston/src/provider.ts:130
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### quoteId
[Section titled “quoteId”](#quoteid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`string`\[] | `Promise`<`string`\[] | `undefined`> | `undefined`
***
### save()
[Section titled “save()”](#save)
> **save**(`quoteId`, `secretsHex`): `void` | `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:129
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### quoteId
[Section titled “quoteId”](#quoteid-2)
`string`
##### secretsHex
[Section titled “secretsHex”](#secretshex)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
# ObservableLike
Defined in: protocol-swap2-omniston/src/provider.ts:176
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Methods
[Section titled “Methods”](#methods)
### subscribe()
[Section titled “subscribe()”](#subscribe)
> **subscribe**(`observer`): `object`
Defined in: protocol-swap2-omniston/src/provider.ts:177
#### Parameters
[Section titled “Parameters”](#parameters)
##### observer
[Section titled “observer”](#observer)
###### complete?
[Section titled “complete?”](#complete)
() => `void`
###### error?
[Section titled “error?”](#error)
(`err`) => `void`
###### next?
[Section titled “next?”](#next)
(`value`) => `void`
#### Returns
[Section titled “Returns”](#returns)
`object`
##### unsubscribe()
[Section titled “unsubscribe()”](#unsubscribe)
> **unsubscribe**(): `void`
###### Returns
[Section titled “Returns”](#returns-1)
`void`
# OmnistonClientLike
Defined in: protocol-swap2-omniston/src/provider.ts:292
The slice of `Omniston` this provider uses — a real instance satisfies it.
## Properties
[Section titled “Properties”](#properties)
### close?
[Section titled “close?”](#close)
> `optional` **close?**: () => `void`
Defined in: protocol-swap2-omniston/src/provider.ts:327
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### transport?
[Section titled “transport?”](#transport)
> `optional` **transport?**: `object`
Defined in: protocol-swap2-omniston/src/provider.ts:328
#### close()
[Section titled “close()”](#close-1)
> **close**(): `void`
##### Returns
[Section titled “Returns”](#returns-1)
`void`
## Methods
[Section titled “Methods”](#methods)
### evmBuildOrderPayload()
[Section titled “evmBuildOrderPayload()”](#evmbuildorderpayload)
> **evmBuildOrderPayload**(`request`): `Promise`<{ `orderExtension`: `Uint8Array`; `serializedOrderDetails?`: `Uint8Array`<`ArrayBufferLike`>; `typedData`: `string`; }>
Defined in: protocol-swap2-omniston/src/provider.ts:303
#### Parameters
[Section titled “Parameters”](#parameters)
##### request
[Section titled “request”](#request)
###### htlcSecrets?
[Section titled “htlcSecrets?”](#htlcsecrets)
{ `secretMode`: { `$case`: `"provided"`; `value`: { `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }; }; }
###### htlcSecrets.secretMode
[Section titled “htlcSecrets.secretMode”](#htlcsecretssecretmode)
{ `$case`: `"provided"`; `value`: { `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }; }
###### htlcSecrets.secretMode.$case
[Section titled “htlcSecrets.secretMode.$case”](#htlcsecretssecretmodecase)
`"provided"`
###### htlcSecrets.secretMode.value
[Section titled “htlcSecrets.secretMode.value”](#htlcsecretssecretmodevalue)
{ `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }
###### htlcSecrets.secretMode.value.hashes
[Section titled “htlcSecrets.secretMode.value.hashes”](#htlcsecretssecretmodevaluehashes)
`Uint8Array`<`ArrayBufferLike`>\[]
###### ownerSrcAddress
[Section titled “ownerSrcAddress”](#ownersrcaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### quoteId
[Section titled “quoteId”](#quoteid)
`string`
###### traderDstAddress?
[Section titled “traderDstAddress?”](#traderdstaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<{ `orderExtension`: `Uint8Array`; `serializedOrderDetails?`: `Uint8Array`<`ArrayBufferLike`>; `typedData`: `string`; }>
***
### orderDiscloseHtlcSecret()
[Section titled “orderDiscloseHtlcSecret()”](#orderdisclosehtlcsecret)
> **orderDiscloseHtlcSecret**(`request`): `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:326
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### request
[Section titled “request”](#request-1)
###### executionIndex
[Section titled “executionIndex”](#executionindex)
`number`
###### quoteId
[Section titled “quoteId”](#quoteid-1)
`string`
###### secret
[Section titled “secret”](#secret)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
***
### orderRegisterSignedOrder()
[Section titled “orderRegisterSignedOrder()”](#orderregistersignedorder)
> **orderRegisterSignedOrder**(`request`): `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:309
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### request
[Section titled “request”](#request-2)
###### ownerSrcAddress
[Section titled “ownerSrcAddress”](#ownersrcaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### quoteId
[Section titled “quoteId”](#quoteid-2)
`string`
###### serializedOrderDetails?
[Section titled “serializedOrderDetails?”](#serializedorderdetails)
`Uint8Array`<`ArrayBufferLike`>
###### signedOrder
[Section titled “signedOrder”](#signedorder)
{ `order`: { `$case`: `"evmV1"`; `value`: { `encodedOrder`: `Uint8Array`; `orderExtension`: `Uint8Array`; `signature`: `Uint8Array`; }; }; }
###### signedOrder.order
[Section titled “signedOrder.order”](#signedorderorder)
{ `$case`: `"evmV1"`; `value`: { `encodedOrder`: `Uint8Array`; `orderExtension`: `Uint8Array`; `signature`: `Uint8Array`; }; }
###### signedOrder.order.$case
[Section titled “signedOrder.order.$case”](#signedorderordercase)
`"evmV1"`
###### signedOrder.order.value
[Section titled “signedOrder.order.value”](#signedorderordervalue)
{ `encodedOrder`: `Uint8Array`; `orderExtension`: `Uint8Array`; `signature`: `Uint8Array`; }
###### signedOrder.order.value.encodedOrder
[Section titled “signedOrder.order.value.encodedOrder”](#signedorderordervalueencodedorder)
`Uint8Array`
###### signedOrder.order.value.orderExtension
[Section titled “signedOrder.order.value.orderExtension”](#signedorderordervalueorderextension)
`Uint8Array`
###### signedOrder.order.value.signature
[Section titled “signedOrder.order.value.signature”](#signedorderordervaluesignature)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### orderTrack()
[Section titled “orderTrack()”](#ordertrack)
> **orderTrack**(`request`): [`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`OrderEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/orderevent/)>
Defined in: protocol-swap2-omniston/src/provider.ts:325
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### request
[Section titled “request”](#request-3)
###### quoteId
[Section titled “quoteId”](#quoteid-3)
`string`
###### traderAddress
[Section titled “traderAddress”](#traderaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
#### Returns
[Section titled “Returns”](#returns-5)
[`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`OrderEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/orderevent/)>
***
### requestForQuote()
[Section titled “requestForQuote()”](#requestforquote)
> **requestForQuote**(`request`): [`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`RfqEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/rfqevent/)>
Defined in: protocol-swap2-omniston/src/provider.ts:293
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### request
[Section titled “request”](#request-4)
[`QuoteRequest`](/api/anywalletkit/protocol-swap2-omniston/interfaces/quoterequest/)
#### Returns
[Section titled “Returns”](#returns-6)
[`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`RfqEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/rfqevent/)>
***
### swapTrack()?
[Section titled “swapTrack()?”](#swaptrack)
> `optional` **swapTrack**(`request`): [`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`SwapTrackEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/swaptrackevent/)>
Defined in: protocol-swap2-omniston/src/provider.ts:324
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### request
[Section titled “request”](#request-5)
###### outgoingTxQuery
[Section titled “outgoingTxQuery”](#outgoingtxquery)
`string`
###### quoteId
[Section titled “quoteId”](#quoteid-4)
`string`
###### traderAddress
[Section titled “traderAddress”](#traderaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
#### Returns
[Section titled “Returns”](#returns-7)
[`ObservableLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/observablelike/)<[`SwapTrackEvent`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/swaptrackevent/)>
***
### tonBuildEscrowTransfer()
[Section titled “tonBuildEscrowTransfer()”](#tonbuildescrowtransfer)
> **tonBuildEscrowTransfer**(`request`): `Promise`<{ `messages`: [`EscrowMessage`](/api/anywalletkit/protocol-swap2-omniston/interfaces/escrowmessage/)\[]; }>
Defined in: protocol-swap2-omniston/src/provider.ts:294
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### request
[Section titled “request”](#request-6)
###### gasExcessAddress
[Section titled “gasExcessAddress”](#gasexcessaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### htlcSecrets
[Section titled “htlcSecrets”](#htlcsecrets-1)
{ `secretMode`: { `$case`: `"provided"`; `value`: { `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }; }; }
###### htlcSecrets.secretMode
[Section titled “htlcSecrets.secretMode”](#htlcsecretssecretmode-1)
{ `$case`: `"provided"`; `value`: { `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }; }
###### htlcSecrets.secretMode.$case
[Section titled “htlcSecrets.secretMode.$case”](#htlcsecretssecretmodecase-1)
`"provided"`
###### htlcSecrets.secretMode.value
[Section titled “htlcSecrets.secretMode.value”](#htlcsecretssecretmodevalue-1)
{ `hashes`: `Uint8Array`<`ArrayBufferLike`>\[]; }
###### htlcSecrets.secretMode.value.hashes
[Section titled “htlcSecrets.secretMode.value.hashes”](#htlcsecretssecretmodevaluehashes-1)
`Uint8Array`<`ArrayBufferLike`>\[]
###### ownerSrcAddress
[Section titled “ownerSrcAddress”](#ownersrcaddress-2)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### quoteId
[Section titled “quoteId”](#quoteid-5)
`string`
###### refundSrcAddress
[Section titled “refundSrcAddress”](#refundsrcaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### traderDstAddress
[Section titled “traderDstAddress”](#traderdstaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### transferSrcAddress
[Section titled “transferSrcAddress”](#transfersrcaddress)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<{ `messages`: [`EscrowMessage`](/api/anywalletkit/protocol-swap2-omniston/interfaces/escrowmessage/)\[]; }>
***
### tonBuildSwap()?
[Section titled “tonBuildSwap()?”](#tonbuildswap)
> `optional` **tonBuildSwap**(`request`): `Promise`<{ `messages`: [`EscrowMessage`](/api/anywalletkit/protocol-swap2-omniston/interfaces/escrowmessage/)\[]; }>
Defined in: protocol-swap2-omniston/src/provider.ts:316
Swap settlement (TON↔TON). Optional so older injected clients keep working; without them same-chain swaps fail closed.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### request
[Section titled “request”](#request-7)
###### gasExcessAddress
[Section titled “gasExcessAddress”](#gasexcessaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### quoteId
[Section titled “quoteId”](#quoteid-6)
`string`
###### refundSrcAddress
[Section titled “refundSrcAddress”](#refundsrcaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### traderDstAddress
[Section titled “traderDstAddress”](#traderdstaddress-2)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### transferSrcAddress
[Section titled “transferSrcAddress”](#transfersrcaddress-1)
[`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
###### useRecommendedSlippage?
[Section titled “useRecommendedSlippage?”](#userecommendedslippage)
`boolean`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<{ `messages`: [`EscrowMessage`](/api/anywalletkit/protocol-swap2-omniston/interfaces/escrowmessage/)\[]; }>
# OmnistonProviderOptions
Defined in: protocol-swap2-omniston/src/provider.ts:331
## Extended by
[Section titled “Extended by”](#extended-by)
* [`OmnistonSwap2Config`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonswap2config/)
## Properties
[Section titled “Properties”](#properties)
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:335
WebSocket API URL; defaults to the public ston.fi endpoint.
***
### client?
[Section titled “client?”](#client)
> `optional` **client?**: [`OmnistonClientLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonclientlike/)
Defined in: protocol-swap2-omniston/src/provider.ts:333
Injected SDK client (tests); defaults to a lazy `new Omniston({apiUrl})`.
***
### closeInjectedClient?
[Section titled “closeInjectedClient?”](#closeinjectedclient)
> `optional` **closeInjectedClient?**: `boolean`
Defined in: protocol-swap2-omniston/src/provider.ts:521
Close an injected client when the provider closes (default: caller owns it).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-omniston/src/provider.ts:347
Explicit constructor configuration; no deployment environment is read.
***
### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
> `optional` **integratorAddress?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:350
***
### integratorFeePips?
[Section titled “integratorFeePips?”](#integratorfeepips)
> `optional` **integratorFeePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:351
***
### locateEvmDelivery?
[Section titled “locateEvmDelivery?”](#locateevmdelivery)
> `optional` **locateEvmDelivery?**: (`input`) => `Promise`<`string` | `null`>
Defined in: protocol-swap2-omniston/src/provider.ts:501
EVM destination: find the delivery transaction — the destination escrow’s payout to the recipient — so a completed order carries `destTxHash`. Omniston’s tracking feed names the escrow but not that transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### input
[Section titled “input”](#input)
###### chain
[Section titled “chain”](#chain)
`string`
###### minUnits
[Section titled “minUnits”](#minunits)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress)
`string`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress)
`string`
###### tokenAddress
[Section titled “tokenAddress”](#tokenaddress)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string` | `null`>
***
### locateTonDelivery?
[Section titled “locateTonDelivery?”](#locatetondelivery)
> `optional` **locateTonDelivery?**: (`input`) => `Promise`<`string` | `null`>
Defined in: protocol-swap2-omniston/src/provider.ts:514
TON destination: find the delivery — the output position’s jetton transfer to the recipient — so a completed EVM → TON order carries `destTxHash` in the form the TON history source uses (tonapi event id). Without it the wallet’s feed cannot pair the TON receive with the swap.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### input
[Section titled “input”](#input-1)
###### jettonMasterAddress
[Section titled “jettonMasterAddress”](#jettonmasteraddress)
`string`
###### minUnits
[Section titled “minUnits”](#minunits-1)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-1)
`string`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string` | `null`>
***
### maxHtlcExecutions?
[Section titled “maxHtlcExecutions?”](#maxhtlcexecutions)
> `optional` **maxHtlcExecutions?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:341
Maximum number of HTLC execution attempts covered by generated secrets.
***
### maxTonExecutionNano?
[Section titled “maxTonExecutionNano?”](#maxtonexecutionnano)
> `optional` **maxTonExecutionNano?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:343
Hard cap for resolver-requested TON gas/forward value (default: 2 TON).
***
### maxUsd?
[Section titled “maxUsd?”](#maxusd)
> `optional` **maxUsd?**: `string` | `number`
Defined in: protocol-swap2-omniston/src/provider.ts:349
Exact decimal USD cap; string form avoids binary-float rounding.
***
### quoteSettleMs?
[Section titled “quoteSettleMs?”](#quotesettlems)
> `optional` **quoteSettleMs?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:345
Resolver competition window; primarily useful for deterministic tests.
***
### quoteStore?
[Section titled “quoteStore?”](#quotestore)
> `optional` **quoteStore?**: [`OmnistonQuoteStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquotestore/)
Defined in: protocol-swap2-omniston/src/provider.ts:339
Quote/build context persistence; defaults to in-memory (NOT serverless-safe).
***
### secretStore?
[Section titled “secretStore?”](#secretstore)
> `optional` **secretStore?**: [`HtlcSecretStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/htlcsecretstore/)
Defined in: protocol-swap2-omniston/src/provider.ts:337
HTLC preimage persistence; defaults to in-memory (NOT serverless-safe).
***
### tonSwapPayloadCheck?
[Section titled “tonSwapPayloadCheck?”](#tonswappayloadcheck)
> `optional` **tonSwapPayloadCheck?**: `"report"` | `"enforce"`
Defined in: protocol-swap2-omniston/src/provider.ts:407
TON↔TON swap settlement (scan F11): what a built swap body that fails the decoder (receiver ≠ destination, refund/excess ≠ trader, on-chain minimum below the quote, unknown layout, unverifiable leg) does. “enforce” (default) refuses the build; “report” traces `ton-swap-payload ` and still builds — a rollout escape hatch, not a steady state.
***
### trace?
[Section titled “trace?”](#trace)
> `optional` **trace?**: (`event`, `details?`) => `void`
Defined in: protocol-swap2-omniston/src/provider.ts:528
Diagnostics: why a poll did not disclose (`disclosure-skipped` with the gate and its fields, `validator-refused`, `validator-threw`) and when it did (`secret-disclosed`). Never carries secrets. Wire it to your logger: a silent “pending” cost a live order its 2-minute window (2026-10-20).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### event
[Section titled “event”](#event)
`string`
##### details?
[Section titled “details?”](#details)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### trustedEvmOrderProtocols?
[Section titled “trustedEvmOrderProtocols?”](#trustedevmorderprotocols)
> `optional` **trustedEvmOrderProtocols?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-omniston/src/provider.ts:362
Independently trusted EVM order protocols — the Omniston fork of the 1inch Limit Order Protocol an EVM-source order is signed against and that moves the input token on fill — keyed by CAIP-2 chain. Kept apart from `trustedSettlementContracts` because one address plays different roles on different chains (0xafCF… is the escrow factory on Ethereum and the order protocol on Polygon). EVM→TON is advertised only for chains listed here.
***
### trustedSettlementContracts?
[Section titled “trustedSettlementContracts?”](#trustedsettlementcontracts)
> `optional` **trustedSettlementContracts?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-omniston/src/provider.ts:353
Independently trusted settlement contracts, keyed by CAIP-2 chain.
***
### validateEvmInputPosition?
[Section titled “validateEvmInputPosition?”](#validateevminputposition)
> `optional` **validateEvmInputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:459
RPC-backed proof of the finalized EVM source position (EVM→TON). The tracking feed only hints at the address; no secret is disclosed until this hook proves — from the trusted factory’s own `SrcEscrowCreated` event, the deterministic escrow address and the escrow’s balances — that the trader’s FULL input is locked for this hashlock under the quoted terms (owner, token, amount, resolver, deposit, timelocks, TON output amount).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### input
[Section titled “input”](#input-2)
###### chain
[Section titled “chain”](#chain-1)
`string`
###### destinationChainId?
[Section titled “destinationChainId?”](#destinationchainid)
`number`
EVM destination only: the escrow event’s destination complement must name this chain, token and deposit.
###### destinationTokenAddress?
[Section titled “destinationTokenAddress?”](#destinationtokenaddress)
`string`
###### dstSecurityDepositUnits?
[Section titled “dstSecurityDepositUnits?”](#dstsecuritydepositunits)
`string`
###### factoryAddress
[Section titled “factoryAddress”](#factoryaddress)
`string`
###### inputTokenAddress
[Section titled “inputTokenAddress”](#inputtokenaddress)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits)
`string`
###### orderProtocolAddress
[Section titled “orderProtocolAddress”](#orderprotocoladdress)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-2)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp)
`number`
###### resolverAddress
[Section titled “resolverAddress”](#resolveraddress)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash)
`Uint8Array`
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`boolean` | `Promise`<`boolean`>
***
### validateEvmOutputPosition?
[Section titled “validateEvmOutputPosition?”](#validateevmoutputposition)
> `optional` **validateEvmOutputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:431
RPC-backed proof of the destination EVM escrow. The tracking feed is only a discovery hint: no HTLC preimage is disclosed until this hook proves the independently finalized on-chain position matches the signed quote.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### input
[Section titled “input”](#input-3)
###### chain
[Section titled “chain”](#chain-2)
`string`
###### dstSecurityDepositUnits
[Section titled “dstSecurityDepositUnits”](#dstsecuritydepositunits-1)
`string`
###### executionIndex
[Section titled “executionIndex”](#executionindex)
`number`
###### factoryAddress
[Section titled “factoryAddress”](#factoryaddress-1)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-1)
`string`
###### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress-1)
`string`
###### integratorFeeUnits
[Section titled “integratorFeeUnits”](#integratorfeeunits)
`string`
###### outputTokenAddress
[Section titled “outputTokenAddress”](#outputtokenaddress)
`string`
###### outputUnits
[Section titled “outputUnits”](#outputunits)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-3)
`string`
###### protocolFeeRecipientAddress?
[Section titled “protocolFeeRecipientAddress?”](#protocolfeerecipientaddress)
`string`
The quote’s `settlementData.protocolFeeRecipientAddress` (destination chain).
###### protocolFeeUnits
[Section titled “protocolFeeUnits”](#protocolfeeunits)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp-1)
`number`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-2)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-1)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash-1)
`Uint8Array`
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits-1)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`boolean` | `Promise`<`boolean`>
***
### validateTonEscrowPayload?
[Section titled “validateTonEscrowPayload?”](#validatetonescrowpayload)
> `optional` **validateTonEscrowPayload?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:408
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### input
[Section titled “input”](#input-4)
###### destinationAddress
[Section titled “destinationAddress”](#destinationaddress)
`string`
###### destinationChain
[Section titled “destinationChain”](#destinationchain)
`string`
###### exclusivityTimeout
[Section titled “exclusivityTimeout”](#exclusivitytimeout)
`number`
The quote’s `exclusivityTimeout` (seconds) the escrow config must carry.
###### forwardPayloadBocHex
[Section titled “forwardPayloadBocHex”](#forwardpayloadbochex)
`string`
###### hashingFunction?
[Section titled “hashingFunction?”](#hashingfunction)
`string`
###### initialResolverAddress
[Section titled “initialResolverAddress”](#initialresolveraddress)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-2)
`string`
###### outputTokenAddress
[Section titled “outputTokenAddress”](#outputtokenaddress-1)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress-1)
`string`
###### payloadBocHex
[Section titled “payloadBocHex”](#payloadbochex)
`string`
###### protocolAddress
[Section titled “protocolAddress”](#protocoladdress)
`string`
###### quoteId
[Section titled “quoteId”](#quoteid)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-2)
`string`
###### secretHashes
[Section titled “secretHashes”](#secrethashes)
readonly `Uint8Array`<`ArrayBufferLike`>\[]
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits-2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean` | `Promise`<`boolean`>
***
### validateTonJettonWallet?
[Section titled “validateTonJettonWallet?”](#validatetonjettonwallet)
> `optional` **validateTonJettonWallet?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:368
RPC-backed TON jetton-wallet verification. A TON-source order is rejected when this hook is absent or does not prove that `walletAddress` belongs to the quoted jetton master for `ownerAddress`.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### input
[Section titled “input”](#input-5)
###### jettonMasterAddress
[Section titled “jettonMasterAddress”](#jettonmasteraddress-1)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress-2)
`string`
###### walletAddress
[Section titled “walletAddress”](#walletaddress)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`boolean` | `Promise`<`boolean`>
***
### validateTonOutputPosition?
[Section titled “validateTonOutputPosition?”](#validatetonoutputposition)
> `optional` **validateTonOutputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:483
Indexer/RPC-backed proof of the TON output position (EVM→TON): deployed by the trusted factory for THIS quote, pinned position/escrow code, hashlock, recipient, amount, security deposit, and a cancellation boundary still far enough away to complete. The tracking feed is only a discovery hint.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### input
[Section titled “input”](#input-6)
###### dstSecurityDepositUnits
[Section titled “dstSecurityDepositUnits”](#dstsecuritydepositunits-2)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-3)
`string`
###### outputJettonMasterAddress
[Section titled “outputJettonMasterAddress”](#outputjettonmasteraddress)
`string`
###### outputUnits
[Section titled “outputUnits”](#outputunits-1)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-4)
`string`
###### protocolAddress
[Section titled “protocolAddress”](#protocoladdress-1)
`string`
###### quoteId
[Section titled “quoteId”](#quoteid-1)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp-2)
`number`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-3)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-3)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash-2)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-7)
`boolean` | `Promise`<`boolean`>
***
### validateTonSwapLeg?
[Section titled “validateTonSwapLeg?”](#validatetonswapleg)
> `optional` **validateTonSwapLeg?**: (`leg`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:399
TON↔TON swap settlement (scan F11): confirm one chain fact the decoded swap body depends on — that a STON.fi hop’s ask wallet is its router’s wallet of the quoted output (and, for native input, that the pTON wallet the message pays belongs to that router), or that a DeDust pool trades the quoted pair. `createOmnistonTonValidators` supplies it. Required, with `validateTonSwapTarget`, to advertise same-chain TON swaps (scan 2026-10-30 F8: without it a genuine DEX body can pay out a token other than the quoted one). Only `tonSwapPayloadCheck: "report"` lets a host run without it — each unverified leg is then traced as `ton-swap-payload legs-unverified`; STON.fi v1 native input (pTON v1) is refused regardless.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### leg
[Section titled “leg”](#leg)
[`TonSwapLeg`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/tonswapleg/)
#### Returns
[Section titled “Returns”](#returns-8)
`boolean` | `Promise`<`boolean`>
***
### validateTonSwapTarget?
[Section titled “validateTonSwapTarget?”](#validatetonswaptarget)
> `optional` **validateTonSwapTarget?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:386
TON↔TON swap settlement: independently confirm that the contract a swap message pays into — directly for native GRAM, as the jetton-transfer destination for jettons — is a DEX contract of a protocol the quote named (e.g. by its code interface on an indexer). Without it, same-chain TON swaps are not advertised.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### input
[Section titled “input”](#input-7)
###### address
[Section titled “address”](#address)
`string`
###### protocols
[Section titled “protocols”](#protocols)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-9)
`boolean` | `Promise`<`boolean`>
# OmnistonQuote
Defined in: protocol-swap2-omniston/src/provider.ts:202
## Properties
[Section titled “Properties”](#properties)
### estimatedGasConsumption?
[Section titled “estimatedGasConsumption?”](#estimatedgasconsumption)
> `optional` **estimatedGasConsumption?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:216
Omniston’s estimate of the gas the route actually burns (swap settlement); the rest of the budget returns.
***
### gasBudget?
[Section titled “gasBudget?”](#gasbudget)
> `optional` **gasBudget?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:214
Total TON the trade needs on top of the input (swap settlement); omitted for gasless quotes.
***
### inputAsset
[Section titled “inputAsset”](#inputasset)
> **inputAsset**: [`AssetId`](/api/anywalletkit/protocol-swap2-omniston/interfaces/assetid/)
Defined in: protocol-swap2-omniston/src/provider.ts:205
***
### inputUnits
[Section titled “inputUnits”](#inputunits)
> **inputUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:207
***
### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
> `optional` **integratorAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:211
***
### integratorFeeUnits?
[Section titled “integratorFeeUnits?”](#integratorfeeunits)
> `optional` **integratorFeeUnits?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:210
***
### outputAsset
[Section titled “outputAsset”](#outputasset)
> **outputAsset**: [`AssetId`](/api/anywalletkit/protocol-swap2-omniston/interfaces/assetid/)
Defined in: protocol-swap2-omniston/src/provider.ts:206
***
### outputUnits
[Section titled “outputUnits”](#outputunits)
> **outputUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:208
***
### protocolFeeUnits?
[Section titled “protocolFeeUnits?”](#protocolfeeunits)
> `optional` **protocolFeeUnits?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:209
***
### quoteId
[Section titled “quoteId”](#quoteid)
> **quoteId**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:204
***
### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp)
> **quoteTimestamp**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:212
***
### rfqId
[Section titled “rfqId”](#rfqid)
> **rfqId**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:203
***
### settlementData
[Section titled “settlementData”](#settlementdata)
> **settlementData**: { `$case`: `"order"`; `value`: [`OrderSettlement`](/api/anywalletkit/protocol-swap2-omniston/interfaces/ordersettlement/); } | { `$case`: `"swap"`; `value`: [`SwapSettlement`](/api/anywalletkit/protocol-swap2-omniston/interfaces/swapsettlement/); }
Defined in: protocol-swap2-omniston/src/provider.ts:217
# OmnistonQuoteStore
Defined in: protocol-swap2-omniston/src/provider.ts:140
Persists the quote/build context between getQuote, buildDeposit and registerSignedOrder. On SERVERLESS these run on different instances, so the default in-memory map strands executions (“quote expired”) — inject a durable store there. Values are JSON-safe (byte fields base64-encoded).
## Methods
[Section titled “Methods”](#methods)
### claim()?
[Section titled “claim()?”](#claim)
> `optional` **claim**(`quoteId`, `valueJson`): `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:150
Save only if nothing is stored under `quoteId` yet, atomically (Redis `SET NX`, a KV conditional put): true when this call wrote it. A quote id is the platform’s choice, so a context must never be overwritten by another user’s quote under the same id (scan 2026-10-27 modules, F27). Without it the provider checks then saves — fine for one process, racy across instances.
#### Parameters
[Section titled “Parameters”](#parameters)
##### quoteId
[Section titled “quoteId”](#quoteid)
`string`
##### valueJson
[Section titled “valueJson”](#valuejson)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean` | `Promise`<`boolean`>
***
### clear()
[Section titled “clear()”](#clear)
> **clear**(`quoteId`): `void` | `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:143
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### quoteId
[Section titled “quoteId”](#quoteid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`void` | `Promise`<`void`>
***
### load()
[Section titled “load()”](#load)
> **load**(`quoteId`): `string` | `Promise`<`string` | `undefined`> | `undefined`
Defined in: protocol-swap2-omniston/src/provider.ts:142
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### quoteId
[Section titled “quoteId”](#quoteid-2)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`string` | `Promise`<`string` | `undefined`> | `undefined`
***
### save()
[Section titled “save()”](#save)
> **save**(`quoteId`, `valueJson`): `void` | `Promise`<`void`>
Defined in: protocol-swap2-omniston/src/provider.ts:141
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### quoteId
[Section titled “quoteId”](#quoteid-3)
`string`
##### valueJson
[Section titled “valueJson”](#valuejson-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`void` | `Promise`<`void`>
# OmnistonSwap2Config
Defined in: protocol-swap2-omniston/src/protocol.ts:7
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:335
WebSocket API URL; defaults to the public ston.fi endpoint.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`apiUrl`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#apiurl)
***
### client?
[Section titled “client?”](#client)
> `optional` **client?**: [`OmnistonClientLike`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonclientlike/)
Defined in: protocol-swap2-omniston/src/provider.ts:333
Injected SDK client (tests); defaults to a lazy `new Omniston({apiUrl})`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`client`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#client)
***
### closeInjectedClient?
[Section titled “closeInjectedClient?”](#closeinjectedclient)
> `optional` **closeInjectedClient?**: `boolean`
Defined in: protocol-swap2-omniston/src/provider.ts:521
Close an injected client when the provider closes (default: caller owns it).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`closeInjectedClient`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#closeinjectedclient)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-omniston/src/provider.ts:347
Explicit constructor configuration; no deployment environment is read.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`enabled`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.fromChain`
***
### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
> `optional` **integratorAddress?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:350
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`integratorAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#integratoraddress)
***
### integratorFeePips?
[Section titled “integratorFeePips?”](#integratorfeepips)
> `optional` **integratorFeePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:351
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`integratorFeePips`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#integratorfeepips)
***
### locateEvmDelivery?
[Section titled “locateEvmDelivery?”](#locateevmdelivery)
> `optional` **locateEvmDelivery?**: (`input`) => `Promise`<`string` | `null`>
Defined in: protocol-swap2-omniston/src/provider.ts:501
EVM destination: find the delivery transaction — the destination escrow’s payout to the recipient — so a completed order carries `destTxHash`. Omniston’s tracking feed names the escrow but not that transaction.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### input
[Section titled “input”](#input)
###### chain
[Section titled “chain”](#chain)
`string`
###### minUnits
[Section titled “minUnits”](#minunits)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress)
`string`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress)
`string`
###### tokenAddress
[Section titled “tokenAddress”](#tokenaddress)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string` | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`locateEvmDelivery`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#locateevmdelivery)
***
### locateTonDelivery?
[Section titled “locateTonDelivery?”](#locatetondelivery)
> `optional` **locateTonDelivery?**: (`input`) => `Promise`<`string` | `null`>
Defined in: protocol-swap2-omniston/src/provider.ts:514
TON destination: find the delivery — the output position’s jetton transfer to the recipient — so a completed EVM → TON order carries `destTxHash` in the form the TON history source uses (tonapi event id). Without it the wallet’s feed cannot pair the TON receive with the swap.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### input
[Section titled “input”](#input-1)
###### jettonMasterAddress
[Section titled “jettonMasterAddress”](#jettonmasteraddress)
`string`
###### minUnits
[Section titled “minUnits”](#minunits-1)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-1)
`string`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`locateTonDelivery`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#locatetondelivery)
***
### maxHtlcExecutions?
[Section titled “maxHtlcExecutions?”](#maxhtlcexecutions)
> `optional` **maxHtlcExecutions?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:341
Maximum number of HTLC execution attempts covered by generated secrets.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`maxHtlcExecutions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#maxhtlcexecutions)
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### maxTonExecutionNano?
[Section titled “maxTonExecutionNano?”](#maxtonexecutionnano)
> `optional` **maxTonExecutionNano?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:343
Hard cap for resolver-requested TON gas/forward value (default: 2 TON).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`maxTonExecutionNano`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#maxtonexecutionnano)
***
### maxUsd?
[Section titled “maxUsd?”](#maxusd)
> `optional` **maxUsd?**: `string` | `number`
Defined in: protocol-swap2-omniston/src/provider.ts:349
Exact decimal USD cap; string form avoids binary-float rounding.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`maxUsd`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#maxusd)
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteSettleMs?
[Section titled “quoteSettleMs?”](#quotesettlems)
> `optional` **quoteSettleMs?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:345
Resolver competition window; primarily useful for deterministic tests.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`quoteSettleMs`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#quotesettlems)
***
### quoteStore?
[Section titled “quoteStore?”](#quotestore)
> `optional` **quoteStore?**: [`OmnistonQuoteStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquotestore/)
Defined in: protocol-swap2-omniston/src/provider.ts:339
Quote/build context persistence; defaults to in-memory (NOT serverless-safe).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`quoteStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#quotestore)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-4)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`Swap2EngineConfig.reviewExecution`
***
### secretStore?
[Section titled “secretStore?”](#secretstore)
> `optional` **secretStore?**: [`HtlcSecretStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/htlcsecretstore/)
Defined in: protocol-swap2-omniston/src/provider.ts:337
HTLC preimage persistence; defaults to in-memory (NOT serverless-safe).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`secretStore`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#secretstore)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`Swap2EngineConfig.tonGasCeiling`
***
### tonSwapPayloadCheck?
[Section titled “tonSwapPayloadCheck?”](#tonswappayloadcheck)
> `optional` **tonSwapPayloadCheck?**: `"report"` | `"enforce"`
Defined in: protocol-swap2-omniston/src/provider.ts:407
TON↔TON swap settlement (scan F11): what a built swap body that fails the decoder (receiver ≠ destination, refund/excess ≠ trader, on-chain minimum below the quote, unknown layout, unverifiable leg) does. “enforce” (default) refuses the build; “report” traces `ton-swap-payload ` and still builds — a rollout escape hatch, not a steady state.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`tonSwapPayloadCheck`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#tonswappayloadcheck)
***
### trace?
[Section titled “trace?”](#trace)
> `optional` **trace?**: (`event`, `details?`) => `void`
Defined in: protocol-swap2-omniston/src/provider.ts:528
Diagnostics: why a poll did not disclose (`disclosure-skipped` with the gate and its fields, `validator-refused`, `validator-threw`) and when it did (`secret-disclosed`). Never carries secrets. Wire it to your logger: a silent “pending” cost a live order its 2-minute window (2026-10-20).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### event
[Section titled “event”](#event)
`string`
##### details?
[Section titled “details?”](#details)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns-5)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`trace`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#trace)
***
### trustedEvmOrderProtocols?
[Section titled “trustedEvmOrderProtocols?”](#trustedevmorderprotocols)
> `optional` **trustedEvmOrderProtocols?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-omniston/src/provider.ts:362
Independently trusted EVM order protocols — the Omniston fork of the 1inch Limit Order Protocol an EVM-source order is signed against and that moves the input token on fill — keyed by CAIP-2 chain. Kept apart from `trustedSettlementContracts` because one address plays different roles on different chains (0xafCF… is the escrow factory on Ethereum and the order protocol on Polygon). EVM→TON is advertised only for chains listed here.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`trustedEvmOrderProtocols`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#trustedevmorderprotocols)
***
### trustedSettlementContracts?
[Section titled “trustedSettlementContracts?”](#trustedsettlementcontracts)
> `optional` **trustedSettlementContracts?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-omniston/src/provider.ts:353
Independently trusted settlement contracts, keyed by CAIP-2 chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`trustedSettlementContracts`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#trustedsettlementcontracts)
***
### validateEvmInputPosition?
[Section titled “validateEvmInputPosition?”](#validateevminputposition)
> `optional` **validateEvmInputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:459
RPC-backed proof of the finalized EVM source position (EVM→TON). The tracking feed only hints at the address; no secret is disclosed until this hook proves — from the trusted factory’s own `SrcEscrowCreated` event, the deterministic escrow address and the escrow’s balances — that the trader’s FULL input is locked for this hashlock under the quoted terms (owner, token, amount, resolver, deposit, timelocks, TON output amount).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### input
[Section titled “input”](#input-2)
###### chain
[Section titled “chain”](#chain-1)
`string`
###### destinationChainId?
[Section titled “destinationChainId?”](#destinationchainid)
`number`
EVM destination only: the escrow event’s destination complement must name this chain, token and deposit.
###### destinationTokenAddress?
[Section titled “destinationTokenAddress?”](#destinationtokenaddress)
`string`
###### dstSecurityDepositUnits?
[Section titled “dstSecurityDepositUnits?”](#dstsecuritydepositunits)
`string`
###### factoryAddress
[Section titled “factoryAddress”](#factoryaddress)
`string`
###### inputTokenAddress
[Section titled “inputTokenAddress”](#inputtokenaddress)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits)
`string`
###### orderProtocolAddress
[Section titled “orderProtocolAddress”](#orderprotocoladdress)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-2)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp)
`number`
###### resolverAddress
[Section titled “resolverAddress”](#resolveraddress)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash)
`Uint8Array`
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateEvmInputPosition`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validateevminputposition)
***
### validateEvmOutputPosition?
[Section titled “validateEvmOutputPosition?”](#validateevmoutputposition)
> `optional` **validateEvmOutputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:431
RPC-backed proof of the destination EVM escrow. The tracking feed is only a discovery hint: no HTLC preimage is disclosed until this hook proves the independently finalized on-chain position matches the signed quote.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### input
[Section titled “input”](#input-3)
###### chain
[Section titled “chain”](#chain-2)
`string`
###### dstSecurityDepositUnits
[Section titled “dstSecurityDepositUnits”](#dstsecuritydepositunits-1)
`string`
###### executionIndex
[Section titled “executionIndex”](#executionindex)
`number`
###### factoryAddress
[Section titled “factoryAddress”](#factoryaddress-1)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-1)
`string`
###### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress-1)
`string`
###### integratorFeeUnits
[Section titled “integratorFeeUnits”](#integratorfeeunits)
`string`
###### outputTokenAddress
[Section titled “outputTokenAddress”](#outputtokenaddress)
`string`
###### outputUnits
[Section titled “outputUnits”](#outputunits)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-3)
`string`
###### protocolFeeRecipientAddress?
[Section titled “protocolFeeRecipientAddress?”](#protocolfeerecipientaddress)
`string`
The quote’s `settlementData.protocolFeeRecipientAddress` (destination chain).
###### protocolFeeUnits
[Section titled “protocolFeeUnits”](#protocolfeeunits)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp-1)
`number`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-2)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-1)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash-1)
`Uint8Array`
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-30)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateEvmOutputPosition`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validateevmoutputposition)
***
### validateTonEscrowPayload?
[Section titled “validateTonEscrowPayload?”](#validatetonescrowpayload)
> `optional` **validateTonEscrowPayload?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:408
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### input
[Section titled “input”](#input-4)
###### destinationAddress
[Section titled “destinationAddress”](#destinationaddress)
`string`
###### destinationChain
[Section titled “destinationChain”](#destinationchain)
`string`
###### exclusivityTimeout
[Section titled “exclusivityTimeout”](#exclusivitytimeout)
`number`
The quote’s `exclusivityTimeout` (seconds) the escrow config must carry.
###### forwardPayloadBocHex
[Section titled “forwardPayloadBocHex”](#forwardpayloadbochex)
`string`
###### hashingFunction?
[Section titled “hashingFunction?”](#hashingfunction)
`string`
###### initialResolverAddress
[Section titled “initialResolverAddress”](#initialresolveraddress)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-2)
`string`
###### outputTokenAddress
[Section titled “outputTokenAddress”](#outputtokenaddress-1)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress-1)
`string`
###### payloadBocHex
[Section titled “payloadBocHex”](#payloadbochex)
`string`
###### protocolAddress
[Section titled “protocolAddress”](#protocoladdress)
`string`
###### quoteId
[Section titled “quoteId”](#quoteid)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-2)
`string`
###### secretHashes
[Section titled “secretHashes”](#secrethashes)
readonly `Uint8Array`<`ArrayBufferLike`>\[]
###### srcHtlcSecurityDepositUnits
[Section titled “srcHtlcSecurityDepositUnits”](#srchtlcsecuritydepositunits-2)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-31)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateTonEscrowPayload`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validatetonescrowpayload)
***
### validateTonJettonWallet?
[Section titled “validateTonJettonWallet?”](#validatetonjettonwallet)
> `optional` **validateTonJettonWallet?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:368
RPC-backed TON jetton-wallet verification. A TON-source order is rejected when this hook is absent or does not prove that `walletAddress` belongs to the quoted jetton master for `ownerAddress`.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### input
[Section titled “input”](#input-5)
###### jettonMasterAddress
[Section titled “jettonMasterAddress”](#jettonmasteraddress-1)
`string`
###### ownerAddress
[Section titled “ownerAddress”](#owneraddress-2)
`string`
###### walletAddress
[Section titled “walletAddress”](#walletaddress)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-32)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateTonJettonWallet`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validatetonjettonwallet)
***
### validateTonOutputPosition?
[Section titled “validateTonOutputPosition?”](#validatetonoutputposition)
> `optional` **validateTonOutputPosition?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:483
Indexer/RPC-backed proof of the TON output position (EVM→TON): deployed by the trusted factory for THIS quote, pinned position/escrow code, hashlock, recipient, amount, security deposit, and a cancellation boundary still far enough away to complete. The tracking feed is only a discovery hint.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### input
[Section titled “input”](#input-6)
###### dstSecurityDepositUnits
[Section titled “dstSecurityDepositUnits”](#dstsecuritydepositunits-2)
`string`
###### inputUnits
[Section titled “inputUnits”](#inputunits-3)
`string`
###### outputJettonMasterAddress
[Section titled “outputJettonMasterAddress”](#outputjettonmasteraddress)
`string`
###### outputUnits
[Section titled “outputUnits”](#outputunits-1)
`string`
###### positionAddress
[Section titled “positionAddress”](#positionaddress-4)
`string`
###### protocolAddress
[Section titled “protocolAddress”](#protocoladdress-1)
`string`
###### quoteId
[Section titled “quoteId”](#quoteid-1)
`string`
###### quoteTimestamp
[Section titled “quoteTimestamp”](#quotetimestamp-2)
`number`
###### recipientAddress
[Section titled “recipientAddress”](#recipientaddress-3)
`string`
###### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits-3)
`string`
###### secretHash
[Section titled “secretHash”](#secrethash-2)
`Uint8Array`
#### Returns
[Section titled “Returns”](#returns-10)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-33)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateTonOutputPosition`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validatetonoutputposition)
***
### validateTonSwapLeg?
[Section titled “validateTonSwapLeg?”](#validatetonswapleg)
> `optional` **validateTonSwapLeg?**: (`leg`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:399
TON↔TON swap settlement (scan F11): confirm one chain fact the decoded swap body depends on — that a STON.fi hop’s ask wallet is its router’s wallet of the quoted output (and, for native input, that the pTON wallet the message pays belongs to that router), or that a DeDust pool trades the quoted pair. `createOmnistonTonValidators` supplies it. Required, with `validateTonSwapTarget`, to advertise same-chain TON swaps (scan 2026-10-30 F8: without it a genuine DEX body can pay out a token other than the quoted one). Only `tonSwapPayloadCheck: "report"` lets a host run without it — each unverified leg is then traced as `ton-swap-payload legs-unverified`; STON.fi v1 native input (pTON v1) is refused regardless.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### leg
[Section titled “leg”](#leg)
[`TonSwapLeg`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/tonswapleg/)
#### Returns
[Section titled “Returns”](#returns-11)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-34)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateTonSwapLeg`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validatetonswapleg)
***
### validateTonSwapTarget?
[Section titled “validateTonSwapTarget?”](#validatetonswaptarget)
> `optional` **validateTonSwapTarget?**: (`input`) => `boolean` | `Promise`<`boolean`>
Defined in: protocol-swap2-omniston/src/provider.ts:386
TON↔TON swap settlement: independently confirm that the contract a swap message pays into — directly for native GRAM, as the jetton-transfer destination for jettons — is a DEX contract of a protocol the quote named (e.g. by its code interface on an indexer). Without it, same-chain TON swaps are not advertised.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### input
[Section titled “input”](#input-7)
###### address
[Section titled “address”](#address)
`string`
###### protocols
[Section titled “protocols”](#protocols)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-12)
`boolean` | `Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-35)
[`OmnistonProviderOptions`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/).[`validateTonSwapTarget`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonprovideroptions/#validatetonswaptarget)
# OrderExecution
Defined in: protocol-swap2-omniston/src/provider.ts:267
## Properties
[Section titled “Properties”](#properties)
### index
[Section titled “index”](#index)
> **index**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:268
***
### inputPositionAddress?
[Section titled “inputPositionAddress?”](#inputpositionaddress)
> `optional` **inputPositionAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:274
***
### inputPositionPhase?
[Section titled “inputPositionPhase?”](#inputpositionphase)
> `optional` **inputPositionPhase?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:273
***
### inputUnits
[Section titled “inputUnits”](#inputunits)
> **inputUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:269
***
### outputPositionAddress?
[Section titled “outputPositionAddress?”](#outputpositionaddress)
> `optional` **outputPositionAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:276
***
### outputPositionPhase?
[Section titled “outputPositionPhase?”](#outputpositionphase)
> `optional` **outputPositionPhase?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:275
***
### outputUnits
[Section titled “outputUnits”](#outputunits)
> **outputUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:270
***
### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits)
> **resolverSendsUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:271
***
### secretHash?
[Section titled “secretHash?”](#secrethash)
> `optional` **secretHash?**: `Uint8Array`<`ArrayBufferLike`>
Defined in: protocol-swap2-omniston/src/provider.ts:272
# OrderSettlement
Defined in: protocol-swap2-omniston/src/provider.ts:221
Order settlement (HTLC / escrow) — the cross-chain branch.
## Properties
[Section titled “Properties”](#properties)
### dstProtocolContractAddress?
[Section titled “dstProtocolContractAddress?”](#dstprotocolcontractaddress)
> `optional` **dstProtocolContractAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:223
***
### dstSecurityDepositUnits?
[Section titled “dstSecurityDepositUnits?”](#dstsecuritydepositunits)
> `optional` **dstSecurityDepositUnits?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:227
***
### exclusivityTimeout?
[Section titled “exclusivityTimeout?”](#exclusivitytimeout)
> `optional` **exclusivityTimeout?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:235
Seconds after the trader creates the position before a resolver must reserve it; after that the position is withdrawable by the trader (SDK docs). The TON escrow config carries it, so the payload validator binds the built escrow to the quoted value.
***
### htlcHashingFunction?
[Section titled “htlcHashingFunction?”](#htlchashingfunction)
> `optional` **htlcHashingFunction?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:236
***
### integratorFeePips?
[Section titled “integratorFeePips?”](#integratorfeepips)
> `optional` **integratorFeePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:239
***
### protocolFeePips?
[Section titled “protocolFeePips?”](#protocolfeepips)
> `optional` **protocolFeePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:238
Fee profile the EVM order extension must mirror (EVM-source orders).
***
### protocolFeeRecipientAddress?
[Section titled “protocolFeeRecipientAddress?”](#protocolfeerecipientaddress)
> `optional` **protocolFeeRecipientAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:242
Destination-chain wallet the protocol fee must be paid to (EVM-destination orders); the EVM output validator binds the escrow’s fee split to it.
***
### resolverSendsUnits
[Section titled “resolverSendsUnits”](#resolversendsunits)
> **resolverSendsUnits**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:225
***
### srcHtlcSecurityDepositUnits?
[Section titled “srcHtlcSecurityDepositUnits?”](#srchtlcsecuritydepositunits)
> `optional` **srcHtlcSecurityDepositUnits?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:226
***
### srcInitialResolverAddress?
[Section titled “srcInitialResolverAddress?”](#srcinitialresolveraddress)
> `optional` **srcInitialResolverAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:224
***
### srcProtocolContractAddress
[Section titled “srcProtocolContractAddress”](#srcprotocolcontractaddress)
> **srcProtocolContractAddress**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:222
***
### tradeStartDeadline
[Section titled “tradeStartDeadline”](#tradestartdeadline)
> **tradeStartDeadline**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:228
# OrderSnapshot
Defined in: protocol-swap2-omniston/src/provider.ts:279
## Properties
[Section titled “Properties”](#properties)
### executions
[Section titled “executions”](#executions)
> **executions**: [`OrderExecution`](/api/anywalletkit/protocol-swap2-omniston/interfaces/orderexecution/)\[]
Defined in: protocol-swap2-omniston/src/provider.ts:281
***
### status
[Section titled “status”](#status)
> **status**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:280
# QuoteRequest
Defined in: protocol-swap2-omniston/src/provider.ts:193
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `object`
Defined in: protocol-swap2-omniston/src/provider.ts:196
#### $case
[Section titled “$case”](#case)
> **$case**: `string`
#### value
[Section titled “value”](#value)
> **value**: `string`
***
### inputAsset
[Section titled “inputAsset”](#inputasset)
> **inputAsset**: [`AssetId`](/api/anywalletkit/protocol-swap2-omniston/interfaces/assetid/)
Defined in: protocol-swap2-omniston/src/provider.ts:194
***
### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
> `optional` **integratorAddress?**: [`ChainAddress`](/api/anywalletkit/protocol-swap2-omniston/interfaces/chainaddress/)
Defined in: protocol-swap2-omniston/src/provider.ts:198
***
### integratorFeePips?
[Section titled “integratorFeePips?”](#integratorfeepips)
> `optional` **integratorFeePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:199
***
### outputAsset
[Section titled “outputAsset”](#outputasset)
> **outputAsset**: [`AssetId`](/api/anywalletkit/protocol-swap2-omniston/interfaces/assetid/)
Defined in: protocol-swap2-omniston/src/provider.ts:195
***
### settlementParams
[Section titled “settlementParams”](#settlementparams)
> **settlementParams**: `object`\[]
Defined in: protocol-swap2-omniston/src/provider.ts:197
#### params
[Section titled “params”](#params)
> **params**: `object`
##### params.$case
[Section titled “params.$case”](#paramscase)
> **$case**: `string`
##### params.value
[Section titled “params.value”](#paramsvalue)
> **value**: `Record`<`string`, `unknown`>
# SwapSettlement
Defined in: protocol-swap2-omniston/src/provider.ts:246
Swap settlement — immediate DEX routes, the TON same-chain branch.
## Properties
[Section titled “Properties”](#properties)
### minOutputAmount
[Section titled “minOutputAmount”](#minoutputamount)
> **minOutputAmount**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:248
***
### priceImpactPips?
[Section titled “priceImpactPips?”](#priceimpactpips)
> `optional` **priceImpactPips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:251
***
### recommendedMinOutputAmount?
[Section titled “recommendedMinOutputAmount?”](#recommendedminoutputamount)
> `optional` **recommendedMinOutputAmount?**: `string`
Defined in: protocol-swap2-omniston/src/provider.ts:249
***
### recommendedSlippagePips?
[Section titled “recommendedSlippagePips?”](#recommendedslippagepips)
> `optional` **recommendedSlippagePips?**: `number`
Defined in: protocol-swap2-omniston/src/provider.ts:250
***
### routes
[Section titled “routes”](#routes)
> **routes**: `object`\[]
Defined in: protocol-swap2-omniston/src/provider.ts:247
#### steps
[Section titled “steps”](#steps)
> **steps**: `object`\[]
# TonSwapCheckInput
Defined in: protocol-swap2-omniston/src/ton-swap.ts:81
## Properties
[Section titled “Properties”](#properties)
### dest
[Section titled “dest”](#dest)
> **dest**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:90
Where the output must land.
***
### inputJetton
[Section titled “inputJetton”](#inputjetton)
> **inputJetton**: `string` | `null`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:94
***
### inputUnits
[Section titled “inputUnits”](#inputunits)
> **inputUnits**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:92
Quote fields the body must honour.
***
### integratorAddress?
[Section titled “integratorAddress?”](#integratoraddress)
> `optional` **integratorAddress?**: `string` | `null`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:98
The integrator the quote was requested with: the only referral a body may name.
***
### minOutputAmount
[Section titled “minOutputAmount”](#minoutputamount)
> **minOutputAmount**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:93
***
### outputJetton
[Section titled “outputJetton”](#outputjetton)
> **outputJetton**: `string` | `null`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:95
***
### payloadHex
[Section titled “payloadHex”](#payloadhex)
> **payloadHex**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:83
The built message’s body (BoC hex) and destination.
***
### sendAmount
[Section titled “sendAmount”](#sendamount)
> **sendAmount**: `bigint`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:86
Value attached to the message, nanoTON.
***
### steps
[Section titled “steps”](#steps)
> **steps**: readonly `object`\[]
Defined in: protocol-swap2-omniston/src/ton-swap.ts:96
***
### targetAddress
[Section titled “targetAddress”](#targetaddress)
> **targetAddress**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:84
***
### trader
[Section titled “trader”](#trader)
> **trader**: `string`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:88
The trader’s wallet (signs; refunds and excesses return to it).
# TonSwapCheckResult
Defined in: protocol-swap2-omniston/src/ton-swap.ts:101
## Properties
[Section titled “Properties”](#properties)
### layout
[Section titled “layout”](#layout)
> **layout**: `"stonfi-v1"` | `"stonfi-v2"` | `"dedust-v1"` | `"dedust-v2"`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:102
***
### legs
[Section titled “legs”](#legs)
> **legs**: [`TonSwapLeg`](/api/anywalletkit/protocol-swap2-omniston/type-aliases/tonswapleg/)\[]
Defined in: protocol-swap2-omniston/src/ton-swap.ts:105
***
### minOut
[Section titled “minOut”](#minout)
> **minOut**: `bigint`
Defined in: protocol-swap2-omniston/src/ton-swap.ts:104
On-chain minimum of the final hop.
# OrderEvent
> **OrderEvent** = { `$case`: `"order"`; `value`: [`OrderSnapshot`](/api/anywalletkit/protocol-swap2-omniston/interfaces/ordersnapshot/); } | { `$case`: `string`; `value?`: `unknown`; }
Defined in: protocol-swap2-omniston/src/provider.ts:284
# RfqEvent
> **RfqEvent** = { `$case`: `"ack"`; `value`: { `rfqId`: `string`; }; } | { `$case`: `"quoteUpdated"`; `rfqId?`: `string`; `value`: [`OmnistonQuote`](/api/anywalletkit/protocol-swap2-omniston/interfaces/omnistonquote/); } | { `$case`: `"noQuote"`; `rfqId?`: `string`; `value`: `unknown`; } | { `$case`: `string`; `value?`: `unknown`; }
Defined in: protocol-swap2-omniston/src/provider.ts:254
# SwapTrackEvent
> **SwapTrackEvent** = { `$case`: `"awaitingTransfer"`; `value?`: `unknown`; } | { `$case`: `"progress"`; `value`: { `outgoingTxHash?`: `string`; `status`: `string`; }; } | { `$case`: `string`; `value?`: `unknown`; }
Defined in: protocol-swap2-omniston/src/provider.ts:286
# TonSwapLeg
> **TonSwapLeg** = { `askWallet`: `string`; `inputJetton`: `string` | `null`; `kind`: `"stonfi-router"`; `outputJetton`: `string` | `null`; `proxyTonWallet?`: `string`; `router`: `string` | `null`; `version`: `1` | `2`; } | { `inputJetton`: `string` | `null`; `kind`: `"dedust-pool"`; `outputJetton`: `string` | `null`; `pool`: `string`; `version`: `1` | `2`; }
Defined in: protocol-swap2-omniston/src/ton-swap.ts:59
A chain fact the payload depends on; checked by `validateTonSwapLeg`. A jetton is named by its master address; `null` is native GRAM.
## Union Members
[Section titled “Union Members”](#union-members)
### Type Literal
[Section titled “Type Literal”](#type-literal)
{ `askWallet`: `string`; `inputJetton`: `string` | `null`; `kind`: `"stonfi-router"`; `outputJetton`: `string` | `null`; `proxyTonWallet?`: `string`; `router`: `string` | `null`; `version`: `1` | `2`; }
#### askWallet
[Section titled “askWallet”](#askwallet)
> **askWallet**: `string`
The router’s wallet the hop asks for — must be the router’s wallet of `outputJetton` (of a proxy-TON master when the output is native).
#### inputJetton
[Section titled “inputJetton”](#inputjetton)
> **inputJetton**: `string` | `null`
#### kind
[Section titled “kind”](#kind)
> **kind**: `"stonfi-router"`
#### outputJetton
[Section titled “outputJetton”](#outputjetton)
> **outputJetton**: `string` | `null`
#### proxyTonWallet?
[Section titled “proxyTonWallet?”](#proxytonwallet)
> `optional` **proxyTonWallet?**: `string`
Native input: the router’s proxy-TON wallet the message pays into.
#### router
[Section titled “router”](#router)
> **router**: `string` | `null`
The router that executes this hop; null = the owner of `proxyTonWallet`.
#### version
[Section titled “version”](#version)
> **version**: `1` | `2`
***
### Type Literal
[Section titled “Type Literal”](#type-literal-1)
{ `inputJetton`: `string` | `null`; `kind`: `"dedust-pool"`; `outputJetton`: `string` | `null`; `pool`: `string`; `version`: `1` | `2`; }
# omniston
> `const` **omniston**: `object`
Defined in: protocol-swap2-omniston/src/config.ts:10
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: () => `boolean`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### integratorAddress
[Section titled “integratorAddress”](#integratoraddress)
> **integratorAddress**: () => `string`
#### Returns
[Section titled “Returns”](#returns-1)
`string`
### integratorFeePips
[Section titled “integratorFeePips”](#integratorfeepips)
> **integratorFeePips**: () => `string`
#### Returns
[Section titled “Returns”](#returns-2)
`string`
### maxUsd
[Section titled “maxUsd”](#maxusd)
> **maxUsd**: () => `number`
Per-swap USD cap — the resolver quotes the corridor up to \~$1000.
#### Returns
[Section titled “Returns”](#returns-3)
`number`
### wsUrl
[Section titled “wsUrl”](#wsurl)
> **wsUrl**: () => `string`
#### Returns
[Section titled “Returns”](#returns-4)
`string`
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`boolean`
# OMNISTON_ESCROWS
> `const` **OMNISTON_ESCROWS**: readonly `string`\[]
Defined in: protocol-swap2-omniston/src/activity.ts:24
Omniston HTLC escrow on TON (Omniston Escrow Minter) — the `srcProtocolContractAddress` of TON→EVM orders.
# OMNISTON_MODULE
> `const` **OMNISTON_MODULE**: `"@anywalletkit/protocol-swap2-omniston"` = `"@anywalletkit/protocol-swap2-omniston"`
Defined in: protocol-swap2-omniston/src/activity.ts:16
# STONFI_ROUTERS
> `const` **STONFI_ROUTERS**: readonly `string`\[]
Defined in: protocol-swap2-omniston/src/activity.ts:19
STON.fi DEX routers (tonapi “STON.fi DEX”; v2.2 observed in the test wallet’s swaps, v1 kept for older history).
# TON_SWAP_PROTOCOL_LAYOUTS
> `const` **TON_SWAP_PROTOCOL_LAYOUTS**: `Readonly`<`Record`<`string`, `"stonfi-v1"` | `"stonfi-v2"` | `"dedust-v1"` | `"dedust-v2"`>>
Defined in: protocol-swap2-omniston/src/ton-swap.ts:50
Omniston’s `SwapChunk.protocol` names and the layout each one builds.
# @anywalletkit/protocol-swap2-router
# @anywalletkit/protocol-swap2-router
[Section titled “@anywalletkit/protocol-swap2-router”](#anywalletkitprotocol-swap2-router)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-router)
The optional swap2 aggregator. Every provider module (`-lifi`, `-near-intents`, `-thorchain`, `-omniston`, `-cctp`, `-uniswap`, `-balancer`, `-wrap`) works on its own; install this package when you want one protocol that auctions a route across the providers **you** pass in. It bundles none.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-router @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-router @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-router @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-router](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-router), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Three ways to offer cross-chain swaps
[Section titled “Three ways to offer cross-chain swaps”](#three-ways-to-offer-cross-chain-swaps)
**1. One protocol, no aggregator.** Install a single provider and use its own protocol class.
```ts
import {LifiSwap2Protocol} from "@anywalletkit/protocol-swap2-lifi";
const swap2 = new LifiSwap2Protocol(account, {fromChain: "eip155:1"});
```
**2. Aggregator picks for the user.** Quotes every provider in parallel, validates each quote the same way and executes the winner.
```ts
import {RouterSwap2Protocol, usdValue} from "@anywalletkit/protocol-swap2-router";
const swap2 = new RouterSwap2Protocol(account, {
fromChain: "eip155:1",
providers: [lifiProvider({}), nearIntentsProvider({}), cctpProvider({rpcUrls})],
valueUsd: usdValue(prices), // optional: rank on net USD (see below)
prefer: "best", // or "fastest"
});
await swap2.swap2({fromToken: "USDC", toToken, toChain: "eip155:8453", fromTokenAmount, minAmountOut});
```
**3. Aggregator with a route picker.** List every route with the best and the fastest tagged, let the user choose, then execute exactly that provider.
```ts
const routes = await swap2.quoteSwap2Routes(options, {
// Called each time another provider answers: show the first price at once,
// a "searching…" hint while `pending` is non-empty.
onUpdate: (routes, pending) => render(routes, pending),
});
// routes[i] = {provider, quote, netValueUsd, relativeValue, tags: ["best"] | ["fastest"] | …}
await swap2.using(picked.provider).swap2({...options, minAmountOut: picked.quote.toTokenAmountMin});
```
The same is available one level down on `CrossChainRouter#getQuotes(params, {onUpdate})`.
## How the winner is chosen
[Section titled “How the winner is chosen”](#how-the-winner-is-chosen)
1. **Value.** With `valueUsd` (e.g. `usdValue(prices, {gasUsd})`) each quote is worth its guaranteed output in USD minus what the route charges on top: a native bridge fee and, when you can say it, the source gas. Without prices for every quote the auction compares guaranteed outputs.
2. **Price first.** Quotes within `tieBand` (default 0.2%) of the best value are the same price.
3. **Speed and reliability inside the tie.** Among equal prices the faster, then the more reliable, route wins (`weights`, default `price:0.6,speed:0.3,reliability:0.1`). A sliver of extra output no longer beats a route that lands twenty times faster; a real price gap still wins.
`fastest` is always the lowest ETA. Every quote passes the engine’s checks before it is ranked, and the executed route is re-validated against its sealed quote before anything is signed.
## Activity
[Section titled “Activity”](#activity)
The router executes through whichever provider wins, so it has no transactions of its own: `describeActivity(tx, ctx)` asks every installed provider in order and returns the first description (null when none claims the transaction, or when the router holds no providers). Each provider package documents what it recognizes (`@anywalletkit/protocol-swap2-lifi` → LI.FI Diamond calls, `-thorchain` → router `depositWithExpiry` / `transferOut`, `-cctp` → burn and claim, `-uniswap` / `-balancer` / `-wrap` → the DEX router / Vault / WETH9 calls, `-omniston` → STON.fi router and Omniston escrow on TON, `-near-intents` → the `intents.near` legs). The conformance fixture here is a public WETH9 deposit recognized by an in-test provider, proving the delegation; the negative is a LI.FI swap no installed provider claims.
## Classes
[Section titled “Classes”](#classes)
* [CrossChainRouter](/api/anywalletkit/protocol-swap2-router/classes/crosschainrouter/)
* [RouterSwap2Protocol](/api/anywalletkit/protocol-swap2-router/classes/routerswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [Asset](/api/anywalletkit/protocol-swap2-router/interfaces/asset/)
* [CrossChainProvider](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
* [IntentRef](/api/anywalletkit/protocol-swap2-router/interfaces/intentref/)
* [IntentStatus](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)
* [Quote](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
* [QuoteParams](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
* [QuoteValue](/api/anywalletkit/protocol-swap2-router/interfaces/quotevalue/)
* [QuoteValueOptions](/api/anywalletkit/protocol-swap2-router/interfaces/quotevalueoptions/)
* [RankedQuote](/api/anywalletkit/protocol-swap2-router/interfaces/rankedquote/)
* [RemotePins](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
* [RemoteProviderOptions](/api/anywalletkit/protocol-swap2-router/interfaces/remoteprovideroptions/)
* [RoutedQuote](/api/anywalletkit/protocol-swap2-router/interfaces/routedquote/)
* [RouterOptions](/api/anywalletkit/protocol-swap2-router/interfaces/routeroptions/)
* [RouterSwap2Config](/api/anywalletkit/protocol-swap2-router/interfaces/routerswap2config/)
* [RouteSet](/api/anywalletkit/protocol-swap2-router/interfaces/routeset/)
* [ScoreWeights](/api/anywalletkit/protocol-swap2-router/interfaces/scoreweights/)
* [Swap2Route](/api/anywalletkit/protocol-swap2-router/interfaces/swap2route/)
* [TxRequest](/api/anywalletkit/protocol-swap2-router/interfaces/txrequest/)
* [UnsignedTx](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [IntentState](/api/anywalletkit/protocol-swap2-router/type-aliases/intentstate/)
* [ValueParams](/api/anywalletkit/protocol-swap2-router/type-aliases/valueparams/)
* [ValueQuote](/api/anywalletkit/protocol-swap2-router/type-aliases/valuequote/)
## Functions
[Section titled “Functions”](#functions)
* [quoteValues](/api/anywalletkit/protocol-swap2-router/functions/quotevalues/)
* [remoteProvider](/api/anywalletkit/protocol-swap2-router/functions/remoteprovider/)
* [usdValue](/api/anywalletkit/protocol-swap2-router/functions/usdvalue/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [RouterSwap2Protocol](/api/anywalletkit/protocol-swap2-router/classes/routerswap2protocol/)
# CrossChainRouter
Defined in: protocol-swap2-router/src/router.ts:99
Routes a cross-chain delivery over pluggable providers: queries all that support the route in parallel (with a timeout so a slow provider can’t block), normalizes their quotes, scores by configurable weights, and returns the best tagged with `routeScore`. A failed/slow provider simply doesn’t participate.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new CrossChainRouter**(`providers`, `options?`): `CrossChainRouter`
Defined in: protocol-swap2-router/src/router.ts:112
#### Parameters
[Section titled “Parameters”](#parameters)
##### providers
[Section titled “providers”](#providers)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)\[]
##### options?
[Section titled “options?”](#options)
`string` | [`RouterOptions`](/api/anywalletkit/protocol-swap2-router/interfaces/routeroptions/)
#### Returns
[Section titled “Returns”](#returns)
`CrossChainRouter`
## Accessors
[Section titled “Accessors”](#accessors)
### lastRejections
[Section titled “lastRejections”](#lastrejections)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **lastRejections**(): readonly `string`\[]
Defined in: protocol-swap2-router/src/router.ts:104
Why providers sat out the last auction, one line each.
##### Returns
[Section titled “Returns”](#returns-1)
readonly `string`\[]
## Methods
[Section titled “Methods”](#methods)
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-router/src/router.ts:350
Release every provider’s resources.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-router/src/router.ts:171
Activity recognition across the installed providers: the first one that claims the transaction describes it. Null when none does (or none is held).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-3)
`ActivityItem` | `null`
***
### getBestQuote()
[Section titled “getBestQuote()”](#getbestquote)
> **getBestQuote**(`params`, `options?`): `Promise`<[`RoutedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/routedquote/) | `null`>
Defined in: protocol-swap2-router/src/router.ts:217
The auction’s pick: the best price (net of native fees and gas when `valueUsd` is set; faster, then more reliable, among equal prices), or the fastest route with `prefer: "fastest"`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
##### options?
[Section titled “options?”](#options-1)
###### prefer?
[Section titled “prefer?”](#prefer)
`"best"` | `"fastest"`
###### requireImmediateExecution?
[Section titled “requireImmediateExecution?”](#requireimmediateexecution)
`boolean`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`RoutedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/routedquote/) | `null`>
***
### getProvider()
[Section titled “getProvider()”](#getprovider)
> **getProvider**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-router/src/router.ts:180
A provider by name.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
***
### getQuotes()
[Section titled “getQuotes()”](#getquotes)
> **getQuotes**(`params`, `options?`): `Promise`<[`RouteSet`](/api/anywalletkit/protocol-swap2-router/interfaces/routeset/) | `null`>
Defined in: protocol-swap2-router/src/router.ts:248
Every validated route, ranked — for a route picker that shows the best and the fastest and lets the user choose. Providers run in parallel; with `onUpdate` each one that answers re-publishes the ranked set at once (the first price shows in the time of the fastest venue, not the slowest).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### params
[Section titled “params”](#params-1)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
##### options?
[Section titled “options?”](#options-2)
###### onUpdate?
[Section titled “onUpdate?”](#onupdate)
(`set`) => `void`
###### requireImmediateExecution?
[Section titled “requireImmediateExecution?”](#requireimmediateexecution-1)
`boolean`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`RouteSet`](/api/anywalletkit/protocol-swap2-router/interfaces/routeset/) | `null`>
***
### hasEnabledProvider()
[Section titled “hasEnabledProvider()”](#hasenabledprovider)
> **hasEnabledProvider**(`name`): `boolean`
Defined in: protocol-swap2-router/src/router.ts:190
True when that provider is installed and enabled.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### name
[Section titled “name”](#name-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`boolean`
***
### hasProvider()
[Section titled “hasProvider()”](#hasprovider)
> **hasProvider**(`name`): `boolean`
Defined in: protocol-swap2-router/src/router.ts:185
True when a provider of that name is installed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### name
[Section titled “name”](#name-2)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`boolean`
***
### notifyDeposit()
[Section titled “notifyDeposit()”](#notifydeposit)
> **notifyDeposit**(`providerName`, `intentId`, `txHash`): `Promise`<`void`>
Defined in: protocol-swap2-router/src/router.ts:345
Forward a source-broadcast notification to the intent’s provider.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### providerName
[Section titled “providerName”](#providername)
`string`
##### intentId
[Section titled “intentId”](#intentid)
`string`
##### txHash
[Section titled “txHash”](#txhash)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`void`>
***
### only()
[Section titled “only()”](#only)
> **only**(`name`): `CrossChainRouter`
Defined in: protocol-swap2-router/src/router.ts:161
The same auction restricted to one provider — to execute the route a user picked.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### name
[Section titled “name”](#name-3)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`CrossChainRouter`
***
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`caip2`): `boolean`
Defined in: protocol-swap2-router/src/router.ts:197
True when any enabled provider declares the chain.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`boolean`
***
### supportsChainPair()
[Section titled “supportsChainPair()”](#supportschainpair)
> **supportsChainPair**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-router/src/router.ts:204
True when any enabled provider declares the chain pair.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### fromChain
[Section titled “fromChain”](#fromchain)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
***
### trackIntent()
[Section titled “trackIntent()”](#trackintent)
> **trackIntent**(`providerName`, `ref`): `Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
Defined in: protocol-swap2-router/src/router.ts:338
Status from the named provider; `failed` when it is not installed.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### providerName
[Section titled “providerName”](#providername-1)
`string`
##### ref
[Section titled “ref”](#ref)
[`IntentRef`](/api/anywalletkit/protocol-swap2-router/interfaces/intentref/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
# RouterSwap2Protocol
Defined in: protocol-swap2-router/src/swap2/router.ts:77
A swap2 protocol that asks every installed provider in parallel, checks each quote the same way, and executes the chosen route. Pass exactly one of `providers` or `router`.
```ts
const swap2 = new RouterSwap2Protocol(account, {
fromChain: 'eip155:1',
providers: [lifiProvider(), nearIntentsProvider(), cctpProvider()],
})
const quote = await swap2.quoteSwap2({ fromToken: 'USDC', toToken: 'USDC', toChain: 'eip155:8453', fromTokenAmount: 100_000_000n })
```
## Extends
[Section titled “Extends”](#extends)
* `BaseSwap2Protocol`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new RouterSwap2Protocol**(`account`, `config`): `RouterSwap2Protocol`
Defined in: protocol-swap2-router/src/swap2/router.ts:82
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`RouterSwap2Config`](/api/anywalletkit/protocol-swap2-router/interfaces/routerswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`RouterSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`BaseSwap2Protocol.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`BaseSwap2Protocol._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`BaseSwap2Protocol._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`BaseSwap2Protocol.fromChain`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`BaseSwap2Protocol.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`BaseSwap2Protocol.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`BaseSwap2Protocol.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`BaseSwap2Protocol.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-router/src/swap2/router.ts:142
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-1)
`BaseSwap2Protocol.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`BaseSwap2Protocol.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-router/src/swap2/router.ts:151
Release the providers’ resources (timers, sockets).
#### Returns
[Section titled “Returns”](#returns-7)
`void`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-router/src/swap2/router.ts:138
Delegates to every provider the router holds (first match wins); null with no providers.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`BaseSwap2Protocol.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`BaseSwap2Protocol.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`BaseSwap2Protocol.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`BaseSwap2Protocol.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`BaseSwap2Protocol.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-router/src/swap2/router.ts:129
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`BaseSwap2Protocol.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-router/src/swap2/router.ts:146
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-4)
`BaseSwap2Protocol.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`BaseSwap2Protocol.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:230
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`BaseSwap2Protocol.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-router/src/swap2/router.ts:133
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Overrides
[Section titled “Overrides”](#overrides-5)
`BaseSwap2Protocol.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`BaseSwap2Protocol.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`BaseSwap2Protocol.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`BaseSwap2Protocol.quoteSwap2`
***
### quoteSwap2Routes()
[Section titled “quoteSwap2Routes()”](#quoteswap2routes)
> **quoteSwap2Routes**(`options`, `opts?`): `Promise`<[`Swap2Route`](/api/anywalletkit/protocol-swap2-router/interfaces/swap2route/)\[]>
Defined in: protocol-swap2-router/src/swap2/router.ts:110
Every route for a picker, ranked, with the best and the fastest tagged. `onUpdate` gets the ranked list each time another provider answers, so a UI shows the first price as soon as the fastest venue replies. Routes the caller’s floor or fee caps refuse are left out. Execute the one the user picks with `using(route.provider).swap2(...)`.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
##### opts?
[Section titled “opts?”](#opts)
###### onUpdate?
[Section titled “onUpdate?”](#onupdate)
(`routes`, `pending`) => `void`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`Swap2Route`](/api/anywalletkit/protocol-swap2-router/interfaces/swap2route/)\[]>
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`BaseSwap2Protocol.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-router/src/swap2/router.ts:99
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Overrides
[Section titled “Overrides”](#overrides-6)
`BaseSwap2Protocol.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`BaseSwap2Protocol.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`BaseSwap2Protocol.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-26)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`BaseSwap2Protocol.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`BaseSwap2Protocol.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-28)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`BaseSwap2Protocol.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-29)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`BaseSwap2Protocol.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-13)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-30)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`BaseSwap2Protocol.toQuote`
***
### using()
[Section titled “using()”](#using)
> **using**(`provider`): `RouterSwap2Protocol`
Defined in: protocol-swap2-router/src/swap2/router.ts:124
This protocol pinned to one provider — the route a user picked from `quoteSwap2Routes`.
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### provider
[Section titled “provider”](#provider)
`string`
#### Returns
[Section titled “Returns”](#returns-31)
`RouterSwap2Protocol`
# quoteValues
> **quoteValues**(`prices`, `params`, `quotes`, `options?`): [`QuoteValue`](/api/anywalletkit/protocol-swap2-router/interfaces/quotevalue/)\[]
Defined in: protocol-swap2-router/src/value.ts:100
USD in / out / loss for every quote of one request, and the better alternative inside the set. Prices are the caller’s current spot prices (symbol → USD). The owner’s rule (2026-10-16): the wallet shows this and says “be careful”; it never blocks — the Oct 16 funded run lost \~$33 on two Uniswap legs that nothing compared to the other venues’ quotes.
## Parameters
[Section titled “Parameters”](#parameters)
### prices
[Section titled “prices”](#prices)
`Readonly`<`Record`<`string`, `number`>>
### params
[Section titled “params”](#params)
[`ValueParams`](/api/anywalletkit/protocol-swap2-router/type-aliases/valueparams/)
### quotes
[Section titled “quotes”](#quotes)
readonly [`ValueQuote`](/api/anywalletkit/protocol-swap2-router/type-aliases/valuequote/)\[]
### options?
[Section titled “options?”](#options)
[`QuoteValueOptions`](/api/anywalletkit/protocol-swap2-router/interfaces/quotevalueoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`QuoteValue`](/api/anywalletkit/protocol-swap2-router/interfaces/quotevalue/)\[]
# remoteProvider
> **remoteProvider**(`opts`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-core/dist/remote.d.ts:90
A provider that runs on your server: quotes, deposits and tracking go to `baseUrl`, so API keys and affiliate settings never ship in the app. The engine still validates every quote and transaction locally before signing.
## Parameters
[Section titled “Parameters”](#parameters)
### opts
[Section titled “opts”](#opts)
[`RemoteProviderOptions`](/api/anywalletkit/protocol-swap2-router/interfaces/remoteprovideroptions/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# usdValue
> **usdValue**(`prices`, `options?`): (`quote`, `params`) => `number` | `null`
Defined in: protocol-swap2-router/src/value.ts:27
A `valueUsd` for the router: the guaranteed output in USD, minus the native fee the route charges on top of the input (bridge messaging fees), minus the source gas when `gasUsd` can say it. null when a needed price is missing — the auction then falls back to comparing guaranteed outputs.
## Parameters
[Section titled “Parameters”](#parameters)
### prices
[Section titled “prices”](#prices)
`Readonly`<`Record`<`string`, `number`>>
### options?
[Section titled “options?”](#options)
#### gasUsd?
[Section titled “gasUsd?”](#gasusd)
(`quote`, `params`) => `number` | `null`
## Returns
[Section titled “Returns”](#returns)
(`quote`, `params`) => `number` | `null`
# Asset
Defined in: protocol-swap2-core/dist/types.d.ts:10
A token on a chain, as providers see it.
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:11
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:12
# CrossChainProvider
Defined in: protocol-swap2-core/dist/types.d.ts:217
Pluggable cross-chain provider. Adding a provider is “add a module”; the rest of the app references only this interface (never a specific provider).
## Properties
[Section titled “Properties”](#properties)
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `readonly` `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:276
Set by `remoteProvider` when the app opted in (`depositAddressRoutes`): this stub may send the input to an address its backend names. Without it the engine refuses a remote stub’s deposit-address and plain-value builds.
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:219
Provider name, unique in a router.
***
### remote?
[Section titled “remote?”](#remote)
> `readonly` `optional` **remote?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:264
Set by `remoteProvider`: the quotes and builds come from a backend, not from code the app ships. The engine then takes the addresses an EVM transaction may call or approve only from [callTargets](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/#calltargets) / [spenders](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/#spenders) — the app’s pins — and refuses a calldata route or an approval it has no pin for (scan 2026-10-27 modules, F8/F9/F16).
***
### supportsSameChain?
[Section titled “supportsSameChain?”](#supportssamechain)
> `optional` **supportsSameChain?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:287
Explicit opt-in: provider can execute a same-chain swap.
***
### verifiesBuilds?
[Section titled “verifiesBuilds?”](#verifiesbuilds)
> `readonly` `optional` **verifiesBuilds?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:266
Set by `remoteProvider` when the app gave it `verifyBuild`: its builds are checked on the client.
***
### verifiesQuotes?
[Section titled “verifiesQuotes?”](#verifiesquotes)
> `readonly` `optional` **verifiesQuotes?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:271
Set by `remoteProvider` when the app gave it `verifyQuote`: its quotes’ transactions are checked on the client. A remote stub’s EVM calldata route needs this or [verifiesBuilds](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/#verifiesbuilds) (scan 2026-10-30, F3).
## Methods
[Section titled “Methods”](#methods)
### buildClaim()?
[Section titled “buildClaim()?”](#buildclaim)
> `optional` **buildClaim**(`ref`): `Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/) | `null`>
Defined in: protocol-swap2-core/dist/types.d.ts:250
Two-phase routes: the destination-chain transaction that completes the delivery (CCTP `receiveMessage(message, attestation)`), or `null` while the attestation is not available yet. The engine executes it through a destination-chain account (`claimSwap2`); `tx.chain` names that chain.
#### Parameters
[Section titled “Parameters”](#parameters)
##### ref
[Section titled “ref”](#ref)
[`IntentRef`](/api/anywalletkit/protocol-swap2-router/interfaces/intentref/)
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/) | `null`>
***
### buildDeposit()
[Section titled “buildDeposit()”](#builddeposit)
> **buildDeposit**(`quote`): `Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)>
Defined in: protocol-swap2-core/dist/types.d.ts:227
The source-leg transaction for a quote.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)>
***
### callTargets()?
[Section titled “callTargets()?”](#calltargets)
> `optional` **callTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:278
Remote stubs: the contracts this provider’s EVM swaps may call on `chain` (the app’s list, e.g. `lifiPins`).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
readonly `string`\[]
***
### claimTargets()?
[Section titled “claimTargets()?”](#claimtargets)
> `optional` **claimTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:257
The contracts a claim from [buildClaim](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/#buildclaim) may call on `chain` (CAIP-2) — CCTP’s MessageTransmitter. `claimSwap2` refuses a claim to anything else, and a provider with a claim step must declare them (round 3, M24). Kept on the client: for a remote provider this is the app’s list, never the server’s.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
readonly `string`\[]
***
### close()?
[Section titled “close()?”](#close)
> `optional` **close**(): `void`
Defined in: protocol-swap2-core/dist/types.d.ts:281
#### Returns
[Section titled “Returns”](#returns-4)
`void`
***
### describeActivity()?
[Section titled “describeActivity()?”](#describeactivity)
> `optional` **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:295
Recognize one of this provider’s own transactions in an address’s history (contract + selector on EVM, settlement counterparty elsewhere) and describe it for the activity feed; null when it is not this provider’s. Pure and synchronous. The single-provider protocol classes and the router delegate `describeActivity` here.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-5)
`ActivityItem` | `null`
***
### enabled()
[Section titled “enabled()”](#enabled)
> **enabled**(): `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:221
Master flag — providers ship “dark” (off) until validated with real funds.
#### Returns
[Section titled “Returns”](#returns-6)
`boolean`
***
### getQuote()
[Section titled “getQuote()”](#getquote)
> **getQuote**(`params`, `signal?`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/types.d.ts:225
A quote, or `null` with the reason passed to `params.onRefusal`.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
##### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
***
### notifyDeposit()?
[Section titled “notifyDeposit()?”](#notifydeposit)
> `optional` **notifyDeposit**(`intentId`, `txHash`): `Promise`<`void`>
Defined in: protocol-swap2-core/dist/types.d.ts:241
Tell the provider the source funds were sent (tx hash / BoC). Required for NEAR Intents TON deposits — the HOT-bridge oracle can’t observe SIMPLE-mode deposits on uninitialized addresses without it. Best-effort elsewhere.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### intentId
[Section titled “intentId”](#intentid)
`string`
##### txHash
[Section titled “txHash”](#txhash)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`void`>
***
### preflightDeposit()?
[Section titled “preflightDeposit()?”](#preflightdeposit)
> `optional` **preflightDeposit**(`quote`, `tx`): `Promise`<`void`>
Defined in: protocol-swap2-core/dist/types.d.ts:233
Last fail-closed check after any approval and immediately before the wallet signs/broadcasts the source leg. Providers whose execution target can rotate or halt (THORChain vaults/routers) must revalidate it here.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### tx
[Section titled “tx”](#tx-1)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`void`>
***
### registerSignedOrder()?
[Section titled “registerSignedOrder()?”](#registersignedorder)
> `optional` **registerSignedOrder**(`intentId`, `signature`): `Promise`<`void`>
Defined in: protocol-swap2-core/dist/types.d.ts:243
Gasless typed-order providers: register the wallet’s EIP-712 signature.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### intentId
[Section titled “intentId”](#intentid-1)
`string`
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`void`>
***
### spenders()?
[Section titled “spenders()?”](#spenders)
> `optional` **spenders**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:280
Remote stubs: the spenders this provider’s EVM swaps may be approved for on `chain` (the app’s list).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### chain
[Section titled “chain”](#chain-2)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
readonly `string`\[]
***
### supportsChain()?
[Section titled “supportsChain()?”](#supportschain)
> `optional` **supportsChain**(`caip2`): `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:283
Optional discovery hook for custom providers.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
***
### supportsChainPair()?
[Section titled “supportsChainPair()?”](#supportschainpair)
> `optional` **supportsChainPair**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:285
Optional pair-level discovery for aggregators.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
***
### supportsRoute()
[Section titled “supportsRoute()”](#supportsroute)
> **supportsRoute**(`from`, `to`): `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:223
Cheap synchronous check: can this provider route `from` to `to`? No I/O.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### from
[Section titled “from”](#from)
[`Asset`](/api/anywalletkit/protocol-swap2-router/interfaces/asset/)
##### to
[Section titled “to”](#to)
[`Asset`](/api/anywalletkit/protocol-swap2-router/interfaces/asset/)
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
***
### trackIntent()
[Section titled “trackIntent()”](#trackintent)
> **trackIntent**(`ref`): `Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
Defined in: protocol-swap2-core/dist/types.d.ts:235
Current status of a swap.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### ref
[Section titled “ref”](#ref-1)
[`IntentRef`](/api/anywalletkit/protocol-swap2-router/interfaces/intentref/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`IntentStatus`](/api/anywalletkit/protocol-swap2-router/interfaces/intentstatus/)>
# IntentRef
Defined in: protocol-swap2-core/dist/types.d.ts:103
What trackIntent gets to work with (LI.FI tracks by the source tx hash).
## Properties
[Section titled “Properties”](#properties)
### destTxHash?
[Section titled “destTxHash?”](#desttxhash)
> `optional` **destTxHash?**: `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:107
Two-phase routes: the destination-chain claim transaction, once sent.
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:104
***
### sourceTxHash?
[Section titled “sourceTxHash?”](#sourcetxhash)
> `optional` **sourceTxHash?**: `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:105
# IntentStatus
Defined in: protocol-swap2-core/dist/types.d.ts:134
A provider’s answer to `trackIntent`.
## Properties
[Section titled “Properties”](#properties)
### claim?
[Section titled “claim?”](#claim)
> `optional` **claim?**: `object`
Defined in: protocol-swap2-core/dist/types.d.ts:145
Two-phase routes (CCTP-style burn-and-mint): the delivery needs a second, user-signed transaction on the destination chain. `ready` means the provider can build it now (`buildClaim`); `state` is then “action-required”. Before that the route is “pending” with `ready: false`.
#### chain
[Section titled “chain”](#chain)
> **chain**: `string`
#### ready
[Section titled “ready”](#ready)
> **ready**: `boolean`
***
### depositReceived?
[Section titled “depositReceived?”](#depositreceived)
> `optional` **depositReceived?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:137
Still pending, but the source deposit has been observed (PROCESSING).
***
### destTxHash?
[Section titled “destTxHash?”](#desttxhash)
> `optional` **destTxHash?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:138
***
### state
[Section titled “state”](#state)
> **state**: [`IntentState`](/api/anywalletkit/protocol-swap2-router/type-aliases/intentstate/)
Defined in: protocol-swap2-core/dist/types.d.ts:135
# Quote
Defined in: protocol-swap2-core/dist/types.d.ts:72
A normalized quote from one provider.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`RankedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/rankedquote/)
* [`RoutedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/routedquote/)
## Properties
[Section titled “Properties”](#properties)
### depositAddress
[Section titled “depositAddress”](#depositaddress)
> **depositAddress**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:77
***
### depositMemo
[Section titled “depositMemo”](#depositmemo)
> **depositMemo**: `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:78
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:82
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:94
Estimated time to delivery.
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `object`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:86
Honest itemized fees when the provider exposes base-unit amounts.
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
#### included
[Section titled “included”](#included)
> **included**: `boolean`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"protocol"` | `"network"` | `"affiliate"` | `"other"`
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:84
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:76
Provider’s id for this swap; tracked with `trackIntent`.
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:83
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:74
Provider name.
***
### providerData?
[Section titled “providerData?”](#providerdata)
> `optional` **providerData?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/dist/types.d.ts:100
Provider-owned, JSON-safe facts required to revalidate execution.
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:96
Provider’s reliability hint, 0 to 1.
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:81
***
### txRequest?
[Section titled “txRequest?”](#txrequest)
> `optional` **txRequest?**: [`TxRequest`](/api/anywalletkit/protocol-swap2-router/interfaces/txrequest/)
Defined in: protocol-swap2-core/dist/types.d.ts:80
Present instead of a usable depositAddress for calldata providers.
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:98
Quote expiry, unix milliseconds.
# QuoteParams
Defined in: protocol-swap2-core/dist/types.d.ts:15
What the engine asks a provider to quote. Amounts are base-unit strings; exact input only.
## Properties
[Section titled “Properties”](#properties)
### amountIn
[Section titled “amountIn”](#amountin)
> **amountIn**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:30
***
### destAddress
[Section titled “destAddress”](#destaddress)
> **destAddress**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:35
***
### destChain
[Section titled “destChain”](#destchain)
> **destChain**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:28
***
### destToken
[Section titled “destToken”](#desttoken)
> **destToken**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:29
***
### dry?
[Section titled “dry?”](#dry)
> `optional` **dry?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:39
Pricing preview only — no deposit address is created upstream.
***
### flex?
[Section titled “flex?”](#flex)
> `optional` **flex?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:45
Amount-flexible deposit (exchange flow): `amountIn` is only a pricing notional — the user may send any amount to the deposit address (1Click FLEX_INPUT). Providers that can’t do this return no quote.
***
### minAmountOut?
[Section titled “minAmountOut?”](#minamountout)
> `optional` **minAmountOut?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:32
Caller-supplied output floor in destination base units.
***
### onRefusal?
[Section titled “onRefusal?”](#onrefusal)
> `optional` **onRefusal?**: (`reason`) => `void`
Defined in: protocol-swap2-core/dist/types.d.ts:19
Local-only (never serialized): called with the reason when the provider refuses to quote — a shared-instance “last refusal” field raced under concurrent quotes, so the reason rides per-call.
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### refundAddress?
[Section titled “refundAddress?”](#refundaddress)
> `optional` **refundAddress?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:37
Where a failed swap refunds on the source chain (the sender’s address).
***
### slippageBps?
[Section titled “slippageBps?”](#slippagebps)
> `optional` **slippageBps?**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:34
Maximum slippage accepted by the caller, expressed in basis points.
***
### sourceChain
[Section titled “sourceChain”](#sourcechain)
> **sourceChain**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:20
***
### sourceDecimals?
[Section titled “sourceDecimals?”](#sourcedecimals)
> `optional` **sourceDecimals?**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:27
Set only for a source token the catalog does not list: `sourceToken` is then its contract (EVM) or mint (Solana) and this its decimals. Providers that can trade any token resolve it with `resolveAsset(chain, sourceToken, {allowUnlisted: true, decimals})`; the others refuse it.
***
### sourceToken
[Section titled “sourceToken”](#sourcetoken)
> **sourceToken**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:21
# QuoteValue
Defined in: protocol-swap2-router/src/value.ts:61
A quote’s value in USD: what the user pays, what arrives, the loss, and a better alternative when one exists. Use it to warn before a bad-value swap.
## Properties
[Section titled “Properties”](#properties)
### betterAlternative?
[Section titled “betterAlternative?”](#betteralternative)
> `optional` **betterAlternative?**: `object`
Defined in: protocol-swap2-router/src/value.ts:71
Another provider in the same set that delivers more than `betterByPct` more. Every quote of a request pays out the same destination token, so the comparison is by delivered USD when priced and by raw `destAmount` otherwise.
#### byPct
[Section titled “byPct”](#bypct)
> **byPct**: `number`
#### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
#### provider
[Section titled “provider”](#provider)
> **provider**: `string`
#### valueUsdOut
[Section titled “valueUsdOut”](#valueusdout)
> **valueUsdOut**: `number` | `null`
***
### lossPct
[Section titled “lossPct”](#losspct)
> **lossPct**: `number` | `null`
Defined in: protocol-swap2-router/src/value.ts:68
(in − out) / in × 100. Positive = the user receives less value than they pay. null when either side is unpriced.
***
### priceImpactBps?
[Section titled “priceImpactBps?”](#priceimpactbps)
> `optional` **priceImpactBps?**: `number`
Defined in: protocol-swap2-router/src/value.ts:73
The venue’s own price impact in basis points (`providerData.priceImpactBps`), when it measures one.
***
### provider
[Section titled “provider”](#provider-1)
> **provider**: `string`
Defined in: protocol-swap2-router/src/value.ts:62
***
### valueUsdIn
[Section titled “valueUsdIn”](#valueusdin)
> **valueUsdIn**: `number` | `null`
Defined in: protocol-swap2-router/src/value.ts:64
USD the user pays: the source amount at the current price. null when unpriced.
***
### valueUsdOut
[Section titled “valueUsdOut”](#valueusdout-1)
> **valueUsdOut**: `number` | `null`
Defined in: protocol-swap2-router/src/value.ts:66
USD the quote delivers: the expected `destAmount` at the current price, minus a native fee paid on top. null when unpriced.
# QuoteValueOptions
Defined in: protocol-swap2-router/src/value.ts:77
Options for quote valuation.
## Properties
[Section titled “Properties”](#properties)
### betterByPct?
[Section titled “betterByPct?”](#betterbypct)
> `optional` **betterByPct?**: `number`
Defined in: protocol-swap2-router/src/value.ts:79
How much more (percent of this quote’s value) another provider must deliver to be named as the better alternative. Default 2.
# RankedQuote
Defined in: protocol-swap2-router/src/router.ts:41
A validated quote with its place in the auction.
## Extends
[Section titled “Extends”](#extends)
* [`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Properties
[Section titled “Properties”](#properties)
### depositAddress
[Section titled “depositAddress”](#depositaddress)
> **depositAddress**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:77
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`depositAddress`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#depositaddress)
***
### depositMemo
[Section titled “depositMemo”](#depositmemo)
> **depositMemo**: `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:78
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`depositMemo`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#depositmemo)
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:82
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`destAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#destamount)
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:94
Estimated time to delivery.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`etaSeconds`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#etaseconds)
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `object`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:86
Honest itemized fees when the provider exposes base-unit amounts.
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
#### included
[Section titled “included”](#included)
> **included**: `boolean`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"protocol"` | `"network"` | `"affiliate"` | `"other"`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`fees`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#fees)
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:84
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`feeUsd`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#feeusd)
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:76
Provider’s id for this swap; tracked with `trackIntent`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`intentId`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#intentid)
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:83
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`minDestAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#mindestamount)
***
### netValueUsd
[Section titled “netValueUsd”](#netvalueusd)
> **netValueUsd**: `number` | `null`
Defined in: protocol-swap2-router/src/router.ts:43
Net USD value (`valueUsd`), or null when the auction compared raw outputs.
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:74
Provider name.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`provider`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#provider)
***
### providerData?
[Section titled “providerData?”](#providerdata)
> `optional` **providerData?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/dist/types.d.ts:100
Provider-owned, JSON-safe facts required to revalidate execution.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`providerData`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#providerdata)
***
### relativeValue
[Section titled “relativeValue”](#relativevalue)
> **relativeValue**: `number`
Defined in: protocol-swap2-router/src/router.ts:45
This quote’s value against the best one, 0..1 (1 = the best price).
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:96
Provider’s reliability hint, 0 to 1.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`reliability`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#reliability)
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:81
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`sourceAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#sourceamount)
***
### tags
[Section titled “tags”](#tags)
> **tags**: (`"best"` | `"fastest"`)\[]
Defined in: protocol-swap2-router/src/router.ts:47
“best”: the pick (best price; faster/more reliable among equal prices). “fastest”: the lowest ETA.
***
### txRequest?
[Section titled “txRequest?”](#txrequest)
> `optional` **txRequest?**: [`TxRequest`](/api/anywalletkit/protocol-swap2-router/interfaces/txrequest/)
Defined in: protocol-swap2-core/dist/types.d.ts:80
Present instead of a usable depositAddress for calldata providers.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`txRequest`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#txrequest)
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:98
Quote expiry, unix milliseconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`validUntilMs`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#validuntilms)
# RemotePins
Defined in: protocol-swap2-core/dist/types.d.ts:195
The contracts a provider’s EVM swaps call and approve on a chain, shipped by the provider package (`lifiPins`, `fyndPins`, `uniswapPins`…) and handed to `remoteProvider({...pins})`: a backend’s build is checked against the app’s addresses, never against its own (scan 2026-10-27 modules, F8/F9/F16). An empty list means the provider has no EVM calldata route on that chain.
## Properties
[Section titled “Properties”](#properties)
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/dist/types.d.ts:211
The provider’s routes pay an address the backend names — a deposit address, or a plain value send — instead of calling a pinned contract (`thorchainPins` for a Tron vault, NEAR Intents’ per-quote deposit addresses). Without it a remote stub’s deposit-address and plain-value routes are refused (scan 2026-10-28, F9).
## Methods
[Section titled “Methods”](#methods)
### callTargets()
[Section titled “callTargets()”](#calltargets)
> **callTargets**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:196
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
***
### spenders()
[Section titled “spenders()”](#spenders)
> **spenders**(`chain`): readonly `string`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:197
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
readonly `string`\[]
***
### verifyBuild()?
[Section titled “verifyBuild()?”](#verifybuild)
> `optional` **verifyBuild**(`quote`, `tx`, `params?`): `string` | `Promise`<`string` | `null`> | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:205
A client-side check of a remote build (typed order, cell body) against its quote: the reason it fails, or null.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### tx
[Section titled “tx”](#tx)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)
##### params?
[Section titled “params?”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-2)
`string` | `Promise`<`string` | `null`> | `null`
***
### verifyQuote()?
[Section titled “verifyQuote()?”](#verifyquote)
> `optional` **verifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:203
A client-side check of a remote quote’s transaction against the user’s own request — the provider’s local validator run again on this side (Fynd: `checkFyndTransaction`): the reason it fails, or null.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### params
[Section titled “params”](#params-1)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-3)
`string` | `null`
# RemoteProviderOptions
Defined in: protocol-swap2-core/dist/remote.d.ts:26
HTTP-proxied `CrossChainProvider`: forwards every provider call to a backend that runs the real provider. This is how a BROWSER context (e.g. a wallet’s signing worker) executes the full swap2 layer — account binding, approvals, cell-body guards, id/status lifecycle — while provider secrets (API JWTs, affiliate config) and non-CORS REST endpoints stay server-side.
Wire protocol: POST {baseUrl}/{action} with a JSON body, one action per provider method: quote {provider, params: QuoteParams} → Quote | null build {provider, quote: Quote} → UnsignedTx preflight {provider, quote: Quote, tx: UnsignedTx} → {} track {provider, ref: IntentRef} → IntentStatus notify {provider, intentId, txHash} → {} register {provider, intentId, signature} → {} claim {provider, ref: IntentRef} → UnsignedTx | null supports {provider, from, to} → {supported: boolean}
`supportsRoute`/`enabled` need a SYNC answer, so they are config: pass the routes the backend advertises via `supports`, or leave the default allow-and-let-quote-decide behavior (a null quote is a clean miss).
## Properties
[Section titled “Properties”](#properties)
### allowInsecureBaseUrl?
[Section titled “allowInsecureBaseUrl?”](#allowinsecurebaseurl)
> `optional` **allowInsecureBaseUrl?**: `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:77
Allow a non-https absolute `baseUrl` (local development only). Quotes, builds and typed orders travel this channel; over plain http anyone on the path can rewrite them (scan 2026-10-27 modules, F4).
***
### baseUrl
[Section titled “baseUrl”](#baseurl)
> **baseUrl**: `string`
Defined in: protocol-swap2-core/dist/remote.d.ts:30
Endpoint prefix, e.g. “/api/v2/swap2” (same-origin) or absolute URL.
***
### callTargets?
[Section titled “callTargets?”](#calltargets)
> `optional` **callTargets?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/dist/remote.d.ts:53
The contracts this provider’s EVM swaps may call, and the spenders they may be approved for, per chain — the provider package’s pins (`lifiPins`, `fyndPins`, `uniswapPins`…, spread into these options). The app’s lists, not the server’s: without them the engine refuses this stub’s EVM calldata routes and approvals, so a compromised backend cannot name its own contract or spender (scan 2026-10-27 modules, F8/F9/F16). Deposit-address routes need `depositAddressRoutes`.
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns)
readonly `string`\[]
***
### claimTargets?
[Section titled “claimTargets?”](#claimtargets)
> `optional` **claimTargets?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/dist/remote.d.ts:45
The contracts this provider’s claims may call, per chain (e.g. `cctpClaimTargets` from `@anywalletkit/protocol-swap2-cctp`). The app’s list, not the server’s: without it the engine refuses claims from this stub (round 3, M24).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
readonly `string`\[]
***
### depositAddressRoutes?
[Section titled “depositAddressRoutes?”](#depositaddressroutes)
> `optional` **depositAddressRoutes?**: `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:72
Let this stub’s routes send the input to an address the backend names: a deposit address (NEAR Intents, a THORChain or Chainflip Tron vault) or a plain value send. Off by default: such a route bypasses `callTargets`, so a compromised backend could name its own address (scan 2026-10-28, F9). Opt in only for a provider whose deposit addresses cannot be pinned, or whose `verifyQuote` / `verifyBuild` checks them (`thorchainPins`, `chainflipPins`).
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: () => `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:34
Optional synchronous dark flag for accurate client-side discovery.
#### Returns
[Section titled “Returns”](#returns-2)
`boolean`
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-core/dist/remote.d.ts:79
Defaults to globalThis.fetch — injectable for tests.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-2)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-3)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`Response`>
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/dist/remote.d.ts:81
Extra headers (e.g. auth) attached to every call.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-swap2-core/dist/remote.d.ts:28
Provider name the backend multiplexes on (e.g. “near-intents”).
***
### spenders?
[Section titled “spenders?”](#spenders)
> `optional` **spenders?**: (`chain`) => readonly `string`\[]
Defined in: protocol-swap2-core/dist/remote.d.ts:54
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### chain
[Section titled “chain”](#chain-2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
readonly `string`\[]
***
### supportsChain?
[Section titled “supportsChain?”](#supportschain)
> `optional` **supportsChain?**: (`caip2`) => `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:36
Optional chain-level discovery hooks mirrored from the backend.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`boolean`
***
### supportsChainPair?
[Section titled “supportsChainPair?”](#supportschainpair)
> `optional` **supportsChainPair?**: (`fromChain`, `toChain`) => `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:37
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### fromChain
[Section titled “fromChain”](#fromchain)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`boolean`
***
### supportsRoute?
[Section titled “supportsRoute?”](#supportsroute)
> `optional` **supportsRoute?**: (`from`, `to`) => `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:32
Sync capability gate; defaults to true (the backend quote decides).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### from
[Section titled “from”](#from)
[`Asset`](/api/anywalletkit/protocol-swap2-router/interfaces/asset/)
##### to
[Section titled “to”](#to)
[`Asset`](/api/anywalletkit/protocol-swap2-router/interfaces/asset/)
#### Returns
[Section titled “Returns”](#returns-8)
`boolean`
***
### supportsSameChain?
[Section titled “supportsSameChain?”](#supportssamechain)
> `optional` **supportsSameChain?**: `boolean`
Defined in: protocol-swap2-core/dist/remote.d.ts:39
Explicit opt-in when the backend can execute same-chain swaps.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: protocol-swap2-core/dist/remote.d.ts:83
Per-request fail-closed timeout. Defaults to 12 seconds.
***
### verifyBuild?
[Section titled “verifyBuild?”](#verifybuild)
> `optional` **verifyBuild?**: (`quote`, `tx`, `params?`) => `string` | `Promise`<`string` | `null`> | `null`
Defined in: protocol-swap2-core/dist/remote.d.ts:65
The provider’s own check of a build on the client — a typed order, a cell body — against the quote it was built for: the reason it fails, or null. A build it refuses is never approved or signed.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### tx
[Section titled “tx”](#tx)
[`UnsignedTx`](/api/anywalletkit/protocol-swap2-router/interfaces/unsignedtx/)
##### params?
[Section titled “params?”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-9)
`string` | `Promise`<`string` | `null`> | `null`
***
### verifyQuote?
[Section titled “verifyQuote?”](#verifyquote)
> `optional` **verifyQuote?**: (`params`, `quote`) => `string` | `null`
Defined in: protocol-swap2-core/dist/remote.d.ts:60
The provider’s own check of a quote’s transaction, run here on the client against the request the app sent (shipped with the pins, e.g. `fyndPins`): a quote it refuses never reaches the auction. The backend runs the same check, but the backend is what this guards against.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### params
[Section titled “params”](#params-1)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
##### quote
[Section titled “quote”](#quote-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
#### Returns
[Section titled “Returns”](#returns-10)
`string` | `null`
# RoutedQuote
Defined in: protocol-swap2-core/dist/types.d.ts:110
The router’s chosen quote, tagged with how it scored.
## Extends
[Section titled “Extends”](#extends)
* [`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Properties
[Section titled “Properties”](#properties)
### depositAddress
[Section titled “depositAddress”](#depositaddress)
> **depositAddress**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:77
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`depositAddress`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#depositaddress)
***
### depositMemo
[Section titled “depositMemo”](#depositmemo)
> **depositMemo**: `string` | `null`
Defined in: protocol-swap2-core/dist/types.d.ts:78
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`depositMemo`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#depositmemo)
***
### destAmount
[Section titled “destAmount”](#destamount)
> **destAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:82
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`destAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#destamount)
***
### etaSeconds
[Section titled “etaSeconds”](#etaseconds)
> **etaSeconds**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:94
Estimated time to delivery.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`etaSeconds`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#etaseconds)
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `object`\[]
Defined in: protocol-swap2-core/dist/types.d.ts:86
Honest itemized fees when the provider exposes base-unit amounts.
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### description?
[Section titled “description?”](#description)
> `optional` **description?**: `string`
#### included
[Section titled “included”](#included)
> **included**: `boolean`
#### token
[Section titled “token”](#token)
> **token**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"protocol"` | `"network"` | `"affiliate"` | `"other"`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`fees`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#fees)
***
### feeUsd
[Section titled “feeUsd”](#feeusd)
> **feeUsd**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:84
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`feeUsd`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#feeusd)
***
### intentId
[Section titled “intentId”](#intentid)
> **intentId**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:76
Provider’s id for this swap; tracked with `trackIntent`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`intentId`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#intentid)
***
### minDestAmount
[Section titled “minDestAmount”](#mindestamount)
> **minDestAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:83
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`minDestAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#mindestamount)
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:74
Provider name.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`provider`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#provider)
***
### providerData?
[Section titled “providerData?”](#providerdata)
> `optional` **providerData?**: `Record`<`string`, `string`>
Defined in: protocol-swap2-core/dist/types.d.ts:100
Provider-owned, JSON-safe facts required to revalidate execution.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`providerData`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#providerdata)
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:96
Provider’s reliability hint, 0 to 1.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`reliability`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#reliability)
***
### routeScore
[Section titled “routeScore”](#routescore)
> **routeScore**: `object`
Defined in: protocol-swap2-core/dist/types.d.ts:111
#### candidates
[Section titled “candidates”](#candidates)
> **candidates**: `object`\[]
Every validated route: `score` is its value against the best (0..1).
#### score
[Section titled “score”](#score)
> **score**: `number`
#### weights
[Section titled “weights”](#weights)
> **weights**: [`ScoreWeights`](/api/anywalletkit/protocol-swap2-router/interfaces/scoreweights/)
***
### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
> **sourceAmount**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:81
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`sourceAmount`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#sourceamount)
***
### txRequest?
[Section titled “txRequest?”](#txrequest)
> `optional` **txRequest?**: [`TxRequest`](/api/anywalletkit/protocol-swap2-router/interfaces/txrequest/)
Defined in: protocol-swap2-core/dist/types.d.ts:80
Present instead of a usable depositAddress for calldata providers.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`txRequest`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#txrequest)
***
### validUntilMs
[Section titled “validUntilMs”](#validuntilms)
> **validUntilMs**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:98
Quote expiry, unix milliseconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/).[`validUntilMs`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/#validuntilms)
# RouterOptions
Defined in: protocol-swap2-router/src/router.ts:23
@anywalletkit/protocol-swap2-router — the OPTIONAL swap2 aggregator.
Every swap2 provider module runs on its own (install only `@anywalletkit/protocol-swap2-lifi` and use `LifiSwap2Protocol`). Install this package when you want one protocol that auctions a route across several providers: pass the providers you installed and it quotes them in parallel, validates every quote, scores them and executes the winner.
```ts
import {RouterSwap2Protocol} from "@anywalletkit/protocol-swap2-router";
import {lifiProvider} from "@anywalletkit/protocol-swap2-lifi/provider";
import {nearIntentsProvider} from "@anywalletkit/protocol-swap2-near-intents/provider";
const swap2 = new RouterSwap2Protocol(account, {
fromChain: "eip155:1",
providers: [lifiProvider({}), nearIntentsProvider({})],
});
```
Providers reached through a backend use `remoteProvider` (re-exported from the core package); give it `supportsChain`/`supportsChainPair` — e.g. from the provider package’s `config` export — so discovery knows its coverage.
## Properties
[Section titled “Properties”](#properties)
### tieBand?
[Section titled “tieBand?”](#tieband)
> `optional` **tieBand?**: `number`
Defined in: protocol-swap2-router/src/router.ts:37
Fraction of the best net value inside which quotes tie on price (default 0.002).
***
### valueUsd?
[Section titled “valueUsd?”](#valueusd)
> `optional` **valueUsd?**: (`quote`, `params`) => `number` | `null`
Defined in: protocol-swap2-router/src/router.ts:35
What a quote is worth to the user in USD: its guaranteed output minus what the route charges on top (a native bridge fee, the source gas). Return null when it cannot be priced — the auction then compares guaranteed outputs. `usdValue(prices)` builds one from a symbol → USD price map.
#### Parameters
[Section titled “Parameters”](#parameters)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns)
`number` | `null`
***
### weights?
[Section titled “weights?”](#weights)
> `optional` **weights?**: `string`
Defined in: protocol-swap2-router/src/router.ts:28
“price:0.6,speed:0.3,reliability:0.1” — how quotes inside the tie band (same price, within `tieBand`) are ordered. Price itself always leads.
# RouterSwap2Config
Defined in: protocol-swap2-router/src/swap2/router.ts:47
Options for [RouterSwap2Protocol](/api/anywalletkit/protocol-swap2-router/classes/routerswap2protocol/): the providers (or a ready router), route preference and the engine options.
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`Swap2EngineConfig.decodeTonBody`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`Swap2EngineConfig.onExecutionPhase`
***
### prefer?
[Section titled “prefer?”](#prefer)
> `optional` **prefer?**: `"best"` | `"fastest"`
Defined in: protocol-swap2-router/src/swap2/router.ts:62
What `swap2()` / `quoteSwap2()` execute when several routes answer: the best (default) or the fastest.
***
### providers?
[Section titled “providers?”](#providers)
> `optional` **providers?**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)\[]
Defined in: protocol-swap2-router/src/swap2/router.ts:49
The providers to aggregate over. Only what the caller installs is bundled.
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.reviewExecution`
***
### router?
[Section titled “router?”](#router)
> `optional` **router?**: [`CrossChainRouter`](/api/anywalletkit/protocol-swap2-router/classes/crosschainrouter/)
Defined in: protocol-swap2-router/src/swap2/router.ts:54
Or a ready auction engine (e.g. to share one between protocols or tune its score weights). Exactly one of `providers` / `router` is required.
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tieBand?
[Section titled “tieBand?”](#tieband)
> `optional` **tieBand?**: `number`
Defined in: protocol-swap2-router/src/swap2/router.ts:60
Fraction of the best value inside which routes tie on price (default 0.002).
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.tonGasCeiling`
***
### valueUsd?
[Section titled “valueUsd?”](#valueusd)
> `optional` **valueUsd?**: (`quote`, `params`) => `number` | `null`
Defined in: protocol-swap2-router/src/swap2/router.ts:58
Net USD value of a quote for a router built from `providers` — see `usdValue(prices)`.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-3)
`number` | `null`
***
### weights?
[Section titled “weights?”](#weights)
> `optional` **weights?**: `string`
Defined in: protocol-swap2-router/src/swap2/router.ts:56
Order inside a price tie for a router built from `providers`, e.g. “price:0.7,speed:0.2,reliability:0.1”.
# RouteSet
Defined in: protocol-swap2-router/src/router.ts:51
Every validated route for one request, ranked by value.
## Properties
[Section titled “Properties”](#properties)
### best
[Section titled “best”](#best)
> **best**: [`RankedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/rankedquote/)
Defined in: protocol-swap2-router/src/router.ts:55
Most delivered value (net of fees when priced) within the tie band.
***
### fastest
[Section titled “fastest”](#fastest)
> **fastest**: [`RankedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/rankedquote/)
Defined in: protocol-swap2-router/src/router.ts:57
Lowest ETA.
***
### pending
[Section titled “pending”](#pending)
> **pending**: `string`\[]
Defined in: protocol-swap2-router/src/router.ts:59
Providers still quoting (only non-empty in progressive `onUpdate` snapshots).
***
### quotes
[Section titled “quotes”](#quotes)
> **quotes**: [`RankedQuote`](/api/anywalletkit/protocol-swap2-router/interfaces/rankedquote/)\[]
Defined in: protocol-swap2-router/src/router.ts:53
Every validated route, best first.
***
### rejections
[Section titled “rejections”](#rejections)
> **rejections**: `string`\[]
Defined in: protocol-swap2-router/src/router.ts:61
Why the venues that sat out did (same as `lastRejections`).
# ScoreWeights
Defined in: protocol-swap2-core/dist/types.d.ts:126
How the router weighs price, speed and reliability when it scores routes.
## Properties
[Section titled “Properties”](#properties)
### price
[Section titled “price”](#price)
> **price**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:127
***
### reliability
[Section titled “reliability”](#reliability)
> **reliability**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:129
***
### speed
[Section titled “speed”](#speed)
> **speed**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:128
# Swap2Route
Defined in: protocol-swap2-router/src/swap2/router.ts:30
One route in a picker: the public quote plus its place in the auction.
## Properties
[Section titled “Properties”](#properties)
### netValueUsd
[Section titled “netValueUsd”](#netvalueusd)
> **netValueUsd**: `number` | `null`
Defined in: protocol-swap2-router/src/swap2/router.ts:36
Net USD value when the router prices routes (`valueUsd`), else null.
***
### provider
[Section titled “provider”](#provider)
> **provider**: `string`
Defined in: protocol-swap2-router/src/swap2/router.ts:32
Provider name.
***
### quote
[Section titled “quote”](#quote)
> **quote**: `Swap2Quote`
Defined in: protocol-swap2-router/src/swap2/router.ts:34
The provider’s quote.
***
### relativeValue
[Section titled “relativeValue”](#relativevalue)
> **relativeValue**: `number`
Defined in: protocol-swap2-router/src/swap2/router.ts:38
Value against the best route, 0..1.
***
### tags
[Section titled “tags”](#tags)
> **tags**: (`"best"` | `"fastest"`)\[]
Defined in: protocol-swap2-router/src/swap2/router.ts:40
`best` (most value within the tie band) and/or `fastest` (lowest ETA).
# TxRequest
Defined in: protocol-swap2-core/dist/types.d.ts:52
Provider-built transaction for the CALLDATA execution model (LI.FI): the user’s wallet must execute this exact payload — a plain transfer to `to` would LOSE funds. Either an EVM request or a pre-serialized Solana tx.
## Properties
[Section titled “Properties”](#properties)
### approvalAddress?
[Section titled “approvalAddress?”](#approvaladdress)
> `optional` **approvalAddress?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:59
ERC-20 sources must approve this spender before executing.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:56
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:54
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:57
***
### nativeFee?
[Section titled “nativeFee?”](#nativefee)
> `optional` **nativeFee?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:67
Native coin the route itself charges on top of the input (bridge messaging fees — Stargate/LayerZero-style), base units. A token source then sends exactly this as `value`; a native source sends input + this. Declared by the provider from the quote, sealed with it, and capped by the engine per chain.
***
### serializedTx?
[Section titled “serializedTx?”](#serializedtx)
> `optional` **serializedTx?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:69
Solana: base64-serialized transaction to sign & broadcast as-is.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:53
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:55
# UnsignedTx
Defined in: protocol-swap2-core/dist/types.d.ts:151
A provider’s source-leg transaction, before the engine checks and signs it.
## Properties
[Section titled “Properties”](#properties)
### approvalAddress?
[Section titled “approvalAddress?”](#approvaladdress)
> `optional` **approvalAddress?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:159
ERC-20 spender that must be approved before the calldata is sent.
***
### bodyBoc?
[Section titled “bodyBoc?”](#bodyboc)
> `optional` **bodyBoc?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:172
TON: serialized message-body CELL (base64 BoC) — e.g. an Omniston escrow payload. NOT interchangeable with `memo`: a memo is a text comment, while sending a BoC as text strands the swap. Executors must decode it to a Cell.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:152
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: protocol-swap2-core/dist/types.d.ts:156
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:155
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:157
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:163
Native-chain memo/body required by the deposit protocol.
***
### memoEncoding?
[Section titled “memoEncoding?”](#memoencoding)
> `optional` **memoEncoding?**: `"utf8"` | `"hex"`
Defined in: protocol-swap2-core/dist/types.d.ts:166
How `memo` becomes bytes on chains whose memo is a byte field (Tron `raw_data.data`): ‘utf8’ text (default) or ‘hex’ — a binary payload given as 0x-hex (a Chainflip vault-swap note).
***
### orderExtension?
[Section titled “orderExtension?”](#orderextension)
> `optional` **orderExtension?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:187
Typed-order execution: the order extension (0x-hex) the order’s salt commits to — a 1inch Limit Order Protocol order’s amount getters and post-interaction, where an HTLC order’s escrow terms live. Carried so an app can open a remote build on the client (`omnistonVerifyBuild`, scan 2026-10-28 F6); the signature covers it through the salt.
***
### serializedTx?
[Section titled “serializedTx?”](#serializedtx)
> `optional` **serializedTx?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:161
Provider-native serialized transaction (for accounts that expose a hook).
***
### stateInitBoc?
[Section titled “stateInitBoc?”](#stateinitboc)
> `optional` **stateInitBoc?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:174
TON: contract stateInit (base64 BoC) the message must carry, when present.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:153
***
### typedData?
[Section titled “typedData?”](#typeddata)
> `optional` **typedData?**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:181
GASLESS typed-order execution (Omniston EVM-source): the JSON EIP-712 payload the account must sign — there is NO source transaction. After signing, complete via `CrossChainProvider.registerSignedOrder`. When set, `approvalAddress` names the settlement contract that needs allowance.
***
### value
[Section titled “value”](#value)
> **value**: `string`
Defined in: protocol-swap2-core/dist/types.d.ts:154
# IntentState
> **IntentState** = `"pending"` | `"action-required"` | `"refund-pending"` | `"partial"` | `"completed"` | `"failed"` | `"refunded"` | `"cancelled"` | `"expired"`
Defined in: protocol-swap2-core/dist/types.d.ts:132
A swap’s state as the engine reports it; maps to `Swap2Status`.
# ValueParams
> **ValueParams** = `Pick`<[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/), `"sourceChain"` | `"sourceToken"` | `"destChain"` | `"destToken"` | `"amountIn"`>
Defined in: protocol-swap2-router/src/value.ts:82
# ValueQuote
> **ValueQuote** = `Pick`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/), `"provider"` | `"destAmount"`> & `Partial`<`Pick`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/), `"txRequest"` | `"providerData"`>>
Defined in: protocol-swap2-router/src/value.ts:83
# @anywalletkit/protocol-swap2-thorchain
# @anywalletkit/protocol-swap2-thorchain
[Section titled “@anywalletkit/protocol-swap2-thorchain”](#anywalletkitprotocol-swap2-thorchain)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-thorchain)
THORChain native cross-chain swaps as a swap2 module: EVM sources (Ethereum, Base, BSC, Avalanche) deposit into the THORChain router with `depositWithExpiry(vault, asset, amount, memo, expiry)`; Tron executes as a native send to the inbound vault with a memo. Standalone through `ThorchainSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-thorchain @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-thorchain @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-thorchain @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-thorchain](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-thorchain), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Where the funds go
[Section titled “Where the funds go”](#where-the-funds-go)
The router an EVM-source swap calls and approves must be one of `THORCHAIN_ROUTERS` (Ethereum, BSC, Avalanche, Base; `trustedRouters` adds one, e.g. during a router migration), and the inbound vault the router pays must be reported by a second THORNode (any node other than the one that quoted) both when the quote is taken and right before broadcast. A disagreeing node, or no second node answering, refuses the swap. The defaults are two public nodes of different operators (Liquify’s gateway and the IBS team’s node, both checked on 2026-10-28); with one `nodeUrl` of your own, the defaults confirm it unless `confirmNodeUrl` names another node (pick one of another operator; a local mock needs a second mock there). Node URLs must be `https:` (`allowInsecureNodeUrl` for local development).
Behind `remoteProvider`, the app checks the backend’s build itself: `remoteProvider({name: "thorchain", baseUrl, ...thorchainPins()})` pins the routers and runs `verifyBuild` on the client — the vault in the router call confirmed by two nodes, the source asset and exact input, and the memo’s destination, refund and limit against the app’s own request (pass the backend’s `affiliate` / `affiliateBps`). The pins open the stub to the Tron deposit route (`depositAddressRoutes`): its vault is the one `verifyBuild` confirms.
## Activity
[Section titled “Activity”](#activity)
Routers and Asgard vaults rotate, so `describeActivity(tx, ctx)` matches no address — only the router’s unique ABI, on the EVM chains this module serves:
| Selector | Meaning | Kind | Title |
| ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- | -------------------------------------------------- | ----------------------------- |
| `depositWithExpiry(address,address,uint256,string,uint256)` `0x44bc937b`, sent by the owner | our source leg | `bridge` (`swap` when the output also landed here) | “Bridged USDC” |
| `transferOut(address,address,uint256,string)` `0x574da717` / `transferOutAndCall` `0xec341444`, with something arriving at the owner | THORChain paying a destination leg | `bridge` | “Received USDC via THORChain” |
Subtitle “THORChain”, counterparty = the router called. Not recognizable offline: the Tron / BTC vault deposits (plain sends with a memo, vault addresses rotate) and the destination leg on non-EVM chains.
Fixtures (`fixtures/activity/`, test wallet on Ethereum, 2026-10-10): two `depositWithExpiry` USDC deposits and one router `transferOut` that paid the wallet; negatives: a LI.FI swap, a Uniswap `multicall`.
## Classes
[Section titled “Classes”](#classes)
* [ThorchainSwap2Protocol](/api/anywalletkit/protocol-swap2-thorchain/classes/thorchainswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ThorchainProviderConfig](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/)
* [ThorchainSwap2Config](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [thorchain](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain/)
* [THORCHAIN_DEPOSIT_WITH_EXPIRY](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_deposit_with_expiry/)
* [THORCHAIN_MODULE](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_module/)
* [THORCHAIN_ROUTERS](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_routers/)
* [THORCHAIN_TRANSFER_OUT](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_transfer_out/)
* [THORCHAIN_TRANSFER_OUT_AND_CALL](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_transfer_out_and_call/)
## Functions
[Section titled “Functions”](#functions)
* [describeThorchainActivity](/api/anywalletkit/protocol-swap2-thorchain/functions/describethorchainactivity/)
* [thorchainPins](/api/anywalletkit/protocol-swap2-thorchain/functions/thorchainpins/)
* [thorchainProvider](/api/anywalletkit/protocol-swap2-thorchain/functions/thorchainprovider/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [ThorchainSwap2Protocol](/api/anywalletkit/protocol-swap2-thorchain/classes/thorchainswap2protocol/)
# ThorchainSwap2Protocol
Defined in: protocol-swap2-thorchain/src/protocol.ts:8
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ThorchainSwap2Protocol**(`account`, `config`): `ThorchainSwap2Protocol`
Defined in: protocol-swap2-thorchain/src/protocol.ts:10
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`ThorchainSwap2Config`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`ThorchainSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-thorchain/src/protocol.ts:9
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-thorchain/src/protocol.ts:14
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-thorchain/src/protocol.ts:17
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeThorchainActivity
> **describeThorchainActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-thorchain/src/activity.ts:25
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# thorchainPins
> **thorchainPins**(`opts?`): [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/) & `object`
Defined in: protocol-swap2-thorchain/src/provider.ts:369
The app’s side of a remote THORChain stub (scan 2026-10-27 modules, F15): `remoteProvider({name: "thorchain", baseUrl, ...thorchainPins()})`. The pinned routers are the only call targets and spenders, and `verifyBuild` checks the build on the client: the vault in the router call (or the Tron deposit’s recipient) confirmed by two THORNodes of different operators, the source asset and exact input, and the memo’s asset, destination, refund and limit against the app’s own request. Pass the affiliate your backend’s provider uses (the memo must carry exactly it). The Tron deposit route is open (`depositAddressRoutes`): its vault is the one `verifyBuild` confirms.
## Parameters
[Section titled “Parameters”](#parameters)
### opts?
[Section titled “opts?”](#opts)
#### affiliate?
[Section titled “affiliate?”](#affiliate)
`string`
#### affiliateBps?
[Section titled “affiliateBps?”](#affiliatebps)
`string`
#### clientId?
[Section titled “clientId?”](#clientid)
`string`
#### nodeUrl?
[Section titled “nodeUrl?”](#nodeurl)
`string` | `string`\[]
#### trustedRouters?
[Section titled “trustedRouters?”](#trustedrouters)
`Readonly`<`Record`<`string`, readonly `string`\[]>>
## Returns
[Section titled “Returns”](#returns)
[`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/) & `object`
# thorchainProvider
> **thorchainProvider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-thorchain/src/provider.ts:436
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# ThorchainProviderConfig
Defined in: protocol-swap2-thorchain/src/provider.ts:330
Explicit constructor configuration; no deployment environment is read.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`ThorchainSwap2Config`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainswap2config/)
## Properties
[Section titled “Properties”](#properties)
### affiliate?
[Section titled “affiliate?”](#affiliate)
> `optional` **affiliate?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:332
***
### affiliateBps?
[Section titled “affiliateBps?”](#affiliatebps)
> `optional` **affiliateBps?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:333
***
### allowInsecureNodeUrl?
[Section titled “allowInsecureNodeUrl?”](#allowinsecurenodeurl)
> `optional` **allowInsecureNodeUrl?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:349
Allow `http:` node URLs (local development only): the vault and router a swap pays come from them.
***
### clientId?
[Section titled “clientId?”](#clientid)
> `optional` **clientId?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:351
Optional gateway identification; defaults to a neutral module name.
***
### confirmNodeUrl?
[Section titled “confirmNodeUrl?”](#confirmnodeurl)
> `optional` **confirmNodeUrl?**: `string` | `string`\[]
Defined in: protocol-swap2-thorchain/src/provider.ts:345
Nodes that confirm the source vault and router a quote names (scan 2026-10-27 modules, F15): another host must report the same before a quote is used and again right before broadcast; a disagreeing or silent second source refuses. Default: the other `nodeUrl` hosts, else the default public nodes. Name a node of another operator.
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:331
***
### nodeUrl?
[Section titled “nodeUrl?”](#nodeurl)
> `optional` **nodeUrl?**: `string` | `string`\[]
Defined in: protocol-swap2-thorchain/src/provider.ts:339
THORNode base URL(s), tried in order; a comma-separated string is accepted for env-style configuration. Defaults to the documented public hosts. Quote + inbound snapshot always come from the same host.
***
### tronSource?
[Section titled “tronSource?”](#tronsource)
> `optional` **tronSource?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:358
Opt-in Tron SOURCE execution: a native TRX send / TRC-20 transfer to the inbound vault carrying the swap memo in `raw_data.data`. Ships dark: the bound account MUST attach the memo on-chain (`raw_data.data`); a memo-less send is unsettleable.
***
### trustedRouters?
[Section titled “trustedRouters?”](#trustedrouters)
> `optional` **trustedRouters?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-thorchain/src/provider.ts:347
Routers to trust besides [THORCHAIN_ROUTERS](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_routers/), per CAIP-2 chain (a router migration before a release).
# ThorchainSwap2Config
Defined in: protocol-swap2-thorchain/src/protocol.ts:6
Explicit constructor configuration; no deployment environment is read.
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### affiliate?
[Section titled “affiliate?”](#affiliate)
> `optional` **affiliate?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:332
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`affiliate`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#affiliate)
***
### affiliateBps?
[Section titled “affiliateBps?”](#affiliatebps)
> `optional` **affiliateBps?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:333
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`affiliateBps`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#affiliatebps)
***
### allowInsecureNodeUrl?
[Section titled “allowInsecureNodeUrl?”](#allowinsecurenodeurl)
> `optional` **allowInsecureNodeUrl?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:349
Allow `http:` node URLs (local development only): the vault and router a swap pays come from them.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`allowInsecureNodeUrl`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#allowinsecurenodeurl)
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2EngineConfig.allowUnlistedTokens`
***
### clientId?
[Section titled “clientId?”](#clientid)
> `optional` **clientId?**: `string`
Defined in: protocol-swap2-thorchain/src/provider.ts:351
Optional gateway identification; defaults to a neutral module name.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`clientId`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#clientid)
***
### confirmNodeUrl?
[Section titled “confirmNodeUrl?”](#confirmnodeurl)
> `optional` **confirmNodeUrl?**: `string` | `string`\[]
Defined in: protocol-swap2-thorchain/src/provider.ts:345
Nodes that confirm the source vault and router a quote names (scan 2026-10-27 modules, F15): another host must report the same before a quote is used and again right before broadcast; a disagreeing or silent second source refuses. Default: the other `nodeUrl` hosts, else the default public nodes. Name a node of another operator.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`confirmNodeUrl`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#confirmnodeurl)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:331
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### nodeUrl?
[Section titled “nodeUrl?”](#nodeurl)
> `optional` **nodeUrl?**: `string` | `string`\[]
Defined in: protocol-swap2-thorchain/src/provider.ts:339
THORNode base URL(s), tried in order; a comma-separated string is accepted for env-style configuration. Defaults to the documented public hosts. Quote + inbound snapshot always come from the same host.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`nodeUrl`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#nodeurl)
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.onExecutionPhase`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.reviewExecution`
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`Swap2EngineConfig.tonGasCeiling`
***
### tronSource?
[Section titled “tronSource?”](#tronsource)
> `optional` **tronSource?**: `boolean`
Defined in: protocol-swap2-thorchain/src/provider.ts:358
Opt-in Tron SOURCE execution: a native TRX send / TRC-20 transfer to the inbound vault carrying the swap memo in `raw_data.data`. Ships dark: the bound account MUST attach the memo on-chain (`raw_data.data`); a memo-less send is unsettleable.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`tronSource`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#tronsource)
***
### trustedRouters?
[Section titled “trustedRouters?”](#trustedrouters)
> `optional` **trustedRouters?**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-thorchain/src/provider.ts:347
Routers to trust besides [THORCHAIN_ROUTERS](/api/anywalletkit/protocol-swap2-thorchain/variables/thorchain_routers/), per CAIP-2 chain (a router migration before a release).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`ThorchainProviderConfig`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/).[`trustedRouters`](/api/anywalletkit/protocol-swap2-thorchain/interfaces/thorchainproviderconfig/#trustedrouters)
# thorchain
> `const` **thorchain**: `object`
Defined in: protocol-swap2-thorchain/src/config.ts:8
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### affiliate
[Section titled “affiliate”](#affiliate)
> **affiliate**: () => `string`
#### Returns
[Section titled “Returns”](#returns)
`string`
### affiliateBps
[Section titled “affiliateBps”](#affiliatebps)
> **affiliateBps**: () => `string`
#### Returns
[Section titled “Returns”](#returns-1)
`string`
### enabled
[Section titled “enabled”](#enabled)
> **enabled**: () => `boolean`
#### Returns
[Section titled “Returns”](#returns-2)
`boolean`
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`boolean`
# THORCHAIN_DEPOSIT_WITH_EXPIRY
> `const` **THORCHAIN_DEPOSIT_WITH_EXPIRY**: `"0x44bc937b"` = `"0x44bc937b"`
Defined in: protocol-swap2-thorchain/src/activity.ts:19
depositWithExpiry(address,address,uint256,string,uint256)
# THORCHAIN_MODULE
> `const` **THORCHAIN_MODULE**: `"@anywalletkit/protocol-swap2-thorchain"` = `"@anywalletkit/protocol-swap2-thorchain"`
Defined in: protocol-swap2-thorchain/src/activity.ts:16
# THORCHAIN_ROUTERS
> `const` **THORCHAIN_ROUTERS**: `Readonly`<`Record`<`string`, readonly `string`\[]>>
Defined in: protocol-swap2-thorchain/src/provider.ts:49
THORChain’s EVM routers (`depositWithExpiry`), the only contracts an EVM-source swap may call and approve (scan 2026-10-27 modules, F15). Reported identically on 2026-10-28 by both default nodes (two operators) and by every October quote-matrix build. A router migration needs a release or `trustedRouters`; until then a quote naming another router is refused, never followed.
# THORCHAIN_TRANSFER_OUT
> `const` **THORCHAIN_TRANSFER_OUT**: `"0x574da717"` = `"0x574da717"`
Defined in: protocol-swap2-thorchain/src/activity.ts:21
transferOut(address,address,uint256,string)
# THORCHAIN_TRANSFER_OUT_AND_CALL
> `const` **THORCHAIN_TRANSFER_OUT_AND_CALL**: `"0xec341444"` = `"0xec341444"`
Defined in: protocol-swap2-thorchain/src/activity.ts:23
transferOutAndCall(address,address,uint256,address,address,string)
# @anywalletkit/protocol-swap2-uniswap
# @anywalletkit/protocol-swap2-uniswap
[Section titled “@anywalletkit/protocol-swap2-uniswap”](#anywalletkitprotocol-swap2-uniswap)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-uniswap)
Uniswap v3 same-chain swaps as a swap2 module: QuoterV2 quotes, SwapRouter02 `multicall(deadline, …)` execution, on the deployments in `src/addresses.ts` (each verified on-chain before use). Standalone through `UniswapSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-uniswap @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-uniswap @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-uniswap @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-uniswap](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-uniswap), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "uniswap", baseUrl, ...uniswapPins})`. The engine then lets the EVM route call and approve only the SwapRouter in `UNISWAP_V3`, never an address the backend names; without the pins the stub gets no EVM calldata route (fail closed). The pins carry `verifyQuote: uniswapVerifyQuote`, which opens the router call on the device: one `multicall(deadline, legs)` whose legs are exactly one `exactInputSingle` / `exactInput` (at most two pools), then `unwrapWETH9` for a native output, selling exactly the input of the source token for the destination token with the quote’s minimum, paid to the recipient. `pull`, `sweepToken` and every other router call are refused.
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` recognizes a call into the chain’s SwapRouter02 (the deployment table, or the `deployments` override you passed) with one of its swap entry points — `multicall(uint256,bytes[])` `0x5ae401dc`, `multicall(bytes[])` `0xac9650d8`, `multicall(bytes32,bytes[])` `0x1f0464d1`, `exactInputSingle` `0x04e45aaf`, `exactInput` `0xb858183f`, `exactOutputSingle` `0x5023b4df`, `exactOutput` `0x09b81346` — as `swap`, “Swapped A → B” from the owner’s net transfers (native legs via `unwrapWETH9` / `value` included). Subtitle `Uniswap v3 · `, counterparty = the router. Symbols come from the transfers or the swap2-assets catalog; unknown tokens show as a shortened address.
Fixtures (`fixtures/activity/`, public Ethereum transactions, 2026-10-14 — the test wallet’s Uniswap runs were quote-only on the matrix): `exactInputSingle` USDC → SHFL, `multicall(deadline)` USDC → USDT (the shape this module builds), `multicall(bytes[])` KEKIUS → ETH, `exactInput` USDC → AGRS; negatives: a Balancer Vault swap, a WETH9 deposit.
## Classes
[Section titled “Classes”](#classes)
* [UniswapSwap2Protocol](/api/anywalletkit/protocol-swap2-uniswap/classes/uniswapswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [UniswapDeployment](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapdeployment/)
* [UniswapProviderConfig](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/)
* [UniswapSwap2Config](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [ADDRESS_THIS](/api/anywalletkit/protocol-swap2-uniswap/variables/address_this/)
* [FEE_TIERS](/api/anywalletkit/protocol-swap2-uniswap/variables/fee_tiers/)
* [HOP_SYMBOLS](/api/anywalletkit/protocol-swap2-uniswap/variables/hop_symbols/)
* [ROUTER_ABI](/api/anywalletkit/protocol-swap2-uniswap/variables/router_abi/)
* [UNISWAP_MODULE](/api/anywalletkit/protocol-swap2-uniswap/variables/uniswap_module/)
* [UNISWAP_ROUTER_SELECTORS](/api/anywalletkit/protocol-swap2-uniswap/variables/uniswap_router_selectors/)
* [UNISWAP_V3](/api/anywalletkit/protocol-swap2-uniswap/variables/uniswap_v3/)
* [uniswapPins](/api/anywalletkit/protocol-swap2-uniswap/variables/uniswappins/)
## Functions
[Section titled “Functions”](#functions)
* [describeUniswapActivity](/api/anywalletkit/protocol-swap2-uniswap/functions/describeuniswapactivity/)
* [uniswapProvider](/api/anywalletkit/protocol-swap2-uniswap/functions/uniswapprovider/)
* [uniswapVerifyQuote](/api/anywalletkit/protocol-swap2-uniswap/functions/uniswapverifyquote/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [UniswapSwap2Protocol](/api/anywalletkit/protocol-swap2-uniswap/classes/uniswapswap2protocol/)
# UniswapSwap2Protocol
Defined in: protocol-swap2-uniswap/src/protocol.ts:10
Uniswap v3 as a standalone swap2 protocol (same-chain swaps on one account).
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UniswapSwap2Protocol**(`account`, `config`): `UniswapSwap2Protocol`
Defined in: protocol-swap2-uniswap/src/protocol.ts:14
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`UniswapSwap2Config`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`UniswapSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-uniswap/src/protocol.ts:11
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-uniswap/src/protocol.ts:20
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-uniswap/src/protocol.ts:23
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeUniswapActivity
> **describeUniswapActivity**(`tx`, `ctx`, `deployments?`): `ActivityItem` | `null`
Defined in: protocol-swap2-uniswap/src/activity.ts:24
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### deployments?
[Section titled “deployments?”](#deployments)
`Readonly`<`Record`<`number`, [`UniswapDeployment`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapdeployment/)>> = `UNISWAP_V3`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# uniswapProvider
> **uniswapProvider**(`config`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-uniswap/src/provider.ts:66
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# uniswapVerifyQuote
> **uniswapVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-uniswap/src/addresses.ts:76
The swap a Uniswap quote’s router call makes, opened on the client against the app’s own request (scan 2026-10-28, F1): one `multicall(deadline, legs)` on the chain’s pinned SwapRouter02 whose legs are exactly one `exactInputSingle` or `exactInput` — then `unwrapWETH9` for a native output — selling exactly the input of the source token (WETH for a native input, paid as `value`) for the destination token, with `amountOutMinimum` the quote’s minimum, paid to the recipient (or kept in the router and unwrapped to the recipient for that same minimum). `pull`, `sweepToken` and every other router call are refused. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# UniswapDeployment
Defined in: protocol-swap2-uniswap/src/addresses.ts:11
Uniswap v3 deployments this module trusts. Every entry was checked on-chain (2026-10-12): SwapRouter02.factory() and QuoterV2.factory() both return `factory`, and both report `weth` as WETH9. The provider re-checks the same facts once per chain at runtime before quoting (see `verifyDeployment`).
## Properties
[Section titled “Properties”](#properties)
### factory
[Section titled “factory”](#factory)
> **factory**: `` `0x${string}` ``
Defined in: protocol-swap2-uniswap/src/addresses.ts:12
***
### nativeWrap?
[Section titled “nativeWrap?”](#nativewrap)
> `optional` **nativeWrap?**: `false`
Defined in: protocol-swap2-uniswap/src/addresses.ts:19
false: the router has no WETH9 (reports 0x0) — no native in/out, the coin is an ERC-20 there.
***
### quoter
[Section titled “quoter”](#quoter)
> **quoter**: `` `0x${string}` ``
Defined in: protocol-swap2-uniswap/src/addresses.ts:13
***
### quoterWeth?
[Section titled “quoterWeth?”](#quoterweth)
> `optional` **quoterWeth?**: `false`
Defined in: protocol-swap2-uniswap/src/addresses.ts:21
false: a newer QuoterV2 build without WETH9() — only its factory is checked.
***
### router
[Section titled “router”](#router)
> **router**: `` `0x${string}` ``
Defined in: protocol-swap2-uniswap/src/addresses.ts:14
***
### weth
[Section titled “weth”](#weth)
> **weth**: `` `0x${string}` ``
Defined in: protocol-swap2-uniswap/src/addresses.ts:17
The chain’s wrapped native token (WETH, WBNB, WPOL, WAVAX) — on a chain without one (Celo), the hop token used for two-hop routes instead.
# UniswapProviderConfig
Defined in: protocol-swap2-uniswap/src/provider.ts:38
## Extended by
[Section titled “Extended by”](#extended-by)
* [`UniswapSwap2Config`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapswap2config/)
## Properties
[Section titled “Properties”](#properties)
### deadlineSeconds?
[Section titled “deadlineSeconds?”](#deadlineseconds)
> `optional` **deadlineSeconds?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:47
Seconds the router accepts the swap after the quote (multicall deadline). Default 600.
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:43
Slippage when the caller names none (bps). Default 50.
***
### deployments?
[Section titled “deployments?”](#deployments)
> `optional` **deployments?**: `Readonly`<`Record`<`number`, [`UniswapDeployment`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapdeployment/)>>
Defined in: protocol-swap2-uniswap/src/provider.ts:49
Override the deployments (tests, new chains). Still verified on-chain before use.
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-uniswap/src/provider.ts:39
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:45
Local quote lifetime (must cover an approval being mined). Default 5 min.
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-uniswap/src/provider.ts:41
JSON-RPC endpoints per EVM chain id, tried in order. A chain without one is not offered.
# UniswapSwap2Config
Defined in: protocol-swap2-uniswap/src/protocol.ts:7
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### deadlineSeconds?
[Section titled “deadlineSeconds?”](#deadlineseconds)
> `optional` **deadlineSeconds?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:47
Seconds the router accepts the swap after the quote (multicall deadline). Default 600.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`deadlineSeconds`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#deadlineseconds)
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`Swap2EngineConfig.decodeTonBody`
***
### defaultSlippageBps?
[Section titled “defaultSlippageBps?”](#defaultslippagebps)
> `optional` **defaultSlippageBps?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:43
Slippage when the caller names none (bps). Default 50.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`defaultSlippageBps`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#defaultslippagebps)
***
### deployments?
[Section titled “deployments?”](#deployments)
> `optional` **deployments?**: `Readonly`<`Record`<`number`, [`UniswapDeployment`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapdeployment/)>>
Defined in: protocol-swap2-uniswap/src/provider.ts:49
Override the deployments (tests, new chains). Still verified on-chain before use.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`deployments`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#deployments)
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-uniswap/src/provider.ts:39
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-uniswap/src/provider.ts:45
Local quote lifetime (must cover an approval being mined). Default 5 min.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-uniswap/src/provider.ts:41
JSON-RPC endpoints per EVM chain id, tried in order. A chain without one is not offered.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`UniswapProviderConfig`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapproviderconfig/#rpcurls)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`Swap2EngineConfig.tonGasCeiling`
# ADDRESS_THIS
> `const` **ADDRESS_THIS**: `"0x0000000000000000000000000000000000000002"` = `"0x0000000000000000000000000000000000000002"`
Defined in: protocol-swap2-uniswap/src/addresses.ts:54
SwapRouter02 recipient sentinel: “keep the output in the router” (then unwrapWETH9).
# FEE_TIERS
> `const` **FEE_TIERS**: readonly \[`100`, `500`, `3000`, `10000`]
Defined in: protocol-swap2-uniswap/src/addresses.ts:50
Pool fee tiers probed for every hop (0.01%, 0.05%, 0.3%, 1%).
# HOP_SYMBOLS
> `const` **HOP_SYMBOLS**: readonly \[`"WETH"`, `"USDC"`, `"USDT"`]
Defined in: protocol-swap2-uniswap/src/addresses.ts:52
Two-hop routes go through these (when the catalog knows them on the chain).
# ROUTER_ABI
> `const` **ROUTER_ABI**: readonly \[{ }, { }, { }, { }, { }, { }]
Defined in: protocol-swap2-uniswap/src/addresses.ts:57
The SwapRouter02 entry points this module writes (and the deployment probes).
# UNISWAP_MODULE
> `const` **UNISWAP_MODULE**: `"@anywalletkit/protocol-swap2-uniswap"` = `"@anywalletkit/protocol-swap2-uniswap"`
Defined in: protocol-swap2-uniswap/src/activity.ts:11
# UNISWAP_ROUTER_SELECTORS
> `const` **UNISWAP_ROUTER_SELECTORS**: `ReadonlySet`<`string`>
Defined in: protocol-swap2-uniswap/src/activity.ts:14
SwapRouter02 entry points (`viem toFunctionSelector`, 2026-10-14).
# UNISWAP_V3
> `const` **UNISWAP_V3**: `Readonly`<`Record`<`number`, [`UniswapDeployment`](/api/anywalletkit/protocol-swap2-uniswap/interfaces/uniswapdeployment/)>>
Defined in: protocol-swap2-uniswap/src/addresses.ts:24
# uniswapPins
> `const` **uniswapPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-uniswap/src/addresses.ts:143
The SwapRouter a Uniswap swap calls and approves on a chain (the shipped [UNISWAP_V3](/api/anywalletkit/protocol-swap2-uniswap/variables/uniswap_v3/) table), and [uniswapVerifyQuote](/api/anywalletkit/protocol-swap2-uniswap/functions/uniswapverifyquote/) — the app’s pins for `remoteProvider({name: "uniswap", baseUrl, ...uniswapPins})` (scan 2026-10-27 modules, F9; scan 2026-10-28, F1).
# @anywalletkit/protocol-swap2-usdt0
# @anywalletkit/protocol-swap2-usdt0
[Section titled “@anywalletkit/protocol-swap2-usdt0”](#anywalletkitprotocol-swap2-usdt0)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-usdt0)
[USDT0](https://docs.usdt0.to) — Tether’s USDT as a LayerZero OFT — as a swap2 provider: USDT / USDT0 between 16 EVM chains in **one source transaction**. `send(SendParam, MessagingFee, refund)` on the chain’s OFT with the LayerZero messaging fee as `msg.value`; LayerZero’s DVNs verify the packet and the executor delivers on the destination (USDT0 minted, or USDT released from the Ethereum adapter). No spread, no protocol fee today — the only cost is the LayerZero fee in the source chain’s native coin (≈ 0.0000024 ETH for Arbitrum → HyperEVM on 2026-10-20). It is the only direct USDT path into HyperEVM.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-usdt0 @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-usdt0 @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-usdt0 @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-usdt0](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-usdt0), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import {usdt0Provider} from "@anywalletkit/protocol-swap2-usdt0/provider";
import {RouterSwap2Protocol} from "@anywalletkit/protocol-swap2-router/swap2/router";
const swap2 = new RouterSwap2Protocol(arbitrumAccount, {fromChain: "eip155:42161", providers: [usdt0Provider({rpcUrls})]});
const res = await swap2.swap2({fromToken: "USDT0", toToken: "USDT0", toChain: 999, fromTokenAmount: 10_000_000n, minAmountOut: 10_000_000n});
// … poll …
const status = await swap2.getSwap2Status(res.id); // "pending" → "completed" with the HyperEVM delivery hash
```
`rpcUrls` (CAIP-2 → URL or URLs) is required for every chain the provider quotes **from**: the fee and the received amount come from the OFT itself, not from an API.
## What the provider does
[Section titled “What the provider does”](#what-the-provider-does)
* **Quote** = two `eth_call`s on the source OFT. `quoteOFT(SendParam)` gives the limits, any OFT fee rows and `amountReceivedLD` — what really arrives after dust removal (shared decimals = 6 on every deployment, so nothing is removed today). That amount becomes `minAmountLD`, and `quoteSend` prices the message with it. The contract reverts rather than deliver less.
* **Calldata is sealed in the quote**: `send(SendParam{dstEid, to, amountLD, minAmountLD, extraOptions: 0x, composeMsg: 0x, oftCmd: 0x}, {nativeFee, 0}, refundAddress)`, `value` = `nativeFee` = the quoted LayerZero fee **+ 25 % headroom** — the fee is paid at send time and moves with gas (live: +1.7 % in a minute on Ethereum); OAppSender needs `msg.value == nativeFee` and the endpoint refunds the unused part to `refundAddress` in the same transaction (declared as `txRequest.nativeFee` so the engine caps it per chain and the router prices it). `extraOptions` stays empty: every deployment’s `enforcedOptions` already carry the executor gas (type-3, `lzReceive` gas 80 000, read on-chain 2026-10-20).
* **Approvals**: Ethereum locks USDT in an OFT *adapter* (`approvalRequired()` = true) → `approvalAddress` is the adapter, exact amount. Every other chain’s OFT burns the caller’s USDT0 through the token’s mint/burn role (`approvalRequired()` = false) → no approval at all.
* **Bound on-chain**: before the first quote on a chain the OFT’s `token()` and `approvalRequired()` must match `config.ts`; per pair, `peers(dstEid)` must be the destination OFT. A mismatch refuses the route with its reason.
* **Preflight** (right before signing): target is the source OFT, peer still wired, and the *current* `quoteSend` fee still fits the sealed `value` — the endpoint reverts an underpaid send, so a fee past the headroom means re-quote.
* **Tracking**: LayerZero Scan `GET /v1/messages/tx/{sourceTxHash}`, matched to the route’s eids and the source OFT. `INFLIGHT` / `CONFIRMING` / `BLOCKED` → pending; `DELIVERED` → completed with the destination hash; `PAYLOAD_STORED` → action-required; `FAILED` and the burned / skipped / malformed statuses → failed; a hash whose message belongs to another pathway → failed.
* **Claim** (`buildClaim`, through the engine’s `claimSwap2`): a delivery that reverted on the destination is stored by the endpoint and can be retried by anyone — `EndpointV2.lzReceive(origin, receiver, guid, message, 0x)` with the exact packet Scan recorded, on the destination chain. Null otherwise.
* **Deployments** (docs.usdt0.to, every address re-read on-chain 2026-10-20): Ethereum (eid 30101, adapter), Arbitrum 30110, OP Mainnet 30111, Polygon 30109, HyperEVM 30367, Ink 30339, Berachain 30362, Unichain 30320, Sei 30280, Plasma 30383, Monad 30390, MegaETH 30398, X Layer 30274, Mantle 30181, Morph 30322, Flare 30295. USDT0 is also live on Conflux eSpace, Hedera, Rootstock, Stable, Tempo, HyperCore, IOTA and Stellar — not wallet chains here yet. OP’s catalog `USDT` is the legacy bridged token (not the OFT); `USDT0` is.
## Tests
[Section titled “Tests”](#tests)
`pnpm test` — provider tests over a fake JSON-RPC + fake LayerZero Scan (route gating, quote maths incl. dust and OFT fee rows, calldata binding, every named refusal, on-chain binding failures, preflight, the whole pending → completed / action-required / failed lifecycle, the `lzReceive` claim, the router snapshot) and the conformance suite incl. the behaviour fixture (the engine executes exactly the reviewed plan, no approval). `USDT0_LIVE=1 pnpm test` adds a live read-only quote on Arbitrum. `pnpm verify:live` re-reads all 13 deployments on-chain and quotes 10 USDT0 Arbitrum → HyperEVM with the preflight.
## Status
[Section titled “Status”](#status)
2026-10-20: built, tests green, all 13 deployments verified on-chain, live quote + preflight verified. No funded transfer yet (plan: 10 USDT Arbitrum → HyperEVM from the phone, then the status through LayerZero Scan).
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "usdt0", baseUrl, ...usdt0Pins})`. The engine then lets the EVM route call and approve only the USDT0 OFT (and, on Ethereum, the adapter as spender), never an address the backend names, and `usdt0VerifyQuote` decodes the server’s `send` on the device: the destination eid, the recipient, the input, a `minAmountLD` that keeps the quoted minimum, no options or compose message, the trader as refund and the declared native fee as value. Without the pins the stub gets no EVM calldata route (fail closed).
## Activity
[Section titled “Activity”](#activity)
`describeActivity`: `send` on the OFT → “Bridged USDT0” (“Bridged USDT” on Ethereum); the executor’s delivery (USDT0 minted to the owner, or USDT released by the adapter, in a transaction the owner did not send) → “Received USDT0 via LayerZero”; the owner’s own `lzReceive` retry → the same. Fixtures are recorded mainnet transactions (`fixtures/activity`).
## Classes
[Section titled “Classes”](#classes)
* [Usdt0Swap2Protocol](/api/anywalletkit/protocol-swap2-usdt0/classes/usdt0swap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [Usdt0Chain](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0chain/)
* [Usdt0ProviderConfig](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/)
* [Usdt0Swap2Config](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0swap2config/)
## Variables
[Section titled “Variables”](#variables)
* [LZ_RECEIVE](/api/anywalletkit/protocol-swap2-usdt0/variables/lz_receive/)
* [LZ_SCAN_API](/api/anywalletkit/protocol-swap2-usdt0/variables/lz_scan_api/)
* [usdt0](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0/)
* [USDT0_BY_EID](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_by_eid/)
* [USDT0_CHAINS](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_chains/)
* [USDT0_MODULE](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_module/)
* [USDT0_SEND](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_send/)
* [USDT0_STATUS_MAP](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_status_map/)
* [USDT0_SYMBOLS](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_symbols/)
* [USDT0_ZERO_PEER](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0_zero_peer/)
* [usdt0Pins](/api/anywalletkit/protocol-swap2-usdt0/variables/usdt0pins/)
## Functions
[Section titled “Functions”](#functions)
* [describeUsdt0Activity](/api/anywalletkit/protocol-swap2-usdt0/functions/describeusdt0activity/)
* [tokenMatches](/api/anywalletkit/protocol-swap2-usdt0/functions/tokenmatches/)
* [usdt0Provider](/api/anywalletkit/protocol-swap2-usdt0/functions/usdt0provider/)
* [usdt0VerifyQuote](/api/anywalletkit/protocol-swap2-usdt0/functions/usdt0verifyquote/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [Usdt0Swap2Protocol](/api/anywalletkit/protocol-swap2-usdt0/classes/usdt0swap2protocol/)
# Usdt0Swap2Protocol
Defined in: protocol-swap2-usdt0/src/protocol.ts:9
Standalone USDT0 swap2: USDT / USDT0 between the LayerZero OFT deployments in one source transaction.
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new Usdt0Swap2Protocol**(`account`, `config`): `Usdt0Swap2Protocol`
Defined in: protocol-swap2-usdt0/src/protocol.ts:11
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`Usdt0Swap2Config`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0swap2config/)
#### Returns
[Section titled “Returns”](#returns)
`Usdt0Swap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-usdt0/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-usdt0/src/protocol.ts:15
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-usdt0/src/protocol.ts:18
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeUsdt0Activity
> **describeUsdt0Activity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-usdt0/src/activity.ts:51
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# tokenMatches
> **tokenMatches**(`chain`, `symbolOrAddress`): `boolean`
Defined in: protocol-swap2-usdt0/src/config.ts:100
Does `symbolOrAddress` name this deployment’s token on `chain`? The contract itself, or a USDT / USDT0 symbol the catalog does not bind to another contract (OP’s legacy bridged USDT is not the OFT token). The provider and [usdt0VerifyQuote](/api/anywalletkit/protocol-swap2-usdt0/functions/usdt0verifyquote/) both check the request with it.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
[`Usdt0Chain`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0chain/)
### symbolOrAddress
[Section titled “symbolOrAddress”](#symboloraddress)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# usdt0Provider
> **usdt0Provider**(`config?`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-usdt0/src/provider.ts:114
## Parameters
[Section titled “Parameters”](#parameters)
### config?
[Section titled “config?”](#config)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# usdt0VerifyQuote
> **usdt0VerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-usdt0/src/config.ts:116
A remote USDT0 quote’s `send`, decoded on the device against the app’s own request (scan 2026-10-30, F3): exactly `send(SendParam, MessagingFee, refund)` on the source OFT; the destination chain’s eid; the recipient as `to`; the input as `amountLD`; a `minAmountLD` no larger than the input that guarantees the quoted minimum and the caller’s floor; empty `extraOptions`, `composeMsg` and `oftCmd` (what the provider sends); no LZ-token fee; the trader as refund; `msg.value` = the declared native fee = the call’s `nativeFee`; the adapter as spender on Ethereum only. The reason it fails, or null. The engine’s native-fee ceiling bounds the fee itself.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# Usdt0Chain
Defined in: protocol-swap2-usdt0/src/config.ts:19
## Properties
[Section titled “Properties”](#properties)
### adapter
[Section titled “adapter”](#adapter)
> **adapter**: `boolean`
Defined in: protocol-swap2-usdt0/src/config.ts:37
True on Ethereum: the OFT is a lockbox adapter in front of plain USDT.
***
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: protocol-swap2-usdt0/src/config.ts:20
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: protocol-swap2-usdt0/src/config.ts:21
***
### eid
[Section titled “eid”](#eid)
> **eid**: `number`
Defined in: protocol-swap2-usdt0/src/config.ts:23
LayerZero V2 endpoint id.
***
### endpoint
[Section titled “endpoint”](#endpoint)
> **endpoint**: `string`
Defined in: protocol-swap2-usdt0/src/config.ts:35
LayerZero V2 EndpointV2 on that chain (`lzReceive` retries of a stored payload go here).
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: protocol-swap2-usdt0/src/config.ts:24
***
### oft
[Section titled “oft”](#oft)
> **oft**: `string`
Defined in: protocol-swap2-usdt0/src/config.ts:33
The OFT contract `quoteSend` / `send` are called on. On Ethereum it is the OFT *adapter* that locks USDT (`approvalRequired()` = true, approve the token to it); elsewhere it is the OUpgradeable OFT that burns the caller’s USDT0 through the token’s mint/burn role — no approval.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: protocol-swap2-usdt0/src/config.ts:26
The ERC-20 the user holds: USDT on Ethereum, USDT0 elsewhere (6 decimals everywhere).
# Usdt0ProviderConfig
Defined in: protocol-swap2-usdt0/src/provider.ts:72
## Extended by
[Section titled “Extended by”](#extended-by)
* [`Usdt0Swap2Config`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0swap2config/)
## Properties
[Section titled “Properties”](#properties)
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-usdt0/src/provider.ts:73
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-usdt0/src/provider.ts:85
Injectable for tests (also used by the RPC transport).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`RequestInfo` | `URL`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `Request` | `URL`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-usdt0/src/provider.ts:83
Local lifetime of a quote (default 60 s; the sealed fee is re-checked at preflight).
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`string`, `string` | readonly `string`\[]>>
Defined in: protocol-swap2-usdt0/src/provider.ts:79
JSON-RPC URL(s) per CAIP-2 chain. REQUIRED for every chain the provider should quote from: the fee and the received amount come from the OFT itself. The destination RPC is optional (used for the stored-payload retry).
***
### scanUrl?
[Section titled “scanUrl?”](#scanurl)
> `optional` **scanUrl?**: `string`
Defined in: protocol-swap2-usdt0/src/provider.ts:81
LayerZero Scan base (default ).
# Usdt0Swap2Config
Defined in: protocol-swap2-usdt0/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-usdt0/src/provider.ts:73
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/#enabled)
***
### fetchImpl?
[Section titled “fetchImpl?”](#fetchimpl)
> `optional` **fetchImpl?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: protocol-swap2-usdt0/src/provider.ts:85
Injectable for tests (also used by the RPC transport).
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input)
`RequestInfo` | `URL`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-2)
###### input
[Section titled “input”](#input-1)
`string` | `Request` | `URL`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Response`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/).[`fetchImpl`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/#fetchimpl)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.onExecutionPhase`
***
### quoteTtlMs?
[Section titled “quoteTtlMs?”](#quotettlms)
> `optional` **quoteTtlMs?**: `number`
Defined in: protocol-swap2-usdt0/src/provider.ts:83
Local lifetime of a quote (default 60 s; the sealed fee is re-checked at preflight).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/).[`quoteTtlMs`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/#quotettlms)
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-4)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `Readonly`<`Record`<`string`, `string` | readonly `string`\[]>>
Defined in: protocol-swap2-usdt0/src/provider.ts:79
JSON-RPC URL(s) per CAIP-2 chain. REQUIRED for every chain the provider should quote from: the fee and the received amount come from the OFT itself. The destination RPC is optional (used for the stored-payload retry).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/#rpcurls)
***
### scanUrl?
[Section titled “scanUrl?”](#scanurl)
> `optional` **scanUrl?**: `string`
Defined in: protocol-swap2-usdt0/src/provider.ts:81
LayerZero Scan base (default ).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`Usdt0ProviderConfig`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/).[`scanUrl`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0providerconfig/#scanurl)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`Swap2EngineConfig.tonGasCeiling`
# LZ_RECEIVE
> `const` **LZ_RECEIVE**: `"0x0c0c389e"` = `"0x0c0c389e"`
Defined in: protocol-swap2-usdt0/src/activity.ts:29
lzReceive((uint32,bytes32,uint64),address,bytes32,bytes,bytes) — EndpointV2
# LZ_SCAN_API
> `const` **LZ_SCAN_API**: `"https://scan.layerzero-api.com"` = `"https://scan.layerzero-api.com"`
Defined in: protocol-swap2-usdt0/src/config.ts:75
LayerZero Scan — message status by source transaction hash.
# usdt0
> `const` **usdt0**: `object`
Defined in: protocol-swap2-usdt0/src/config.ts:80
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### supports()
[Section titled “supports()”](#supports)
> **supports**(`from`, `to`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters)
##### from
[Section titled “from”](#from)
`string`
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns)
`boolean`
### supportsChain()
[Section titled “supportsChain()”](#supportschain)
> **supportsChain**(`chain`): `boolean`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### chain
[Section titled “chain”](#chain)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`boolean`
# USDT0_BY_EID
> `const` **USDT0_BY_EID**: `Readonly`<`Record`<`number`, [`Usdt0Chain`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0chain/)>>
Defined in: protocol-swap2-usdt0/src/config.ts:70
LayerZero eid → deployment.
# USDT0_CHAINS
> `const` **USDT0_CHAINS**: `Readonly`<`Record`<`string`, [`Usdt0Chain`](/api/anywalletkit/protocol-swap2-usdt0/interfaces/usdt0chain/)>>
Defined in: protocol-swap2-usdt0/src/config.ts:48
CAIP-2 → USDT0 deployment.
# USDT0_MODULE
> `const` **USDT0_MODULE**: `"@anywalletkit/protocol-swap2-usdt0"` = `"@anywalletkit/protocol-swap2-usdt0"`
Defined in: protocol-swap2-usdt0/src/activity.ts:24
# USDT0_SEND
> `const` **USDT0_SEND**: `"0xc7c7f5b3"` = `"0xc7c7f5b3"`
Defined in: protocol-swap2-usdt0/src/activity.ts:27
send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address) — IOFT
# USDT0_STATUS_MAP
> `const` **USDT0_STATUS_MAP**: `Readonly`<`Record`<`string`, [`IntentState`](/api/anywalletkit/protocol-swap2-router/type-aliases/intentstate/)>>
Defined in: protocol-swap2-usdt0/src/provider.ts:390
Exported for tests and diagnostics: the LayerZero Scan status → swap2 state mapping.
# USDT0_SYMBOLS
> `const` **USDT0_SYMBOLS**: readonly `string`\[]
Defined in: protocol-swap2-usdt0/src/config.ts:78
Token symbols the catalog uses for the same asset across chains.
# USDT0_ZERO_PEER
> `const` **USDT0_ZERO_PEER**: `` `0x${string}` ``
Defined in: protocol-swap2-usdt0/src/provider.ts:70
# usdt0Pins
> `const` **usdt0Pins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-usdt0/src/config.ts:173
The USDT0 OFT a send calls on a chain, and the adapter it approves where one locks USDT (Ethereum), and [usdt0VerifyQuote](/api/anywalletkit/protocol-swap2-usdt0/functions/usdt0verifyquote/) — the app’s pins for `remoteProvider({name: "usdt0", baseUrl, ...usdt0Pins})` (scan 2026-10-27 modules, F8/F16; the send’s arguments since scan 2026-10-30, F3).
# @anywalletkit/protocol-swap2-wrap
# @anywalletkit/protocol-swap2-wrap
[Section titled “@anywalletkit/protocol-swap2-wrap”](#anywalletkitprotocol-swap2-wrap)
[](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-wrap)
Wrap / unwrap the native coin as a swap2 module: WETH9 `deposit()` and `withdraw(uint256)` on the wrapper in `WRAPPED_NATIVE` for each chain (WETH, WBNB, WPOL, WAVAX, …), verified on-chain before use. Standalone through `WrapSwap2Protocol`, or as one provider of the router.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/protocol-swap2-wrap @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-swap2-wrap @anywalletkit/core · yarn add @anywalletkit/protocol-swap2-wrap @anywalletkit/core
```
On npm: [@anywalletkit/protocol-swap2-wrap](https://www.npmjs.com/package/@anywalletkit/protocol-swap2-wrap), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
## Behind `remoteProvider`
[Section titled “Behind remoteProvider”](#behind-remoteprovider)
When the provider runs on your server, spread its pins into the app’s stub: `remoteProvider({name: "wrap", baseUrl, ...wrapPins})`. The engine then lets the EVM route call and approve only the wrapped-native contract (no spender), never an address the backend names, and `wrapVerifyQuote` checks the call on the device: `deposit()` with the input as value, or `withdraw(input)` with no value, for the sender. Without the pins the stub gets no EVM calldata route (fail closed).
## Activity
[Section titled “Activity”](#activity)
`describeActivity(tx, ctx)` recognizes calls to the chain’s wrapper (the table, or the `wrapped` override you passed):
| Selector | Kind | Title |
| -------------------------------- | -------- | ----------------------------------------- |
| `deposit()` `0xd0e30db0` | `wrap` | “Wrapped ETH” (the chain’s native symbol) |
| `withdraw(uint256)` `0x2e1a7d4d` | `unwrap` | “Unwrapped WETH” (the wrapper’s symbol) |
Assets are the owner’s net transfers (native out + WETH mint in, or WETH burn out + native in), subtitle = the wrapper symbol, counterparty = the wrapper. A swap that unwraps inside a DEX router is that router’s activity, not this module’s.
Fixtures (`fixtures/activity/`, public Ethereum WETH9 transactions, 2026-10-14 — the test wallet’s wrap runs were quote-only on the matrix): two `deposit()`, two `withdraw()`; negatives: a Uniswap `multicall` ending in `unwrapWETH9`, a Balancer Vault swap.
## Classes
[Section titled “Classes”](#classes)
* [WrapSwap2Protocol](/api/anywalletkit/protocol-swap2-wrap/classes/wrapswap2protocol/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [WrapProviderConfig](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/)
* [WrapSwap2Config](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapswap2config/)
## Variables
[Section titled “Variables”](#variables)
* [WETH_DEPOSIT](/api/anywalletkit/protocol-swap2-wrap/variables/weth_deposit/)
* [WETH_WITHDRAW](/api/anywalletkit/protocol-swap2-wrap/variables/weth_withdraw/)
* [WRAP_MODULE](/api/anywalletkit/protocol-swap2-wrap/variables/wrap_module/)
* [WRAPPED_NATIVE](/api/anywalletkit/protocol-swap2-wrap/variables/wrapped_native/)
* [wrapPins](/api/anywalletkit/protocol-swap2-wrap/variables/wrappins/)
## Functions
[Section titled “Functions”](#functions)
* [describeWrapActivity](/api/anywalletkit/protocol-swap2-wrap/functions/describewrapactivity/)
* [wrapProvider](/api/anywalletkit/protocol-swap2-wrap/functions/wrapprovider/)
* [wrapVerifyQuote](/api/anywalletkit/protocol-swap2-wrap/functions/wrapverifyquote/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WrapSwap2Protocol](/api/anywalletkit/protocol-swap2-wrap/classes/wrapswap2protocol/)
# WrapSwap2Protocol
Defined in: protocol-swap2-wrap/src/protocol.ts:9
Wrap / unwrap the native coin on one account (ETH ↔ WETH and friends).
## Extends
[Section titled “Extends”](#extends)
* `SingleProviderSwap2`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WrapSwap2Protocol**(`account`, `config`): `WrapSwap2Protocol`
Defined in: protocol-swap2-wrap/src/protocol.ts:13
#### Parameters
[Section titled “Parameters”](#parameters)
##### account
[Section titled “account”](#account)
`unknown`
##### config
[Section titled “config”](#config)
[`WrapSwap2Config`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapswap2config/)
#### Returns
[Section titled “Returns”](#returns)
`WrapSwap2Protocol`
#### Overrides
[Section titled “Overrides”](#overrides)
`SingleProviderSwap2.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_account
[Section titled “\_account”](#_account)
> `protected` `readonly` **\_account**: `IWalletAccountReadOnly` | `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:309
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`SingleProviderSwap2._account`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: `Swap2ProtocolConfig`
Defined in: core/dist/index-QWdcwE6y.d.ts:310
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`SingleProviderSwap2._config`
***
### fromChain
[Section titled “fromChain”](#fromchain)
> `protected` `readonly` **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:215
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`SingleProviderSwap2.fromChain`
***
### provider
[Section titled “provider”](#provider)
> `protected` `readonly` **provider**: [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-wrap/src/protocol.ts:10
#### Overrides
[Section titled “Overrides”](#overrides-1)
`SingleProviderSwap2.provider`
## Methods
[Section titled “Methods”](#methods)
### assertFeeCaps()
[Section titled “assertFeeCaps()”](#assertfeecaps)
> `protected` **assertFeeCaps**(`fees`, `sourceAmount`, `sourceToken`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:247
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### fees
[Section titled “fees”](#fees)
readonly `Swap2Fee`\[] | `undefined`
##### sourceAmount
[Section titled “sourceAmount”](#sourceamount)
`bigint`
##### sourceToken
[Section titled “sourceToken”](#sourcetoken)
`string`
##### config?
[Section titled “config?”](#config-1)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`SingleProviderSwap2.assertFeeCaps`
***
### assertFeeConfig()
[Section titled “assertFeeConfig()”](#assertfeeconfig)
> `protected` **assertFeeConfig**(`config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:246
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### config?
[Section titled “config?”](#config-2)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`SingleProviderSwap2.assertFeeConfig`
***
### assertQuoteFeeCaps()
[Section titled “assertQuoteFeeCaps()”](#assertquotefeecaps)
> `protected` **assertQuoteFeeCaps**(`q`, `options`, `config?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:248
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### q
[Section titled “q”](#q)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options)
`Swap2Options`
##### config?
[Section titled “config?”](#config-3)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`SingleProviderSwap2.assertQuoteFeeCaps`
***
### bridge()
[Section titled “bridge()”](#bridge)
> **bridge**(`options`): `Promise`<`BridgeResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:302
The inherited bridge() has no floor field: quote first, then bind execution to that quote’s minimum so the inherited convenience API stays safe.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### options
[Section titled “options”](#options-1)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`BridgeResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`SingleProviderSwap2.bridge`
***
### chainSupported()
[Section titled “chainSupported()”](#chainsupported)
> `protected` **chainSupported**(`caip2`): `boolean`
Defined in: protocol-swap2-wrap/src/protocol.ts:19
Whether this protocol can route a chain at all (for support discovery).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### caip2
[Section titled “caip2”](#caip2)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-2)
`SingleProviderSwap2.chainSupported`
***
### claimSwap2()
[Section titled “claimSwap2()”](#claimswap2)
> **claimSwap2**(`id`, `account`): `Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:295
Two-phase routes (CCTP-style burn-and-mint): once `getSwap2Status` reports “action-required”, the delivery needs a second transaction on the DESTINATION chain, signed there and paid in that chain’s gas. `account` is the destination-chain account (the bound source account is not reused: the chains differ). The provider builds the claim from the attestation; it is refused when not ready, when it names another chain than the account, or when it is anything but plain EVM calldata. Returns the claim hash and the status id to keep polling with.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id)
`string`
##### account
[Section titled “account”](#account-1)
`unknown`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `chain`: `string`; `hash`: `string`; `id`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`SingleProviderSwap2.claimSwap2`
***
### close()
[Section titled “close()”](#close)
> **close**(): `void`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:18
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`SingleProviderSwap2.close`
***
### describeActivity()
[Section titled “describeActivity()”](#describeactivity)
> **describeActivity**(`tx`, `ctx`): `ActivityItem` | `null`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:16
Activity recognition lives on the provider (shared with the router); null when it has none.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx)
`ChainTx`
##### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
#### Returns
[Section titled “Returns”](#returns-8)
`ActivityItem` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`SingleProviderSwap2.describeActivity`
***
### emitPhase()
[Section titled “emitPhase()”](#emitphase)
> `protected` **emitPhase**(`phase`, `detail?`): `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:228
Report an execution phase; an observer that throws is ignored.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`SingleProviderSwap2.emitPhase`
***
### getSupportedChains()
[Section titled “getSupportedChains()”](#getsupportedchains)
> **getSupportedChains**(): `Promise`<`Swap2SupportedChain`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:306
Source chains this protocol can swap from.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`Swap2SupportedChain`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`SingleProviderSwap2.getSupportedChains`
***
### getSupportedTokens()
[Section titled “getSupportedTokens()”](#getsupportedtokens)
> **getSupportedTokens**(`options?`): `Promise`<`Swap2SupportedToken`\[]>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:308
Tokens of the asset catalog on the supported chains, optionally narrowed.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### options?
[Section titled “options?”](#options-2)
`Swap2SupportedTokensOptions`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Swap2SupportedToken`\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`SingleProviderSwap2.getSupportedTokens`
***
### getSwap2Status()
[Section titled “getSwap2Status()”](#getswap2status)
> **getSwap2Status**(`id`, `_options?`): `Promise`<`Swap2StatusResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:284
Status of a swap by the id `swap2()` returned, asked from the provider that executed it.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### id
[Section titled “id”](#id-1)
`string`
##### \_options?
[Section titled “\_options?”](#_options)
`Swap2StatusOptions`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`Swap2StatusResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
`SingleProviderSwap2.getSwap2Status`
***
### noRouteDetail()
[Section titled “noRouteDetail()”](#noroutedetail)
> `protected` **noRouteDetail**(): `string`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:13
Why the last resolveQuote came back empty (venue names + reasons), or “”. Rides inside the no-route error so execution failures are diagnosable from the surface that shows them.
#### Returns
[Section titled “Returns”](#returns-13)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
`SingleProviderSwap2.noRouteDetail`
***
### pairSupported()
[Section titled “pairSupported()”](#pairsupported)
> `protected` **pairSupported**(`fromChain`, `toChain`): `boolean`
Defined in: protocol-swap2-wrap/src/protocol.ts:22
Pair-level capability used when discovery specifies both endpoints.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### fromChain
[Section titled “fromChain”](#fromchain-1)
`string`
##### toChain
[Section titled “toChain”](#tochain)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`boolean`
#### Overrides
[Section titled “Overrides”](#overrides-3)
`SingleProviderSwap2.pairSupported`
***
### prepareOptions()
[Section titled “prepareOptions()”](#prepareoptions)
> `protected` **prepareOptions**(`options`): `Promise`<`Swap2Options`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:242
Options ready to quote: with `allowUnlistedTokens`, an unlisted source token gets its decimals, read from the chain through the account (cached per token) — a caller’s `fromTokenDecimals` that disagrees is refused. Listed tokens and every option otherwise pass through unchanged.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### options
[Section titled “options”](#options-3)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Swap2Options`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
`SingleProviderSwap2.prepareOptions`
***
### protocolEnabled()
[Section titled “protocolEnabled()”](#protocolenabled)
> `protected` **protocolEnabled**(): `boolean`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:17
Runtime availability used by the public discovery methods.
#### Returns
[Section titled “Returns”](#returns-16)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
`SingleProviderSwap2.protocolEnabled`
***
### providerFor()
[Section titled “providerFor()”](#providerfor)
> `protected` **providerFor**(`name`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:14
Look up a provider by name to resume/track an in-flight swap2.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### name
[Section titled “name”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/) | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
`SingleProviderSwap2.providerFor`
***
### quoteBridge()
[Section titled “quoteBridge()”](#quotebridge)
> **quoteBridge**(`options`): `Promise`<`BridgeQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:609
The older `quoteBridge`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### options
[Section titled “options”](#options-4)
`BridgeOptions`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`BridgeQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
`SingleProviderSwap2.quoteBridge`
***
### quoteSwap()
[Section titled “quoteSwap()”](#quoteswap)
> **quoteSwap**(`options`): `Promise`<`SwapQuote`>
Defined in: core/dist/index-QWdcwE6y.d.ts:605
The older `quoteSwap`, run through `quoteSwap2`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### options
[Section titled “options”](#options-5)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`SwapQuote`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
`SingleProviderSwap2.quoteSwap`
***
### quoteSwap2()
[Section titled “quoteSwap2()”](#quoteswap2)
> **quoteSwap2**(`options`): `Promise`<`Swap2Quote`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:261
Ask for a quote and check it against the request (amounts, slippage floor, fee ceilings in the protocol config). Works on a read-only account.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### options
[Section titled “options”](#options-6)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Swap2Quote`>
#### Throws
[Section titled “Throws”](#throws)
Swap2QuoteError when no route answers, with the provider’s own reason when it gave one.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
`SingleProviderSwap2.quoteSwap2`
***
### requireSigningAccount()
[Section titled “requireSigningAccount()”](#requiresigningaccount)
> `protected` **requireSigningAccount**(`methodName`): `IWalletAccount`
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### methodName
[Section titled “methodName”](#methodname)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`IWalletAccount`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
`SingleProviderSwap2.requireSigningAccount`
***
### resolveQuote()
[Section titled “resolveQuote()”](#resolvequote)
> `protected` **resolveQuote**(`params`): `Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
Defined in: protocol-swap2-core/dist/swap2/single.d.ts:12
Quote the route (single provider, or best across the router).
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/) | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
`SingleProviderSwap2.resolveQuote`
***
### routeQuote()
[Section titled “routeQuote()”](#routequote)
> `protected` **routeQuote**(`q`, `options`): `Swap2Quote` | `null`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:253
A dry route the auction already validated → the public quote, or null when the caller’s floor / fee caps refuse it.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### q
[Section titled “q”](#q-1)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-7)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-23)
`Swap2Quote` | `null`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
`SingleProviderSwap2.routeQuote`
***
### snapshotOf()
[Section titled “snapshotOf()”](#snapshotof)
> `protected` **snapshotOf**(`options`): `Swap2Options`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:251
A frozen, validated copy of caller options (what every engine path works from).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### options
[Section titled “options”](#options-8)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-24)
`Swap2Options`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
`SingleProviderSwap2.snapshotOf`
***
### sourceAsset()
[Section titled “sourceAsset()”](#sourceasset)
> `protected` **sourceAsset**(`options`): `CcAsset` | `undefined`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:235
The source asset the options name: the catalog’s, or (allowUnlistedTokens) an unlisted one with its decimals.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-9)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-25)
`CcAsset` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
`SingleProviderSwap2.sourceAsset`
***
### swap()
[Section titled “swap()”](#swap)
> **swap**(`options`): `Promise`<`SwapResult`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:304
Same protection for legacy exact-in swap() calls whose min is optional.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### options
[Section titled “options”](#options-10)
`SwapOptions`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`SwapResult`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
`SingleProviderSwap2.swap`
***
### swap2()
[Section titled “swap2()”](#swap2)
> **swap2**(`options`, `config?`): `Promise`<`Swap2Result`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:271
Re-quote, check the quote, show it to `reviewExecution` when configured, send any approvals, then sign and broadcast the source leg. An identical call already in flight on the same account is refused.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### options
[Section titled “options”](#options-11)
`Swap2Options`
##### config?
[Section titled “config?”](#config-4)
`Swap2ProtocolConfig`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`Swap2Result`>
#### Throws
[Section titled “Throws”](#throws-1)
Swap2ExecutionError for a read-only account, Swap2InFlightError for a double tap, Swap2MaybeSentError when the broadcast outcome is unknown (do not retry; track `hash`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
`SingleProviderSwap2.swap2`
***
### toParams()
[Section titled “toParams()”](#toparams)
> `protected` **toParams**(`given`, `dry`): [`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:244
Swap2Options → the engine’s QuoteParams (exact-in only).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### given
[Section titled “given”](#given)
`Swap2Options`
##### dry
[Section titled “dry”](#dry)
`boolean`
#### Returns
[Section titled “Returns”](#returns-28)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
`SingleProviderSwap2.toParams`
***
### toQuote()
[Section titled “toQuote()”](#toquote)
> `protected` **toQuote**(`q`, `options`): `Swap2Quote`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:249
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### q
[Section titled “q”](#q-2)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
##### options
[Section titled “options”](#options-12)
`Swap2Options`
#### Returns
[Section titled “Returns”](#returns-29)
`Swap2Quote`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
`SingleProviderSwap2.toQuote`
# describeWrapActivity
> **describeWrapActivity**(`tx`, `ctx`, `wrapped?`): `ActivityItem` | `null`
Defined in: protocol-swap2-wrap/src/activity.ts:18
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`ChainTx`
### ctx
[Section titled “ctx”](#ctx)
`DescribeActivityContext`
### wrapped?
[Section titled “wrapped?”](#wrapped)
`Readonly`<`Record`<`number`, { `address`: `` `0x${string}` ``; `symbol`: `string`; }>> = `WRAPPED_NATIVE`
## Returns
[Section titled “Returns”](#returns)
`ActivityItem` | `null`
# wrapProvider
> **wrapProvider**(`config`): [`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
Defined in: protocol-swap2-wrap/src/provider.ts:72
Native ↔ wrapped native as a swap2 venue: `deposit()` with value to wrap, `withdraw(amount)` to unwrap. 1:1, no pool, no slippage, no approval. WETH9 credits and pays `msg.sender`, so the recipient must be the sender — a wrap “to someone else” is refused rather than silently paid to the wrong place.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`WrapProviderConfig`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/)
## Returns
[Section titled “Returns”](#returns)
[`CrossChainProvider`](/api/anywalletkit/protocol-swap2-router/interfaces/crosschainprovider/)
# wrapVerifyQuote
> **wrapVerifyQuote**(`params`, `quote`): `string` | `null`
Defined in: protocol-swap2-wrap/src/provider.ts:216
A remote wrap / unwrap quote, decoded on the device against the app’s own request (scan 2026-10-30, F3): native → wrapped is exactly `deposit()` with the input as value; wrapped → native is exactly `withdraw(input)` with no value; on the chain’s wrapped native, no approval, and (as WETH9 pays `msg.sender`) a recipient that is the sender. The reason it fails, or null.
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
[`QuoteParams`](/api/anywalletkit/protocol-swap2-router/interfaces/quoteparams/)
### quote
[Section titled “quote”](#quote)
[`Quote`](/api/anywalletkit/protocol-swap2-router/interfaces/quote/)
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# WrapProviderConfig
Defined in: protocol-swap2-wrap/src/provider.ts:58
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WrapSwap2Config`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapswap2config/)
## Properties
[Section titled “Properties”](#properties)
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-wrap/src/provider.ts:59
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-wrap/src/provider.ts:61
JSON-RPC endpoints per EVM chain id (on-chain token check + receipt tracking).
***
### wrapped?
[Section titled “wrapped?”](#wrapped)
> `optional` **wrapped?**: `Readonly`<`Record`<`number`, { `address`: `` `0x${string}` ``; `symbol`: `string`; }>>
Defined in: protocol-swap2-wrap/src/provider.ts:63
Override the wrapped tokens (tests, new chains). Still verified on-chain before use.
# WrapSwap2Config
Defined in: protocol-swap2-wrap/src/protocol.ts:6
## Extends
[Section titled “Extends”](#extends)
* `Swap2EngineConfig`.[`WrapProviderConfig`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/)
## Properties
[Section titled “Properties”](#properties)
### accountChain?
[Section titled “accountChain?”](#accountchain)
> `optional` **accountChain?**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66
Optional account chain identity when the account does not expose a provider.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`Swap2EngineConfig.accountChain`
***
### allowUnlistedTokens?
[Section titled “allowUnlistedTokens?”](#allowunlistedtokens)
> `optional` **allowUnlistedTokens?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107
Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s `getTokenInfo` (a `fromTokenDecimals` that disagrees is refused); an account without it must be given `fromTokenDecimals`. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`Swap2EngineConfig.allowUnlistedTokens`
***
### decodeTonBody?
[Section titled “decodeTonBody?”](#decodetonbody)
> `optional` **decodeTonBody?**: (`bocBase64`) => `unknown`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74
Decodes a base64 BoC into a TON `Cell` for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on `@ton/core`; the caller supplies e.g. `(b) => Cell.fromBase64(b)`. Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.
#### Parameters
[Section titled “Parameters”](#parameters)
##### bocBase64
[Section titled “bocBase64”](#bocbase64)
`string`
#### Returns
[Section titled “Returns”](#returns)
`unknown`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`Swap2EngineConfig.decodeTonBody`
***
### enabled?
[Section titled “enabled?”](#enabled)
> `optional` **enabled?**: `boolean`
Defined in: protocol-swap2-wrap/src/provider.ts:59
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WrapProviderConfig`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/).[`enabled`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/#enabled)
***
### fromChain
[Section titled “fromChain”](#fromchain)
> **fromChain**: `string`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60
CAIP-2 of the chain the bound account lives on (the swap2 source).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`Swap2EngineConfig.fromChain`
***
### maxNetworkFeeBps?
[Section titled “maxNetworkFeeBps?”](#maxnetworkfeebps)
> `optional` **maxNetworkFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:429
Maximum acceptable network fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`Swap2EngineConfig.maxNetworkFeeBps`
***
### maxProtocolFeeBps?
[Section titled “maxProtocolFeeBps?”](#maxprotocolfeebps)
> `optional` **maxProtocolFeeBps?**: `number` | `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:431
Maximum acceptable protocol fee, basis points of the input amount.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`Swap2EngineConfig.maxProtocolFeeBps`
***
### onExecutionPhase?
[Section titled “onExecutionPhase?”](#onexecutionphase)
> `optional` **onExecutionPhase?**: (`phase`, `detail?`) => `void`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62
Progress observer, see Swap2ExecutionPhase.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### phase
[Section titled “phase”](#phase)
`Swap2ExecutionPhase`
##### detail?
[Section titled “detail?”](#detail)
`Swap2ExecutionPhaseDetail`
#### Returns
[Section titled “Returns”](#returns-1)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`Swap2EngineConfig.onExecutionPhase`
***
### reviewExecution?
[Section titled “reviewExecution?”](#reviewexecution)
> `optional` **reviewExecution?**: (`plan`) => `void` | `Promise`<`void`>
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98
Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with `requoted: true`, and throwing then revokes the allowance.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### plan
[Section titled “plan”](#plan)
`Swap2ExecutionPlan`
#### Returns
[Section titled “Returns”](#returns-2)
`void` | `Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`Swap2EngineConfig.reviewExecution`
***
### rpcUrls
[Section titled “rpcUrls”](#rpcurls)
> **rpcUrls**: `Readonly`<`Record`<`number`, readonly `string`\[]>>
Defined in: protocol-swap2-wrap/src/provider.ts:61
JSON-RPC endpoints per EVM chain id (on-chain token check + receipt tracking).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WrapProviderConfig`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/).[`rpcUrls`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/#rpcurls)
***
### serializedNativeAllowance?
[Section titled “serializedNativeAllowance?”](#serializednativeallowance)
> `optional` **serializedNativeAllowance?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81
Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`Swap2EngineConfig.serializedNativeAllowance`
***
### skipAccountChainCheck?
[Section titled “skipAccountChainCheck?”](#skipaccountchaincheck)
> `optional` **skipAccountChainCheck?**: `boolean`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64
Explicit escape hatch for adapters that can prove chain binding elsewhere.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`Swap2EngineConfig.skipAccountChainCheck`
***
### tonGasCeiling?
[Section titled “tonGasCeiling?”](#tongasceiling)
> `optional` **tonGasCeiling?**: `string` | `number` | `bigint`
Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87
The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
`Swap2EngineConfig.tonGasCeiling`
***
### wrapped?
[Section titled “wrapped?”](#wrapped)
> `optional` **wrapped?**: `Readonly`<`Record`<`number`, { `address`: `` `0x${string}` ``; `symbol`: `string`; }>>
Defined in: protocol-swap2-wrap/src/provider.ts:63
Override the wrapped tokens (tests, new chains). Still verified on-chain before use.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WrapProviderConfig`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/).[`wrapped`](/api/anywalletkit/protocol-swap2-wrap/interfaces/wrapproviderconfig/#wrapped)
# WETH_DEPOSIT
> `const` **WETH_DEPOSIT**: `"0xd0e30db0"` = `"0xd0e30db0"`
Defined in: protocol-swap2-wrap/src/activity.ts:14
deposit()
# WETH_WITHDRAW
> `const` **WETH_WITHDRAW**: `"0x2e1a7d4d"` = `"0x2e1a7d4d"`
Defined in: protocol-swap2-wrap/src/activity.ts:16
withdraw(uint256 wad)
# WRAP_MODULE
> `const` **WRAP_MODULE**: `"@anywalletkit/protocol-swap2-wrap"` = `"@anywalletkit/protocol-swap2-wrap"`
Defined in: protocol-swap2-wrap/src/activity.ts:11
# WRAPPED_NATIVE
> `const` **WRAPPED_NATIVE**: `Readonly`<`Record`<`number`, { `address`: `` `0x${string}` ``; `symbol`: `string`; }>>
Defined in: protocol-swap2-wrap/src/provider.ts:14
The chain’s canonical wrapped native token (WETH9-style `deposit()` / `withdraw(uint256)`). Every entry was checked on-chain 2026-10-12: symbol, 18 decimals, non-zero supply, and `deposit()` succeeding for a funded sender. The provider re-checks symbol + decimals once per chain before quoting.
# wrapPins
> `const` **wrapPins**: [`RemotePins`](/api/anywalletkit/protocol-swap2-router/interfaces/remotepins/)
Defined in: protocol-swap2-wrap/src/provider.ts:265
The wrapped-native contract a wrap / unwrap calls on a chain (no spender: neither approves), and [wrapVerifyQuote](/api/anywalletkit/protocol-swap2-wrap/functions/wrapverifyquote/) — the app’s pins for `remoteProvider({name: "wrap", baseUrl, ...wrapPins})` (scan 2026-10-27 modules, F8/F16; the call itself since scan 2026-10-30, F3).
# @anywalletkit/runtime-hermes
# @anywalletkit/runtime-hermes
[Section titled “@anywalletkit/runtime-hermes”](#anywalletkitruntime-hermes)
[](https://www.npmjs.com/package/@anywalletkit/runtime-hermes)
One call, at the app entry, after `react-native-get-random-values`, `buffer` and a TextEncoder polyfill are in place:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
# or: pnpm add @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill · yarn add @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
```
On npm: [@anywalletkit/runtime-hermes](https://www.npmjs.com/package/@anywalletkit/runtime-hermes), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance. React Native / Hermes only; import it first in your entry file.
```ts
import 'react-native-get-random-values'
import { Buffer } from 'buffer'
global.Buffer ??= Buffer
import 'fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min.js'
import 'react-native-url-polyfill/auto'
import { installHermesRuntime } from '@anywalletkit/runtime-hermes'
installHermesRuntime()
```
What it installs, each only when missing:
| | why |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `Buffer.prototype.subarray` keeps the Buffer prototype | Hermes has no `Symbol.species`; `@ton/core`, bitcoinjs-lib and other Node-style libraries call `.copy()` / `.readUInt32BE()` on sliced Buffers |
| `AbortSignal.timeout` / `AbortSignal.any` | missing on Hermes; their absence silently broke every cross-chain swap execution once |
| `crypto.subtle.digest` (SHA-256/384/512 via noble) | the Solana ed25519 polyfill creates `subtle` without `digest` |
| `structuredClone` | missing on older Hermes |
It throws when the things only the app can provide are absent: `crypto.getRandomValues`, `TextEncoder`/`TextDecoder`, and a full WHATWG `URL` (React Native’s built-in one has no working `searchParams`; providers parse endpoints and query strings with it). SDK packages never import this package themselves.
## Metro: `react-native-fast-pbkdf2`
[Section titled “Metro: react-native-fast-pbkdf2”](#metro-react-native-fast-pbkdf2)
`@anywalletkit/wallet-ton` pulls in `@ton/crypto-primitives`, whose React Native build requires the native `react-native-fast-pbkdf2` module (TON 24-word mnemonics) and `expo-crypto`. Install `expo-crypto`, and point Metro at the pure-JS drop-in this package ships instead of the native module:
metro.config.js
```js
const { getDefaultConfig } = require('expo/metro-config')
const config = getDefaultConfig(__dirname)
const resolveRequest = config.resolver.resolveRequest
config.resolver.resolveRequest = (context, moduleName, platform) =>
moduleName === 'react-native-fast-pbkdf2'
? { type: 'sourceFile', filePath: require.resolve('@anywalletkit/runtime-hermes/fast-pbkdf2') }
: (resolveRequest ?? context.resolveRequest)(context, moduleName, platform)
module.exports = config
```
Same call shape as the native module (base64 in, base64 out), PBKDF2 from `@noble/hashes`.
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [HermesRuntimeReport](/api/anywalletkit/runtime-hermes/interfaces/hermesruntimereport/)
## Functions
[Section titled “Functions”](#functions)
* [installAbortSignalAny](/api/anywalletkit/runtime-hermes/functions/installabortsignalany/)
* [installAbortSignalTimeout](/api/anywalletkit/runtime-hermes/functions/installabortsignaltimeout/)
* [installBufferSubarrayFix](/api/anywalletkit/runtime-hermes/functions/installbuffersubarrayfix/)
* [installHermesRuntime](/api/anywalletkit/runtime-hermes/functions/installhermesruntime/)
* [installSecureContext](/api/anywalletkit/runtime-hermes/functions/installsecurecontext/)
* [installStructuredClone](/api/anywalletkit/runtime-hermes/functions/installstructuredclone/)
* [installSubtleDigest](/api/anywalletkit/runtime-hermes/functions/installsubtledigest/)
* [probeUrl](/api/anywalletkit/runtime-hermes/functions/probeurl/)
# installAbortSignalAny
> **installAbortSignalAny**(): `"native"` | `"polyfilled"`
Defined in: index.ts:47
`AbortSignal.any(signals)`.
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"polyfilled"`
# installAbortSignalTimeout
> **installAbortSignalTimeout**(): `"native"` | `"polyfilled"`
Defined in: index.ts:34
`AbortSignal.timeout(ms)` — missing on Hermes; its absence silently broke every swap2 execution once.
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"polyfilled"`
# installBufferSubarrayFix
> **installBufferSubarrayFix**(): `"native"` | `"patched"` | `"no-buffer"`
Defined in: index.ts:86
Hermes has no Symbol.species, so `Buffer.prototype.subarray` (and any other TypedArray method that returns a view) yields a plain Uint8Array — the next `.copy()` / `.readUInt32BE()` on it throws “undefined is not a function”. @ton/core, bitcoinjs-lib and many Node-style libraries slice Buffers this way. Patches the global Buffer (the app installs one from the `buffer` package).
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"patched"` | `"no-buffer"`
# installHermesRuntime
> **installHermesRuntime**(`options?`): [`HermesRuntimeReport`](/api/anywalletkit/runtime-hermes/interfaces/hermesruntimereport/)
Defined in: index.ts:195
Install everything and report. Throws for the two things only the APP can provide (secure randomness, TextEncoder) — a wallet must not run without them.
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
#### throwOnMissing?
[Section titled “throwOnMissing?”](#throwonmissing)
`boolean`
## Returns
[Section titled “Returns”](#returns)
[`HermesRuntimeReport`](/api/anywalletkit/runtime-hermes/interfaces/hermesruntimereport/)
# installSecureContext
> **installSecureContext**(): `"native"` | `"polyfilled"` | `"insecure"`
Defined in: index.ts:179
`globalThis.isSecureContext = true` when the VM has no such flag. @solana/kit refuses `crypto.subtle` outside a secure context, so every program-derived address — associated token accounts, token metadata accounts — threw under Hermes. A browser sets the flag itself (and an http page’s `false` is left alone: ‘insecure’); an app’s JS VM is not a web page and has none.
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"polyfilled"` | `"insecure"`
# installStructuredClone
> **installStructuredClone**(): `"native"` | `"polyfilled"`
Defined in: index.ts:114
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"polyfilled"`
# installSubtleDigest
> **installSubtleDigest**(): `"native"` | `"polyfilled"` | `"unavailable"`
Defined in: index.ts:63
`crypto.subtle.digest` for SHA-256/384/512 via noble — Solana’s ed25519 polyfill creates `subtle` without it.
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"polyfilled"` | `"unavailable"`
# probeUrl
> **probeUrl**(): `"native"` | `"missing"` | `"partial"`
Defined in: index.ts:105
URL/URLSearchParams probe. ‘partial’ = RN’s built-in stub (no searchParams); fix with react-native-url-polyfill/auto.
## Returns
[Section titled “Returns”](#returns)
`"native"` | `"missing"` | `"partial"`
# HermesRuntimeReport
Defined in: index.ts:17
## Properties
[Section titled “Properties”](#properties)
### abortSignalAny
[Section titled “abortSignalAny”](#abortsignalany)
> **abortSignalAny**: `"native"` | `"polyfilled"`
Defined in: index.ts:20
***
### abortSignalTimeout
[Section titled “abortSignalTimeout”](#abortsignaltimeout)
> **abortSignalTimeout**: `"native"` | `"polyfilled"`
Defined in: index.ts:19
***
### bufferSubarray
[Section titled “bufferSubarray”](#buffersubarray)
> **bufferSubarray**: `"native"` | `"patched"` | `"no-buffer"`
Defined in: index.ts:18
***
### getRandomValues
[Section titled “getRandomValues”](#getrandomvalues)
> **getRandomValues**: `"native"` | `"missing"`
Defined in: index.ts:23
***
### secureContext
[Section titled “secureContext”](#securecontext)
> **secureContext**: `"native"` | `"polyfilled"` | `"insecure"`
Defined in: index.ts:28
`globalThis.isSecureContext`, which @solana/kit requires before it touches `crypto.subtle` (every PDA).
***
### structuredClone
[Section titled “structuredClone”](#structuredclone)
> **structuredClone**: `"native"` | `"polyfilled"`
Defined in: index.ts:26
***
### subtleDigest
[Section titled “subtleDigest”](#subtledigest)
> **subtleDigest**: `"native"` | `"polyfilled"` | `"unavailable"`
Defined in: index.ts:21
***
### textEncoder
[Section titled “textEncoder”](#textencoder)
> **textEncoder**: `"native"` | `"missing"`
Defined in: index.ts:22
***
### url
[Section titled “url”](#url)
> **url**: `"native"` | `"missing"` | `"partial"`
Defined in: index.ts:25
WHATWG URL: RN ships a partial one (no working searchParams); providers parse endpoints with it.
# @anywalletkit/secure-storage-react-native
# @anywalletkit/secure-storage-react-native
[Section titled “@anywalletkit/secure-storage-react-native”](#anywalletkitsecure-storage-react-native)
[](https://www.npmjs.com/package/@anywalletkit/secure-storage-react-native)
Where a React Native wallet keeps its seed phrases and private keys. It plugs straight into `@anywalletkit/keyring` as its `SecretStorage`:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/secure-storage-react-native
# or: pnpm add @anywalletkit/secure-storage-react-native · yarn add @anywalletkit/secure-storage-react-native
```
On npm: [@anywalletkit/secure-storage-react-native](https://www.npmjs.com/package/@anywalletkit/secure-storage-react-native), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance. An Expo native module (`expo-modules-core` is its peer, already in every Expo app): use a development build, not Expo Go.
```ts
import { Keyring } from '@anywalletkit/keyring'
import { createSecureStorage } from '@anywalletkit/secure-storage-react-native'
const secrets = createSecureStorage({ namespace: 'my-wallet' })
const keyring = await Keyring.load({ storage, secrets, chains })
```
An Expo module (Swift + Kotlin). It works in Expo apps (prebuild / dev client, not Expo Go) and in bare React Native apps that have `expo-modules-core` installed.
## What it guarantees
[Section titled “What it guarantees”](#what-it-guarantees)
| | iOS | Android (11+) |
| -------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Where the secret lives | Keychain item, data-protection keychain | AES-256-GCM ciphertext in `noBackupFilesDir`; key in Android Keystore |
| What guards a read | `SecAccessControl` checked by the Secure Enclave, on **every** read | Keystore key in StrongBox (or TEE) that needs the user for **every** use (`CryptoObject`, no time window) |
| Leaves the device? | Never: `WhenUnlockedThisDeviceOnly`, not synchronizable, not restored from backups to another phone | Never: the key can’t be exported, the file isn’t in Auto Backup or device-to-device transfer |
| While the phone is locked | Unreadable | Unreadable (`setUnlockedDeviceRequired`) |
| No secure hardware / no passcode | Refused (`no-passcode`) | Refused (`not-available` / `no-passcode`), fail closed |
## Protection modes
[Section titled “Protection modes”](#protection-modes)
* **`biometricsOrPasscode`** (default): Face ID / Touch ID / a fingerprint, with the device passcode as the fallback. Re-enrolling biometrics doesn’t lock the user out.
* **`biometricsOnly`** (opt-in strict mode): only the biometrics enrolled **now**, with no passcode fallback. Someone who watched the user type the passcode and then stole the phone still can’t open it. Adding or removing a face or finger makes the secret unreadable for good, and reads throw `biometry-changed`. Offer this only to users who have a backup.
```ts
await secrets.set(id, phrase) // default mode
await secrets.setProtection(id, 'biometricsOnly') // one read, then rewritten
const { biometry, passcodeSet, hardware } = await secrets.capabilities()
```
## Around the keyring
[Section titled “Around the keyring”](#around-the-keyring)
* **`list()` / `info(id)` / `has(id)`** read only public metadata, with no prompt.
* **`prune(keepIds)`**: the iOS Keychain survives an uninstall, but the app’s account list does not. Call this on start-up with the ids your app still knows, and orphaned secrets from a previous install are deleted.
* **`migrateFrom(oldStore, ids)`** moves secrets out of `expo-secure-store` or anything else. For each id it copies the secret, reads it back, compares, and only then deletes the old copy. If the user cancels or the comparison fails, the old copy stays.
* **Replacing a secret** writes a fresh slot first and removes the old one afterwards. A cancelled or failed write never loses the secret.
* **An old copy that cannot be removed** is never left silently. `set` and `setProtection` reject with `stale-copy` (the new copy is stored; the old one may be under the weaker protection), `info` / `list` report the weakest protection of the copies still stored, and the store retries the removal on its next operation, on first use after a restart and in `prune`. Retry `setProtection` before you tell the user strict mode is on; it resolves once the old copy is gone.
## Errors
[Section titled “Errors”](#errors)
Every failure is a `SecureStorageError` with a `code`: `cancelled`, `biometry-changed`, `lockout`, `no-passcode`, `not-available`, `locked`, `auth-failed`, `invalid`, `storage`, `stale-copy`. Branch on `isSecureStorageError(err, 'biometry-changed')` and send the user to restore from backup.
## Prompts
[Section titled “Prompts”](#prompts)
Pass `prompts: { unlock: { reason, title, cancel }, save: {...} }`, or a `prompt` per call:
* **iOS** shows `reason` under Face ID, and writes never prompt.
* **Android** shows `title` / `reason` and prompts on writes too, because a Keystore key that needs the user can’t encrypt without them.
The app’s `Info.plist` needs `NSFaceIDUsageDescription`.
## Classes
[Section titled “Classes”](#classes)
* [SecureStorageError](/api/anywalletkit/secure-storage-react-native/classes/securestorageerror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [DeviceSecretStorage](/api/anywalletkit/secure-storage-react-native/interfaces/devicesecretstorage/)
* [MigrateOptions](/api/anywalletkit/secure-storage-react-native/interfaces/migrateoptions/)
* [MigrationResult](/api/anywalletkit/secure-storage-react-native/interfaces/migrationresult/)
* [MigrationSource](/api/anywalletkit/secure-storage-react-native/interfaces/migrationsource/)
* [NativeCapabilities](/api/anywalletkit/secure-storage-react-native/interfaces/nativecapabilities/)
* [NativeEntry](/api/anywalletkit/secure-storage-react-native/interfaces/nativeentry/)
* [NativePrompt](/api/anywalletkit/secure-storage-react-native/interfaces/nativeprompt/)
* [NativeSecureStorage](/api/anywalletkit/secure-storage-react-native/interfaces/nativesecurestorage/)
* [PromptText](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
* [SecureStorageOptions](/api/anywalletkit/secure-storage-react-native/interfaces/securestorageoptions/)
* [SetSecretOptions](/api/anywalletkit/secure-storage-react-native/interfaces/setsecretoptions/)
* [StoredSecretInfo](/api/anywalletkit/secure-storage-react-native/interfaces/storedsecretinfo/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [Protection](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
* [SecureStorageErrorCode](/api/anywalletkit/secure-storage-react-native/type-aliases/securestorageerrorcode/)
## Variables
[Section titled “Variables”](#variables)
* [PROTECTIONS](/api/anywalletkit/secure-storage-react-native/variables/protections/)
## Functions
[Section titled “Functions”](#functions)
* [createSecureStorage](/api/anywalletkit/secure-storage-react-native/functions/createsecurestorage/)
* [isSecureStorageError](/api/anywalletkit/secure-storage-react-native/functions/issecurestorageerror/)
# SecureStorageError
Defined in: errors.ts:32
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SecureStorageError**(`code`, `message`, `options?`): `SecureStorageError`
Defined in: errors.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`SecureStorageErrorCode`](/api/anywalletkit/secure-storage-react-native/type-aliases/securestorageerrorcode/)
##### message
[Section titled “message”](#message)
`string`
##### options?
[Section titled “options?”](#options)
###### cause?
[Section titled “cause?”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`SecureStorageError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`SecureStorageErrorCode`](/api/anywalletkit/secure-storage-react-native/type-aliases/securestorageerrorcode/)
Defined in: errors.ts:35
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `"SecureStorageError"` = `'SecureStorageError'`
Defined in: errors.ts:33
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Error.name`
# createSecureStorage
> **createSecureStorage**(`options?`): [`DeviceSecretStorage`](/api/anywalletkit/secure-storage-react-native/interfaces/devicesecretstorage/)
Defined in: storage.ts:121
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`SecureStorageOptions`](/api/anywalletkit/secure-storage-react-native/interfaces/securestorageoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`DeviceSecretStorage`](/api/anywalletkit/secure-storage-react-native/interfaces/devicesecretstorage/)
# isSecureStorageError
> **isSecureStorageError**(`err`, `code?`): `err is SecureStorageError`
Defined in: errors.ts:43
## Parameters
[Section titled “Parameters”](#parameters)
### err
[Section titled “err”](#err)
`unknown`
### code?
[Section titled “code?”](#code)
[`SecureStorageErrorCode`](/api/anywalletkit/secure-storage-react-native/type-aliases/securestorageerrorcode/)
## Returns
[Section titled “Returns”](#returns)
`err is SecureStorageError`
# DeviceSecretStorage
Defined in: storage.ts:66
Device secret storage. Structurally a keyring `SecretStorage` (`get` / `set` / `delete`) plus what a wallet app needs around it.
## Methods
[Section titled “Methods”](#methods)
### capabilities()
[Section titled “capabilities()”](#capabilities)
> **capabilities**(): `Promise`<[`NativeCapabilities`](/api/anywalletkit/secure-storage-react-native/interfaces/nativecapabilities/)>
Defined in: storage.ts:104
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`NativeCapabilities`](/api/anywalletkit/secure-storage-react-native/interfaces/nativecapabilities/)>
***
### delete()
[Section titled “delete()”](#delete)
> **delete**(`id`): `Promise`<`void`>
Defined in: storage.ts:77
#### Parameters
[Section titled “Parameters”](#parameters)
##### id
[Section titled “id”](#id)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`id`, `options?`): `Promise`<`string` | `null`>
Defined in: storage.ts:68
The secret, after the OS sheet. null when nothing is stored under `id`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id-1)
`string`
##### options?
[Section titled “options?”](#options)
###### prompt?
[Section titled “prompt?”](#prompt)
[`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `null`>
***
### has()
[Section titled “has()”](#has)
> **has**(`id`): `Promise`<`boolean`>
Defined in: storage.ts:79
Is something stored under `id` — no prompt.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### id
[Section titled “id”](#id-2)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`boolean`>
***
### info()
[Section titled “info()”](#info)
> **info**(`id`): `Promise`<[`StoredSecretInfo`](/api/anywalletkit/secure-storage-react-native/interfaces/storedsecretinfo/) | `null`>
Defined in: storage.ts:84
Public facts about one secret — no prompt. `protection` is the weakest among the copies stored: an older copy left behind by a failed removal counts until it is gone.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### id
[Section titled “id”](#id-3)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`StoredSecretInfo`](/api/anywalletkit/secure-storage-react-native/interfaces/storedsecretinfo/) | `null`>
***
### list()
[Section titled “list()”](#list)
> **list**(): `Promise`<[`StoredSecretInfo`](/api/anywalletkit/secure-storage-react-native/interfaces/storedsecretinfo/)\[]>
Defined in: storage.ts:86
Every secret in this namespace — no prompt; `protection` as in [info](/api/anywalletkit/secure-storage-react-native/interfaces/devicesecretstorage/#info).
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`StoredSecretInfo`](/api/anywalletkit/secure-storage-react-native/interfaces/storedsecretinfo/)\[]>
***
### migrateFrom()
[Section titled “migrateFrom()”](#migratefrom)
> **migrateFrom**(`source`, `ids`, `options?`): `Promise`<[`MigrationResult`](/api/anywalletkit/secure-storage-react-native/interfaces/migrationresult/)>
Defined in: storage.ts:103
Copy secrets from an older store, verify, then delete the old copies.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### source
[Section titled “source”](#source)
[`MigrationSource`](/api/anywalletkit/secure-storage-react-native/interfaces/migrationsource/)
##### ids
[Section titled “ids”](#ids)
`Iterable`<`string`>
##### options?
[Section titled “options?”](#options-1)
[`MigrateOptions`](/api/anywalletkit/secure-storage-react-native/interfaces/migrateoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`MigrationResult`](/api/anywalletkit/secure-storage-react-native/interfaces/migrationresult/)>
***
### prune()
[Section titled “prune()”](#prune)
> **prune**(`keep`): `Promise`<`string`\[]>
Defined in: storage.ts:101
Delete every secret whose id is not in `keep` and return those ids. Run it on start-up against the app’s own account list: the iOS Keychain outlives an uninstall, the app’s metadata does not. Older copies of the kept secrets left by a failed removal are removed too (rejects with `stale-copy` when one stays).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### keep
[Section titled “keep”](#keep)
`Iterable`<`string`>
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`string`\[]>
***
### set()
[Section titled “set()”](#set)
> **set**(`id`, `secret`, `options?`): `Promise`<`void`>
Defined in: storage.ts:76
Store or replace. The new version is written to a fresh slot first and the old one removed only afterwards, so a failed write never loses the secret. Never prompts on iOS; prompts once on Android (Keystore keys need the user for every use). Rejects with `stale-copy` when the new version is stored but an older copy could not be removed; the store retries that removal on its next operation.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### id
[Section titled “id”](#id-4)
`string`
##### secret
[Section titled “secret”](#secret)
`string`
##### options?
[Section titled “options?”](#options-2)
[`SetSecretOptions`](/api/anywalletkit/secure-storage-react-native/interfaces/setsecretoptions/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`void`>
***
### setProtection()
[Section titled “setProtection()”](#setprotection)
> **setProtection**(`id`, `protection`, `options?`): `Promise`<`void`>
Defined in: storage.ts:94
Switch one secret between `biometricsOrPasscode` and `biometricsOnly`. Reads it (one sheet) and writes it again under the new access control. Resolves only once no copy under the old protection is left: rejects with `stale-copy` when the new copy is stored but the old one could not be removed. Calling it again retries the removal (no sheet when the newest copy already has `protection`).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### id
[Section titled “id”](#id-5)
`string`
##### protection
[Section titled “protection”](#protection)
[`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
##### options?
[Section titled “options?”](#options-3)
###### prompt?
[Section titled “prompt?”](#prompt-1)
[`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`void`>
# MigrateOptions
Defined in: storage.ts:42
## Properties
[Section titled “Properties”](#properties)
### prompt?
[Section titled “prompt?”](#prompt)
> `optional` **prompt?**: [`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
Defined in: storage.ts:50
***
### protection?
[Section titled “protection?”](#protection)
> `optional` **protection?**: [`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
Defined in: storage.ts:43
***
### verify?
[Section titled “verify?”](#verify)
> `optional` **verify?**: `boolean`
Defined in: storage.ts:49
Read the new copy back and compare before deleting the old one (one extra prompt per secret, once). Default true — leave it on unless the platform already prompted inside `set` and the app accepts the risk.
# MigrationResult
Defined in: storage.ts:53
## Properties
[Section titled “Properties”](#properties)
### alreadyPresent
[Section titled “alreadyPresent”](#alreadypresent)
> **alreadyPresent**: `string`\[]
Defined in: storage.ts:59
The new store already holds this id; the old copy was left alone for the app to decide.
***
### empty
[Section titled “empty”](#empty)
> **empty**: `string`\[]
Defined in: storage.ts:57
The old store had nothing under this id.
***
### migrated
[Section titled “migrated”](#migrated)
> **migrated**: `string`\[]
Defined in: storage.ts:55
Copied, verified, removed from the old store.
# MigrationSource
Defined in: storage.ts:35
## Methods
[Section titled “Methods”](#methods)
### delete()
[Section titled “delete()”](#delete)
> **delete**(`id`): `Promise`<`void`>
Defined in: storage.ts:39
Remove it from the old store — called only after the copy was read back and matched.
#### Parameters
[Section titled “Parameters”](#parameters)
##### id
[Section titled “id”](#id)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`void`>
***
### get()
[Section titled “get()”](#get)
> **get**(`id`): `Promise`<`string` | `null`>
Defined in: storage.ts:37
Read the secret from the old store (may prompt). null = nothing there.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### id
[Section titled “id”](#id-1)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string` | `null`>
# NativeCapabilities
Defined in: native.ts:10
## Properties
[Section titled “Properties”](#properties)
### biometry
[Section titled “biometry”](#biometry)
> **biometry**: `"faceId"` | `"touchId"` | `"opticId"` | `"fingerprint"` | `"face"` | `"iris"` | `"biometric"` | `null`
Defined in: native.ts:15
The enrolled biometry, or null when none is enrolled (strict mode then refuses).
***
### hardware
[Section titled “hardware”](#hardware)
> **hardware**: `"secureEnclave"` | `"strongBox"` | `"tee"` | `null`
Defined in: native.ts:17
Where keys live: iOS Secure Enclave–guarded Keychain, Android StrongBox or TEE; null = unavailable.
***
### passcodeSet
[Section titled “passcodeSet”](#passcodeset)
> **passcodeSet**: `boolean`
Defined in: native.ts:13
The device has a passcode / secure lock screen — nothing can be stored without one.
***
### platform
[Section titled “platform”](#platform)
> **platform**: `"ios"` | `"android"`
Defined in: native.ts:11
# NativeEntry
Defined in: native.ts:4
One stored entry as the native side reports it — no secret, no prompt.
## Properties
[Section titled “Properties”](#properties)
### key
[Section titled “key”](#key)
> **key**: `string`
Defined in: native.ts:5
***
### meta
[Section titled “meta”](#meta)
> **meta**: `string`
Defined in: native.ts:7
JSON written by the native side: `{ "p": Protection, "t": createdAtMs }`.
# NativePrompt
Defined in: native.ts:34
Text for the OS sheet. iOS shows `reason` under Face ID; Android shows `title` / `subtitle` / `cancel`.
## Properties
[Section titled “Properties”](#properties)
### cancel
[Section titled “cancel”](#cancel)
> **cancel**: `string`
Defined in: native.ts:38
***
### reason
[Section titled “reason”](#reason)
> **reason**: `string`
Defined in: native.ts:35
***
### subtitle?
[Section titled “subtitle?”](#subtitle)
> `optional` **subtitle?**: `string`
Defined in: native.ts:37
***
### title
[Section titled “title”](#title)
> **title**: `string`
Defined in: native.ts:36
# NativeSecureStorage
Defined in: native.ts:25
The native module surface (`AnyWalletKitSecureStorage`). Keys are opaque here; slots, ids and policy live in the JS layer. Every method rejects with an `ERR_FW_*` code (see errors.ts).
## Methods
[Section titled “Methods”](#methods)
### capabilities()
[Section titled “capabilities()”](#capabilities)
> **capabilities**(): `Promise`<[`NativeCapabilities`](/api/anywalletkit/secure-storage-react-native/interfaces/nativecapabilities/)>
Defined in: native.ts:30
#### Returns
[Section titled “Returns”](#returns)
`Promise`<[`NativeCapabilities`](/api/anywalletkit/secure-storage-react-native/interfaces/nativecapabilities/)>
***
### deleteItem()
[Section titled “deleteItem()”](#deleteitem)
> **deleteItem**(`namespace`, `key`): `Promise`<`void`>
Defined in: native.ts:28
#### Parameters
[Section titled “Parameters”](#parameters)
##### namespace
[Section titled “namespace”](#namespace)
`string`
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### getItem()
[Section titled “getItem()”](#getitem)
> **getItem**(`namespace`, `key`, `prompt`): `Promise`<`string` | `null`>
Defined in: native.ts:27
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### namespace
[Section titled “namespace”](#namespace-1)
`string`
##### key
[Section titled “key”](#key-1)
`string`
##### prompt
[Section titled “prompt”](#prompt)
[`NativePrompt`](/api/anywalletkit/secure-storage-react-native/interfaces/nativeprompt/)
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string` | `null`>
***
### listItems()
[Section titled “listItems()”](#listitems)
> **listItems**(`namespace`): `Promise`<[`NativeEntry`](/api/anywalletkit/secure-storage-react-native/interfaces/nativeentry/)\[]>
Defined in: native.ts:29
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### namespace
[Section titled “namespace”](#namespace-2)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`NativeEntry`](/api/anywalletkit/secure-storage-react-native/interfaces/nativeentry/)\[]>
***
### setItem()
[Section titled “setItem()”](#setitem)
> **setItem**(`namespace`, `key`, `value`, `protection`, `prompt`): `Promise`<`void`>
Defined in: native.ts:26
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### namespace
[Section titled “namespace”](#namespace-3)
`string`
##### key
[Section titled “key”](#key-2)
`string`
##### value
[Section titled “value”](#value)
`string`
##### protection
[Section titled “protection”](#protection)
[`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
##### prompt
[Section titled “prompt”](#prompt-1)
[`NativePrompt`](/api/anywalletkit/secure-storage-react-native/interfaces/nativeprompt/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
# PromptText
Defined in: storage.ts:6
Texts for the OS authentication sheet.
## Properties
[Section titled “Properties”](#properties)
### cancel?
[Section titled “cancel?”](#cancel)
> `optional` **cancel?**: `string`
Defined in: storage.ts:12
Android cancel button (strict mode only — the default mode offers the passcode instead).
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: storage.ts:8
iOS: the line under Face ID / the passcode sheet. Android: the subtitle.
***
### title?
[Section titled “title?”](#title)
> `optional` **title?**: `string`
Defined in: storage.ts:10
Android sheet title.
# SecureStorageOptions
Defined in: storage.ts:15
## Properties
[Section titled “Properties”](#properties)
### namespace?
[Section titled “namespace?”](#namespace)
> `optional` **namespace?**: `string`
Defined in: storage.ts:20
Keeps one app’s secrets apart from another’s (and from tests). Letters, digits, `.`, `_`, `-`. Default `"default"`.
***
### native?
[Section titled “native?”](#native)
> `optional` **native?**: [`NativeSecureStorage`](/api/anywalletkit/secure-storage-react-native/interfaces/nativesecurestorage/)
Defined in: storage.ts:26
The native module — injected by tests; the installed Expo module otherwise.
***
### prompts?
[Section titled “prompts?”](#prompts)
> `optional` **prompts?**: `object`
Defined in: storage.ts:24
Default sheet text for reads (`unlock`) and, on Android, writes (`save`).
#### save?
[Section titled “save?”](#save)
> `optional` **save?**: [`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
#### unlock?
[Section titled “unlock?”](#unlock)
> `optional` **unlock?**: [`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
***
### protection?
[Section titled “protection?”](#protection)
> `optional` **protection?**: [`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
Defined in: storage.ts:22
Protection for secrets written without an explicit one. Default `biometricsOrPasscode`.
# SetSecretOptions
Defined in: storage.ts:29
## Properties
[Section titled “Properties”](#properties)
### prompt?
[Section titled “prompt?”](#prompt)
> `optional` **prompt?**: [`PromptText`](/api/anywalletkit/secure-storage-react-native/interfaces/prompttext/)
Defined in: storage.ts:32
***
### protection?
[Section titled “protection?”](#protection)
> `optional` **protection?**: [`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
Defined in: storage.ts:31
Defaults to the protection the secret already has, then the store default.
# StoredSecretInfo
Defined in: types.ts:16
Public facts about one stored secret — readable without any prompt.
## Properties
[Section titled “Properties”](#properties)
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: types.ts:20
ms since epoch when this version of the secret was written.
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: types.ts:17
***
### protection
[Section titled “protection”](#protection)
> **protection**: [`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)
Defined in: types.ts:18
# Protection
> **Protection** = `"biometricsOrPasscode"` | `"biometricsOnly"`
Defined in: types.ts:11
Who may open a secret.
* `biometricsOrPasscode` (default) — Face ID / Touch ID / fingerprint, or the device passcode as the fallback. Survives re-enrolling biometrics.
* `biometricsOnly` — the biometrics enrolled *now*, no passcode fallback. A thief who watched the passcode cannot open it; adding or removing a face / finger makes it unreadable for good (`biometry-changed`). Opt-in, and only sensible once the user has a backup.
# SecureStorageErrorCode
> **SecureStorageErrorCode** = `"cancelled"` | `"biometry-changed"` | `"lockout"` | `"no-passcode"` | `"not-available"` | `"locked"` | `"auth-failed"` | `"invalid"` | `"storage"` | `"stale-copy"`
Defined in: errors.ts:20
Every failure the store can report, as a stable code the app can branch on.
* `cancelled` — the user dismissed the Face ID / passcode / fingerprint sheet.
* `biometry-changed` — a strict (`biometricsOnly`) secret whose biometrics were re-enrolled or removed. The OS has made it unreadable for good; the app offers a restore from backup. Never retried.
* `lockout` — too many failed biometric attempts; the OS unlocks it later or with the passcode.
* `no-passcode` — the device has no passcode / screen lock, so nothing can be stored safely.
* `not-available` — the device cannot give the protection asked for (no biometrics enrolled for strict mode, no secure hardware, Android older than 11). Fail closed.
* `locked` — the device is locked; secrets are readable only while it is unlocked.
* `auth-failed` — the OS refused the authentication for another reason.
* `invalid` — a bad id or option, rejected before any native call.
* `storage` — anything else from the Keychain / Keystore / file layer.
* `stale-copy` — the newest copy of a secret is stored, but an older one (maybe under a weaker protection) could not be removed. `info` / `list` report the weakest protection left, and the store retries the removal on its next operation.
# PROTECTIONS
> `const` **PROTECTIONS**: readonly [`Protection`](/api/anywalletkit/secure-storage-react-native/type-aliases/protection/)\[]
Defined in: types.ts:13
# @anywalletkit/seed-vault
# @anywalletkit/seed-vault
[Section titled “@anywalletkit/seed-vault”](#anywalletkitseed-vault)
[](https://www.npmjs.com/package/@anywalletkit/seed-vault)
An encrypted backup file for one wallet secret: a seed phrase or a private key, exactly as the keyring stores it. One file can be opened by one or more **protectors**:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/seed-vault
# or: pnpm add @anywalletkit/seed-vault · yarn add @anywalletkit/seed-vault
```
On npm: [@anywalletkit/seed-vault](https://www.npmjs.com/package/@anywalletkit/seed-vault), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
| Protector | What opens it | Use it for |
| ---------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `password` | A password through Argon2id (19 MiB × 2 by default, at least 10 characters) | A file in iCloud Drive / Google Drive / anywhere. Works across platforms. |
| `key` | Any ≥32-byte secret held somewhere else | A passkey PRF output, a random key in iCloud Keychain / Google Block Store, a hardware key’s hmac-secret |
```ts
import { sealBackup, openBackup, addProtector, encodeBackup, decodeBackup } from '@anywalletkit/seed-vault'
const secret = await secrets.get(sourceId) // the keyring's stored string
const meta = { type: source.type, fingerprint: source.fingerprint, label: source.label }
const file = encodeBackup(await sealBackup(secret, meta, [{ kind: 'password', password }]))
// later, on any device
const opened = await openBackup(decodeBackup(file), { kind: 'password', password })
if (opened.meta.fingerprint !== expected) … // compare before writing anything
await secrets.set(sourceId, opened.text())
opened.dispose() // zeroizes the bytes
```
## The format
[Section titled “The format”](#the-format)
* **Payload:** the secret is encrypted once with a random 32-byte data key (XChaCha20-Poly1305).
* The header (format, version, created-at, `meta`) is authenticated as associated data.
* Changing the fingerprint or label in the file makes it fail to open (`corrupted`).
* **Protectors:** each one wraps the same data key with its own key-encryption key, and its descriptor is authenticated.
* Lowering the Argon2 cost in the file, or renaming a key, makes that protector fail.
* **Changing protectors:** `addProtector` / `removeProtector` change who can open the file without re-encrypting the secret. The last protector cannot be removed.
* **Decoding:** `decodeBackup` is strict.
* It refuses an unknown format, version, cipher or KDF, and it rebuilds the object from known fields only.
* It bounds Argon2 costs (≤ 1 GiB, t ≤ 16), so a malicious file can’t exhaust the phone’s memory, and refuses a password protector below the cost this SDK seals with (19 MiB × 2), so a cheap-to-brute-force file is never taken for a normal backup.
* **Passwords:** NFKC-normalized, so the same passphrase typed on different keyboards opens the file.
## Speed on phones
[Section titled “Speed on phones”](#speed-on-phones)
Argon2id runs in pure JS by default, and that always works for opening a file.
| Engine | Seal or open (19 MiB × 2) |
| --------- | ------------------------- |
| Hermes | about 6–15 s |
| V8 / Node | about 0.15 s |
Show a native spinner while it runs.
With a native Argon2id you get under a second and can afford a stronger cost. Pass `{ argon2id: nativeImpl, argon2: { m: 64 * 1024, t: 3, p: 1 } }`. The cost is stored in the file, so any device can still open it.
## What it is not
[Section titled “What it is not”](#what-it-is-not)
* It doesn’t upload files. That is `backup-cloud`.
* It doesn’t store secrets on the device. That is `@anywalletkit/secure-storage-react-native`.
* It doesn’t split secrets into shares (Shamir). That is planned as an extra protector kind.
* It doesn’t use keystore v3 (Ethereum JSON) files.
## Classes
[Section titled “Classes”](#classes)
* [BackupError](/api/anywalletkit/seed-vault/classes/backuperror/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [Argon2Params](/api/anywalletkit/seed-vault/interfaces/argon2params/)
* [BackupEnvelope](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
* [BackupMeta](/api/anywalletkit/seed-vault/interfaces/backupmeta/)
* [KdfOptions](/api/anywalletkit/seed-vault/interfaces/kdfoptions/)
* [OpenedBackup](/api/anywalletkit/seed-vault/interfaces/openedbackup/)
* [Sealed](/api/anywalletkit/seed-vault/interfaces/sealed/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [Argon2idImpl](/api/anywalletkit/seed-vault/type-aliases/argon2idimpl/)
* [BackupErrorCode](/api/anywalletkit/seed-vault/type-aliases/backuperrorcode/)
* [Protector](/api/anywalletkit/seed-vault/type-aliases/protector/)
* [ProtectorRecord](/api/anywalletkit/seed-vault/type-aliases/protectorrecord/)
* [Unlock](/api/anywalletkit/seed-vault/type-aliases/unlock/)
## Variables
[Section titled “Variables”](#variables)
* [BACKUP_FORMAT](/api/anywalletkit/seed-vault/variables/backup_format/)
* [BACKUP_VERSION](/api/anywalletkit/seed-vault/variables/backup_version/)
* [DEFAULT_ARGON2](/api/anywalletkit/seed-vault/variables/default_argon2/)
* [MIN_PASSWORD_LENGTH](/api/anywalletkit/seed-vault/variables/min_password_length/)
## Functions
[Section titled “Functions”](#functions)
* [addProtector](/api/anywalletkit/seed-vault/functions/addprotector/)
* [decodeBackup](/api/anywalletkit/seed-vault/functions/decodebackup/)
* [describeBackup](/api/anywalletkit/seed-vault/functions/describebackup/)
* [encodeBackup](/api/anywalletkit/seed-vault/functions/encodebackup/)
* [isBackupError](/api/anywalletkit/seed-vault/functions/isbackuperror/)
* [openBackup](/api/anywalletkit/seed-vault/functions/openbackup/)
* [removeProtector](/api/anywalletkit/seed-vault/functions/removeprotector/)
* [sealBackup](/api/anywalletkit/seed-vault/functions/sealbackup/)
# BackupError
Defined in: errors.ts:10
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BackupError**(`code`, `message`): `BackupError`
Defined in: errors.ts:12
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`BackupErrorCode`](/api/anywalletkit/seed-vault/type-aliases/backuperrorcode/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`BackupError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`BackupErrorCode`](/api/anywalletkit/seed-vault/type-aliases/backuperrorcode/)
Defined in: errors.ts:13
***
### name
[Section titled “name”](#name)
> `readonly` **name**: `"BackupError"` = `'BackupError'`
Defined in: errors.ts:11
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Error.name`
# addProtector
> **addProtector**(`envelope`, `unlock`, `protector`, `opts?`): `Promise`<[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)>
Defined in: envelope.ts:150
Attach another protector (e.g. a passkey after a password backup). Opens with `unlock` first.
## Parameters
[Section titled “Parameters”](#parameters)
### envelope
[Section titled “envelope”](#envelope)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
### unlock
[Section titled “unlock”](#unlock)
[`Unlock`](/api/anywalletkit/seed-vault/type-aliases/unlock/)
### protector
[Section titled “protector”](#protector)
[`Protector`](/api/anywalletkit/seed-vault/type-aliases/protector/)
### opts?
[Section titled “opts?”](#opts)
[`KdfOptions`](/api/anywalletkit/seed-vault/interfaces/kdfoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)>
# decodeBackup
> **decodeBackup**(`text`): [`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
Defined in: envelope.ts:204
Parse and validate a backup file. Unknown formats, versions, algorithms or out-of-bounds costs are refused.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
# describeBackup
> **describeBackup**(`envelope`): `object`
Defined in: envelope.ts:171
What the file says about itself — no secret, no KDF.
## Parameters
[Section titled “Parameters”](#parameters)
### envelope
[Section titled “envelope”](#envelope)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
## Returns
[Section titled “Returns”](#returns)
`object`
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
### meta
[Section titled “meta”](#meta)
> **meta**: [`BackupMeta`](/api/anywalletkit/seed-vault/interfaces/backupmeta/)
### protectors
[Section titled “protectors”](#protectors)
> **protectors**: ({ `kind`: `"password"`; } | { `id`: `string`; `kind`: `"key"`; `label?`: `string`; })\[]
# encodeBackup
> **encodeBackup**(`envelope`): `string`
Defined in: envelope.ts:198
## Parameters
[Section titled “Parameters”](#parameters)
### envelope
[Section titled “envelope”](#envelope)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
## Returns
[Section titled “Returns”](#returns)
`string`
# isBackupError
> **isBackupError**(`err`, `code?`): `err is BackupError`
Defined in: errors.ts:20
## Parameters
[Section titled “Parameters”](#parameters)
### err
[Section titled “err”](#err)
`unknown`
### code?
[Section titled “code?”](#code)
[`BackupErrorCode`](/api/anywalletkit/seed-vault/type-aliases/backuperrorcode/)
## Returns
[Section titled “Returns”](#returns)
`err is BackupError`
# openBackup
> **openBackup**(`envelope`, `unlock`, `opts?`): `Promise`<[`OpenedBackup`](/api/anywalletkit/seed-vault/interfaces/openedbackup/)>
Defined in: envelope.ts:120
Open with one protector. Throws `wrong-password` / `wrong-key` / `corrupted`.
## Parameters
[Section titled “Parameters”](#parameters)
### envelope
[Section titled “envelope”](#envelope)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
### unlock
[Section titled “unlock”](#unlock)
[`Unlock`](/api/anywalletkit/seed-vault/type-aliases/unlock/)
### opts?
[Section titled “opts?”](#opts)
[`KdfOptions`](/api/anywalletkit/seed-vault/interfaces/kdfoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`OpenedBackup`](/api/anywalletkit/seed-vault/interfaces/openedbackup/)>
# removeProtector
> **removeProtector**(`envelope`, `which`): [`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
Defined in: envelope.ts:162
Detach a protector. The last one cannot be removed — the backup would be unopenable.
## Parameters
[Section titled “Parameters”](#parameters)
### envelope
[Section titled “envelope”](#envelope)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
### which
[Section titled “which”](#which)
{ `kind`: `"password"`; } | { `id`: `string`; `kind`: `"key"`; }
## Returns
[Section titled “Returns”](#returns)
[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)
# sealBackup
> **sealBackup**(`secret`, `meta`, `protectors`, `opts?`): `Promise`<[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)>
Defined in: envelope.ts:100
Seal `secret` (the keyring’s stored string, or raw bytes) for every protector.
## Parameters
[Section titled “Parameters”](#parameters)
### secret
[Section titled “secret”](#secret)
`string` | `Uint8Array`<`ArrayBufferLike`>
### meta
[Section titled “meta”](#meta)
[`BackupMeta`](/api/anywalletkit/seed-vault/interfaces/backupmeta/)
### protectors
[Section titled “protectors”](#protectors)
[`Protector`](/api/anywalletkit/seed-vault/type-aliases/protector/)\[]
### opts?
[Section titled “opts?”](#opts)
[`KdfOptions`](/api/anywalletkit/seed-vault/interfaces/kdfoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`BackupEnvelope`](/api/anywalletkit/seed-vault/interfaces/backupenvelope/)>
# Argon2Params
Defined in: envelope.ts:18
Argon2id cost. Default = OWASP’s minimum recommendation (19 MiB, 2 passes): \~6 s in pure JS on Hermes, well under a second with a native implementation — pass a stronger one (e.g. 64 MiB × 3) together with `argon2id` on devices that have it.
## Properties
[Section titled “Properties”](#properties)
### m
[Section titled “m”](#m)
> **m**: `number`
Defined in: envelope.ts:20
Memory in KiB.
***
### p
[Section titled “p”](#p)
> **p**: `number`
Defined in: envelope.ts:24
Lanes.
***
### t
[Section titled “t”](#t)
> **t**: `number`
Defined in: envelope.ts:22
Passes.
# BackupEnvelope
Defined in: envelope.ts:79
The backup file. JSON-safe as is: `encodeBackup` / `decodeBackup`.
## Properties
[Section titled “Properties”](#properties)
### createdAt
[Section titled “createdAt”](#createdat)
> **createdAt**: `number`
Defined in: envelope.ts:82
***
### format
[Section titled “format”](#format)
> **format**: `"forgewallet-backup"`
Defined in: envelope.ts:80
***
### meta
[Section titled “meta”](#meta)
> **meta**: [`BackupMeta`](/api/anywalletkit/seed-vault/interfaces/backupmeta/)
Defined in: envelope.ts:83
***
### payload
[Section titled “payload”](#payload)
> **payload**: `object` & [`Sealed`](/api/anywalletkit/seed-vault/interfaces/sealed/)
Defined in: envelope.ts:84
#### Type Declaration
[Section titled “Type Declaration”](#type-declaration)
##### alg
[Section titled “alg”](#alg)
> **alg**: `"xchacha20poly1305"`
***
### protectors
[Section titled “protectors”](#protectors)
> **protectors**: [`ProtectorRecord`](/api/anywalletkit/seed-vault/type-aliases/protectorrecord/)\[]
Defined in: envelope.ts:85
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: envelope.ts:81
# BackupMeta
Defined in: envelope.ts:47
Public, authenticated facts about the secret — compare them with the keyring before restoring.
## Properties
[Section titled “Properties”](#properties)
### chain?
[Section titled “chain?”](#chain)
> `optional` **chain?**: `string`
Defined in: envelope.ts:53
***
### fingerprint
[Section titled “fingerprint”](#fingerprint)
> **fingerprint**: `string`
Defined in: envelope.ts:51
Keyring duplicate-check fingerprint (BIP-32 master fingerprint for a seed).
***
### label?
[Section titled “label?”](#label)
> `optional` **label?**: `string`
Defined in: envelope.ts:52
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: envelope.ts:49
Keyring source type: ‘mnemonic’ | ‘privateKey’ | ‘tonMnemonic’ | …
# KdfOptions
Defined in: envelope.ts:37
## Properties
[Section titled “Properties”](#properties)
### argon2?
[Section titled “argon2?”](#argon2)
> `optional` **argon2?**: [`Argon2Params`](/api/anywalletkit/seed-vault/interfaces/argon2params/)
Defined in: envelope.ts:41
Cost for a new password protector. Default DEFAULT_ARGON2; never below it.
***
### argon2id?
[Section titled “argon2id?”](#argon2id)
> `optional` **argon2id?**: [`Argon2idImpl`](/api/anywalletkit/seed-vault/type-aliases/argon2idimpl/)
Defined in: envelope.ts:39
Faster Argon2id; the pure-JS one is used otherwise (and always works to open a backup).
***
### onProgress?
[Section titled “onProgress?”](#onprogress)
> `optional` **onProgress?**: (`progress`) => `void`
Defined in: envelope.ts:43
Progress 0…1 of the pure-JS Argon2id, for a progress bar.
#### Parameters
[Section titled “Parameters”](#parameters)
##### progress
[Section titled “progress”](#progress)
`number`
#### Returns
[Section titled “Returns”](#returns)
`void`
# OpenedBackup
Defined in: envelope.ts:89
An opened backup. Read the secret, then `dispose()` — the bytes are zeroized.
## Properties
[Section titled “Properties”](#properties)
### bytes
[Section titled “bytes”](#bytes)
> `readonly` **bytes**: `Uint8Array`
Defined in: envelope.ts:91
***
### meta
[Section titled “meta”](#meta)
> `readonly` **meta**: [`BackupMeta`](/api/anywalletkit/seed-vault/interfaces/backupmeta/)
Defined in: envelope.ts:90
## Methods
[Section titled “Methods”](#methods)
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: envelope.ts:93
#### Returns
[Section titled “Returns”](#returns)
`void`
***
### text()
[Section titled “text()”](#text)
> **text**(): `string`
Defined in: envelope.ts:92
#### Returns
[Section titled “Returns”](#returns-1)
`string`
# Sealed
Defined in: envelope.ts:69
## Properties
[Section titled “Properties”](#properties)
### ct
[Section titled “ct”](#ct)
> **ct**: `string`
Defined in: envelope.ts:71
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `string`
Defined in: envelope.ts:70
# Argon2idImpl
> **Argon2idImpl** = (`password`, `salt`, `params`) => `Promise`<`Uint8Array`>
Defined in: envelope.ts:35
A native Argon2id (e.g. react-native-quick-crypto): same inputs and output as RFC 9106, 32-byte output.
## Parameters
[Section titled “Parameters”](#parameters)
### password
[Section titled “password”](#password)
`Uint8Array`
### salt
[Section titled “salt”](#salt)
`Uint8Array`
### params
[Section titled “params”](#params)
[`Argon2Params`](/api/anywalletkit/seed-vault/interfaces/argon2params/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<`Uint8Array`>
# BackupErrorCode
> **BackupErrorCode** = `"wrong-password"` | `"wrong-key"` | `"corrupted"` | `"unsupported"` | `"weak-password"` | `"invalid"`
Defined in: errors.ts:8
* `wrong-password` / `wrong-key` — the protector did not open (or the file was altered there).
* `corrupted` — the protector opened but the payload or its metadata fails authentication.
* `unsupported` — a format, version or algorithm this build does not read.
* `weak-password` — refused when sealing; see MIN_PASSWORD_LENGTH.
* `invalid` — malformed input (decode, a missing protector, out-of-bounds parameters).
# Protector
> **Protector** = { `kind`: `"password"`; `password`: `string`; } | { `id`: `string`; `key`: `Uint8Array`; `kind`: `"key"`; `label?`: `string`; }
Defined in: envelope.ts:57
Who can open a backup. Several can be attached; each one alone opens it.
## Union Members
[Section titled “Union Members”](#union-members)
### Type Literal
[Section titled “Type Literal”](#type-literal)
{ `kind`: `"password"`; `password`: `string`; }
***
### Type Literal
[Section titled “Type Literal”](#type-literal-1)
{ `id`: `string`; `key`: `Uint8Array`; `kind`: `"key"`; `label?`: `string`; }
A ≥32-byte secret held elsewhere: a passkey PRF output, a random key in iCloud Keychain / Google Block Store, a hardware key’s hmac-secret. `id` names it so the app knows which key to fetch (e.g. “passkey:”, “icloud-keychain”).
# ProtectorRecord
> **ProtectorRecord** = `object` & [`Sealed`](/api/anywalletkit/seed-vault/interfaces/sealed/) | `object` & [`Sealed`](/api/anywalletkit/seed-vault/interfaces/sealed/)
Defined in: envelope.ts:74
# Unlock
> **Unlock** = { `kind`: `"password"`; `password`: `string`; } | { `id`: `string`; `key`: `Uint8Array`; `kind`: `"key"`; }
Defined in: envelope.ts:67
What opens a backup: a password, or the key behind one `key` protector.
# BACKUP_FORMAT
> `const` **BACKUP_FORMAT**: `"forgewallet-backup"` = `'forgewallet-backup'`
Defined in: envelope.ts:10
Stable wire identifier: existing backups carry it — never rename.
# BACKUP_VERSION
> `const` **BACKUP_VERSION**: `1` = `1`
Defined in: envelope.ts:11
# DEFAULT_ARGON2
> `const` **DEFAULT_ARGON2**: [`Argon2Params`](/api/anywalletkit/seed-vault/interfaces/argon2params/)
Defined in: envelope.ts:26
# MIN_PASSWORD_LENGTH
> `const` **MIN_PASSWORD_LENGTH**: `10` = `10`
Defined in: envelope.ts:32
A password needs at least this many characters (after NFKC). Suggest four or more random words.
# @anywalletkit/swap2-assets
# @anywalletkit/swap2-assets
[Section titled “@anywalletkit/swap2-assets”](#anywalletkitswap2-assets)
[](https://www.npmjs.com/package/@anywalletkit/swap2-assets)
The cross-chain asset catalog the swap2 packages share: chains by CAIP-2 id, and per chain the native coin plus the major stables, each with decimals, contract (EVM / SPL / TRC-20 / jetton / NEP-141) and icon. It is not a general token list: every entry has been routed through a live provider.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/swap2-assets
# or: pnpm add @anywalletkit/swap2-assets · yarn add @anywalletkit/swap2-assets
```
On npm: [@anywalletkit/swap2-assets](https://www.npmjs.com/package/@anywalletkit/swap2-assets), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import { CC_SOURCE_CHAINS, ccChain, ccAsset, ccAssetByToken, displaySymbol } from '@anywalletkit/swap2-assets'
ccAsset('eip155:8453', 'USDC') // { symbol, assetId, decimals, contract, icon }
```
Tokens the catalog does not list (a user’s own, named by address): `isTokenAddress(chain, ref)` accepts an EVM contract or a Solana mint, `unlistedAsset(chain, contract, decimals)` builds an `UnlistedAsset` whose symbol is the address itself, and `resolveAsset(chain, ref, { allowUnlisted, decimals })` always returns the catalog’s entry first. `catalogChainId` maps ids accounts report (`solana:5eykt4…`) to the catalog’s keys.
No dependencies — usable in an app, a server and a worker alike.
Apache-2.0
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [CcAsset](/api/anywalletkit/swap2-assets/interfaces/ccasset/)
* [CcChain](/api/anywalletkit/swap2-assets/interfaces/ccchain/)
* [UnlistedAsset](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/)
## Variables
[Section titled “Variables”](#variables)
* [CATALOG_CHAIN_ALIASES](/api/anywalletkit/swap2-assets/variables/catalog_chain_aliases/)
* [CC_DEPOSIT_CHAINS](/api/anywalletkit/swap2-assets/variables/cc_deposit_chains/)
* [CC_DEST](/api/anywalletkit/swap2-assets/variables/cc_dest/)
* [CC_OTHER_CHAINS](/api/anywalletkit/swap2-assets/variables/cc_other_chains/)
* [CC_SOURCE_CHAINS](/api/anywalletkit/swap2-assets/variables/cc_source_chains/)
* [ETH_CAIP2](/api/anywalletkit/swap2-assets/variables/eth_caip2/)
## Functions
[Section titled “Functions”](#functions)
* [catalogChainId](/api/anywalletkit/swap2-assets/functions/catalogchainid/)
* [ccAsset](/api/anywalletkit/swap2-assets/functions/ccasset/)
* [ccAssetByToken](/api/anywalletkit/swap2-assets/functions/ccassetbytoken/)
* [ccChain](/api/anywalletkit/swap2-assets/functions/ccchain/)
* [chainIcon](/api/anywalletkit/swap2-assets/functions/chainicon/)
* [cmcIcon](/api/anywalletkit/swap2-assets/functions/cmcicon/)
* [displaySymbol](/api/anywalletkit/swap2-assets/functions/displaysymbol/)
* [iconForSymbol](/api/anywalletkit/swap2-assets/functions/iconforsymbol/)
* [isTokenAddress](/api/anywalletkit/swap2-assets/functions/istokenaddress/)
* [isUnlisted](/api/anywalletkit/swap2-assets/functions/isunlisted/)
* [resolveAsset](/api/anywalletkit/swap2-assets/functions/resolveasset/)
* [unlistedAsset](/api/anywalletkit/swap2-assets/functions/unlistedasset/)
# catalogChainId
> **catalogChainId**(`caip2`): `string`
Defined in: index.ts:1605
The catalog’s key for a chain id (itself when it has no alias).
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# ccAsset
> **ccAsset**(`caip2`, `symbol`): [`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
Defined in: index.ts:1476
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### symbol
[Section titled “symbol”](#symbol)
`string`
## Returns
[Section titled “Returns”](#returns)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
# ccAssetByToken
> **ccAssetByToken**(`caip2`, `token`): [`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
Defined in: index.ts:1508
Reverse lookup for the off-ramp: resolve a catalog asset by its on-chain token id on a chain. `token` is an EVM/SVM contract (case-insensitive) or the zero address / empty string for that chain’s native asset. Providers use this to turn an outbound (destChain, destToken) pair into their own asset notation.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### token
[Section titled “token”](#token)
`string`
## Returns
[Section titled “Returns”](#returns)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
# ccChain
> **ccChain**(`caip2`): [`CcChain`](/api/anywalletkit/swap2-assets/interfaces/ccchain/) | `undefined`
Defined in: index.ts:1458
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
## Returns
[Section titled “Returns”](#returns)
[`CcChain`](/api/anywalletkit/swap2-assets/interfaces/ccchain/) | `undefined`
# chainIcon
> **chainIcon**(`slug`): `string`
Defined in: index.ts:32
Crisp chain logo (Trust Wallet assets, 256px) — the DeFiLlama thumbs are \~48px and blur at retina. `slug` is our chain key; map to TW’s folder.
## Parameters
[Section titled “Parameters”](#parameters)
### slug
[Section titled “slug”](#slug)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# cmcIcon
> **cmcIcon**(`id`, `size?`): `string`
Defined in: index.ts:26
CoinMarketCap static icon. 128px by default: token marks render at 26–36pt on 3x screens (78–108px), where the 64px file blurs; 200 exists for hero sizes.
## Parameters
[Section titled “Parameters”](#parameters)
### id
[Section titled “id”](#id)
`number`
### size?
[Section titled “size?”](#size)
`64` | `128` | `200`
## Returns
[Section titled “Returns”](#returns)
`string`
# displaySymbol
> **displaySymbol**(`caip2`, `symbol`): `string`
Defined in: index.ts:1472
The catalog’s current symbol for a possibly-legacy one (identity otherwise).
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### symbol
[Section titled “symbol”](#symbol)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# iconForSymbol
> **iconForSymbol**(`symbol`): `string` | `undefined`
Defined in: index.ts:1497
## Parameters
[Section titled “Parameters”](#parameters)
### symbol
[Section titled “symbol”](#symbol)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# isTokenAddress
> **isTokenAddress**(`caip2`, `ref`): `boolean`
Defined in: index.ts:1563
Whether `ref` can name a token on `caip2` by address: a non-zero EVM contract address on an `eip155` chain, or a 32-byte base58 mint on Solana. Other chain families are not supported.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### ref
[Section titled “ref”](#ref)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isUnlisted
> **isUnlisted**(`asset`): `asset is UnlistedAsset`
Defined in: index.ts:1581
Whether an asset is an [UnlistedAsset](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/).
## Parameters
[Section titled “Parameters”](#parameters)
### asset
[Section titled “asset”](#asset)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
## Returns
[Section titled “Returns”](#returns)
`asset is UnlistedAsset`
# resolveAsset
> **resolveAsset**(`caip2`, `ref`, `opts?`): [`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
Defined in: index.ts:1590
The asset a swap names by `ref` (a catalog symbol, a contract / mint, or ‘’ for the native coin): the catalog’s entry first, always. With `allowUnlisted` and `decimals`, an address the catalog does not know becomes an [UnlistedAsset](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/); otherwise undefined.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### ref
[Section titled “ref”](#ref)
`string`
### opts?
[Section titled “opts?”](#opts)
#### allowUnlisted?
[Section titled “allowUnlisted?”](#allowunlisted)
`boolean`
#### decimals?
[Section titled “decimals?”](#decimals)
`number`
## Returns
[Section titled “Returns”](#returns)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/) | `undefined`
# unlistedAsset
> **unlistedAsset**(`caip2`, `contract`, `decimals`): [`UnlistedAsset`](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/) | `undefined`
Defined in: index.ts:1574
An [UnlistedAsset](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/) for `contract` on `caip2`, or undefined when the address is malformed, the chain family is not supported, the catalog already lists it, or `decimals` is not an integer from 0 to 77.
## Parameters
[Section titled “Parameters”](#parameters)
### caip2
[Section titled “caip2”](#caip2)
`string`
### contract
[Section titled “contract”](#contract)
`string`
### decimals
[Section titled “decimals”](#decimals)
`number`
## Returns
[Section titled “Returns”](#returns)
[`UnlistedAsset`](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/) | `undefined`
# CcAsset
Defined in: index.ts:10
Curated cross-chain asset catalog (native + major stables per chain), NOT a general token list: every entry has been routed through NEAR Intents in production.
Shared by server providers (assetId resolution) and client pickers (chain/token lists, decimals) — keep it dependency-free.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`UnlistedAsset`](/api/anywalletkit/swap2-assets/interfaces/unlistedasset/)
## Properties
[Section titled “Properties”](#properties)
### assetId
[Section titled “assetId”](#assetid)
> **assetId**: `string`
Defined in: index.ts:13
1Click asset id (nep141/nep245).
***
### contract?
[Section titled “contract?”](#contract)
> `optional` **contract?**: `string` | `null`
Defined in: index.ts:18
On-chain token id (EVM/SPL/TRC contract, TON jetton master). REQUIRED for every non-native asset — null/absent means native, and the off-ramp round trip relies on that invariant.
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: index.ts:14
***
### icon?
[Section titled “icon?”](#icon)
> `optional` **icon?**: `string`
Defined in: index.ts:20
Icon URL (CoinMarketCap static CDN).
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: index.ts:11
# CcChain
Defined in: index.ts:38
## Properties
[Section titled “Properties”](#properties)
### assets
[Section titled “assets”](#assets)
> **assets**: [`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/)\[]
Defined in: index.ts:54
***
### caip2
[Section titled “caip2”](#caip2)
> **caip2**: `string`
Defined in: index.ts:42
CAIP-2 id used across our router/config/db.
***
### hidden?
[Section titled “hidden?”](#hidden)
> `optional` **hidden?**: `boolean`
Defined in: index.ts:50
Parked: kept in the catalog (routing/attribution still resolve it) but hidden from the deposit and off-ramp pickers.
***
### icon?
[Section titled “icon?”](#icon)
> `optional` **icon?**: `string`
Defined in: index.ts:45
Chain icon URL (DeFiLlama).
***
### key
[Section titled “key”](#key)
> **key**: `string`
Defined in: index.ts:40
1Click chain key (their SourceChain naming).
***
### label
[Section titled “label”](#label)
> **label**: `string`
Defined in: index.ts:43
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `boolean`
Defined in: index.ts:47
Deposits to this chain’s address REQUIRE the memo when one is returned.
***
### offrampOnly?
[Section titled “offrampOnly?”](#offramponly)
> `optional` **offrampOnly?**: `boolean`
Defined in: index.ts:53
No inbound route (not in the 1Click registry, and THOR sources are EVM-only) — off-ramp destination only, hidden from deposit pickers.
# UnlistedAsset
Defined in: index.ts:1527
A token the catalog does not list, named only by its contract (EVM) or mint (Solana) — a token the user added at their own risk. `symbol` is the address itself: an unlisted token never claims a catalog symbol, so “USDC” always means the catalog’s USDC.
## Extends
[Section titled “Extends”](#extends)
* [`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/)
## Properties
[Section titled “Properties”](#properties)
### assetId
[Section titled “assetId”](#assetid)
> **assetId**: `string`
Defined in: index.ts:13
1Click asset id (nep141/nep245).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/).[`assetId`](/api/anywalletkit/swap2-assets/interfaces/ccasset/#assetid)
***
### contract
[Section titled “contract”](#contract)
> **contract**: `string`
Defined in: index.ts:1529
On-chain token id (EVM/SPL/TRC contract, TON jetton master). REQUIRED for every non-native asset — null/absent means native, and the off-ramp round trip relies on that invariant.
#### Overrides
[Section titled “Overrides”](#overrides)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/).[`contract`](/api/anywalletkit/swap2-assets/interfaces/ccasset/#contract)
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: index.ts:14
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/).[`decimals`](/api/anywalletkit/swap2-assets/interfaces/ccasset/#decimals)
***
### icon?
[Section titled “icon?”](#icon)
> `optional` **icon?**: `string`
Defined in: index.ts:20
Icon URL (CoinMarketCap static CDN).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/).[`icon`](/api/anywalletkit/swap2-assets/interfaces/ccasset/#icon)
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: index.ts:11
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`CcAsset`](/api/anywalletkit/swap2-assets/interfaces/ccasset/).[`symbol`](/api/anywalletkit/swap2-assets/interfaces/ccasset/#symbol)
***
### unlisted
[Section titled “unlisted”](#unlisted)
> **unlisted**: `true`
Defined in: index.ts:1528
# CATALOG_CHAIN_ALIASES
> `const` **CATALOG_CHAIN_ALIASES**: `Readonly`<`Record`<`string`, `string`>>
Defined in: index.ts:1598
Chain ids accounts report that the catalog keys differently (genesis-hash CAIP-2 → catalog key).
# CC_DEPOSIT_CHAINS
> `const` **CC_DEPOSIT_CHAINS**: [`CcChain`](/api/anywalletkit/swap2-assets/interfaces/ccchain/)\[]
Defined in: index.ts:1448
Deposit pickers only — excludes off-ramp-only destinations.
# CC_DEST
> `const` **CC_DEST**: `object`
Defined in: index.ts:1451
Destination side: the vault always receives native ETH on Ethereum.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### assetId
[Section titled “assetId”](#assetid)
> `readonly` **assetId**: `"nep141:eth.omft.near"` = `"nep141:eth.omft.near"`
### caip2
[Section titled “caip2”](#caip2)
> `readonly` **caip2**: `"eip155:1"` = `ETH_CAIP2`
### decimals
[Section titled “decimals”](#decimals)
> `readonly` **decimals**: `18` = `18`
### token
[Section titled “token”](#token)
> `readonly` **token**: `"0x0000000000000000000000000000000000000000"` = `"0x0000000000000000000000000000000000000000"`
# CC_OTHER_CHAINS
> `const` **CC_OTHER_CHAINS**: [`CcChain`](/api/anywalletkit/swap2-assets/interfaces/ccchain/)\[]
Defined in: index.ts:1443
Every non-Ethereum chain — deposit sources AND off-ramp destinations.
# CC_SOURCE_CHAINS
> `const` **CC_SOURCE_CHAINS**: [`CcChain`](/api/anywalletkit/swap2-assets/interfaces/ccchain/)\[]
Defined in: index.ts:57
# ETH_CAIP2
> `const` **ETH_CAIP2**: `"eip155:1"` = `"eip155:1"`
Defined in: index.ts:1440
# @anywalletkit/tokens
# @anywalletkit/tokens
[Section titled “@anywalletkit/tokens”](#anywalletkittokens)
[](https://www.npmjs.com/package/@anywalletkit/tokens)
Tokens users add themselves, by address and at their own risk: read the token from the chain, warn about what matters before it is saved, keep the list, and swap it through the engines that accept tokens outside the catalog. EVM contracts and Solana mints (Token-2022 included).
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/tokens
# or: pnpm add @anywalletkit/tokens · yarn add @anywalletkit/tokens
```
On npm: [@anywalletkit/tokens](https://www.npmjs.com/package/@anywalletkit/tokens), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Pure TypeScript; depends on `@anywalletkit/swap2-assets` (the catalog it checks against) and takes `@anywalletkit/core` types. Runs under Hermes.
```ts
import { inspectToken, TokensTable, swapSource } from '@anywalletkit/tokens'
const found = await inspectToken(account, '0x6982508145454Ce325dDbE47a25d4ec3d2311933') // an EVM or Solana account
if (found.listed) {
// already in the catalog: nothing to add
} else {
found.assessment // { level: 'caution' | 'danger', risks: [{ code, level, message }] } — show before saving
const tokens = new TokensTable(myJsonStorage) // AsyncStorage / chrome.storage / memoryJsonStorage()
await tokens.load()
await tokens.add(found.token) // after the user accepted the warnings
}
// Swap a user token: the engine must opt in
const swaps = new RouterSwap2Protocol(account, { fromChain: 'eip155:1', providers, allowUnlistedTokens: true })
await swaps.quoteSwap2Routes({ ...swapSource(token), toToken: 'USDC', fromTokenAmount })
```
## What it checks
[Section titled “What it checks”](#what-it-checks)
`inspectToken` calls the account’s `getTokenInfo(address)` (`wallet-evm`, `wallet-solana`): decimals, symbol, name, supply and holder-relevant flags. A wallet, an NFT or a plain contract throws `NotATokenError`. `assessToken(info, chain)` then lists every warning, worst first:
* **danger**: `impersonation` (the symbol reads as a catalog token of the same chain, or as a native coin or major stablecoin anywhere, after folding Cyrillic / Greek look-alikes, `$` → S, `₮` → T, ASCII `l` / `1` / `|` → I and `0` → O, `rn` → m, `cl` → d, `vv` → w, accents, fullwidth and invisible characters), `odd-characters` when the symbol has letters that pass for Latin ones (Cyrillic, Greek, Armenian, Cherokee, Canadian syllabics, small capitals, letterlike, enclosed and math letters) or characters that hide in text (zero-width, bidi), `permanent-delegate`, `transfer-hook`, `non-transferable`;
* **caution**: `unlisted` (always), `upgradeable`, `mint-authority`, `freeze-authority`, `transfer-fee`, `default-frozen`, `pausable`, `odd-characters` (emoji, CJK, accents, a space inside the symbol, odd characters in the name), `no-symbol`, `zero-supply`, `unusual-decimals`.
A user token’s symbol and name are what the token says about itself: display them next to the address, never identify the token by them. Both are trimmed and cut (`tokenText`: symbol `TOKEN_SYMBOL_MAX` = 32, name `TOKEN_NAME_MAX` = 128 code points) before they are stored or assessed, so what is shown is what was checked.
## TokensTable
[Section titled “TokensTable”](#tokenstable)
One JSON value in the app’s storage. `load()` once (a failed read throws and leaves the table unloaded instead of empty), then `list(chain?)` / `get(chain, address)` synchronously; `add` / `remove` queue behind each other and a failed save leaves memory as stored. Catalog tokens, malformed entries and more than `maxTokens` (200) are refused; stored entries that do not validate are dropped on load. Solana is keyed by the catalog’s `solana:mainnet`, whichever id the account reports.
## Testing
[Section titled “Testing”](#testing)
* `pnpm test`: assessment rules (look-alikes, flags, levels), the table (persistence, refusals, failed reads and saves), `inspectToken`.
* `pnpm verify:live`: mainnet reads (PEPE, USDC, MKR, an NFT, BONK, JUP, a wallet) and quotes of tokens outside the catalog through the real router and providers — PEPE ⇄ USDC on Ethereum, PEPE → USDC on Base, BONK ⇄ USDC on Solana — refused without `allowUnlistedTokens`. Nothing is signed.
Apache-2.0
## Classes
[Section titled “Classes”](#classes)
* [TokensError](/api/anywalletkit/tokens/classes/tokenserror/)
* [TokensTable](/api/anywalletkit/tokens/classes/tokenstable/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [JsonStorage](/api/anywalletkit/tokens/interfaces/jsonstorage/)
* [TokenAssessment](/api/anywalletkit/tokens/interfaces/tokenassessment/)
* [TokenRisk](/api/anywalletkit/tokens/interfaces/tokenrisk/)
* [TokensState](/api/anywalletkit/tokens/interfaces/tokensstate/)
* [UserToken](/api/anywalletkit/tokens/interfaces/usertoken/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [TokenInspection](/api/anywalletkit/tokens/type-aliases/tokeninspection/)
* [TokenRiskCode](/api/anywalletkit/tokens/type-aliases/tokenriskcode/)
* [TokenRiskLevel](/api/anywalletkit/tokens/type-aliases/tokenrisklevel/)
* [TokensErrorCode](/api/anywalletkit/tokens/type-aliases/tokenserrorcode/)
## Variables
[Section titled “Variables”](#variables)
* [TOKEN_NAME_MAX](/api/anywalletkit/tokens/variables/token_name_max/)
* [TOKEN_SYMBOL_MAX](/api/anywalletkit/tokens/variables/token_symbol_max/)
## Functions
[Section titled “Functions”](#functions)
* [assessToken](/api/anywalletkit/tokens/functions/assesstoken/)
* [foldSymbol](/api/anywalletkit/tokens/functions/foldsymbol/)
* [inspectToken](/api/anywalletkit/tokens/functions/inspecttoken/)
* [memoryJsonStorage](/api/anywalletkit/tokens/functions/memoryjsonstorage/)
* [swapSource](/api/anywalletkit/tokens/functions/swapsource/)
* [tokenText](/api/anywalletkit/tokens/functions/tokentext/)
# TokensError
Defined in: table.ts:51
A refusal from the tokens table or [inspectToken](/api/anywalletkit/tokens/functions/inspecttoken/), with a machine-readable `code`.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TokensError**(`code`, `message`): `TokensError`
Defined in: table.ts:53
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`TokensErrorCode`](/api/anywalletkit/tokens/type-aliases/tokenserrorcode/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`TokensError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`TokensErrorCode`](/api/anywalletkit/tokens/type-aliases/tokenserrorcode/)
Defined in: table.ts:52
# TokensTable
Defined in: table.ts:131
The user’s own tokens, over any JSON storage: load once at cold start, then read synchronously. Writes queue behind each other; a failed save leaves memory as stored. Tokens the catalog lists are refused (they are already there), and so are addresses that are not EVM contracts or Solana mints.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TokensTable**(`storage`, `options?`): `TokensTable`
Defined in: table.ts:138
#### Parameters
[Section titled “Parameters”](#parameters)
##### storage
[Section titled “storage”](#storage)
[`JsonStorage`](/api/anywalletkit/tokens/interfaces/jsonstorage/)<[`TokensState`](/api/anywalletkit/tokens/interfaces/tokensstate/)>
##### options?
[Section titled “options?”](#options)
###### maxTokens?
[Section titled “maxTokens?”](#maxtokens)
`number`
#### Returns
[Section titled “Returns”](#returns)
`TokensTable`
## Properties
[Section titled “Properties”](#properties)
### maxTokens
[Section titled “maxTokens”](#maxtokens-1)
> `readonly` **maxTokens**: `number`
Defined in: table.ts:136
## Methods
[Section titled “Methods”](#methods)
### add()
[Section titled “add()”](#add)
> **add**(`token`): `Promise`<[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)>
Defined in: table.ts:168
Add (or refresh) a token — usually `inspection.token` after the user accepted the warnings.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### token
[Section titled “token”](#token)
[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)>
***
### get()
[Section titled “get()”](#get)
> **get**(`chain`, `address`): [`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/) | `undefined`
Defined in: table.ts:161
The user token at `address` on `chain`, if added.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### chain
[Section titled “chain”](#chain)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/) | `undefined`
***
### list()
[Section titled “list()”](#list)
> **list**(`chain?`): [`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)\[]
Defined in: table.ts:154
The user’s tokens, oldest first; only those on `chain` when given.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### chain?
[Section titled “chain?”](#chain-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)\[]
***
### load()
[Section titled “load()”](#load)
> **load**(): `Promise`<`void`>
Defined in: table.ts:143
Read the stored list. Call once before the sync reads; a failed read throws and leaves the table unloaded.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`void`>
***
### remove()
[Section titled “remove()”](#remove)
> **remove**(`chain`, `address`): `Promise`<`boolean`>
Defined in: table.ts:181
Remove a token. Returns whether it was there.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### chain
[Section titled “chain”](#chain-2)
`string`
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`boolean`>
***
### subscribe()
[Section titled “subscribe()”](#subscribe)
> **subscribe**(`fn`): () => `void`
Defined in: table.ts:148
Called after every successful write. Returns the unsubscribe function.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### fn
[Section titled “fn”](#fn)
() => `void`
#### Returns
[Section titled “Returns”](#returns-6)
() => `void`
# assessToken
> **assessToken**(`info`, `chain?`): [`TokenAssessment`](/api/anywalletkit/tokens/interfaces/tokenassessment/)
Defined in: assess.ts:168
Warnings for a token read with `getTokenInfo`, for a token the wallet’s list does not include. Pure: nothing is fetched. `impersonation` when its symbol (look-alike letters folded) reads as a catalog token on the same `chain` — the real one would be in the list, this is another contract — or as a native coin or major stablecoin anywhere. A bridged token of another chain’s list (JUP on Solana, listed on Unichain) is not flagged.
## Parameters
[Section titled “Parameters”](#parameters)
### info
[Section titled “info”](#info)
`TokenInfo`
### chain?
[Section titled “chain?”](#chain)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TokenAssessment`](/api/anywalletkit/tokens/interfaces/tokenassessment/)
# foldSymbol
> **foldSymbol**(`text`): `string`
Defined in: assess.ts:98
A symbol folded the way a reader sees it — a confusables skeleton in the spirit of UTS #39: invisible characters and spaces gone, compatibility forms unified and accents dropped (NFKD), look-alike letters mapped (Cyrillic, Greek, currency signs, and ASCII l / 1 / | → I, 0 → O; rn → m, cl → d, vv → w), upper case. Only the first [TOKEN_SYMBOL_MAX](/api/anywalletkit/tokens/variables/token_symbol_max/) code points are read (scan 2026-10-27 modules, F36).
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# inspectToken
> **inspectToken**(`account`, `address`, `now?`): `Promise`<[`TokenInspection`](/api/anywalletkit/tokens/type-aliases/tokeninspection/)>
Defined in: table.ts:88
Read a token from the chain through `account` (its chain decides where) and assess it. A token the catalog already lists comes back as `{ listed }`: nothing to add. Otherwise the token, ready for [TokensTable.add](/api/anywalletkit/tokens/classes/tokenstable/#add), and the warnings to show first. Throws [TokensError](/api/anywalletkit/tokens/classes/tokenserror/) (`unsupported-chain`, `bad-address`) or the chain package’s `NotATokenError`.
## Parameters
[Section titled “Parameters”](#parameters)
### account
[Section titled “account”](#account)
`Pick`<`IWalletAccountReadOnly`, `"chain"` | `"getTokenInfo"`> & `object`
### address
[Section titled “address”](#address)
`string`
### now?
[Section titled “now?”](#now)
() => `number`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`TokenInspection`](/api/anywalletkit/tokens/type-aliases/tokeninspection/)>
# memoryJsonStorage
> **memoryJsonStorage**<`T`>(`initial?`): [`JsonStorage`](/api/anywalletkit/tokens/interfaces/jsonstorage/)<`T`> & `object`
Defined in: table.ts:14
In-memory storage for tests and smoke runs.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Parameters
[Section titled “Parameters”](#parameters)
### initial?
[Section titled “initial?”](#initial)
`T` | `null`
## Returns
[Section titled “Returns”](#returns)
[`JsonStorage`](/api/anywalletkit/tokens/interfaces/jsonstorage/)<`T`> & `object`
# swapSource
> **swapSource**(`token`): `object`
Defined in: table.ts:122
The swap options that name a user token as the source: its address and decimals. Pass them to an engine created with `allowUnlistedTokens: true`.
## Parameters
[Section titled “Parameters”](#parameters)
### token
[Section titled “token”](#token)
`Pick`<[`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/), `"address"` | `"decimals"`>
## Returns
[Section titled “Returns”](#returns)
`object`
### fromToken
[Section titled “fromToken”](#fromtoken)
> **fromToken**: `string`
### fromTokenDecimals
[Section titled “fromTokenDecimals”](#fromtokendecimals)
> **fromTokenDecimals**: `number`
# tokenText
> **tokenText**(`text`, `max`): `string`
Defined in: assess.ts:53
A symbol or name as the wallet keeps and shows it: trimmed, cut to `max` code points, trimmed again — so “USDC” + 124 spaces + “X” is stored, shown and assessed as “USDC” (scan 2026-10-27 modules, F28).
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
### max
[Section titled “max”](#max)
`number`
## Returns
[Section titled “Returns”](#returns)
`string`
# JsonStorage
Defined in: table.ts:6
One JSON value under one key — the shape every small store needs (AsyncStorage, chrome.storage, memory).
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### T
[Section titled “T”](#t)
`T`
## Methods
[Section titled “Methods”](#methods)
### get()
[Section titled “get()”](#get)
> **get**(): `Promise`<`T` | `null`>
Defined in: table.ts:8
The stored value, or `null` on first run.
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`T` | `null`>
***
### set()
[Section titled “set()”](#set)
> **set**(`value`): `Promise`<`void`>
Defined in: table.ts:10
Persist the value.
#### Parameters
[Section titled “Parameters”](#parameters)
##### value
[Section titled “value”](#value)
`T`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
# TokenAssessment
Defined in: assess.ts:27
Every warning that applies, worst first, and the worst level. A user token is never “safe”: `caution` is the floor.
## Properties
[Section titled “Properties”](#properties)
### level
[Section titled “level”](#level)
> **level**: [`TokenRiskLevel`](/api/anywalletkit/tokens/type-aliases/tokenrisklevel/)
Defined in: assess.ts:28
***
### risks
[Section titled “risks”](#risks)
> **risks**: [`TokenRisk`](/api/anywalletkit/tokens/interfaces/tokenrisk/)\[]
Defined in: assess.ts:29
# TokenRisk
Defined in: assess.ts:20
One warning, worded for the person adding the token.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`TokenRiskCode`](/api/anywalletkit/tokens/type-aliases/tokenriskcode/)
Defined in: assess.ts:21
***
### level
[Section titled “level”](#level)
> **level**: [`TokenRiskLevel`](/api/anywalletkit/tokens/type-aliases/tokenrisklevel/)
Defined in: assess.ts:22
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: assess.ts:23
# TokensState
Defined in: table.ts:42
What [TokensTable](/api/anywalletkit/tokens/classes/tokenstable/) stores.
## Properties
[Section titled “Properties”](#properties)
### tokens
[Section titled “tokens”](#tokens)
> **tokens**: [`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/)\[]
Defined in: table.ts:44
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: table.ts:43
# UserToken
Defined in: table.ts:25
A token the user added. `symbol` and `name` are what the token reports: display them, never match on them.
## Properties
[Section titled “Properties”](#properties)
### addedAt
[Section titled “addedAt”](#addedat)
> **addedAt**: `number`
Defined in: table.ts:38
When the user added it (ms since epoch).
***
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: table.ts:29
Contract (EVM, checksummed as read) or mint (Solana). The token’s identity.
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: table.ts:27
CAIP-2 chain id, the catalog’s key (`solana:mainnet`, `eip155:1`).
***
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: table.ts:32
***
### flags
[Section titled “flags”](#flags)
> **flags**: `TokenFlag`\[]
Defined in: table.ts:36
Facts read from the chain when it was added.
***
### name
[Section titled “name”](#name)
> **name**: `string`
Defined in: table.ts:31
***
### standard
[Section titled “standard”](#standard)
> **standard**: `string`
Defined in: table.ts:34
`erc20`, `spl` or `spl-token-2022`.
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
Defined in: table.ts:30
# TokenInspection
> **TokenInspection** = { `listed`: `CcAsset`; } | { `assessment`: [`TokenAssessment`](/api/anywalletkit/tokens/interfaces/tokenassessment/); `info`: `TokenInfo`; `listed?`: `undefined`; `token`: [`UserToken`](/api/anywalletkit/tokens/interfaces/usertoken/); }
Defined in: table.ts:78
The result of looking a token up before adding it.
# TokenRiskCode
> **TokenRiskCode** = `"unlisted"` | `"impersonation"` | `"odd-characters"` | `"no-symbol"` | `"zero-supply"` | `"unusual-decimals"` | `TokenFlag`
Defined in: assess.ts:17
Why a token deserves a warning:
* `unlisted`: always — the wallet’s list does not include it, and anyone can deploy a token with any name and logo.
* `impersonation`: its symbol reads as a known token’s (USDC, ETH, …), look-alike letters included.
* `odd-characters`: its symbol or name uses characters outside plain ASCII, or invisible ones.
* `no-symbol`: it reports no symbol.
* `zero-supply`: nothing has been minted.
* `unusual-decimals`: more than 24 decimals.
* a TokenFlag read from the chain (issuer powers, Token-2022 extensions).
# TokenRiskLevel
> **TokenRiskLevel** = `"danger"` | `"caution"`
Defined in: assess.ts:5
`danger`: the token can take or trap the user’s money, or pretends to be another one. `caution`: worth knowing.
# TokensErrorCode
> **TokensErrorCode** = `"not-loaded"` | `"unsupported-chain"` | `"bad-address"` | `"listed"` | `"bad-token"` | `"full"`
Defined in: table.ts:48
Codes of [TokensError](/api/anywalletkit/tokens/classes/tokenserror/).
# TOKEN_NAME_MAX
> `const` **TOKEN_NAME_MAX**: `128` = `128`
Defined in: assess.ts:47
Longest name the wallet stores (code points).
# TOKEN_SYMBOL_MAX
> `const` **TOKEN_SYMBOL_MAX**: `32` = `32`
Defined in: assess.ts:45
Longest symbol the wallet stores and assesses (code points); a longer one is cut, after trimming, before anything reads it.
# @anywalletkit/tx-preview-evm
# @anywalletkit/tx-preview-evm
[Section titled “@anywalletkit/tx-preview-evm”](#anywalletkittx-preview-evm)
[](https://www.npmjs.com/package/@anywalletkit/tx-preview-evm)
What an EVM transaction will do, before it is signed. It also handles an approve → call sequence. The output feeds a review screen:
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/tx-preview-evm
# or: pnpm add @anywalletkit/tx-preview-evm · yarn add @anywalletkit/tx-preview-evm
```
On npm: [@anywalletkit/tx-preview-evm](https://www.npmjs.com/package/@anywalletkit/tx-preview-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
* **decoded calls** — the recipient, the contract, the method;
* **approvals and transfers**: `approve`, `increaseAllowance` / `increaseApproval`, `setApprovalForAll`, EIP-2612 `permit` calls, Permit2 `approve` and `permit` (single and batch); a permit whose arguments can’t be read is the `approval-unparsed` warning;
* **simulated balance changes** at a pinned block (`eth_simulateV1` with transfer tracing, `eth_call` as the fallback);
* **a verdict** made of named checks: unlimited approval, unknown spender, value out, simulation failed…
```ts
import { previewEvmTx } from '@anywalletkit/tx-preview-evm'
```
Pure functions over an injected `rpc(method, params)`. The only dependency is viem.
Docs: [Transaction preview](https://docs.anywallet.tech/guides/tx-preview/)
Apache-2.0
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [Approval](/api/anywalletkit/tx-preview-evm/interfaces/approval/)
* [BalanceChange](/api/anywalletkit/tx-preview-evm/interfaces/balancechange/)
* [Check](/api/anywalletkit/tx-preview-evm/interfaces/check/)
* [DecodedCall](/api/anywalletkit/tx-preview-evm/interfaces/decodedcall/)
* [PreviewCall](/api/anywalletkit/tx-preview-evm/interfaces/previewcall/)
* [PreviewInput](/api/anywalletkit/tx-preview-evm/interfaces/previewinput/)
* [TxPreview](/api/anywalletkit/tx-preview-evm/interfaces/txpreview/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [CheckCode](/api/anywalletkit/tx-preview-evm/type-aliases/checkcode/)
* [Rpc](/api/anywalletkit/tx-preview-evm/type-aliases/rpc/)
* [Simulation](/api/anywalletkit/tx-preview-evm/type-aliases/simulation/)
## Functions
[Section titled “Functions”](#functions)
* [checksFor](/api/anywalletkit/tx-preview-evm/functions/checksfor/)
* [decodeCall](/api/anywalletkit/tx-preview-evm/functions/decodecall/)
* [previewEvmTx](/api/anywalletkit/tx-preview-evm/functions/previewevmtx/)
* [simulateUnsupported](/api/anywalletkit/tx-preview-evm/functions/simulateunsupported/)
# checksFor
> **checksFor**(`input`, `calls`, `sim`): [`Check`](/api/anywalletkit/tx-preview-evm/interfaces/check/)\[]
Defined in: index.ts:511
Derive the review checks from decoded calls and a simulation. `previewEvmTx` calls it; use it directly to re-check after your own simulation.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
[`PreviewInput`](/api/anywalletkit/tx-preview-evm/interfaces/previewinput/)
### calls
[Section titled “calls”](#calls)
[`DecodedCall`](/api/anywalletkit/tx-preview-evm/interfaces/decodedcall/)\[]
### sim
[Section titled “sim”](#sim)
[`Simulation`](/api/anywalletkit/tx-preview-evm/type-aliases/simulation/)
## Returns
[Section titled “Returns”](#returns)
[`Check`](/api/anywalletkit/tx-preview-evm/interfaces/check/)\[]
# decodeCall
> **decodeCall**(`call`, `known?`): [`DecodedCall`](/api/anywalletkit/tx-preview-evm/interfaces/decodedcall/)
Defined in: index.ts:206
Decode one call offline: ERC-20 transfer, approve, Permit2, operator approvals and known selectors. Calldata that is not hex bytes is `undecodable`, and a permit whose arguments cannot be read is `unparsedApproval` (both warnings in [checksFor](/api/anywalletkit/tx-preview-evm/functions/checksfor/)), never a plain call.
## Parameters
[Section titled “Parameters”](#parameters)
### call
[Section titled “call”](#call)
[`PreviewCall`](/api/anywalletkit/tx-preview-evm/interfaces/previewcall/)
### known?
[Section titled “known?”](#known)
`Record`<`string`, `string`> = `{}`
## Returns
[Section titled “Returns”](#returns)
[`DecodedCall`](/api/anywalletkit/tx-preview-evm/interfaces/decodedcall/)
# previewEvmTx
> **previewEvmTx**(`input`): `Promise`<[`TxPreview`](/api/anywalletkit/tx-preview-evm/interfaces/txpreview/)>
Defined in: index.ts:499
Decode the calls, simulate them in one block with `eth_simulateV1` (falling back to `eth_call` when the node lacks it), and derive the checks.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
[`PreviewInput`](/api/anywalletkit/tx-preview-evm/interfaces/previewinput/)
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`TxPreview`](/api/anywalletkit/tx-preview-evm/interfaces/txpreview/)>
## Throws
[Section titled “Throws”](#throws)
Error when `calls` is empty.
# simulateUnsupported
> **simulateUnsupported**(`err`): `boolean`
Defined in: index.ts:344
Did eth_simulateV1 fail because the node does not serve it (→ eth_call fallback)? Structured first — the JSON-RPC code or viem’s typed error anywhere on the cause chain (-32601: Avalanche, Hyperliquid, MegaETH, Linea, Arc, Morph, Flare) —, then the JSON body of an HTTP error (403 + -32601: zkSync, Celo, Unichain, Sei, X Layer), then a bounded text match on the first TEXT_HEAD characters of `details` / `shortMessage` / `message` (Monad: -32000 “`validation: false` is not supported yet”). Never a regex over the whole server-supplied text.
## Parameters
[Section titled “Parameters”](#parameters)
### err
[Section titled “err”](#err)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# Approval
Defined in: index.ts:73
An allowance a call grants: ERC-20 `approve`, Permit2, or an operator approval for all.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint` | `null`
Defined in: index.ts:78
null = unlimited (≥ 2^255) or an operator approval for all.
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"erc20"` | `"permit2"` | `"operator"`
Defined in: index.ts:79
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: index.ts:75
***
### spenderLabel
[Section titled “spenderLabel”](#spenderlabel)
> **spenderLabel**: `string` | `null`
Defined in: index.ts:76
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: index.ts:74
# BalanceChange
Defined in: index.ts:104
How one asset’s balance of the sender changes when the calls run.
## Properties
[Section titled “Properties”](#properties)
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number` | `null`
Defined in: index.ts:108
***
### delta
[Section titled “delta”](#delta)
> **delta**: `bigint`
Defined in: index.ts:110
Signed, base units, for the sender.
***
### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string` | `null`
Defined in: index.ts:107
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: index.ts:106
Token address, or “native”.
***
### verified
[Section titled “verified”](#verified)
> **verified**: `boolean`
Defined in: index.ts:112
Native, or a token the caller lists in `known`. Otherwise `symbol` is whatever the contract claims.
# Check
Defined in: index.ts:142
One item for the review screen: a code, a status, and the values to word it with.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`CheckCode`](/api/anywalletkit/tx-preview-evm/type-aliases/checkcode/)
Defined in: index.ts:143
***
### detail?
[Section titled “detail?”](#detail)
> `optional` **detail?**: `Record`<`string`, `string`>
Defined in: index.ts:146
Values the app needs to word it (labels, addresses, amounts).
***
### status
[Section titled “status”](#status)
> **status**: `"ok"` | `"warn"` | `"unknown"`
Defined in: index.ts:144
# DecodedCall
Defined in: index.ts:83
One call decoded: method, value, and the approval or token transfer it makes.
## Properties
[Section titled “Properties”](#properties)
### approval?
[Section titled “approval?”](#approval)
> `optional` **approval?**: [`Approval`](/api/anywalletkit/tx-preview-evm/interfaces/approval/)
Defined in: index.ts:89
***
### approvals?
[Section titled “approvals?”](#approvals)
> `optional` **approvals?**: [`Approval`](/api/anywalletkit/tx-preview-evm/interfaces/approval/)\[]
Defined in: index.ts:91
Every allowance the call grants when it grants more than one (a Permit2 batch permit); `approval` is the first.
***
### label
[Section titled “label”](#label)
> **label**: `string` | `null`
Defined in: index.ts:85
***
### method
[Section titled “method”](#method)
> **method**: `string`
Defined in: index.ts:87
***
### selector
[Section titled “selector”](#selector)
> **selector**: `string` | `null`
Defined in: index.ts:86
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: index.ts:84
***
### transfer?
[Section titled “transfer?”](#transfer)
> `optional` **transfer?**: `object`
Defined in: index.ts:98
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### to
[Section titled “to”](#to-1)
> **to**: `string`
#### token
[Section titled “token”](#token)
> **token**: `string`
***
### undecodable?
[Section titled “undecodable?”](#undecodable)
> `optional` **undecodable?**: `true`
Defined in: index.ts:100
The calldata is not hex bytes: nothing can be said about what it does (a warning, never a plain call).
***
### unparsedApproval?
[Section titled “unparsedApproval?”](#unparsedapproval)
> `optional` **unparsedApproval?**: `true`
Defined in: index.ts:97
A selector that grants an allowance (EIP-2612 or Permit2 `permit`) whose arguments could not be read: shorter than the ABI needs, or offsets and lengths out of range. What it grants is unknown, so it is a warning ([checksFor](/api/anywalletkit/tx-preview-evm/functions/checksfor/)), never a plain call.
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: index.ts:88
# PreviewCall
Defined in: index.ts:23
One call to preview: target, calldata and native value.
## Properties
[Section titled “Properties”](#properties)
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: index.ts:25
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: index.ts:24
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `bigint`
Defined in: index.ts:26
# PreviewInput
Defined in: index.ts:33
What to preview: the calls (approvals first), who sends them, on which chain, and which addresses and contracts the app already knows.
## Properties
[Section titled “Properties”](#properties)
### calls
[Section titled “calls”](#calls)
> **calls**: [`PreviewCall`](/api/anywalletkit/tx-preview-evm/interfaces/previewcall/)\[]
Defined in: index.ts:37
Executed in order in one simulated block (approve first, then the call).
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
Defined in: index.ts:34
***
### expectedApproval?
[Section titled “expectedApproval?”](#expectedapproval)
> `optional` **expectedApproval?**: `bigint`
Defined in: index.ts:46
Amount the flow needs approved (base units); larger approvals are flagged.
***
### expectedRecipient?
[Section titled “expectedRecipient?”](#expectedrecipient)
> `optional` **expectedRecipient?**: `string`
Defined in: index.ts:44
Where the funds are meant to arrive (a swap’s destination address).
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: index.ts:35
***
### known?
[Section titled “known?”](#known)
> `optional` **known?**: `Record`<`string`, `string`>
Defined in: index.ts:42
Known contracts: address → label (e.g. a provider’s trusted targets).
***
### native?
[Section titled “native?”](#native)
> `optional` **native?**: `object`
Defined in: index.ts:48
Native coin symbol and decimals for balance changes (default ETH / 18).
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
#### symbol
[Section titled “symbol”](#symbol)
> **symbol**: `string`
***
### own
[Section titled “own”](#own)
> **own**: `string`\[]
Defined in: index.ts:40
Addresses that are “you” (all of the user’s accounts, lower or mixed case).
***
### rpc
[Section titled “rpc”](#rpc)
> **rpc**: [`Rpc`](/api/anywalletkit/tx-preview-evm/type-aliases/rpc/)
Defined in: index.ts:38
***
### stateOverrides?
[Section titled “stateOverrides?”](#stateoverrides)
> `optional` **stateOverrides?**: `Record`<`string`, { `balance?`: `bigint`; `code?`: `string`; `nonce?`: `number`; `stateDiff?`: `Record`<`string`, `string`>; }>
Defined in: index.ts:55
State overrides applied to the simulated block (eth_simulateV1 `stateOverrides`, eth_call’s third parameter): e.g. fund the sender with a native `balance` or an ERC-20 balance via `stateDiff` on the token’s balance slot, to prove a flow a not-yet-funded account will sign.
# TxPreview
Defined in: index.ts:150
Everything a review screen needs: decoded calls, the simulation and the checks.
## Properties
[Section titled “Properties”](#properties)
### calls
[Section titled “calls”](#calls)
> **calls**: [`DecodedCall`](/api/anywalletkit/tx-preview-evm/interfaces/decodedcall/)\[]
Defined in: index.ts:151
***
### checks
[Section titled “checks”](#checks)
> **checks**: [`Check`](/api/anywalletkit/tx-preview-evm/interfaces/check/)\[]
Defined in: index.ts:153
***
### simulation
[Section titled “simulation”](#simulation)
> **simulation**: [`Simulation`](/api/anywalletkit/tx-preview-evm/type-aliases/simulation/)
Defined in: index.ts:152
# CheckCode
> **CheckCode** = `"contract-known"` | `"contract-unknown"` | `"simulation-ok"` | `"simulation-reverted"` | `"simulation-unavailable"` | `"recipient-own"` | `"recipient-foreign"` | `"approval-exact"` | `"approval-excess"` | `"approval-unlimited"` | `"approval-unknown-spender"` | `"approval-unchecked"` | `"approval-unparsed"` | `"native-value"` | `"calldata-undecodable"`
Defined in: index.ts:128
What a check is about: whether the contract is known, the simulation outcome, who receives, and how large an approval is.
# Rpc
> **Rpc** = (`method`, `params`) => `Promise`<`unknown`>
Defined in: index.ts:20
Any JSON-RPC transport: `(method, params) => result`. Wrap viem, ethers or `fetch` in one line.
## Parameters
[Section titled “Parameters”](#parameters)
### method
[Section titled “method”](#method)
`string`
### params
[Section titled “params”](#params)
`unknown`\[]
## Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# Simulation
> **Simulation** = { `changes`: [`BalanceChange`](/api/anywalletkit/tx-preview-evm/interfaces/balancechange/)\[]; `gasUsed`: `bigint`\[]; `status`: `"ok"`; } | { `callIndex`: `number`; `reason`: `string`; `status`: `"reverted"`; } | { `reason`: `string`; `status`: `"unavailable"`; }
Defined in: index.ts:119
The simulation result: balance changes and gas, the call that reverted and why, or why simulation was unavailable.
# @anywalletkit/wallet-btc
# @anywalletkit/wallet-btc
[Section titled “@anywalletkit/wallet-btc”](#anywalletkitwallet-btc)
[](https://www.npmjs.com/package/@anywalletkit/wallet-btc)
Bitcoin accounts on [`@scure/btc-signer`](https://github.com/paulmillr/scure-btc-signer) (audited by Cure53; pure `Uint8Array`, no `Buffer`, no Node shims):
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-btc
# or: pnpm add @anywalletkit/wallet-btc · yarn add @anywalletkit/wallet-btc
```
On npm: [@anywalletkit/wallet-btc](https://www.npmjs.com/package/@anywalletkit/wallet-btc), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
| `addressType` | Path | Address | Standard |
| ------------------ | ----------------- | ------- | ----------------------- |
| `p2wpkh` (default) | `m/84'/0'/0'/0/i` | `bc1q…` | BIP-84 native segwit |
| `p2tr` | `m/86'/0'/0'/0/i` | `bc1p…` | BIP-86 key-path taproot |
Test networks use coin type `1'` (`tb1…` / `bcrt1…`). Both paths are pinned by the official BIP-84 / BIP-86 test vectors.
```ts
import WalletManagerBtc from '@anywalletkit/wallet-btc'
const wallet = new WalletManagerBtc(seedPhrase, {
network: 'bitcoin',
addressType: 'p2wpkh', // or 'p2tr'
client: [
{ type: 'blockbook-http', clientConfig: { url: 'https://btc1.trezor.io' } },
{ type: 'esplora-http', clientConfig: { url: 'https://mempool.space/api' } }, // fails over in order
],
maxFeeRate: 200, // sat/vB ceiling (default 500)
})
const account = await wallet.getAccount(0)
const preview = await account.describeTransaction({ to: 'bc1q…', value: 50_000n })
// { kind: 'btc-transfer', inputs, outputs: [{ role: 'recipient' | 'change' }], fee, feeRate, vsize, rbf, lockTime, warnings }
await account.transfer({ recipient: 'bc1q…', amount: 50_000n }) // sats
await account.sendTransaction({ to: 'bc1q…', value: 50_000n, feeRate: 12n }) // explicit sat/vB
const hex = await account.signTransaction({ to: 'bc1q…', value: 50_000n }) // sign only
const max = await account.getMaxSpendable() // sweep amount after fee
wallet.dispose()
```
## What a spend is
[Section titled “What a spend is”](#what-a-spend-is)
Coin selection is our own (`selectCoins`, `coinselect.ts`): effective-value accumulation, largest first; inputs that cannot pay for themselves are skipped; change below dust (294 sat p2wpkh / 330 sat p2tr) is folded into the fee; at most `maxInputs` (200) inputs. Fees are `feeRate × vsize` with the standard segwit weights, estimated with 72-byte signatures so the quote is never below the fee actually paid.
Transactions signal replace-by-fee (`rbf`, default on) and set `nLockTime` to the current tip (`antiFeeSniping`, default on when the transport can report the height).
## Safety checks
[Section titled “Safety checks”](#safety-checks)
A broadcast with no definitive answer (fetch threw, a timeout, a 5xx or 408, an unreadable body) throws `BroadcastUnknownError` (`maybeSent`, `hash` = the txid computed before sending): the transaction may be in the mempool, so do not build another spend. A node’s refusal (4xx with a reason, an error body) stays an error marked answered (`isAnsweredRefusal`); with several clients it is a refusal only when every one refused. “Already in the mempool / block chain” returns the txid. A custom `BtcClient` should mark refusals `answered: true`. Outputs are matched to recipient and change by script.
Before signing **and** before broadcasting — also for caller-supplied raw hex — every transaction is resolved into a `BtcTxDescription` and must pass:
* fee rate ≤ `maxFeeRate` (`UnsafeTransactionError('fee-rate-too-high')`);
* exactly one output equals the requested recipient + amount, every other output is our own change (`'unexpected-output'`, `'recipient-mismatch'`, `'change-not-ours'`);
* `transactionMaxFee` / `transferMaxFee` absolute caps.
Warnings that do not block: `high-fee-rate`, `fee-over-10pct-of-amount`, `dust-output`, `no-change`.
## Message signing
[Section titled “Message signing”](#message-signing)
`sign()` / `verify()` are BIP-137 for p2wpkh accounts (header `39 + recovery`, base64 — the Electrum / Bitcoin Core encoding). Taproot accounts have no BIP-137 form; `sign()` throws `UnsupportedAddressTypeError` (BIP-322 is not implemented).
## Transports
[Section titled “Transports”](#transports)
`blockbook-http` (Trezor Blockbook REST, QuickNode’s add-on) and `esplora-http` (mempool.space, blockstream.info). Requests time out after `timeoutMs` (15 s) and responses are shape-checked (`NetworkError` otherwise). Pass your own object implementing `BtcClient` for anything else.
## Activity history
[Section titled “Activity history”](#activity-history)
`createBtcHistory` is the chain’s `HistorySource` (`@anywalletkit/core`) over Blockbook, reusing `BlockbookClient` (`getAddressPage`, `getTransactionDetails`).
```ts
import { createBtcHistory } from '@anywalletkit/wallet-btc/history'
const history = createBtcHistory({ blockbookUrls: ['https://btc1.trezor.io', 'https://bitcoin.atomicwallet.io'] })
const page = await history.listActivity('bc1q3x8yszvcvjjxqragsh0l6j8rxnhk7pay9hnj5h', { limit: 25 })
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://mempool.space/tx/…
```
| option | default | notes |
| -------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `blockbookUrl` / `blockbookUrls` | — | Blockbook roots, tried in order (Cloudflare 403, 5xx, network → next). The Trezor instances (`btc1…5.trezor.io`) sit behind a Cloudflare challenge that blocks non-browser user agents; `bitcoin.atomicwallet.io` and `blockbook.btc.zelcore.io` answered on 2026-10-14. QuickNode’s Blockbook add-on speaks the same API. |
| `network` | `bitcoin` | `testnet` / `regtest` CAIP-2 ids; mempool.space testnet links. |
| `pageSize` | the query `limit`, ≤ 100 | Rows per Blockbook page (its max is 1000). |
| `fetch`, `timeoutMs` | global, 15 000 | |
**Endpoint.** `GET /api/v2/address/{a}?details=txs&page=&pageSize=` — Blockbook returns transactions newest first with inputs and outputs (`hex` is dropped). The cursor is base64 JSON `{ v: 1, p, s }`: the next page and the page size the pagination started with (Blockbook clamps out-of-range pages to the last one, so paging stops at `totalPages`). `since` is applied client-side; unconfirmed rows are always kept.
**Mapping.** Inputs the address spent (`ownIn`) and outputs it received (`ownOut`) are summed. Spent inputs → a send: `from` = address, `to` = the first output that is not ours, `nativeValue` = what left to non-own outputs (change ignored, fee separate); every output ours → a consolidation to itself. No spent inputs → a receive: `from` = the first input address (`coinbase` when none), `nativeValue` = `ownOut`. `transfers` is that one native leg, `fee` = `fees`, `status` = `confirmed` once `confirmations ≥ 1` (else `pending`, no `block`), `block` = `blockHeight`, `raw` = the Blockbook transaction plus `ownIn` / `ownOut`.
Fixtures in `test/fixtures/history/` were captured on 2026-10-14 from `bitcoin.atomicwallet.io` for the test address (its 4 transactions: two receives, two sends with change) and `GET /api/v2/tx/{txid}` of one send. No protocol module recognizes Bitcoin transactions, so there is no recognizer cross-check.
## Classes
[Section titled “Classes”](#classes)
* [BlockbookClient](/api/anywalletkit/wallet-btc/classes/blockbookclient/)
* [BroadcastUnknownError](/api/anywalletkit/wallet-btc/classes/broadcastunknownerror/)
* [EsploraClient](/api/anywalletkit/wallet-btc/classes/esploraclient/)
* [HistoryUnavailableError](/api/anywalletkit/wallet-btc/classes/historyunavailableerror/)
* [TooManyInputsError](/api/anywalletkit/wallet-btc/classes/toomanyinputserror/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-btc/classes/unsafetransactionerror/)
* [UnsupportedAddressTypeError](/api/anywalletkit/wallet-btc/classes/unsupportedaddresstypeerror/)
* [WalletAccountBtc](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)
* [WalletAccountReadOnlyBtc](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/)
* [WalletManagerBtc](/api/anywalletkit/wallet-btc/classes/walletmanagerbtc/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [BlockbookAddressPage](/api/anywalletkit/wallet-btc/interfaces/blockbookaddresspage/)
* [BlockbookAddressTx](/api/anywalletkit/wallet-btc/interfaces/blockbookaddresstx/)
* [BlockbookTx](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/)
* [BlockbookTxDetails](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/)
* [BlockbookVin](/api/anywalletkit/wallet-btc/interfaces/blockbookvin/)
* [BlockbookVout](/api/anywalletkit/wallet-btc/interfaces/blockbookvout/)
* [BtcChainTx](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/)
* [BtcClient](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
* [BtcConfig](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)
* [BtcHistoryOptions](/api/anywalletkit/wallet-btc/interfaces/btchistoryoptions/)
* [BtcHistoryPage](/api/anywalletkit/wallet-btc/interfaces/btchistorypage/)
* [BtcHistoryRaw](/api/anywalletkit/wallet-btc/interfaces/btchistoryraw/)
* [BtcHistorySource](/api/anywalletkit/wallet-btc/interfaces/btchistorysource/)
* [BtcMaxSpendableResult](/api/anywalletkit/wallet-btc/interfaces/btcmaxspendableresult/)
* [BtcReceipt](/api/anywalletkit/wallet-btc/interfaces/btcreceipt/)
* [BtcSpend](/api/anywalletkit/wallet-btc/interfaces/btcspend/)
* [BtcTransferOptions](/api/anywalletkit/wallet-btc/interfaces/btctransferoptions/)
* [BtcTxDescription](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)
* [BtcTxInputDescription](/api/anywalletkit/wallet-btc/interfaces/btctxinputdescription/)
* [BtcTxOutputDescription](/api/anywalletkit/wallet-btc/interfaces/btctxoutputdescription/)
* [Built](/api/anywalletkit/wallet-btc/interfaces/built/)
* [CoinSelection](/api/anywalletkit/wallet-btc/interfaces/coinselection/)
* [CoinSelectOptions](/api/anywalletkit/wallet-btc/interfaces/coinselectoptions/)
* [DecodedAddress](/api/anywalletkit/wallet-btc/interfaces/decodedaddress/)
* [DescribeContext](/api/anywalletkit/wallet-btc/interfaces/describecontext/)
* [SelectionTarget](/api/anywalletkit/wallet-btc/interfaces/selectiontarget/)
* [SpendPlan](/api/anywalletkit/wallet-btc/interfaces/spendplan/)
* [Utxo](/api/anywalletkit/wallet-btc/interfaces/utxo/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [BtcAddressType](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/)
* [BtcClientConfig](/api/anywalletkit/wallet-btc/type-aliases/btcclientconfig/)
* [BtcNetwork](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
* [BtcTransaction](/api/anywalletkit/wallet-btc/type-aliases/btctransaction/)
* [BtcWarning](/api/anywalletkit/wallet-btc/type-aliases/btcwarning/)
* [ScriptKind](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
* [SegwitType](/api/anywalletkit/wallet-btc/type-aliases/segwittype/)
* [UnsafeTransactionCode](/api/anywalletkit/wallet-btc/type-aliases/unsafetransactioncode/)
## Variables
[Section titled “Variables”](#variables)
* [CAIP2_GENESIS](/api/anywalletkit/wallet-btc/variables/caip2_genesis/)
* [DEFAULT_MAX_FEE_RATE](/api/anywalletkit/wallet-btc/variables/default_max_fee_rate/)
* [DUST_LIMIT_P2TR](/api/anywalletkit/wallet-btc/variables/dust_limit_p2tr/)
* [DUST_LIMIT_P2WPKH](/api/anywalletkit/wallet-btc/variables/dust_limit_p2wpkh/)
* [FINAL_SEQUENCE](/api/anywalletkit/wallet-btc/variables/final_sequence/)
* [INPUT_WEIGHT](/api/anywalletkit/wallet-btc/variables/input_weight/)
* [MAX_UTXO_INPUTS](/api/anywalletkit/wallet-btc/variables/max_utxo_inputs/)
* [RBF_SEQUENCE](/api/anywalletkit/wallet-btc/variables/rbf_sequence/)
* [REGTEST_NETWORK](/api/anywalletkit/wallet-btc/variables/regtest_network/)
## Functions
[Section titled “Functions”](#functions)
* [addressFor](/api/anywalletkit/wallet-btc/functions/addressfor/)
* [addressFromPublicKey](/api/anywalletkit/wallet-btc/functions/addressfrompublickey/)
* [addressFromScript](/api/anywalletkit/wallet-btc/functions/addressfromscript/)
* [assertSafe](/api/anywalletkit/wallet-btc/functions/assertsafe/)
* [btcExplorerTxUrl](/api/anywalletkit/wallet-btc/functions/btcexplorertxurl/)
* [coinType](/api/anywalletkit/wallet-btc/functions/cointype/)
* [createBtcHistory](/api/anywalletkit/wallet-btc/functions/createbtchistory/)
* [createClient](/api/anywalletkit/wallet-btc/functions/createclient/)
* [decodeAddress](/api/anywalletkit/wallet-btc/functions/decodeaddress/)
* [decodeHistoryCursor](/api/anywalletkit/wallet-btc/functions/decodehistorycursor/)
* [describeTransaction](/api/anywalletkit/wallet-btc/functions/describetransaction/)
* [dustLimit](/api/anywalletkit/wallet-btc/functions/dustlimit/)
* [encodeHistoryCursor](/api/anywalletkit/wallet-btc/functions/encodehistorycursor/)
* [encodeMessageSignature](/api/anywalletkit/wallet-btc/functions/encodemessagesignature/)
* [estimateVsize](/api/anywalletkit/wallet-btc/functions/estimatevsize/)
* [isAnsweredRefusal](/api/anywalletkit/wallet-btc/functions/isansweredrefusal/)
* [magicHash](/api/anywalletkit/wallet-btc/functions/magichash/)
* [mapBlockbookTx](/api/anywalletkit/wallet-btc/functions/mapblockbooktx/)
* [networkParams](/api/anywalletkit/wallet-btc/functions/networkparams/)
* [outputVBytes](/api/anywalletkit/wallet-btc/functions/outputvbytes/)
* [parseRawTransaction](/api/anywalletkit/wallet-btc/functions/parserawtransaction/)
* [purposeFor](/api/anywalletkit/wallet-btc/functions/purposefor/)
* [recoverMessagePublicKey](/api/anywalletkit/wallet-btc/functions/recovermessagepublickey/)
* [scriptKind](/api/anywalletkit/wallet-btc/functions/scriptkind/)
* [selectAll](/api/anywalletkit/wallet-btc/functions/selectall/)
* [selectCoins](/api/anywalletkit/wallet-btc/functions/selectcoins/)
* [signMessage](/api/anywalletkit/wallet-btc/functions/signmessage/)
* [signMessageWith](/api/anywalletkit/wallet-btc/functions/signmessagewith/)
* [spendableUtxos](/api/anywalletkit/wallet-btc/functions/spendableutxos/)
* [unconfirmedOutgoing](/api/anywalletkit/wallet-btc/functions/unconfirmedoutgoing/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerBtc](/api/anywalletkit/wallet-btc/classes/walletmanagerbtc/)
# BlockbookClient
Defined in: wallet-btc/src/blockbook.ts:60
Blockbook REST transport (Trezor’s indexer; QuickNode’s Blockbook add-on speaks the same API).
## Implements
[Section titled “Implements”](#implements)
* [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BlockbookClient**(`config`, `fetchFn?`, `timeoutMs?`): `BlockbookClient`
Defined in: wallet-btc/src/blockbook.ts:65
#### Parameters
[Section titled “Parameters”](#parameters)
##### config
[Section titled “config”](#config)
###### url
[Section titled “url”](#url)
`string`
##### fetchFn?
[Section titled “fetchFn?”](#fetchfn)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
##### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number` = `DEFAULT_TIMEOUT_MS`
#### Returns
[Section titled “Returns”](#returns)
`BlockbookClient`
## Methods
[Section titled “Methods”](#methods)
### broadcast()
[Section titled “broadcast()”](#broadcast)
> **broadcast**(`rawTx`): `Promise`<`string`>
Defined in: wallet-btc/src/blockbook.ts:151
Broadcast raw hex; returns the txid.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### rawTx
[Section titled “rawTx”](#rawtx)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`broadcast`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#broadcast)
***
### close()
[Section titled “close()”](#close)
> **close**(): `Promise`<`void`>
Defined in: wallet-btc/src/blockbook.ts:72
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`close`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#close)
***
### connect()
[Section titled “connect()”](#connect)
> **connect**(): `Promise`<`void`>
Defined in: wallet-btc/src/blockbook.ts:71
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`connect`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#connect)
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`blocks`): `Promise`<`number`>
Defined in: wallet-btc/src/blockbook.ts:159
sat/vB. Blockbook reports BTC/kB (×1e5 → sat/vB); falls back to mempool.space when it has no estimate.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### blocks
[Section titled “blocks”](#blocks)
`number`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`estimateFee`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#estimatefee)
***
### getAddressPage()
[Section titled “getAddressPage()”](#getaddresspage)
> **getAddressPage**(`address`, `page?`, `pageSize?`): `Promise`<[`BlockbookAddressPage`](/api/anywalletkit/wallet-btc/interfaces/blockbookaddresspage/)>
Defined in: wallet-btc/src/blockbook.ts:113
One page of the address’s transactions, newest first, with inputs / outputs (what the activity history reads).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
##### page?
[Section titled “page?”](#page)
`number` = `1`
##### pageSize?
[Section titled “pageSize?”](#pagesize)
`number` = `25`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`BlockbookAddressPage`](/api/anywalletkit/wallet-btc/interfaces/blockbookaddresspage/)>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(`address`): `Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing`: `bigint`; }>
Defined in: wallet-btc/src/blockbook.ts:89
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getBalance`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#getbalance)
***
### getBlockHeight()
[Section titled “getBlockHeight()”](#getblockheight)
> **getBlockHeight**(): `Promise`<`number`>
Defined in: wallet-btc/src/blockbook.ts:173
Current chain tip height (anti-fee-sniping locktime). Optional.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getBlockHeight`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#getblockheight)
***
### getHistory()
[Section titled “getHistory()”](#gethistory)
> **getHistory**(`address`): `Promise`<`object`\[]>
Defined in: wallet-btc/src/blockbook.ts:101
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### address
[Section titled “address”](#address-2)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`object`\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getHistory`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gethistory)
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`txid`): `Promise`<`string`>
Defined in: wallet-btc/src/blockbook.ts:145
Raw transaction hex.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### txid
[Section titled “txid”](#txid)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getTransaction`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gettransaction)
***
### getTransactionDetails()
[Section titled “getTransactionDetails()”](#gettransactiondetails)
> **getTransactionDetails**(`txid`): `Promise`<[`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/) | `undefined`>
Defined in: wallet-btc/src/blockbook.ts:122
A transaction with its inputs / outputs; undefined when Blockbook does not know it.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### txid
[Section titled “txid”](#txid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/) | `undefined`>
***
### getTransactionInfo()
[Section titled “getTransactionInfo()”](#gettransactioninfo)
> **getTransactionInfo**(`txid`): `Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
Defined in: wallet-btc/src/blockbook.ts:138
Full tx record (used for receipts).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### txid
[Section titled “txid”](#txid-2)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getTransactionInfo`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gettransactioninfo)
***
### listUnspent()
[Section titled “listUnspent()”](#listunspent)
> **listUnspent**(`address`): `Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
Defined in: wallet-btc/src/blockbook.ts:95
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### address
[Section titled “address”](#address-3)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`listUnspent`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#listunspent)
# BroadcastUnknownError
Defined in: wallet-btc/src/errors.ts:49
The transaction was handed to the network but no definitive answer came back (no response, a timeout, a 5xx, an unreadable body): it MAY be in the mempool. Do not build another spend of the same coins — watch `hash`, the txid computed before sending (round 3, M12).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-btc/src/errors.ts:54
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `string`
Defined in: wallet-btc/src/errors.ts:53
The transaction id (hex).
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-btc/src/errors.ts:51
Always true: the transaction may be on its way.
# EsploraClient
Defined in: wallet-btc/src/esplora.ts:19
Esplora REST transport — the API served by mempool.space (`https://mempool.space/api`) and Blockstream (`https://blockstream.info/api`). Public instances exist, so it is the natural fallback behind a self-hosted Blockbook.
Balance semantics: `unconfirmedOutgoing` is the mempool net outflow (spent − funded, clamped at 0), a conservative stand-in for Bitcoin Core’s trusted-change rule that Blockbook’s richer address record allows.
## Implements
[Section titled “Implements”](#implements)
* [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new EsploraClient**(`config`, `fetchFn?`, `timeoutMs?`): `EsploraClient`
Defined in: wallet-btc/src/esplora.ts:24
#### Parameters
[Section titled “Parameters”](#parameters)
##### config
[Section titled “config”](#config)
###### url
[Section titled “url”](#url)
`string`
##### fetchFn?
[Section titled “fetchFn?”](#fetchfn)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
##### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number` = `DEFAULT_TIMEOUT_MS`
#### Returns
[Section titled “Returns”](#returns)
`EsploraClient`
## Methods
[Section titled “Methods”](#methods)
### broadcast()
[Section titled “broadcast()”](#broadcast)
> **broadcast**(`rawTx`): `Promise`<`string`>
Defined in: wallet-btc/src/esplora.ts:108
Broadcast raw hex; returns the txid.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### rawTx
[Section titled “rawTx”](#rawtx)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`broadcast`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#broadcast)
***
### close()
[Section titled “close()”](#close)
> **close**(): `Promise`<`void`>
Defined in: wallet-btc/src/esplora.ts:32
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`close`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#close)
***
### connect()
[Section titled “connect()”](#connect)
> **connect**(): `Promise`<`void`>
Defined in: wallet-btc/src/esplora.ts:31
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`connect`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#connect)
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`blocks`): `Promise`<`number`>
Defined in: wallet-btc/src/esplora.ts:115
`/fee-estimates` → { “1”: sat/vB, “2”: …, “25”: …, “144”: … }; picks the nearest target ≥ `blocks`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### blocks
[Section titled “blocks”](#blocks)
`number`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`estimateFee`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#estimatefee)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(`address`): `Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing`: `bigint`; }>
Defined in: wallet-btc/src/esplora.ts:58
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getBalance`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#getbalance)
***
### getBlockHeight()
[Section titled “getBlockHeight()”](#getblockheight)
> **getBlockHeight**(): `Promise`<`number`>
Defined in: wallet-btc/src/esplora.ts:124
Current chain tip height (anti-fee-sniping locktime). Optional.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`number`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getBlockHeight`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#getblockheight)
***
### getHistory()
[Section titled “getHistory()”](#gethistory)
> **getHistory**(`address`): `Promise`<`object`\[]>
Defined in: wallet-btc/src/esplora.ts:74
Esplora pages 25 (mempool.space: up to 50) txs per call; walk `/txs/chain/` until a short page.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`object`\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getHistory`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gethistory)
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`txid`): `Promise`<`string`>
Defined in: wallet-btc/src/esplora.ts:102
Raw transaction hex.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### txid
[Section titled “txid”](#txid)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getTransaction`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gettransaction)
***
### getTransactionInfo()
[Section titled “getTransactionInfo()”](#gettransactioninfo)
> **getTransactionInfo**(`txid`): `Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
Defined in: wallet-btc/src/esplora.ts:89
Full tx record (used for receipts).
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### txid
[Section titled “txid”](#txid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`getTransactionInfo`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#gettransactioninfo)
***
### listUnspent()
[Section titled “listUnspent()”](#listunspent)
> **listUnspent**(`address`): `Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
Defined in: wallet-btc/src/esplora.ts:67
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### address
[Section titled “address”](#address-2)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/).[`listUnspent`](/api/anywalletkit/wallet-btc/interfaces/btcclient/#listunspent)
# HistoryUnavailableError
Defined in: wallet-btc/src/history.ts:63
Every configured Blockbook endpoint failed (or none was configured).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: wallet-btc/src/history.ts:67
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: wallet-btc/src/history.ts:66
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: wallet-btc/src/history.ts:64
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-btc/src/history.ts:65
# TooManyInputsError
Defined in: wallet-btc/src/errors.ts:27
Coin selection would need more inputs than `maxInputs` allows.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TooManyInputsError**(`maxInputs`): `TooManyInputsError`
Defined in: wallet-btc/src/errors.ts:29
#### Parameters
[Section titled “Parameters”](#parameters)
##### maxInputs
[Section titled “maxInputs”](#maxinputs)
`number`
#### Returns
[Section titled “Returns”](#returns)
`TooManyInputsError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### maxInputs
[Section titled “maxInputs”](#maxinputs-1)
> `readonly` **maxInputs**: `number`
Defined in: wallet-btc/src/errors.ts:28
# UnsafeTransactionError
Defined in: wallet-btc/src/errors.ts:17
A transaction failed a hard safety check and was not signed / broadcast.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`code`, `message`): `UnsafeTransactionError`
Defined in: wallet-btc/src/errors.ts:19
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`UnsafeTransactionCode`](/api/anywalletkit/wallet-btc/type-aliases/unsafetransactioncode/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`UnsafeTransactionCode`](/api/anywalletkit/wallet-btc/type-aliases/unsafetransactioncode/)
Defined in: wallet-btc/src/errors.ts:18
# UnsupportedAddressTypeError
Defined in: wallet-btc/src/errors.ts:37
BIP-137 message signatures only exist for p2pkh/p2wpkh keys; taproot accounts have none (BIP-322 is not implemented).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsupportedAddressTypeError**(`message`): `UnsupportedAddressTypeError`
Defined in: wallet-btc/src/errors.ts:38
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsupportedAddressTypeError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# WalletAccountBtc
Defined in: wallet-btc/src/account.ts:45
Signing Bitcoin account — BIP-84 p2wpkh or BIP-86 p2tr (key-path). The key never enters this package: every signature is one `signer.sign(...)` call over a btc-signer-computed sighash — a LocalSigner for seed wallets, anything else (hardware, MPC, backend) through `externalSigner()`:
```text
p2wpkh input → `ecdsa` over the BIP-143 sighash (SIGHASH_ALL), DER-encoded here
p2tr input → `schnorr` + `tweak` over the BIP-341 sighash (DEFAULT), tweak = TapTweak(xonly)
BIP-137 msg → `ecdsa-recoverable` over the magic hash
```
Every spend is resolved to a full description (“what you sign”) and run through the hard safety checks (fee-rate ceiling, recipient/amount exactness, change ownership) before signing AND before broadcast — also for caller-supplied raw hex.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountBtc**(`signer`, `publicKey`, `path`, `config?`): `WalletAccountBtc`
Defined in: wallet-btc/src/account.ts:65
`publicKey` is the signer’s compressed secp256k1 key (33 bytes); it is needed synchronously for the address.
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountBtc`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`constructor`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/) | `undefined`
Defined in: wallet-btc/src/read-only-account.ts:39
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`_client`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#_client)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)
Defined in: wallet-btc/src/read-only-account.ts:38
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`_config`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#_config)
***
### \_network
[Section titled “\_network”](#_network)
> `protected` `readonly` **\_network**: `BTC_NETWORK`
Defined in: wallet-btc/src/read-only-account.ts:40
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`_network`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#_network)
***
### \_networkName
[Section titled “\_networkName”](#_networkname)
> `protected` `readonly` **\_networkName**: [`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
Defined in: wallet-btc/src/read-only-account.ts:41
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`_networkName`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#_networkname)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `string`
Defined in: wallet-btc/src/read-only-account.ts:28
The address.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`address`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#address)
***
### addressType
[Section titled “addressType”](#addresstype)
> `readonly` **addressType**: [`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/)
Defined in: wallet-btc/src/account.ts:52
p2wpkh / p2tr when the address is one we know how to spend from; undefined for other script types.
#### Overrides
[Section titled “Overrides”](#overrides-1)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`addressType`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#addresstype)
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-btc/src/read-only-account.ts:29
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`chain`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#chain)
***
### dustLimit
[Section titled “dustLimit”](#dustlimit)
> `readonly` **dustLimit**: `bigint`
Defined in: wallet-btc/src/read-only-account.ts:37
Smallest output this address type may create, in satoshis.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`dustLimit`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#dustlimit)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `true` = `true`
Defined in: wallet-btc/src/account.ts:47
UTXOs, fee rate and tip height come from the network before signing.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-btc/src/account.ts:49
Derivation path, or `external` for an external signer.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-btc/src/account.ts:51
Compressed secp256k1 public key.
***
### scriptKind
[Section titled “scriptKind”](#scriptkind)
> `readonly` **scriptKind**: [`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
Defined in: wallet-btc/src/read-only-account.ts:33
Script type of the address.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`scriptKind`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#scriptkind)
***
### scriptPubKey
[Section titled “scriptPubKey”](#scriptpubkey)
> `readonly` **scriptPubKey**: `Uint8Array`
Defined in: wallet-btc/src/read-only-account.ts:31
Output script of `address`.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`scriptPubKey`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#scriptpubkey)
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"seed"` | `"key"` | `"external"`
Defined in: wallet-btc/src/account.ts:60
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-btc/src/account.ts:84
Account index for the standard m/{84|86}‘/{0|1}’/0’/0/i path.
##### Returns
[Section titled “Returns”](#returns-1)
`number` | `undefined`
***
### maxFeeRate
[Section titled “maxFeeRate”](#maxfeerate)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **maxFeeRate**(): `number`
Defined in: wallet-btc/src/read-only-account.ts:63
Fee-rate ceiling in sat/vB: `BtcConfig.maxFeeRate` or [DEFAULT_MAX_FEE_RATE](/api/anywalletkit/wallet-btc/variables/default_max_fee_rate/).
##### Returns
[Section titled “Returns”](#returns-2)
`number`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`maxFeeRate`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#maxfeerate)
## Methods
[Section titled “Methods”](#methods)
### describeTransaction()
[Section titled “describeTransaction()”](#describetransaction)
> **describeTransaction**(`tx`): `Promise`<[`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)>
Defined in: wallet-btc/src/account.ts:250
“What you sign”: the fully resolved spend (signed, NOT broadcast) or a caller’s raw hex.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
[`BtcTransaction`](/api/anywalletkit/wallet-btc/type-aliases/btctransaction/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)>
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-btc/src/account.ts:319
Zeroize this account’s key material.
#### Returns
[Section titled “Returns”](#returns-4)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-btc/src/read-only-account.ts:68
The address.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`getAddress`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#getaddress)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:71
Confirmed minus pending outgoing (Bitcoin Core wallet semantics).
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`getBalance`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#getbalance)
***
### getMaxSpendable()
[Section titled “getMaxSpendable()”](#getmaxspendable)
> **getMaxSpendable**(`opts?`): `Promise`<[`BtcMaxSpendableResult`](/api/anywalletkit/wallet-btc/interfaces/btcmaxspendableresult/)>
Defined in: wallet-btc/src/read-only-account.ts:136
Everything spendable in ONE transaction to a single output of our own address type, no change.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### opts?
[Section titled “opts?”](#opts)
###### confirmationTarget?
[Section titled “confirmationTarget?”](#confirmationtarget)
`number`
###### feeRate?
[Section titled “feeRate?”](#feerate)
`number` | `bigint`
###### to?
[Section titled “to?”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`BtcMaxSpendableResult`](/api/anywalletkit/wallet-btc/interfaces/btcmaxspendableresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`getMaxSpendable`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#getmaxspendable)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`_token`): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:77
Always throws: Bitcoin has no tokens.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### \_token
[Section titled “\_token”](#_token)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`getTokenBalance`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#gettokenbalance)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`BtcReceipt`](/api/anywalletkit/wallet-btc/interfaces/btcreceipt/) | `undefined`>
Defined in: wallet-btc/src/read-only-account.ts:147
Undefined until the transaction is mined.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`BtcReceipt`](/api/anywalletkit/wallet-btc/interfaces/btcreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`getTransactionReceipt`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#gettransactionreceipt)
***
### inputWeight()
[Section titled “inputWeight()”](#inputweight)
> `protected` **inputWeight**(): `number`
Defined in: wallet-btc/src/read-only-account.ts:82
Weight one of OUR inputs adds; throws for address types we cannot spend from.
#### Returns
[Section titled “Returns”](#returns-10)
`number`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`inputWeight`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#inputweight)
***
### lockTimeHeight()
[Section titled “lockTimeHeight()”](#locktimeheight)
> `protected` **lockTimeHeight**(): `Promise`<`number`>
Defined in: wallet-btc/src/read-only-account.ts:167
Chain tip for anti-fee-sniping; undefined when disabled or the transport cannot tell.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`lockTimeHeight`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#locktimeheight)
***
### planSpend()
[Section titled “planSpend()”](#planspend)
> `protected` **planSpend**(`spend`): `Promise`<[`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)>
Defined in: wallet-btc/src/read-only-account.ts:97
Coin selection for a spend (see coinselect.ts). Validates the recipient and the dust floor first.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### spend
[Section titled “spend”](#spend)
[`BtcSpend`](/api/anywalletkit/wallet-btc/interfaces/btcspend/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`planSpend`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#planspend)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-btc/src/account.ts:268
Fee of a spend in satoshis, from a coin selection at the current fee rate.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx-1)
[`BtcTransaction`](/api/anywalletkit/wallet-btc/type-aliases/btctransaction/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.quoteSendTransaction`
#### Overrides
[Section titled “Overrides”](#overrides-2)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`quoteSendTransaction`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-btc/src/read-only-account.ts:130
Fee of a transfer in satoshis.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### o
[Section titled “o”](#o)
[`BtcTransferOptions`](/api/anywalletkit/wallet-btc/interfaces/btctransferoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<{ `fee`: `bigint`; }>
#### Throws
[Section titled “Throws”](#throws)
Error when `token` is set.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`quoteTransfer`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#quotetransfer)
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
Defined in: wallet-btc/src/read-only-account.ts:57
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`requireClient`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#requireclient)
***
### resolveFeeRate()
[Section titled “resolveFeeRate()”](#resolvefeerate)
> `protected` **resolveFeeRate**(`spend`): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:87
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### spend
[Section titled “spend”](#spend-1)
###### confirmationTarget?
[Section titled “confirmationTarget?”](#confirmationtarget-1)
`number`
###### feeRate?
[Section titled “feeRate?”](#feerate-1)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`resolveFeeRate`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#resolvefeerate)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<`TransferResult`>
Defined in: wallet-btc/src/account.ts:273
Sign and broadcast.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### tx
[Section titled “tx”](#tx-2)
[`BtcTransaction`](/api/anywalletkit/wallet-btc/type-aliases/btctransaction/)
##### options?
[Section titled “options?”](#options)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-btc/src/account.ts:94
BIP-137 p2wpkh signature, base64 (Electrum / Bitcoin Core encoding). Not available for taproot accounts.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sign`
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-btc/src/account.ts:256
Sign without broadcasting. Returns the raw transaction hex. Raw hex input gets the checks `sendTransaction` runs (prevouts through the client) and is returned unchanged, never re-signed.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### tx
[Section titled “tx”](#tx-3)
[`BtcTransaction`](/api/anywalletkit/wallet-btc/type-aliases/btctransaction/)
##### options?
[Section titled “options?”](#options-1)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.signTransaction`
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-btc/src/account.ts:314
The same address as a [WalletAccountReadOnlyBtc](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).
#### Returns
[Section titled “Returns”](#returns-20)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.toReadOnlyAccount`
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`o`, `writeOptions?`): `Promise`<`TransferResult`>
Defined in: wallet-btc/src/account.ts:289
Native BTC only (`token` is rejected). Subject to `transferMaxFee`.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### o
[Section titled “o”](#o-1)
[`BtcTransferOptions`](/api/anywalletkit/wallet-btc/interfaces/btctransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.transfer`
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-btc/src/read-only-account.ts:159
BIP-137: recover the key and compare its p2wpkh address with ours. Taproot addresses have no BIP-137 form.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/).[`verify`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/#verify)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`): `WalletAccountBtc`
Defined in: wallet-btc/src/account.ts:79
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
##### config?
[Section titled “config?”](#config-1)
[`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-23)
`WalletAccountBtc`
# WalletAccountReadOnlyBtc
Defined in: wallet-btc/src/read-only-account.ts:26
Watch-only Bitcoin account: balances, quotes, receipts, BIP-137 verification. No key.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlyBtc**(`address`, `config?`): `WalletAccountReadOnlyBtc`
Defined in: wallet-btc/src/read-only-account.ts:43
#### Parameters
[Section titled “Parameters”](#parameters)
##### address
[Section titled “address”](#address)
`string`
##### config?
[Section titled “config?”](#config)
[`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlyBtc`
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/) | `undefined`
Defined in: wallet-btc/src/read-only-account.ts:39
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)
Defined in: wallet-btc/src/read-only-account.ts:38
***
### \_network
[Section titled “\_network”](#_network)
> `protected` `readonly` **\_network**: `BTC_NETWORK`
Defined in: wallet-btc/src/read-only-account.ts:40
***
### \_networkName
[Section titled “\_networkName”](#_networkname)
> `protected` `readonly` **\_networkName**: [`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
Defined in: wallet-btc/src/read-only-account.ts:41
***
### address
[Section titled “address”](#address-1)
> `readonly` **address**: `string`
Defined in: wallet-btc/src/read-only-account.ts:28
The address.
***
### addressType
[Section titled “addressType”](#addresstype)
> `readonly` **addressType**: [`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/) | `undefined`
Defined in: wallet-btc/src/read-only-account.ts:35
p2wpkh / p2tr when the address is one we know how to spend from; undefined for other script types.
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-btc/src/read-only-account.ts:29
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
***
### dustLimit
[Section titled “dustLimit”](#dustlimit)
> `readonly` **dustLimit**: `bigint`
Defined in: wallet-btc/src/read-only-account.ts:37
Smallest output this address type may create, in satoshis.
***
### scriptKind
[Section titled “scriptKind”](#scriptkind)
> `readonly` **scriptKind**: [`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
Defined in: wallet-btc/src/read-only-account.ts:33
Script type of the address.
***
### scriptPubKey
[Section titled “scriptPubKey”](#scriptpubkey)
> `readonly` **scriptPubKey**: `Uint8Array`
Defined in: wallet-btc/src/read-only-account.ts:31
Output script of `address`.
## Accessors
[Section titled “Accessors”](#accessors)
### maxFeeRate
[Section titled “maxFeeRate”](#maxfeerate)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **maxFeeRate**(): `number`
Defined in: wallet-btc/src/read-only-account.ts:63
Fee-rate ceiling in sat/vB: `BtcConfig.maxFeeRate` or [DEFAULT_MAX_FEE_RATE](/api/anywalletkit/wallet-btc/variables/default_max_fee_rate/).
##### Returns
[Section titled “Returns”](#returns-1)
`number`
## Methods
[Section titled “Methods”](#methods)
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-btc/src/read-only-account.ts:68
The address.
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:71
Confirmed minus pending outgoing (Bitcoin Core wallet semantics).
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getMaxSpendable()
[Section titled “getMaxSpendable()”](#getmaxspendable)
> **getMaxSpendable**(`opts?`): `Promise`<[`BtcMaxSpendableResult`](/api/anywalletkit/wallet-btc/interfaces/btcmaxspendableresult/)>
Defined in: wallet-btc/src/read-only-account.ts:136
Everything spendable in ONE transaction to a single output of our own address type, no change.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### opts?
[Section titled “opts?”](#opts)
###### confirmationTarget?
[Section titled “confirmationTarget?”](#confirmationtarget)
`number`
###### feeRate?
[Section titled “feeRate?”](#feerate)
`number` | `bigint`
###### to?
[Section titled “to?”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`BtcMaxSpendableResult`](/api/anywalletkit/wallet-btc/interfaces/btcmaxspendableresult/)>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`_token`): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:77
Always throws: Bitcoin has no tokens.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### \_token
[Section titled “\_token”](#_token)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`BtcReceipt`](/api/anywalletkit/wallet-btc/interfaces/btcreceipt/) | `undefined`>
Defined in: wallet-btc/src/read-only-account.ts:147
Undefined until the transaction is mined.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`BtcReceipt`](/api/anywalletkit/wallet-btc/interfaces/btcreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### inputWeight()
[Section titled “inputWeight()”](#inputweight)
> `protected` **inputWeight**(): `number`
Defined in: wallet-btc/src/read-only-account.ts:82
Weight one of OUR inputs adds; throws for address types we cannot spend from.
#### Returns
[Section titled “Returns”](#returns-7)
`number`
***
### lockTimeHeight()
[Section titled “lockTimeHeight()”](#locktimeheight)
> `protected` **lockTimeHeight**(): `Promise`<`number`>
Defined in: wallet-btc/src/read-only-account.ts:167
Chain tip for anti-fee-sniping; undefined when disabled or the transport cannot tell.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`number`>
***
### planSpend()
[Section titled “planSpend()”](#planspend)
> `protected` **planSpend**(`spend`): `Promise`<[`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)>
Defined in: wallet-btc/src/read-only-account.ts:97
Coin selection for a spend (see coinselect.ts). Validates the recipient and the dust floor first.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### spend
[Section titled “spend”](#spend)
[`BtcSpend`](/api/anywalletkit/wallet-btc/interfaces/btcspend/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)>
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-btc/src/read-only-account.ts:120
Fee of a spend in satoshis, from a coin selection at the current fee rate.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### tx
[Section titled “tx”](#tx)
[`BtcSpend`](/api/anywalletkit/wallet-btc/interfaces/btcspend/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-btc/src/read-only-account.ts:130
Fee of a transfer in satoshis.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### o
[Section titled “o”](#o)
[`BtcTransferOptions`](/api/anywalletkit/wallet-btc/interfaces/btctransferoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<{ `fee`: `bigint`; }>
#### Throws
[Section titled “Throws”](#throws)
Error when `token` is set.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
Defined in: wallet-btc/src/read-only-account.ts:57
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/)
***
### resolveFeeRate()
[Section titled “resolveFeeRate()”](#resolvefeerate)
> `protected` **resolveFeeRate**(`spend`): `Promise`<`bigint`>
Defined in: wallet-btc/src/read-only-account.ts:87
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### spend
[Section titled “spend”](#spend-1)
###### confirmationTarget?
[Section titled “confirmationTarget?”](#confirmationtarget-1)
`number`
###### feeRate?
[Section titled “feeRate?”](#feerate-1)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`bigint`>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-btc/src/read-only-account.ts:159
BIP-137: recover the key and compare its p2wpkh address with ours. Taproot addresses have no BIP-137 form.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.verify`
# WalletManagerBtc
Defined in: wallet-btc/src/manager.ts:20
One seed → Bitcoin accounts. p2wpkh (default): BIP-84, m/84’/0’/0’/0/i on mainnet, m/84’/1’/0’/0/i on test networks — bc1q… / tb1q… p2tr: BIP-86, m/86’/0’/0’/0/i (key-path taproot) — bc1p… / tb1p… Paths may be relative to the purpose/coin prefix (“0’/0/i”) or given in full.
Built with a secp256k1 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at the account branch (`m/84'/0'/0'/0` or `m/86'/0'/0'/0`, per `addressType`/`network`) yields `getAccount(i)` children;
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’) with the configured address type; other indexes/paths throw.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/), [`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerBtc**(`seedOrSigner`, `config?`): `WalletManagerBtc`
Defined in: wallet-btc/src/manager.ts:21
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerBtc`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Accessors
[Section titled “Accessors”](#accessors)
### basePath
[Section titled “basePath”](#basepath)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **basePath**(): `string`
Defined in: wallet-btc/src/manager.ts:30
`m/84'/0'` for p2wpkh or `m/86'/0'` for p2tr on mainnet (coin type 1 on test networks); account `i` is at `basePath/0'/0/i`.
##### Returns
[Section titled “Returns”](#returns-1)
`string`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/) | `Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-3)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-4)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
Defined in: wallet-btc/src/manager.ts:34
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
Defined in: wallet-btc/src/manager.ts:38
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-btc/src/manager.ts:71
sat/vB from the client’s estimator: fast = 1 block, normal = 3, slow = 6.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`address`): [`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/)
Defined in: wallet-btc/src/manager.ts:66
A read-only account for any address, with this manager’s config.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
[`WalletAccountReadOnlyBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountreadonlybtc/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-9)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-10)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-btc/classes/walletmanagerbtc/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`WalletAccountBtc`](/api/anywalletkit/wallet-btc/classes/walletaccountbtc/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-btc/classes/walletmanagerbtc/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-12)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-btc/classes/walletmanagerbtc/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# addressFor
> **addressFor**(`publicKey`, `network?`, `type?`): `string`
Defined in: wallet-btc/src/account.ts:18
Address for a compressed public key; `network` may be a name or btc-signer params.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
### network?
[Section titled “network?”](#network)
[`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/) | `BTC_NETWORK`
### type?
[Section titled “type?”](#type)
[`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/) = `'p2wpkh'`
## Returns
[Section titled “Returns”](#returns)
`string`
# addressFromPublicKey
> **addressFromPublicKey**(`publicKey`, `network`, `type?`): `string`
Defined in: wallet-btc/src/address.ts:40
Address of a compressed public key: p2wpkh (`bc1q…`) or p2tr key-path (`bc1p…`).
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
### network
[Section titled “network”](#network)
`BTC_NETWORK`
### type?
[Section titled “type?”](#type)
[`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/) = `'p2wpkh'`
## Returns
[Section titled “Returns”](#returns)
`string`
# addressFromScript
> **addressFromScript**(`script`, `network`): `string` | `undefined`
Defined in: wallet-btc/src/address.ts:24
Address for an output script, or undefined when the script has no address form.
## Parameters
[Section titled “Parameters”](#parameters)
### script
[Section titled “script”](#script)
`Uint8Array`
### network
[Section titled “network”](#network)
`BTC_NETWORK`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# assertSafe
> **assertSafe**(`desc`, `ctx`): `void`
Defined in: wallet-btc/src/describe.ts:88
Hard checks run before signing and before broadcasting. Throws UnsafeTransactionError; never mutates. With `intended`, exactly one output must be the requested recipient/amount and every other output must be our change.
## Parameters
[Section titled “Parameters”](#parameters)
### desc
[Section titled “desc”](#desc)
[`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)
### ctx
[Section titled “ctx”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-btc/interfaces/describecontext/)
## Returns
[Section titled “Returns”](#returns)
`void`
# btcExplorerTxUrl
> **btcExplorerTxUrl**(`hash`, `network?`): `string`
Defined in: wallet-btc/src/history.ts:174
mempool.space link for a transaction.
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### network?
[Section titled “network?”](#network)
[`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/) = `'bitcoin'`
## Returns
[Section titled “Returns”](#returns)
`string`
# coinType
> **coinType**(`network`): `0` | `1`
Defined in: wallet-btc/src/network.ts:19
SLIP-44 coin type: 0 for mainnet, 1 for every test network.
## Parameters
[Section titled “Parameters”](#parameters)
### network
[Section titled “network”](#network)
[`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
## Returns
[Section titled “Returns”](#returns)
`0` | `1`
# createBtcHistory
> **createBtcHistory**(`options?`): [`BtcHistorySource`](/api/anywalletkit/wallet-btc/interfaces/btchistorysource/)
Defined in: wallet-btc/src/history.ts:184
A history source for Bitcoin addresses backed by Blockbook (Trezor’s public instances, QuickNode’s add-on, or your own).
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`BtcHistoryOptions`](/api/anywalletkit/wallet-btc/interfaces/btchistoryoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`BtcHistorySource`](/api/anywalletkit/wallet-btc/interfaces/btchistorysource/)
## Throws
[Section titled “Throws”](#throws)
Error when no Blockbook URL is given.
# createClient
> **createClient**(`config`): [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/) | `undefined`
Defined in: wallet-btc/src/client.ts:21
One client, or a failover client over the list: each call walks the list in order, `retries` extra rounds.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`BtcConfig`](/api/anywalletkit/wallet-btc/interfaces/btcconfig/)
## Returns
[Section titled “Returns”](#returns)
[`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/) | `undefined`
# decodeAddress
> **decodeAddress**(`address`, `network`): [`DecodedAddress`](/api/anywalletkit/wallet-btc/interfaces/decodedaddress/)
Defined in: wallet-btc/src/address.ts:15
Decode and validate an address for `network`; throws on a malformed address or a foreign network.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
### network
[Section titled “network”](#network)
`BTC_NETWORK`
## Returns
[Section titled “Returns”](#returns)
[`DecodedAddress`](/api/anywalletkit/wallet-btc/interfaces/decodedaddress/)
# decodeHistoryCursor
> **decodeHistoryCursor**(`s`): `BtcHistoryCursor`
Defined in: wallet-btc/src/history.ts:120
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
`BtcHistoryCursor`
# describeTransaction
> **describeTransaction**(`tx`, `inputValues`, `ctx`): [`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)
Defined in: wallet-btc/src/describe.ts:40
Describe a (signed or unsigned) btc-signer Transaction given the sat value of every input, in input order. Pure: no network, no signing.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`Transaction`
### inputValues
[Section titled “inputValues”](#inputvalues)
`bigint`\[]
### ctx
[Section titled “ctx”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-btc/interfaces/describecontext/)
## Returns
[Section titled “Returns”](#returns)
[`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)
# dustLimit
> **dustLimit**(`kind`): `bigint`
Defined in: wallet-btc/src/address.ts:63
Bitcoin Core dust threshold (3 sat/vB discard rate) per output type, in sats.
## Parameters
[Section titled “Parameters”](#parameters)
### kind
[Section titled “kind”](#kind)
[`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
## Returns
[Section titled “Returns”](#returns)
`bigint`
# encodeHistoryCursor
> **encodeHistoryCursor**(`c`): `string`
Defined in: wallet-btc/src/history.ts:116
## Parameters
[Section titled “Parameters”](#parameters)
### c
[Section titled “c”](#c)
`BtcHistoryCursor`
## Returns
[Section titled “Returns”](#returns)
`string`
# encodeMessageSignature
> **encodeMessageSignature**(`rs`, `recovery`, `segwitType?`): `string`
Defined in: wallet-btc/src/message.ts:43
Encode `r‖s` + recovery id as a base64 BIP-137 signature.
## Parameters
[Section titled “Parameters”](#parameters)
### rs
[Section titled “rs”](#rs)
`Uint8Array`
### recovery
[Section titled “recovery”](#recovery)
`number`
### segwitType?
[Section titled “segwitType?”](#segwittype)
[`SegwitType`](/api/anywalletkit/wallet-btc/type-aliases/segwittype/) | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string`
# estimateVsize
> **estimateVsize**(`inputs`, `inputWeight`, `outputVBytes`): `number`
Defined in: wallet-btc/src/coinselect.ts:63
Virtual size (vB) of a segwit transaction with the given inputs and outputs.
## Parameters
[Section titled “Parameters”](#parameters)
### inputs
[Section titled “inputs”](#inputs)
`number`
### inputWeight
[Section titled “inputWeight”](#inputweight)
`number`
### outputVBytes
[Section titled “outputVBytes”](#outputvbytes)
`number`\[]
## Returns
[Section titled “Returns”](#returns)
`number`
# isAnsweredRefusal
> **isAnsweredRefusal**(`e`): `boolean`
Defined in: wallet-btc/src/http.ts:27
An endpoint answered with a refusal (HTTP 4xx other than 408, or an error body): nothing was taken. A thrown fetch, a timeout, a 5xx or a body that cannot be read may have been.
## Parameters
[Section titled “Parameters”](#parameters)
### e
[Section titled “e”](#e)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# magicHash
> **magicHash**(`message`): `Uint8Array`
Defined in: wallet-btc/src/message.ts:24
BIP-137 hash of a message (`Bitcoin Signed Message:` prefix, double SHA-256).
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# mapBlockbookTx
> **mapBlockbookTx**(`chain`, `address`, `tx`): [`BtcChainTx`](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/)
Defined in: wallet-btc/src/history.ts:136
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### tx
[Section titled “tx”](#tx)
[`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/)
## Returns
[Section titled “Returns”](#returns)
[`BtcChainTx`](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/)
# networkParams
> **networkParams**(`network`): `BTC_NETWORK`
Defined in: wallet-btc/src/network.ts:9
`@scure/btc-signer` parameters of a network.
## Parameters
[Section titled “Parameters”](#parameters)
### network
[Section titled “network”](#network)
[`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
## Returns
[Section titled “Returns”](#returns)
`BTC_NETWORK`
# outputVBytes
> **outputVBytes**(`kind`, `script?`): `number`
Defined in: wallet-btc/src/address.ts:52
Virtual bytes an output of this script kind occupies (8 B value + 1 B len + script).
## Parameters
[Section titled “Parameters”](#parameters)
### kind
[Section titled “kind”](#kind)
[`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
### script?
[Section titled “script?”](#script)
`Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
`number`
# parseRawTransaction
> **parseRawTransaction**(`rawHex`): `Transaction`
Defined in: wallet-btc/src/describe.ts:27
Parse raw tx hex. Prevout amounts are not in the wire format — callers pass them in `inputValues`.
## Parameters
[Section titled “Parameters”](#parameters)
### rawHex
[Section titled “rawHex”](#rawhex)
`string`
## Returns
[Section titled “Returns”](#returns)
`Transaction`
# purposeFor
> **purposeFor**(`type`): `84` | `86`
Defined in: wallet-btc/src/network.ts:22
BIP purpose for the address type: 84 (p2wpkh) or 86 (p2tr).
## Parameters
[Section titled “Parameters”](#parameters)
### type
[Section titled “type”](#type)
[`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/)
## Returns
[Section titled “Returns”](#returns)
`84` | `86`
# recoverMessagePublicKey
> **recoverMessagePublicKey**(`message`, `signature`): { `publicKey`: `Uint8Array`; `segwitType`: [`SegwitType`](/api/anywalletkit/wallet-btc/type-aliases/segwittype/) | `undefined`; } | `undefined`
Defined in: wallet-btc/src/message.ts:65
Recover the public key (compressed unless the header says otherwise) from a BIP-137 signature, or undefined when malformed.
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
### signature
[Section titled “signature”](#signature)
`string`
## Returns
[Section titled “Returns”](#returns)
{ `publicKey`: `Uint8Array`; `segwitType`: [`SegwitType`](/api/anywalletkit/wallet-btc/type-aliases/segwittype/) | `undefined`; } | `undefined`
# scriptKind
> **scriptKind**(`script`): [`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
Defined in: wallet-btc/src/address.ts:29
Type of an output script; `unknown` when it cannot be decoded.
## Parameters
[Section titled “Parameters”](#parameters)
### script
[Section titled “script”](#script)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
# selectAll
> **selectAll**(`o`): `object`
Defined in: wallet-btc/src/coinselect.ts:118
Sweep: every spendable input (largest first, capped), one output, no change.
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
`Omit`<[`CoinSelectOptions`](/api/anywalletkit/wallet-btc/interfaces/coinselectoptions/), `"targets"` | `"changeVBytes"` | `"changeDust"`> & `object`
## Returns
[Section titled “Returns”](#returns)
`object`
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
### utxos
[Section titled “utxos”](#utxos)
> **utxos**: [`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
### vsize
[Section titled “vsize”](#vsize)
> **vsize**: `number`
# selectCoins
> **selectCoins**(`o`): [`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/)
Defined in: wallet-btc/src/coinselect.ts:86
Pick UTXOs to fund the targets at `feeRate` (sat/vB): change goes back when it is above dust, otherwise it joins the fee.
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
[`CoinSelectOptions`](/api/anywalletkit/wallet-btc/interfaces/coinselectoptions/)
## Returns
[Section titled “Returns”](#returns)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/)
## Throws
[Section titled “Throws”](#throws)
`InsufficientFundsError` (core) when the UTXOs cannot cover targets plus fee, `TooManyInputsError` above `maxInputs`, Error for a fee rate below 1 sat/vB.
# signMessage
> **signMessage**(`message`, `privateKey`, `segwitType?`): `string`
Defined in: wallet-btc/src/message.ts:52
Sign with a raw private key (RFC-6979 deterministic, low-S). Kept for callers that hold a key outside a Signer.
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
### segwitType?
[Section titled “segwitType?”](#segwittype)
[`SegwitType`](/api/anywalletkit/wallet-btc/type-aliases/segwittype/) | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string`
# signMessageWith
> **signMessageWith**(`message`, `signer`, `segwitType?`): `Promise`<`string`>
Defined in: wallet-btc/src/message.ts:59
Sign through a Signer (`ecdsa-recoverable`, context `btc-message`).
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
### signer
[Section titled “signer”](#signer)
`Signer`
### segwitType?
[Section titled “segwitType?”](#segwittype)
[`SegwitType`](/api/anywalletkit/wallet-btc/type-aliases/segwittype/) | `undefined`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
# spendableUtxos
> **spendableUtxos**(`utxos`, `feeRate`, `inputWeight`): [`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
Defined in: wallet-btc/src/coinselect.ts:74
UTXOs worth spending at this fee rate, largest first.
## Parameters
[Section titled “Parameters”](#parameters)
### utxos
[Section titled “utxos”](#utxos)
[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
### feeRate
[Section titled “feeRate”](#feerate)
`bigint`
### inputWeight
[Section titled “inputWeight”](#inputweight)
`number`
## Returns
[Section titled “Returns”](#returns)
[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
# unconfirmedOutgoing
> **unconfirmedOutgoing**(`transactions`, `address`): `bigint`
Defined in: wallet-btc/src/blockbook.ts:34
Pending outgoing value the way Bitcoin Core’s wallet counts it: a pending tx is trusted only if every input is ours and confirmed or chained from another trusted tx; only then its change counts back.
## Parameters
[Section titled “Parameters”](#parameters)
### transactions
[Section titled “transactions”](#transactions)
[`BlockbookAddressTx`](/api/anywalletkit/wallet-btc/interfaces/blockbookaddresstx/)\[] | `undefined`
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# BlockbookAddressPage
Defined in: wallet-btc/src/blockbook.ts:18
One `/api/v2/address/{a}?details=txs` page.
## Properties
[Section titled “Properties”](#properties)
### address?
[Section titled “address?”](#address)
> `optional` **address?**: `string`
Defined in: wallet-btc/src/blockbook.ts:22
***
### balance?
[Section titled “balance?”](#balance)
> `optional` **balance?**: `string`
Defined in: wallet-btc/src/blockbook.ts:23
***
### itemsOnPage?
[Section titled “itemsOnPage?”](#itemsonpage)
> `optional` **itemsOnPage?**: `number`
Defined in: wallet-btc/src/blockbook.ts:21
***
### page?
[Section titled “page?”](#page)
> `optional` **page?**: `number`
Defined in: wallet-btc/src/blockbook.ts:19
***
### totalPages?
[Section titled “totalPages?”](#totalpages)
> `optional` **totalPages?**: `number`
Defined in: wallet-btc/src/blockbook.ts:20
***
### transactions?
[Section titled “transactions?”](#transactions)
> `optional` **transactions?**: [`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/)\[]
Defined in: wallet-btc/src/blockbook.ts:26
***
### txs?
[Section titled “txs?”](#txs)
> `optional` **txs?**: `number`
Defined in: wallet-btc/src/blockbook.ts:25
***
### unconfirmedBalance?
[Section titled “unconfirmedBalance?”](#unconfirmedbalance)
> `optional` **unconfirmedBalance?**: `string`
Defined in: wallet-btc/src/blockbook.ts:24
# BlockbookAddressTx
Defined in: wallet-btc/src/blockbook.ts:9
## Properties
[Section titled “Properties”](#properties)
### blockHeight
[Section titled “blockHeight”](#blockheight)
> **blockHeight**: `number`
Defined in: wallet-btc/src/blockbook.ts:9
***
### txid
[Section titled “txid”](#txid)
> **txid**: `string`
Defined in: wallet-btc/src/blockbook.ts:9
***
### vin?
[Section titled “vin?”](#vin)
> `optional` **vin?**: [`BlockbookVin`](/api/anywalletkit/wallet-btc/interfaces/blockbookvin/)\[]
Defined in: wallet-btc/src/blockbook.ts:9
***
### vout?
[Section titled “vout?”](#vout)
> `optional` **vout?**: [`BlockbookVout`](/api/anywalletkit/wallet-btc/interfaces/blockbookvout/)\[]
Defined in: wallet-btc/src/blockbook.ts:9
# BlockbookTx
Defined in: wallet-btc/src/types.ts:108
Transport-neutral tx record (Blockbook’s /api/v2/tx shape; Esplora is mapped onto it).
## Extended by
[Section titled “Extended by”](#extended-by)
* [`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/)
## Properties
[Section titled “Properties”](#properties)
### blockHeight
[Section titled “blockHeight”](#blockheight)
> **blockHeight**: `number`
Defined in: wallet-btc/src/types.ts:110
***
### blockTime?
[Section titled “blockTime?”](#blocktime)
> `optional` **blockTime?**: `number`
Defined in: wallet-btc/src/types.ts:114
***
### confirmations
[Section titled “confirmations”](#confirmations)
> **confirmations**: `number`
Defined in: wallet-btc/src/types.ts:111
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `string`
Defined in: wallet-btc/src/types.ts:112
***
### hex?
[Section titled “hex?”](#hex)
> `optional` **hex?**: `string`
Defined in: wallet-btc/src/types.ts:113
***
### txid
[Section titled “txid”](#txid)
> **txid**: `string`
Defined in: wallet-btc/src/types.ts:109
# BlockbookTxDetails
Defined in: wallet-btc/src/blockbook.ts:11
A Blockbook transaction with its inputs and outputs (`/api/v2/tx/{txid}`, or one row of `?details=txs`).
## Extends
[Section titled “Extends”](#extends)
* [`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/)
## Properties
[Section titled “Properties”](#properties)
### blockHeight
[Section titled “blockHeight”](#blockheight)
> **blockHeight**: `number`
Defined in: wallet-btc/src/types.ts:110
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`blockHeight`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#blockheight)
***
### blockTime?
[Section titled “blockTime?”](#blocktime)
> `optional` **blockTime?**: `number`
Defined in: wallet-btc/src/types.ts:114
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`blockTime`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#blocktime)
***
### confirmations
[Section titled “confirmations”](#confirmations)
> **confirmations**: `number`
Defined in: wallet-btc/src/types.ts:111
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`confirmations`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#confirmations)
***
### fees?
[Section titled “fees?”](#fees)
> `optional` **fees?**: `string`
Defined in: wallet-btc/src/types.ts:112
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`fees`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#fees)
***
### hex?
[Section titled “hex?”](#hex)
> `optional` **hex?**: `string`
Defined in: wallet-btc/src/types.ts:113
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`hex`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#hex)
***
### txid
[Section titled “txid”](#txid)
> **txid**: `string`
Defined in: wallet-btc/src/types.ts:109
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/).[`txid`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/#txid)
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string`
Defined in: wallet-btc/src/blockbook.ts:14
***
### valueIn?
[Section titled “valueIn?”](#valuein)
> `optional` **valueIn?**: `string`
Defined in: wallet-btc/src/blockbook.ts:15
***
### vin?
[Section titled “vin?”](#vin)
> `optional` **vin?**: [`BlockbookVin`](/api/anywalletkit/wallet-btc/interfaces/blockbookvin/)\[]
Defined in: wallet-btc/src/blockbook.ts:12
***
### vout?
[Section titled “vout?”](#vout)
> `optional` **vout?**: [`BlockbookVout`](/api/anywalletkit/wallet-btc/interfaces/blockbookvout/)\[]
Defined in: wallet-btc/src/blockbook.ts:13
# BlockbookVin
Defined in: wallet-btc/src/blockbook.ts:7
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: `string`\[]
Defined in: wallet-btc/src/blockbook.ts:7
***
### isAddress?
[Section titled “isAddress?”](#isaddress)
> `optional` **isAddress?**: `boolean`
Defined in: wallet-btc/src/blockbook.ts:7
***
### isOwn?
[Section titled “isOwn?”](#isown)
> `optional` **isOwn?**: `boolean`
Defined in: wallet-btc/src/blockbook.ts:7
***
### n?
[Section titled “n?”](#n)
> `optional` **n?**: `number`
Defined in: wallet-btc/src/blockbook.ts:7
***
### txid?
[Section titled “txid?”](#txid)
> `optional` **txid?**: `string`
Defined in: wallet-btc/src/blockbook.ts:7
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string`
Defined in: wallet-btc/src/blockbook.ts:7
***
### vout?
[Section titled “vout?”](#vout)
> `optional` **vout?**: `number`
Defined in: wallet-btc/src/blockbook.ts:7
# BlockbookVout
Defined in: wallet-btc/src/blockbook.ts:8
## Properties
[Section titled “Properties”](#properties)
### addresses?
[Section titled “addresses?”](#addresses)
> `optional` **addresses?**: `string`\[]
Defined in: wallet-btc/src/blockbook.ts:8
***
### isAddress?
[Section titled “isAddress?”](#isaddress)
> `optional` **isAddress?**: `boolean`
Defined in: wallet-btc/src/blockbook.ts:8
***
### isOwn?
[Section titled “isOwn?”](#isown)
> `optional` **isOwn?**: `boolean`
Defined in: wallet-btc/src/blockbook.ts:8
***
### n
[Section titled “n”](#n)
> **n**: `number`
Defined in: wallet-btc/src/blockbook.ts:8
***
### spent?
[Section titled “spent?”](#spent)
> `optional` **spent?**: `boolean`
Defined in: wallet-btc/src/blockbook.ts:8
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string`
Defined in: wallet-btc/src/blockbook.ts:8
# BtcChainTx
Defined in: wallet-btc/src/history.ts:44
A `ChainTx` with the Blockbook transaction it was built from.
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`BtcHistoryRaw`](/api/anywalletkit/wallet-btc/interfaces/btchistoryraw/)
Defined in: wallet-btc/src/history.ts:45
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# BtcClient
Defined in: wallet-btc/src/types.ts:8
Minimal chain-data client every transport implements. Values in satoshis, fee rates in sat/vB.
## Methods
[Section titled “Methods”](#methods)
### broadcast()
[Section titled “broadcast()”](#broadcast)
> **broadcast**(`rawTx`): `Promise`<`string`>
Defined in: wallet-btc/src/types.ts:19
Broadcast raw hex; returns the txid.
#### Parameters
[Section titled “Parameters”](#parameters)
##### rawTx
[Section titled “rawTx”](#rawtx)
`string`
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`string`>
***
### close()
[Section titled “close()”](#close)
> **close**(): `Promise`<`void`>
Defined in: wallet-btc/src/types.ts:10
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### connect()
[Section titled “connect()”](#connect)
> **connect**(): `Promise`<`void`>
Defined in: wallet-btc/src/types.ts:9
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`blocks`): `Promise`<`number`>
Defined in: wallet-btc/src/types.ts:21
Fee rate in sat/vB for confirmation within `blocks`.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### blocks
[Section titled “blocks”](#blocks)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`number`>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(`address`): `Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing?`: `bigint`; }>
Defined in: wallet-btc/src/types.ts:11
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `confirmed`: `bigint`; `unconfirmed`: `bigint`; `unconfirmedOutgoing?`: `bigint`; }>
***
### getBlockHeight()?
[Section titled “getBlockHeight()?”](#getblockheight)
> `optional` **getBlockHeight**(): `Promise`<`number`>
Defined in: wallet-btc/src/types.ts:23
Current chain tip height (anti-fee-sniping locktime). Optional.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`number`>
***
### getHistory()
[Section titled “getHistory()”](#gethistory)
> **getHistory**(`address`): `Promise`<`object`\[]>
Defined in: wallet-btc/src/types.ts:13
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`object`\[]>
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`txid`): `Promise`<`string`>
Defined in: wallet-btc/src/types.ts:15
Raw transaction hex.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### txid
[Section titled “txid”](#txid)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`string`>
***
### getTransactionInfo()?
[Section titled “getTransactionInfo()?”](#gettransactioninfo)
> `optional` **getTransactionInfo**(`txid`): `Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
Defined in: wallet-btc/src/types.ts:17
Full tx record (used for receipts).
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### txid
[Section titled “txid”](#txid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`BlockbookTx`](/api/anywalletkit/wallet-btc/interfaces/blockbooktx/) | `undefined`>
***
### listUnspent()
[Section titled “listUnspent()”](#listunspent)
> **listUnspent**(`address`): `Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
Defined in: wallet-btc/src/types.ts:12
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### address
[Section titled “address”](#address-2)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]>
# BtcConfig
Defined in: wallet-btc/src/types.ts:47
Options for a Bitcoin wallet manager or account: transports, network, address type and fee limits.
## Properties
[Section titled “Properties”](#properties)
### addressType?
[Section titled “addressType?”](#addresstype)
> `optional` **addressType?**: [`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/)
Defined in: wallet-btc/src/types.ts:53
p2wpkh (BIP-84, default) or p2tr (BIP-86 taproot). Changes the derivation path and the address.
***
### antiFeeSniping?
[Section titled “antiFeeSniping?”](#antifeesniping)
> `optional` **antiFeeSniping?**: `boolean`
Defined in: wallet-btc/src/types.ts:69
Set nLockTime to the current height so the tx cannot be mined into a reorg (default true; skipped when the transport has no `getBlockHeight`).
***
### client?
[Section titled “client?”](#client)
> `optional` **client?**: [`BtcClient`](/api/anywalletkit/wallet-btc/interfaces/btcclient/) | [`BtcClientConfig`](/api/anywalletkit/wallet-btc/type-aliases/btcclientconfig/) | BtcClient | BtcClientConfig\[]
Defined in: wallet-btc/src/types.ts:49
One or more transports (config objects or ready `BtcClient`s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: wallet-btc/src/types.ts:71
Injectable fetch (tests, custom agents). Defaults to globalThis.fetch.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### maxFeeRate?
[Section titled “maxFeeRate?”](#maxfeerate)
> `optional` **maxFeeRate?**: `number`
Defined in: wallet-btc/src/types.ts:63
Fee-rate ceiling in sat/vB (default 500). Anything above is refused before signing or broadcast.
***
### maxInputs?
[Section titled “maxInputs?”](#maxinputs)
> `optional` **maxInputs?**: `number`
Defined in: wallet-btc/src/types.ts:65
Coin-selection input cap (default 200).
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: [`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
Defined in: wallet-btc/src/types.ts:51
Network; default `bitcoin` (mainnet).
***
### rbf?
[Section titled “rbf?”](#rbf)
> `optional` **rbf?**: `boolean`
Defined in: wallet-btc/src/types.ts:67
Opt-in to replace-by-fee signalling (default true).
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-btc/src/types.ts:55
Extra attempts across the client list after the first failure (default 3).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-btc/src/types.ts:57
Per-request timeout in ms (default 15000).
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-btc/src/types.ts:61
Max fee (sats) for `sendTransaction` / `signTransaction`.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-btc/src/types.ts:59
Max fee (sats) for `transfer`.
# BtcHistoryOptions
Defined in: wallet-btc/src/history.ts:19
Options for [createBtcHistory](/api/anywalletkit/wallet-btc/functions/createbtchistory/).
## Properties
[Section titled “Properties”](#properties)
### blockbookUrl?
[Section titled “blockbookUrl?”](#blockbookurl)
> `optional` **blockbookUrl?**: `string`
Defined in: wallet-btc/src/history.ts:21
One Blockbook root (`https://btc1.trezor.io`).
***
### blockbookUrls?
[Section titled “blockbookUrls?”](#blockbookurls)
> `optional` **blockbookUrls?**: `string`\[]
Defined in: wallet-btc/src/history.ts:23
Several roots, tried in order (failover).
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: wallet-btc/src/history.ts:26
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: [`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/)
Defined in: wallet-btc/src/history.ts:25
`bitcoin` (default), `testnet`, `regtest`.
***
### pageSize?
[Section titled “pageSize?”](#pagesize)
> `optional` **pageSize?**: `number`
Defined in: wallet-btc/src/history.ts:30
Rows per Blockbook page (its max is 1000). Default: the query limit, capped at 100.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-btc/src/history.ts:28
Per request, ms. Default 15 000.
# BtcHistoryPage
Defined in: wallet-btc/src/history.ts:49
One page of Bitcoin history.
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`BtcChainTx`](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/)\[]
Defined in: wallet-btc/src/history.ts:50
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
***
### page?
[Section titled “page?”](#page)
> `optional` **page?**: `number`
Defined in: wallet-btc/src/history.ts:52
Blockbook page served / total pages.
***
### totalPages?
[Section titled “totalPages?”](#totalpages)
> `optional` **totalPages?**: `number`
Defined in: wallet-btc/src/history.ts:53
# BtcHistoryRaw
Defined in: wallet-btc/src/history.ts:34
What a Bitcoin `ChainTx` was built from, and the address’s own totals.
## Properties
[Section titled “Properties”](#properties)
### ownIn
[Section titled “ownIn”](#ownin)
> **ownIn**: `bigint`
Defined in: wallet-btc/src/history.ts:38
Sum of inputs spent by the address, sats.
***
### ownOut
[Section titled “ownOut”](#ownout)
> **ownOut**: `bigint`
Defined in: wallet-btc/src/history.ts:40
Sum of outputs paid to the address, sats.
***
### tx
[Section titled “tx”](#tx)
> **tx**: [`BlockbookTxDetails`](/api/anywalletkit/wallet-btc/interfaces/blockbooktxdetails/)
Defined in: wallet-btc/src/history.ts:36
The Blockbook transaction (vin / vout with addresses and values; `hex` dropped).
# BtcHistorySource
Defined in: wallet-btc/src/history.ts:57
Bitcoin history from a Blockbook instance. Build it with [createBtcHistory](/api/anywalletkit/wallet-btc/functions/createbtchistory/).
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`BtcChainTx`](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/) | `undefined`>
Defined in: wallet-btc/src/history.ts:59
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`BtcChainTx`](/api/anywalletkit/wallet-btc/interfaces/btcchaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`BtcHistoryPage`](/api/anywalletkit/wallet-btc/interfaces/btchistorypage/)>
Defined in: wallet-btc/src/history.ts:58
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`BtcHistoryPage`](/api/anywalletkit/wallet-btc/interfaces/btchistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
# BtcMaxSpendableResult
Defined in: wallet-btc/src/types.ts:118
The most one transaction can send (a sweep of every UTXO), after the fee.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-btc/src/types.ts:120
Max sats one transaction can send after the fee. 0n when nothing is spendable.
***
### changeValue
[Section titled “changeValue”](#changevalue)
> **changeValue**: `bigint`
Defined in: wallet-btc/src/types.ts:123
Always 0n: a sweep leaves no change.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-btc/src/types.ts:121
***
### feeRate
[Section titled “feeRate”](#feerate)
> **feeRate**: `bigint`
Defined in: wallet-btc/src/types.ts:126
***
### inputs
[Section titled “inputs”](#inputs)
> **inputs**: `number`
Defined in: wallet-btc/src/types.ts:125
Inputs the sweep would consume.
# BtcReceipt
Defined in: wallet-btc/src/types.ts:96
A mined Bitcoin transaction.
## Properties
[Section titled “Properties”](#properties)
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `bigint`
Defined in: wallet-btc/src/types.ts:100
***
### confirmations
[Section titled “confirmations”](#confirmations)
> **confirmations**: `number`
Defined in: wallet-btc/src/types.ts:101
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: wallet-btc/src/types.ts:103
Total fee in sats (when the transport reports it).
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-btc/src/types.ts:97
***
### hex?
[Section titled “hex?”](#hex)
> `optional` **hex?**: `string`
Defined in: wallet-btc/src/types.ts:104
***
### status
[Section titled “status”](#status)
> **status**: `1`
Defined in: wallet-btc/src/types.ts:99
Always 1 once mined — a Bitcoin transaction cannot fail after inclusion.
# BtcSpend
Defined in: wallet-btc/src/types.ts:75
A spend. `value` in satoshis; `feeRate` in sat/vB (estimated for `confirmationTarget` blocks when omitted).
## Properties
[Section titled “Properties”](#properties)
### confirmationTarget?
[Section titled “confirmationTarget?”](#confirmationtarget)
> `optional` **confirmationTarget?**: `number`
Defined in: wallet-btc/src/types.ts:79
***
### feeRate?
[Section titled “feeRate?”](#feerate)
> `optional` **feeRate?**: `number` | `bigint`
Defined in: wallet-btc/src/types.ts:78
***
### rbf?
[Section titled “rbf?”](#rbf)
> `optional` **rbf?**: `boolean`
Defined in: wallet-btc/src/types.ts:81
Override the account-level `rbf` default for this spend.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-btc/src/types.ts:76
***
### value
[Section titled “value”](#value)
> **value**: `string` | `number` | `bigint`
Defined in: wallet-btc/src/types.ts:77
# BtcTransferOptions
Defined in: wallet-btc/src/types.ts:88
A Bitcoin transfer. Amount in satoshis.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-btc/src/types.ts:92
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-btc/src/types.ts:91
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-btc/src/types.ts:90
Not supported on Bitcoin; present for the shared account interface.
# BtcTxDescription
Defined in: wallet-btc/src/types.ts:156
“What you sign”: the fully resolved transaction before (or after) signing.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-btc/src/types.ts:161
Sats sent to non-change outputs.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-btc/src/types.ts:162
***
### feeRate
[Section titled “feeRate”](#feerate)
> **feeRate**: `number`
Defined in: wallet-btc/src/types.ts:164
sat/vB, rounded to 2 decimals.
***
### inputs
[Section titled “inputs”](#inputs)
> **inputs**: [`BtcTxInputDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxinputdescription/)\[]
Defined in: wallet-btc/src/types.ts:158
***
### kind
[Section titled “kind”](#kind)
> **kind**: `"btc-transfer"`
Defined in: wallet-btc/src/types.ts:157
***
### lockTime
[Section titled “lockTime”](#locktime)
> **lockTime**: `number`
Defined in: wallet-btc/src/types.ts:167
***
### outputs
[Section titled “outputs”](#outputs)
> **outputs**: [`BtcTxOutputDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxoutputdescription/)\[]
Defined in: wallet-btc/src/types.ts:159
***
### rbf
[Section titled “rbf”](#rbf)
> **rbf**: `boolean`
Defined in: wallet-btc/src/types.ts:166
***
### txid?
[Section titled “txid?”](#txid)
> `optional` **txid?**: `string`
Defined in: wallet-btc/src/types.ts:169
Present once the transaction is signed.
***
### vsize
[Section titled “vsize”](#vsize)
> **vsize**: `number`
Defined in: wallet-btc/src/types.ts:165
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`BtcWarning`](/api/anywalletkit/wallet-btc/type-aliases/btcwarning/)\[]
Defined in: wallet-btc/src/types.ts:170
# BtcTxInputDescription
Defined in: wallet-btc/src/types.ts:141
One input of a described transaction: the UTXO it spends.
## Properties
[Section titled “Properties”](#properties)
### txid
[Section titled “txid”](#txid)
> **txid**: `string`
Defined in: wallet-btc/src/types.ts:142
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-btc/src/types.ts:144
***
### vout
[Section titled “vout”](#vout)
> **vout**: `number`
Defined in: wallet-btc/src/types.ts:143
# BtcTxOutputDescription
Defined in: wallet-btc/src/types.ts:148
One output of a described transaction, tagged as the recipient, our change, or unknown.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string` | `undefined`
Defined in: wallet-btc/src/types.ts:150
Undefined for scripts without an address form.
***
### role
[Section titled “role”](#role)
> **role**: `"recipient"` | `"change"` | `"unknown"`
Defined in: wallet-btc/src/types.ts:152
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-btc/src/types.ts:151
# Built
Defined in: wallet-btc/src/account.ts:22
## Properties
[Section titled “Properties”](#properties)
### desc
[Section titled “desc”](#desc)
> **desc**: [`BtcTxDescription`](/api/anywalletkit/wallet-btc/interfaces/btctxdescription/)
Defined in: wallet-btc/src/account.ts:26
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-btc/src/account.ts:24
***
### plan
[Section titled “plan”](#plan)
> **plan**: [`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)
Defined in: wallet-btc/src/account.ts:25
***
### tx
[Section titled “tx”](#tx)
> **tx**: `Transaction`
Defined in: wallet-btc/src/account.ts:23
# CoinSelection
Defined in: wallet-btc/src/coinselect.ts:50
UTXOs chosen for a spend, the fee and the change.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`SpendPlan`](/api/anywalletkit/wallet-btc/interfaces/spendplan/)
## Properties
[Section titled “Properties”](#properties)
### change
[Section titled “change”](#change)
> **change**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:54
Change back to us; 0n when folded into the fee.
***
### changeFolded
[Section titled “changeFolded”](#changefolded)
> **changeFolded**: `boolean`
Defined in: wallet-btc/src/coinselect.ts:56
True when change existed but fell below dust and became fee.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:52
***
### feeRate
[Section titled “feeRate”](#feerate)
> **feeRate**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:59
***
### utxos
[Section titled “utxos”](#utxos)
> **utxos**: [`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
Defined in: wallet-btc/src/coinselect.ts:51
***
### vsize
[Section titled “vsize”](#vsize)
> **vsize**: `number`
Defined in: wallet-btc/src/coinselect.ts:58
Estimated vsize of the final transaction.
# CoinSelectOptions
Defined in: wallet-btc/src/coinselect.ts:35
Input to [selectCoins](/api/anywalletkit/wallet-btc/functions/selectcoins/).
## Properties
[Section titled “Properties”](#properties)
### changeDust
[Section titled “changeDust”](#changedust)
> **changeDust**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:45
Dust threshold for our change output type.
***
### changeVBytes
[Section titled “changeVBytes”](#changevbytes)
> **changeVBytes**: `number`
Defined in: wallet-btc/src/coinselect.ts:43
vbytes a change output to our own address occupies.
***
### feeRate
[Section titled “feeRate”](#feerate)
> **feeRate**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:39
sat/vB, ≥ 1.
***
### inputWeight
[Section titled “inputWeight”](#inputweight)
> **inputWeight**: `number`
Defined in: wallet-btc/src/coinselect.ts:41
Weight units one of our inputs adds (`INPUT_WEIGHT[addressType]`).
***
### maxInputs?
[Section titled “maxInputs?”](#maxinputs)
> `optional` **maxInputs?**: `number`
Defined in: wallet-btc/src/coinselect.ts:46
***
### targets
[Section titled “targets”](#targets)
> **targets**: [`SelectionTarget`](/api/anywalletkit/wallet-btc/interfaces/selectiontarget/)\[]
Defined in: wallet-btc/src/coinselect.ts:37
***
### utxos
[Section titled “utxos”](#utxos)
> **utxos**: [`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
Defined in: wallet-btc/src/coinselect.ts:36
# DecodedAddress
Defined in: wallet-btc/src/address.ts:9
An address decoded to its output script.
## Properties
[Section titled “Properties”](#properties)
### kind
[Section titled “kind”](#kind)
> **kind**: [`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
Defined in: wallet-btc/src/address.ts:11
***
### script
[Section titled “script”](#script)
> **script**: `Uint8Array`
Defined in: wallet-btc/src/address.ts:10
# DescribeContext
Defined in: wallet-btc/src/describe.ts:17
What a description needs to tell recipient, change and unknown outputs apart.
## Properties
[Section titled “Properties”](#properties)
### intended?
[Section titled “intended?”](#intended)
> `optional` **intended?**: `object`
Defined in: wallet-btc/src/describe.ts:22
The spend the caller asked for. Outputs matching it are `recipient`; anything else is `unknown`.
#### to
[Section titled “to”](#to)
> **to**: `string`
#### value
[Section titled “value”](#value)
> **value**: `bigint`
***
### maxFeeRate?
[Section titled “maxFeeRate?”](#maxfeerate)
> `optional` **maxFeeRate?**: `number`
Defined in: wallet-btc/src/describe.ts:23
***
### network
[Section titled “network”](#network)
> **network**: `BTC_NETWORK`
Defined in: wallet-btc/src/describe.ts:18
***
### ownAddress
[Section titled “ownAddress”](#ownaddress)
> **ownAddress**: `string`
Defined in: wallet-btc/src/describe.ts:20
Our own address: outputs paying it are tagged `change`.
# SelectionTarget
Defined in: wallet-btc/src/coinselect.ts:28
An output the selection must fund.
## Properties
[Section titled “Properties”](#properties)
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:29
***
### vbytes
[Section titled “vbytes”](#vbytes)
> **vbytes**: `number`
Defined in: wallet-btc/src/coinselect.ts:31
vbytes the output occupies (see `outputVBytes`).
# SpendPlan
Defined in: wallet-btc/src/read-only-account.ts:15
A coin selection for one spend, with the recipient’s script.
## Extends
[Section titled “Extends”](#extends)
* [`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/)
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-btc/src/read-only-account.ts:17
Sats the recipient gets (the requested value — never reduced).
***
### change
[Section titled “change”](#change)
> **change**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:54
Change back to us; 0n when folded into the fee.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`change`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#change)
***
### changeFolded
[Section titled “changeFolded”](#changefolded)
> **changeFolded**: `boolean`
Defined in: wallet-btc/src/coinselect.ts:56
True when change existed but fell below dust and became fee.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`changeFolded`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#changefolded)
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:52
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`fee`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#fee)
***
### feeRate
[Section titled “feeRate”](#feerate)
> **feeRate**: `bigint`
Defined in: wallet-btc/src/coinselect.ts:59
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`feeRate`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#feerate)
***
### recipientKind
[Section titled “recipientKind”](#recipientkind)
> **recipientKind**: [`ScriptKind`](/api/anywalletkit/wallet-btc/type-aliases/scriptkind/)
Defined in: wallet-btc/src/read-only-account.ts:19
***
### recipientScript
[Section titled “recipientScript”](#recipientscript)
> **recipientScript**: `Uint8Array`
Defined in: wallet-btc/src/read-only-account.ts:18
***
### utxos
[Section titled “utxos”](#utxos)
> **utxos**: [`Utxo`](/api/anywalletkit/wallet-btc/interfaces/utxo/)\[]
Defined in: wallet-btc/src/coinselect.ts:51
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`utxos`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#utxos)
***
### vsize
[Section titled “vsize”](#vsize)
> **vsize**: `number`
Defined in: wallet-btc/src/coinselect.ts:58
Estimated vsize of the final transaction.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`CoinSelection`](/api/anywalletkit/wallet-btc/interfaces/coinselection/).[`vsize`](/api/anywalletkit/wallet-btc/interfaces/coinselection/#vsize)
# Utxo
Defined in: wallet-btc/src/types.ts:27
An unspent output the account can spend.
## Properties
[Section titled “Properties”](#properties)
### height
[Section titled “height”](#height)
> **height**: `number`
Defined in: wallet-btc/src/types.ts:33
Block height; 0 or -1 while unconfirmed.
***
### txid
[Section titled “txid”](#txid)
> **txid**: `string`
Defined in: wallet-btc/src/types.ts:28
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-btc/src/types.ts:31
Satoshis.
***
### vout
[Section titled “vout”](#vout)
> **vout**: `number`
Defined in: wallet-btc/src/types.ts:29
# BtcAddressType
> **BtcAddressType** = `"p2wpkh"` | `"p2tr"`
Defined in: wallet-btc/src/types.ts:5
Address / script type the account spends from. BIP-84 p2wpkh (bc1q…) or BIP-86 p2tr (bc1p…).
# BtcClientConfig
> **BtcClientConfig** = { `clientConfig`: { `url`: `string`; }; `type`: `"blockbook-http"`; } | { `clientConfig`: { `url`: `string`; }; `type`: `"esplora-http"`; }
Defined in: wallet-btc/src/types.ts:37
One transport to a Bitcoin indexer: Blockbook or Esplora over HTTP.
## Union Members
[Section titled “Union Members”](#union-members)
### Type Literal
[Section titled “Type Literal”](#type-literal)
{ `clientConfig`: { `url`: `string`; }; `type`: `"blockbook-http"`; }
Trezor Blockbook REST (`https://btc1.trezor.io`, QuickNode’s Blockbook add-on, …).
***
### Type Literal
[Section titled “Type Literal”](#type-literal-1)
{ `clientConfig`: { `url`: `string`; }; `type`: `"esplora-http"`; }
Esplora REST (`https://mempool.space/api`, `https://blockstream.info/api`).
# BtcNetwork
> **BtcNetwork** = `"bitcoin"` | `"testnet"` | `"regtest"`
Defined in: wallet-btc/src/types.ts:2
Bitcoin mainnet, testnet or regtest.
# BtcTransaction
> **BtcTransaction** = [`BtcSpend`](/api/anywalletkit/wallet-btc/interfaces/btcspend/) | `string`
Defined in: wallet-btc/src/types.ts:85
`sendTransaction` accepts a spend or an already signed raw transaction hex.
# BtcWarning
> **BtcWarning** = `"high-fee-rate"` | `"fee-over-10pct-of-amount"` | `"dust-output"` | `"no-change"`
Defined in: wallet-btc/src/types.ts:130
Problems a described transaction is flagged with.
# ScriptKind
> **ScriptKind** = `"pk"` | `"pkh"` | `"sh"` | `"wsh"` | `"wpkh"` | `"ms"` | `"tr"` | `"tr_ns"` | `"tr_ms"` | `"p2a"` | `"unknown"`
Defined in: wallet-btc/src/address.ts:6
Output-script families btc-signer recognises (`OutScript.decode(...).type`).
# SegwitType
> **SegwitType** = `"p2wpkh"` | `"p2sh(p2wpkh)"`
Defined in: wallet-btc/src/message.ts:33
Address flavour a BIP-137 signature header is written for.
# UnsafeTransactionCode
> **UnsafeTransactionCode** = `"fee-rate-too-high"` | `"unexpected-output"` | `"recipient-mismatch"` | `"change-not-ours"` | `"prevout-mismatch"`
Defined in: wallet-btc/src/errors.ts:4
Why a spend was refused before signing.
# CAIP2_GENESIS
> `const` **CAIP2_GENESIS**: `Record`<[`BtcNetwork`](/api/anywalletkit/wallet-btc/type-aliases/btcnetwork/), `string`>
Defined in: wallet-btc/src/types.ts:174
CAIP-2 ids of the Bitcoin networks, by name.
# DEFAULT_MAX_FEE_RATE
> `const` **DEFAULT_MAX_FEE_RATE**: `500` = `500`
Defined in: wallet-btc/src/describe.ts:10
Default fee-rate ceiling, sat/vB; a spend above it is refused.
# DUST_LIMIT_P2TR
> `const` **DUST_LIMIT_P2TR**: `bigint`
Defined in: wallet-btc/src/address.ts:76
Smallest p2tr output relay policy accepts, in satoshis.
# DUST_LIMIT_P2WPKH
> `const` **DUST_LIMIT_P2WPKH**: `bigint`
Defined in: wallet-btc/src/address.ts:74
Smallest p2wpkh output relay policy accepts, in satoshis.
# FINAL_SEQUENCE
> `const` **FINAL_SEQUENCE**: `4294967294` = `0xfffffffe`
Defined in: wallet-btc/src/describe.ts:14
Opts out of RBF while still letting nLockTime apply.
# INPUT_WEIGHT
> `const` **INPUT_WEIGHT**: `Record`<[`BtcAddressType`](/api/anywalletkit/wallet-btc/type-aliases/btcaddresstype/), `number`>
Defined in: wallet-btc/src/address.ts:49
Weight units one of OUR inputs adds once signed (prevout 41 B × 4 + witness). p2wpkh assumes a 72-byte DER sig.
# MAX_UTXO_INPUTS
> `const` **MAX_UTXO_INPUTS**: `200` = `200`
Defined in: wallet-btc/src/coinselect.ts:22
Most inputs one spend may use; above it the account asks to consolidate first.
# RBF_SEQUENCE
> `const` **RBF_SEQUENCE**: `4294967293` = `0xfffffffd`
Defined in: wallet-btc/src/describe.ts:12
Replace-by-fee signalling: any sequence below 0xfffffffe (BIP-125).
# REGTEST_NETWORK
> `const` **REGTEST_NETWORK**: `BTC_NETWORK`
Defined in: wallet-btc/src/network.ts:6
btc-signer ships mainnet + testnet; regtest only differs in the bech32 HRP.
# @anywalletkit/wallet-evm
# @anywalletkit/wallet-evm
[Section titled “@anywalletkit/wallet-evm”](#anywalletkitwallet-evm)
[](https://www.npmjs.com/package/@anywalletkit/wallet-evm)
EVM accounts for Any Wallet Kit, derived at `m/44'/60'/0'/0/i` — the same path as MetaMask and ethers, pinned by golden vectors in `@anywalletkit/conformance`.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-evm
# or: pnpm add @anywalletkit/wallet-evm · yarn add @anywalletkit/wallet-evm
```
On npm: [@anywalletkit/wallet-evm](https://www.npmjs.com/package/@anywalletkit/wallet-evm), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import WalletManagerEvm from '@anywalletkit/wallet-evm'
const wallet = new WalletManagerEvm(seedPhrase, { provider: ['https://rpc-a', 'https://rpc-b'] })
const account = await wallet.getAccount(0)
await account.transfer({ recipient: '0x…', amount: 10n ** 15n }) // ETH
await account.transfer({ token: USDT, recipient: '0x…', amount: 1_000_000n }) // ERC-20
await account.approve({ token: USDT, spender: ROUTER, amount: 1_000_000n })
const sig = await account.signTypedData({ domain, types, message }) // EIP-712
wallet.dispose() // zeroizes seed + keys
```
Offline signing: omit `provider`, pass `chainId` (or put it on the tx) and call `signTransaction` with every field set — nothing touches the network.
## Token info
[Section titled “Token info”](#token-info)
`getTokenInfo(address)` reads an ERC-20 from its contract: `{ address, standard: 'erc20', decimals, symbol, name, totalSupply, flags }`. `bytes32` symbols (MKR) are decoded; text that is not UTF-8 is `''`. `flags` holds `upgradeable` when the address is an EIP-1967 / EIP-1822 / beacon / ZeppelinOS proxy. No code, an EIP-7702-delegated account or no `decimals()` (an NFT, a plain contract) throws `NotATokenError`; RPC failures are thrown as they are. `@anywalletkit/tokens` builds the “add a token” flow on it.
## Safety layer
[Section titled “Safety layer”](#safety-layer)
Every send goes through, in order: static refusals → simulation → fee cap → sign → broadcast.
* **What you sign.** `describeTransaction(tx, {chainId})` and `describeTypedData(typed, {chainId, account})` are pure, offline decoders for a confirmation screen: kind (`native-transfer`, `erc20-transfer`, `erc20-approve`, `contract-call`, `eip7702-delegation`, …; `permit`, `permit2`, `safe-tx`, `generic`), decoded fields, and warnings (`approve-unlimited`, `to-zero-address`, `chain-mismatch`, `deadline-passed`, `owner-mismatch`, `legacy-fee-fields`).
* **Hard refusals** before any signature: a tx or typed-data domain for another chain throws `ChainMismatchError` (override typed data with `allowCrossChainTypedData`); value to the zero address throws `UnsafeTransactionError` (override with `allowBurn`).
* **Simulation.** `simulateTransaction(tx)` runs `eth_call` + gas estimate and returns `{ok, gas, returnData}` or `{ok: false, reason, data}` with the decoded `Error(string)` / `Panic` / custom-error selector. `sendTransaction` / `transfer` / `approve` simulate first and throw `SimulationError` instead of broadcasting a revert; `simulate: false` opts out. The estimated gas is reused, so the network is asked once.
* **Fee cap.** `transferMaxFee` / `transactionMaxFee` are checked on the transaction about to be signed — gas limit × its `gasPrice` / `maxFeePerGas`, fee fields you set yourself included — before every signature. `quoteSendTransaction` prices the same fields, so a kit `maxFee` policy sees them too.
* **Broadcast.** A lost answer throws `BroadcastUnknownError` with the locally computed `hash`: watch it, do not send again. With several RPCs, `already known` from the next one is the same transaction and resolves to its hash. `nonce too low` is re-signed with the next nonce only when the nonce is proven taken by another transaction: at least two distinct configured RPCs count the account’s mined transactions past it (`latest`) and none of them knows the rejected hash. Otherwise — one RPC configured, or the RPCs disagree — the send throws `NonceConflictError` (a `BroadcastUnknownError`: `maybeSent`, `hash`, plus `nonce` and the node’s `nextNonce`) and nothing new is signed, since the RPC that refused may still hold and broadcast the signed bytes. Show “the network didn’t confirm — check activity, then retry”; the account’s next send skips the refused nonce. `replacement transaction underpriced` is never retried.
* **EIP-2612 permit.** `getPermitInfo(token)` reads `name/version/nonces/DOMAIN_SEPARATOR` and reports `supported` only when the rebuilt EIP-712 domain equals the contract’s own; `signPermit({token, spender, value, deadline})` returns `{signature, v, r, s, nonce, deadline, typedData}`. DAI’s legacy `permit(holder, spender, nonce, expiry, allowed)` is not supported.
```ts
const d = describeTransaction(tx, { chainId: await account.getChainId() })
if (d.warnings.some((w) => w.code === 'approve-unlimited')) ask(d)
const sim = await account.simulateTransaction(tx)
if (!sim.ok) show(sim.reason)
```
## Classes
[Section titled “Classes”](#classes)
* [BroadcastUnknownError](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/)
* [ChainMismatchError](/api/anywalletkit/wallet-evm/classes/chainmismatcherror/)
* [NonceConflictError](/api/anywalletkit/wallet-evm/classes/nonceconflicterror/)
* [PermitUnsupportedError](/api/anywalletkit/wallet-evm/classes/permitunsupportederror/)
* [SimulationError](/api/anywalletkit/wallet-evm/classes/simulationerror/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-evm/classes/unsafetransactionerror/)
* [WalletAccountEvm](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)
* [WalletAccountReadOnlyEvm](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/)
* [WalletManagerEvm](/api/anywalletkit/wallet-evm/classes/walletmanagerevm/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ApproveOptions](/api/anywalletkit/wallet-evm/interfaces/approveoptions/)
* [EvmConfig](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)
* [EvmReceipt](/api/anywalletkit/wallet-evm/interfaces/evmreceipt/)
* [EvmTransaction](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
* [EvmTransferOptions](/api/anywalletkit/wallet-evm/interfaces/evmtransferoptions/)
* [PermitOptions](/api/anywalletkit/wallet-evm/interfaces/permitoptions/)
* [SignedPermit](/api/anywalletkit/wallet-evm/interfaces/signedpermit/)
* [TxDescription](/api/anywalletkit/wallet-evm/interfaces/txdescription/)
* [TypedDataDescription](/api/anywalletkit/wallet-evm/interfaces/typeddatadescription/)
* [TypedDataInput](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
* [Warning](/api/anywalletkit/wallet-evm/interfaces/warning/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [EvmProvider](/api/anywalletkit/wallet-evm/type-aliases/evmprovider/)
* [FeeFields](/api/anywalletkit/wallet-evm/type-aliases/feefields/)
* [PermitInfo](/api/anywalletkit/wallet-evm/type-aliases/permitinfo/)
* [SimulationResult](/api/anywalletkit/wallet-evm/type-aliases/simulationresult/)
* [TxKind](/api/anywalletkit/wallet-evm/type-aliases/txkind/)
* [TxWarning](/api/anywalletkit/wallet-evm/type-aliases/txwarning/)
* [TxWarningCode](/api/anywalletkit/wallet-evm/type-aliases/txwarningcode/)
* [TypedDataKind](/api/anywalletkit/wallet-evm/type-aliases/typeddatakind/)
* [TypedDataWarning](/api/anywalletkit/wallet-evm/type-aliases/typeddatawarning/)
* [TypedDataWarningCode](/api/anywalletkit/wallet-evm/type-aliases/typeddatawarningcode/)
## Variables
[Section titled “Variables”](#variables)
* [ERC20_ABI](/api/anywalletkit/wallet-evm/variables/erc20_abi/)
* [ERC20_PERMIT_ABI](/api/anywalletkit/wallet-evm/variables/erc20_permit_abi/)
* [EVM_BASE_PATH](/api/anywalletkit/wallet-evm/variables/evm_base_path/)
* [MAX_TYPED_DATA_FIELDS](/api/anywalletkit/wallet-evm/variables/max_typed_data_fields/)
* [MAX_TYPED_DATA_TYPES](/api/anywalletkit/wallet-evm/variables/max_typed_data_types/)
* [PERMIT_TYPES](/api/anywalletkit/wallet-evm/variables/permit_types/)
* [USDT_MAINNET](/api/anywalletkit/wallet-evm/variables/usdt_mainnet/)
## Functions
[Section titled “Functions”](#functions)
* [addressFromPublicKey](/api/anywalletkit/wallet-evm/functions/addressfrompublickey/)
* [assertTxShape](/api/anywalletkit/wallet-evm/functions/asserttxshape/)
* [assertTypedDataSize](/api/anywalletkit/wallet-evm/functions/asserttypeddatasize/)
* [canonicalData](/api/anywalletkit/wallet-evm/functions/canonicaldata/)
* [cleanTypes](/api/anywalletkit/wallet-evm/functions/cleantypes/)
* [createClient](/api/anywalletkit/wallet-evm/functions/createclient/)
* [decodeRevert](/api/anywalletkit/wallet-evm/functions/decoderevert/)
* [describeTransaction](/api/anywalletkit/wallet-evm/functions/describetransaction/)
* [describeTypedData](/api/anywalletkit/wallet-evm/functions/describetypeddata/)
* [encodeApprove](/api/anywalletkit/wallet-evm/functions/encodeapprove/)
* [encodeTransfer](/api/anywalletkit/wallet-evm/functions/encodetransfer/)
* [inferPrimaryType](/api/anywalletkit/wallet-evm/functions/inferprimarytype/)
* [isUnlimitedAmount](/api/anywalletkit/wallet-evm/functions/isunlimitedamount/)
* [transferTransaction](/api/anywalletkit/wallet-evm/functions/transfertransaction/)
* [typedDataHash](/api/anywalletkit/wallet-evm/functions/typeddatahash/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerEvm](/api/anywalletkit/wallet-evm/classes/walletmanagerevm/)
# BroadcastUnknownError
Defined in: wallet-evm/src/errors.ts:58
The signed transaction was handed to the node but no answer came back (timeout, connection lost, gateway error): it MAY be in the mempool. Do not re-sign it as new — watch `hash` (keccak of the signed raw tx, computed locally) instead.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Extended by
[Section titled “Extended by”](#extended-by)
* [`NonceConflictError`](/api/anywalletkit/wallet-evm/classes/nonceconflicterror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-evm/src/errors.ts:63
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`` `0x${string}` ``
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `` `0x${string}` ``
Defined in: wallet-evm/src/errors.ts:62
Hash of the signed transaction, computed locally. Watch it instead of sending again.
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-evm/src/errors.ts:60
Always true: the transaction may be on its way.
# ChainMismatchError
Defined in: wallet-evm/src/errors.ts:9
Refused before signing: the payload’s chain is not the account’s chain. A tx for chain 1 signed by an account that detected chain 10, or typed data whose domain names another chain, is the classic replay / wrong-network mistake — surfaced here instead of as a reverted or stranded transaction.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new ChainMismatchError**(`expected`, `actual`, `what?`): `ChainMismatchError`
Defined in: wallet-evm/src/errors.ts:14
#### Parameters
[Section titled “Parameters”](#parameters)
##### expected
[Section titled “expected”](#expected)
`number`
##### actual
[Section titled “actual”](#actual)
`number`
##### what?
[Section titled “what?”](#what)
`string` = `'transaction'`
#### Returns
[Section titled “Returns”](#returns)
`ChainMismatchError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### actual
[Section titled “actual”](#actual-1)
> `readonly` **actual**: `number`
Defined in: wallet-evm/src/errors.ts:13
The chain id the payload names.
***
### expected
[Section titled “expected”](#expected-1)
> `readonly` **expected**: `number`
Defined in: wallet-evm/src/errors.ts:11
The account’s chain id.
# NonceConflictError
Defined in: wallet-evm/src/errors.ts:77
The node refused the transaction with “nonce too low”, its hash was not found, and the nonce could not be proven spent by another transaction (scan 2026-10-30 F1). The RPC that refused it already holds the signed bytes: if it lied, it can still broadcast them, so nothing new is signed. Show “the network didn’t confirm — check activity, then retry”; the account’s next send uses `nextNonce` (when the node named one) or the nonce after this one.
## Extends
[Section titled “Extends”](#extends)
* [`BroadcastUnknownError`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/)
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NonceConflictError**(`hash`, `nonce`, `nextNonce`, `cause`): `NonceConflictError`
Defined in: wallet-evm/src/errors.ts:82
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`` `0x${string}` ``
##### nonce
[Section titled “nonce”](#nonce)
`number`
##### nextNonce
[Section titled “nextNonce”](#nextnonce)
`number` | `undefined`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`NonceConflictError`
#### Overrides
[Section titled “Overrides”](#overrides)
[`BroadcastUnknownError`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/).[`constructor`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/#constructor)
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `` `0x${string}` ``
Defined in: wallet-evm/src/errors.ts:62
Hash of the signed transaction, computed locally. Watch it instead of sending again.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`BroadcastUnknownError`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/).[`hash`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/#hash)
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-evm/src/errors.ts:60
Always true: the transaction may be on its way.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`BroadcastUnknownError`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/).[`maybeSent`](/api/anywalletkit/wallet-evm/classes/broadcastunknownerror/#maybesent)
***
### nextNonce
[Section titled “nextNonce”](#nextnonce-1)
> `readonly` **nextNonce**: `number` | `undefined`
Defined in: wallet-evm/src/errors.ts:81
The next nonce the node named in its refusal, when it named one.
***
### nonce
[Section titled “nonce”](#nonce-1)
> `readonly` **nonce**: `number`
Defined in: wallet-evm/src/errors.ts:79
The nonce the signed transaction carries.
# PermitUnsupportedError
Defined in: wallet-evm/src/errors.ts:45
The token does not implement EIP-2612 `permit` (or its domain could not be reproduced).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new PermitUnsupportedError**(`token`, `reason`): `PermitUnsupportedError`
Defined in: wallet-evm/src/errors.ts:46
#### Parameters
[Section titled “Parameters”](#parameters)
##### token
[Section titled “token”](#token)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns)
`PermitUnsupportedError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# SimulationError
Defined in: wallet-evm/src/errors.ts:31
`eth_call` of the transaction reverted; nothing was signed or sent. `reason` is decoded when possible.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SimulationError**(`reason`, `data?`): `SimulationError`
Defined in: wallet-evm/src/errors.ts:36
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
##### data?
[Section titled “data?”](#data)
`` `0x${string}` ``
#### Returns
[Section titled “Returns”](#returns)
`SimulationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data-1)
> `readonly` **data**: `` `0x${string}` `` | `undefined`
Defined in: wallet-evm/src/errors.ts:35
Raw revert data, when the node returned it.
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-evm/src/errors.ts:33
Decoded revert reason, or the node’s message.
# UnsafeTransactionError
Defined in: wallet-evm/src/errors.ts:23
Refused before signing: the transaction would almost certainly destroy funds (e.g. value to the zero address).
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`message`): `UnsafeTransactionError`
Defined in: wallet-evm/src/errors.ts:24
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
# WalletAccountEvm
Defined in: wallet-evm/src/account.ts:87
An EVM account with a signer: signs messages, typed data, permits and transactions, and sends transfers and approvals. Before signing it checks the chain id and simulates the transaction (when a provider is configured), and refuses value sent to the zero address.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountEvm**(`signer`, `publicKey`, `path`, `config?`): `WalletAccountEvm`
Defined in: wallet-evm/src/account.ts:118
`publicKey` is the signer’s compressed secp256k1 key (33 bytes); it is needed synchronously for the address.
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`constructor`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: { } | `undefined`
Defined in: wallet-evm/src/read-only-account.ts:129
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`_client`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#_client)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)
Defined in: wallet-evm/src/read-only-account.ts:128
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`_config`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#_config)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `` `0x${string}` ``
Defined in: wallet-evm/src/read-only-account.ts:127
Checksummed address.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`address`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#address)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `false` = `false`
Defined in: wallet-evm/src/account.ts:88
True when `signTransaction` itself needs the network (TON seqno, Solana blockhash, BTC UTXOs, Tron ref block). EVM signs offline.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-evm/src/account.ts:90
Derivation path, or `external` for an external signer.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-evm/src/account.ts:92
Compressed secp256k1 public key (33 bytes).
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"external"` | `"key"` | `"seed"`
Defined in: wallet-evm/src/account.ts:100
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### chain
[Section titled “chain”](#chain)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **chain**(): `string`
Defined in: wallet-evm/src/read-only-account.ts:140
CAIP-2 id; “eip155:unknown” until the chain id is known (offline wallet without `chainId`).
##### Returns
[Section titled “Returns”](#returns-1)
`string`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`chain`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#chain)
***
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-evm/src/account.ts:132
Account index when the path is the standard m/44’/60’/0’/0/i, else undefined.
##### Returns
[Section titled “Returns”](#returns-2)
`number` | `undefined`
## Methods
[Section titled “Methods”](#methods)
### approve()
[Section titled “approve()”](#approve)
> **approve**(`options`, `writeOptions?`): `Promise`<`TransferResult`>
Defined in: wallet-evm/src/account.ts:474
ERC-20 approve. Mainnet USDT non-zero → non-zero is refused or auto-reset (`autoResetAllowance`). `writeOptions.maxFee` (and `transactionMaxFee`) holds for each transaction signed, the reset too.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### options
[Section titled “options”](#options)
[`ApproveOptions`](/api/anywalletkit/wallet-evm/interfaces/approveoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`TransferResult`>
***
### callParams()
[Section titled “callParams()”](#callparams)
> `protected` **callParams**(`tx`): `object`
Defined in: wallet-evm/src/read-only-account.ts:243
Calldata/value/to in the shape viem’s `call` / `estimateGas` take — with an EIP-7702 transaction’s authorizations, so the dry run executes the delegate’s code, not the account’s.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-4)
`object`
##### account
[Section titled “account”](#account)
> **account**: `` `0x${string}` ``
##### authorizationList?
[Section titled “authorizationList?”](#authorizationlist)
> `optional` **authorizationList?**: `undefined`
##### data?
[Section titled “data?”](#data)
> `optional` **data?**: `` `0x${string}` ``
##### to?
[Section titled “to?”](#to)
> `optional` **to?**: `` `0x${string}` ``
##### value?
[Section titled “value?”](#value)
> `optional` **value?**: `bigint`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`callParams`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#callparams)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-evm/src/account.ts:519
Dispose the signer (zeroizes a local key). Idempotent.
#### Returns
[Section titled “Returns”](#returns-5)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### feeFields()
[Section titled “feeFields()”](#feefields)
> `protected` **feeFields**(`tx`, `chainId`): `Promise`<[`FeeFields`](/api/anywalletkit/wallet-evm/type-aliases/feefields/)>
Defined in: wallet-evm/src/read-only-account.ts:265
The fee fields a send signs: the transaction’s own where it sets them, the network’s for the rest. One function for the quote and the signature, so a cap checked on the quote holds for what is signed.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-1)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
##### chainId
[Section titled “chainId”](#chainid)
`number`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`FeeFields`](/api/anywalletkit/wallet-evm/type-aliases/feefields/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`feeFields`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#feefields)
***
### gasFor()
[Section titled “gasFor()”](#gasfor)
> `protected` **gasFor**(`tx`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:255
Gas limit: the tx’s own, else one estimate.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx-2)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`gasFor`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gasfor)
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-evm/src/read-only-account.ts:151
The checksummed address.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getAddress`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#getaddress)
***
### getAllowance()
[Section titled “getAllowance()”](#getallowance)
> **getAllowance**(`token`, `spender`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:181
ERC-20 `allowance(owner, spender)` in base units.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### token
[Section titled “token”](#token)
`string`
##### spender
[Section titled “spender”](#spender)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getAllowance`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#getallowance)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:162
Native balance in wei.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getBalance`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#getbalance)
***
### getChainId()
[Section titled “getChainId()”](#getchainid)
> **getChainId**(): `Promise`<`number`>
Defined in: wallet-evm/src/read-only-account.ts:156
Chain id from the config, or asked from the RPC once and cached.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getChainId`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#getchainid)
***
### getFeeRate()
[Section titled “getFeeRate()”](#getfeerate)
> **getFeeRate**(): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:230
Current fee rate: maxFeePerGas, falling back to gasPrice.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getFeeRate`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#getfeerate)
***
### getPermitInfo()
[Section titled “getPermitInfo()”](#getpermitinfo)
> **getPermitInfo**(`token`): `Promise`<[`PermitInfo`](/api/anywalletkit/wallet-evm/type-aliases/permitinfo/)>
Defined in: wallet-evm/src/account.ts:419
Does `token` implement EIP-2612 permit, and with which domain? Supported only when the domain separator we rebuild from name/version/chainId/ verifyingContract equals the contract’s own — so a signature we produce is one the contract will accept. DAI’s legacy `permit(holder, spender, nonce, expiry, allowed)` is NOT recognised.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`PermitInfo`](/api/anywalletkit/wallet-evm/type-aliases/permitinfo/)>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:167
ERC-20 `balanceOf` in the token’s base units.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getTokenBalance`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gettokenbalance)
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-evm/src/read-only-account.ts:174
Several ERC-20 balances in parallel, keyed by the token addresses as given.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Record`<`string`, `bigint`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getTokenBalances`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gettokenbalances)
***
### getTokenInfo()
[Section titled “getTokenInfo()”](#gettokeninfo)
> **getTokenInfo**(`token`): `Promise`<`TokenInfo`>
Defined in: wallet-evm/src/read-only-account.ts:193
An ERC-20’s decimals, symbol, name and total supply, read from the contract, and `upgradeable` when it sits behind an EIP-1967 / EIP-1822 / beacon / ZeppelinOS proxy. `bytes32` symbols (MKR style) are decoded. Throws NotATokenError when there is no contract at the address or it has no `decimals()` (an NFT, a wallet, a plain contract).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### token
[Section titled “token”](#token-3)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`TokenInfo`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTokenInfo`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getTokenInfo`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gettokeninfo)
***
### getTransactionByHash()
[Section titled “getTransactionByHash()”](#gettransactionbyhash)
> **getTransactionByHash**(`hash`): `Promise`<{ } | { } | { } | { } | { }>
Defined in: wallet-evm/src/read-only-account.ts:359
The transaction as the RPC returns it (viem shape).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<{ } | { } | { } | { } | { }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getTransactionByHash`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gettransactionbyhash)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`EvmReceipt`](/api/anywalletkit/wallet-evm/interfaces/evmreceipt/) | `undefined`>
Defined in: wallet-evm/src/read-only-account.ts:344
The receipt, or `undefined` while the transaction is not mined.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### hash
[Section titled “hash”](#hash-1)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`EvmReceipt`](/api/anywalletkit/wallet-evm/interfaces/evmreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`getTransactionReceipt`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#gettransactionreceipt)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-evm/src/read-only-account.ts:293
Upper-bound fee in wei: `gas × fee cap`, with the cap the transaction would be signed with — its own `gasPrice` / `maxFeePerGas` when it sets one, else the network’s (`gasPrice` on chains without EIP-1559).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### tx
[Section titled “tx”](#tx-3)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteSendTransaction`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`quoteSendTransaction`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`options`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-evm/src/read-only-account.ts:339
Network fee of a transfer, in wei.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### options
[Section titled “options”](#options-1)
[`EvmTransferOptions`](/api/anywalletkit/wallet-evm/interfaces/evmtransferoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`quoteTransfer`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#quotetransfer)
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): `object`
Defined in: wallet-evm/src/read-only-account.ts:145
The RPC client, or a `NetworkError` naming the action when the wallet is offline.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`object`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`requireClient`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#requireclient)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<`TransferResult`>
Defined in: wallet-evm/src/account.ts:402
Sign and broadcast; `options.maxFee` caps the signed fee on top of `transactionMaxFee`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### tx
[Section titled “tx”](#tx-4)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
##### options?
[Section titled “options?”](#options-2)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-evm/src/account.ts:151
EIP-191 personal_sign; returns 65-byte hex with v ∈ {27, 28} (ethers encoding).
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.sign`
***
### signPermit()
[Section titled “signPermit()”](#signpermit)
> **signPermit**(`options`): `Promise`<[`SignedPermit`](/api/anywalletkit/wallet-evm/interfaces/signedpermit/)>
Defined in: wallet-evm/src/account.ts:448
Sign an EIP-2612 permit for `spender`. Nothing is broadcast; the spender submits it.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### options
[Section titled “options”](#options-3)
[`PermitOptions`](/api/anywalletkit/wallet-evm/interfaces/permitoptions/)
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`SignedPermit`](/api/anywalletkit/wallet-evm/interfaces/signedpermit/)>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-evm/src/account.ts:284
Sign WITHOUT broadcasting. Fully-specified EIP-1559 / legacy txs sign offline; the chain and zero-address refusals still apply. Simulation is NOT run here (nothing is sent) — `sendTransaction` runs it.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### tx
[Section titled “tx”](#tx-5)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
##### options?
[Section titled “options?”](#options-4)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.signTransaction`
***
### signTypedData()
[Section titled “signTypedData()”](#signtypeddata)
> **signTypedData**(`typed`): `Promise`<`string`>
Defined in: wallet-evm/src/account.ts:193
EIP-712. Accepts `{domain, types, message}`; `primaryType` is inferred when absent.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### typed
[Section titled “typed”](#typed)
[`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`string`>
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`SimulationResult`](/api/anywalletkit/wallet-evm/type-aliases/simulationresult/)>
Defined in: wallet-evm/src/read-only-account.ts:316
Dry-run the transaction from this account (`eth_call` + gas estimate). A revert comes back as `{ok: false, reason}` with the decoded `Error(string)`, `Panic(uint256)` or custom-error selector; only transport failures throw.
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-6)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<[`SimulationResult`](/api/anywalletkit/wallet-evm/type-aliases/simulationresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`simulateTransaction`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#simulatetransaction)
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-evm/src/account.ts:513
The same address as a [WalletAccountReadOnlyEvm](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).
#### Returns
[Section titled “Returns”](#returns-28)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.toReadOnlyAccount`
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`options`, `writeOptions?`): `Promise`<`TransferResult`>
Defined in: wallet-evm/src/account.ts:406
Native or token transfer; the account builds the transaction.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### options
[Section titled “options”](#options-5)
[`EvmTransferOptions`](/api/anywalletkit/wallet-evm/interfaces/evmtransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions-1)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.transfer`
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-evm/src/read-only-account.ts:364
True when `signature` is this address’s EIP-191 signature of `message`.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-15)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`verify`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#verify)
***
### verifyTypedData()
[Section titled “verifyTypedData()”](#verifytypeddata)
> **verifyTypedData**(`typed`, `signature`): `Promise`<`boolean`>
Defined in: wallet-evm/src/read-only-account.ts:373
True when `signature` is this address’s EIP-712 signature of `typed`.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### typed
[Section titled “typed”](#typed-1)
[`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
##### signature
[Section titled “signature”](#signature-1)
`string`
#### Returns
[Section titled “Returns”](#returns-31)
`Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/).[`verifyTypedData`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/#verifytypeddata)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`): `WalletAccountEvm`
Defined in: wallet-evm/src/account.ts:127
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
##### config?
[Section titled “config?”](#config-1)
[`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-32)
`WalletAccountEvm`
# WalletAccountReadOnlyEvm
Defined in: wallet-evm/src/read-only-account.ts:125
An EVM address without a key: balances, allowances, fee quotes, simulation, receipts and signature checks. Hand it to code that should only read or quote.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlyEvm**(`address`, `config?`): `WalletAccountReadOnlyEvm`
Defined in: wallet-evm/src/read-only-account.ts:132
#### Parameters
[Section titled “Parameters”](#parameters)
##### address
[Section titled “address”](#address)
`string`
##### config?
[Section titled “config?”](#config)
[`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlyEvm`
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: { } | `undefined`
Defined in: wallet-evm/src/read-only-account.ts:129
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)
Defined in: wallet-evm/src/read-only-account.ts:128
***
### address
[Section titled “address”](#address-1)
> `readonly` **address**: `` `0x${string}` ``
Defined in: wallet-evm/src/read-only-account.ts:127
Checksummed address.
## Accessors
[Section titled “Accessors”](#accessors)
### chain
[Section titled “chain”](#chain)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **chain**(): `string`
Defined in: wallet-evm/src/read-only-account.ts:140
CAIP-2 id; “eip155:unknown” until the chain id is known (offline wallet without `chainId`).
##### Returns
[Section titled “Returns”](#returns-1)
`string`
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
## Methods
[Section titled “Methods”](#methods)
### callParams()
[Section titled “callParams()”](#callparams)
> `protected` **callParams**(`tx`): `object`
Defined in: wallet-evm/src/read-only-account.ts:243
Calldata/value/to in the shape viem’s `call` / `estimateGas` take — with an EIP-7702 transaction’s authorizations, so the dry run executes the delegate’s code, not the account’s.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### tx
[Section titled “tx”](#tx)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-2)
`object`
##### account
[Section titled “account”](#account)
> **account**: `` `0x${string}` ``
##### authorizationList?
[Section titled “authorizationList?”](#authorizationlist)
> `optional` **authorizationList?**: `undefined`
##### data?
[Section titled “data?”](#data)
> `optional` **data?**: `` `0x${string}` ``
##### to?
[Section titled “to?”](#to)
> `optional` **to?**: `` `0x${string}` ``
##### value?
[Section titled “value?”](#value)
> `optional` **value?**: `bigint`
***
### feeFields()
[Section titled “feeFields()”](#feefields)
> `protected` **feeFields**(`tx`, `chainId`): `Promise`<[`FeeFields`](/api/anywalletkit/wallet-evm/type-aliases/feefields/)>
Defined in: wallet-evm/src/read-only-account.ts:265
The fee fields a send signs: the transaction’s own where it sets them, the network’s for the rest. One function for the quote and the signature, so a cap checked on the quote holds for what is signed.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx-1)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
##### chainId
[Section titled “chainId”](#chainid)
`number`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`FeeFields`](/api/anywalletkit/wallet-evm/type-aliases/feefields/)>
***
### gasFor()
[Section titled “gasFor()”](#gasfor)
> `protected` **gasFor**(`tx`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:255
Gas limit: the tx’s own, else one estimate.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-2)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`bigint`>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-evm/src/read-only-account.ts:151
The checksummed address.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getAllowance()
[Section titled “getAllowance()”](#getallowance)
> **getAllowance**(`token`, `spender`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:181
ERC-20 `allowance(owner, spender)` in base units.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token)
`string`
##### spender
[Section titled “spender”](#spender)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`bigint`>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:162
Native balance in wei.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getChainId()
[Section titled “getChainId()”](#getchainid)
> **getChainId**(): `Promise`<`number`>
Defined in: wallet-evm/src/read-only-account.ts:156
Chain id from the config, or asked from the RPC once and cached.
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`number`>
***
### getFeeRate()
[Section titled “getFeeRate()”](#getfeerate)
> **getFeeRate**(): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:230
Current fee rate: maxFeePerGas, falling back to gasPrice.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`bigint`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-evm/src/read-only-account.ts:167
ERC-20 `balanceOf` in the token’s base units.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-evm/src/read-only-account.ts:174
Several ERC-20 balances in parallel, keyed by the token addresses as given.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`Record`<`string`, `bigint`>>
***
### getTokenInfo()
[Section titled “getTokenInfo()”](#gettokeninfo)
> **getTokenInfo**(`token`): `Promise`<`TokenInfo`>
Defined in: wallet-evm/src/read-only-account.ts:193
An ERC-20’s decimals, symbol, name and total supply, read from the contract, and `upgradeable` when it sits behind an EIP-1967 / EIP-1822 / beacon / ZeppelinOS proxy. `bytes32` symbols (MKR style) are decoded. Throws NotATokenError when there is no contract at the address or it has no `decimals()` (an NFT, a wallet, a plain contract).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`TokenInfo`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTokenInfo`
***
### getTransactionByHash()
[Section titled “getTransactionByHash()”](#gettransactionbyhash)
> **getTransactionByHash**(`hash`): `Promise`<{ } | { } | { } | { } | { }>
Defined in: wallet-evm/src/read-only-account.ts:359
The transaction as the RPC returns it (viem shape).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<{ } | { } | { } | { } | { }>
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`EvmReceipt`](/api/anywalletkit/wallet-evm/interfaces/evmreceipt/) | `undefined`>
Defined in: wallet-evm/src/read-only-account.ts:344
The receipt, or `undefined` while the transaction is not mined.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### hash
[Section titled “hash”](#hash-1)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`EvmReceipt`](/api/anywalletkit/wallet-evm/interfaces/evmreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-evm/src/read-only-account.ts:293
Upper-bound fee in wei: `gas × fee cap`, with the cap the transaction would be signed with — its own `gasPrice` / `maxFeePerGas` when it sets one, else the network’s (`gasPrice` on chains without EIP-1559).
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### tx
[Section titled “tx”](#tx-3)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`options`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-evm/src/read-only-account.ts:339
Network fee of a transfer, in wei.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### options
[Section titled “options”](#options)
[`EvmTransferOptions`](/api/anywalletkit/wallet-evm/interfaces/evmtransferoptions/)
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): `object`
Defined in: wallet-evm/src/read-only-account.ts:145
The RPC client, or a `NetworkError` naming the action when the wallet is offline.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`object`
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`SimulationResult`](/api/anywalletkit/wallet-evm/type-aliases/simulationresult/)>
Defined in: wallet-evm/src/read-only-account.ts:316
Dry-run the transaction from this account (`eth_call` + gas estimate). A revert comes back as `{ok: false, reason}` with the decoded `Error(string)`, `Panic(uint256)` or custom-error selector; only transport failures throw.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### tx
[Section titled “tx”](#tx-4)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`SimulationResult`](/api/anywalletkit/wallet-evm/type-aliases/simulationresult/)>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-evm/src/read-only-account.ts:364
True when `signature` is this address’s EIP-191 signature of `message`.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccountReadOnly.verify`
***
### verifyTypedData()
[Section titled “verifyTypedData()”](#verifytypeddata)
> **verifyTypedData**(`typed`, `signature`): `Promise`<`boolean`>
Defined in: wallet-evm/src/read-only-account.ts:373
True when `signature` is this address’s EIP-712 signature of `typed`.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### typed
[Section titled “typed”](#typed)
[`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
##### signature
[Section titled “signature”](#signature-1)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`boolean`>
# WalletManagerEvm
Defined in: wallet-evm/src/manager.ts:19
One seed → EVM accounts at m/44’/60’/0’/0/i (BIP-44; MetaMask / ethers default). The 64-byte BIP-39 seed is held for the life of the manager and zeroized on `dispose()`.
Built with a secp256k1 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at `m/44'/60'/0'/0` yields `getAccount(i)` children;
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’); other indexes/paths throw.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/), [`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerEvm**(`seedOrSigner`, `config?`): `WalletManagerEvm`
Defined in: wallet-evm/src/manager.ts:20
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerEvm`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/) | `Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
Defined in: wallet-evm/src/manager.ts:25
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
Defined in: wallet-evm/src/manager.ts:29
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-evm/src/manager.ts:61
normal = feeRate × 1.0, fast = × 1.2, slow = × 0.8.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`address`): [`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/)
Defined in: wallet-evm/src/manager.ts:56
Watch-only account for any address, sharing this manager’s provider config.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
[`WalletAccountReadOnlyEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountreadonlyevm/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-8)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-9)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-evm/classes/walletmanagerevm/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`WalletAccountEvm`](/api/anywalletkit/wallet-evm/classes/walletaccountevm/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-evm/classes/walletmanagerevm/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-11)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-evm/classes/walletmanagerevm/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# addressFromPublicKey
> **addressFromPublicKey**(`compressed`): `` `0x${string}` ``
Defined in: wallet-evm/src/account.ts:21
Uncompressed 65-byte public key → checksummed address.
## Parameters
[Section titled “Parameters”](#parameters)
### compressed
[Section titled “compressed”](#compressed)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# assertTxShape
> **assertTxShape**(`tx`): `void`
Defined in: wallet-evm/src/read-only-account.ts:30
Refuses shapes that would silently lose meaning: authorizations on a transaction that is not type 4 (they would be dropped), and a type 4 with `gasPrice` (it would become a legacy transaction without them).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
## Returns
[Section titled “Returns”](#returns)
`void`
# assertTypedDataSize
> **assertTypedDataSize**(`types`, `names?`): `void`
Defined in: wallet-evm/src/read-only-account.ts:99
A dApp’s typed data with more types or fields than any real one is refused before anything walks it (scan 2026-10-27 F24).
## Parameters
[Section titled “Parameters”](#parameters)
### types
[Section titled “types”](#types)
`Record`<`string`, `unknown`>
### names?
[Section titled “names?”](#names)
`string`\[] = `...`
## Returns
[Section titled “Returns”](#returns)
`void`
# canonicalData
> **canonicalData**(`data`): `` `0x${string}` `` | `undefined`
Defined in: wallet-evm/src/read-only-account.ts:50
Calldata as the wallet signs it: bytes, or 0x-hex of whole bytes. viem’s hexToBytes drops any two leading characters and pads an odd length, so ‘1x…’ or an odd-length string would be signed as other bytes than the ones a policy or a review screen read (scan 2026-10-27 F12).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` `` | `undefined`
# cleanTypes
> **cleanTypes**(`types`): `Record`<`string`, `object`\[]>
Defined in: wallet-evm/src/read-only-account.ts:110
Strip `EIP712Domain` (ethers rejects it; viem tolerates it — normalise).
## Parameters
[Section titled “Parameters”](#parameters)
### types
[Section titled “types”](#types)
`Record`<`string`, `object`\[]>
## Returns
[Section titled “Returns”](#returns)
`Record`<`string`, `object`\[]>
# createClient
> **createClient**(`config`): { } | `undefined`
Defined in: wallet-evm/src/client.ts:9
viem public client over the provider config (string | EIP-1193 | list → fallback).
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`EvmConfig`](/api/anywalletkit/wallet-evm/interfaces/evmconfig/)
## Returns
[Section titled “Returns”](#returns)
{ } | `undefined`
# decodeRevert
> **decodeRevert**(`e`): { `data?`: `` `0x${string}` ``; `reason`: `string`; } | `undefined`
Defined in: wallet-evm/src/read-only-account.ts:445
Walk a viem error for revert data and turn it into a human reason; undefined when it is not a revert.
## Parameters
[Section titled “Parameters”](#parameters)
### e
[Section titled “e”](#e)
`unknown`
## Returns
[Section titled “Returns”](#returns)
{ `data?`: `` `0x${string}` ``; `reason`: `string`; } | `undefined`
# describeTransaction
> **describeTransaction**(`tx`, `ctx?`): [`TxDescription`](/api/anywalletkit/wallet-evm/interfaces/txdescription/)
Defined in: wallet-evm/src/describe.ts:131
Decode a transaction for a confirmation screen: kind, recipient or spender, amounts and warnings. Offline and synchronous. Pass the account’s `chainId` to get a chain-mismatch warning.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
### ctx?
[Section titled “ctx?”](#ctx)
#### chainId?
[Section titled “chainId?”](#chainid)
`number`
## Returns
[Section titled “Returns”](#returns)
[`TxDescription`](/api/anywalletkit/wallet-evm/interfaces/txdescription/)
# describeTypedData
> **describeTypedData**(`typed`, `ctx?`): [`TypedDataDescription`](/api/anywalletkit/wallet-evm/interfaces/typeddatadescription/)
Defined in: wallet-evm/src/describe.ts:241
Decode EIP-712 typed data for a confirmation screen. Pass the account’s `chainId` and address to get chain and owner warnings.
## Parameters
[Section titled “Parameters”](#parameters)
### typed
[Section titled “typed”](#typed)
[`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
### ctx?
[Section titled “ctx?”](#ctx)
#### account?
[Section titled “account?”](#account)
`string`
#### chainId?
[Section titled “chainId?”](#chainid)
`number`
## Returns
[Section titled “Returns”](#returns)
[`TypedDataDescription`](/api/anywalletkit/wallet-evm/interfaces/typeddatadescription/)
# encodeApprove
> **encodeApprove**(`spender`, `amount`): `` `0x${string}` ``
Defined in: wallet-evm/src/erc20.ts:41
Calldata of ERC-20 `approve(spender, amount)`.
## Parameters
[Section titled “Parameters”](#parameters)
### spender
[Section titled “spender”](#spender)
`` `0x${string}` ``
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# encodeTransfer
> **encodeTransfer**(`to`, `amount`): `` `0x${string}` ``
Defined in: wallet-evm/src/erc20.ts:38
Calldata of ERC-20 `transfer(to, amount)`.
## Parameters
[Section titled “Parameters”](#parameters)
### to
[Section titled “to”](#to)
`` `0x${string}` ``
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# inferPrimaryType
> **inferPrimaryType**(`types`): `string`
Defined in: wallet-evm/src/read-only-account.ts:80
Pick the root type of an EIP-712 `types` map when `primaryType` is not given.
## Parameters
[Section titled “Parameters”](#parameters)
### types
[Section titled “types”](#types)
`Record`<`string`, `object`\[]>
## Returns
[Section titled “Returns”](#returns)
`string`
# isUnlimitedAmount
> **isUnlimitedAmount**(`amount`): `boolean`
Defined in: wallet-evm/src/describe.ts:111
Unlimited-approval heuristic: type(uint128).max or more, the SDK-wide threshold (core’s UNLIMITED_ALLOWANCE). Every “infinite approval” sentinel in use — uint256 (maxUint256), uint160 (Permit2), uint128 max, 2^255 — reaches it; 2^255 − 1 used to slip under the old top-bit check.
## Parameters
[Section titled “Parameters”](#parameters)
### amount
[Section titled “amount”](#amount)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# transferTransaction
> **transferTransaction**(`o`): [`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
Defined in: wallet-evm/src/read-only-account.ts:115
Build the transfer tx: native value, or ERC-20 `transfer` calldata.
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
[`EvmTransferOptions`](/api/anywalletkit/wallet-evm/interfaces/evmtransferoptions/)
## Returns
[Section titled “Returns”](#returns)
[`EvmTransaction`](/api/anywalletkit/wallet-evm/interfaces/evmtransaction/)
# typedDataHash
> **typedDataHash**(`typed`): `` `0x${string}` ``
Defined in: wallet-evm/src/read-only-account.ts:398
The EIP-712 digest `signTypedData` signs and `verifyTypedData` checks — one function, so the two cannot disagree (audit 2026-10-25, #1.6). viem includes `chainId` in the EIP712Domain type only when it is a number: a dApp that sends it as a hex or decimal STRING (Omniston’s 1inch orders: “0x89”) would otherwise be hashed over a domain WITHOUT chainId — a signature no verifying contract accepts.
## Parameters
[Section titled “Parameters”](#parameters)
### typed
[Section titled “typed”](#typed)
[`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
## Returns
[Section titled “Returns”](#returns)
`` `0x${string}` ``
# ApproveOptions
Defined in: wallet-evm/src/types.ts:90
An ERC-20 `approve(spender, amount)`.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-evm/src/types.ts:96
Allowance in base units; 0 revokes.
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: wallet-evm/src/types.ts:94
Address allowed to spend.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: wallet-evm/src/types.ts:92
ERC-20 contract.
# EvmConfig
Defined in: wallet-evm/src/types.ts:10
Options for an EVM wallet manager or account: endpoints, chain id, fee caps and the pre-sign safety checks.
## Properties
[Section titled “Properties”](#properties)
### allowBurn?
[Section titled “allowBurn?”](#allowburn)
> `optional` **allowBurn?**: `boolean`
Defined in: wallet-evm/src/types.ts:41
Allow value transfers to the zero address (refused by default — UnsafeTransactionError).
***
### allowCrossChainTypedData?
[Section titled “allowCrossChainTypedData?”](#allowcrosschaintypeddata)
> `optional` **allowCrossChainTypedData?**: `boolean`
Defined in: wallet-evm/src/types.ts:43
Allow signing typed data whose domain names another chain (refused by default — ChainMismatchError).
***
### autoResetAllowance?
[Section titled “autoResetAllowance?”](#autoresetallowance)
> `optional` **autoResetAllowance?**: `boolean`
Defined in: wallet-evm/src/types.ts:29
Ethereum-mainnet USDT reverts a non-zero → non-zero `approve`. By default the account throws and asks the caller to approve(0) first; with this flag the account sends the reset itself and waits for it before the real approval.
***
### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
Defined in: wallet-evm/src/types.ts:16
Skip chain-id detection. Required for offline signing when the tx omits `chainId`.
***
### gasHeadroom?
[Section titled “gasHeadroom?”](#gasheadroom)
> `optional` **gasHeadroom?**: `number`
Defined in: wallet-evm/src/types.ts:39
Multiplier applied to an ESTIMATED gas limit (simulation / estimateGas) when the caller passes none. Default 1.2; 1 = no headroom.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`EvmProvider`](/api/anywalletkit/wallet-evm/type-aliases/evmprovider/) | [`EvmProvider`](/api/anywalletkit/wallet-evm/type-aliases/evmprovider/)\[]
Defined in: wallet-evm/src/types.ts:12
RPC url(s) or EIP-1193 provider(s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-evm/src/types.ts:14
Extra attempts after the first failure across the provider list (default 3).
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-evm/src/types.ts:34
`eth_call` every transaction before signing it and refuse on revert (SimulationError). Default true whenever a provider is configured.
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:23
Max fee (wei) for `sendTransaction` / `signTransaction`, checked the same way on the caller’s own fee fields too.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:21
Max fee (wei) for `transfer`: the signed transaction’s gas limit × fee cap (`gasPrice` or `maxFeePerGas`) above it throws before anything is signed.
# EvmReceipt
Defined in: wallet-evm/src/types.ts:112
A mined transaction’s receipt, in the shape protocol modules read.
## Properties
[Section titled “Properties”](#properties)
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `bigint`
Defined in: wallet-evm/src/types.ts:118
Block it was mined in.
***
### contractAddress
[Section titled “contractAddress”](#contractaddress)
> **contractAddress**: `string` | `null`
Defined in: wallet-evm/src/types.ts:128
Address of a deployed contract.
***
### effectiveGasPrice
[Section titled “effectiveGasPrice”](#effectivegasprice)
> **effectiveGasPrice**: `bigint`
Defined in: wallet-evm/src/types.ts:122
Price per gas actually paid, in wei.
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: wallet-evm/src/types.ts:124
Sender.
***
### gasUsed
[Section titled “gasUsed”](#gasused)
> **gasUsed**: `bigint`
Defined in: wallet-evm/src/types.ts:120
Gas the transaction used.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-evm/src/types.ts:114
Transaction hash.
***
### logs
[Section titled “logs”](#logs)
> **logs**: `unknown`\[]
Defined in: wallet-evm/src/types.ts:130
Event logs, as viem returns them.
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: wallet-evm/src/types.ts:116
1 success, 0 reverted — the convention protocol modules test.
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: wallet-evm/src/types.ts:126
Recipient or called contract; `null` for a deploy.
# EvmTransaction
Defined in: wallet-evm/src/types.ts:50
A transaction in ethers shape (`gasLimit`, numeric `type`). Anything missing is filled from the network when a provider is configured.
## Properties
[Section titled “Properties”](#properties)
### accessList?
[Section titled “accessList?”](#accesslist)
> `optional` **accessList?**: `object`\[]
Defined in: wallet-evm/src/types.ts:72
EIP-2930 access list.
#### address
[Section titled “address”](#address)
> **address**: `` `0x${string}` ``
#### storageKeys
[Section titled “storageKeys”](#storagekeys)
> **storageKeys**: `` `0x${string}` ``\[]
***
### authorizationList?
[Section titled “authorizationList?”](#authorizationlist)
> `optional` **authorizationList?**: `object`\[]
Defined in: wallet-evm/src/types.ts:74
EIP-7702 signed authorizations (type 4).
#### address
[Section titled “address”](#address-1)
> **address**: `` `0x${string}` ``
#### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number`
#### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `number`
#### r
[Section titled “r”](#r)
> **r**: `` `0x${string}` ``
#### s
[Section titled “s”](#s)
> **s**: `` `0x${string}` ``
#### yParity
[Section titled “yParity”](#yparity)
> **yParity**: `number`
***
### chainId?
[Section titled “chainId?”](#chainid-1)
> `optional` **chainId?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:70
Must match the account’s chain; a mismatch throws `ChainMismatchError`.
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: wallet-evm/src/types.ts:56
Calldata, `0x`-prefixed.
***
### from?
[Section titled “from?”](#from)
> `optional` **from?**: `string`
Defined in: wallet-evm/src/types.ts:76
Ignored: always the account itself (kept so ethers-shaped objects pass through).
***
### gasLimit?
[Section titled “gasLimit?”](#gaslimit)
> `optional` **gasLimit?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:58
Gas limit; estimated with `gasHeadroom` when omitted.
***
### gasPrice?
[Section titled “gasPrice?”](#gasprice)
> `optional` **gasPrice?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:60
Legacy (type 0) gas price in wei.
***
### maxFeePerGas?
[Section titled “maxFeePerGas?”](#maxfeepergas)
> `optional` **maxFeePerGas?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:62
EIP-1559 fee cap in wei.
***
### maxPriorityFeePerGas?
[Section titled “maxPriorityFeePerGas?”](#maxpriorityfeepergas)
> `optional` **maxPriorityFeePerGas?**: `number` | `bigint`
Defined in: wallet-evm/src/types.ts:64
EIP-1559 tip in wei.
***
### nonce?
[Section titled “nonce?”](#nonce-1)
> `optional` **nonce?**: `number`
Defined in: wallet-evm/src/types.ts:68
Filled from the network (pending) when omitted.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: wallet-evm/src/types.ts:52
Recipient or called contract; omit to deploy a contract.
***
### type?
[Section titled “type?”](#type)
> `optional` **type?**: `number`
Defined in: wallet-evm/src/types.ts:66
0 legacy, 2 EIP-1559 (default when fee fields are 1559), 4 EIP-7702.
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string` | `number` | `bigint`
Defined in: wallet-evm/src/types.ts:54
Native value in wei.
# EvmTransferOptions
Defined in: wallet-evm/src/types.ts:80
A native ETH or ERC-20 transfer. Amount in base units.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-evm/src/types.ts:86
Amount in wei or the token’s base units.
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-evm/src/types.ts:84
Address that receives.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-evm/src/types.ts:82
ERC-20 contract. Omit for native ETH.
# PermitOptions
Defined in: wallet-evm/src/types.ts:139
An EIP-2612 permit to sign: `value` of `token` for `spender` until `deadline`.
## Properties
[Section titled “Properties”](#properties)
### deadline
[Section titled “deadline”](#deadline)
> **deadline**: `string` | `number` | `bigint`
Defined in: wallet-evm/src/types.ts:147
Unix seconds.
***
### spender
[Section titled “spender”](#spender)
> **spender**: `string`
Defined in: wallet-evm/src/types.ts:143
Address allowed to spend.
***
### token
[Section titled “token”](#token)
> **token**: `string`
Defined in: wallet-evm/src/types.ts:141
ERC-20 contract with `permit`.
***
### value
[Section titled “value”](#value)
> **value**: `string` | `number` | `bigint`
Defined in: wallet-evm/src/types.ts:145
Allowance in base units.
# SignedPermit
Defined in: wallet-evm/src/types.ts:156
A signed EIP-2612 permit, in every form a contract call may need.
## Properties
[Section titled “Properties”](#properties)
### deadline
[Section titled “deadline”](#deadline)
> **deadline**: `bigint`
Defined in: wallet-evm/src/types.ts:168
Deadline that was signed, unix seconds.
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `bigint`
Defined in: wallet-evm/src/types.ts:166
Permit nonce that was signed.
***
### r
[Section titled “r”](#r)
> **r**: `` `0x${string}` ``
Defined in: wallet-evm/src/types.ts:162
Signature `r`.
***
### s
[Section titled “s”](#s)
> **s**: `` `0x${string}` ``
Defined in: wallet-evm/src/types.ts:164
Signature `s`.
***
### signature
[Section titled “signature”](#signature)
> **signature**: `` `0x${string}` ``
Defined in: wallet-evm/src/types.ts:158
65-byte signature, `0x`-hex.
***
### typedData
[Section titled “typedData”](#typeddata)
> **typedData**: [`TypedDataInput`](/api/anywalletkit/wallet-evm/interfaces/typeddatainput/)
Defined in: wallet-evm/src/types.ts:170
The typed data that was signed.
***
### v
[Section titled “v”](#v)
> **v**: `number`
Defined in: wallet-evm/src/types.ts:160
Signature `v`.
# TxDescription
Defined in: wallet-evm/src/describe.ts:49
An EVM transaction decoded for a confirmation screen, without any network call. For simulated balance changes use `tx-preview-evm`.
## Properties
[Section titled “Properties”](#properties)
### amount?
[Section titled “amount?”](#amount)
> `optional` **amount?**: `bigint`
Defined in: wallet-evm/src/describe.ts:63
Token amount for erc20-transfer / transferFrom / approve.
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: [`TxKind`](/api/anywalletkit/wallet-evm/type-aliases/txkind/)
Defined in: wallet-evm/src/describe.ts:74
For an EIP-7702 tx (kind ‘eip7702-delegation’): what its call does, decoded like any other transaction — the token / spender / amount fields and the warnings are the call’s.
***
### chainId
[Section titled “chainId”](#chainid)
> **chainId**: `number` | `undefined`
Defined in: wallet-evm/src/describe.ts:76
Chain id named by the transaction, if any.
***
### delegations?
[Section titled “delegations?”](#delegations)
> `optional` **delegations?**: `object`\[]
Defined in: wallet-evm/src/describe.ts:69
Delegation targets for an EIP-7702 tx.
#### address
[Section titled “address”](#address)
> **address**: `string`
#### chainId
[Section titled “chainId”](#chainid-1)
> **chainId**: `number`
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`TxKind`](/api/anywalletkit/wallet-evm/type-aliases/txkind/)
Defined in: wallet-evm/src/describe.ts:51
What it does.
***
### owner?
[Section titled “owner?”](#owner)
> `optional` **owner?**: `string`
Defined in: wallet-evm/src/describe.ts:67
Source account for erc20-transferFrom.
***
### recipient?
[Section titled “recipient?”](#recipient)
> `optional` **recipient?**: `string`
Defined in: wallet-evm/src/describe.ts:61
Token recipient for the erc20 transfer kinds.
***
### selector
[Section titled “selector”](#selector)
> **selector**: `` `0x${string}` `` | `undefined`
Defined in: wallet-evm/src/describe.ts:57
4-byte selector of the calldata, when there is calldata.
***
### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
Defined in: wallet-evm/src/describe.ts:65
Spender for erc20-approve.
***
### to
[Section titled “to”](#to)
> **to**: `string` | `undefined`
Defined in: wallet-evm/src/describe.ts:53
Checksummed `to`, or undefined for a deploy.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-evm/src/describe.ts:59
ERC-20 contract for the erc20-\* kinds.
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-evm/src/describe.ts:55
Native value in wei.
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`TxWarning`](/api/anywalletkit/wallet-evm/type-aliases/txwarning/)\[]
Defined in: wallet-evm/src/describe.ts:78
Problems to show before signing.
# TypedDataDescription
Defined in: wallet-evm/src/describe.ts:88
EIP-712 typed data decoded for a confirmation screen.
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `object`
Defined in: wallet-evm/src/describe.ts:94
The domain fields a user should see.
#### chainId?
[Section titled “chainId?”](#chainid)
> `optional` **chainId?**: `number`
#### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
#### verifyingContract?
[Section titled “verifyingContract?”](#verifyingcontract)
> `optional` **verifyingContract?**: `string`
#### version?
[Section titled “version?”](#version)
> `optional` **version?**: `string`
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`TypedDataKind`](/api/anywalletkit/wallet-evm/type-aliases/typeddatakind/)
Defined in: wallet-evm/src/describe.ts:90
What it is.
***
### permit?
[Section titled “permit?”](#permit)
> `optional` **permit?**: `object`
Defined in: wallet-evm/src/describe.ts:101
EIP-2612 permit fields (kind ‘permit’).
#### deadline
[Section titled “deadline”](#deadline)
> **deadline**: `bigint`
#### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `bigint`
#### owner
[Section titled “owner”](#owner)
> **owner**: `string`
#### spender
[Section titled “spender”](#spender)
> **spender**: `string`
#### value
[Section titled “value”](#value)
> **value**: `bigint`
***
### primaryType
[Section titled “primaryType”](#primarytype)
> **primaryType**: `string`
Defined in: wallet-evm/src/describe.ts:92
The primary type, given or inferred.
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`TypedDataWarning`](/api/anywalletkit/wallet-evm/type-aliases/typeddatawarning/)\[]
Defined in: wallet-evm/src/describe.ts:103
Problems to show before signing.
# TypedDataInput
Defined in: wallet-evm/src/types.ts:100
EIP-712 typed data, as `eth_signTypedData_v4` takes it.
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `Record`<`string`, `unknown`>
Defined in: wallet-evm/src/types.ts:102
EIP-712 domain (name, version, chainId, verifyingContract).
***
### message
[Section titled “message”](#message)
> **message**: `Record`<`string`, `unknown`>
Defined in: wallet-evm/src/types.ts:106
The values to sign.
***
### primaryType?
[Section titled “primaryType?”](#primarytype)
> `optional` **primaryType?**: `string`
Defined in: wallet-evm/src/types.ts:108
Inferred when omitted: the one type nothing else references.
***
### types
[Section titled “types”](#types)
> **types**: `Record`<`string`, `object`\[]>
Defined in: wallet-evm/src/types.ts:104
Type definitions; `EIP712Domain` may be included or left out.
# Warning
Defined in: wallet-evm/src/describe.ts:34
One flagged problem, with a sentence a wallet can show.
## Type Parameters
[Section titled “Type Parameters”](#type-parameters)
### Code
[Section titled “Code”](#code)
`Code` *extends* `string`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> **code**: `Code`
Defined in: wallet-evm/src/describe.ts:36
Machine-readable code.
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-evm/src/describe.ts:38
Sentence to show the user.
# EvmProvider
> **EvmProvider** = `string` | `EIP1193Provider`
Defined in: wallet-evm/src/types.ts:4
One RPC endpoint or an EIP-1193 provider.
# FeeFields
> **FeeFields** = { `gasPrice`: `bigint`; } | { `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; }
Defined in: wallet-evm/src/read-only-account.ts:23
Fee fields a transaction is signed with: a legacy `gasPrice`, or the EIP-1559 cap and tip.
# PermitInfo
> **PermitInfo** = { `reason`: `string`; `supported`: `false`; } | { `chainId`: `number`; `domainSeparator`: `Hex`; `name`: `string`; `nonce`: `bigint`; `supported`: `true`; `version`: `string`; }
Defined in: wallet-evm/src/types.ts:151
Whether a token supports EIP-2612, and its domain and the owner’s nonce when it does.
# SimulationResult
> **SimulationResult** = { `gas`: `bigint`; `ok`: `true`; `returnData`: `Hex`; } | { `data?`: `Hex`; `ok`: `false`; `reason`: `string`; }
Defined in: wallet-evm/src/types.ts:134
Outcome of `simulateTransaction`: the gas used and return data, or the decoded revert reason.
# TxKind
> **TxKind** = `"native-transfer"` | `"erc20-transfer"` | `"erc20-transferFrom"` | `"erc20-approve"` | `"contract-call"` | `"contract-deploy"` | `"eip7702-delegation"`
Defined in: wallet-evm/src/describe.ts:13
What an EVM transaction does, read from its fields and calldata.
# TxWarning
> **TxWarning** = [`Warning`](/api/anywalletkit/wallet-evm/interfaces/warning/)<[`TxWarningCode`](/api/anywalletkit/wallet-evm/type-aliases/txwarningcode/)>
Defined in: wallet-evm/src/describe.ts:41
A warning about a transaction.
# TxWarningCode
> **TxWarningCode** = `"approve-unlimited"` | `"to-zero-address"` | `"chain-mismatch"` | `"legacy-fee-fields"`
Defined in: wallet-evm/src/describe.ts:26
Problems [describeTransaction](/api/anywalletkit/wallet-evm/functions/describetransaction/) flags: an unlimited approval, value or calldata to the zero address, a chain id that is not the account’s, or legacy fee fields.
# TypedDataKind
> **TypedDataKind** = `"permit"` | `"permit2"` | `"safe-tx"` | `"generic"`
Defined in: wallet-evm/src/describe.ts:85
What typed data is: an EIP-2612 permit, a Uniswap Permit2 message, a Safe transaction, or anything else.
# TypedDataWarning
> **TypedDataWarning** = [`Warning`](/api/anywalletkit/wallet-evm/interfaces/warning/)<[`TypedDataWarningCode`](/api/anywalletkit/wallet-evm/type-aliases/typeddatawarningcode/)>
Defined in: wallet-evm/src/describe.ts:43
A warning about typed data.
# TypedDataWarningCode
> **TypedDataWarningCode** = `"chain-mismatch"` | `"deadline-passed"` | `"approve-unlimited"` | `"owner-mismatch"`
Defined in: wallet-evm/src/describe.ts:31
Problems [describeTypedData](/api/anywalletkit/wallet-evm/functions/describetypeddata/) flags: another chain in the domain, an expired deadline, an unlimited permit, or a permit owner that is not the account.
# ERC20_ABI
> `const` **ERC20_ABI**: readonly \[{ }, { }, { }, { }, { }]
Defined in: wallet-evm/src/erc20.ts:4
The ERC-20 functions the package calls (viem ABI).
# ERC20_PERMIT_ABI
> `const` **ERC20_PERMIT_ABI**: readonly \[{ }, { }, { }, { }]
Defined in: wallet-evm/src/erc20.ts:13
EIP-2612 surface (+ the `version()` some tokens expose; the fallback is ‘1’).
# EVM_BASE_PATH
> `const` **EVM_BASE_PATH**: `"m/44'/60'/0'/0"` = `"m/44'/60'/0'/0"`
Defined in: wallet-evm/src/manager.ts:7
Base derivation path of EVM accounts; account `i` is at `m/44'/60'/0'/0/i`.
# MAX_TYPED_DATA_FIELDS
> `const` **MAX_TYPED_DATA_FIELDS**: `4096` = `4096`
Defined in: wallet-evm/src/read-only-account.ts:96
# MAX_TYPED_DATA_TYPES
> `const` **MAX_TYPED_DATA_TYPES**: `256` = `256`
Defined in: wallet-evm/src/read-only-account.ts:95
Far above any real EIP-712 payload (Seaport: a dozen types, under a hundred fields).
# PERMIT_TYPES
> `const` **PERMIT_TYPES**: `object`
Defined in: wallet-evm/src/erc20.ts:21
EIP-712 types of an EIP-2612 `Permit`.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### Permit
[Section titled “Permit”](#permit)
> `readonly` **Permit**: readonly \[{ `name`: `"owner"`; `type`: `"address"`; }, { `name`: `"spender"`; `type`: `"address"`; }, { `name`: `"value"`; `type`: `"uint256"`; }, { `name`: `"nonce"`; `type`: `"uint256"`; }, { `name`: `"deadline"`; `type`: `"uint256"`; }]
# USDT_MAINNET
> `const` **USDT_MAINNET**: `"0xdac17f958d2ee523a2206206994597c13d831ec7"` = `'0xdac17f958d2ee523a2206206994597c13d831ec7'`
Defined in: wallet-evm/src/erc20.ts:35
Ethereum-mainnet USDT, which reverts a non-zero to non-zero `approve` (see `EvmConfig.autoResetAllowance`).
# @anywalletkit/wallet-near
# @anywalletkit/wallet-near
[Section titled “@anywalletkit/wallet-near”](#anywalletkitwallet-near)
[](https://www.npmjs.com/package/@anywalletkit/wallet-near)
NEAR accounts at `m/44'/397'/i'` (SLIP-10 ed25519 — the NEAR Wallet / `near-seed-phrase` path; index 0 is what every NEAR wallet derives), pinned by golden vectors in `@anywalletkit/conformance`. No near-api-js: borsh is hand-written against the nearcore schema (byte-for-byte checked against `@near-js/transactions`), the node answers JSON-RPC, the account signs `sha256(borsh(tx))` with noble ed25519 and broadcasts with `send_tx`.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-near
# or: pnpm add @anywalletkit/wallet-near · yarn add @anywalletkit/wallet-near
```
On npm: [@anywalletkit/wallet-near](https://www.npmjs.com/package/@anywalletkit/wallet-near), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import WalletManagerNear from '@anywalletkit/wallet-near'
const wallet = new WalletManagerNear(seedPhrase, { provider: ['https://free.rpc.fastnear.com', 'https://rpc.mainnet.near.org'] })
const account = await wallet.getAccount(0) // implicit account: 64-hex id = the public key
await account.transfer({ recipient: 'alice.near', amount: 10n ** 24n }) // 1 NEAR (yocto)
await account.transfer({ token: 'usdt.tether-token.near', recipient: 'alice.near', amount: 1_000_000n, memo: 'rent' }) // NEP-141
await account.sendTransaction({ receiverId: 'wrap.near', actions: [{ functionCall: { methodName: 'near_deposit', args: {}, gas: 30n * 10n ** 12n, deposit: 10n ** 24n } }] })
const sig = await account.sign('hello') // "ed25519:" over the raw bytes; 32 bytes are refused (MessageIsTransactionError: a tx hash)
const nep413 = await account.signNep413({ message, nonce, recipient: 'intents.near' }) // what NEAR Intents / dApps ask for
const named = await wallet.getNamedAccount('alice.near') // same key, bound to a named account
wallet.dispose()
```
## What happens before a signature
[Section titled “What happens before a signature”](#what-happens-before-a-signature)
Every `signTransaction` / `sendTransaction` / `transfer` goes through the same gate:
1. **Build**: `signerId` / `publicKey` are the account’s; `nonce` = access-key nonce + 1 and `blockHash` = the latest final block come from the node (so `needsNetwork` is true).
2. **Hard checks** (`UnsafeTransactionError`, with a `code`): the signer and key are this account; at least one action; no *dangerous* action — AddKey, DeleteKey, DeleteAccount, DeployContract, Stake, CreateAccount, global-contract actions, SignedDelegate — unless `allowDangerousActions: true`; a valid receiver id; prepaid gas ≤ 300 Tgas; fee ≤ `transactionMaxFee` when set.
3. **Preflight** (`SimulationError`, off with `simulate: false`) — NEAR has no dry-run RPC, so this is what makes a transaction fail *before* a fee is paid: the signer account and its access key exist and allow the call, the spendable balance (total − locked − storage) covers deposits + fee, a named recipient exists (an implicit one may be created, for ≥ 0.002 NEAR), the NEP-141 balance covers an `ft_transfer`, the recipient is registered on the token or a `storage_deposit` rides along.
4. **Fee estimate** (upper bound: prepaid gas counts in full; unused gas is refunded; a native transfer that creates an implicit account adds the protocol’s \~0.007 NEAR creation charge — measured on mainnet, not derivable from gas) and the `transferMaxFee` / `transactionMaxFee` cap.
Measured on mainnet (2026-10-10): `ft_transfer` 11.6 Tgas / 0.00041 NEAR; native transfer creating the recipient 15.9 Tgas / 0.0071 NEAR.
`describeTransaction(tx)` tells you what a transaction does, offline: `near-transfer`, `ft-transfer` (recipient / amount / memo decoded from the args), `ft-storage-deposit`, `function-call`, `batch`, or the dangerous kinds — with warnings (`dangerous-action`, `full-access-key`, `zero-amount`, `self-transfer`, `high-gas`, `unknown-method`, `invalid-account`). `account.describeTransactionOnline(tx)` adds `implicit-new-account`.
## NEP-141 tokens
[Section titled “NEP-141 tokens”](#nep-141-tokens)
`transfer({ token, recipient, amount, memo })` sends `ft_transfer` with 1 yoctoNEAR and 30 Tgas. When the recipient is not registered on the token (`storage_balance_of` is null) a `storage_deposit` for `storage_balance_bounds.min` (0.00125 NEAR on most tokens) is prepended in the same transaction. `getTokenBalance(token)` is `ft_balance_of`.
## Accounts
[Section titled “Accounts”](#accounts)
An implicit account exists from the first NEAR it receives; an account holding only tokens and no NEAR cannot sign (nothing pays gas) — `simulateTransaction` reports that. A named account (`alice.near`) that lists this key as a full-access key works through `getNamedAccount`. `getBalance()` is the total; `getAvailableBalance()` is what can be spent.
## Network
[Section titled “Network”](#network)
`provider` is one or more JSON-RPC urls (or custom transports); a list fails over in order, except for definitive node answers (unknown account, invalid transaction) which are returned as they are. Every url request times out after `timeoutMs` (default 15 000), so a node that never answers fails over. `send_tx` is never re-sent to another RPC: without a definitive answer (no response, a node timeout) it throws `BroadcastUnknownError` with the locally computed `hash` — watch it, do not sign again. `rpc.mainnet.near.org` is rate-limited and deprecated for production — use FastNear / a provider / your own proxy. CAIP-2: `near:mainnet` (default) or `near:testnet`.
## Activity history
[Section titled “Activity history”](#activity-history)
`createNearHistory` is the chain’s `HistorySource` (`@anywalletkit/core`) over the nearblocks API, optionally sharpened by an archival RPC.
```ts
import { createNearHistory } from '@anywalletkit/wallet-near/history'
const history = createNearHistory({ apiKey: process.env.NEARBLOCKS_KEY, rpcUrl: 'https://archival-rpc.mainnet.near.org' })
const page = await history.listActivity('fc647e203e0e099212485017b78a0e77dc330019d4b532a4d44408adc0bfd9a1', { limit: 25 })
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://nearblocks.io/txns/…
```
| option | default | notes |
| -------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nearblocksUrl` | `https://api.nearblocks.io` (`api-testnet.nearblocks.io`) | |
| `apiKey` | none | Bearer key. Keyless nearblocks is limited to a few requests per minute. |
| `rpcUrl` | none | `EXPERIMENTAL_tx_status` for `getTransaction`. Must be **archival** for anything older than a few days: `rpc.mainnet.near.org` answered `UNKNOWN_TRANSACTION` for a two-week-old hash, `archival-rpc.mainnet.near.org` served it. |
| `network` | `mainnet` | `near:mainnet` / `near:testnet`. |
| `rateLimit` | 0.1 rps (6/min) keyless, 5 with a key | nearblocks requests per second; a page needs two. |
| `fetch`, `timeoutMs` | global, 15 000 | |
**Lists.** `GET /v1/account/{id}/txns?per_page=&order=desc&cursor=` (receipt-level rows, asked for twice the limit since a transaction usually has a call and a refund receipt) and `GET /v1/account/{id}/ft-txns?per_page=&order=desc&cursor=` (NEP-141 movements), grouped by `transaction_hash`. nearblocks writes large yoctoNEAR values as JSON numbers; bodies go through `parseJsonPreservingBigInts`, which re-quotes 16+ digit integer literals before `JSON.parse` so they stay exact, while values nearblocks had already rounded to a double (`7e+23`) are used as-is and flag the row `raw.approximate`. `delta_amount` of NEP-141 rows is a string and always exact.
**Mapping.** Receipt rows whose predecessor is `system` (gas refunds) carry no transfers. `TRANSFER` actions and `FUNCTION_CALL` deposits (other than the NEP-141 one-yoctoNEAR formality) become native transfers predecessor → receiver; the first non-transfer action of the receipt addressed to someone else becomes `call` (`to` = receiver, `method`, `programs` = every method in order). NEP-141 rows become `nep141` transfers with the contract as `token`, `symbol` / `decimals` from `ft` (an `ft_transfer_call` into `intents.near` is own → `intents.near`, what `@anywalletkit/protocol-swap2-near-intents` looks for). `status` from `outcomes.status`, `fee` from `outcomes_agg.transaction_fee`, `block` = the lowest `block_height` of the group, `time` from the transaction’s `block_timestamp`.
**Cursor.** Base64 JSON `{ v: 1, tx, ft }`: the `id` / `event_index` of the last consumed row of each list (`''` = not started, `null` = exhausted) — nearblocks’ `cursor=` is a keyset, so the page can take the top `limit` transactions by block time plus ties and resume each list exactly where it stopped; a list that came back short and fully consumed is not asked again. Receipts of one transaction share the transaction’s `block_timestamp`, so a transaction is never split across pages (an NEP-141 row carries its receipt’s block time and may land one page later as a row of its own).
**Single transaction.** `GET /v1/txns/{hash}` (transaction-level actions, signer / receiver, `receipts[].fts` with **double** deltas → `raw.approximate`). With `rpcUrl`, `EXPERIMENTAL_tx_status(hash, signer)` rebuilds the row exactly: native legs from `Transfer` / `FunctionCall` deposits (delegate actions unwrapped, so `call.to` is the real receiver), NEP-141 legs from receipt logs (`EVENT_JSON` nep141 `ft_transfer` / `ft_mint` / `ft_burn` and the legacy `Transfer N from A to B` line `wrap.near` emits), `fee` = Σ `tokens_burnt`, `status` from `Failure`; `raw.rpc` holds the result. An RPC that does not know the hash or is down leaves the nearblocks row in place.
Fixtures in `test/fixtures/history/` were captured on 2026-10-14 from `api.nearblocks.io` (keyless) and `archival-rpc.mainnet.near.org`: the test wallet’s `/txns` page (a NEAR send with its refund receipt, a `storage_deposit` + `ft_transfer` call, a receive from `intents.near`) and its empty `/ft-txns`, plus — because the test wallet has no NEP-141 rows — the `/txns`, `/ft-txns`, `/v1/txns/{hash}` and RPC `EXPERIMENTAL_tx_status` of the NEAR Intents module’s fixture transaction `Fdk3i7f9…` (20.5 wNEAR `ft_transfer_call` into `intents.near` by `b1633df6…`). `test/history.test.ts` checks that the near-intents module describes both the list row and the RPC-refined row as `Bridged wNEAR`.
## Classes
[Section titled “Classes”](#classes)
* [BroadcastUnknownError](/api/anywalletkit/wallet-near/classes/broadcastunknownerror/)
* [HistoryUnavailableError](/api/anywalletkit/wallet-near/classes/historyunavailableerror/)
* [MessageIsTransactionError](/api/anywalletkit/wallet-near/classes/messageistransactionerror/)
* [NearRpc](/api/anywalletkit/wallet-near/classes/nearrpc/)
* [NearRpcError](/api/anywalletkit/wallet-near/classes/nearrpcerror/)
* [SimulationError](/api/anywalletkit/wallet-near/classes/simulationerror/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-near/classes/unsafetransactionerror/)
* [WalletAccountNear](/api/anywalletkit/wallet-near/classes/walletaccountnear/)
* [WalletAccountReadOnlyNear](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/)
* [WalletManagerNear](/api/anywalletkit/wallet-near/classes/walletmanagernear/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [DescribeContext](/api/anywalletkit/wallet-near/interfaces/describecontext/)
* [NearAccessKey](/api/anywalletkit/wallet-near/interfaces/nearaccesskey/)
* [NearAccountView](/api/anywalletkit/wallet-near/interfaces/nearaccountview/)
* [NearAddKeyAction](/api/anywalletkit/wallet-near/interfaces/nearaddkeyaction/)
* [NearblocksAction](/api/anywalletkit/wallet-near/interfaces/nearblocksaction/)
* [NearblocksFtRow](/api/anywalletkit/wallet-near/interfaces/nearblocksftrow/)
* [NearblocksReceiptRow](/api/anywalletkit/wallet-near/interfaces/nearblocksreceiptrow/)
* [NearblocksTxn](/api/anywalletkit/wallet-near/interfaces/nearblockstxn/)
* [NearBuiltTransaction](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
* [NearChainTx](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
* [NearConfig](/api/anywalletkit/wallet-near/interfaces/nearconfig/)
* [NearCreateAccountAction](/api/anywalletkit/wallet-near/interfaces/nearcreateaccountaction/)
* [NearDelegateAction](/api/anywalletkit/wallet-near/interfaces/neardelegateaction/)
* [NearDeleteAccountAction](/api/anywalletkit/wallet-near/interfaces/neardeleteaccountaction/)
* [NearDeleteKeyAction](/api/anywalletkit/wallet-near/interfaces/neardeletekeyaction/)
* [NearDeployContractAction](/api/anywalletkit/wallet-near/interfaces/neardeploycontractaction/)
* [NearDeployGlobalContractAction](/api/anywalletkit/wallet-near/interfaces/neardeployglobalcontractaction/)
* [NearFeeEstimate](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)
* [NearFunctionCallAction](/api/anywalletkit/wallet-near/interfaces/nearfunctioncallaction/)
* [NearHistoryCursor](/api/anywalletkit/wallet-near/interfaces/nearhistorycursor/)
* [NearHistoryOptions](/api/anywalletkit/wallet-near/interfaces/nearhistoryoptions/)
* [NearHistoryPage](/api/anywalletkit/wallet-near/interfaces/nearhistorypage/)
* [NearHistoryRaw](/api/anywalletkit/wallet-near/interfaces/nearhistoryraw/)
* [NearHistorySource](/api/anywalletkit/wallet-near/interfaces/nearhistorysource/)
* [NearPublicKey](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
* [NearQuote](/api/anywalletkit/wallet-near/interfaces/nearquote/)
* [NearReceipt](/api/anywalletkit/wallet-near/interfaces/nearreceipt/)
* [NearSignature](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
* [NearSignedDelegateAction](/api/anywalletkit/wallet-near/interfaces/nearsigneddelegateaction/)
* [NearSignedTransaction](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)
* [NearSimulation](/api/anywalletkit/wallet-near/interfaces/nearsimulation/)
* [NearStakeAction](/api/anywalletkit/wallet-near/interfaces/nearstakeaction/)
* [NearTransaction](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
* [NearTransferAction](/api/anywalletkit/wallet-near/interfaces/neartransferaction/)
* [NearTransferOptions](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
* [NearTransferResult](/api/anywalletkit/wallet-near/interfaces/neartransferresult/)
* [NearTxDescription](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)
* [NearTxWarning](/api/anywalletkit/wallet-near/interfaces/neartxwarning/)
* [NearUseGlobalContractAction](/api/anywalletkit/wallet-near/interfaces/nearuseglobalcontractaction/)
* [Nep413Payload](/api/anywalletkit/wallet-near/interfaces/nep413payload/)
* [Nep413Signed](/api/anywalletkit/wallet-near/interfaces/nep413signed/)
* [RawAccessKeyView](/api/anywalletkit/wallet-near/interfaces/rawaccesskeyview/)
* [RawAccountView](/api/anywalletkit/wallet-near/interfaces/rawaccountview/)
* [RawFinalOutcome](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/)
* [RpcAction](/api/anywalletkit/wallet-near/interfaces/rpcaction/)
* [RpcTxStatus](/api/anywalletkit/wallet-near/interfaces/rpctxstatus/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [HistoryFetch](/api/anywalletkit/wallet-near/type-aliases/historyfetch/)
* [NearAction](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
* [NearFetch](/api/anywalletkit/wallet-near/type-aliases/nearfetch/)
* [NearProvider](/api/anywalletkit/wallet-near/type-aliases/nearprovider/)
* [NearTxKind](/api/anywalletkit/wallet-near/type-aliases/neartxkind/)
* [NearTxWarningCode](/api/anywalletkit/wallet-near/type-aliases/neartxwarningcode/)
* [UnsafeTransactionCode](/api/anywalletkit/wallet-near/type-aliases/unsafetransactioncode/)
## Variables
[Section titled “Variables”](#variables)
* [ACTION_TAG](/api/anywalletkit/wallet-near/variables/action_tag/)
* [CAIP2](/api/anywalletkit/wallet-near/variables/caip2/)
* [DANGEROUS_ACTIONS](/api/anywalletkit/wallet-near/variables/dangerous_actions/)
* [FT_TRANSFER_GAS](/api/anywalletkit/wallet-near/variables/ft_transfer_gas/)
* [IMPLICIT_ACCOUNT_MIN_DEPOSIT](/api/anywalletkit/wallet-near/variables/implicit_account_min_deposit/)
* [MAX_GAS](/api/anywalletkit/wallet-near/variables/max_gas/)
* [NEAR_BASE_PATH](/api/anywalletkit/wallet-near/variables/near_base_path/)
* [NEP413_PREFIX](/api/anywalletkit/wallet-near/variables/nep413_prefix/)
* [ONE_YOCTO](/api/anywalletkit/wallet-near/variables/one_yocto/)
* [STORAGE_DEPOSIT_GAS](/api/anywalletkit/wallet-near/variables/storage_deposit_gas/)
* [STORAGE_PRICE_PER_BYTE](/api/anywalletkit/wallet-near/variables/storage_price_per_byte/)
* [TGAS](/api/anywalletkit/wallet-near/variables/tgas/)
* [YOCTO](/api/anywalletkit/wallet-near/variables/yocto/)
## Functions
[Section titled “Functions”](#functions)
* [accessKeyPermissionTag](/api/anywalletkit/wallet-near/functions/accesskeypermissiontag/)
* [actionKey](/api/anywalletkit/wallet-near/functions/actionkey/)
* [argsBytes](/api/anywalletkit/wallet-near/functions/argsbytes/)
* [assertWellFormed](/api/anywalletkit/wallet-near/functions/assertwellformed/)
* [base58ToBytes](/api/anywalletkit/wallet-near/functions/base58tobytes/)
* [bytesToBase58](/api/anywalletkit/wallet-near/functions/bytestobase58/)
* [createClient](/api/anywalletkit/wallet-near/functions/createclient/)
* [createNearHistory](/api/anywalletkit/wallet-near/functions/createnearhistory/)
* [decodeAnyTransaction](/api/anywalletkit/wallet-near/functions/decodeanytransaction/)
* [decodeFunctionCallArgs](/api/anywalletkit/wallet-near/functions/decodefunctioncallargs/)
* [decodeHistoryCursor](/api/anywalletkit/wallet-near/functions/decodehistorycursor/)
* [decodeSignedTransaction](/api/anywalletkit/wallet-near/functions/decodesignedtransaction/)
* [decodeTransaction](/api/anywalletkit/wallet-near/functions/decodetransaction/)
* [describeTransaction](/api/anywalletkit/wallet-near/functions/describetransaction/)
* [ed25519Key](/api/anywalletkit/wallet-near/functions/ed25519key/)
* [encodeHistoryCursor](/api/anywalletkit/wallet-near/functions/encodehistorycursor/)
* [encodeSignedTransaction](/api/anywalletkit/wallet-near/functions/encodesignedtransaction/)
* [encodeTransaction](/api/anywalletkit/wallet-near/functions/encodetransaction/)
* [failureOf](/api/anywalletkit/wallet-near/functions/failureof/)
* [fromBase64](/api/anywalletkit/wallet-near/functions/frombase64/)
* [implicitAccountId](/api/anywalletkit/wallet-near/functions/implicitaccountid/)
* [isDangerous](/api/anywalletkit/wallet-near/functions/isdangerous/)
* [isImplicitAccountId](/api/anywalletkit/wallet-near/functions/isimplicitaccountid/)
* [isPlainObject](/api/anywalletkit/wallet-near/functions/isplainobject/)
* [isValidAccountId](/api/anywalletkit/wallet-near/functions/isvalidaccountid/)
* [mapNearblocksGroup](/api/anywalletkit/wallet-near/functions/mapnearblocksgroup/)
* [mapNearblocksTxn](/api/anywalletkit/wallet-near/functions/mapnearblockstxn/)
* [mapRpcTxStatus](/api/anywalletkit/wallet-near/functions/maprpctxstatus/)
* [nearExplorerTxUrl](/api/anywalletkit/wallet-near/functions/nearexplorertxurl/)
* [nep413Bytes](/api/anywalletkit/wallet-near/functions/nep413bytes/)
* [nep413Hash](/api/anywalletkit/wallet-near/functions/nep413hash/)
* [outcomeFailed](/api/anywalletkit/wallet-near/functions/outcomefailed/)
* [parseJsonPreservingBigInts](/api/anywalletkit/wallet-near/functions/parsejsonpreservingbigints/)
* [parsePublicKey](/api/anywalletkit/wallet-near/functions/parsepublickey/)
* [parseSignature](/api/anywalletkit/wallet-near/functions/parsesignature/)
* [publicKeyOfImplicit](/api/anywalletkit/wallet-near/functions/publickeyofimplicit/)
* [publicKeyToString](/api/anywalletkit/wallet-near/functions/publickeytostring/)
* [readAction](/api/anywalletkit/wallet-near/functions/readaction/)
* [readPublicKey](/api/anywalletkit/wallet-near/functions/readpublickey/)
* [readSignature](/api/anywalletkit/wallet-near/functions/readsignature/)
* [receiptOf](/api/anywalletkit/wallet-near/functions/receiptof/)
* [toBase64](/api/anywalletkit/wallet-near/functions/tobase64/)
* [writeAction](/api/anywalletkit/wallet-near/functions/writeaction/)
* [writePublicKey](/api/anywalletkit/wallet-near/functions/writepublickey/)
* [writeSignature](/api/anywalletkit/wallet-near/functions/writesignature/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerNear](/api/anywalletkit/wallet-near/classes/walletmanagernear/)
# BroadcastUnknownError
Defined in: wallet-near/src/errors.ts:77
The signed transaction was handed to the RPC but no definitive answer came back (no response, or a node timeout): it MAY be on chain. Do not sign it again (a new nonce would pay twice) — watch `hash`, computed locally.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-near/src/errors.ts:82
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `string`
Defined in: wallet-near/src/errors.ts:81
Base58 hash of the signed transaction.
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-near/src/errors.ts:79
Always true: the transaction may be on its way.
# HistoryUnavailableError
Defined in: wallet-near/src/history.ts:72
Every configured history backend failed.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: wallet-near/src/history.ts:76
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: wallet-near/src/history.ts:75
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: wallet-near/src/history.ts:73
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-near/src/history.ts:74
# MessageIsTransactionError
Defined in: wallet-near/src/errors.ts:39
`sign()` refused a 32-byte message: NEAR signs a transaction (and a delegate action, and a NEP-413 message) as ed25519 over a 32-byte sha256, so a signature over 32 raw bytes may be a valid transaction signature — an AddKey that hands the account over. Off-chain messages go through `signNep413`; transactions through `signTransaction` / `sendTransaction`, where they are reviewed.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MessageIsTransactionError**(): `MessageIsTransactionError`
Defined in: wallet-near/src/errors.ts:41
#### Returns
[Section titled “Returns”](#returns)
`MessageIsTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: `"message-is-transaction"` = `'message-is-transaction'`
Defined in: wallet-near/src/errors.ts:40
# NearRpc
Defined in: wallet-near/src/rpc.ts:110
The NEAR JSON-RPC calls a wallet uses, with parsed results.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NearRpc**(`fetch`): `NearRpc`
Defined in: wallet-near/src/rpc.ts:111
#### Parameters
[Section titled “Parameters”](#parameters)
##### fetch
[Section titled “fetch”](#fetch)
[`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/)
#### Returns
[Section titled “Returns”](#returns)
`NearRpc`
## Properties
[Section titled “Properties”](#properties)
### fetch
[Section titled “fetch”](#fetch-1)
> `readonly` **fetch**: [`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/)
Defined in: wallet-near/src/rpc.ts:111
## Methods
[Section titled “Methods”](#methods)
### callFunction()
[Section titled “callFunction()”](#callfunction)
> **callFunction**<`T`>(`contract`, `method`, `args?`): `Promise`<`T`>
Defined in: wallet-near/src/rpc.ts:134
View call; the JSON-decoded return value (`null` for an empty result).
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T` = `unknown`
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### contract
[Section titled “contract”](#contract)
`string`
##### method
[Section titled “method”](#method)
`string`
##### args?
[Section titled “args?”](#args)
`Record`<`string`, `unknown`> = `{}`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`T`>
***
### gasPrice()
[Section titled “gasPrice()”](#gasprice)
> **gasPrice**(): `Promise`<`bigint`>
Defined in: wallet-near/src/rpc.ts:150
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`bigint`>
***
### latestBlockHash()
[Section titled “latestBlockHash()”](#latestblockhash)
> **latestBlockHash**(): `Promise`<`string`>
Defined in: wallet-near/src/rpc.ts:144
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`string`>
***
### sendTx()
[Section titled “sendTx()”](#sendtx)
> **sendTx**(`signedTxBase64`, `waitUntil?`): `Promise`<[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/)>
Defined in: wallet-near/src/rpc.ts:156
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### signedTxBase64
[Section titled “signedTxBase64”](#signedtxbase64)
`string`
##### waitUntil?
[Section titled “waitUntil?”](#waituntil)
`"NONE"` | `"INCLUDED"` | `"EXECUTED_OPTIMISTIC"` | `"INCLUDED_FINAL"` | `"EXECUTED"` | `"FINAL"`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/)>
***
### txStatus()
[Section titled “txStatus()”](#txstatus)
> **txStatus**(`hash`, `senderId`): `Promise`<[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/) | `undefined`>
Defined in: wallet-near/src/rpc.ts:161
`undefined` when the node does not know the transaction.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### hash
[Section titled “hash”](#hash)
`string`
##### senderId
[Section titled “senderId”](#senderid)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/) | `undefined`>
***
### viewAccessKey()
[Section titled “viewAccessKey()”](#viewaccesskey)
> **viewAccessKey**(`accountId`, `publicKey`): `Promise`<[`RawAccessKeyView`](/api/anywalletkit/wallet-near/interfaces/rawaccesskeyview/) | `undefined`>
Defined in: wallet-near/src/rpc.ts:124
`undefined` when the key is not on the account.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### accountId
[Section titled “accountId”](#accountid)
`string`
##### publicKey
[Section titled “publicKey”](#publickey)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`RawAccessKeyView`](/api/anywalletkit/wallet-near/interfaces/rawaccesskeyview/) | `undefined`>
***
### viewAccount()
[Section titled “viewAccount()”](#viewaccount)
> **viewAccount**(`accountId`): `Promise`<[`RawAccountView`](/api/anywalletkit/wallet-near/interfaces/rawaccountview/) | `undefined`>
Defined in: wallet-near/src/rpc.ts:114
`undefined` when the account does not exist.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### accountId
[Section titled “accountId”](#accountid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`RawAccountView`](/api/anywalletkit/wallet-near/interfaces/rawaccountview/) | `undefined`>
# NearRpcError
Defined in: wallet-near/src/errors.ts:58
The RPC answered with an `error` object.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NearRpcError**(`method`, `error`): `NearRpcError`
Defined in: wallet-near/src/errors.ts:62
#### Parameters
[Section titled “Parameters”](#parameters)
##### method
[Section titled “method”](#method)
`string`
##### error
[Section titled “error”](#error)
###### cause?
[Section titled “cause?”](#cause)
{ `info?`: `unknown`; `name?`: `string`; }
###### cause.info?
[Section titled “cause.info?”](#causeinfo)
`unknown`
###### cause.name?
[Section titled “cause.name?”](#causename)
`string`
###### code?
[Section titled “code?”](#code)
`number`
###### data?
[Section titled “data?”](#data)
`unknown`
###### message?
[Section titled “message?”](#message)
`string`
###### name?
[Section titled “name?”](#name)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NearRpcError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### cause
[Section titled “cause”](#cause-1)
> `readonly` **cause**: `unknown`
Defined in: wallet-near/src/errors.ts:61
#### Overrides
[Section titled “Overrides”](#overrides-1)
`Error.cause`
***
### errorName
[Section titled “errorName”](#errorname)
> `readonly` **errorName**: `string` | `undefined`
Defined in: wallet-near/src/errors.ts:60
***
### method
[Section titled “method”](#method-1)
> `readonly` **method**: `string`
Defined in: wallet-near/src/errors.ts:59
# SimulationError
Defined in: wallet-near/src/errors.ts:48
The preflight (balances, account, access key, token registration) predicted failure; nothing was signed.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SimulationError**(`reason`): `SimulationError`
Defined in: wallet-near/src/errors.ts:50
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
#### Returns
[Section titled “Returns”](#returns)
`SimulationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-near/src/errors.ts:49
# UnsafeTransactionError
Defined in: wallet-near/src/errors.ts:24
A transaction failed a hard check and was not signed.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`code`, `message`): `UnsafeTransactionError`
Defined in: wallet-near/src/errors.ts:26
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`UnsafeTransactionCode`](/api/anywalletkit/wallet-near/type-aliases/unsafetransactioncode/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`UnsafeTransactionCode`](/api/anywalletkit/wallet-near/type-aliases/unsafetransactioncode/)
Defined in: wallet-near/src/errors.ts:25
# WalletAccountNear
Defined in: wallet-near/src/account.ts:33
Signing NEAR account. The key lives in an ed25519 Signer (a local key zeroized by `dispose()`, or an external hardware / MPC / backend signer). The account builds the transaction (nonce + block hash from the node), checks it, runs the preflight, has the signer sign sha256(borsh(tx)) (context `near-tx`) and broadcasts it with `send_tx`.
By default the account id is the implicit one (hex of the public key). Pass `accountId` for a named account whose full-access key this is.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountNear**(`signer`, `publicKey`, `path`, `config?`, `accountId?`): `WalletAccountNear`
Defined in: wallet-near/src/account.ts:49
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/) = `{}`
##### accountId?
[Section titled “accountId?”](#accountid)
`string`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountNear`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`constructor`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/) | `undefined`
Defined in: wallet-near/src/read-only-account.ts:49
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`_client`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#_client)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/)
Defined in: wallet-near/src/read-only-account.ts:48
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`_config`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#_config)
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: [`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/) | `undefined`
Defined in: wallet-near/src/read-only-account.ts:50
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`_rpc`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#_rpc)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `string`
Defined in: wallet-near/src/read-only-account.ts:45
Account id: the implicit hex id of the key, or a named account bound to it.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`address`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#address)
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-near/src/read-only-account.ts:46
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`chain`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#chain)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `true` = `true`
Defined in: wallet-near/src/account.ts:35
nonce / block hash come from the node, so building needs the network.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-near/src/account.ts:37
Derivation path, or `external` for an external signer.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/read-only-account.ts:47
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`publicKey`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#publickey)
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"seed"` | `"key"` | `"external"`
Defined in: wallet-near/src/account.ts:45
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-near/src/account.ts:62
Account index for the standard m/44’/397’/i’ path.
##### Returns
[Section titled “Returns”](#returns-1)
`number` | `undefined`
***
### publicKeyString
[Section titled “publicKeyString”](#publickeystring)
#### Get Signature
[Section titled “Get Signature”](#get-signature-1)
> **get** **publicKeyString**(): `string`
Defined in: wallet-near/src/read-only-account.ts:71
“ed25519:”
##### Returns
[Section titled “Returns”](#returns-2)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`publicKeyString`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#publickeystring)
## Methods
[Section titled “Methods”](#methods)
### accountExists()
[Section titled “accountExists()”](#accountexists)
> **accountExists**(`accountId`): `Promise`<`boolean`>
Defined in: wallet-near/src/read-only-account.ts:103
True when the account exists on chain.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### accountId
[Section titled “accountId”](#accountid-1)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`accountExists`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#accountexists)
***
### assertSafe()
[Section titled “assertSafe()”](#assertsafe)
> **assertSafe**(`tx`, `fee?`): `void`
Defined in: wallet-near/src/read-only-account.ts:288
Refuse what cannot be right: a foreign signer or key, no actions, a dangerous action (unless `allowDangerousActions`), an invalid receiver, prepaid gas over 300 Tgas, a fee above `transactionMaxFee`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
##### fee?
[Section titled “fee?”](#fee)
`bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`assertSafe`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#assertsafe)
***
### buildTransaction()
[Section titled “buildTransaction()”](#buildtransaction)
> **buildTransaction**(`tx`): `Promise`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)>
Defined in: wallet-near/src/read-only-account.ts:166
Fill `signerId` / `publicKey` / `nonce` / `blockHash` (the last two from the node when missing).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-1)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`buildTransaction`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#buildtransaction)
***
### describeTransactionOnline()
[Section titled “describeTransactionOnline()”](#describetransactiononline)
> **describeTransactionOnline**(`tx`, `ctx?`): `Promise`<[`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)>
Defined in: wallet-near/src/read-only-account.ts:310
`describeTransaction` plus the recipient-existence check against the node.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx-2)
[`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
##### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-near/interfaces/describecontext/) = `{}`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`describeTransactionOnline`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#describetransactiononline)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-near/src/account.ts:174
Dispose the signer (zeroizes a local key). Idempotent.
#### Returns
[Section titled “Returns”](#returns-7)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### estimate()
[Section titled “estimate()”](#estimate)
> `protected` **estimate**(`tx`, `recipientExists?`): `Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
Defined in: wallet-near/src/read-only-account.ts:211
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### tx
[Section titled “tx”](#tx-3)
`Pick`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/), `"receiverId"` | `"actions"`>
##### recipientExists?
[Section titled “recipientExists?”](#recipientexists)
`boolean`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`estimate`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#estimate)
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`tx`): `Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
Defined in: wallet-near/src/read-only-account.ts:222
Gas and cost of a transaction.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx-4)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`estimateFee`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#estimatefee)
***
### getAccountView()
[Section titled “getAccountView()”](#getaccountview)
> **getAccountView**(`accountId?`): `Promise`<[`NearAccountView`](/api/anywalletkit/wallet-near/interfaces/nearaccountview/) | `undefined`>
Defined in: wallet-near/src/read-only-account.ts:82
The account as the node sees it; `undefined` when it does not exist yet.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### accountId?
[Section titled “accountId?”](#accountid-2)
`string` = `...`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`NearAccountView`](/api/anywalletkit/wallet-near/interfaces/nearaccountview/) | `undefined`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getAccountView`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getaccountview)
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-near/src/read-only-account.ts:79
The account id.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getAddress`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getaddress)
***
### getAvailableBalance()
[Section titled “getAvailableBalance()”](#getavailablebalance)
> **getAvailableBalance**(): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:98
What can actually be spent: total − locked (staked) − storage reservation.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getAvailableBalance`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getavailablebalance)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:93
Total NEAR balance in yoctoNEAR (0 for an account that does not exist yet).
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getBalance`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getbalance)
***
### getStorageBalance()
[Section titled “getStorageBalance()”](#getstoragebalance)
> **getStorageBalance**(`token`, `accountId?`): `Promise`<{ `available`: `bigint`; `total`: `bigint`; } | `null`>
Defined in: wallet-near/src/read-only-account.ts:121
NEP-145 storage registration of `accountId` on a token contract (`null` = not registered).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### token
[Section titled “token”](#token)
`string`
##### accountId?
[Section titled “accountId?”](#accountid-3)
`string` = `...`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<{ `available`: `bigint`; `total`: `bigint`; } | `null`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getStorageBalance`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getstoragebalance)
***
### getStorageDepositMin()
[Section titled “getStorageDepositMin()”](#getstoragedepositmin)
> **getStorageDepositMin**(`token`): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:127
Minimum deposit a token contract wants for a registration (`storage_balance_bounds.min`).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getStorageDepositMin`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#getstoragedepositmin)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:108
NEP-141 `ft_balance_of`.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getTokenBalance`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#gettokenbalance)
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-near/src/read-only-account.ts:114
Several NEP-141 balances in parallel, keyed by the token contracts as given.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`Record`<`string`, `bigint`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getTokenBalances`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#gettokenbalances)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/) | `undefined`>
Defined in: wallet-near/src/read-only-account.ts:317
Status of one of this account’s transactions (the `tx` RPC needs the sender).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`getTransactionReceipt`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#gettransactionreceipt)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
Defined in: wallet-near/src/read-only-account.ts:227
Fee of a transaction in yoctoNEAR.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### tx
[Section titled “tx”](#tx-5)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.quoteSendTransaction`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`quoteSendTransaction`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
Defined in: wallet-near/src/read-only-account.ts:233
Fee of a transfer in yoctoNEAR, for the same actions `transfer` would send.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### o
[Section titled “o”](#o)
[`NearTransferOptions`](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`quoteTransfer`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#quotetransfer)
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/)
Defined in: wallet-near/src/read-only-account.ts:73
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
[`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`requireRpc`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#requirerpc)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<[`NearTransferResult`](/api/anywalletkit/wallet-near/interfaces/neartransferresult/)>
Defined in: wallet-near/src/account.ts:150
Sign and broadcast. Accepts a transaction, or base64 borsh of an unsigned / already-signed transaction (a signed one is checked, not re-signed).
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tx
[Section titled “tx”](#tx-6)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
##### options?
[Section titled “options?”](#options)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`NearTransferResult`](/api/anywalletkit/wallet-near/interfaces/neartransferresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-near/src/account.ts:89
Raw ed25519 signature over the message bytes, as NEAR tooling prints it: “ed25519:”. A 32-byte message — string or bytes — is refused with [MessageIsTransactionError](/api/anywalletkit/wallet-near/classes/messageistransactionerror/): a NEAR transaction is signed over its 32-byte sha256, so those bytes could be one. Bytes that carry this account’s public key are refused as well: one ed25519 key (an external signer) may also be a Solana wallet, and a Solana transaction names its signer’s key. Sites asking a wallet to sign a message use [signNep413](/api/anywalletkit/wallet-near/classes/walletaccountnear/#signnep413).
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sign`
***
### signBuilt()
[Section titled “signBuilt()”](#signbuilt)
> **signBuilt**(`tx`): `Promise`<[`NearSignedTransaction`](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)>
Defined in: wallet-near/src/account.ts:102
Sign a fully built transaction. No checks — see `signTransaction`.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### tx
[Section titled “tx”](#tx-7)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`NearSignedTransaction`](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)>
***
### signNep413()
[Section titled “signNep413()”](#signnep413)
> **signNep413**(`payload`): `Promise`<[`Nep413Signed`](/api/anywalletkit/wallet-near/interfaces/nep413signed/)>
Defined in: wallet-near/src/account.ts:96
NEP-413 off-chain message (what NEAR Intents and dApps ask wallets to sign).
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### payload
[Section titled “payload”](#payload)
[`Nep413Payload`](/api/anywalletkit/wallet-near/interfaces/nep413payload/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`Nep413Signed`](/api/anywalletkit/wallet-near/interfaces/nep413signed/)>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-near/src/account.ts:123
Build, check, preflight and sign; returns the signed transaction as base64 borsh (what `send_tx` takes).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-8)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
##### options?
[Section titled “options?”](#options-1)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.signTransaction`
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`, `estimate?`): `Promise`<[`NearSimulation`](/api/anywalletkit/wallet-near/interfaces/nearsimulation/)>
Defined in: wallet-near/src/read-only-account.ts:245
Predict failure without signing: the signer account and its access key exist, the spendable balance covers deposits + fee, a named recipient exists (an implicit one may be created, for ≥ 0.002 NEAR), the token balance covers an `ft_transfer`. Transport failures throw; predicted failures don’t.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### tx
[Section titled “tx”](#tx-9)
[`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/) | [`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
##### estimate?
[Section titled “estimate?”](#estimate-1)
[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<[`NearSimulation`](/api/anywalletkit/wallet-near/interfaces/nearsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`simulateTransaction`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#simulatetransaction)
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-near/src/account.ts:168
The same account as a [WalletAccountReadOnlyNear](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).
#### Returns
[Section titled “Returns”](#returns-28)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.toReadOnlyAccount`
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`o`, `writeOptions?`): `Promise`<[`NearTransferResult`](/api/anywalletkit/wallet-near/interfaces/neartransferresult/)>
Defined in: wallet-near/src/account.ts:160
Native NEAR (no `token`) or NEP-141 `ft_transfer` (with `storage_deposit` when the recipient needs it).
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### o
[Section titled “o”](#o-1)
[`NearTransferOptions`](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<[`NearTransferResult`](/api/anywalletkit/wallet-near/interfaces/neartransferresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.transfer`
***
### transferActions()
[Section titled “transferActions()”](#transferactions)
> **transferActions**(`o`): `Promise`<{ `actions`: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]; `receiverId`: `string`; }>
Defined in: wallet-near/src/read-only-account.ts:140
The actions for `transfer`: native → one Transfer; NEP-141 → `ft_transfer` (1 yocto, 30 Tgas), preceded by `storage_deposit` when the recipient is not registered on the token.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### o
[Section titled “o”](#o-2)
[`NearTransferOptions`](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<{ `actions`: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]; `receiverId`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`transferActions`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#transferactions)
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-near/src/read-only-account.ts:324
Verify an `ed25519:` (or bare base58 / hex) signature produced by `sign`.
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-31)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`verify`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#verify)
***
### withAccountId()
[Section titled “withAccountId()”](#withaccountid)
> **withAccountId**(`accountId`): `WalletAccountNear`
Defined in: wallet-near/src/account.ts:68
The same key bound to a named account (`alice.near`) that lists it as a full-access key.
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### accountId
[Section titled “accountId”](#accountid-4)
`string`
#### Returns
[Section titled “Returns”](#returns-32)
`WalletAccountNear`
***
### depositOf()
[Section titled “depositOf()”](#depositof)
> `static` **depositOf**(`actions`): `bigint`
Defined in: wallet-near/src/read-only-account.ts:201
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### actions
[Section titled “actions”](#actions)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
#### Returns
[Section titled “Returns”](#returns-33)
`bigint`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`depositOf`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#depositof)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`, `accountId?`): `WalletAccountNear`
Defined in: wallet-near/src/account.ts:57
Wrap a raw derived key (takes ownership; zeroized on dispose).
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
##### config?
[Section titled “config?”](#config-1)
[`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/) = `{}`
##### accountId?
[Section titled “accountId?”](#accountid-5)
`string`
#### Returns
[Section titled “Returns”](#returns-34)
`WalletAccountNear`
***
### gasOf()
[Section titled “gasOf()”](#gasof)
> `static` **gasOf**(`actions`, `createsAccount`): `bigint`
Defined in: wallet-near/src/read-only-account.ts:188
Gas upper bound for the actions (prepaid function-call gas in full).
#### Parameters
[Section titled “Parameters”](#parameters-28)
##### actions
[Section titled “actions”](#actions-1)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
##### createsAccount
[Section titled “createsAccount”](#createsaccount)
`boolean`
#### Returns
[Section titled “Returns”](#returns-35)
`bigint`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`gasOf`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#gasof)
***
### hashOf()
[Section titled “hashOf()”](#hashof)
> `static` **hashOf**(`tx`): `Uint8Array`
Defined in: wallet-near/src/read-only-account.ts:332
sha256(borsh(tx)) — what gets signed; base58 of it is the transaction hash.
#### Parameters
[Section titled “Parameters”](#parameters-29)
##### tx
[Section titled “tx”](#tx-10)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
#### Returns
[Section titled “Returns”](#returns-36)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-30)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`hashOf`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#hashof)
***
### txHash()
[Section titled “txHash()”](#txhash)
> `static` **txHash**(`tx`): `string`
Defined in: wallet-near/src/read-only-account.ts:333
#### Parameters
[Section titled “Parameters”](#parameters-30)
##### tx
[Section titled “tx”](#tx-11)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
#### Returns
[Section titled “Returns”](#returns-37)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-31)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/).[`txHash`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/#txhash)
# WalletAccountReadOnlyNear
Defined in: wallet-near/src/read-only-account.ts:43
A NEAR account without a key: balances, NEP-141 tokens and storage, fee estimates, simulation, receipts and signature checks.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlyNear**(`address`, `config?`, `publicKey?`): `WalletAccountReadOnlyNear`
Defined in: wallet-near/src/read-only-account.ts:56
#### Parameters
[Section titled “Parameters”](#parameters)
##### address
[Section titled “address”](#address)
`string`
account id; an implicit (64-hex) id also fixes the public key.
##### config?
[Section titled “config?”](#config)
[`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/) = `{}`
##### publicKey?
[Section titled “publicKey?”](#publickey)
`Uint8Array`<`ArrayBufferLike`> | [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
required for a named account (the key the account signs with).
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlyNear`
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/) | `undefined`
Defined in: wallet-near/src/read-only-account.ts:49
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/)
Defined in: wallet-near/src/read-only-account.ts:48
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: [`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/) | `undefined`
Defined in: wallet-near/src/read-only-account.ts:50
***
### address
[Section titled “address”](#address-1)
> `readonly` **address**: `string`
Defined in: wallet-near/src/read-only-account.ts:45
Account id: the implicit hex id of the key, or a named account bound to it.
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-near/src/read-only-account.ts:46
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/read-only-account.ts:47
## Accessors
[Section titled “Accessors”](#accessors)
### publicKeyString
[Section titled “publicKeyString”](#publickeystring)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **publicKeyString**(): `string`
Defined in: wallet-near/src/read-only-account.ts:71
“ed25519:”
##### Returns
[Section titled “Returns”](#returns-1)
`string`
## Methods
[Section titled “Methods”](#methods)
### accountExists()
[Section titled “accountExists()”](#accountexists)
> **accountExists**(`accountId`): `Promise`<`boolean`>
Defined in: wallet-near/src/read-only-account.ts:103
True when the account exists on chain.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### accountId
[Section titled “accountId”](#accountid)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`boolean`>
***
### assertSafe()
[Section titled “assertSafe()”](#assertsafe)
> **assertSafe**(`tx`, `fee?`): `void`
Defined in: wallet-near/src/read-only-account.ts:288
Refuse what cannot be right: a foreign signer or key, no actions, a dangerous action (unless `allowDangerousActions`), an invalid receiver, prepaid gas over 300 Tgas, a fee above `transactionMaxFee`.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
##### fee?
[Section titled “fee?”](#fee)
`bigint`
#### Returns
[Section titled “Returns”](#returns-3)
`void`
***
### buildTransaction()
[Section titled “buildTransaction()”](#buildtransaction)
> **buildTransaction**(`tx`): `Promise`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)>
Defined in: wallet-near/src/read-only-account.ts:166
Fill `signerId` / `publicKey` / `nonce` / `blockHash` (the last two from the node when missing).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-1)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)>
***
### describeTransactionOnline()
[Section titled “describeTransactionOnline()”](#describetransactiononline)
> **describeTransactionOnline**(`tx`, `ctx?`): `Promise`<[`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)>
Defined in: wallet-near/src/read-only-account.ts:310
`describeTransaction` plus the recipient-existence check against the node.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx-2)
[`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
##### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-near/interfaces/describecontext/) = `{}`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)>
***
### estimate()
[Section titled “estimate()”](#estimate)
> `protected` **estimate**(`tx`, `recipientExists?`): `Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
Defined in: wallet-near/src/read-only-account.ts:211
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### tx
[Section titled “tx”](#tx-3)
`Pick`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/), `"receiverId"` | `"actions"`>
##### recipientExists?
[Section titled “recipientExists?”](#recipientexists)
`boolean`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`tx`): `Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
Defined in: wallet-near/src/read-only-account.ts:222
Gas and cost of a transaction.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx-4)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)>
***
### getAccountView()
[Section titled “getAccountView()”](#getaccountview)
> **getAccountView**(`accountId?`): `Promise`<[`NearAccountView`](/api/anywalletkit/wallet-near/interfaces/nearaccountview/) | `undefined`>
Defined in: wallet-near/src/read-only-account.ts:82
The account as the node sees it; `undefined` when it does not exist yet.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### accountId?
[Section titled “accountId?”](#accountid-1)
`string` = `...`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`NearAccountView`](/api/anywalletkit/wallet-near/interfaces/nearaccountview/) | `undefined`>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-near/src/read-only-account.ts:79
The account id.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getAvailableBalance()
[Section titled “getAvailableBalance()”](#getavailablebalance)
> **getAvailableBalance**(): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:98
What can actually be spent: total − locked (staked) − storage reservation.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:93
Total NEAR balance in yoctoNEAR (0 for an account that does not exist yet).
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getStorageBalance()
[Section titled “getStorageBalance()”](#getstoragebalance)
> **getStorageBalance**(`token`, `accountId?`): `Promise`<{ `available`: `bigint`; `total`: `bigint`; } | `null`>
Defined in: wallet-near/src/read-only-account.ts:121
NEP-145 storage registration of `accountId` on a token contract (`null` = not registered).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### token
[Section titled “token”](#token)
`string`
##### accountId?
[Section titled “accountId?”](#accountid-2)
`string` = `...`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<{ `available`: `bigint`; `total`: `bigint`; } | `null`>
***
### getStorageDepositMin()
[Section titled “getStorageDepositMin()”](#getstoragedepositmin)
> **getStorageDepositMin**(`token`): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:127
Minimum deposit a token contract wants for a registration (`storage_balance_bounds.min`).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`bigint`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-near/src/read-only-account.ts:108
NEP-141 `ft_balance_of`.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-near/src/read-only-account.ts:114
Several NEP-141 balances in parallel, keyed by the token contracts as given.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`Record`<`string`, `bigint`>>
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/) | `undefined`>
Defined in: wallet-near/src/read-only-account.ts:317
Status of one of this account’s transactions (the `tx` RPC needs the sender).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<[`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
Defined in: wallet-near/src/read-only-account.ts:227
Fee of a transaction in yoctoNEAR.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### tx
[Section titled “tx”](#tx-5)
`string` | [`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
Defined in: wallet-near/src/read-only-account.ts:233
Fee of a transfer in yoctoNEAR, for the same actions `transfer` would send.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### o
[Section titled “o”](#o)
[`NearTransferOptions`](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`NearQuote`](/api/anywalletkit/wallet-near/interfaces/nearquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/)
Defined in: wallet-near/src/read-only-account.ts:73
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
[`NearRpc`](/api/anywalletkit/wallet-near/classes/nearrpc/)
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`, `estimate?`): `Promise`<[`NearSimulation`](/api/anywalletkit/wallet-near/interfaces/nearsimulation/)>
Defined in: wallet-near/src/read-only-account.ts:245
Predict failure without signing: the signer account and its access key exist, the spendable balance covers deposits + fee, a named recipient exists (an implicit one may be created, for ≥ 0.002 NEAR), the token balance covers an `ft_transfer`. Transport failures throw; predicted failures don’t.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tx
[Section titled “tx”](#tx-6)
[`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/) | [`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
##### estimate?
[Section titled “estimate?”](#estimate-1)
[`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`NearSimulation`](/api/anywalletkit/wallet-near/interfaces/nearsimulation/)>
***
### transferActions()
[Section titled “transferActions()”](#transferactions)
> **transferActions**(`o`): `Promise`<{ `actions`: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]; `receiverId`: `string`; }>
Defined in: wallet-near/src/read-only-account.ts:140
The actions for `transfer`: native → one Transfer; NEP-141 → `ft_transfer` (1 yocto, 30 Tgas), preceded by `storage_deposit` when the recipient is not registered on the token.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### o
[Section titled “o”](#o-1)
[`NearTransferOptions`](/api/anywalletkit/wallet-near/interfaces/neartransferoptions/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<{ `actions`: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]; `receiverId`: `string`; }>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-near/src/read-only-account.ts:324
Verify an `ed25519:` (or bare base58 / hex) signature produced by `sign`.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.verify`
***
### depositOf()
[Section titled “depositOf()”](#depositof)
> `static` **depositOf**(`actions`): `bigint`
Defined in: wallet-near/src/read-only-account.ts:201
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### actions
[Section titled “actions”](#actions)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
#### Returns
[Section titled “Returns”](#returns-23)
`bigint`
***
### gasOf()
[Section titled “gasOf()”](#gasof)
> `static` **gasOf**(`actions`, `createsAccount`): `bigint`
Defined in: wallet-near/src/read-only-account.ts:188
Gas upper bound for the actions (prepaid function-call gas in full).
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### actions
[Section titled “actions”](#actions-1)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
##### createsAccount
[Section titled “createsAccount”](#createsaccount)
`boolean`
#### Returns
[Section titled “Returns”](#returns-24)
`bigint`
***
### hashOf()
[Section titled “hashOf()”](#hashof)
> `static` **hashOf**(`tx`): `Uint8Array`
Defined in: wallet-near/src/read-only-account.ts:332
sha256(borsh(tx)) — what gets signed; base58 of it is the transaction hash.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### tx
[Section titled “tx”](#tx-7)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
#### Returns
[Section titled “Returns”](#returns-25)
`Uint8Array`
***
### txHash()
[Section titled “txHash()”](#txhash)
> `static` **txHash**(`tx`): `string`
Defined in: wallet-near/src/read-only-account.ts:333
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### tx
[Section titled “tx”](#tx-8)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
#### Returns
[Section titled “Returns”](#returns-26)
`string`
# WalletManagerNear
Defined in: wallet-near/src/manager.ts:22
One seed → NEAR accounts at m/44’/397’/i’ (SLIP-10 ed25519 — the NEAR Wallet / near-seed-phrase path; index 0 is what every NEAR wallet derives). Paths may be given relative to m/44’/397’ (“0’”) or in full; every segment must be hardened.
Built with an ed25519 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at `m/44'/397'` yields `getAccount(i)` → `i'` children;
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’); other indexes/paths throw `SignerError`.
`getNamedAccount("alice.near", i)` binds account i’s key to a named account.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/), [`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerNear**(`seedOrSigner`, `config?`): `WalletManagerNear`
Defined in: wallet-near/src/manager.ts:23
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerNear`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/) | `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: wallet-near/src/manager.ts:28
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: wallet-near/src/manager.ts:32
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-near/src/manager.ts:71
NEAR has one protocol gas price (`gas_price` RPC, yoctoNEAR per gas); it can rise \~1%/block, so fast = ×1.1.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getNamedAccount()
[Section titled “getNamedAccount()”](#getnamedaccount)
> **getNamedAccount**(`accountId`, `index?`): `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: wallet-near/src/manager.ts:46
The key of account `index`, bound to a named account that lists it as a full-access key.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### accountId
[Section titled “accountId”](#accountid)
`string`
##### index?
[Section titled “index?”](#index-1)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`accountId`, `publicKey?`): [`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/)
Defined in: wallet-near/src/manager.ts:66
A read-only account for any account id, with this manager’s config.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### accountId
[Section titled “accountId”](#accountid-1)
`string`
##### publicKey?
[Section titled “publicKey?”](#publickey)
`Uint8Array`<`ArrayBufferLike`> | [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
#### Returns
[Section titled “Returns”](#returns-8)
[`WalletAccountReadOnlyNear`](/api/anywalletkit/wallet-near/classes/walletaccountreadonlynear/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-9)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-10)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-near/classes/walletmanagernear/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`WalletAccountNear`](/api/anywalletkit/wallet-near/classes/walletaccountnear/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-near/classes/walletmanagernear/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-12)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-near/classes/walletmanagernear/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# accessKeyPermissionTag
> **accessKeyPermissionTag**(`permission`): `0` | `1`
Defined in: wallet-near/src/borsh.ts:154
The borsh tag of an access-key permission (0 FunctionCall, 1 FullAccess), read from a permission of exactly one known variant: `{ fullAccess: {} }` or `{ functionCall: { receiverId, methodNames, allowance? } }`. Anything else throws, so an empty, misspelled, unknown or doubled variant is never encoded as FullAccess. The encoder, `assertWellFormed` and the description all read this one tag (scan 2026-10-30 F9).
## Parameters
[Section titled “Parameters”](#parameters)
### permission
[Section titled “permission”](#permission)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`0` | `1`
# actionKey
> **actionKey**(`a`): `"stake"` | `"createAccount"` | `"deployContract"` | `"functionCall"` | `"transfer"` | `"addKey"` | `"deleteKey"` | `"deleteAccount"` | `"signedDelegate"` | `"deployGlobalContract"` | `"useGlobalContract"`
Defined in: wallet-near/src/borsh.ts:123
The one key an action object has. Two keys (a deleteAccount next to a functionCall) is no action: whichever a reader picks, another reader may pick the other (scan 2026-10-27 F6).
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
## Returns
[Section titled “Returns”](#returns)
`"stake"` | `"createAccount"` | `"deployContract"` | `"functionCall"` | `"transfer"` | `"addKey"` | `"deleteKey"` | `"deleteAccount"` | `"signedDelegate"` | `"deployGlobalContract"` | `"useGlobalContract"`
# argsBytes
> **argsBytes**(`args`): `Uint8Array`
Defined in: wallet-near/src/borsh.ts:139
Function-call args as bytes: raw bytes pass through; plain objects / strings become UTF-8 JSON / UTF-8. Anything else throws.
## Parameters
[Section titled “Parameters”](#parameters)
### args
[Section titled “args”](#args)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Record`<`string`, `unknown`>
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# assertWellFormed
> **assertWellFormed**(`tx`): `void`
Defined in: wallet-near/src/read-only-account.ts:361
An object transaction has exactly the shape the encoder writes, before it is built or signed (also `signBuilt`): every action one known key; a function call’s `methodName` a string of the method grammar, `args` bytes, a string or a plain object, `gas` / `deposit` bigints; an AddKey permission exactly one known variant (scan 2026-10-30 F9); every account id and method name well formed. What the policies read is then what gets encoded (scan 2026-10-27 F6, F28).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`Pick`<[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/), `"receiverId"` | `"actions"`>
## Returns
[Section titled “Returns”](#returns)
`void`
# base58ToBytes
> **base58ToBytes**(`s`, `length?`): `Uint8Array`
Defined in: wallet-near/src/address.ts:51
Decode base58, optionally checking the length.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
### length?
[Section titled “length?”](#length)
`number`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# bytesToBase58
> **bytesToBase58**(`b`): `string`
Defined in: wallet-near/src/address.ts:57
Encode bytes as base58.
## Parameters
[Section titled “Parameters”](#parameters)
### b
[Section titled “b”](#b)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# createClient
> **createClient**(`config`): [`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/) | `undefined`
Defined in: wallet-near/src/rpc.ts:72
One transport, or a failover transport over the list. Reads fail over on anything but a definitive node answer; a broadcast is sent once — the account turns an unanswered one into `BroadcastUnknownError`.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`NearConfig`](/api/anywalletkit/wallet-near/interfaces/nearconfig/)
## Returns
[Section titled “Returns”](#returns)
[`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/) | `undefined`
# createNearHistory
> **createNearHistory**(`options?`): [`NearHistorySource`](/api/anywalletkit/wallet-near/interfaces/nearhistorysource/)
Defined in: wallet-near/src/history.ts:538
A history source for NEAR accounts backed by nearblocks.
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`NearHistoryOptions`](/api/anywalletkit/wallet-near/interfaces/nearhistoryoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`NearHistorySource`](/api/anywalletkit/wallet-near/interfaces/nearhistorysource/)
# decodeAnyTransaction
> **decodeAnyTransaction**(`bytes`): `object`
Defined in: wallet-near/src/borsh.ts:348
Unsigned or signed borsh bytes → the transaction (and signature when present).
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`object`
### signature?
[Section titled “signature?”](#signature)
> `optional` **signature?**: [`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
### transaction
[Section titled “transaction”](#transaction)
> **transaction**: [`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
# decodeFunctionCallArgs
> **decodeFunctionCallArgs**(`args`): `unknown`
Defined in: wallet-near/src/history.ts:522
Decode `FunctionCall.args` (base64 JSON) — exported for callers that want the arguments of a call.
## Parameters
[Section titled “Parameters”](#parameters)
### args
[Section titled “args”](#args)
`string`
## Returns
[Section titled “Returns”](#returns)
`unknown`
# decodeHistoryCursor
> **decodeHistoryCursor**(`s`): [`NearHistoryCursor`](/api/anywalletkit/wallet-near/interfaces/nearhistorycursor/)
Defined in: wallet-near/src/history.ts:138
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
[`NearHistoryCursor`](/api/anywalletkit/wallet-near/interfaces/nearhistorycursor/)
# decodeSignedTransaction
> **decodeSignedTransaction**(`bytes`): [`NearSignedTransaction`](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)
Defined in: wallet-near/src/borsh.ts:339
Decode a signed transaction from borsh bytes.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`NearSignedTransaction`](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)
# decodeTransaction
> **decodeTransaction**(`bytes`): [`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
Defined in: wallet-near/src/borsh.ts:323
Decode an unsigned transaction from borsh bytes.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
# describeTransaction
> **describeTransaction**(`tx`, `ctx?`): [`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)
Defined in: wallet-near/src/describe.ts:32
What a transaction does, decoded offline. Never throws on odd input — it warns.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`NearTransaction`](/api/anywalletkit/wallet-near/interfaces/neartransaction/)
### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-near/interfaces/describecontext/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`NearTxDescription`](/api/anywalletkit/wallet-near/interfaces/neartxdescription/)
# ed25519Key
> **ed25519Key**(`publicKey`): [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/address.ts:39
A NEAR public key from 32 ed25519 bytes.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
# encodeHistoryCursor
> **encodeHistoryCursor**(`c`): `string`
Defined in: wallet-near/src/history.ts:134
## Parameters
[Section titled “Parameters”](#parameters)
### c
[Section titled “c”](#c)
[`NearHistoryCursor`](/api/anywalletkit/wallet-near/interfaces/nearhistorycursor/)
## Returns
[Section titled “Returns”](#returns)
`string`
# encodeSignedTransaction
> **encodeSignedTransaction**(`s`): `Uint8Array`
Defined in: wallet-near/src/borsh.ts:331
Borsh bytes of a signed transaction, ready to broadcast as base64.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
[`NearSignedTransaction`](/api/anywalletkit/wallet-near/interfaces/nearsignedtransaction/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# encodeTransaction
> **encodeTransaction**(`tx`): `Uint8Array`
Defined in: wallet-near/src/borsh.ts:299
Borsh bytes of an unsigned transaction.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# failureOf
> **failureOf**(`status`): `string` | `undefined`
Defined in: wallet-near/src/rpc.ts:172
Human-readable failure from an execution `status` (`{Failure: {...}}`), or undefined on success.
## Parameters
[Section titled “Parameters”](#parameters)
### status
[Section titled “status”](#status)
`Record`<`string`, `unknown`> | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# fromBase64
> **fromBase64**(`s`): `Uint8Array`
Defined in: wallet-near/src/rpc.ts:15
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# implicitAccountId
> **implicitAccountId**(`publicKey`): `string`
Defined in: wallet-near/src/address.ts:18
The implicit account id of an ed25519 public key.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# isDangerous
> **isDangerous**(`a`): `boolean`
Defined in: wallet-near/src/describe.ts:125
True for actions that change who controls the account or its code: keys, account creation or deletion, contract deployment, staking, delegated actions. Refused unless `allowDangerousActions` is set.
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isImplicitAccountId
> **isImplicitAccountId**(`id`): `boolean`
Defined in: wallet-near/src/address.ts:13
64 lowercase hex chars = an implicit account (the account id IS the ed25519 public key).
## Parameters
[Section titled “Parameters”](#parameters)
### id
[Section titled “id”](#id)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isPlainObject
> **isPlainObject**(`v`): `v is Record`
Defined in: wallet-near/src/borsh.ts:132
A plain `{…}` object: not an array, not a class instance.
## Parameters
[Section titled “Parameters”](#parameters)
### v
[Section titled “v”](#v)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`v is Record`
# isValidAccountId
> **isValidAccountId**(`id`): `boolean`
Defined in: wallet-near/src/address.ts:8
True for a valid NEAR account id: 2–64 characters of the allowed alphabet, implicit or named.
## Parameters
[Section titled “Parameters”](#parameters)
### id
[Section titled “id”](#id)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# mapNearblocksGroup
> **mapNearblocksGroup**(`chain`, `address`, `receipts`, `ft`): [`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
Defined in: wallet-near/src/history.ts:339
One transaction from its nearblocks receipt rows + NEP-141 rows.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### receipts
[Section titled “receipts”](#receipts)
[`NearblocksReceiptRow`](/api/anywalletkit/wallet-near/interfaces/nearblocksreceiptrow/)\[]
### ft
[Section titled “ft”](#ft)
[`NearblocksFtRow`](/api/anywalletkit/wallet-near/interfaces/nearblocksftrow/)\[]
## Returns
[Section titled “Returns”](#returns)
[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
# mapNearblocksTxn
> **mapNearblocksTxn**(`chain`, `address`, `txn`): [`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
Defined in: wallet-near/src/history.ts:376
`/v1/txns/{hash}`: transaction-level actions, signer / receiver, approximate NEP-141 deltas from the receipts.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### txn
[Section titled “txn”](#txn)
[`NearblocksTxn`](/api/anywalletkit/wallet-near/interfaces/nearblockstxn/)
## Returns
[Section titled “Returns”](#returns)
[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
# mapRpcTxStatus
> **mapRpcTxStatus**(`chain`, `address`, `r`, `base?`): [`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
Defined in: wallet-near/src/history.ts:437
Rebuild transfers / call / fee / status exactly from an `EXPERIMENTAL_tx_status` result.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### r
[Section titled “r”](#r)
[`RpcTxStatus`](/api/anywalletkit/wallet-near/interfaces/rpctxstatus/)
### base?
[Section titled “base?”](#base)
[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
## Returns
[Section titled “Returns”](#returns)
[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)
# nearExplorerTxUrl
> **nearExplorerTxUrl**(`hash`, `network?`): `string`
Defined in: wallet-near/src/history.ts:533
Nearblocks link for a transaction.
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### network?
[Section titled “network?”](#network)
`"mainnet"` | `"testnet"`
## Returns
[Section titled “Returns”](#returns)
`string`
# nep413Bytes
> **nep413Bytes**(`p`): `Uint8Array`
Defined in: wallet-near/src/nep413.ts:33
Borsh bytes of a NEP-413 payload, ready to hash and sign.
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
[`Nep413Payload`](/api/anywalletkit/wallet-near/interfaces/nep413payload/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# nep413Hash
> **nep413Hash**(`p`): `Uint8Array`
Defined in: wallet-near/src/nep413.ts:43
The 32-byte digest an ed25519 signer signs for a NEP-413 message.
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
[`Nep413Payload`](/api/anywalletkit/wallet-near/interfaces/nep413payload/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# outcomeFailed
> **outcomeFailed**(`o`): `string` | `undefined`
Defined in: wallet-near/src/rpc.ts:183
Did the whole transaction (every receipt) succeed?
## Parameters
[Section titled “Parameters”](#parameters)
### o
[Section titled “o”](#o)
[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/)
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# parseJsonPreservingBigInts
> **parseJsonPreservingBigInts**(`text`): `unknown`
Defined in: wallet-near/src/history.ts:193
`JSON.parse` that keeps integer literals of 16+ digits exact by quoting them first (outside strings only). Numbers with a fraction or exponent are left to the double parser — nearblocks already rounded those.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
`unknown`
# parsePublicKey
> **parsePublicKey**(`s`): [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/address.ts:29
Parse `ed25519:` (or bare base58) into a public key.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
[`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
# parseSignature
> **parseSignature**(`signature`): `Uint8Array`
Defined in: wallet-near/src/read-only-account.ts:342
## Parameters
[Section titled “Parameters”](#parameters)
### signature
[Section titled “signature”](#signature)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# publicKeyOfImplicit
> **publicKeyOfImplicit**(`accountId`): `Uint8Array`
Defined in: wallet-near/src/address.ts:45
The ed25519 public key behind an implicit account id.
## Parameters
[Section titled “Parameters”](#parameters)
### accountId
[Section titled “accountId”](#accountid)
`string`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# publicKeyToString
> **publicKeyToString**(`k`): `string`
Defined in: wallet-near/src/address.ts:24
“ed25519:” as NEAR tooling prints keys.
## Parameters
[Section titled “Parameters”](#parameters)
### k
[Section titled “k”](#k)
[`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
## Returns
[Section titled “Returns”](#returns)
`string`
# readAction
> **readAction**(`r`): [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
Defined in: wallet-near/src/borsh.ts:272
## Parameters
[Section titled “Parameters”](#parameters)
### r
[Section titled “r”](#r)
`BorshReader`
## Returns
[Section titled “Returns”](#returns)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
# readPublicKey
> **readPublicKey**(`r`): [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/borsh.ts:96
## Parameters
[Section titled “Parameters”](#parameters)
### r
[Section titled “r”](#r)
`BorshReader`
## Returns
[Section titled “Returns”](#returns)
[`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
# readSignature
> **readSignature**(`r`): [`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
Defined in: wallet-near/src/borsh.ts:106
## Parameters
[Section titled “Parameters”](#parameters)
### r
[Section titled “r”](#r)
`BorshReader`
## Returns
[Section titled “Returns”](#returns)
[`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
# receiptOf
> **receiptOf**(`hash`, `o`): [`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/)
Defined in: wallet-near/src/read-only-account.ts:336
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### o
[Section titled “o”](#o)
[`RawFinalOutcome`](/api/anywalletkit/wallet-near/interfaces/rawfinaloutcome/)
## Returns
[Section titled “Returns”](#returns)
[`NearReceipt`](/api/anywalletkit/wallet-near/interfaces/nearreceipt/)
# toBase64
> **toBase64**(`bytes`): `string`
Defined in: wallet-near/src/rpc.ts:6
Base64 helpers that work in Node, browsers and Hermes (no Buffer).
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# writeAction
> **writeAction**(`w`, `a`): `void`
Defined in: wallet-near/src/borsh.ts:217
## Parameters
[Section titled “Parameters”](#parameters)
### w
[Section titled “w”](#w)
`BorshWriter`
### a
[Section titled “a”](#a)
[`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)
## Returns
[Section titled “Returns”](#returns)
`void`
# writePublicKey
> **writePublicKey**(`w`, `k`): `void`
Defined in: wallet-near/src/borsh.ts:92
## Parameters
[Section titled “Parameters”](#parameters)
### w
[Section titled “w”](#w)
`BorshWriter`
### k
[Section titled “k”](#k)
[`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
## Returns
[Section titled “Returns”](#returns)
`void`
# writeSignature
> **writeSignature**(`w`, `s`): `void`
Defined in: wallet-near/src/borsh.ts:102
## Parameters
[Section titled “Parameters”](#parameters)
### w
[Section titled “w”](#w)
`BorshWriter`
### s
[Section titled “s”](#s)
[`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
## Returns
[Section titled “Returns”](#returns)
`void`
# DescribeContext
Defined in: wallet-near/src/describe.ts:6
What an offline description can be told to sharpen its warnings.
## Properties
[Section titled “Properties”](#properties)
### recipientExists?
[Section titled “recipientExists?”](#recipientexists)
> `optional` **recipientExists?**: `boolean`
Defined in: wallet-near/src/describe.ts:10
Whether the receiver account exists; `describeTransactionOnline` fills it from the node.
***
### signerId?
[Section titled “signerId?”](#signerid)
> `optional` **signerId?**: `string`
Defined in: wallet-near/src/describe.ts:8
The signing account; adds `self-transfer` and fills `from`.
# NearAccessKey
Defined in: wallet-near/src/types.ts:60
An access key’s nonce and permission (full access or a function-call key).
## Properties
[Section titled “Properties”](#properties)
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `bigint`
Defined in: wallet-near/src/types.ts:61
***
### permission
[Section titled “permission”](#permission)
> **permission**: { `fullAccess`: `Record`<`string`, `never`>; } | { `functionCall`: { `allowance?`: `bigint`; `methodNames`: `string`\[]; `receiverId`: `string`; }; }
Defined in: wallet-near/src/types.ts:62
# NearAccountView
Defined in: wallet-near/src/types.ts:162
An account’s balance, locked stake and storage.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-near/src/types.ts:163
***
### available
[Section titled “available”](#available)
> **available**: `bigint`
Defined in: wallet-near/src/types.ts:167
`amount - locked - storageUsage * STORAGE_PRICE_PER_BYTE` (never below 0).
***
### locked
[Section titled “locked”](#locked)
> **locked**: `bigint`
Defined in: wallet-near/src/types.ts:164
***
### storageUsage
[Section titled “storageUsage”](#storageusage)
> **storageUsage**: `bigint`
Defined in: wallet-near/src/types.ts:165
# NearAddKeyAction
Defined in: wallet-near/src/types.ts:64
## Properties
[Section titled “Properties”](#properties)
### addKey
[Section titled “addKey”](#addkey)
> **addKey**: `object`
Defined in: wallet-near/src/types.ts:64
#### accessKey
[Section titled “accessKey”](#accesskey)
> **accessKey**: [`NearAccessKey`](/api/anywalletkit/wallet-near/interfaces/nearaccesskey/)
#### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
# NearblocksAction
Defined in: wallet-near/src/history.ts:258
## Properties
[Section titled “Properties”](#properties)
### action
[Section titled “action”](#action)
> **action**: `string`
Defined in: wallet-near/src/history.ts:259
***
### args?
[Section titled “args?”](#args)
> `optional` **args?**: `string` | `null`
Defined in: wallet-near/src/history.ts:262
***
### deposit?
[Section titled “deposit?”](#deposit)
> `optional` **deposit?**: `string` | `number` | `null`
Defined in: wallet-near/src/history.ts:261
***
### method?
[Section titled “method?”](#method)
> `optional` **method?**: `string` | `null`
Defined in: wallet-near/src/history.ts:260
# NearblocksFtRow
Defined in: wallet-near/src/history.ts:278
## Properties
[Section titled “Properties”](#properties)
### affected_account_id
[Section titled “affected_account_id”](#affected_account_id)
> **affected_account_id**: `string`
Defined in: wallet-near/src/history.ts:280
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `object`
Defined in: wallet-near/src/history.ts:287
#### block_height?
[Section titled “block_height?”](#block_height)
> `optional` **block_height?**: `number`
***
### block_timestamp
[Section titled “block_timestamp”](#block_timestamp)
> **block_timestamp**: `string` | `number`
Defined in: wallet-near/src/history.ts:286
***
### cause?
[Section titled “cause?”](#cause)
> `optional` **cause?**: `string`
Defined in: wallet-near/src/history.ts:284
***
### delta_amount
[Section titled “delta_amount”](#delta_amount)
> **delta_amount**: `string` | `number`
Defined in: wallet-near/src/history.ts:283
Signed, decimal string (exact).
***
### event_index
[Section titled “event_index”](#event_index)
> **event_index**: `string`
Defined in: wallet-near/src/history.ts:279
***
### ft?
[Section titled “ft?”](#ft)
> `optional` **ft?**: `object`
Defined in: wallet-near/src/history.ts:289
#### contract
[Section titled “contract”](#contract)
> **contract**: `string`
#### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number` | `null`
#### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string` | `null`
***
### ft_meta?
[Section titled “ft_meta?”](#ft_meta)
> `optional` **ft_meta?**: `object`
Defined in: wallet-near/src/history.ts:290
#### contract
[Section titled “contract”](#contract-1)
> **contract**: `string`
#### decimals?
[Section titled “decimals?”](#decimals-1)
> `optional` **decimals?**: `number` | `null`
#### symbol?
[Section titled “symbol?”](#symbol-1)
> `optional` **symbol?**: `string` | `null`
***
### involved_account_id?
[Section titled “involved_account_id?”](#involved_account_id)
> `optional` **involved_account_id?**: `string` | `null`
Defined in: wallet-near/src/history.ts:281
***
### outcomes?
[Section titled “outcomes?”](#outcomes)
> `optional` **outcomes?**: `object`
Defined in: wallet-near/src/history.ts:288
#### status?
[Section titled “status?”](#status)
> `optional` **status?**: `boolean` | `null`
***
### transaction_hash
[Section titled “transaction_hash”](#transaction_hash)
> **transaction_hash**: `string`
Defined in: wallet-near/src/history.ts:285
# NearblocksReceiptRow
Defined in: wallet-near/src/history.ts:264
## Properties
[Section titled “Properties”](#properties)
### actions?
[Section titled “actions?”](#actions)
> `optional` **actions?**: [`NearblocksAction`](/api/anywalletkit/wallet-near/interfaces/nearblocksaction/)\[] | `null`
Defined in: wallet-near/src/history.ts:274
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `object`
Defined in: wallet-near/src/history.ts:273
#### block_height?
[Section titled “block_height?”](#block_height)
> `optional` **block_height?**: `number`
***
### block_timestamp
[Section titled “block_timestamp”](#block_timestamp)
> **block_timestamp**: `string` | `number`
Defined in: wallet-near/src/history.ts:272
ns, decimal string (the transaction’s block).
***
### id
[Section titled “id”](#id)
> **id**: `string`
Defined in: wallet-near/src/history.ts:265
***
### outcomes?
[Section titled “outcomes?”](#outcomes)
> `optional` **outcomes?**: `object`
Defined in: wallet-near/src/history.ts:275
#### status?
[Section titled “status?”](#status)
> `optional` **status?**: `boolean` | `null`
***
### outcomes_agg?
[Section titled “outcomes_agg?”](#outcomes_agg)
> `optional` **outcomes_agg?**: `object`
Defined in: wallet-near/src/history.ts:276
#### transaction_fee?
[Section titled “transaction_fee?”](#transaction_fee)
> `optional` **transaction_fee?**: `string` | `number` | `null`
***
### predecessor_account_id
[Section titled “predecessor_account_id”](#predecessor_account_id)
> **predecessor_account_id**: `string`
Defined in: wallet-near/src/history.ts:267
***
### receipt_id?
[Section titled “receipt_id?”](#receipt_id)
> `optional` **receipt_id?**: `string`
Defined in: wallet-near/src/history.ts:266
***
### receipt_kind?
[Section titled “receipt_kind?”](#receipt_kind)
> `optional` **receipt_kind?**: `string`
Defined in: wallet-near/src/history.ts:269
***
### receiver_account_id
[Section titled “receiver_account_id”](#receiver_account_id)
> **receiver_account_id**: `string`
Defined in: wallet-near/src/history.ts:268
***
### transaction_hash
[Section titled “transaction_hash”](#transaction_hash)
> **transaction_hash**: `string`
Defined in: wallet-near/src/history.ts:270
# NearblocksTxn
Defined in: wallet-near/src/history.ts:292
## Properties
[Section titled “Properties”](#properties)
### actions?
[Section titled “actions?”](#actions)
> `optional` **actions?**: [`NearblocksAction`](/api/anywalletkit/wallet-near/interfaces/nearblocksaction/)\[] | `null`
Defined in: wallet-near/src/history.ts:298
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `object`
Defined in: wallet-near/src/history.ts:297
#### block_height?
[Section titled “block_height?”](#block_height)
> `optional` **block_height?**: `number`
***
### block_timestamp
[Section titled “block_timestamp”](#block_timestamp)
> **block_timestamp**: `string` | `number`
Defined in: wallet-near/src/history.ts:294
***
### outcomes?
[Section titled “outcomes?”](#outcomes)
> `optional` **outcomes?**: `object`
Defined in: wallet-near/src/history.ts:299
#### status?
[Section titled “status?”](#status)
> `optional` **status?**: `boolean` | `null`
***
### outcomes_agg?
[Section titled “outcomes_agg?”](#outcomes_agg)
> `optional` **outcomes_agg?**: `object`
Defined in: wallet-near/src/history.ts:300
#### transaction_fee?
[Section titled “transaction_fee?”](#transaction_fee)
> `optional` **transaction_fee?**: `string` | `number` | `null`
***
### receipts?
[Section titled “receipts?”](#receipts)
> `optional` **receipts?**: `object`\[]
Defined in: wallet-near/src/history.ts:301
#### fts?
[Section titled “fts?”](#fts)
> `optional` **fts?**: `Pick`<[`NearblocksFtRow`](/api/anywalletkit/wallet-near/interfaces/nearblocksftrow/), `"cause"` | `"affected_account_id"` | `"involved_account_id"` | `"delta_amount"` | `"ft_meta"`>\[]
***
### receiver_account_id
[Section titled “receiver_account_id”](#receiver_account_id)
> **receiver_account_id**: `string`
Defined in: wallet-near/src/history.ts:296
***
### signer_account_id
[Section titled “signer_account_id”](#signer_account_id)
> **signer_account_id**: `string`
Defined in: wallet-near/src/history.ts:295
***
### transaction_hash
[Section titled “transaction_hash”](#transaction_hash)
> **transaction_hash**: `string`
Defined in: wallet-near/src/history.ts:293
# NearBuiltTransaction
Defined in: wallet-near/src/types.ts:112
Fully specified transaction as it is hashed and signed.
## Properties
[Section titled “Properties”](#properties)
### actions
[Section titled “actions”](#actions)
> **actions**: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
Defined in: wallet-near/src/types.ts:118
***
### blockHash
[Section titled “blockHash”](#blockhash)
> **blockHash**: `Uint8Array`
Defined in: wallet-near/src/types.ts:117
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `bigint`
Defined in: wallet-near/src/types.ts:115
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/types.ts:114
***
### receiverId
[Section titled “receiverId”](#receiverid)
> **receiverId**: `string`
Defined in: wallet-near/src/types.ts:116
***
### signerId
[Section titled “signerId”](#signerid)
> **signerId**: `string`
Defined in: wallet-near/src/types.ts:113
# NearChainTx
Defined in: wallet-near/src/history.ts:54
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`NearHistoryRaw`](/api/anywalletkit/wallet-near/interfaces/nearhistoryraw/)
Defined in: wallet-near/src/history.ts:55
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# NearConfig
Defined in: wallet-near/src/types.ts:11
Options for a NEAR wallet manager or account: RPC endpoints, network, fee caps and the pre-sign checks.
## Properties
[Section titled “Properties”](#properties)
### allowDangerousActions?
[Section titled “allowDangerousActions?”](#allowdangerousactions)
> `optional` **allowDangerousActions?**: `boolean`
Defined in: wallet-near/src/types.ts:33
Allow actions that change the account itself or deploy code (AddKey, DeleteKey, DeleteAccount, DeployContract, Stake, CreateAccount, global-contract actions, SignedDelegate). Default false: they are refused with `dangerous-action`.
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: wallet-near/src/types.ts:17
Optional headers for every request (e.g. an API key).
***
### maxStorageDeposit?
[Section titled “maxStorageDeposit?”](#maxstoragedeposit)
> `optional` **maxStorageDeposit?**: `number` | `bigint`
Defined in: wallet-near/src/types.ts:39
Most yoctoNEAR a token `transfer` may attach as `storage_deposit` to register the recipient (the amount comes from the token contract itself). Default 0.0125 NEAR, ten times the usual NEP-145 minimum.
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
Defined in: wallet-near/src/types.ts:21
“mainnet” (default) | “testnet” | any CAIP-2 suffix.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`NearProvider`](/api/anywalletkit/wallet-near/type-aliases/nearprovider/) | [`NearProvider`](/api/anywalletkit/wallet-near/type-aliases/nearprovider/)\[]
Defined in: wallet-near/src/types.ts:13
RPC url(s) / transport(s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-near/src/types.ts:15
Extra attempts across the provider list after the first failure (default 3).
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-near/src/types.ts:27
Run the balance / account / access-key preflight before signing (default true).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-near/src/types.ts:19
Per-request timeout for url providers, in ms (default 15 000): a node that never answers fails over (reads) or ends as “maybe sent” (`send_tx`).
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-near/src/types.ts:25
Max fee (yoctoNEAR) for `sendTransaction` / `signTransaction`.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-near/src/types.ts:23
Max fee (yoctoNEAR) for `transfer`.
# NearCreateAccountAction
Defined in: wallet-near/src/types.ts:56
## Properties
[Section titled “Properties”](#properties)
### createAccount
[Section titled “createAccount”](#createaccount)
> **createAccount**: `Record`<`string`, `never`>
Defined in: wallet-near/src/types.ts:56
# NearDelegateAction
Defined in: wallet-near/src/types.ts:67
## Properties
[Section titled “Properties”](#properties)
### actions
[Section titled “actions”](#actions)
> **actions**: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
Defined in: wallet-near/src/types.ts:70
***
### maxBlockHeight
[Section titled “maxBlockHeight”](#maxblockheight)
> **maxBlockHeight**: `bigint`
Defined in: wallet-near/src/types.ts:72
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `bigint`
Defined in: wallet-near/src/types.ts:71
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/types.ts:73
***
### receiverId
[Section titled “receiverId”](#receiverid)
> **receiverId**: `string`
Defined in: wallet-near/src/types.ts:69
***
### senderId
[Section titled “senderId”](#senderid)
> **senderId**: `string`
Defined in: wallet-near/src/types.ts:68
# NearDeleteAccountAction
Defined in: wallet-near/src/types.ts:66
## Properties
[Section titled “Properties”](#properties)
### deleteAccount
[Section titled “deleteAccount”](#deleteaccount)
> **deleteAccount**: `object`
Defined in: wallet-near/src/types.ts:66
#### beneficiaryId
[Section titled “beneficiaryId”](#beneficiaryid)
> **beneficiaryId**: `string`
# NearDeleteKeyAction
Defined in: wallet-near/src/types.ts:65
## Properties
[Section titled “Properties”](#properties)
### deleteKey
[Section titled “deleteKey”](#deletekey)
> **deleteKey**: `object`
Defined in: wallet-near/src/types.ts:65
#### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
# NearDeployContractAction
Defined in: wallet-near/src/types.ts:57
## Properties
[Section titled “Properties”](#properties)
### deployContract
[Section titled “deployContract”](#deploycontract)
> **deployContract**: `object`
Defined in: wallet-near/src/types.ts:57
#### code
[Section titled “code”](#code)
> **code**: `Uint8Array`
# NearDeployGlobalContractAction
Defined in: wallet-near/src/types.ts:76
## Properties
[Section titled “Properties”](#properties)
### deployGlobalContract
[Section titled “deployGlobalContract”](#deployglobalcontract)
> **deployGlobalContract**: `object`
Defined in: wallet-near/src/types.ts:76
#### code
[Section titled “code”](#code)
> **code**: `Uint8Array`
#### deployMode
[Section titled “deployMode”](#deploymode)
> **deployMode**: `"codeHash"` | `"accountId"`
# NearFeeEstimate
Defined in: wallet-near/src/types.ts:135
Gas a transaction may burn and its cost in yoctoNEAR.
## Properties
[Section titled “Properties”](#properties)
### createsAccount
[Section titled “createsAccount”](#createsaccount)
> **createsAccount**: `boolean`
Defined in: wallet-near/src/types.ts:145
True when a native transfer will create an implicit account (extra gas included).
***
### deposit
[Section titled “deposit”](#deposit)
> **deposit**: `bigint`
Defined in: wallet-near/src/types.ts:143
yoctoNEAR the actions attach (transfer deposits + function-call deposits).
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-near/src/types.ts:141
Upper bound of the fee in yoctoNEAR (`gas * gasPrice`, plus the account-creation charge when `createsAccount`).
***
### gas
[Section titled “gas”](#gas)
> **gas**: `bigint`
Defined in: wallet-near/src/types.ts:137
Gas the transaction can burn at most (prepaid function-call gas counts in full).
***
### gasPrice
[Section titled “gasPrice”](#gasprice)
> **gasPrice**: `bigint`
Defined in: wallet-near/src/types.ts:139
yoctoNEAR per gas unit at quote time.
# NearFunctionCallAction
Defined in: wallet-near/src/types.ts:45
## Properties
[Section titled “Properties”](#properties)
### functionCall
[Section titled “functionCall”](#functioncall)
> **functionCall**: `object`
Defined in: wallet-near/src/types.ts:46
#### args
[Section titled “args”](#args)
> **args**: `string` | `Uint8Array`<`ArrayBufferLike`> | `Record`<`string`, `unknown`>
Raw bytes, or a JSON-serialisable object / string (encoded as UTF-8 JSON).
#### deposit?
[Section titled “deposit?”](#deposit)
> `optional` **deposit?**: `bigint`
Attached deposit in yoctoNEAR (default 0).
#### gas?
[Section titled “gas?”](#gas)
> `optional` **gas?**: `bigint`
Prepaid gas (default 30 Tgas). Max 300 Tgas.
#### methodName
[Section titled “methodName”](#methodname)
> **methodName**: `string`
# NearHistoryCursor
Defined in: wallet-near/src/history.ts:93
## Properties
[Section titled “Properties”](#properties)
### ft
[Section titled “ft”](#ft)
> **ft**: `string` | `null`
Defined in: wallet-near/src/history.ts:98
`/ft-txns`: `event_index` of the last consumed row; ‘’ = not started; null = exhausted.
***
### skip?
[Section titled “skip?”](#skip)
> `optional` **skip?**: `string`\[]
Defined in: wallet-near/src/history.ts:104
Transactions already emitted that have rows on the next page: a transaction with more receipt rows than a page goes out with the rows that fit, and the rest are consumed without emitting it again (round 3, M13).
***
### tx
[Section titled “tx”](#tx)
> **tx**: `string` | `null`
Defined in: wallet-near/src/history.ts:96
`/txns`: `id` of the last consumed row; ‘’ = not started; null = exhausted.
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: wallet-near/src/history.ts:94
# NearHistoryOptions
Defined in: wallet-near/src/history.ts:26
Options for [createNearHistory](/api/anywalletkit/wallet-near/functions/createnearhistory/).
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: wallet-near/src/history.ts:30
nearblocks Bearer key. Keyless use is limited to a few requests per minute.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`HistoryFetch`](/api/anywalletkit/wallet-near/type-aliases/historyfetch/)
Defined in: wallet-near/src/history.ts:34
***
### nearblocksUrl?
[Section titled “nearblocksUrl?”](#nearblocksurl)
> `optional` **nearblocksUrl?**: `string`
Defined in: wallet-near/src/history.ts:28
nearblocks root. Default `https://api.nearblocks.io` (`https://api-testnet.nearblocks.io` on testnet).
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `"mainnet"` | `"testnet"`
Defined in: wallet-near/src/history.ts:33
***
### rateLimit?
[Section titled “rateLimit?”](#ratelimit)
> `optional` **rateLimit?**: `number`
Defined in: wallet-near/src/history.ts:36
nearblocks requests per second. Default 0.1 (6/min) without a key, 5 with one.
***
### rpcUrl?
[Section titled “rpcUrl?”](#rpcurl)
> `optional` **rpcUrl?**: `string`
Defined in: wallet-near/src/history.ts:32
Archival JSON-RPC (`https://archival-rpc.mainnet.near.org`). When set, `getTransaction` is refined with exact amounts, fee and NEP-141 events.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-near/src/history.ts:38
Per request, ms. Default 15 000.
# NearHistoryPage
Defined in: wallet-near/src/history.ts:58
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/)\[]
Defined in: wallet-near/src/history.ts:59
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
# NearHistoryRaw
Defined in: wallet-near/src/history.ts:41
## Properties
[Section titled “Properties”](#properties)
### approximate?
[Section titled “approximate?”](#approximate)
> `optional` **approximate?**: `true`
Defined in: wallet-near/src/history.ts:51
Set when an amount or the fee came from a value nearblocks had already rounded to a double.
***
### ft
[Section titled “ft”](#ft)
> **ft**: [`NearblocksFtRow`](/api/anywalletkit/wallet-near/interfaces/nearblocksftrow/)\[]
Defined in: wallet-near/src/history.ts:45
nearblocks NEP-141 rows of this transaction (account `/ft-txns`).
***
### receipts
[Section titled “receipts”](#receipts)
> **receipts**: [`NearblocksReceiptRow`](/api/anywalletkit/wallet-near/interfaces/nearblocksreceiptrow/)\[]
Defined in: wallet-near/src/history.ts:43
nearblocks receipt rows of this transaction (account `/txns`).
***
### rpc?
[Section titled “rpc?”](#rpc)
> `optional` **rpc?**: [`RpcTxStatus`](/api/anywalletkit/wallet-near/interfaces/rpctxstatus/)
Defined in: wallet-near/src/history.ts:49
`EXPERIMENTAL_tx_status` result when the RPC answered.
***
### txn?
[Section titled “txn?”](#txn)
> `optional` **txn?**: [`NearblocksTxn`](/api/anywalletkit/wallet-near/interfaces/nearblockstxn/)
Defined in: wallet-near/src/history.ts:47
`/v1/txns/{hash}` row (single-transaction reads).
# NearHistorySource
Defined in: wallet-near/src/history.ts:66
NEAR history from the nearblocks API, with an archival RPC for single transactions. Build it with [createNearHistory](/api/anywalletkit/wallet-near/functions/createnearhistory/).
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/) | `undefined`>
Defined in: wallet-near/src/history.ts:68
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`NearChainTx`](/api/anywalletkit/wallet-near/interfaces/nearchaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`NearHistoryPage`](/api/anywalletkit/wallet-near/interfaces/nearhistorypage/)>
Defined in: wallet-near/src/history.ts:67
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`NearHistoryPage`](/api/anywalletkit/wallet-near/interfaces/nearhistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
# NearPublicKey
Defined in: wallet-near/src/types.ts:94
A public key as NEAR encodes it: curve tag + raw bytes.
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `Uint8Array`
Defined in: wallet-near/src/types.ts:94
***
### keyType
[Section titled “keyType”](#keytype)
> **keyType**: `"ed25519"` | `"secp256k1"`
Defined in: wallet-near/src/types.ts:94
# NearQuote
Defined in: wallet-near/src/types.ts:149
Fee of a transaction in yoctoNEAR, with the estimate behind it.
## Properties
[Section titled “Properties”](#properties)
### estimate
[Section titled “estimate”](#estimate)
> **estimate**: [`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)
Defined in: wallet-near/src/types.ts:152
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-near/src/types.ts:151
\= `estimate.fee`.
# NearReceipt
Defined in: wallet-near/src/types.ts:171
Outcome of a NEAR transaction.
## Properties
[Section titled “Properties”](#properties)
### blockNumber?
[Section titled “blockNumber?”](#blocknumber)
> `optional` **blockNumber?**: `bigint`
Defined in: wallet-near/src/types.ts:175
***
### failure?
[Section titled “failure?”](#failure)
> `optional` **failure?**: `string`
Defined in: wallet-near/src/types.ts:177
Decoded failure, when any receipt failed.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-near/src/types.ts:172
***
### raw
[Section titled “raw”](#raw)
> **raw**: `Record`<`string`, `unknown`>
Defined in: wallet-near/src/types.ts:179
Raw `tx` RPC payload.
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: wallet-near/src/types.ts:174
1 success, 0 failed.
# NearSignature
Defined in: wallet-near/src/types.ts:95
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `Uint8Array`
Defined in: wallet-near/src/types.ts:95
***
### keyType
[Section titled “keyType”](#keytype)
> **keyType**: `"ed25519"` | `"secp256k1"`
Defined in: wallet-near/src/types.ts:95
# NearSignedDelegateAction
Defined in: wallet-near/src/types.ts:75
## Properties
[Section titled “Properties”](#properties)
### signedDelegate
[Section titled “signedDelegate”](#signeddelegate)
> **signedDelegate**: `object`
Defined in: wallet-near/src/types.ts:75
#### delegateAction
[Section titled “delegateAction”](#delegateaction)
> **delegateAction**: [`NearDelegateAction`](/api/anywalletkit/wallet-near/interfaces/neardelegateaction/)
#### signature
[Section titled “signature”](#signature)
> **signature**: [`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
# NearSignedTransaction
Defined in: wallet-near/src/types.ts:121
## Properties
[Section titled “Properties”](#properties)
### signature
[Section titled “signature”](#signature)
> **signature**: [`NearSignature`](/api/anywalletkit/wallet-near/interfaces/nearsignature/)
Defined in: wallet-near/src/types.ts:121
***
### transaction
[Section titled “transaction”](#transaction)
> **transaction**: [`NearBuiltTransaction`](/api/anywalletkit/wallet-near/interfaces/nearbuilttransaction/)
Defined in: wallet-near/src/types.ts:121
# NearSimulation
Defined in: wallet-near/src/types.ts:156
Whether a transaction is expected to succeed, and why not.
## Properties
[Section titled “Properties”](#properties)
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: wallet-near/src/types.ts:157
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: wallet-near/src/types.ts:158
# NearStakeAction
Defined in: wallet-near/src/types.ts:58
## Properties
[Section titled “Properties”](#properties)
### stake
[Section titled “stake”](#stake)
> **stake**: `object`
Defined in: wallet-near/src/types.ts:58
#### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
#### stake
[Section titled “stake”](#stake-1)
> **stake**: `bigint`
# NearTransaction
Defined in: wallet-near/src/types.ts:101
A transaction to sign. `signerId` / `publicKey` default to the account’s; `nonce` / `blockHash` are fetched from the network when omitted (the account `needsNetwork`).
## Properties
[Section titled “Properties”](#properties)
### actions
[Section titled “actions”](#actions)
> **actions**: [`NearAction`](/api/anywalletkit/wallet-near/type-aliases/nearaction/)\[]
Defined in: wallet-near/src/types.ts:103
***
### blockHash?
[Section titled “blockHash?”](#blockhash)
> `optional` **blockHash?**: `string` | `Uint8Array`<`ArrayBufferLike`>
Defined in: wallet-near/src/types.ts:108
32 bytes, or base58.
***
### nonce?
[Section titled “nonce?”](#nonce)
> `optional` **nonce?**: `bigint`
Defined in: wallet-near/src/types.ts:106
***
### publicKey?
[Section titled “publicKey?”](#publickey)
> `optional` **publicKey?**: [`NearPublicKey`](/api/anywalletkit/wallet-near/interfaces/nearpublickey/)
Defined in: wallet-near/src/types.ts:105
***
### receiverId
[Section titled “receiverId”](#receiverid)
> **receiverId**: `string`
Defined in: wallet-near/src/types.ts:102
***
### signerId?
[Section titled “signerId?”](#signerid)
> `optional` **signerId?**: `string`
Defined in: wallet-near/src/types.ts:104
# NearTransferAction
Defined in: wallet-near/src/types.ts:44
## Properties
[Section titled “Properties”](#properties)
### transfer
[Section titled “transfer”](#transfer)
> **transfer**: `object`
Defined in: wallet-near/src/types.ts:44
#### deposit
[Section titled “deposit”](#deposit)
> **deposit**: `bigint`
# NearTransferOptions
Defined in: wallet-near/src/types.ts:124
Shorthand for `transfer`: native NEAR (no `token`) or a NEP-141 token (`token` = contract account id).
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-near/src/types.ts:127
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-near/src/types.ts:129
NEP-141 `memo` (ignored for native transfers — NEAR transfers carry no memo).
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-near/src/types.ts:126
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-near/src/types.ts:125
# NearTransferResult
Defined in: wallet-near/src/account.ts:19
## Extends
[Section titled “Extends”](#extends)
* `TransferResult`
## Properties
[Section titled “Properties”](#properties)
### estimate?
[Section titled “estimate?”](#estimate)
> `optional` **estimate?**: [`NearFeeEstimate`](/api/anywalletkit/wallet-near/interfaces/nearfeeestimate/)
Defined in: wallet-near/src/account.ts:20
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:18
Network fee actually paid or quoted, in native base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`TransferResult.fee`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:16
Transaction hash (id) on the chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`TransferResult.hash`
# NearTxDescription
Defined in: wallet-near/src/types.ts:205
A NEAR transaction decoded for a confirmation screen.
## Properties
[Section titled “Properties”](#properties)
### actionCount
[Section titled “actionCount”](#actioncount)
> **actionCount**: `number`
Defined in: wallet-near/src/types.ts:226
***
### amount?
[Section titled “amount?”](#amount)
> `optional` **amount?**: `bigint`
Defined in: wallet-near/src/types.ts:213
yoctoNEAR (native) or token base units (ft-transfer).
***
### contract?
[Section titled “contract?”](#contract)
> `optional` **contract?**: `string`
Defined in: wallet-near/src/types.ts:219
Called contract (function-call / batch).
***
### deposit
[Section titled “deposit”](#deposit)
> **deposit**: `bigint`
Defined in: wallet-near/src/types.ts:223
Total yoctoNEAR attached across actions.
***
### from?
[Section titled “from?”](#from)
> `optional` **from?**: `string`
Defined in: wallet-near/src/types.ts:209
Signer account id when known.
***
### gas
[Section titled “gas”](#gas)
> **gas**: `bigint`
Defined in: wallet-near/src/types.ts:225
Total prepaid gas across function calls.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`NearTxKind`](/api/anywalletkit/wallet-near/type-aliases/neartxkind/)
Defined in: wallet-near/src/types.ts:206
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-near/src/types.ts:217
NEP-141 memo.
***
### methods?
[Section titled “methods?”](#methods)
> `optional` **methods?**: `string`\[]
Defined in: wallet-near/src/types.ts:221
Methods called, in order.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: wallet-near/src/types.ts:211
Receiver account id (native transfer) or NEP-141 `receiver_id` (ft-transfer).
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-near/src/types.ts:215
NEP-141 contract account id.
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`NearTxWarning`](/api/anywalletkit/wallet-near/interfaces/neartxwarning/)\[]
Defined in: wallet-near/src/types.ts:207
# NearTxWarning
Defined in: wallet-near/src/types.ts:202
One flagged problem, with a sentence a wallet can show.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`NearTxWarningCode`](/api/anywalletkit/wallet-near/type-aliases/neartxwarningcode/)
Defined in: wallet-near/src/types.ts:202
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-near/src/types.ts:202
# NearUseGlobalContractAction
Defined in: wallet-near/src/types.ts:77
## Properties
[Section titled “Properties”](#properties)
### useGlobalContract
[Section titled “useGlobalContract”](#useglobalcontract)
> **useGlobalContract**: { `codeHash`: `Uint8Array`; } | { `accountId`: `string`; }
Defined in: wallet-near/src/types.ts:77
# Nep413Payload
Defined in: wallet-near/src/nep413.ts:14
A NEP-413 sign-in message, as a site asks for it.
## Properties
[Section titled “Properties”](#properties)
### callbackUrl?
[Section titled “callbackUrl?”](#callbackurl)
> `optional` **callbackUrl?**: `string`
Defined in: wallet-near/src/nep413.ts:20
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-near/src/nep413.ts:15
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `Uint8Array`
Defined in: wallet-near/src/nep413.ts:17
32 random bytes chosen by the verifier (replay protection).
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-near/src/nep413.ts:19
Who the message is for (e.g. “intents.near”).
# Nep413Signed
Defined in: wallet-near/src/nep413.ts:24
A NEP-413 signature and the key that made it.
## Properties
[Section titled “Properties”](#properties)
### accountId
[Section titled “accountId”](#accountid)
> **accountId**: `string`
Defined in: wallet-near/src/nep413.ts:29
***
### publicKey
[Section titled “publicKey”](#publickey)
> **publicKey**: `string`
Defined in: wallet-near/src/nep413.ts:28
“ed25519:”
***
### signature
[Section titled “signature”](#signature)
> **signature**: `string`
Defined in: wallet-near/src/nep413.ts:26
Base64 of the 64-byte ed25519 signature — the encoding wallets return.
# RawAccessKeyView
Defined in: wallet-near/src/rpc.ts:97
## Properties
[Section titled “Properties”](#properties)
### block_hash?
[Section titled “block_hash?”](#block_hash)
> `optional` **block_hash?**: `string`
Defined in: wallet-near/src/rpc.ts:97
***
### block_height?
[Section titled “block_height?”](#block_height)
> `optional` **block_height?**: `number`
Defined in: wallet-near/src/rpc.ts:97
***
### nonce
[Section titled “nonce”](#nonce)
> **nonce**: `number`
Defined in: wallet-near/src/rpc.ts:97
***
### permission
[Section titled “permission”](#permission)
> **permission**: { `FunctionCall`: { `allowance`: `string` | `null`; `method_names`: `string`\[]; `receiver_id`: `string`; }; } | `"FullAccess"`
Defined in: wallet-near/src/rpc.ts:97
# RawAccountView
Defined in: wallet-near/src/rpc.ts:96
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string`
Defined in: wallet-near/src/rpc.ts:96
***
### block_hash?
[Section titled “block_hash?”](#block_hash)
> `optional` **block_hash?**: `string`
Defined in: wallet-near/src/rpc.ts:96
***
### block_height?
[Section titled “block_height?”](#block_height)
> `optional` **block_height?**: `number`
Defined in: wallet-near/src/rpc.ts:96
***
### code_hash?
[Section titled “code_hash?”](#code_hash)
> `optional` **code_hash?**: `string`
Defined in: wallet-near/src/rpc.ts:96
***
### locked
[Section titled “locked”](#locked)
> **locked**: `string`
Defined in: wallet-near/src/rpc.ts:96
***
### storage_usage
[Section titled “storage_usage”](#storage_usage)
> **storage_usage**: `number`
Defined in: wallet-near/src/rpc.ts:96
# RawFinalOutcome
Defined in: wallet-near/src/rpc.ts:99
## Properties
[Section titled “Properties”](#properties)
### final_execution_status?
[Section titled “final_execution_status?”](#final_execution_status)
> `optional` **final_execution_status?**: `string`
Defined in: wallet-near/src/rpc.ts:101
***
### receipts_outcome?
[Section titled “receipts_outcome?”](#receipts_outcome)
> `optional` **receipts_outcome?**: `object`\[]
Defined in: wallet-near/src/rpc.ts:104
#### block_hash?
[Section titled “block_hash?”](#block_hash)
> `optional` **block_hash?**: `string`
#### id?
[Section titled “id?”](#id)
> `optional` **id?**: `string`
#### outcome?
[Section titled “outcome?”](#outcome)
> `optional` **outcome?**: `object`
##### outcome.gas_burnt?
[Section titled “outcome.gas_burnt?”](#outcomegas_burnt)
> `optional` **gas_burnt?**: `number`
##### outcome.status?
[Section titled “outcome.status?”](#outcomestatus)
> `optional` **status?**: `Record`<`string`, `unknown`>
##### outcome.tokens_burnt?
[Section titled “outcome.tokens_burnt?”](#outcometokens_burnt)
> `optional` **tokens_burnt?**: `string`
***
### status?
[Section titled “status?”](#status)
> `optional` **status?**: `Record`<`string`, `unknown`>
Defined in: wallet-near/src/rpc.ts:100
***
### transaction?
[Section titled “transaction?”](#transaction)
> `optional` **transaction?**: `object`
Defined in: wallet-near/src/rpc.ts:102
#### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
#### signer_id?
[Section titled “signer_id?”](#signer_id)
> `optional` **signer_id?**: `string`
***
### transaction_outcome?
[Section titled “transaction_outcome?”](#transaction_outcome)
> `optional` **transaction_outcome?**: `object`
Defined in: wallet-near/src/rpc.ts:103
#### block_hash?
[Section titled “block_hash?”](#block_hash-1)
> `optional` **block_hash?**: `string`
#### id?
[Section titled “id?”](#id-1)
> `optional` **id?**: `string`
#### outcome?
[Section titled “outcome?”](#outcome-1)
> `optional` **outcome?**: `object`
##### outcome.gas_burnt?
[Section titled “outcome.gas_burnt?”](#outcomegas_burnt-1)
> `optional` **gas_burnt?**: `number`
##### outcome.status?
[Section titled “outcome.status?”](#outcomestatus-1)
> `optional` **status?**: `Record`<`string`, `unknown`>
##### outcome.tokens_burnt?
[Section titled “outcome.tokens_burnt?”](#outcometokens_burnt-1)
> `optional` **tokens_burnt?**: `string`
# RpcAction
Defined in: wallet-near/src/history.ts:409
## Indexable
[Section titled “Indexable”](#indexable)
> \[`other`: `string`]: `unknown`
## Properties
[Section titled “Properties”](#properties)
### Delegate?
[Section titled “Delegate?”](#delegate)
> `optional` **Delegate?**: `object`
Defined in: wallet-near/src/history.ts:412
#### delegate_action
[Section titled “delegate_action”](#delegate_action)
> **delegate_action**: `object`
##### delegate_action.actions
[Section titled “delegate_action.actions”](#delegate_actionactions)
> **actions**: `RpcAction`\[]
##### delegate_action.receiver_id
[Section titled “delegate_action.receiver_id”](#delegate_actionreceiver_id)
> **receiver_id**: `string`
##### delegate_action.sender_id
[Section titled “delegate_action.sender_id”](#delegate_actionsender_id)
> **sender_id**: `string`
***
### FunctionCall?
[Section titled “FunctionCall?”](#functioncall)
> `optional` **FunctionCall?**: `object`
Defined in: wallet-near/src/history.ts:411
#### args
[Section titled “args”](#args)
> **args**: `string`
#### deposit
[Section titled “deposit”](#deposit)
> **deposit**: `string`
#### gas?
[Section titled “gas?”](#gas)
> `optional` **gas?**: `number`
#### method_name
[Section titled “method_name”](#method_name)
> **method_name**: `string`
***
### Transfer?
[Section titled “Transfer?”](#transfer)
> `optional` **Transfer?**: `object`
Defined in: wallet-near/src/history.ts:410
#### deposit
[Section titled “deposit”](#deposit-1)
> **deposit**: `string`
# RpcTxStatus
Defined in: wallet-near/src/history.ts:415
## Properties
[Section titled “Properties”](#properties)
### receipts_outcome?
[Section titled “receipts_outcome?”](#receipts_outcome)
> `optional` **receipts_outcome?**: `object`\[]
Defined in: wallet-near/src/history.ts:419
#### outcome?
[Section titled “outcome?”](#outcome)
> `optional` **outcome?**: `object`
##### outcome.executor_id?
[Section titled “outcome.executor_id?”](#outcomeexecutor_id)
> `optional` **executor_id?**: `string`
##### outcome.logs?
[Section titled “outcome.logs?”](#outcomelogs)
> `optional` **logs?**: `string`\[]
##### outcome.status?
[Section titled “outcome.status?”](#outcomestatus)
> `optional` **status?**: `Record`<`string`, `unknown`>
##### outcome.tokens_burnt?
[Section titled “outcome.tokens_burnt?”](#outcometokens_burnt)
> `optional` **tokens_burnt?**: `string`
***
### status?
[Section titled “status?”](#status)
> `optional` **status?**: `Record`<`string`, `unknown`>
Defined in: wallet-near/src/history.ts:416
***
### transaction?
[Section titled “transaction?”](#transaction)
> `optional` **transaction?**: `object`
Defined in: wallet-near/src/history.ts:417
#### actions?
[Section titled “actions?”](#actions)
> `optional` **actions?**: [`RpcAction`](/api/anywalletkit/wallet-near/interfaces/rpcaction/)\[]
#### hash?
[Section titled “hash?”](#hash)
> `optional` **hash?**: `string`
#### receiver_id
[Section titled “receiver_id”](#receiver_id)
> **receiver_id**: `string`
#### signer_id
[Section titled “signer_id”](#signer_id)
> **signer_id**: `string`
***
### transaction_outcome?
[Section titled “transaction_outcome?”](#transaction_outcome)
> `optional` **transaction_outcome?**: `object`
Defined in: wallet-near/src/history.ts:418
#### outcome?
[Section titled “outcome?”](#outcome-1)
> `optional` **outcome?**: `object`
##### outcome.executor_id?
[Section titled “outcome.executor_id?”](#outcomeexecutor_id-1)
> `optional` **executor_id?**: `string`
##### outcome.logs?
[Section titled “outcome.logs?”](#outcomelogs-1)
> `optional` **logs?**: `string`\[]
##### outcome.tokens_burnt?
[Section titled “outcome.tokens_burnt?”](#outcometokens_burnt-1)
> `optional` **tokens_burnt?**: `string`
# HistoryFetch
> **HistoryFetch** = (`input`, `init?`) => `Promise`<{ `ok`: `boolean`; `status`: `number`; `text`: `Promise`<`string`>; }>
Defined in: wallet-near/src/history.ts:20
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### init?
[Section titled “init?”](#init)
#### body?
[Section titled “body?”](#body)
`string`
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `ok`: `boolean`; `status`: `number`; `text`: `Promise`<`string`>; }>
# NearAction
> **NearAction** = [`NearCreateAccountAction`](/api/anywalletkit/wallet-near/interfaces/nearcreateaccountaction/) | [`NearDeployContractAction`](/api/anywalletkit/wallet-near/interfaces/neardeploycontractaction/) | [`NearFunctionCallAction`](/api/anywalletkit/wallet-near/interfaces/nearfunctioncallaction/) | [`NearTransferAction`](/api/anywalletkit/wallet-near/interfaces/neartransferaction/) | [`NearStakeAction`](/api/anywalletkit/wallet-near/interfaces/nearstakeaction/) | [`NearAddKeyAction`](/api/anywalletkit/wallet-near/interfaces/nearaddkeyaction/) | [`NearDeleteKeyAction`](/api/anywalletkit/wallet-near/interfaces/neardeletekeyaction/) | [`NearDeleteAccountAction`](/api/anywalletkit/wallet-near/interfaces/neardeleteaccountaction/) | [`NearSignedDelegateAction`](/api/anywalletkit/wallet-near/interfaces/nearsigneddelegateaction/) | [`NearDeployGlobalContractAction`](/api/anywalletkit/wallet-near/interfaces/neardeployglobalcontractaction/) | [`NearUseGlobalContractAction`](/api/anywalletkit/wallet-near/interfaces/nearuseglobalcontractaction/)
Defined in: wallet-near/src/types.ts:80
One action of a NEAR transaction.
# NearFetch
> **NearFetch** = (`method`, `params`) => `Promise`<`unknown`>
Defined in: wallet-near/src/types.ts:2
JSON-RPC transport: `method` + `params`, returns the `result` (throws on `error`).
## Parameters
[Section titled “Parameters”](#parameters)
### method
[Section titled “method”](#method)
`string`
### params
[Section titled “params”](#params)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# NearProvider
> **NearProvider** = `string` | [`NearFetch`](/api/anywalletkit/wallet-near/type-aliases/nearfetch/)
Defined in: wallet-near/src/types.ts:5
One RPC base url (e.g. “”) or a ready transport.
# NearTxKind
> **NearTxKind** = `"near-transfer"` | `"ft-transfer"` | `"ft-storage-deposit"` | `"function-call"` | `"batch"` | `"create-account"` | `"deploy-contract"` | `"stake"` | `"add-key"` | `"delete-key"` | `"delete-account"` | `"delegate"` | `"global-contract"`
Defined in: wallet-near/src/types.ts:185
What a NEAR transaction does.
# NearTxWarningCode
> **NearTxWarningCode** = `"dangerous-action"` | `"full-access-key"` | `"zero-amount"` | `"implicit-new-account"` | `"self-transfer"` | `"high-gas"` | `"unknown-method"` | `"invalid-account"`
Defined in: wallet-near/src/types.ts:200
Problems a NEAR description is flagged with.
# UnsafeTransactionCode
> **UnsafeTransactionCode** = `"signer-mismatch"` | `"public-key-mismatch"` | `"dangerous-action"` | `"invalid-account"` | `"no-actions"` | `"gas-limit"` | `"fee-limit"` | `"missing-block-hash"` | `"missing-nonce"` | `"unknown-action"` | `"insufficient-balance"` | `"implicit-account-min-deposit"` | `"no-access-key"` | `"storage-deposit"` | `"non-canonical"` | `"invalid-method"` | `"malformed-action"`
Defined in: wallet-near/src/errors.ts:4
Why a transaction was refused before signing.
# ACTION_TAG
> `const` **ACTION_TAG**: `object`
Defined in: wallet-near/src/borsh.ts:116
Enum order from nearcore `Action` (and @near-js/transactions SCHEMA.Action).
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### addKey
[Section titled “addKey”](#addkey)
> `readonly` **addKey**: `5` = `5`
### createAccount
[Section titled “createAccount”](#createaccount)
> `readonly` **createAccount**: `0` = `0`
### deleteAccount
[Section titled “deleteAccount”](#deleteaccount)
> `readonly` **deleteAccount**: `7` = `7`
### deleteKey
[Section titled “deleteKey”](#deletekey)
> `readonly` **deleteKey**: `6` = `6`
### deployContract
[Section titled “deployContract”](#deploycontract)
> `readonly` **deployContract**: `1` = `1`
### deployGlobalContract
[Section titled “deployGlobalContract”](#deployglobalcontract)
> `readonly` **deployGlobalContract**: `9` = `9`
### functionCall
[Section titled “functionCall”](#functioncall)
> `readonly` **functionCall**: `2` = `2`
### signedDelegate
[Section titled “signedDelegate”](#signeddelegate)
> `readonly` **signedDelegate**: `8` = `8`
### stake
[Section titled “stake”](#stake)
> `readonly` **stake**: `4` = `4`
### transfer
[Section titled “transfer”](#transfer)
> `readonly` **transfer**: `3` = `3`
### useGlobalContract
[Section titled “useGlobalContract”](#useglobalcontract)
> `readonly` **useGlobalContract**: `10` = `10`
# CAIP2
> `const` **CAIP2**: `Record`<`string`, `string`>
Defined in: wallet-near/src/types.ts:232
CAIP-2 ids of NEAR mainnet and testnet.
# DANGEROUS_ACTIONS
> `const` **DANGEROUS_ACTIONS**: `Set`<`string`>
Defined in: wallet-near/src/describe.ts:14
Actions that change the account itself, its keys, or deploy code. Refused unless `allowDangerousActions`.
# FT_TRANSFER_GAS
> `const` **FT_TRANSFER_GAS**: `bigint`
Defined in: wallet-near/src/types.ts:245
Default gas for `ft_transfer` / `storage_deposit`.
# IMPLICIT_ACCOUNT_MIN_DEPOSIT
> `const` **IMPLICIT_ACCOUNT_MIN_DEPOSIT**: `bigint`
Defined in: wallet-near/src/types.ts:249
Minimum native transfer that can create an implicit account (covers its storage).
# MAX_GAS
> `const` **MAX_GAS**: `bigint`
Defined in: wallet-near/src/types.ts:239
Hard per-transaction prepaid gas limit.
# NEAR_BASE_PATH
> `const` **NEAR_BASE_PATH**: `"m/44'/397'"` = `"m/44'/397'"`
Defined in: wallet-near/src/manager.ts:8
Base derivation path; account `i` is at `m/44'/397'/i'`.
# NEP413_PREFIX
> `const` **NEP413_PREFIX**: `number`
Defined in: wallet-near/src/nep413.ts:11
NEP-413 tag (2^31 + 413) that keeps a signed message from being a valid transaction.
# ONE_YOCTO
> `const` **ONE_YOCTO**: `1n` = `1n`
Defined in: wallet-near/src/types.ts:243
NEP-141 `ft_transfer` requires exactly 1 yoctoNEAR attached.
# STORAGE_DEPOSIT_GAS
> `const` **STORAGE_DEPOSIT_GAS**: `bigint`
Defined in: wallet-near/src/types.ts:247
Gas attached to a NEP-145 `storage_deposit` call.
# STORAGE_PRICE_PER_BYTE
> `const` **STORAGE_PRICE_PER_BYTE**: `bigint`
Defined in: wallet-near/src/types.ts:241
Protocol storage price: 10^19 yoctoNEAR per byte.
# TGAS
> `const` **TGAS**: `bigint`
Defined in: wallet-near/src/types.ts:237
1 Tgas.
# YOCTO
> `const` **YOCTO**: `bigint`
Defined in: wallet-near/src/types.ts:235
1 NEAR = 10^24 yoctoNEAR.
# @anywalletkit/wallet-solana
# @anywalletkit/wallet-solana
[Section titled “@anywalletkit/wallet-solana”](#anywalletkitwallet-solana)
[](https://www.npmjs.com/package/@anywalletkit/wallet-solana)
Solana accounts at `m/44'/501'/i'/0'` (SLIP-10 ed25519 — the Phantom / Solflare default), pinned by golden vectors in `@anywalletkit/conformance`.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-solana
# or: pnpm add @anywalletkit/wallet-solana · yarn add @anywalletkit/wallet-solana
```
On npm: [@anywalletkit/wallet-solana](https://www.npmjs.com/package/@anywalletkit/wallet-solana), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
Signing uses noble ed25519 over the compiled message bytes, so there is no WebCrypto dependency: the same code runs in Node and in React Native Hermes without the Ed25519 subtle polyfill.
```ts
import WalletManagerSolana from '@anywalletkit/wallet-solana'
const wallet = new WalletManagerSolana(seedPhrase, { provider: ['https://rpc-a', 'https://rpc-b'] })
const account = await wallet.getAccount(0)
await account.transfer({ recipient: 'So1…', amount: 10_000_000n }) // SOL (lamports)
await account.transfer({ token: USDC_MINT, recipient: 'So1…', amount: 1_000_000n }) // SPL, creates the ATA if missing
await account.sendTransaction(transactionMessage) // any @solana/kit message
wallet.dispose()
```
## What you sign, what it costs, and when the wallet refuses
[Section titled “What you sign, what it costs, and when the wallet refuses”](#what-you-sign-what-it-costs-and-when-the-wallet-refuses)
Every `transfer` / `sendTransaction` / `signTransaction` goes through one plan, so the network is consulted once per fact and a failing step throws before the key is used:
1. **Describe** — `account.describeTransaction(tx)` (or `describeTransaction(tx, {account})`, pure/offline) decodes System, Token, Token-2022, Associated-Token and Compute-Budget instructions and reports `kind` (`sol-transfer`, `spl-transfer`, `token2022-transfer`, `ata-create`, `program-call`, `mixed`) plus warnings: `unknown-program`, `sets-authority`, `closes-account`, `approves-delegate`, `unlimited-approve`, `foreign-fee-payer`, `missing-signers`, `unresolved-lookup-tables`, `burn-address`, `durable-nonce`, and `lifetime`: `blockhash`, or `durable-nonce` when the first instruction is `AdvanceNonceAccount` (the signature never expires).
2. **Hard checks** — fee payer must be this wallet (`allowForeignFeePayer` to override), a provider transaction must not need other signatures (`MissingSignersError`), transfers to the System-program address are refused (`UnsafeTransactionError`, `allowBurn` to override). Every `sendTransaction` / `signTransaction` (message, kit `Transaction` or base64) also refuses the drainer shapes: System `Assign` / `Allocate` / `CreateAccountAllowPrefund` (and the `WithSeed` forms) of this wallet’s account or a `CreateAccount` of it, `AuthorizeNonceAccount` by this wallet, a token `SetAuthority` (or the metadata / group update-authority handoff), a token `Batch`, lamports moved to anyone but this wallet by an instruction that is not a visible transfer (`CloseAccount`, `WithdrawExcessLamports`, `UnwrapLamports`, `WithdrawNonceAccount`, `TransferSolWithSeed`), a Stake-program instruction this wallet signs that hands a stake account over (`Authorize*` to another key, a `Withdraw` to anyone else, a `SetLockup*` with a foreign custodian or a lockup), a stake account the wallet funds that the same transaction does not initialize (or split into) with this wallet as staker and withdrawer — an SPL Stake Pool `WithdrawStake` into it that names this wallet as the user stake authority counts (a pool’s delayed exit) — an undecodable System / Token / Stake instruction (`UnsafeTransactionError` with `code` `core-instruction`, `sets-authority`, `closes-account` or `moves-lamports`; `allowAuthorityChanges: true` to override, e.g. for a token launch that renounces its mint authority). A durable-nonce transaction is refused (`code` `durable-nonce`) unless `allowDurableNonce` is set in the config or the call’s options. `transfer` / `quoteTransfer` refuse a recipient that is not a wallet: a token account, a mint or a program (`recipient-not-wallet`); an address with no account yet is a wallet. The same checks run in `signCompiled` and `signTransactionMessage`. What a program the wallet signs for does by CPI is proved by the simulation (step 4). Swap-aggregator transactions belong on `sendSerialized`, which adds a program allowlist and a simulated balance / ownership proof and ignores that flag.
3. **Compute budget** — by default the price is the 75th percentile of `getRecentPrioritizationFees` over the writable accounts (clamped by `minPriorityMicroLamports` / `maxPriorityMicroLamports`) and the unit limit is the simulated usage × 1.1. Set `priorityFee: {microLamports, computeUnitLimit}` for explicit values or `priorityFee: false` to add nothing; a budget the caller already put in the message is kept.
4. **Simulation** — `simulateTransaction` (`sigVerify: false`) runs before signing; a failure throws `SimulationError` with the program logs. It also returns the post-state of the wallet, of its token accounts the transaction writes and of every written account the transaction may create (one that does not exist yet, or a bare System account; one extra read for the pre-state), and refuses what CPI would do there: the wallet’s account handed to a program or given data (`wallet-owner`), a token account’s owner or close authority changed, or set on a token account of this wallet that the transaction creates, this wallet’s associated token account created for another owner (`sets-authority`), a delegate allowance no top-level Approve shows (`approves-delegate`); `allowAuthorityChanges` skips this too. `simulate: false` disables the gate (and the CPI proof with it).
5. **Fee quote** — `quoteSendTransaction` / `quoteTransfer` return `{fee, baseFee, priorityFee, microLamports, computeUnitLimit, tokenFee?}`; `transferMaxFee` / `transactionMaxFee` compare against `fee`.
```ts
const q = await account.quoteTransfer({ token: MINT, recipient, amount: 10_000n })
q.priorityFee // lamports added by the compute budget
q.tokenFee // Token-2022 transfer fee withheld by the mint (0 for plain SPL)
```
### Token-2022
[Section titled “Token-2022”](#token-2022)
`transfer` reads the mint once: owner program, decimals and (for Token-2022) the `TransferFee` extension in force this epoch. Transfers use `transferChecked` (mint and decimals verified on chain); fee-bearing mints use `transferCheckedWithFee` so a changed fee makes the transaction fail instead of silently taking more. The recipient’s ATA is derived for the right program.
### Token info
[Section titled “Token info”](#token-info)
`getTokenInfo(mint)` reads a mint from the chain, for a token the user adds by address: `{ standard: 'spl' | 'spl-token-2022', decimals, symbol, name, totalSupply, flags }`. Name and symbol come from the Token-2022 metadata extension, else the Metaplex metadata account (`""` when there is neither); anyone can name a token “USDC”, so only the address identifies it. `flags` lists what a holder should know: `mint-authority`, `freeze-authority`, and the Token-2022 extensions `permanent-delegate` (someone can move or burn any balance), `transfer-fee` (non-zero), `transfer-hook`, `non-transferable`, `default-frozen`, `pausable`. An address that is not an initialized Token / Token-2022 mint throws `NotATokenError`.
```ts
const pyusd = await account.getTokenInfo('2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo')
// { standard: 'spl-token-2022', decimals: 6, symbol: 'PYUSD', name: 'PayPal USD',
// flags: ['mint-authority', 'freeze-authority', 'permanent-delegate'], … }
```
### Versioned transactions and provider wires
[Section titled “Versioned transactions and provider wires”](#versioned-transactions-and-provider-wires)
* `transfer({..., lookupTables: [table]})` / `sendTransaction({to, value, lookupTables})` fetch the tables and compress the v0 message.
* A swap or DeFi provider’s base64 wire transaction is accepted directly: `signTransaction(base64)` / `sendTransaction(base64)` decode it, run the hard checks, simulate, add this wallet’s signature (others are preserved) and return / broadcast the wire. The message bytes are never altered.
* `sendSerialized(base64, guard)` / `checkSerialized(base64, guard)` prove a provider-built wire before signing: the program allowlist, the hard checks, and a simulated balance proof against `guard.expect` (`maxLamportsOut`, `tokenIn: {mint, minAmount, maxAmount?}`, `maxTokenOut`). Every bound must be a non-negative bigint (`invalid-expectation` otherwise, before any RPC call); `tokenIn.maxAmount` refuses a wire that pays the wallet more than asked (`token-in-excess`). A module that knows the exact instructions its operation takes passes `guard.instructions`: every top-level instruction must match one rule — program, data prefix (`data`, hex), optional exact `dataLength`, and the accounts at given positions, compared after lookup tables are resolved — or the wire is refused (`unexpected-instruction`). Net balances alone let a deposit that also withdraws collateral and transfers it away pass; the rules do not.
* `getAccountInfos(addresses)` reads raw accounts (owner, lamports, data) in the order asked, `null` where none exists, for modules that check a provider’s figures against chain state.
### Broadcast outcome and timeouts
[Section titled “Broadcast outcome and timeouts”](#broadcast-outcome-and-timeouts)
A url `provider` gives up after `timeoutMs` (default 15 000) per request (`AbortSignal.timeout`, or a timer where the runtime lacks it); a read that times out is a `NetworkError`. A provider list fails over with the same signed bytes, never a new signature. A send the node refused (preflight failure, bad signature, an HTTP 4xx such as a rate limit) throws that error: nothing was forwarded, plan and sign again. Anything else — a timeout, a dropped connection, a 408 / 5xx, or a refusal after another provider went unanswered — throws `BroadcastUnknownError` (`maybeSent: true`, `hash` = the signature): the transaction may land, so do not sign it again; watch `getTransactionReceipt(hash)` until its blockhash expires.
## Activity history
[Section titled “Activity history”](#activity-history)
`createSolanaHistory` is the chain’s `HistorySource` (`@anywalletkit/core`): newest-first `ChainTx` pages for an address over plain JSON-RPC, no indexer.
```ts
import { createSolanaHistory } from '@anywalletkit/wallet-solana/history'
const history = createSolanaHistory({ rpcUrls: ['https://api.mainnet-beta.solana.com'] })
const page = await history.listActivity('2tKRnQTAXmryVYxDNSajdZg1DfX2FbHKNboWr5EBiKhW', { limit: 25 })
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://solscan.io/tx/…
```
| option | default | notes |
| -------------------- | -------------- | ------------------------------------------------------------------------------------------------ |
| `rpcUrl` / `rpcUrls` | — | One or several JSON-RPC endpoints, tried in order per request (HTTP 429 / 5xx / network → next). |
| `network` | `mainnet` | `devnet` / `testnet` switch the CAIP-2 id and add `?cluster=` to Solscan links. |
| `rateLimit` | 5 rps | Requests per second (a JSON-RPC batch counts as one). |
| `batchSize` | 10 | `getTransaction` calls per JSON-RPC batch (1–10). |
| `maxTokenAccounts` | 50 | Token accounts merged into the address’s history. |
| `fetch`, `timeoutMs` | global, 15 000 | `AbortSignal.timeout` when the runtime has it. |
**Endpoints.** `getTokenAccountsByOwner` (Token + Token-2022, `jsonParsed`, cached per address) → `getSignaturesForAddress` for the wallet **and each token account** → `getTransaction` (`jsonParsed`, `maxSupportedTransactionVersion: 0`, `confirmed`) in batches of ≤ 10. A transaction the node pruned still yields a row (status from the signature list, no transfers, `raw.tx === null`).
**Pages and cursor.** Signatures of every list are merged by slot (newest first), deduplicated, and the page takes the top `limit` plus ties at the boundary slot, so each list’s consumed rows form a prefix of what the node returned. The cursor is base64 JSON `{ v: 1, l: { : | '' | null } }`: one `before` signature per list, `''` = not started, `null` = exhausted. The list set is frozen in the cursor; a token account created mid-pagination joins on the next fresh listing. Pagination is exact even when one transaction touches several lists.
**Mapping.** Native transfers come from `preBalances`/`postBalances` with the fee added back to the payer, token transfers from `pre`/`postTokenBalances` per mint attributed to the token accounts’ **owners** (`standard` = `spl` / `token2022` from `programId`, `decimals` from the balance), senders paired with receivers largest-first; a receiver without a sender is a mint (`from` = mint), a sender without a receiver a burn (`to` = mint). `fee` = `meta.fee`, `status` from `meta.err`, `block` = slot. `call.programs` lists every top-level instruction program id, then inner ones; `call.to` is the first program that is not plumbing (System, ComputeBudget, Memo, Token, Token-2022, Associated Token) and `call.data` that instruction’s base58 data — what `@anywalletkit/protocol-staking-spl-stake-pool-solana` reads. A transaction made only of plumbing (a SOL or SPL transfer) has no `call`; `to` is then the recipient owner. `nativeValue` is the SOL the payer sent in a plain transfer, 0 for program calls. Symbols are not resolved here (no catalog dependency); the kit fills them.
Fixtures in `test/fixtures/history/` were captured on 2026-10-14 from `api.mainnet-beta.solana.com` for the test wallet: signature pages for the wallet, its JitoSOL and USDC accounts, both token-account lists, the Jito `DepositSol` (`3SmwE6qf…`, the same transaction as the stake-pool module’s activity fixture), a SOL send and receive, a USDC send and a Token-2022 → USDC aggregator swap. `test/history.test.ts` checks that the row this source builds for the Jito deposit is described as `stake` by the stake-pool module.
## Classes
[Section titled “Classes”](#classes)
* [BroadcastUnknownError](/api/anywalletkit/wallet-solana/classes/broadcastunknownerror/)
* [HistoryUnavailableError](/api/anywalletkit/wallet-solana/classes/historyunavailableerror/)
* [MessageIsTransactionError](/api/anywalletkit/wallet-solana/classes/messageistransactionerror/)
* [MissingSignersError](/api/anywalletkit/wallet-solana/classes/missingsignerserror/)
* [SimulationError](/api/anywalletkit/wallet-solana/classes/simulationerror/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-solana/classes/unsafetransactionerror/)
* [WalletAccountReadOnlySolana](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/)
* [WalletAccountSolana](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)
* [WalletManagerSolana](/api/anywalletkit/wallet-solana/classes/walletmanagersolana/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [CompiledAccounts](/api/anywalletkit/wallet-solana/interfaces/compiledaccounts/)
* [CompiledMessage](/api/anywalletkit/wallet-solana/interfaces/compiledmessage/)
* [DescribeContext](/api/anywalletkit/wallet-solana/interfaces/describecontext/)
* [MintInfo](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)
* [PageCursor](/api/anywalletkit/wallet-solana/interfaces/pagecursor/)
* [ParsedInstruction](/api/anywalletkit/wallet-solana/interfaces/parsedinstruction/)
* [ParsedTokenAccount](/api/anywalletkit/wallet-solana/interfaces/parsedtokenaccount/)
* [ParsedTransaction](/api/anywalletkit/wallet-solana/interfaces/parsedtransaction/)
* [PlanOptions](/api/anywalletkit/wallet-solana/interfaces/planoptions/)
* [PriorityFeeConfig](/api/anywalletkit/wallet-solana/interfaces/priorityfeeconfig/)
* [SeedAccountDetails](/api/anywalletkit/wallet-solana/interfaces/seedaccountdetails/)
* [SerializedCheck](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/)
* [SerializedExpectation](/api/anywalletkit/wallet-solana/interfaces/serializedexpectation/)
* [SerializedInstructionRule](/api/anywalletkit/wallet-solana/interfaces/serializedinstructionrule/)
* [SerializedTxGuard](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
* [SignatureRow](/api/anywalletkit/wallet-solana/interfaces/signaturerow/)
* [SolanaAccountData](/api/anywalletkit/wallet-solana/interfaces/solanaaccountdata/)
* [SolanaChainTx](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/)
* [SolanaConfig](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)
* [SolanaFeeQuote](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)
* [SolanaHistoryOptions](/api/anywalletkit/wallet-solana/interfaces/solanahistoryoptions/)
* [SolanaHistoryPage](/api/anywalletkit/wallet-solana/interfaces/solanahistorypage/)
* [SolanaHistoryRaw](/api/anywalletkit/wallet-solana/interfaces/solanahistoryraw/)
* [SolanaHistorySource](/api/anywalletkit/wallet-solana/interfaces/solanahistorysource/)
* [SolanaNativeTransfer](/api/anywalletkit/wallet-solana/interfaces/solananativetransfer/)
* [SolanaPlan](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)
* [SolanaReceipt](/api/anywalletkit/wallet-solana/interfaces/solanareceipt/)
* [SolanaSendResult](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/)
* [SolanaTransferOptions](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
* [SolanaWarning](/api/anywalletkit/wallet-solana/interfaces/solanawarning/)
* [SolanaWriteOptions](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/)
* [StakeInstructionDetails](/api/anywalletkit/wallet-solana/interfaces/stakeinstructiondetails/)
* [TokenBalance](/api/anywalletkit/wallet-solana/interfaces/tokenbalance/)
* [TransactionDescription](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [DecodedInstruction](/api/anywalletkit/wallet-solana/type-aliases/decodedinstruction/)
* [HistoryFetch](/api/anywalletkit/wallet-solana/type-aliases/historyfetch/)
* [SimulationResult](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/)
* [SolanaMessageKind](/api/anywalletkit/wallet-solana/type-aliases/solanamessagekind/)
* [SolanaRpc](/api/anywalletkit/wallet-solana/type-aliases/solanarpc/)
* [SolanaTransaction](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
* [SolanaTransactionKind](/api/anywalletkit/wallet-solana/type-aliases/solanatransactionkind/)
* [SolanaWarningCode](/api/anywalletkit/wallet-solana/type-aliases/solanawarningcode/)
* [StakeInstructionName](/api/anywalletkit/wallet-solana/type-aliases/stakeinstructionname/)
* [TokenProgramKind](/api/anywalletkit/wallet-solana/type-aliases/tokenprogramkind/)
## Variables
[Section titled “Variables”](#variables)
* [ASSOCIATED_TOKEN_PROGRAM](/api/anywalletkit/wallet-solana/variables/associated_token_program/)
* [CAIP2_GENESIS](/api/anywalletkit/wallet-solana/variables/caip2_genesis/)
* [COMPUTE_BUDGET_PROGRAM](/api/anywalletkit/wallet-solana/variables/compute_budget_program/)
* [DEFAULT_PROGRAM_ALLOWLIST](/api/anywalletkit/wallet-solana/variables/default_program_allowlist/)
* [DFLOW_V4_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/dflow_v4_program_address/)
* [JUPITER_V6_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/jupiter_v6_program_address/)
* [LIFI_TRACKING_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/lifi_tracking_program_address/)
* [MAX_U64](/api/anywalletkit/wallet-solana/variables/max_u64/)
* [MAYAN_PROGRAM_ADDRESSES](/api/anywalletkit/wallet-solana/variables/mayan_program_addresses/)
* [MEMO_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/memo_program_address/)
* [MEMO_V1_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/memo_v1_program_address/)
* [OKX_DEX_ROUTER_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/okx_dex_router_program_address/)
* [RELAY_DEPOSITORY_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/relay_depository_program_address/)
* [RELAY_FORWARDER_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/relay_forwarder_program_address/)
* [SOLANA_BASE_PATH](/api/anywalletkit/wallet-solana/variables/solana_base_path/)
* [SOLANA_OFFCHAIN_MESSAGE_PREFIX](/api/anywalletkit/wallet-solana/variables/solana_offchain_message_prefix/)
* [STAKE_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/stake_program_address/)
* [SYSTEM_PROGRAM](/api/anywalletkit/wallet-solana/variables/system_program/)
* [TITAN_PROGRAM_ADDRESS](/api/anywalletkit/wallet-solana/variables/titan_program_address/)
* [TOKEN_2022_PROGRAM](/api/anywalletkit/wallet-solana/variables/token_2022_program/)
* [TOKEN_ACCOUNT_MIN_SIZE](/api/anywalletkit/wallet-solana/variables/token_account_min_size/)
* [TOKEN_PROGRAM](/api/anywalletkit/wallet-solana/variables/token_program/)
* [WSOL_MINT](/api/anywalletkit/wallet-solana/variables/wsol_mint/)
* [ZERO_ADDRESS](/api/anywalletkit/wallet-solana/variables/zero_address/)
## Functions
[Section titled “Functions”](#functions)
* [addressFromPublicKey](/api/anywalletkit/wallet-solana/functions/addressfrompublickey/)
* [classifySolanaMessage](/api/anywalletkit/wallet-solana/functions/classifysolanamessage/)
* [computeUnitLimitFromSimulation](/api/anywalletkit/wallet-solana/functions/computeunitlimitfromsimulation/)
* [createRpc](/api/anywalletkit/wallet-solana/functions/createrpc/)
* [createSolanaHistory](/api/anywalletkit/wallet-solana/functions/createsolanahistory/)
* [decodeHistoryCursor](/api/anywalletkit/wallet-solana/functions/decodehistorycursor/)
* [decodeStakeInstruction](/api/anywalletkit/wallet-solana/functions/decodestakeinstruction/)
* [decodeWireTransaction](/api/anywalletkit/wallet-solana/functions/decodewiretransaction/)
* [describeTransaction](/api/anywalletkit/wallet-solana/functions/describetransaction/)
* [encodeHistoryCursor](/api/anywalletkit/wallet-solana/functions/encodehistorycursor/)
* [hasSolanaOffchainHeader](/api/anywalletkit/wallet-solana/functions/hassolanaoffchainheader/)
* [historyCallOf](/api/anywalletkit/wallet-solana/functions/historycallof/)
* [historyNativeTransfers](/api/anywalletkit/wallet-solana/functions/historynativetransfers/)
* [historyTokenTransfers](/api/anywalletkit/wallet-solana/functions/historytokentransfers/)
* [isNativeMint](/api/anywalletkit/wallet-solana/functions/isnativemint/)
* [isNativeTransfer](/api/anywalletkit/wallet-solana/functions/isnativetransfer/)
* [isReadableText](/api/anywalletkit/wallet-solana/functions/isreadabletext/)
* [isSignedTransaction](/api/anywalletkit/wallet-solana/functions/issignedtransaction/)
* [isSolanaTransactionPayload](/api/anywalletkit/wallet-solana/functions/issolanatransactionpayload/)
* [isTransactionMessage](/api/anywalletkit/wallet-solana/functions/istransactionmessage/)
* [mapHistoryTransaction](/api/anywalletkit/wallet-solana/functions/maphistorytransaction/)
* [parseTokenAccount](/api/anywalletkit/wallet-solana/functions/parsetokenaccount/)
* [pickPriorityPrice](/api/anywalletkit/wallet-solana/functions/pickpriorityprice/)
* [resolveCompiledAccounts](/api/anywalletkit/wallet-solana/functions/resolvecompiledaccounts/)
* [solanaExplorerTxUrl](/api/anywalletkit/wallet-solana/functions/solanaexplorertxurl/)
* [unexpectedInstruction](/api/anywalletkit/wallet-solana/functions/unexpectedinstruction/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerSolana](/api/anywalletkit/wallet-solana/classes/walletmanagersolana/)
# BroadcastUnknownError
Defined in: wallet-solana/src/errors.ts:48
The signed transaction was handed to the RPC but no definitive answer came back (no response, a timeout, a gateway error): it MAY be on chain. Do not plan and sign it again (a new blockhash is a second transaction that also lands) — watch `hash`, the signature computed locally, until the blockhash expires.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-solana/src/errors.ts:53
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `string`
Defined in: wallet-solana/src/errors.ts:52
Base58 transaction signature (the fee payer’s), the id to watch.
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-solana/src/errors.ts:50
Always true: the transaction may be on its way.
# HistoryUnavailableError
Defined in: wallet-solana/src/history.ts:77
Every configured RPC failed (or none was configured).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: wallet-solana/src/history.ts:84
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: wallet-solana/src/history.ts:83
One line per endpoint tried, in order.
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: wallet-solana/src/history.ts:79
CAIP-2 id of the cluster.
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-solana/src/history.ts:81
Why the last endpoint failed.
# MessageIsTransactionError
Defined in: wallet-solana/src/offchain.ts:23
Refused before signing: the “message” is a Solana transaction this account would sign for.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MessageIsTransactionError**(`message?`): `MessageIsTransactionError`
Defined in: wallet-solana/src/offchain.ts:26
#### Parameters
[Section titled “Parameters”](#parameters)
##### message?
[Section titled “message?”](#message)
`string` = `'This message is a Solana transaction; use signTransaction so it can be reviewed.'`
#### Returns
[Section titled “Returns”](#returns)
`MessageIsTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: `"message-is-transaction"` = `'message-is-transaction'`
Defined in: wallet-solana/src/offchain.ts:25
Machine-readable code.
# MissingSignersError
Defined in: wallet-solana/src/errors.ts:18
A provider-built transaction needs signatures this wallet cannot produce; signing it would strand a half-signed tx.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MissingSignersError**(`missing`): `MissingSignersError`
Defined in: wallet-solana/src/errors.ts:21
#### Parameters
[Section titled “Parameters”](#parameters)
##### missing
[Section titled “missing”](#missing)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns)
`MissingSignersError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### missing
[Section titled “missing”](#missing-1)
> `readonly` **missing**: readonly `string`\[]
Defined in: wallet-solana/src/errors.ts:20
Signer addresses the transaction still needs.
# SimulationError
Defined in: wallet-solana/src/errors.ts:29
`simulateTransaction` failed; nothing was signed or sent. `logs` are the program logs the RPC returned.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SimulationError**(`reason`, `logs?`): `SimulationError`
Defined in: wallet-solana/src/errors.ts:34
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
##### logs?
[Section titled “logs?”](#logs)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`SimulationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### logs
[Section titled “logs”](#logs-1)
> `readonly` **logs**: readonly `string`\[]
Defined in: wallet-solana/src/errors.ts:33
Program logs from the simulation.
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-solana/src/errors.ts:31
The simulation error.
# UnsafeTransactionError
Defined in: wallet-solana/src/errors.ts:4
Refused before signing: the transaction would almost certainly destroy funds or sign on someone else’s behalf.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`message`, `code?`, `details?`): `UnsafeTransactionError`
Defined in: wallet-solana/src/errors.ts:9
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
##### code?
[Section titled “code?”](#code)
`string`
##### details?
[Section titled “details?”](#details)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `string` | `undefined`
Defined in: wallet-solana/src/errors.ts:6
Machine-readable reason (e.g. `unknown-program`, `token-drain`, `slippage`); undefined for the generic refusals.
***
### details
[Section titled “details”](#details-1)
> `readonly` **details**: readonly `string`\[]
Defined in: wallet-solana/src/errors.ts:8
What tripped the check (program ids, account addresses…).
# WalletAccountReadOnlySolana
Defined in: wallet-solana/src/read-only-account.ts:139
A Solana address without a key: balances, mint info, fee quotes, simulation, the serialized- transaction guard, receipts and signature checks.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlySolana**(`addr`, `config?`): `WalletAccountReadOnlySolana`
Defined in: wallet-solana/src/read-only-account.ts:148
#### Parameters
[Section titled “Parameters”](#parameters)
##### addr
[Section titled “addr”](#addr)
`string`
##### config?
[Section titled “config?”](#config)
[`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlySolana`
## Properties
[Section titled “Properties”](#properties)
### \_commitment
[Section titled “\_commitment”](#_commitment)
> `protected` `readonly` **\_commitment**: `Commitment`
Defined in: wallet-solana/src/read-only-account.ts:146
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)
Defined in: wallet-solana/src/read-only-account.ts:144
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: `Rpc`<`SolanaRpcApiForTestClusters`> | `undefined`
Defined in: wallet-solana/src/read-only-account.ts:145
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `Address`
Defined in: wallet-solana/src/read-only-account.ts:141
Base58 address.
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-solana/src/read-only-account.ts:143
CAIP-2 id of the cluster.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
## Methods
[Section titled “Methods”](#methods)
### assertWalletRecipient()
[Section titled “assertWalletRecipient()”](#assertwalletrecipient)
> `protected` **assertWalletRecipient**(`recipient`): `Promise`<`void`>
Defined in: wallet-solana/src/read-only-account.ts:337
A transfer’s recipient must be a wallet (round 3, M10). A token account or a mint as recipient gets an associated token account nobody can sign for, and SOL or tokens sent to a program are lost: an account owned by Token / Token-2022, or an executable one, is refused. An address with no account yet is an ordinary wallet.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### recipient
[Section titled “recipient”](#recipient)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`void`>
***
### ata()
[Section titled “ata()”](#ata)
> `protected` **ata**(`mint`, `owner`, `tokenProgram?`): `Promise`<`Address`>
Defined in: wallet-solana/src/read-only-account.ts:262
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### mint
[Section titled “mint”](#mint)
`Address`
##### owner
[Section titled “owner”](#owner)
`Address`
##### tokenProgram?
[Section titled “tokenProgram?”](#tokenprogram)
`Address` = `TOKEN_PROGRAM_ADDRESS`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`Address`>
***
### buildNativeTransfer()
[Section titled “buildNativeTransfer()”](#buildnativetransfer)
> `protected` **buildNativeTransfer**(`to`, `value`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:326
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### to
[Section titled “to”](#to)
`string`
##### value
[Section titled “value”](#value)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`TransactionMessage`>
***
### buildTokenTransfer()
[Section titled “buildTokenTransfer()”](#buildtokentransfer)
> `protected` **buildTokenTransfer**(`token`, `recipient`, `amount`): `Promise`<{ `message`: `TransactionMessage`; `tokenFee`: `bigint`; }>
Defined in: wallet-solana/src/read-only-account.ts:348
SPL / Token-2022 transfer via `transferChecked` (mint + decimals verified on chain); the recipient ATA is created when missing.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token)
`string`
##### recipient
[Section titled “recipient”](#recipient-1)
`string`
##### amount
[Section titled “amount”](#amount)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `message`: `TransactionMessage`; `tokenFee`: `bigint`; }>
***
### checkSerialized()
[Section titled “checkSerialized()”](#checkserialized)
> **checkSerialized**(`base64`, `guard`, `options?`): `Promise`<[`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/)>
Defined in: wallet-solana/src/read-only-account.ts:793
Prove what a provider-built transaction does before anyone signs it (see `serialized.ts`). Throws [UnsafeTransactionError](/api/anywalletkit/wallet-solana/classes/unsafetransactionerror/) (allowlist, authority changes, balance violations), [MissingSignersError](/api/anywalletkit/wallet-solana/classes/missingsignerserror/) or [SimulationError](/api/anywalletkit/wallet-solana/classes/simulationerror/); returns the evidence otherwise. Nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### base64
[Section titled “base64”](#base64)
`string`
##### guard
[Section titled “guard”](#guard)
[`SerializedTxGuard`](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
##### options?
[Section titled “options?”](#options)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/)>
***
### describeTransaction()
[Section titled “describeTransaction()”](#describetransaction)
> **describeTransaction**(`tx`): [`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
Defined in: wallet-solana/src/read-only-account.ts:998
Decode without the network: what the transaction does and what to be wary of.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-6)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
***
### enforce()
[Section titled “enforce()”](#enforce)
> `protected` **enforce**(`description`, `options?`): `void`
Defined in: wallet-solana/src/read-only-account.ts:530
Hard checks shared by every signing path. `options` carries the per-call opt-ins ([SolanaWriteOptions](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/)).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### description
[Section titled “description”](#description)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
##### options?
[Section titled “options?”](#options-1)
###### allowDurableNonce?
[Section titled “allowDurableNonce?”](#allowdurablenonce)
`boolean`
#### Returns
[Section titled “Returns”](#returns-7)
`void`
***
### enforceAuthorities()
[Section titled “enforceAuthorities()”](#enforceauthorities)
> `protected` **enforceAuthorities**(`description`): `void`
Defined in: wallet-solana/src/read-only-account.ts:552
The drainer shapes a wallet never signs by default: this wallet’s account reassigned, allocated or created under a program; a nonce, token, metadata or group authority handed away; lamports moved out by an instruction the description does not show as a transfer (a token account closed, excess or wrapped lamports withdrawn, a nonce or seed account emptied) to anyone but this wallet; a token `Batch` (it can carry any of these); an undecodable System / Token instruction. Instructions whose accounts sit in unresolved lookup tables are judged by their identified name (this wallet, a signer, is always a static key). A program this wallet signs for can still do any of this by CPI; `sendSerialized` proves the outcome by simulation instead.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### description
[Section titled “description”](#description-1)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
#### Returns
[Section titled “Returns”](#returns-8)
`void`
***
### enforceCompiledSigners()
[Section titled “enforceCompiledSigners()”](#enforcecompiledsigners)
> `protected` **enforceCompiledSigners**(`description`, `options?`): `void`
Defined in: wallet-solana/src/read-only-account.ts:709
Signer checks shared by every compiled-transaction path: this wallet must be a required signer and nobody else may still be missing.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### description
[Section titled “description”](#description-2)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
##### options?
[Section titled “options?”](#options-2)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
***
### feeForBase64()
[Section titled “feeForBase64()”](#feeforbase64)
> `protected` **feeForBase64**(`messageBase64`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:981
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### messageBase64
[Section titled “messageBase64”](#messagebase64)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
***
### feeForMessage()
[Section titled “feeForMessage()”](#feeformessage)
> `protected` **feeForMessage**(`msg`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:976
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### msg
[Section titled “msg”](#msg)
`TransactionMessage`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`bigint`>
***
### getAccountInfos()
[Section titled “getAccountInfos()”](#getaccountinfos)
> **getAccountInfos**(`addresses`): `Promise`<([`SolanaAccountData`](/api/anywalletkit/wallet-solana/interfaces/solanaaccountdata/) | `null`)\[]>
Defined in: wallet-solana/src/read-only-account.ts:767
Raw accounts in the order asked (null where none exists), batched 100 per `getMultipleAccounts`: for modules that check a provider’s figures against the chain state they claim to describe.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<([`SolanaAccountData`](/api/anywalletkit/wallet-solana/interfaces/solanaaccountdata/) | `null`)\[]>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-solana/src/read-only-account.ts:163
The base58 address.
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:166
Native balance in lamports.
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getMintInfo()
[Section titled “getMintInfo()”](#getmintinfo)
> **getMintInfo**(`mint`): `Promise`<[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)>
Defined in: wallet-solana/src/read-only-account.ts:174
Mint owner program, decimals and (Token-2022) the transfer fee in force this epoch.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### mint
[Section titled “mint”](#mint-1)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)>
***
### getTokenAccountOwner()
[Section titled “getTokenAccountOwner()”](#gettokenaccountowner)
> **getTokenAccountOwner**(`tokenAccount`): `Promise`<`string` | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:201
The owner of a Token / Token-2022 token account — whom an SPL transfer into it pays — or undefined when the address holds no initialized token account (a wallet, a mint, nothing). Network errors throw. The kit’s policies read SPL transfer recipients through it.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### tokenAccount
[Section titled “tokenAccount”](#tokenaccount)
`string`
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`string` | `undefined`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:272
Balance of a mint in this wallet’s associated token account (Token or Token-2022, whichever owns the mint), in base units; 0 when that account does not exist or the address is not a mint. A network error throws: it is never read as a zero balance (round 3, L10).
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-solana/src/read-only-account.ts:287
Batched over getMultipleAccounts (100 addresses per call). Both programs’ associated token accounts are read for every mint, so Token-2022 balances count (round 3, L10); the amount comes from the token-account layout (offset 64) of the account that holds that mint.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`Record`<`string`, `bigint`>>
***
### getTokenInfo()
[Section titled “getTokenInfo()”](#gettokeninfo)
> **getTokenInfo**(`token`): `Promise`<`TokenInfo`>
Defined in: wallet-solana/src/read-only-account.ts:222
Decimals, symbol, name, supply and the holder-relevant flags of a mint, read from the chain: a live mint or freeze authority, and the Token-2022 extensions that let someone take, tax, hook, freeze or pause holders’ tokens. Name and symbol come from the Token-2022 metadata extension, else from the Metaplex metadata account (“” when there is neither). Throws NotATokenError when the address is not an initialized Token / Token-2022 mint.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`TokenInfo`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTokenInfo`
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`SolanaReceipt`](/api/anywalletkit/wallet-solana/interfaces/solanareceipt/) | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:1003
The receipt, or `undefined` while the transaction has not landed.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`SolanaReceipt`](/api/anywalletkit/wallet-solana/interfaces/solanareceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### latestBlockhash()
[Section titled “latestBlockhash()”](#latestblockhash)
> `protected` **latestBlockhash**(): `Promise`<`Readonly`<{ }>>
Defined in: wallet-solana/src/read-only-account.ts:311
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`Readonly`<{ }>>
***
### lookupAddresses()
[Section titled “lookupAddresses()”](#lookupaddresses)
> `protected` **lookupAddresses**(`tables`): `Promise`<`Record`<`string`, readonly `string`\[]> | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:756
Addresses of a lookup-table set, fetched once; `undefined` when the message uses none.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### tables
[Section titled “tables”](#tables)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<`Record`<`string`, readonly `string`\[]> | `undefined`>
***
### plan()
[Section titled “plan()”](#plan)
> `protected` **plan**(`tx`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:960
Plan any accepted input.
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-1)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
##### opts?
[Section titled “opts?”](#opts)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
***
### planCompiled()
[Section titled “planCompiled()”](#plancompiled)
> `protected` **planCompiled**(`input`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:717
Plan a compiled transaction (kit `Transaction` or base64 wire): hard checks, simulation, fee quote. The bytes are never altered.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### input
[Section titled “input”](#input)
`string` | `Readonly`<{ }>
##### opts?
[Section titled “opts?”](#opts-1)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
***
### planMessage()
[Section titled “planMessage()”](#planmessage)
> `protected` **planMessage**(`input`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:664
Plan a message-based transaction: lookup tables, compute budget (priority price + unit limit), simulation and the fee quote. Shared by quote / sign / send so the network is consulted once per fact.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### input
[Section titled “input”](#input-1)
`TransactionMessage`
##### opts?
[Section titled “opts?”](#opts-2)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) & `object` = `{}`
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
***
### planTransfer()
[Section titled “planTransfer()”](#plantransfer)
> `protected` **planTransfer**(`o`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:965
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### o
[Section titled “o”](#o)
[`SolanaTransferOptions`](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
##### opts?
[Section titled “opts?”](#opts-3)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
***
### prepareMessage()
[Section titled “prepareMessage()”](#preparemessage)
> `protected` **prepareMessage**(`tx`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:372
Normalise `{to, value}` or a kit message into a message with lifetime + this account as fee payer.
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### tx
[Section titled “tx”](#tx-2)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`TransactionMessage`>
***
### quoteCompiled()
[Section titled “quoteCompiled()”](#quotecompiled)
> `protected` **quoteCompiled**(`transaction`, `description`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:736
Fee of a compiled transaction: signatures + the compute budget it carries, floored by the RPC’s own quote.
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### transaction
[Section titled “transaction”](#transaction)
`Transaction`
##### description
[Section titled “description”](#description-3)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
#### Returns
[Section titled “Returns”](#returns-28)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:988
Full fee breakdown (base + priority, Token-2022 fee for transfers). Simulation runs too, so a reverting tx is reported here.
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### tx
[Section titled “tx”](#tx-3)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:993
Fee breakdown of a transfer, including the compute budget and any Token-2022 transfer fee.
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### o
[Section titled “o”](#o-1)
[`SolanaTransferOptions`](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`SolanaRpc`](/api/anywalletkit/wallet-solana/type-aliases/solanarpc/)
Defined in: wallet-solana/src/read-only-account.ts:157
#### Parameters
[Section titled “Parameters”](#parameters-28)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-31)
[`SolanaRpc`](/api/anywalletkit/wallet-solana/type-aliases/solanarpc/)
***
### simulateSerialized()
[Section titled “simulateSerialized()”](#simulateserialized)
> **simulateSerialized**(`base64`, `guard`): `Promise`<{ `check`: [`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/); `ok`: `true`; } | { `code?`: `string`; `ok`: `false`; `reason`: `string`; }>
Defined in: wallet-solana/src/read-only-account.ts:949
[checkSerialized](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#checkserialized) without throwing for a refusal: the check or the reason.
#### Parameters
[Section titled “Parameters”](#parameters-29)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### guard
[Section titled “guard”](#guard-1)
[`SerializedTxGuard`](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
#### Returns
[Section titled “Returns”](#returns-32)
`Promise`<{ `check`: [`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/); `ok`: `true`; } | { `code?`: `string`; `ok`: `false`; `reason`: `string`; }>
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`SimulationResult`](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/)>
Defined in: wallet-solana/src/read-only-account.ts:522
`simulateTransaction` for any accepted input; never throws for an on-chain failure, only for transport errors.
#### Parameters
[Section titled “Parameters”](#parameters-30)
##### tx
[Section titled “tx”](#tx-4)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-33)
`Promise`<[`SimulationResult`](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/)>
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-solana/src/read-only-account.ts:1012
ed25519 over the UTF-8 message; `signature` hex.
#### Parameters
[Section titled “Parameters”](#parameters-31)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-34)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccountReadOnly.verify`
***
### withLookupTables()
[Section titled “withLookupTables()”](#withlookuptables)
> `protected` **withLookupTables**(`msg`, `tables`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:389
Compress a v0 message with the given address lookup tables (fetched from the RPC).
#### Parameters
[Section titled “Parameters”](#parameters-32)
##### msg
[Section titled “msg”](#msg-1)
`TransactionMessage`
##### tables
[Section titled “tables”](#tables-1)
`string`\[] | `undefined`
#### Returns
[Section titled “Returns”](#returns-35)
`Promise`<`TransactionMessage`>
***
### transferFeeFor()
[Section titled “transferFeeFor()”](#transferfeefor)
> `static` **transferFeeFor**(`info`, `amount`): `bigint`
Defined in: wallet-solana/src/read-only-account.ts:256
Token-2022 transfer fee for `amount` under `info` (0 for plain mints).
#### Parameters
[Section titled “Parameters”](#parameters-33)
##### info
[Section titled “info”](#info)
[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)
##### amount
[Section titled “amount”](#amount-1)
`bigint`
#### Returns
[Section titled “Returns”](#returns-36)
`bigint`
# WalletAccountSolana
Defined in: wallet-solana/src/account.ts:34
Signing Solana account. The account never touches a private key: every signature is one `signer.sign(bytes, {scheme: 'ed25519', context})` call over the compiled message bytes — a LocalSigner for seed wallets, anything else (hardware, MPC, backend) through `externalSigner()`. No WebCrypto anywhere, so it runs unchanged in Node and Hermes.
Every broadcast goes through the same plan: hard checks (fee payer, burn address, missing co-signers) → compute budget → simulation → fee guard → sign → send. A failing step throws before the signer is asked for anything.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountSolana**(`signer`, `publicKey`, `path`, `config?`): `WalletAccountSolana`
Defined in: wallet-solana/src/account.ts:51
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`constructor`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_commitment
[Section titled “\_commitment”](#_commitment)
> `protected` `readonly` **\_commitment**: `Commitment`
Defined in: wallet-solana/src/read-only-account.ts:146
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`_commitment`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#_commitment)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)
Defined in: wallet-solana/src/read-only-account.ts:144
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`_config`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#_config)
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: `Rpc`<`SolanaRpcApiForTestClusters`> | `undefined`
Defined in: wallet-solana/src/read-only-account.ts:145
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`_rpc`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#_rpc)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `Address`
Defined in: wallet-solana/src/read-only-account.ts:141
Base58 address.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`address`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#address)
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-solana/src/read-only-account.ts:143
CAIP-2 id of the cluster.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`chain`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#chain)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `true` = `true`
Defined in: wallet-solana/src/account.ts:36
Blockhash and fee come from the network before signing.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-solana/src/account.ts:38
Derivation path, or `external` for an external signer.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-solana/src/account.ts:40
The signer’s 32-byte ed25519 public key (needed synchronously for the address).
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"seed"` | `"key"` | `"external"`
Defined in: wallet-solana/src/account.ts:48
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-solana/src/account.ts:65
Account index for the standard m/44’/501’/i’/0’ path.
##### Returns
[Section titled “Returns”](#returns-1)
`number` | `undefined`
## Methods
[Section titled “Methods”](#methods)
### assertWalletRecipient()
[Section titled “assertWalletRecipient()”](#assertwalletrecipient)
> `protected` **assertWalletRecipient**(`recipient`): `Promise`<`void`>
Defined in: wallet-solana/src/read-only-account.ts:337
A transfer’s recipient must be a wallet (round 3, M10). A token account or a mint as recipient gets an associated token account nobody can sign for, and SOL or tokens sent to a program are lost: an account owned by Token / Token-2022, or an executable one, is refused. An address with no account yet is an ordinary wallet.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### recipient
[Section titled “recipient”](#recipient)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`void`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`assertWalletRecipient`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#assertwalletrecipient)
***
### ata()
[Section titled “ata()”](#ata)
> `protected` **ata**(`mint`, `owner`, `tokenProgram?`): `Promise`<`Address`>
Defined in: wallet-solana/src/read-only-account.ts:262
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### mint
[Section titled “mint”](#mint)
`Address`
##### owner
[Section titled “owner”](#owner)
`Address`
##### tokenProgram?
[Section titled “tokenProgram?”](#tokenprogram)
`Address` = `TOKEN_PROGRAM_ADDRESS`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Address`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`ata`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#ata)
***
### buildNativeTransfer()
[Section titled “buildNativeTransfer()”](#buildnativetransfer)
> `protected` **buildNativeTransfer**(`to`, `value`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:326
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### to
[Section titled “to”](#to)
`string`
##### value
[Section titled “value”](#value)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`TransactionMessage`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`buildNativeTransfer`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#buildnativetransfer)
***
### buildTokenTransfer()
[Section titled “buildTokenTransfer()”](#buildtokentransfer)
> `protected` **buildTokenTransfer**(`token`, `recipient`, `amount`): `Promise`<{ `message`: `TransactionMessage`; `tokenFee`: `bigint`; }>
Defined in: wallet-solana/src/read-only-account.ts:348
SPL / Token-2022 transfer via `transferChecked` (mint + decimals verified on chain); the recipient ATA is created when missing.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token)
`string`
##### recipient
[Section titled “recipient”](#recipient-1)
`string`
##### amount
[Section titled “amount”](#amount)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<{ `message`: `TransactionMessage`; `tokenFee`: `bigint`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`buildTokenTransfer`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#buildtokentransfer)
***
### checkSerialized()
[Section titled “checkSerialized()”](#checkserialized)
> **checkSerialized**(`base64`, `guard`, `options?`): `Promise`<[`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/)>
Defined in: wallet-solana/src/read-only-account.ts:793
Prove what a provider-built transaction does before anyone signs it (see `serialized.ts`). Throws [UnsafeTransactionError](/api/anywalletkit/wallet-solana/classes/unsafetransactionerror/) (allowlist, authority changes, balance violations), [MissingSignersError](/api/anywalletkit/wallet-solana/classes/missingsignerserror/) or [SimulationError](/api/anywalletkit/wallet-solana/classes/simulationerror/); returns the evidence otherwise. Nothing is signed.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### base64
[Section titled “base64”](#base64)
`string`
##### guard
[Section titled “guard”](#guard)
[`SerializedTxGuard`](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
##### options?
[Section titled “options?”](#options)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`checkSerialized`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#checkserialized)
***
### describeTransaction()
[Section titled “describeTransaction()”](#describetransaction)
> **describeTransaction**(`tx`): [`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
Defined in: wallet-solana/src/read-only-account.ts:998
Decode without the network: what the transaction does and what to be wary of.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-7)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`describeTransaction`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#describetransaction)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-solana/src/account.ts:187
Dispose the signer (zeroizes a local key). Idempotent.
#### Returns
[Section titled “Returns”](#returns-8)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### enforce()
[Section titled “enforce()”](#enforce)
> `protected` **enforce**(`description`, `options?`): `void`
Defined in: wallet-solana/src/read-only-account.ts:530
Hard checks shared by every signing path. `options` carries the per-call opt-ins ([SolanaWriteOptions](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/)).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### description
[Section titled “description”](#description)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
##### options?
[Section titled “options?”](#options-1)
###### allowDurableNonce?
[Section titled “allowDurableNonce?”](#allowdurablenonce)
`boolean`
#### Returns
[Section titled “Returns”](#returns-9)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`enforce`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#enforce)
***
### enforceAuthorities()
[Section titled “enforceAuthorities()”](#enforceauthorities)
> `protected` **enforceAuthorities**(`description`): `void`
Defined in: wallet-solana/src/read-only-account.ts:552
The drainer shapes a wallet never signs by default: this wallet’s account reassigned, allocated or created under a program; a nonce, token, metadata or group authority handed away; lamports moved out by an instruction the description does not show as a transfer (a token account closed, excess or wrapped lamports withdrawn, a nonce or seed account emptied) to anyone but this wallet; a token `Batch` (it can carry any of these); an undecodable System / Token instruction. Instructions whose accounts sit in unresolved lookup tables are judged by their identified name (this wallet, a signer, is always a static key). A program this wallet signs for can still do any of this by CPI; `sendSerialized` proves the outcome by simulation instead.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### description
[Section titled “description”](#description-1)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
#### Returns
[Section titled “Returns”](#returns-10)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`enforceAuthorities`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#enforceauthorities)
***
### enforceCompiledSigners()
[Section titled “enforceCompiledSigners()”](#enforcecompiledsigners)
> `protected` **enforceCompiledSigners**(`description`, `options?`): `void`
Defined in: wallet-solana/src/read-only-account.ts:709
Signer checks shared by every compiled-transaction path: this wallet must be a required signer and nobody else may still be missing.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### description
[Section titled “description”](#description-2)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
##### options?
[Section titled “options?”](#options-2)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-11)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`enforceCompiledSigners`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#enforcecompiledsigners)
***
### feeForBase64()
[Section titled “feeForBase64()”](#feeforbase64)
> `protected` **feeForBase64**(`messageBase64`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:981
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### messageBase64
[Section titled “messageBase64”](#messagebase64)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`feeForBase64`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#feeforbase64)
***
### feeForMessage()
[Section titled “feeForMessage()”](#feeformessage)
> `protected` **feeForMessage**(`msg`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:976
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### msg
[Section titled “msg”](#msg)
`TransactionMessage`
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`feeForMessage`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#feeformessage)
***
### getAccountInfos()
[Section titled “getAccountInfos()”](#getaccountinfos)
> **getAccountInfos**(`addresses`): `Promise`<([`SolanaAccountData`](/api/anywalletkit/wallet-solana/interfaces/solanaaccountdata/) | `null`)\[]>
Defined in: wallet-solana/src/read-only-account.ts:767
Raw accounts in the order asked (null where none exists), batched 100 per `getMultipleAccounts`: for modules that check a provider’s figures against the chain state they claim to describe.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### addresses
[Section titled “addresses”](#addresses)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<([`SolanaAccountData`](/api/anywalletkit/wallet-solana/interfaces/solanaaccountdata/) | `null`)\[]>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getAccountInfos`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#getaccountinfos)
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-solana/src/read-only-account.ts:163
The base58 address.
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getAddress`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#getaddress)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:166
Native balance in lamports.
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getBalance`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#getbalance)
***
### getMintInfo()
[Section titled “getMintInfo()”](#getmintinfo)
> **getMintInfo**(`mint`): `Promise`<[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)>
Defined in: wallet-solana/src/read-only-account.ts:174
Mint owner program, decimals and (Token-2022) the transfer fee in force this epoch.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### mint
[Section titled “mint”](#mint-1)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getMintInfo`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#getmintinfo)
***
### getTokenAccountOwner()
[Section titled “getTokenAccountOwner()”](#gettokenaccountowner)
> **getTokenAccountOwner**(`tokenAccount`): `Promise`<`string` | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:201
The owner of a Token / Token-2022 token account — whom an SPL transfer into it pays — or undefined when the address holds no initialized token account (a wallet, a mint, nothing). Network errors throw. The kit’s policies read SPL transfer recipients through it.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### tokenAccount
[Section titled “tokenAccount”](#tokenaccount)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`string` | `undefined`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getTokenAccountOwner`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#gettokenaccountowner)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-solana/src/read-only-account.ts:272
Balance of a mint in this wallet’s associated token account (Token or Token-2022, whichever owns the mint), in base units; 0 when that account does not exist or the address is not a mint. A network error throws: it is never read as a zero balance (round 3, L10).
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getTokenBalance`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#gettokenbalance)
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-solana/src/read-only-account.ts:287
Batched over getMultipleAccounts (100 addresses per call). Both programs’ associated token accounts are read for every mint, so Token-2022 balances count (round 3, L10); the amount comes from the token-account layout (offset 64) of the account that holds that mint.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`Record`<`string`, `bigint`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getTokenBalances`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#gettokenbalances)
***
### getTokenInfo()
[Section titled “getTokenInfo()”](#gettokeninfo)
> **getTokenInfo**(`token`): `Promise`<`TokenInfo`>
Defined in: wallet-solana/src/read-only-account.ts:222
Decimals, symbol, name, supply and the holder-relevant flags of a mint, read from the chain: a live mint or freeze authority, and the Token-2022 extensions that let someone take, tax, hook, freeze or pause holders’ tokens. Name and symbol come from the Token-2022 metadata extension, else from the Metaplex metadata account (“” when there is neither). Throws NotATokenError when the address is not an initialized Token / Token-2022 mint.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### token
[Section titled “token”](#token-2)
`string`
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`TokenInfo`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTokenInfo`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getTokenInfo`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#gettokeninfo)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`SolanaReceipt`](/api/anywalletkit/wallet-solana/interfaces/solanareceipt/) | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:1003
The receipt, or `undefined` while the transaction has not landed.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`SolanaReceipt`](/api/anywalletkit/wallet-solana/interfaces/solanareceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`getTransactionReceipt`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#gettransactionreceipt)
***
### latestBlockhash()
[Section titled “latestBlockhash()”](#latestblockhash)
> `protected` **latestBlockhash**(): `Promise`<`Readonly`<{ }>>
Defined in: wallet-solana/src/read-only-account.ts:311
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`Readonly`<{ }>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`latestBlockhash`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#latestblockhash)
***
### lookupAddresses()
[Section titled “lookupAddresses()”](#lookupaddresses)
> `protected` **lookupAddresses**(`tables`): `Promise`<`Record`<`string`, readonly `string`\[]> | `undefined`>
Defined in: wallet-solana/src/read-only-account.ts:756
Addresses of a lookup-table set, fetched once; `undefined` when the message uses none.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### tables
[Section titled “tables”](#tables)
readonly `string`\[]
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<`Record`<`string`, readonly `string`\[]> | `undefined`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`lookupAddresses`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#lookupaddresses)
***
### plan()
[Section titled “plan()”](#plan)
> `protected` **plan**(`tx`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:960
Plan any accepted input.
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-1)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
##### opts?
[Section titled “opts?”](#opts)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`plan`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#plan)
***
### planCompiled()
[Section titled “planCompiled()”](#plancompiled)
> `protected` **planCompiled**(`input`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:717
Plan a compiled transaction (kit `Transaction` or base64 wire): hard checks, simulation, fee quote. The bytes are never altered.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### input
[Section titled “input”](#input)
`string` | `Readonly`<{ }>
##### opts?
[Section titled “opts?”](#opts-1)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`planCompiled`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#plancompiled)
***
### planMessage()
[Section titled “planMessage()”](#planmessage)
> `protected` **planMessage**(`input`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:664
Plan a message-based transaction: lookup tables, compute budget (priority price + unit limit), simulation and the fee quote. Shared by quote / sign / send so the network is consulted once per fact.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### input
[Section titled “input”](#input-1)
`TransactionMessage`
##### opts?
[Section titled “opts?”](#opts-2)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) & `object` = `{}`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`planMessage`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#planmessage)
***
### planTransfer()
[Section titled “planTransfer()”](#plantransfer)
> `protected` **planTransfer**(`o`, `opts?`): `Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
Defined in: wallet-solana/src/read-only-account.ts:965
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### o
[Section titled “o”](#o)
[`SolanaTransferOptions`](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
##### opts?
[Section titled “opts?”](#opts-3)
[`PlanOptions`](/api/anywalletkit/wallet-solana/interfaces/planoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-28)
`Promise`<[`SolanaPlan`](/api/anywalletkit/wallet-solana/interfaces/solanaplan/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-30)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`planTransfer`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#plantransfer)
***
### prepareMessage()
[Section titled “prepareMessage()”](#preparemessage)
> `protected` **prepareMessage**(`tx`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:372
Normalise `{to, value}` or a kit message into a message with lifetime + this account as fee payer.
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### tx
[Section titled “tx”](#tx-2)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<`TransactionMessage`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-31)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`prepareMessage`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#preparemessage)
***
### quoteCompiled()
[Section titled “quoteCompiled()”](#quotecompiled)
> `protected` **quoteCompiled**(`transaction`, `description`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:736
Fee of a compiled transaction: signatures + the compute budget it carries, floored by the RPC’s own quote.
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### transaction
[Section titled “transaction”](#transaction)
`Transaction`
##### description
[Section titled “description”](#description-3)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-32)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`quoteCompiled`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#quotecompiled)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:988
Full fee breakdown (base + priority, Token-2022 fee for transfers). Simulation runs too, so a reverting tx is reported here.
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### tx
[Section titled “tx”](#tx-3)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-31)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteSendTransaction`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-33)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`quoteSendTransaction`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
Defined in: wallet-solana/src/read-only-account.ts:993
Fee breakdown of a transfer, including the compute budget and any Token-2022 transfer fee.
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### o
[Section titled “o”](#o-1)
[`SolanaTransferOptions`](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
#### Returns
[Section titled “Returns”](#returns-32)
`Promise`<[`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-34)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`quoteTransfer`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#quotetransfer)
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`SolanaRpc`](/api/anywalletkit/wallet-solana/type-aliases/solanarpc/)
Defined in: wallet-solana/src/read-only-account.ts:157
#### Parameters
[Section titled “Parameters”](#parameters-28)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-33)
[`SolanaRpc`](/api/anywalletkit/wallet-solana/type-aliases/solanarpc/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-35)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`requireRpc`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#requirerpc)
***
### sendSerialized()
[Section titled “sendSerialized()”](#sendserialized)
> **sendSerialized**(`base64`, `guard`, `options?`): `Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/) & `object`>
Defined in: wallet-solana/src/account.ts:171
Sign and broadcast a provider-built transaction (base64 wire) after [checkSerialized](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#checkserialized) proved it only does what `guard.expect` allows. Signatures already present (other parties) are preserved. The checked fee is held to the tighter of `transactionMaxFee` and `options.maxFee`.
#### Parameters
[Section titled “Parameters”](#parameters-29)
##### base64
[Section titled “base64”](#base64-1)
`string`
##### guard
[Section titled “guard”](#guard-1)
[`SerializedTxGuard`](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
##### options?
[Section titled “options?”](#options-3)
[`SolanaWriteOptions`](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-34)
`Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/) & `object`>
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/)>
Defined in: wallet-solana/src/account.ts:148
Sign and broadcast.
#### Parameters
[Section titled “Parameters”](#parameters-30)
##### tx
[Section titled “tx”](#tx-4)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
##### options?
[Section titled “options?”](#options-4)
[`SolanaWriteOptions`](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-35)
`Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-solana/src/account.ts:77
Hex ed25519 signature over the raw message bytes (UTF-8 for a string; context `solana-offchain`). Throws [MessageIsTransactionError](/api/anywalletkit/wallet-solana/classes/messageistransactionerror/) when the bytes are a Solana transaction this account would sign for (see `isSolanaTransactionPayload`): that must go through `signTransaction`. On an external signer (`path` ‘external’) a 32-byte message is refused too: the same ed25519 key may also be a TON or NEAR wallet, whose transactions are signed over a 32-byte digest.
#### Parameters
[Section titled “Parameters”](#parameters-31)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-36)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.sign`
***
### signCompiled()
[Section titled “signCompiled()”](#signcompiled)
> **signCompiled**(`tx`, `options?`): `Promise`<`Readonly`<{ }>>
Defined in: wallet-solana/src/account.ts:89
Add this wallet’s signature to a compiled transaction (other signatures are preserved). Runs the same checks as every signing path (round 3): a drainer shape, a burn or a durable nonce is refused unless the config or `options` opt in. No simulation and no fee quote: it is a primitive.
#### Parameters
[Section titled “Parameters”](#parameters-32)
##### tx
[Section titled “tx”](#tx-5)
`Transaction`
##### options?
[Section titled “options?”](#options-5)
[`SolanaWriteOptions`](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-37)
`Promise`<`Readonly`<{ }>>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-solana/src/account.ts:120
Sign without broadcasting. Returns the base64 wire transaction. Simulation still runs (a reverting tx is refused).
#### Parameters
[Section titled “Parameters”](#parameters-33)
##### tx
[Section titled “tx”](#tx-6)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
##### options?
[Section titled “options?”](#options-6)
[`SolanaWriteOptions`](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-38)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.signTransaction`
***
### signTransactionMessage()
[Section titled “signTransactionMessage()”](#signtransactionmessage)
> **signTransactionMessage**(`msg`, `options?`): `Promise`<`Readonly`<{ }>>
Defined in: wallet-solana/src/account.ts:95
Compile and sign a message; returns the kit `Transaction` (for callers that want to inspect or co-sign). Checked like [signCompiled](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/#signcompiled).
#### Parameters
[Section titled “Parameters”](#parameters-34)
##### msg
[Section titled “msg”](#msg-1)
`TransactionMessage`
##### options?
[Section titled “options?”](#options-7)
[`SolanaWriteOptions`](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/) = `{}`
#### Returns
[Section titled “Returns”](#returns-39)
`Promise`<`Readonly`<{ }>>
***
### simulateSerialized()
[Section titled “simulateSerialized()”](#simulateserialized)
> **simulateSerialized**(`base64`, `guard`): `Promise`<{ `check`: [`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/); `ok`: `true`; } | { `code?`: `string`; `ok`: `false`; `reason`: `string`; }>
Defined in: wallet-solana/src/read-only-account.ts:949
[checkSerialized](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#checkserialized) without throwing for a refusal: the check or the reason.
#### Parameters
[Section titled “Parameters”](#parameters-35)
##### base64
[Section titled “base64”](#base64-2)
`string`
##### guard
[Section titled “guard”](#guard-2)
[`SerializedTxGuard`](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/)
#### Returns
[Section titled “Returns”](#returns-40)
`Promise`<{ `check`: [`SerializedCheck`](/api/anywalletkit/wallet-solana/interfaces/serializedcheck/); `ok`: `true`; } | { `code?`: `string`; `ok`: `false`; `reason`: `string`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-36)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`simulateSerialized`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#simulateserialized)
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`SimulationResult`](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/)>
Defined in: wallet-solana/src/read-only-account.ts:522
`simulateTransaction` for any accepted input; never throws for an on-chain failure, only for transport errors.
#### Parameters
[Section titled “Parameters”](#parameters-36)
##### tx
[Section titled “tx”](#tx-7)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
#### Returns
[Section titled “Returns”](#returns-41)
`Promise`<[`SimulationResult`](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-37)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`simulateTransaction`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#simulatetransaction)
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-solana/src/account.ts:181
The same address as a [WalletAccountReadOnlySolana](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).
#### Returns
[Section titled “Returns”](#returns-42)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.toReadOnlyAccount`
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`o`, `writeOptions?`): `Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/)>
Defined in: wallet-solana/src/account.ts:157
SOL (no `token`), SPL or Token-2022 transfer; the recipient’s ATA is created when missing.
#### Parameters
[Section titled “Parameters”](#parameters-37)
##### o
[Section titled “o”](#o-2)
[`SolanaTransferOptions`](/api/anywalletkit/wallet-solana/interfaces/solanatransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-43)
`Promise`<[`SolanaSendResult`](/api/anywalletkit/wallet-solana/interfaces/solanasendresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.transfer`
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-solana/src/read-only-account.ts:1012
ed25519 over the UTF-8 message; `signature` hex.
#### Parameters
[Section titled “Parameters”](#parameters-38)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-44)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-15)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-38)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`verify`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#verify)
***
### withLookupTables()
[Section titled “withLookupTables()”](#withlookuptables)
> `protected` **withLookupTables**(`msg`, `tables`): `Promise`<`TransactionMessage`>
Defined in: wallet-solana/src/read-only-account.ts:389
Compress a v0 message with the given address lookup tables (fetched from the RPC).
#### Parameters
[Section titled “Parameters”](#parameters-39)
##### msg
[Section titled “msg”](#msg-2)
`TransactionMessage`
##### tables
[Section titled “tables”](#tables-1)
`string`\[] | `undefined`
#### Returns
[Section titled “Returns”](#returns-45)
`Promise`<`TransactionMessage`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-39)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`withLookupTables`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#withlookuptables)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`): `WalletAccountSolana`
Defined in: wallet-solana/src/account.ts:60
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
#### Parameters
[Section titled “Parameters”](#parameters-40)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
##### config?
[Section titled “config?”](#config-1)
[`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-46)
`WalletAccountSolana`
***
### transferFeeFor()
[Section titled “transferFeeFor()”](#transferfeefor)
> `static` **transferFeeFor**(`info`, `amount`): `bigint`
Defined in: wallet-solana/src/read-only-account.ts:256
Token-2022 transfer fee for `amount` under `info` (0 for plain mints).
#### Parameters
[Section titled “Parameters”](#parameters-41)
##### info
[Section titled “info”](#info)
[`MintInfo`](/api/anywalletkit/wallet-solana/interfaces/mintinfo/)
##### amount
[Section titled “amount”](#amount-1)
`bigint`
#### Returns
[Section titled “Returns”](#returns-47)
`bigint`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-40)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/).[`transferFeeFor`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/#transferfeefor)
# WalletManagerSolana
Defined in: wallet-solana/src/manager.ts:20
One seed → Solana accounts at m/44’/501’/i’/0’ (SLIP-10 ed25519; Phantom and Solflare default). Paths may be given relative to m/44’/501’ (“0’/0’”) or in full.
Built with an ed25519 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at `m/44'/501'` yields `getAccount(i)` → `i'/0'` children (any path under the signer’s path derives);
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’); other indexes/paths throw `SignerError`.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/), [`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerSolana**(`seedOrSigner`, `config?`): `WalletManagerSolana`
Defined in: wallet-solana/src/manager.ts:21
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerSolana`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/) | `Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
Defined in: wallet-solana/src/manager.ts:26
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
Defined in: wallet-solana/src/manager.ts:30
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-solana/src/manager.ts:64
Max recent prioritization fee (micro-lamports/CU); slow = ×0.8, fast = ×1.2.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`address`): [`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/)
Defined in: wallet-solana/src/manager.ts:59
A read-only account for any address, with this manager’s config.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
[`WalletAccountReadOnlySolana`](/api/anywalletkit/wallet-solana/classes/walletaccountreadonlysolana/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-8)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-9)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-solana/classes/walletmanagersolana/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`WalletAccountSolana`](/api/anywalletkit/wallet-solana/classes/walletaccountsolana/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-solana/classes/walletmanagersolana/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### words?
[Section titled “words?”](#words)
`24` | `12`
#### Returns
[Section titled “Returns”](#returns-11)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-solana/classes/walletmanagersolana/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# addressFromPublicKey
> **addressFromPublicKey**(`publicKey`): `string`
Defined in: wallet-solana/src/account.ts:14
Base58 address of a 32-byte ed25519 public key.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# classifySolanaMessage
> **classifySolanaMessage**(`bytes`, `signer`): [`SolanaMessageKind`](/api/anywalletkit/wallet-solana/type-aliases/solanamessagekind/)
Defined in: wallet-solana/src/offchain.ts:119
Classify bytes a site asks the wallet to sign as a message. Refuse `transaction`; show `text` and `offchain` content; warn on `binary`.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
### signer
[Section titled “signer”](#signer)
`string` | `Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
[`SolanaMessageKind`](/api/anywalletkit/wallet-solana/type-aliases/solanamessagekind/)
# computeUnitLimitFromSimulation
> **computeUnitLimitFromSimulation**(`unitsConsumed`): `number`
Defined in: wallet-solana/src/read-only-account.ts:114
Compute-unit limit from a simulation: ×1.1, clamped.
## Parameters
[Section titled “Parameters”](#parameters)
### unitsConsumed
[Section titled “unitsConsumed”](#unitsconsumed)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`number`
# createRpc
> **createRpc**(`config`): `Rpc`<`SolanaRpcApiForTestClusters`> | `undefined`
Defined in: wallet-solana/src/rpc.ts:84
One Rpc, or a failover Rpc over a list: every `.method(...).send()` walks the list in order until one answers; `retries` extra rounds after the first full pass. A broadcast fails over with the same signed bytes (one signature, so it lands at most once). It is a clean refusal only if every attempt was refused; once one went unanswered the first node may have forwarded it, so the failure is a `NetworkError` the account turns into `BroadcastUnknownError`.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`SolanaConfig`](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/)
## Returns
[Section titled “Returns”](#returns)
`Rpc`<`SolanaRpcApiForTestClusters`> | `undefined`
# createSolanaHistory
> **createSolanaHistory**(`options?`): [`SolanaHistorySource`](/api/anywalletkit/wallet-solana/interfaces/solanahistorysource/)
Defined in: wallet-solana/src/history.ts:396
A `HistorySource` for Solana over JSON-RPC. Pages merge the wallet’s own signatures with those of its token accounts (newest slot first); the cursor holds one `before` signature per list, so pagination is exact even when a transaction touches several of them.
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`SolanaHistoryOptions`](/api/anywalletkit/wallet-solana/interfaces/solanahistoryoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`SolanaHistorySource`](/api/anywalletkit/wallet-solana/interfaces/solanahistorysource/)
# decodeHistoryCursor
> **decodeHistoryCursor**(`s`): [`PageCursor`](/api/anywalletkit/wallet-solana/interfaces/pagecursor/)
Defined in: wallet-solana/src/history.ts:201
Decode a cursor made by `encodeHistoryCursor`; throws on anything else.
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
[`PageCursor`](/api/anywalletkit/wallet-solana/interfaces/pagecursor/)
# decodeStakeInstruction
> **decodeStakeInstruction**(`data`, `accounts`): [`StakeInstructionDetails`](/api/anywalletkit/wallet-solana/interfaces/stakeinstructiondetails/) | `undefined`
Defined in: wallet-solana/src/describe.ts:79
A Stake instruction’s name and what it sets, or undefined when the data does not decode. The `Checked` forms name accounts by position, and the program takes two layouts: the legacy one with sysvars (`[stake, clock, authority, new]`, `[stake, rent, staker, withdrawer]`) and the current one without (`[stake, authority, new]`, `[stake, staker, withdrawer]`).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
### accounts
[Section titled “accounts”](#accounts)
readonly (`string` | `null`)\[]
## Returns
[Section titled “Returns”](#returns)
[`StakeInstructionDetails`](/api/anywalletkit/wallet-solana/interfaces/stakeinstructiondetails/) | `undefined`
# decodeWireTransaction
> **decodeWireTransaction**(`base64`): `Transaction`
Defined in: wallet-solana/src/describe.ts:213
Decode a base64 wire transaction into a kit `Transaction`.
## Parameters
[Section titled “Parameters”](#parameters)
### base64
[Section titled “base64”](#base64)
`string`
## Returns
[Section titled “Returns”](#returns)
`Transaction`
# describeTransaction
> **describeTransaction**(`tx`, `ctx?`): [`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
Defined in: wallet-solana/src/describe.ts:343
Decode any transaction the account accepts (transfer, message, compiled, base64) for a confirmation screen: kind, instructions and warnings. Pass the signing `account` to get fee-payer and missing-signer warnings.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`SolanaTransaction`](/api/anywalletkit/wallet-solana/type-aliases/solanatransaction/)
### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-solana/interfaces/describecontext/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
# encodeHistoryCursor
> **encodeHistoryCursor**(`c`): `string`
Defined in: wallet-solana/src/history.ts:196
Encode a history page cursor.
## Parameters
[Section titled “Parameters”](#parameters)
### c
[Section titled “c”](#c)
[`PageCursor`](/api/anywalletkit/wallet-solana/interfaces/pagecursor/)
## Returns
[Section titled “Returns”](#returns)
`string`
# hasSolanaOffchainHeader
> **hasSolanaOffchainHeader**(`bytes`): `boolean`
Defined in: wallet-solana/src/offchain.ts:72
True when the bytes start with the Solana off-chain message header (`\xffsolana offchain`).
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# historyCallOf
> **historyCallOf**(`tx`): `ChainCall` | `undefined`
Defined in: wallet-solana/src/history.ts:338
Top-level instruction program ids, then inner ones; `to` = the first program that is not plumbing; `data` = that program’s first instruction data (base58).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`ParsedTransaction`](/api/anywalletkit/wallet-solana/interfaces/parsedtransaction/)
## Returns
[Section titled “Returns”](#returns)
`ChainCall` | `undefined`
# historyNativeTransfers
> **historyNativeTransfers**(`tx`): `ChainTransfer`\[]
Defined in: wallet-solana/src/history.ts:284
Native SOL movements from the lamport deltas, fee added back to the payer so sends match what the user typed.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`ParsedTransaction`](/api/anywalletkit/wallet-solana/interfaces/parsedtransaction/)
## Returns
[Section titled “Returns”](#returns)
`ChainTransfer`\[]
# historyTokenTransfers
> **historyTokenTransfers**(`tx`): `ChainTransfer`\[]
Defined in: wallet-solana/src/history.ts:300
SPL / Token-2022 movements per mint from the token balance deltas, attributed to the token accounts’ owners.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`ParsedTransaction`](/api/anywalletkit/wallet-solana/interfaces/parsedtransaction/)
## Returns
[Section titled “Returns”](#returns)
`ChainTransfer`\[]
# isNativeMint
> **isNativeMint**(`mint`): `boolean`
Defined in: wallet-solana/src/serialized.ts:243
True for every spelling of native SOL: the System program id, `0x0…`, or the wSOL mint.
## Parameters
[Section titled “Parameters”](#parameters)
### mint
[Section titled “mint”](#mint)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isNativeTransfer
> **isNativeTransfer**(`tx`): `tx is SolanaNativeTransfer`
Defined in: wallet-solana/src/guards.ts:8
Type guard: a [SolanaNativeTransfer](/api/anywalletkit/wallet-solana/interfaces/solananativetransfer/) object.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`tx is SolanaNativeTransfer`
# isReadableText
> **isReadableText**(`bytes`): `boolean`
Defined in: wallet-solana/src/offchain.ts:100
Readable text: valid UTF-8 with no control characters other than tab, LF and CR.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isSignedTransaction
> **isSignedTransaction**(`tx`): `tx is Readonly<{}>`
Defined in: wallet-solana/src/guards.ts:5
A compiled kit `Transaction` (signatures may still be null).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`tx is Readonly<{}>`
# isSolanaTransactionPayload
> **isSolanaTransactionPayload**(`bytes`, `signer`): `boolean`
Defined in: wallet-solana/src/offchain.ts:63
True when `bytes` are a legacy / v0 / v1 compiled transaction message, or a wire transaction, that decodes exactly and lists `signer` (32-byte public key or base58 address) among its required signers. Such bytes must never be signed as an off-chain message.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
### signer
[Section titled “signer”](#signer)
`string` | `Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isTransactionMessage
> **isTransactionMessage**(`tx`): `tx is TransactionMessage`
Defined in: wallet-solana/src/guards.ts:11
Type guard: a `@solana/kit` transaction message (not yet compiled).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`tx is TransactionMessage`
# mapHistoryTransaction
> **mapHistoryTransaction**(`chain`, `address`, `row`, `tx`): [`SolanaChainTx`](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/)
Defined in: wallet-solana/src/history.ts:355
Build a `ChainTx` from a signature row and its jsonParsed `getTransaction` result (or `null` when the node no longer has it).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### row
[Section titled “row”](#row)
[`SignatureRow`](/api/anywalletkit/wallet-solana/interfaces/signaturerow/)
### tx
[Section titled “tx”](#tx)
[`ParsedTransaction`](/api/anywalletkit/wallet-solana/interfaces/parsedtransaction/) | `null`
## Returns
[Section titled “Returns”](#returns)
[`SolanaChainTx`](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/)
# parseTokenAccount
> **parseTokenAccount**(`data`): [`ParsedTokenAccount`](/api/anywalletkit/wallet-solana/interfaces/parsedtokenaccount/) | `null`
Defined in: wallet-solana/src/serialized.ts:281
Read mint, owner and amount from a token account’s data; `null` when it is too short to be one.
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`ParsedTokenAccount`](/api/anywalletkit/wallet-solana/interfaces/parsedtokenaccount/) | `null`
# pickPriorityPrice
> **pickPriorityPrice**(`fees`, `min`, `max`): `bigint`
Defined in: wallet-solana/src/read-only-account.ts:101
`getRecentPrioritizationFees` percentile (75th) over the given accounts, clamped to the configured range.
## Parameters
[Section titled “Parameters”](#parameters)
### fees
[Section titled “fees”](#fees)
readonly (`number` | `bigint`)\[]
### min
[Section titled “min”](#min)
`bigint`
### max
[Section titled “max”](#max)
`bigint`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# resolveCompiledAccounts
> **resolveCompiledAccounts**(`tx`, `ctx?`): [`CompiledAccounts`](/api/anywalletkit/wallet-solana/interfaces/compiledaccounts/)
Defined in: wallet-solana/src/describe.ts:174
The accounts a compiled transaction loads, in order, with roles. Lookup-table accounts resolve through `ctx` or come back as `null`, with `unresolved` set.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`Transaction`
### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-solana/interfaces/describecontext/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`CompiledAccounts`](/api/anywalletkit/wallet-solana/interfaces/compiledaccounts/)
# solanaExplorerTxUrl
> **solanaExplorerTxUrl**(`hash`, `network?`): `string`
Defined in: wallet-solana/src/history.ts:386
Solscan link for a transaction on the given cluster.
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### network?
[Section titled “network?”](#network)
`"mainnet"` | `"devnet"` | `"testnet"`
## Returns
[Section titled “Returns”](#returns)
`string`
# unexpectedInstruction
> **unexpectedInstruction**(`compiled`, `accounts`, `rules`): { `data`: `string`; `index`: `number`; `program`: `string`; } | `undefined`
Defined in: wallet-solana/src/serialized.ts:206
The first top-level instruction no rule allows, or undefined when every one matches. Instructions are read from the compiled message with lookup-table accounts resolved (`resolveCompiledAccounts`).
## Parameters
[Section titled “Parameters”](#parameters)
### compiled
[Section titled “compiled”](#compiled)
#### instructions
[Section titled “instructions”](#instructions)
readonly `object`\[]
### accounts
[Section titled “accounts”](#accounts)
readonly `object`\[]
### rules
[Section titled “rules”](#rules)
readonly [`SerializedInstructionRule`](/api/anywalletkit/wallet-solana/interfaces/serializedinstructionrule/)\[]
## Returns
[Section titled “Returns”](#returns)
{ `data`: `string`; `index`: `number`; `program`: `string`; } | `undefined`
# CompiledAccounts
Defined in: wallet-solana/src/describe.ts:162
The accounts a compiled message loads, in message order, with roles; lookups resolve through `ctx` or come back as `null`.
## Properties
[Section titled “Properties”](#properties)
### accounts
[Section titled “accounts”](#accounts)
> **accounts**: `object`\[]
Defined in: wallet-solana/src/describe.ts:164
#### address
[Section titled “address”](#address)
> **address**: `string` | `null`
#### role
[Section titled “role”](#role)
> **role**: `AccountRole`
***
### compiled
[Section titled “compiled”](#compiled)
> **compiled**: [`CompiledMessage`](/api/anywalletkit/wallet-solana/interfaces/compiledmessage/)
Defined in: wallet-solana/src/describe.ts:163
***
### tables
[Section titled “tables”](#tables)
> **tables**: `Address`\[]
Defined in: wallet-solana/src/describe.ts:166
Lookup tables the message references (empty for legacy).
***
### unresolved
[Section titled “unresolved”](#unresolved)
> **unresolved**: `boolean`
Defined in: wallet-solana/src/describe.ts:167
# CompiledMessage
Defined in: wallet-solana/src/describe.ts:153
## Properties
[Section titled “Properties”](#properties)
### addressTableLookups?
[Section titled “addressTableLookups?”](#addresstablelookups)
> `optional` **addressTableLookups?**: `object`\[]
Defined in: wallet-solana/src/describe.ts:158
#### lookupTableAddress
[Section titled “lookupTableAddress”](#lookuptableaddress)
> **lookupTableAddress**: `Address`
#### readonlyIndexes
[Section titled “readonlyIndexes”](#readonlyindexes)
> **readonlyIndexes**: `number`\[]
#### writableIndexes
[Section titled “writableIndexes”](#writableindexes)
> **writableIndexes**: `number`\[]
***
### header
[Section titled “header”](#header)
> **header**: `object`
Defined in: wallet-solana/src/describe.ts:155
#### numReadonlyNonSignerAccounts
[Section titled “numReadonlyNonSignerAccounts”](#numreadonlynonsigneraccounts)
> **numReadonlyNonSignerAccounts**: `number`
#### numReadonlySignerAccounts
[Section titled “numReadonlySignerAccounts”](#numreadonlysigneraccounts)
> **numReadonlySignerAccounts**: `number`
#### numSignerAccounts
[Section titled “numSignerAccounts”](#numsigneraccounts)
> **numSignerAccounts**: `number`
***
### instructions
[Section titled “instructions”](#instructions)
> **instructions**: `object`\[]
Defined in: wallet-solana/src/describe.ts:157
#### accountIndices?
[Section titled “accountIndices?”](#accountindices)
> `optional` **accountIndices?**: `number`\[]
#### data?
[Section titled “data?”](#data)
> `optional` **data?**: `Uint8Array`<`ArrayBufferLike`>
#### programAddressIndex
[Section titled “programAddressIndex”](#programaddressindex)
> **programAddressIndex**: `number`
***
### staticAccounts
[Section titled “staticAccounts”](#staticaccounts)
> **staticAccounts**: `Address`\[]
Defined in: wallet-solana/src/describe.ts:156
***
### version
[Section titled “version”](#version)
> **version**: `0` | `"legacy"` | `1`
Defined in: wallet-solana/src/describe.ts:154
# DescribeContext
Defined in: wallet-solana/src/describe.ts:131
## Properties
[Section titled “Properties”](#properties)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: `string`
Defined in: wallet-solana/src/describe.ts:133
The signing account — enables `foreign-fee-payer` / `missing-signers` checks.
***
### addressesByLookupTableAddress?
[Section titled “addressesByLookupTableAddress?”](#addressesbylookuptableaddress)
> `optional` **addressesByLookupTableAddress?**: `Record`<`string`, readonly `string`\[]>
Defined in: wallet-solana/src/describe.ts:135
Resolved lookup tables (`{tableAddress: [addresses]}`) so v0 lookups decode fully.
# MintInfo
Defined in: wallet-solana/src/read-only-account.ts:82
Mint facts a token transfer needs; one `getAccountInfo` + (for fee mints) one `getEpochInfo`.
## Properties
[Section titled “Properties”](#properties)
### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
Defined in: wallet-solana/src/read-only-account.ts:84
***
### program
[Section titled “program”](#program)
> **program**: `Address`
Defined in: wallet-solana/src/read-only-account.ts:83
***
### transferFee?
[Section titled “transferFee?”](#transferfee)
> `optional` **transferFee?**: `object`
Defined in: wallet-solana/src/read-only-account.ts:86
Token-2022 TransferFee extension, resolved for the current epoch; undefined for plain mints.
#### basisPoints
[Section titled “basisPoints”](#basispoints)
> **basisPoints**: `number`
#### maximumFee
[Section titled “maximumFee”](#maximumfee)
> **maximumFee**: `bigint`
# PageCursor
Defined in: wallet-solana/src/history.ts:162
## Properties
[Section titled “Properties”](#properties)
### l
[Section titled “l”](#l)
> **l**: `Record`<`string`, `string` | `null`>
Defined in: wallet-solana/src/history.ts:165
list address → `before` signature; `null` = exhausted.
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: wallet-solana/src/history.ts:163
# ParsedInstruction
Defined in: wallet-solana/src/history.ts:124
## Properties
[Section titled “Properties”](#properties)
### accounts?
[Section titled “accounts?”](#accounts)
> `optional` **accounts?**: `string`\[]
Defined in: wallet-solana/src/history.ts:129
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: wallet-solana/src/history.ts:128
***
### parsed?
[Section titled “parsed?”](#parsed)
> `optional` **parsed?**: `unknown`
Defined in: wallet-solana/src/history.ts:127
***
### program?
[Section titled “program?”](#program)
> `optional` **program?**: `string`
Defined in: wallet-solana/src/history.ts:126
***
### programId
[Section titled “programId”](#programid)
> **programId**: `string`
Defined in: wallet-solana/src/history.ts:125
# ParsedTokenAccount
Defined in: wallet-solana/src/serialized.ts:249
The fixed fields of an SPL / Token-2022 token account.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-solana/src/serialized.ts:252
***
### closeAuthority
[Section titled “closeAuthority”](#closeauthority)
> **closeAuthority**: `Uint8Array`<`ArrayBufferLike`> | `null`
Defined in: wallet-solana/src/serialized.ts:258
COption at offset 129: who may close the account, if not the owner.
***
### delegate
[Section titled “delegate”](#delegate)
> **delegate**: `Uint8Array`<`ArrayBufferLike`> | `null`
Defined in: wallet-solana/src/serialized.ts:254
COption at offset 72: the account’s current delegate, if any.
***
### delegatedAmount
[Section titled “delegatedAmount”](#delegatedamount)
> **delegatedAmount**: `bigint`
Defined in: wallet-solana/src/serialized.ts:256
u64 at offset 121: what that delegate may still pull.
***
### mint
[Section titled “mint”](#mint)
> **mint**: `Uint8Array`
Defined in: wallet-solana/src/serialized.ts:250
***
### owner
[Section titled “owner”](#owner)
> **owner**: `Uint8Array`
Defined in: wallet-solana/src/serialized.ts:251
# ParsedTransaction
Defined in: wallet-solana/src/history.ts:140
## Properties
[Section titled “Properties”](#properties)
### blockTime?
[Section titled “blockTime?”](#blocktime)
> `optional` **blockTime?**: `number` | `null`
Defined in: wallet-solana/src/history.ts:142
***
### meta
[Section titled “meta”](#meta)
> **meta**: { `err`: `unknown`; `fee`: `number`; `innerInstructions?`: `object`\[] | `null`; `logMessages?`: `string`\[] | `null`; `postBalances`: `number`\[]; `postTokenBalances?`: [`TokenBalance`](/api/anywalletkit/wallet-solana/interfaces/tokenbalance/)\[] | `null`; `preBalances`: `number`\[]; `preTokenBalances?`: [`TokenBalance`](/api/anywalletkit/wallet-solana/interfaces/tokenbalance/)\[] | `null`; } | `null`
Defined in: wallet-solana/src/history.ts:148
***
### slot
[Section titled “slot”](#slot)
> **slot**: `number`
Defined in: wallet-solana/src/history.ts:141
***
### transaction
[Section titled “transaction”](#transaction)
> **transaction**: `object`
Defined in: wallet-solana/src/history.ts:144
#### message
[Section titled “message”](#message)
> **message**: `object`
##### message.accountKeys
[Section titled “message.accountKeys”](#messageaccountkeys)
> **accountKeys**: (`string` | { `pubkey`: `string`; })\[]
##### message.instructions
[Section titled “message.instructions”](#messageinstructions)
> **instructions**: [`ParsedInstruction`](/api/anywalletkit/wallet-solana/interfaces/parsedinstruction/)\[]
#### signatures
[Section titled “signatures”](#signatures)
> **signatures**: `string`\[]
***
### version?
[Section titled “version?”](#version)
> `optional` **version?**: `unknown`
Defined in: wallet-solana/src/history.ts:143
# PlanOptions
Defined in: wallet-solana/src/read-only-account.ts:47
What a plan may be told per call: skip simulation, sign a durable-nonce transaction (round 3, M9).
## Properties
[Section titled “Properties”](#properties)
### allowDurableNonce?
[Section titled “allowDurableNonce?”](#allowdurablenonce)
> `optional` **allowDurableNonce?**: `boolean`
Defined in: wallet-solana/src/read-only-account.ts:47
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-solana/src/read-only-account.ts:47
# PriorityFeeConfig
Defined in: wallet-solana/src/types.ts:13
Compute-budget policy. `'auto'` (the default whenever a provider is configured) prices the transaction from `getRecentPrioritizationFees` over its writable accounts and sizes the compute-unit limit from a simulation. Explicit values are used verbatim.
## Properties
[Section titled “Properties”](#properties)
### computeUnitLimit?
[Section titled “computeUnitLimit?”](#computeunitlimit)
> `optional` **computeUnitLimit?**: `number` | `"auto"`
Defined in: wallet-solana/src/types.ts:17
Compute-unit limit.
***
### microLamports?
[Section titled “microLamports?”](#microlamports)
> `optional` **microLamports?**: `number` | `bigint` | `"auto"`
Defined in: wallet-solana/src/types.ts:15
Micro-lamports per compute unit.
# SeedAccountDetails
Defined in: wallet-solana/src/types.ts:211
System `AllocateWithSeed` / `AssignWithSeed`: the seed account’s base, seed and new owner.
## Properties
[Section titled “Properties”](#properties)
### base
[Section titled “base”](#base)
> **base**: `string`
Defined in: wallet-solana/src/types.ts:211
***
### owner
[Section titled “owner”](#owner)
> **owner**: `string`
Defined in: wallet-solana/src/types.ts:211
***
### seed
[Section titled “seed”](#seed)
> **seed**: `string`
Defined in: wallet-solana/src/types.ts:211
***
### space?
[Section titled “space?”](#space)
> `optional` **space?**: `bigint`
Defined in: wallet-solana/src/types.ts:211
# SerializedCheck
Defined in: wallet-solana/src/serialized.ts:228
What the guard proved before signing.
## Properties
[Section titled “Properties”](#properties)
### description
[Section titled “description”](#description)
> **description**: [`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
Defined in: wallet-solana/src/serialized.ts:229
***
### lamportsDelta
[Section titled “lamportsDelta”](#lamportsdelta)
> **lamportsDelta**: `bigint`
Defined in: wallet-solana/src/serialized.ts:233
post − pre native SOL of the wallet (negative = spent), fee included: its lamports plus the wrapped SOL in token accounts it owns.
***
### quote
[Section titled “quote”](#quote)
> **quote**: [`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)
Defined in: wallet-solana/src/serialized.ts:231
***
### simulation
[Section titled “simulation”](#simulation)
> **simulation**: `object`
Defined in: wallet-solana/src/serialized.ts:230
#### logs
[Section titled “logs”](#logs)
> **logs**: readonly `string`\[]
#### ok
[Section titled “ok”](#ok)
> **ok**: `true`
#### unitsConsumed
[Section titled “unitsConsumed”](#unitsconsumed)
> **unitsConsumed**: `bigint`
***
### tokenInDelta
[Section titled “tokenInDelta”](#tokenindelta)
> **tokenInDelta**: `bigint` | `undefined`
Defined in: wallet-solana/src/serialized.ts:235
post − pre of the expected token across the wallet’s ATAs (undefined without `tokenIn` or for native).
***
### tokenOutDelta
[Section titled “tokenOutDelta”](#tokenoutdelta)
> **tokenOutDelta**: `bigint` | `undefined`
Defined in: wallet-solana/src/serialized.ts:237
post − pre of the token the wallet may send (undefined without `maxTokenOut`).
***
### watched
[Section titled “watched”](#watched)
> **watched**: readonly `string`\[]
Defined in: wallet-solana/src/serialized.ts:239
Accounts whose pre/post state was compared.
# SerializedExpectation
Defined in: wallet-solana/src/serialized.ts:112
What the caller expects the transaction to do with this wallet’s balances. Every bound is a non-negative bigint; anything else is refused before the network is consulted (a negative minimum would read as permission to lose that much — scan 2026-10-27 modules, F10/F11).
## Properties
[Section titled “Properties”](#properties)
### maxLamportsOut
[Section titled “maxLamportsOut”](#maxlamportsout)
> **maxLamportsOut**: `bigint`
Defined in: wallet-solana/src/serialized.ts:114
Most lamports the wallet may lose, fee excluded (the swap input for a SOL source; rent/fee slack for a token source).
***
### maxTokenOut?
[Section titled “maxTokenOut?”](#maxtokenout)
> `optional` **maxTokenOut?**: `object`
Defined in: wallet-solana/src/serialized.ts:122
Token the wallet may SEND and the most it may lose of it (the swap input for a token source).
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### mint
[Section titled “mint”](#mint)
> **mint**: `string`
***
### tokenIn?
[Section titled “tokenIn?”](#tokenin)
> `optional` **tokenIn?**: `object`
Defined in: wallet-solana/src/serialized.ts:120
Token the wallet must RECEIVE (same-chain swaps): the mint and the quoted minimum. Native SOL is `11111111111111111111111111111111`, `0x0…` or the wSOL mint. `maxAmount`, when set, is the most it may receive: a builder that hands over more than was asked did something else (a bigger borrow).
#### maxAmount?
[Section titled “maxAmount?”](#maxamount)
> `optional` **maxAmount?**: `bigint`
#### minAmount
[Section titled “minAmount”](#minamount)
> **minAmount**: `bigint`
#### mint
[Section titled “mint”](#mint-1)
> **mint**: `string`
# SerializedInstructionRule
Defined in: wallet-solana/src/serialized.ts:130
One instruction shape a provider transaction may carry (see [SerializedTxGuard.instructions](/api/anywalletkit/wallet-solana/interfaces/serializedtxguard/#instructions)): the program, the first bytes of its data (an Anchor discriminator, an SPL tag), and the accounts it must pass at given positions.
## Properties
[Section titled “Properties”](#properties)
### accounts?
[Section titled “accounts?”](#accounts)
> `optional` **accounts?**: `Readonly`<`Record`<`number`, `string` | readonly `string`\[]>>
Defined in: wallet-solana/src/serialized.ts:138
Accounts by position in the instruction: this address, or one of these. Lookup-table accounts are resolved first.
***
### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Defined in: wallet-solana/src/serialized.ts:134
Hex the instruction data starts with (case-insensitive); omitted = any data.
***
### dataLength?
[Section titled “dataLength?”](#datalength)
> `optional` **dataLength?**: `number`
Defined in: wallet-solana/src/serialized.ts:136
Exact length of the instruction data in bytes, for fixed layouts.
***
### program
[Section titled “program”](#program)
> **program**: `string`
Defined in: wallet-solana/src/serialized.ts:132
Program the instruction calls.
# SerializedTxGuard
Defined in: wallet-solana/src/serialized.ts:141
## Properties
[Section titled “Properties”](#properties)
### allowUnknownPrograms?
[Section titled “allowUnknownPrograms?”](#allowunknownprograms)
> `optional` **allowUnknownPrograms?**: `boolean`
Defined in: wallet-solana/src/serialized.ts:145
Skip the allowlist (NOT the balance checks).
***
### expect
[Section titled “expect”](#expect)
> **expect**: [`SerializedExpectation`](/api/anywalletkit/wallet-solana/interfaces/serializedexpectation/)
Defined in: wallet-solana/src/serialized.ts:154
What the transaction may do to the wallet’s balances.
***
### instructions?
[Section titled “instructions?”](#instructions)
> `optional` **instructions?**: readonly [`SerializedInstructionRule`](/api/anywalletkit/wallet-solana/interfaces/serializedinstructionrule/)\[]
Defined in: wallet-solana/src/serialized.ts:152
Every top-level instruction must match one of these rules, or the transaction is refused (`unexpected-instruction`). For callers that know the exact instructions an operation takes — a lending deposit, say — where an extra withdrawal plus a transfer signed by the same key would otherwise pass as long as the net balances hold (scan 2026-10-27 modules, F1).
***
### programAllowlist?
[Section titled “programAllowlist?”](#programallowlist)
> `optional` **programAllowlist?**: readonly `string`\[]
Defined in: wallet-solana/src/serialized.ts:143
Program ids the transaction may invoke. Default [DEFAULT_PROGRAM_ALLOWLIST](/api/anywalletkit/wallet-solana/variables/default_program_allowlist/).
# SignatureRow
Defined in: wallet-solana/src/history.ts:116
A `getSignaturesForAddress` row.
## Properties
[Section titled “Properties”](#properties)
### blockTime?
[Section titled “blockTime?”](#blocktime)
> `optional` **blockTime?**: `number` | `null`
Defined in: wallet-solana/src/history.ts:119
***
### err?
[Section titled “err?”](#err)
> `optional` **err?**: `unknown`
Defined in: wallet-solana/src/history.ts:120
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string` | `null`
Defined in: wallet-solana/src/history.ts:121
***
### signature
[Section titled “signature”](#signature)
> **signature**: `string`
Defined in: wallet-solana/src/history.ts:117
***
### slot
[Section titled “slot”](#slot)
> **slot**: `number`
Defined in: wallet-solana/src/history.ts:118
# SolanaAccountData
Defined in: wallet-solana/src/serialized.ts:158
An account as `getMultipleAccounts` returns it: owner program, lamports and raw data.
## Properties
[Section titled “Properties”](#properties)
### data
[Section titled “data”](#data)
> **data**: `Uint8Array`
Defined in: wallet-solana/src/serialized.ts:161
***
### lamports
[Section titled “lamports”](#lamports)
> **lamports**: `bigint`
Defined in: wallet-solana/src/serialized.ts:160
***
### owner
[Section titled “owner”](#owner)
> **owner**: `string`
Defined in: wallet-solana/src/serialized.ts:159
# SolanaChainTx
Defined in: wallet-solana/src/history.ts:55
A `ChainTx` with the raw RPC rows it was built from.
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`SolanaHistoryRaw`](/api/anywalletkit/wallet-solana/interfaces/solanahistoryraw/)
Defined in: wallet-solana/src/history.ts:56
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# SolanaConfig
Defined in: wallet-solana/src/types.ts:24
Options for a Solana wallet manager or account: endpoints, network, fee caps, compute budget and the pre-sign checks.
## Properties
[Section titled “Properties”](#properties)
### allowAuthorityChanges?
[Section titled “allowAuthorityChanges?”](#allowauthoritychanges)
> `optional` **allowAuthorityChanges?**: `boolean`
Defined in: wallet-solana/src/types.ts:61
Sign transactions that reassign, allocate or create this wallet’s account under a program, hand away a nonce / token / metadata / group authority, run a token `Batch`, move lamports to someone else with an instruction that is not a visible transfer (`CloseAccount`, `WithdrawExcessLamports`, `UnwrapLamports`, `WithdrawNonceAccount`, `TransferSolWithSeed`), or carry an undecodable System / Token instruction (default false). Applies to `sendTransaction` / `signTransaction`; `sendSerialized` refuses them regardless.
***
### allowBurn?
[Section titled “allowBurn?”](#allowburn)
> `optional` **allowBurn?**: `boolean`
Defined in: wallet-solana/src/types.ts:52
Allow transfers to the System program / all-zero address (default false).
***
### allowDurableNonce?
[Section titled “allowDurableNonce?”](#allowdurablenonce)
> `optional` **allowDurableNonce?**: `boolean`
Defined in: wallet-solana/src/types.ts:67
Sign durable-nonce transactions (first instruction `AdvanceNonceAccount`), whose signature never expires: whoever holds it can broadcast it at any later time (default false). Can also be given per call in [SolanaWriteOptions](/api/anywalletkit/wallet-solana/interfaces/solanawriteoptions/).
***
### allowForeignFeePayer?
[Section titled “allowForeignFeePayer?”](#allowforeignfeepayer)
> `optional` **allowForeignFeePayer?**: `boolean`
Defined in: wallet-solana/src/types.ts:50
Sign provider transactions whose fee payer is not this wallet (default false).
***
### commitment?
[Section titled “commitment?”](#commitment)
> `optional` **commitment?**: `Commitment`
Defined in: wallet-solana/src/types.ts:30
Commitment for reads and confirmations. Default `confirmed`.
***
### maxPriorityMicroLamports?
[Section titled “maxPriorityMicroLamports?”](#maxprioritymicrolamports)
> `optional` **maxPriorityMicroLamports?**: `number` | `bigint`
Defined in: wallet-solana/src/types.ts:46
Cap for the auto priority price (micro-lamports/CU, default 5_000_000).
***
### minPriorityMicroLamports?
[Section titled “minPriorityMicroLamports?”](#minprioritymicrolamports)
> `optional` **minPriorityMicroLamports?**: `number` | `bigint`
Defined in: wallet-solana/src/types.ts:44
Floor for the auto priority price (micro-lamports/CU, default 0).
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
Defined in: wallet-solana/src/types.ts:40
CAIP-2 network suffix; default mainnet genesis hash.
***
### priorityFee?
[Section titled “priorityFee?”](#priorityfee)
> `optional` **priorityFee?**: `false` | [`PriorityFeeConfig`](/api/anywalletkit/wallet-solana/interfaces/priorityfeeconfig/)
Defined in: wallet-solana/src/types.ts:42
Compute-budget policy; default `{microLamports: 'auto', computeUnitLimit: 'auto'}` with a provider. `false` = no compute-budget instructions.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: `string` | `Rpc`<`SolanaRpcApiForTestClusters`> | (`string` | `Rpc`<`SolanaRpcApiForTestClusters`>)\[]
Defined in: wallet-solana/src/types.ts:26
RPC url(s) or ready `Rpc` object(s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-solana/src/types.ts:32
Extra attempts across the provider list after the first failure (default 3).
***
### rpcUrl?
[Section titled “rpcUrl?”](#rpcurl)
> `optional` **rpcUrl?**: `string` | `string`\[]
Defined in: wallet-solana/src/types.ts:28
Alias of `provider`.
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-solana/src/types.ts:48
Run `simulateTransaction` before signing a broadcast (default true with a provider). A failed simulation throws before anything is signed.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-solana/src/types.ts:34
Per-request timeout for url providers, in ms (default 15 000). A send that times out is a `BroadcastUnknownError`.
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-solana/src/types.ts:38
Max fee (lamports, priority fee included) for `sendTransaction` / `signTransaction`.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-solana/src/types.ts:36
Max fee (lamports, priority fee included) for `transfer`.
# SolanaFeeQuote
Defined in: wallet-solana/src/types.ts:123
Fee breakdown; `fee` is what the max-fee guards compare against.
## Properties
[Section titled “Properties”](#properties)
### baseFee
[Section titled “baseFee”](#basefee)
> **baseFee**: `bigint`
Defined in: wallet-solana/src/types.ts:127
Signature fees (5 000 lamports × signers).
***
### computeUnitLimit
[Section titled “computeUnitLimit”](#computeunitlimit)
> **computeUnitLimit**: `number` | `undefined`
Defined in: wallet-solana/src/types.ts:133
Compute-unit limit actually set, undefined when disabled.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-solana/src/types.ts:125
Total fee in lamports: base plus priority.
***
### microLamports
[Section titled “microLamports”](#microlamports)
> **microLamports**: `bigint`
Defined in: wallet-solana/src/types.ts:131
Micro-lamports per CU actually set, 0 when disabled.
***
### priorityFee
[Section titled “priorityFee”](#priorityfee)
> **priorityFee**: `bigint`
Defined in: wallet-solana/src/types.ts:129
Compute-budget priority fee in lamports (`limit × price / 1e6`, rounded up).
***
### tokenFee?
[Section titled “tokenFee?”](#tokenfee)
> `optional` **tokenFee?**: `bigint`
Defined in: wallet-solana/src/types.ts:135
Token-2022 transfer fee withheld by the mint, in token base units (transfers only).
# SolanaHistoryOptions
Defined in: wallet-solana/src/history.ts:25
Options for [createSolanaHistory](/api/anywalletkit/wallet-solana/functions/createsolanahistory/).
## Properties
[Section titled “Properties”](#properties)
### batchSize?
[Section titled “batchSize?”](#batchsize)
> `optional` **batchSize?**: `number`
Defined in: wallet-solana/src/history.ts:39
`getTransaction` calls per JSON-RPC batch, 1–10. Default 10.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`HistoryFetch`](/api/anywalletkit/wallet-solana/type-aliases/historyfetch/)
Defined in: wallet-solana/src/history.ts:33
Fetch implementation; defaults to the global `fetch`.
***
### maxTokenAccounts?
[Section titled “maxTokenAccounts?”](#maxtokenaccounts)
> `optional` **maxTokenAccounts?**: `number`
Defined in: wallet-solana/src/history.ts:41
Token accounts included in the merge (the wallet itself is always included). Default 50.
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `"mainnet"` | `"devnet"` | `"testnet"`
Defined in: wallet-solana/src/history.ts:31
`mainnet` (default), `devnet`, `testnet` — picks the CAIP-2 id and the explorer cluster.
***
### rateLimit?
[Section titled “rateLimit?”](#ratelimit)
> `optional` **rateLimit?**: `number`
Defined in: wallet-solana/src/history.ts:35
RPC requests per second (a batch counts as one request). Default 5.
***
### rpcUrl?
[Section titled “rpcUrl?”](#rpcurl)
> `optional` **rpcUrl?**: `string`
Defined in: wallet-solana/src/history.ts:27
One JSON-RPC endpoint.
***
### rpcUrls?
[Section titled “rpcUrls?”](#rpcurls)
> `optional` **rpcUrls?**: `string`\[]
Defined in: wallet-solana/src/history.ts:29
Several endpoints, tried in order per request (failover).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-solana/src/history.ts:37
Per request, ms. Default 15 000.
# SolanaHistoryPage
Defined in: wallet-solana/src/history.ts:60
One page of Solana history.
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`SolanaChainTx`](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/)\[]
Defined in: wallet-solana/src/history.ts:62
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
# SolanaHistoryRaw
Defined in: wallet-solana/src/history.ts:45
What the `ChainTx` was built from.
## Properties
[Section titled “Properties”](#properties)
### logs?
[Section titled “logs?”](#logs)
> `optional` **logs?**: `string`\[]
Defined in: wallet-solana/src/history.ts:51
Program log messages when the node returned them.
***
### signature
[Section titled “signature”](#signature)
> **signature**: [`SignatureRow`](/api/anywalletkit/wallet-solana/interfaces/signaturerow/)
Defined in: wallet-solana/src/history.ts:47
The `getSignaturesForAddress` row.
***
### tx
[Section titled “tx”](#tx)
> **tx**: `unknown`
Defined in: wallet-solana/src/history.ts:49
The `getTransaction` result (jsonParsed), or null when the node no longer has it.
# SolanaHistorySource
Defined in: wallet-solana/src/history.ts:69
Solana history from JSON-RPC alone (`getSignaturesForAddress` + `getTransaction`), merged across the wallet and its token accounts. Build it with [createSolanaHistory](/api/anywalletkit/wallet-solana/functions/createsolanahistory/).
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`SolanaChainTx`](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/) | `undefined`>
Defined in: wallet-solana/src/history.ts:71
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`SolanaChainTx`](/api/anywalletkit/wallet-solana/interfaces/solanachaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`SolanaHistoryPage`](/api/anywalletkit/wallet-solana/interfaces/solanahistorypage/)>
Defined in: wallet-solana/src/history.ts:70
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`SolanaHistoryPage`](/api/anywalletkit/wallet-solana/interfaces/solanahistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
***
### tokenAccounts()
[Section titled “tokenAccounts()”](#tokenaccounts)
> **tokenAccounts**(`address`): `Promise`<`string`\[]>
Defined in: wallet-solana/src/history.ts:73
Token accounts (both programs) merged into the address’s history; cached per address.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address-2)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`string`\[]>
# SolanaNativeTransfer
Defined in: wallet-solana/src/types.ts:77
A native SOL transfer. `value` in lamports.
## Properties
[Section titled “Properties”](#properties)
### lookupTables?
[Section titled “lookupTables?”](#lookuptables)
> `optional` **lookupTables?**: `string`\[]
Defined in: wallet-solana/src/types.ts:81
Address lookup tables to compress the v0 message with.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-solana/src/types.ts:78
***
### value
[Section titled “value”](#value)
> **value**: `string` | `number` | `bigint`
Defined in: wallet-solana/src/types.ts:79
# SolanaPlan
Defined in: wallet-solana/src/read-only-account.ts:90
A fully prepared transaction: what to sign, what it costs, what the simulation said and what it does.
## Properties
[Section titled “Properties”](#properties)
### description
[Section titled “description”](#description)
> **description**: [`TransactionDescription`](/api/anywalletkit/wallet-solana/interfaces/transactiondescription/)
Defined in: wallet-solana/src/read-only-account.ts:97
***
### message?
[Section titled “message?”](#message)
> `optional` **message?**: `TransactionMessage`
Defined in: wallet-solana/src/read-only-account.ts:92
Message-based inputs (transfers, messages): the final message with compute-budget instructions.
***
### quote
[Section titled “quote”](#quote)
> **quote**: [`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)
Defined in: wallet-solana/src/read-only-account.ts:95
***
### simulation
[Section titled “simulation”](#simulation)
> **simulation**: [`SimulationResult`](/api/anywalletkit/wallet-solana/type-aliases/simulationresult/) | `undefined`
Defined in: wallet-solana/src/read-only-account.ts:96
***
### transaction?
[Section titled “transaction?”](#transaction)
> `optional` **transaction?**: `Readonly`<{ }>
Defined in: wallet-solana/src/read-only-account.ts:94
Compiled inputs (kit `Transaction` / base64 wire): the transaction as given.
# SolanaReceipt
Defined in: wallet-solana/src/types.ts:107
Outcome of a landed transaction.
## Properties
[Section titled “Properties”](#properties)
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `bigint`
Defined in: wallet-solana/src/types.ts:113
Slot (Solana’s block height analogue).
***
### blockTime
[Section titled “blockTime”](#blocktime)
> **blockTime**: `number` | `null`
Defined in: wallet-solana/src/types.ts:117
Unix seconds, when the node knows it.
***
### err
[Section titled “err”](#err)
> **err**: `unknown`
Defined in: wallet-solana/src/types.ts:119
The transaction error as the RPC reports it; `null` on success.
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-solana/src/types.ts:115
Fee paid, in lamports.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-solana/src/types.ts:109
Transaction signature (base58).
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: wallet-solana/src/types.ts:111
1 confirmed without error, 0 failed.
# SolanaSendResult
Defined in: wallet-solana/src/account.ts:19
`TransferResult` plus the full fee breakdown.
## Extends
[Section titled “Extends”](#extends)
* `TransferResult`
## Properties
[Section titled “Properties”](#properties)
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:18
Network fee actually paid or quoted, in native base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`TransferResult.fee`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:16
Transaction hash (id) on the chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`TransferResult.hash`
***
### quote
[Section titled “quote”](#quote)
> **quote**: [`SolanaFeeQuote`](/api/anywalletkit/wallet-solana/interfaces/solanafeequote/)
Defined in: wallet-solana/src/account.ts:20
# SolanaTransferOptions
Defined in: wallet-solana/src/types.ts:95
A native SOL or SPL / Token-2022 transfer. Amount in lamports or the token’s base units. A missing recipient token account is created in the same transaction.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-solana/src/types.ts:101
Amount in lamports or token base units.
***
### lookupTables?
[Section titled “lookupTables?”](#lookuptables)
> `optional` **lookupTables?**: `string`\[]
Defined in: wallet-solana/src/types.ts:103
Address lookup tables to compress the v0 message with.
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-solana/src/types.ts:99
Wallet address that receives (not its token account).
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-solana/src/types.ts:97
SPL or Token-2022 mint. Omit for native SOL.
# SolanaWarning
Defined in: wallet-solana/src/types.ts:161
One flagged problem, with a sentence a wallet can show.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`SolanaWarningCode`](/api/anywalletkit/wallet-solana/type-aliases/solanawarningcode/)
Defined in: wallet-solana/src/types.ts:163
Machine-readable code.
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-solana/src/types.ts:165
Sentence to show the user.
# SolanaWriteOptions
Defined in: wallet-solana/src/types.ts:71
`WriteOptions` plus the per-call opt-ins of this chain.
## Extends
[Section titled “Extends”](#extends)
* `WriteOptions`
## Properties
[Section titled “Properties”](#properties)
### allowDurableNonce?
[Section titled “allowDurableNonce?”](#allowdurablenonce)
> `optional` **allowDurableNonce?**: `boolean`
Defined in: wallet-solana/src/types.ts:73
Sign this durable-nonce transaction (see [SolanaConfig.allowDurableNonce](/api/anywalletkit/wallet-solana/interfaces/solanaconfig/#allowdurablenonce)).
***
### maxFee?
[Section titled “maxFee?”](#maxfee)
> `optional` **maxFee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:112
Cap on this write’s worst-case network fee, in native base units. Checked by the chain package on the transaction it is about to sign (EVM: its gas limit × its own gas price), with the tighter of this and the account’s configured cap winning. The kit’s `policies.maxFee` passes it down.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WriteOptions.maxFee`
# StakeInstructionDetails
Defined in: wallet-solana/src/types.ts:194
A Stake-program instruction, decoded as far as the guard and a review sheet need.
## Properties
[Section titled “Properties”](#properties)
### authorityType?
[Section titled “authorityType?”](#authoritytype)
> `optional` **authorityType?**: `"staker"` | `"withdrawer"`
Defined in: wallet-solana/src/types.ts:198
***
### custodian?
[Section titled “custodian?”](#custodian)
> `optional` **custodian?**: `string`
Defined in: wallet-solana/src/types.ts:207
***
### lamports?
[Section titled “lamports?”](#lamports)
> `optional` **lamports?**: `bigint`
Defined in: wallet-solana/src/types.ts:200
`Split`, `Withdraw`, `MoveStake`, `MoveLamports`.
***
### lockupEpoch?
[Section titled “lockupEpoch?”](#lockupepoch)
> `optional` **lockupEpoch?**: `bigint`
Defined in: wallet-solana/src/types.ts:206
***
### lockupTimestamp?
[Section titled “lockupTimestamp?”](#lockuptimestamp)
> `optional` **lockupTimestamp?**: `bigint`
Defined in: wallet-solana/src/types.ts:205
`Initialize` / `SetLockup*`: the lockup it sets — absent fields are left as they are.
***
### name
[Section titled “name”](#name)
> **name**: [`StakeInstructionName`](/api/anywalletkit/wallet-solana/type-aliases/stakeinstructionname/)
Defined in: wallet-solana/src/types.ts:195
***
### newAuthority?
[Section titled “newAuthority?”](#newauthority)
> `optional` **newAuthority?**: `string`
Defined in: wallet-solana/src/types.ts:197
`Authorize*`: the authority it sets (the new-authority account for the `Checked` forms; absent when unresolved).
***
### staker?
[Section titled “staker?”](#staker)
> `optional` **staker?**: `string`
Defined in: wallet-solana/src/types.ts:202
`Initialize*`: the authorities it sets (absent when unresolved).
***
### withdrawer?
[Section titled “withdrawer?”](#withdrawer)
> `optional` **withdrawer?**: `string`
Defined in: wallet-solana/src/types.ts:203
# TokenBalance
Defined in: wallet-solana/src/history.ts:132
## Properties
[Section titled “Properties”](#properties)
### accountIndex
[Section titled “accountIndex”](#accountindex)
> **accountIndex**: `number`
Defined in: wallet-solana/src/history.ts:133
***
### mint
[Section titled “mint”](#mint)
> **mint**: `string`
Defined in: wallet-solana/src/history.ts:134
***
### owner?
[Section titled “owner?”](#owner)
> `optional` **owner?**: `string`
Defined in: wallet-solana/src/history.ts:135
***
### programId?
[Section titled “programId?”](#programid)
> `optional` **programId?**: `string`
Defined in: wallet-solana/src/history.ts:136
***
### uiTokenAmount
[Section titled “uiTokenAmount”](#uitokenamount)
> **uiTokenAmount**: `object`
Defined in: wallet-solana/src/history.ts:137
#### amount
[Section titled “amount”](#amount)
> **amount**: `string`
#### decimals
[Section titled “decimals”](#decimals)
> **decimals**: `number`
# TransactionDescription
Defined in: wallet-solana/src/types.ts:220
A Solana transaction decoded for a confirmation screen, without any network call.
## Properties
[Section titled “Properties”](#properties)
### feePayer
[Section titled “feePayer”](#feepayer)
> **feePayer**: `string` | `undefined`
Defined in: wallet-solana/src/types.ts:226
Account that pays the fee.
***
### items
[Section titled “items”](#items)
> **items**: [`DecodedInstruction`](/api/anywalletkit/wallet-solana/type-aliases/decodedinstruction/)\[]
Defined in: wallet-solana/src/types.ts:230
Every instruction, decoded where possible.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`SolanaTransactionKind`](/api/anywalletkit/wallet-solana/type-aliases/solanatransactionkind/)
Defined in: wallet-solana/src/types.ts:222
What it does overall.
***
### lifetime
[Section titled “lifetime”](#lifetime)
> **lifetime**: `"durable-nonce"` | `"blockhash"`
Defined in: wallet-solana/src/types.ts:237
How the transaction expires: `blockhash` (about a minute after it was built) or `durable-nonce` (first instruction AdvanceNonceAccount: the signature never expires).
***
### signers
[Section titled “signers”](#signers)
> **signers**: `object`\[]
Defined in: wallet-solana/src/types.ts:228
Required signers in message order; `signed` is known only for compiled transactions.
#### address
[Section titled “address”](#address)
> **address**: `string`
#### signed
[Section titled “signed”](#signed)
> **signed**: `boolean` | `undefined`
***
### version
[Section titled “version”](#version)
> **version**: `0` | `"legacy"` | `1`
Defined in: wallet-solana/src/types.ts:224
Message version.
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`SolanaWarning`](/api/anywalletkit/wallet-solana/interfaces/solanawarning/)\[]
Defined in: wallet-solana/src/types.ts:232
Problems to show before signing.
# DecodedInstruction
> **DecodedInstruction** = { `from`: `string`; `lamports`: `bigint`; `program`: `string`; `to`: `string`; `type`: `"sol-transfer"`; } | { `lamports`: `bigint`; `newAccount`: `string`; `owner`: `string`; `payer`: `string`; `program`: `string`; `type`: `"create-account"`; } | { `amount`: `bigint`; `authority`: `string`; `decimals?`: `number`; `destination`: `string`; `fee?`: `bigint`; `mint?`: `string`; `program`: `string`; `source`: `string`; `tokenProgram`: [`TokenProgramKind`](/api/anywalletkit/wallet-solana/type-aliases/tokenprogramkind/); `type`: `"token-transfer"`; } | { `amount`: `bigint`; `delegate`: `string`; `owner`: `string`; `program`: `string`; `source`: `string`; `tokenProgram`: [`TokenProgramKind`](/api/anywalletkit/wallet-solana/type-aliases/tokenprogramkind/); `type`: `"token-approve"`; `unlimited`: `boolean`; } | { `account`: `string`; `authorityType`: `number`; `newAuthority`: `string` | `null`; `program`: `string`; `tokenProgram`: [`TokenProgramKind`](/api/anywalletkit/wallet-solana/type-aliases/tokenprogramkind/); `type`: `"set-authority"`; } | { `account`: `string`; `destination`: `string`; `owner`: `string`; `program`: `string`; `tokenProgram`: [`TokenProgramKind`](/api/anywalletkit/wallet-solana/type-aliases/tokenprogramkind/); `type`: `"close-account"`; } | { `ata`: `string`; `idempotent`: `boolean`; `mint`: `string`; `owner`: `string`; `payer`: `string`; `program`: `string`; `type`: `"ata-create"`; } | { `kind`: `"limit"` | `"price"` | `"other"`; `program`: `string`; `type`: `"compute-budget"`; `value`: `bigint`; } | { `accounts`: readonly `string`\[]; `dataLength`: `number`; `instruction?`: `string`; `program`: `string`; `stake?`: [`StakeInstructionDetails`](/api/anywalletkit/wallet-solana/interfaces/stakeinstructiondetails/); `type`: `"program-call"`; `withSeed?`: [`SeedAccountDetails`](/api/anywalletkit/wallet-solana/interfaces/seedaccountdetails/); } | { `accounts`: readonly (`string` | `null`)\[]; `dataLength`: `number`; `instruction?`: `string`; `program`: `string` | `null`; `stake?`: [`StakeInstructionDetails`](/api/anywalletkit/wallet-solana/interfaces/stakeinstructiondetails/); `type`: `"unknown"`; }
Defined in: wallet-solana/src/types.ts:175
One instruction of a transaction, decoded where the program is known (System, Token, Token-2022, Associated Token, Compute Budget) and listed raw otherwise.
# HistoryFetch
> **HistoryFetch** = (`input`, `init?`) => `Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
Defined in: wallet-solana/src/history.ts:19
The subset of WHATWG `fetch` this module uses; inject for tests / custom transports.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### init?
[Section titled “init?”](#init)
#### body?
[Section titled “body?”](#body)
`string`
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
# SimulationResult
> **SimulationResult** = { `logs`: readonly `string`\[]; `ok`: `true`; `unitsConsumed`: `bigint`; } | { `error`: `string`; `logs`: readonly `string`\[]; `ok`: `false`; }
Defined in: wallet-solana/src/types.ts:139
Outcome of `simulateTransaction`: compute units used and logs, or the error and logs.
# SolanaMessageKind
> **SolanaMessageKind** = `"transaction"` | `"offchain"` | `"text"` | `"binary"`
Defined in: wallet-solana/src/offchain.ts:113
What an off-chain “sign message” payload is, for the approval UI:
* `transaction` — refuse (see [isSolanaTransactionPayload](/api/anywalletkit/wallet-solana/functions/issolanatransactionpayload/));
* `offchain` — Solana off-chain message format (header-prefixed);
* `text` — readable UTF-8;
* `binary` — anything else: allowed, but the user cannot see what it commits to.
# SolanaRpc
> **SolanaRpc** = `Rpc`<`SolanaRpcApi`>
Defined in: wallet-solana/src/types.ts:5
A `@solana/kit` RPC client.
# SolanaTransaction
> **SolanaTransaction** = [`SolanaNativeTransfer`](/api/anywalletkit/wallet-solana/interfaces/solananativetransfer/) | `TransactionMessage` | `Transaction` | `string`
Defined in: wallet-solana/src/types.ts:89
Anything `sendTransaction` / `signTransaction` accept: a native transfer, a kit transaction message, a kit `Transaction` (compiled, possibly partially signed) or the base64 wire form a swap / DeFi provider returns.
# SolanaTransactionKind
> **SolanaTransactionKind** = `"sol-transfer"` | `"spl-transfer"` | `"token2022-transfer"` | `"ata-create"` | `"program-call"` | `"mixed"` | `"empty"`
Defined in: wallet-solana/src/types.ts:217
What a transaction does overall; `mixed` when it does several things, `program-call` when it calls an unknown program.
# SolanaWarningCode
> **SolanaWarningCode** = `"unknown-program"` | `"sets-authority"` | `"closes-account"` | `"approves-delegate"` | `"unlimited-approve"` | `"foreign-fee-payer"` | `"missing-signers"` | `"unresolved-lookup-tables"` | `"burn-address"` | `"durable-nonce"`
Defined in: wallet-solana/src/types.ts:148
Problems [describeTransaction](/api/anywalletkit/wallet-solana/functions/describetransaction/) flags: a program it does not know, an authority change, a closed account, a delegate approval (unlimited or not), a fee payer that is not the wallet, missing co-signers, lookup tables it could not resolve, or the burn address.
# StakeInstructionName
> **StakeInstructionName** = `"Initialize"` | `"Authorize"` | `"DelegateStake"` | `"Split"` | `"Withdraw"` | `"Deactivate"` | `"SetLockup"` | `"Merge"` | `"AuthorizeWithSeed"` | `"InitializeChecked"` | `"AuthorizeChecked"` | `"AuthorizeCheckedWithSeed"` | `"SetLockupChecked"` | `"GetMinimumDelegation"` | `"DeactivateDelinquent"` | `"Redelegate"` | `"MoveStake"` | `"MoveLamports"`
Defined in: wallet-solana/src/types.ts:188
Stake-program instruction names, by their tag.
# TokenProgramKind
> **TokenProgramKind** = `"token"` | `"token-2022"`
Defined in: wallet-solana/src/types.ts:169
The classic SPL Token program or Token-2022.
# ASSOCIATED_TOKEN_PROGRAM
> `const` **ASSOCIATED_TOKEN_PROGRAM**: `"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"` = `'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'`
Defined in: wallet-solana/src/history.ts:104
Associated Token Account program id.
# CAIP2_GENESIS
> `const` **CAIP2_GENESIS**: `Record`<`string`, `string`>
Defined in: wallet-solana/src/types.ts:241
CAIP-2 ids of the Solana clusters, by name.
# COMPUTE_BUDGET_PROGRAM
> `const` **COMPUTE_BUDGET_PROGRAM**: `"ComputeBudget111111111111111111111111111111"` = `'ComputeBudget111111111111111111111111111111'`
Defined in: wallet-solana/src/history.ts:98
Compute Budget program id.
# DEFAULT_PROGRAM_ALLOWLIST
> `const` **DEFAULT_PROGRAM_ALLOWLIST**: readonly `string`\[]
Defined in: wallet-solana/src/serialized.ts:89
Programs a provider transaction may invoke unless the caller widens the list.
# DFLOW_V4_PROGRAM_ADDRESS
> `const` **DFLOW_V4_PROGRAM_ADDRESS**: `"DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH"` = `'DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH'`
Defined in: wallet-solana/src/serialized.ts:52
Same-chain routers LI.FI’s `jupiter` tool resolves to besides Jupiter v6 (names per MyTonWallet / OISY known-program lists, 2026-10-09).
# JUPITER_V6_PROGRAM_ADDRESS
> `const` **JUPITER_V6_PROGRAM_ADDRESS**: `"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"` = `'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4'`
Defined in: wallet-solana/src/serialized.ts:28
Jupiter aggregator v6 — the router behind LI.FI’s Solana legs.
# LIFI_TRACKING_PROGRAM_ADDRESS
> `const` **LIFI_TRACKING_PROGRAM_ADDRESS**: `"3i5JeuZuUxeKtVysUnwQNGerJP2bSMX9fTFfS4Nxe3Br"` = `'3i5JeuZuUxeKtVysUnwQNGerJP2bSMX9fTFfS4Nxe3Br'`
Defined in: wallet-solana/src/serialized.ts:36
“LI.FI Solana Program 1” (github.com/lifinance/solana-programs, listed in Solana Explorer’s verified programs). Its only instruction, `TrackV1`, logs a LI.FI transaction id against two READ-ONLY accounts (the Clock sysvar and an epoch PDA) — a memo in all but name. Every LI.FI cross-chain quote from Solana (NEAR Intents legs, seen 2026-10-09) prepends it to the deposit.
# MAX_U64
> `const` **MAX_U64**: `18446744073709551615n` = `0xffffffffffffffffn`
Defined in: wallet-solana/src/describe.ts:117
Largest u64; a token approval of this amount is unlimited.
# MAYAN_PROGRAM_ADDRESSES
> `const` **MAYAN_PROGRAM_ADDRESSES**: readonly `string`\[]
Defined in: wallet-solana/src/serialized.ts:67
Mayan (LI.FI’s `mayan` / `mayanMCTP` / `mayanFastMCTP` tools) — program ids from github.com/mayan-finance/swap-sdk `src/addresses.ts` (2026-10-09), plus the Wormhole core and Circle CCTP programs its routes CPI into. The owner approved widening the list on 2026-10-10; the balance proof below (SOL ceiling, token-in floor, no drain, no lingering delegate) stays the guard that actually bounds what a route may do.
# MEMO_PROGRAM_ADDRESS
> `const` **MEMO_PROGRAM_ADDRESS**: `"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"` = `'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'`
Defined in: wallet-solana/src/serialized.ts:26
Memo program (v2) — swap aggregators tag routes with it.
# MEMO_V1_PROGRAM_ADDRESS
> `const` **MEMO_V1_PROGRAM_ADDRESS**: `"Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"` = `'Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo'`
Defined in: wallet-solana/src/serialized.ts:47
Memo program v1 — LI.FI’s Solana → Robinhood (relay) route tags with it (2026-10-09).
# OKX_DEX_ROUTER_PROGRAM_ADDRESS
> `const` **OKX_DEX_ROUTER_PROGRAM_ADDRESS**: `"proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u"` = `'proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u'`
Defined in: wallet-solana/src/serialized.ts:54
OKX DEX router, reached through LI.FI’s Solana `jupiter` tool.
# RELAY_DEPOSITORY_PROGRAM_ADDRESS
> `const` **RELAY_DEPOSITORY_PROGRAM_ADDRESS**: `"99vQwtBwYtrqqD9YSXbdum3KBdxPAVxYTaQ3cfnJSrN2"` = `'99vQwtBwYtrqqD9YSXbdum3KBdxPAVxYTaQ3cfnJSrN2'`
Defined in: wallet-solana/src/serialized.ts:45
Relay Protocol’s Solana depository (“Relay Bridge” in Jupiter’s platform list; github.com/reservoirprotocol). LI.FI’s `relaydepository` tool — its only route from Solana to HyperEVM (2026-10-09) — approves the depository as delegate on the source token account and lets it pull the amount in the same transaction; the guard verifies the delegate is spent (see [ParsedTokenAccount.delegatedAmount](/api/anywalletkit/wallet-solana/interfaces/parsedtokenaccount/#delegatedamount)).
# RELAY_FORWARDER_PROGRAM_ADDRESS
> `const` **RELAY_FORWARDER_PROGRAM_ADDRESS**: `"DPArtTLbEqa6EuXHfL5UFLBZhFjiEXWRudhvXDrjwXUr"` = `'DPArtTLbEqa6EuXHfL5UFLBZhFjiEXWRudhvXDrjwXUr'`
Defined in: wallet-solana/src/serialized.ts:58
Relay Forwarder (relayprotocol/relay-settlement, solana-vm/programs/relay-forwarder) — LI.FI relay routes out of Solana (2026-10-10).
# SOLANA_BASE_PATH
> `const` **SOLANA_BASE_PATH**: `"m/44'/501'"` = `"m/44'/501'"`
Defined in: wallet-solana/src/manager.ts:7
Base derivation path; account `i` is at `m/44'/501'/i'/0'` (Phantom, Solflare).
# SOLANA_OFFCHAIN_MESSAGE_PREFIX
> `const` **SOLANA_OFFCHAIN_MESSAGE_PREFIX**: `Uint8Array`
Defined in: wallet-solana/src/offchain.ts:20
`\xffsolana offchain` — the signing-domain header of the Solana off-chain message format.
# STAKE_PROGRAM_ADDRESS
> `const` **STAKE_PROGRAM_ADDRESS**: `"Stake11111111111111111111111111111111111111"` = `'Stake11111111111111111111111111111111111111'`
Defined in: wallet-solana/src/describe.ts:33
The native Stake program.
# SYSTEM_PROGRAM
> `const` **SYSTEM_PROGRAM**: `"11111111111111111111111111111111"` = `'11111111111111111111111111111111'`
Defined in: wallet-solana/src/history.ts:96
System program id.
# TITAN_PROGRAM_ADDRESS
> `const` **TITAN_PROGRAM_ADDRESS**: `"T1TANpTeScyeqVzzgNViGDNrkQ6qHz9KrSBS4aNXvGT"` = `'T1TANpTeScyeqVzzgNViGDNrkQ6qHz9KrSBS4aNXvGT'`
Defined in: wallet-solana/src/serialized.ts:56
Titan Exchange aggregator — LI.FI’s jupiter tool routed Solana USDe → USDC through it (2026-10-10).
# TOKEN_2022_PROGRAM
> `const` **TOKEN_2022_PROGRAM**: `"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"` = `'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'`
Defined in: wallet-solana/src/history.ts:102
Token-2022 program id.
# TOKEN_ACCOUNT_MIN_SIZE
> `const` **TOKEN_ACCOUNT_MIN_SIZE**: `165` = `165`
Defined in: wallet-solana/src/serialized.ts:246
The fixed prefix of an SPL / Token-2022 token account: mint, owner, amount (u64 LE at offset 64).
# TOKEN_PROGRAM
> `const` **TOKEN_PROGRAM**: `"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"` = `'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'`
Defined in: wallet-solana/src/history.ts:100
SPL Token program id.
# WSOL_MINT
> `const` **WSOL_MINT**: `"So11111111111111111111111111111111111111112"` = `'So11111111111111111111111111111111111111112'`
Defined in: wallet-solana/src/serialized.ts:86
Wrapped SOL mint; a “token in” of wSOL is measured on the SOL balance (aggregators unwrap it).
# ZERO_ADDRESS
> `const` **ZERO_ADDRESS**: `string`
Defined in: wallet-solana/src/describe.ts:119
The System program id doubles as the all-zero “burn” address.
# @anywalletkit/wallet-ton
# @anywalletkit/wallet-ton
[Section titled “@anywalletkit/wallet-ton”](#anywalletkitwallet-ton)
[](https://www.npmjs.com/package/@anywalletkit/wallet-ton)
TON accounts at `m/44'/607'/i'` (SLIP-10 ed25519) on Wallet V5R1 — the derivation Trust Wallet and Ledger use for a BIP-39 phrase, pinned by golden vectors in `@anywalletkit/conformance`. Runtime dependencies: `@ton/core`, `@ton/crypto`, `buffer` (no `@ton/ton`: the V5R1 contract and the toncenter client are implemented here, byte-for-byte checked against `@ton/ton` in tests).
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-ton
# or: pnpm add @anywalletkit/wallet-ton · yarn add @anywalletkit/wallet-ton
```
On npm: [@anywalletkit/wallet-ton](https://www.npmjs.com/package/@anywalletkit/wallet-ton), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import WalletManagerTon from '@anywalletkit/wallet-ton'
const wallet = new WalletManagerTon(seedPhrase, {
tonClient: [{ url: 'https://toncenter.com/api/v2/jsonRPC', secretKey }], // fails over in order
// emulate: {kind: 'tonapi'} is the default (tonapi.io/v2/wallet/emulate, then /traces/emulate);
// {kind: 'toncenter-v3', url} switches the emulator, false = estimateFee only.
tonApiKey, // optional: Bearer key for tonapi
})
const account = await wallet.getAccount(0)
account.describe({ to: 'UQ…', value: 100_000_000n, body: 'thanks' }) // offline: kind, items, warnings
await account.simulateTransaction({ to: 'UQ…', value: 100_000_000n }) // fees + emulation verdict + risk (what leaves the wallet)
await account.transfer({ recipient: 'UQ…', amount: 100_000_000n }) // 0.1 TON
await account.transfer({ token: USDT_MASTER, recipient: 'UQ…', amount: 1_000_000n, forwardPayload: 'hi' })
await account.sendTransaction([ // several messages, ONE external
{ to: 'EQ…', value: 50_000_000n, bodyBoc, stateInit }, // e.g. an Omniston escrow deploy
{ to: 'UQ…', value: 1n },
])
const receipt = await account.getTransactionReceipt(hash) // hash = body hash, via toncenter v3
wallet.dispose()
// Tonkeeper-style 24-word TON mnemonic (not BIP-39): one account, same surface.
const tk = await WalletManagerTon.fromTonMnemonic(words, { tonClient })
```
## Every send
[Section titled “Every send”](#every-send)
1. Hard checks, before any network call: value > 0, workchain 0/-1 only, friendly-address network flag matches `config.network`, `valid_until` = now + `validUntilSeconds` (default 60, max 600).
2. Fresh seqno (never cached across sends).
3. Preflight on the zero-signed body: toncenter `estimateFee` (the fee cap) and a trace emulation — tonapi by default (`POST /v2/wallet/emulate`, falling back to `/v2/traces/emulate`), or a toncenter-v3 `emulateTrace` endpoint via `emulate: {kind: 'toncenter-v3', url}`. A non-zero compute exit, an aborted transaction, a failed action phase or a failed **first-hop** internal message (the operation would bounce) throws `SimulationError` **before signing**; failures deeper in the trace are `warnings`. tonapi’s `risk` is returned as `risk`. A message with send mode 128 (the whole remaining balance) or 32 (the account destroyed once empty) is refused with `UnsafeTransactionError('drain')` unless `allowDrainingTransactions` — checked locally before any emulation, prebuilt bodies too, and again on tonapi’s risk. `describeTransaction` shows each message’s `mode`. `emulate: false` keeps only `estimateFee`; `simulate: false` skips the preflight entirely (not the mode check). A jetton transfer’s recipient and response destination get the same network (test-only flag) and workchain checks as a native transfer. A broadcast with no definitive answer (no response, a timeout, a non-JSON body) throws `BroadcastUnknownError` (`maybeSent`, `hash` = the body hash): do not sign again (the next seqno would pay twice); a node’s `ok: false` stays a `NetworkError`. A custom `TonRpc` should mark refusals `answered: true` (`isAnsweredRefusal`).
4. noble ed25519 over the body hash; the 32-byte seed is the only key material and `dispose()` zeroizes it.
5. `sendBoc` of the external (with StateInit when the wallet is not deployed).
## Signers
[Section titled “Signers”](#signers)
The account never holds a key. Every signature is a `signer.sign(bytes, {scheme: 'ed25519', context})` call: `ton-external` over the hash of the V5R1 signing cell (after the preflight, which runs on a zero-signed body), `ton-message` over raw message bytes (`sign()`), `ton-proof` / `ton-sign-data` over the TON Connect digests (`signTonProof`, `signTonConnectData`). Seed wallets get a `LocalSigner`; a hardware wallet, MPC node or backend is wrapped with `externalSigner()` from `@anywalletkit/core`:
```ts
const signer = externalSigner({ curve: 'ed25519', publicKey, sign: (payload, { context }) => device.sign(payload) })
const manager = new WalletManagerTon(signer, { tonClient })
const account = await manager.getAccount() // path 'external'; other indexes throw
```
A derivable `SeedSigner` at `m/44'/607'` yields `getAccount(i)` children; a leaf signer (including `fromTonMnemonic`) is one account. `WalletAccountTon.fromPrivateKey(priv, pub, path)` keeps the raw-key shape for callers that derive themselves.
## Messages and TON Connect
[Section titled “Messages and TON Connect”](#messages-and-ton-connect)
`sign(message)` is a hex ed25519 signature over the raw bytes. A 32-byte message — bytes or a string that encodes to 32 bytes — is refused with `MessageIsTransactionError`: the wallet contract checks a transfer’s signature over the 32-byte hash of its signing cell, so 32 raw bytes may be a transfer. TON Connect has its own methods, which build the digest from the request and the account’s own address (0xffff ‖ “ton-connect…”, never a cell hash):
```ts
const proof = await account.signTonProof({ domain: 'app.example', timestamp, payload }) // the `proof` of a ton_proof reply
const reply = await account.signTonConnectData({ domain: 'app.example', timestamp, payload: { type: 'text', text } }) // signData (text | binary)
```
`domain` is the host the wallet saw the request come from, never the dApp’s own claim.
## Describe
[Section titled “Describe”](#describe)
`describeTransaction(tx)` / `account.describe(tx)` decode TON transfers (text comments), jetton transfers (`0x0f8a7ea5`: amount, destination, forward amount/payload, custom payload) and contract calls, also from a prebuilt V5R1 body, with warnings: `zero-value`, `non-bounceable-contract-call`, `unknown-body`, `large-forward-amount`, `testnet-address` / `mainnet-address`, `exotic-workchain`.
## Buffer
[Section titled “Buffer”](#buffer)
On import the package installs the `buffer` polyfill as `globalThis.Buffer` if none exists (`@ton/core` requires the global). Node, and apps that already set it, are untouched.
## React Native
[Section titled “React Native”](#react-native)
`@ton/crypto-primitives` resolves its `react-native` build on Metro, which requires `expo-crypto` (random bytes) at module load and `react-native-fast-pbkdf2` for the TON-mnemonic import. Install `expo-crypto` in the app (Expo projects already have it). BIP-39 wallets sign through noble ed25519 and need neither.
## Activity history
[Section titled “Activity history”](#activity-history)
`createTonHistory` is the chain’s `HistorySource` (`@anywalletkit/core`): tonapi account events first, toncenter v3 as a reduced fallback.
```ts
import { createTonHistory } from '@anywalletkit/wallet-ton/history'
const history = createTonHistory({ apiKey: process.env.TONAPI_KEY })
const page = await history.listActivity('UQCbXJ1-Hd_CyyAt3TNgircduNIn5QH5dj1_LBNz__y4fQaq', { limit: 25 })
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://tonviewer.com/transaction/…
```
| option | default | notes |
| -------------------- | ------------------------------------------------- | ----------------------------------------------------------------- |
| `tonapiUrl` | `https://tonapi.io` (`testnet.tonapi.io`) | `null` disables tonapi. |
| `apiKey` | none | tonapi Bearer key. Keyless tonapi allows \~1 request/s. |
| `toncenterUrl` | `https://toncenter.com` (`testnet.toncenter.com`) | v3 fallback; `null` disables it. |
| `toncenterApiKey` | none | `X-API-Key`. |
| `network` | `mainnet` | `ton:-239` / `ton:-3`. |
| `rateLimit` | 1 rps keyless, 10 with a key | tonapi requests per second (toncenter: 1 keyless, 10 with a key). |
| `fetch`, `timeoutMs` | global, 15 000 | |
**tonapi** (`GET /v2/accounts/{a}/events?limit=&before_lt=`, `GET /v2/accounts/{a}/events/{id}`): one event = one trace, with typed actions. `TonTransfer`, `JettonTransfer`, `JettonMint`, `JettonBurn`, `JettonSwap` (TON / jetton in and out against the DEX router), `SmartContractExec` (`ton_attached`), `DepositStake` / `WithdrawStake` (staker ↔ pool), `Subscribe`, `NftPurchase`, elections become transfers; jetton transfers carry the master as `token`, `standard: 'jetton'`, `symbol` and `decimals` from the action’s jetton object. The first contract-level action is the `call`: `SmartContractExec` → `to` = contract, hex op in `data`, named op in `method`; `JettonSwap` → router / `swap`; a jetton sent to a contract with a forward payload → recipient / `jetton_transfer` with the op from tonapi’s `Call: 0x…` comment; `DepositStake` → pool / `stake`, `WithdrawStakeRequest` → pool / `unstake`, `WithdrawStake` → pool / `withdraw_stake`. tonapi does not spell out the pool-token burn of an unstake request, so for those events the source fetches `/v2/events/{id}` once and turns the account’s `value_flow` jetton deltas into transfers (`raw.valueFlow`). `from` is the first action’s initiator, `nativeValue` the TON it sent, `fee` = `-extra` (tonapi’s “what the account lost beyond its actions”, so it includes forward fees the actions do not show), `status` = `pending` while `in_progress`, `failed` when every action failed, `block` = the event’s `lt`, `hash` = the event id (the trace root; tonapi resolves any transaction hash of the trace to it). `is_scam` events are flagged `scam: true` (also in `raw.scam`). Addresses stay raw (`0:…`, lowercase) as tonapi returns them.
**toncenter v3** (`GET /api/v3/transactions?account=&limit=&sort=desc&end_lt=`): the account’s own transactions only. An external message (the wallet acted) maps its outgoing messages to TON transfers and the first op code to `call` (`data` = `opcode`, `method` = `decoded_opcode`); an incoming message maps its value and op. Jettons are not visible here, `fee` = `total_fees`, `hash` = the transaction hash in hex.
**Cursor.** Base64 JSON `{ v: 1, b: 'tonapi' | 'toncenter', lt }`: an exclusive `lt` upper bound (`before_lt` for tonapi, `end_lt = lt − 1` for toncenter). A cursor from one backend resumes on the other; the backend that issued it is tried first. `since` is applied client-side and ends pagination.
Fixtures in `test/fixtures/history/` were captured on 2026-10-14 from `tonapi.io` and `toncenter.com` (keyless) for the test wallet: one events page, the account-scoped events of the Tonstakers stake / unstake request / payout and of the Omniston STON.fi swap and escrow order (the same transactions as those modules’ activity fixtures), the full event with `value_flow` for the unstake, and a toncenter v3 page. `test/history.test.ts` checks that the Tonstakers and Omniston modules describe the rows this source builds (`stake`, `unstake`, `claim`, `swap`, `bridge`). Note: `@anywalletkit/protocol-swap2-core`’s `netTransfers` compares addresses verbatim, so `DescribeActivityContext.own` must contain the raw `0:…` form of the wallet for Omniston (Tonstakers normalizes itself).
## Classes
[Section titled “Classes”](#classes)
* [BroadcastUnknownError](/api/anywalletkit/wallet-ton/classes/broadcastunknownerror/)
* [HistoryUnavailableError](/api/anywalletkit/wallet-ton/classes/historyunavailableerror/)
* [MessageIsTransactionError](/api/anywalletkit/wallet-ton/classes/messageistransactionerror/)
* [SimulationError](/api/anywalletkit/wallet-ton/classes/simulationerror/)
* [TonCenter](/api/anywalletkit/wallet-ton/classes/toncenter/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-ton/classes/unsafetransactionerror/)
* [WalletAccountReadOnlyTon](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/)
* [WalletAccountTon](/api/anywalletkit/wallet-ton/classes/walletaccountton/)
* [WalletManagerTon](/api/anywalletkit/wallet-ton/classes/walletmanagerton/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [EmulateOptions](/api/anywalletkit/wallet-ton/interfaces/emulateoptions/)
* [EmulationOutcome](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)
* [EmulationVerdict](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)
* [GetMethodResult](/api/anywalletkit/wallet-ton/interfaces/getmethodresult/)
* [MappedActions](/api/anywalletkit/wallet-ton/interfaces/mappedactions/)
* [ParsedV5R1Body](/api/anywalletkit/wallet-ton/interfaces/parsedv5r1body/)
* [TonAccountState](/api/anywalletkit/wallet-ton/interfaces/tonaccountstate/)
* [TonAddressParts](/api/anywalletkit/wallet-ton/interfaces/tonaddressparts/)
* [TonapiAccount](/api/anywalletkit/wallet-ton/interfaces/tonapiaccount/)
* [TonapiAction](/api/anywalletkit/wallet-ton/interfaces/tonapiaction/)
* [TonapiEvent](/api/anywalletkit/wallet-ton/interfaces/tonapievent/)
* [TonapiJetton](/api/anywalletkit/wallet-ton/interfaces/tonapijetton/)
* [TonChainTx](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)
* [TonConfig](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)
* [TonDescribedMessage](/api/anywalletkit/wallet-ton/interfaces/tondescribedmessage/)
* [TonDescription](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
* [TonEndpoint](/api/anywalletkit/wallet-ton/interfaces/tonendpoint/)
* [TonFees](/api/anywalletkit/wallet-ton/interfaces/tonfees/)
* [TonHistoryCursor](/api/anywalletkit/wallet-ton/interfaces/tonhistorycursor/)
* [TonHistoryOptions](/api/anywalletkit/wallet-ton/interfaces/tonhistoryoptions/)
* [TonHistoryPage](/api/anywalletkit/wallet-ton/interfaces/tonhistorypage/)
* [TonHistoryRaw](/api/anywalletkit/wallet-ton/interfaces/tonhistoryraw/)
* [TonHistorySource](/api/anywalletkit/wallet-ton/interfaces/tonhistorysource/)
* [TonJettonDetails](/api/anywalletkit/wallet-ton/interfaces/tonjettondetails/)
* [TonProof](/api/anywalletkit/wallet-ton/interfaces/tonproof/)
* [TonProofRequest](/api/anywalletkit/wallet-ton/interfaces/tonproofrequest/)
* [TonReceipt](/api/anywalletkit/wallet-ton/interfaces/tonreceipt/)
* [TonRisk](/api/anywalletkit/wallet-ton/interfaces/tonrisk/)
* [TonRpc](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
* [TonSignDataRequest](/api/anywalletkit/wallet-ton/interfaces/tonsigndatarequest/)
* [TonSignedData](/api/anywalletkit/wallet-ton/interfaces/tonsigneddata/)
* [TonTransaction](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)
* [TonTransferOptions](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
* [TonWarning](/api/anywalletkit/wallet-ton/interfaces/tonwarning/)
* [V3Message](/api/anywalletkit/wallet-ton/interfaces/v3message/)
* [V3Transaction](/api/anywalletkit/wallet-ton/interfaces/v3transaction/)
* [V5R1Message](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)
* [V5R1SigningParams](/api/anywalletkit/wallet-ton/interfaces/v5r1signingparams/)
* [V5R1WalletIdParts](/api/anywalletkit/wallet-ton/interfaces/v5r1walletidparts/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [DecodedBody](/api/anywalletkit/wallet-ton/type-aliases/decodedbody/)
* [EmulationSource](/api/anywalletkit/wallet-ton/type-aliases/emulationsource/)
* [HistoryFetch](/api/anywalletkit/wallet-ton/type-aliases/historyfetch/)
* [TonAccountStatus](/api/anywalletkit/wallet-ton/type-aliases/tonaccountstatus/)
* [TonDescribedKind](/api/anywalletkit/wallet-ton/type-aliases/tondescribedkind/)
* [TonEmulateConfig](/api/anywalletkit/wallet-ton/type-aliases/tonemulateconfig/)
* [TonHistoryBackend](/api/anywalletkit/wallet-ton/type-aliases/tonhistorybackend/)
* [TonProvider](/api/anywalletkit/wallet-ton/type-aliases/tonprovider/)
* [TonSendable](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
* [TonSignDataPayload](/api/anywalletkit/wallet-ton/type-aliases/tonsigndatapayload/)
* [TonSimulation](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)
* [TonSimulationSource](/api/anywalletkit/wallet-ton/type-aliases/tonsimulationsource/)
* [TonWarningCode](/api/anywalletkit/wallet-ton/type-aliases/tonwarningcode/)
## Variables
[Section titled “Variables”](#variables)
* [CAIP2](/api/anywalletkit/wallet-ton/variables/caip2/)
* [DEFAULT_SEND_MODE](/api/anywalletkit/wallet-ton/variables/default_send_mode/)
* [DEFAULT_TONAPI](/api/anywalletkit/wallet-ton/variables/default_tonapi/)
* [JETTON_TRANSFER_OP](/api/anywalletkit/wallet-ton/variables/jetton_transfer_op/)
* [MAINNET_GLOBAL_ID](/api/anywalletkit/wallet-ton/variables/mainnet_global_id/)
* [MAX_ACTIONS](/api/anywalletkit/wallet-ton/variables/max_actions/)
* [SEND_MODE](/api/anywalletkit/wallet-ton/variables/send_mode/)
* [TESTNET_GLOBAL_ID](/api/anywalletkit/wallet-ton/variables/testnet_global_id/)
* [TON_BASE_PATH](/api/anywalletkit/wallet-ton/variables/ton_base_path/)
* [TON_MNEMONIC_PATH](/api/anywalletkit/wallet-ton/variables/ton_mnemonic_path/)
* [V5R1_CODE_HEX](/api/anywalletkit/wallet-ton/variables/v5r1_code_hex/)
* [V5R1_OP](/api/anywalletkit/wallet-ton/variables/v5r1_op/)
## Functions
[Section titled “Functions”](#functions)
* [canonicalBocCell](/api/anywalletkit/wallet-ton/functions/canonicalboccell/)
* [commentCell](/api/anywalletkit/wallet-ton/functions/commentcell/)
* [createTonClient](/api/anywalletkit/wallet-ton/functions/createtonclient/)
* [createTonHistory](/api/anywalletkit/wallet-ton/functions/createtonhistory/)
* [decodeBody](/api/anywalletkit/wallet-ton/functions/decodebody/)
* [decodeHistoryCursor](/api/anywalletkit/wallet-ton/functions/decodehistorycursor/)
* [describeMessageRelaxed](/api/anywalletkit/wallet-ton/functions/describemessagerelaxed/)
* [describeTransaction](/api/anywalletkit/wallet-ton/functions/describetransaction/)
* [emulateExternal](/api/anywalletkit/wallet-ton/functions/emulateexternal/)
* [emulateViaTonapi](/api/anywalletkit/wallet-ton/functions/emulateviatonapi/)
* [encodeHistoryCursor](/api/anywalletkit/wallet-ton/functions/encodehistorycursor/)
* [installBufferGlobal](/api/anywalletkit/wallet-ton/functions/installbufferglobal/)
* [isAnsweredRefusal](/api/anywalletkit/wallet-ton/functions/isansweredrefusal/)
* [mapTonapiActions](/api/anywalletkit/wallet-ton/functions/maptonapiactions/)
* [mapTonapiEvent](/api/anywalletkit/wallet-ton/functions/maptonapievent/)
* [mapToncenterTransaction](/api/anywalletkit/wallet-ton/functions/maptoncentertransaction/)
* [messageBody](/api/anywalletkit/wallet-ton/functions/messagebody/)
* [parseEmulation](/api/anywalletkit/wallet-ton/functions/parseemulation/)
* [parseTonapiConsequences](/api/anywalletkit/wallet-ton/functions/parsetonapiconsequences/)
* [parseTonapiRisk](/api/anywalletkit/wallet-ton/functions/parsetonapirisk/)
* [parseTonapiTrace](/api/anywalletkit/wallet-ton/functions/parsetonapitrace/)
* [parseV5R1Body](/api/anywalletkit/wallet-ton/functions/parsev5r1body/)
* [rawTonAddress](/api/anywalletkit/wallet-ton/functions/rawtonaddress/)
* [resolveEmulate](/api/anywalletkit/wallet-ton/functions/resolveemulate/)
* [runEmulation](/api/anywalletkit/wallet-ton/functions/runemulation/)
* [tonCenterEndpoint](/api/anywalletkit/wallet-ton/functions/toncenterendpoint/)
* [tonExplorerTxUrl](/api/anywalletkit/wallet-ton/functions/tonexplorertxurl/)
* [tonProofDigest](/api/anywalletkit/wallet-ton/functions/tonproofdigest/)
* [tonSignDataDigest](/api/anywalletkit/wallet-ton/functions/tonsigndatadigest/)
* [v5r1Address](/api/anywalletkit/wallet-ton/functions/v5r1address/)
* [v5r1Code](/api/anywalletkit/wallet-ton/functions/v5r1code/)
* [v5r1ExternalMessage](/api/anywalletkit/wallet-ton/functions/v5r1externalmessage/)
* [v5r1PackSigned](/api/anywalletkit/wallet-ton/functions/v5r1packsigned/)
* [v5r1PackUnsigned](/api/anywalletkit/wallet-ton/functions/v5r1packunsigned/)
* [v5r1SigningMessage](/api/anywalletkit/wallet-ton/functions/v5r1signingmessage/)
* [v5r1StateInit](/api/anywalletkit/wallet-ton/functions/v5r1stateinit/)
* [v5r1WalletId](/api/anywalletkit/wallet-ton/functions/v5r1walletid/)
* [valueFlowTransfers](/api/anywalletkit/wallet-ton/functions/valueflowtransfers/)
## References
[Section titled “References”](#references)
### createTonRpc
[Section titled “createTonRpc”](#createtonrpc)
Renames and re-exports [createTonClient](/api/anywalletkit/wallet-ton/functions/createtonclient/)
***
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerTon](/api/anywalletkit/wallet-ton/classes/walletmanagerton/)
# BroadcastUnknownError
Defined in: wallet-ton/src/errors.ts:48
The external message was handed to the network but no definitive answer came back (no response, a timeout, a non-JSON body): it MAY be on chain. Do not sign again (the next seqno would pay twice) — watch `hash`, the body hash `sendTransaction` returns.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-ton/src/errors.ts:53
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `string`
Defined in: wallet-ton/src/errors.ts:52
Hex hash of the signed body.
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-ton/src/errors.ts:50
Always true: the transaction may be on its way.
# HistoryUnavailableError
Defined in: wallet-ton/src/history.ts:77
Every configured history backend failed (or none was configured).
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: wallet-ton/src/history.ts:81
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: wallet-ton/src/history.ts:80
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: wallet-ton/src/history.ts:78
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-ton/src/history.ts:79
# MessageIsTransactionError
Defined in: wallet-ton/src/errors.ts:23
`sign()` refused a 32-byte message: the wallet contract checks a transfer’s signature over the 32-byte hash of its signing cell, so a signature over 32 raw bytes may authorise one. TON Connect proofs and signData go through `signTonProof` / `signTonConnectData`; transactions through `signTransaction` / `sendTransaction`, where they are reviewed.
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new MessageIsTransactionError**(): `MessageIsTransactionError`
Defined in: wallet-ton/src/errors.ts:25
#### Returns
[Section titled “Returns”](#returns)
`MessageIsTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> `readonly` **code**: `"message-is-transaction"` = `'message-is-transaction'`
Defined in: wallet-ton/src/errors.ts:24
# SimulationError
Defined in: wallet-ton/src/errors.ts:32
Emulation of the external message failed (non-zero compute exit, aborted, action phase failed); nothing was signed or sent.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SimulationError**(`reason`, `details?`): `SimulationError`
Defined in: wallet-ton/src/errors.ts:35
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
##### details?
[Section titled “details?”](#details)
###### aborted?
[Section titled “aborted?”](#aborted)
`boolean`
###### exitCode?
[Section titled “exitCode?”](#exitcode)
`number`
#### Returns
[Section titled “Returns”](#returns)
`SimulationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### aborted
[Section titled “aborted”](#aborted-1)
> `readonly` **aborted**: `boolean`
Defined in: wallet-ton/src/errors.ts:34
***
### exitCode
[Section titled “exitCode”](#exitcode-1)
> `readonly` **exitCode**: `number` | `undefined`
Defined in: wallet-ton/src/errors.ts:33
# TonCenter
Defined in: wallet-ton/src/toncenter.ts:164
The toncenter calls a wallet uses, with parsed results.
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new TonCenter**(`rpc`): `TonCenter`
Defined in: wallet-ton/src/toncenter.ts:165
#### Parameters
[Section titled “Parameters”](#parameters)
##### rpc
[Section titled “rpc”](#rpc)
[`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
#### Returns
[Section titled “Returns”](#returns)
`TonCenter`
## Properties
[Section titled “Properties”](#properties)
### rpc
[Section titled “rpc”](#rpc-1)
> `readonly` **rpc**: [`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
Defined in: wallet-ton/src/toncenter.ts:165
## Methods
[Section titled “Methods”](#methods)
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`address`, `args`): `Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
Defined in: wallet-ton/src/toncenter.ts:222
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### address
[Section titled “address”](#address)
`Address`
##### args
[Section titled “args”](#args)
###### body
[Section titled “body”](#body)
`Cell`
###### ignoreSignature?
[Section titled “ignoreSignature?”](#ignoresignature)
`boolean`
###### init?
[Section titled “init?”](#init)
`StateInit`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
***
### getAddressInformation()
[Section titled “getAddressInformation()”](#getaddressinformation)
> **getAddressInformation**(`address`): `Promise`<[`TonAccountState`](/api/anywalletkit/wallet-ton/interfaces/tonaccountstate/)>
Defined in: wallet-ton/src/toncenter.ts:168
Balance, status, code and data of an account.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`Address`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`TonAccountState`](/api/anywalletkit/wallet-ton/interfaces/tonaccountstate/)>
***
### getTransactions()
[Section titled “getTransactions()”](#gettransactions)
> **getTransactions**(`address`, `opts`): `Promise`<`Transaction`\[]>
Defined in: wallet-ton/src/toncenter.ts:209
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### address
[Section titled “address”](#address-2)
`Address`
##### opts
[Section titled “opts”](#opts)
###### archival?
[Section titled “archival?”](#archival)
`boolean`
###### hash?
[Section titled “hash?”](#hash)
`string`
###### limit
[Section titled “limit”](#limit)
`number`
###### lt?
[Section titled “lt?”](#lt)
`string`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`Transaction`\[]>
***
### runGetMethod()
[Section titled “runGetMethod()”](#rungetmethod)
> **runGetMethod**(`address`, `method`, `stack?`): `Promise`<[`GetMethodResult`](/api/anywalletkit/wallet-ton/interfaces/getmethodresult/)>
Defined in: wallet-ton/src/toncenter.ts:183
Call a contract get-method; the result carries the exit code.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address-3)
`Address`
##### method
[Section titled “method”](#method)
`string`
##### stack?
[Section titled “stack?”](#stack)
`TupleItem`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`GetMethodResult`](/api/anywalletkit/wallet-ton/interfaces/getmethodresult/)>
***
### runGetMethodOk()
[Section titled “runGetMethodOk()”](#rungetmethodok)
> **runGetMethodOk**(`address`, `method`, `stack?`): `Promise`<[`GetMethodResult`](/api/anywalletkit/wallet-ton/interfaces/getmethodresult/)>
Defined in: wallet-ton/src/toncenter.ts:192
Like runGetMethod but throws on a non-zero exit code.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### address
[Section titled “address”](#address-4)
`Address`
##### method
[Section titled “method”](#method-1)
`string`
##### stack?
[Section titled “stack?”](#stack-1)
`TupleItem`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`GetMethodResult`](/api/anywalletkit/wallet-ton/interfaces/getmethodresult/)>
***
### sendBoc()
[Section titled “sendBoc()”](#sendboc)
> **sendBoc**(`message`): `Promise`<`void`>
Defined in: wallet-ton/src/toncenter.ts:199
Broadcast a signed external message.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### message
[Section titled “message”](#message)
`Cell`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`void`>
***
### sendBocReturnHash()
[Section titled “sendBocReturnHash()”](#sendbocreturnhash)
> **sendBocReturnHash**(`message`): `Promise`<`string`>
Defined in: wallet-ton/src/toncenter.ts:204
Broadcast and return the external-message hash (base64) toncenter reports.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### message
[Section titled “message”](#message-1)
`Cell`
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`string`>
# UnsafeTransactionError
Defined in: wallet-ton/src/errors.ts:8
Refused before signing: the message would almost certainly misbehave or strand funds (zero value, wrong network flag, exotic workchain, a `valid_until` further away than the wallet contract tolerates…).
## Extends
[Section titled “Extends”](#extends)
* `SignerError`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`code`, `message`): `UnsafeTransactionError`
Defined in: wallet-ton/src/errors.ts:10
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
`string`
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`SignerError.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: `string`
Defined in: wallet-ton/src/errors.ts:9
# WalletAccountReadOnlyTon
Defined in: wallet-ton/src/read-only-account.ts:33
A TON V5R1 wallet without a key: balance, jetton balances, seqno, fee estimates, emulation, receipts and signature checks.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlyTon**(`publicKey`, `config?`): `WalletAccountReadOnlyTon`
Defined in: wallet-ton/src/read-only-account.ts:45
#### Parameters
[Section titled “Parameters”](#parameters)
##### publicKey
[Section titled “publicKey”](#publickey)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### config?
[Section titled “config?”](#config)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlyTon`
## Properties
[Section titled “Properties”](#properties)
### \_address
[Section titled “\_address”](#_address)
> `protected` `readonly` **\_address**: `Address`
Defined in: wallet-ton/src/read-only-account.ts:42
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)
Defined in: wallet-ton/src/read-only-account.ts:39
***
### \_init
[Section titled “\_init”](#_init)
> `protected` `readonly` **\_init**: `StateInit`
Defined in: wallet-ton/src/read-only-account.ts:41
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: [`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/) | `undefined`
Defined in: wallet-ton/src/read-only-account.ts:43
***
### \_walletId
[Section titled “\_walletId”](#_walletid)
> `protected` `readonly` **\_walletId**: `bigint`
Defined in: wallet-ton/src/read-only-account.ts:40
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `string`
Defined in: wallet-ton/src/read-only-account.ts:38
User-friendly address.
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-ton/src/read-only-account.ts:34
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-ton/src/read-only-account.ts:36
Ed25519 public key the wallet is derived from.
## Methods
[Section titled “Methods”](#methods)
### checkedAddress()
[Section titled “checkedAddress()”](#checkedaddress)
> `protected` **checkedAddress**(`to`): `object`
Defined in: wallet-ton/src/read-only-account.ts:135
A destination address with the checks every payment gets: workchain 0 or -1, and a friendly address’s test-only flag matching the wallet’s network. Used for a native message’s `to` and a jetton transfer’s recipient and response destination (round 3, L8).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`object`
##### address
[Section titled “address”](#address-1)
> **address**: `Address`
##### bounceable
[Section titled “bounceable”](#bounceable)
> **bounceable**: `boolean`
***
### describe()
[Section titled “describe()”](#describe)
> **describe**(`tx`): [`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
Defined in: wallet-ton/src/read-only-account.ts:281
Offline description of what `tx` does — see [describeTransaction](/api/anywalletkit/wallet-ton/functions/describetransaction/).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-2)
[`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
***
### estimateFees()
[Section titled “estimateFees()”](#estimatefees)
> **estimateFees**(`body`): `Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
Defined in: wallet-ton/src/read-only-account.ts:234
in_fwd + storage + gas + fwd from toncenter’s estimateFee (signature ignored).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### body
[Section titled “body”](#body)
`Cell`
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-ton/src/read-only-account.ts:70
The user-friendly address.
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:73
Native balance in nanotons.
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getJettonWalletAddress()
[Section titled “getJettonWalletAddress()”](#getjettonwalletaddress)
> **getJettonWalletAddress**(`token`): `Promise`<`Address`>
Defined in: wallet-ton/src/read-only-account.ts:86
Resolve this wallet’s jetton wallet for a jetton master.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`Address`>
***
### getSeqno()
[Section titled “getSeqno()”](#getseqno)
> **getSeqno**(): `Promise`<`number`>
Defined in: wallet-ton/src/read-only-account.ts:78
Current seqno — 0 until the wallet contract is deployed. Always fetched fresh.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`number`>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:114
Jetton balance in base units, read from this wallet’s jetton wallet; 0 when it does not exist.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`TonReceipt`](/api/anywalletkit/wallet-ton/interfaces/tonreceipt/) | `undefined`>
Defined in: wallet-ton/src/read-only-account.ts:289
Receipt for a body hash returned by sendTransaction: toncenter v3 maps the message body hash to the account transaction, which is then fetched.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`TonReceipt`](/api/anywalletkit/wallet-ton/interfaces/tonreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### initIfNeeded()
[Section titled “initIfNeeded()”](#initifneeded)
> `protected` **initIfNeeded**(): `Promise`<`StateInit` | `undefined`>
Defined in: wallet-ton/src/read-only-account.ts:228
StateInit to attach to an external when the wallet is not deployed yet.
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`StateInit` | `undefined`>
***
### jettonTransferMessage()
[Section titled “jettonTransferMessage()”](#jettontransfermessage)
> `protected` **jettonTransferMessage**(`o`): `Promise`<[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)>
Defined in: wallet-ton/src/read-only-account.ts:166
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### o
[Section titled “o”](#o)
[`TonTransferOptions`](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)>
***
### jettonWalletData()
[Section titled “jettonWalletData()”](#jettonwalletdata)
> `protected` **jettonWalletData**(`token`, `jw`): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:100
Read a jetton wallet and prove it is ours for `token`: `get_wallet_data` must name this wallet as owner and `token` as master. The master’s own `get_wallet_address` answer is not trusted on its own — a fake master could point at our real wallet of another jetton (e.g. USDT).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### token
[Section titled “token”](#token-2)
`string`
##### jw
[Section titled “jw”](#jw)
`Address`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-ton/src/read-only-account.ts:268
Estimated fee of a transaction, in nanotons.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### tx
[Section titled “tx”](#tx-1)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-ton/src/read-only-account.ts:274
Estimated fee of a transfer, in nanotons.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### o
[Section titled “o”](#o-1)
[`TonTransferOptions`](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/)
Defined in: wallet-ton/src/read-only-account.ts:64
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
[`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/)
***
### signingCell()
[Section titled “signingCell()”](#signingcell)
> `protected` **signingCell**(`messages`): `Promise`<{ `seqno`: `number`; `signing`: `Cell`; `validUntil`: `number`; }>
Defined in: wallet-ton/src/read-only-account.ts:219
The cell to sign for `messages` at the CURRENT seqno (fetched fresh every time).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### messages
[Section titled “messages”](#messages)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<{ `seqno`: `number`; `signing`: `Cell`; `validUntil`: `number`; }>
***
### simulateBody()
[Section titled “simulateBody()”](#simulatebody)
> **simulateBody**(`body`): `Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
Defined in: wallet-ton/src/read-only-account.ts:247
Preflight an external body: fees via estimateFee and, unless `config.emulate === false`, a trace emulation (tonapi by default, see [TonConfig.emulate](/api/anywalletkit/wallet-ton/interfaces/tonconfig/#emulate)) whose compute/action phases — and the first-hop internal messages — decide `ok`. Never throws for a failing emulation, only for transport problems or a malformed emulator response.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### body
[Section titled “body”](#body-1)
`Cell`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
Defined in: wallet-ton/src/read-only-account.ts:262
Preflight a [TonSendable](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/) (unsigned body, current seqno).
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### tx
[Section titled “tx”](#tx-2)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
***
### stateInitOf()
[Section titled “stateInitOf()”](#stateinitof)
> `protected` **stateInitOf**(`src`): `StateInit` | `undefined`
Defined in: wallet-ton/src/read-only-account.ts:123
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### src
[Section titled “src”](#src)
`string` | `Cell` | `StateInit` | `undefined`
#### Returns
[Section titled “Returns”](#returns-19)
`StateInit` | `undefined`
***
### toMessages()
[Section titled “toMessages()”](#tomessages)
> `protected` **toMessages**(`tx`): [`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
Defined in: wallet-ton/src/read-only-account.ts:204
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tx
[Section titled “tx”](#tx-3)
[`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/) | [`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)\[]
#### Returns
[Section titled “Returns”](#returns-20)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
***
### transactionMessage()
[Section titled “transactionMessage()”](#transactionmessage)
> `protected` **transactionMessage**(`tx`): [`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)
Defined in: wallet-ton/src/read-only-account.ts:156
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### tx
[Section titled “tx”](#tx-4)
[`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)
#### Returns
[Section titled “Returns”](#returns-21)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)
***
### validUntil()
[Section titled “validUntil()”](#validuntil)
> `protected` **validUntil**(): `number`
Defined in: wallet-ton/src/read-only-account.ts:210
#### Returns
[Section titled “Returns”](#returns-22)
`number`
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-ton/src/read-only-account.ts:308
ed25519 over the raw message bytes; `signature` hex.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.verify`
# WalletAccountTon
Defined in: wallet-ton/src/account.ts:34
Signing TON account on Wallet V5R1. It never holds a key: the V5R1 body is signed by `signer.sign(signingCell.hash(), {scheme: 'ed25519', context: 'ton-external'})` — a LocalSigner for seed wallets, anything else (hardware, MPC, backend) through `externalSigner()`.
Every send runs: hard checks → fresh seqno → preflight on the zero-signed body (estimateFee, emulation when configured, fee cap) → sign → broadcast. The preflight body carries a zero signature, so the signer is only asked once the transaction has passed.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountTon**(`signer`, `publicKey`, `path`, `config?`): `WalletAccountTon`
Defined in: wallet-ton/src/account.ts:50
`publicKey` is the signer’s 32-byte ed25519 key; the V5R1 address derives from it synchronously.
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountTon`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`constructor`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_address
[Section titled “\_address”](#_address)
> `protected` `readonly` **\_address**: `Address`
Defined in: wallet-ton/src/read-only-account.ts:42
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`_address`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#_address)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)
Defined in: wallet-ton/src/read-only-account.ts:39
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`_config`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#_config)
***
### \_init
[Section titled “\_init”](#_init)
> `protected` `readonly` **\_init**: `StateInit`
Defined in: wallet-ton/src/read-only-account.ts:41
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`_init`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#_init)
***
### \_rpc
[Section titled “\_rpc”](#_rpc)
> `protected` `readonly` **\_rpc**: [`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/) | `undefined`
Defined in: wallet-ton/src/read-only-account.ts:43
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`_rpc`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#_rpc)
***
### \_walletId
[Section titled “\_walletId”](#_walletid)
> `protected` `readonly` **\_walletId**: `bigint`
Defined in: wallet-ton/src/read-only-account.ts:40
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`_walletId`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#_walletid)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `string`
Defined in: wallet-ton/src/read-only-account.ts:38
User-friendly address.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`address`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#address)
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-ton/src/read-only-account.ts:34
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`chain`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#chain)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `true` = `true`
Defined in: wallet-ton/src/account.ts:36
seqno and fees come from the network before signing.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-ton/src/account.ts:38
Derivation path, `ton-mnemonic`, or `external`.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-ton/src/read-only-account.ts:36
Ed25519 public key the wallet is derived from.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`publicKey`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#publickey)
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"external"` | `"seed"` | `"key"`
Defined in: wallet-ton/src/account.ts:46
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-ton/src/account.ts:63
Account index for the standard m/44’/607’/i’ path.
##### Returns
[Section titled “Returns”](#returns-1)
`number` | `undefined`
## Methods
[Section titled “Methods”](#methods)
### checkedAddress()
[Section titled “checkedAddress()”](#checkedaddress)
> `protected` **checkedAddress**(`to`): `object`
Defined in: wallet-ton/src/read-only-account.ts:135
A destination address with the checks every payment gets: workchain 0 or -1, and a friendly address’s test-only flag matching the wallet’s network. Used for a native message’s `to` and a jetton transfer’s recipient and response destination (round 3, L8).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### to
[Section titled “to”](#to)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`object`
##### address
[Section titled “address”](#address-1)
> **address**: `Address`
##### bounceable
[Section titled “bounceable”](#bounceable)
> **bounceable**: `boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`checkedAddress`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#checkedaddress)
***
### describe()
[Section titled “describe()”](#describe)
> **describe**(`tx`): [`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
Defined in: wallet-ton/src/read-only-account.ts:281
Offline description of what `tx` does — see [describeTransaction](/api/anywalletkit/wallet-ton/functions/describetransaction/).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-3)
[`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`describe`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#describe)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-ton/src/account.ts:222
Disposes the signer: a local key is zeroized, an external one is released.
#### Returns
[Section titled “Returns”](#returns-4)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### estimateFees()
[Section titled “estimateFees()”](#estimatefees)
> **estimateFees**(`body`): `Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
Defined in: wallet-ton/src/read-only-account.ts:234
in_fwd + storage + gas + fwd from toncenter’s estimateFee (signature ignored).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### body
[Section titled “body”](#body)
`Cell`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`estimateFees`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#estimatefees)
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-ton/src/read-only-account.ts:70
The user-friendly address.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getAddress`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#getaddress)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:73
Native balance in nanotons.
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getBalance`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#getbalance)
***
### getJettonWalletAddress()
[Section titled “getJettonWalletAddress()”](#getjettonwalletaddress)
> **getJettonWalletAddress**(`token`): `Promise`<`Address`>
Defined in: wallet-ton/src/read-only-account.ts:86
Resolve this wallet’s jetton wallet for a jetton master.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### token
[Section titled “token”](#token)
`string`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<`Address`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getJettonWalletAddress`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#getjettonwalletaddress)
***
### getSeqno()
[Section titled “getSeqno()”](#getseqno)
> **getSeqno**(): `Promise`<`number`>
Defined in: wallet-ton/src/read-only-account.ts:78
Current seqno — 0 until the wallet contract is deployed. Always fetched fresh.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`number`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getSeqno`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#getseqno)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:114
Jetton balance in base units, read from this wallet’s jetton wallet; 0 when it does not exist.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getTokenBalance`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#gettokenbalance)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`TonReceipt`](/api/anywalletkit/wallet-ton/interfaces/tonreceipt/) | `undefined`>
Defined in: wallet-ton/src/read-only-account.ts:289
Receipt for a body hash returned by sendTransaction: toncenter v3 maps the message body hash to the account transaction, which is then fetched.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<[`TonReceipt`](/api/anywalletkit/wallet-ton/interfaces/tonreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`getTransactionReceipt`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#gettransactionreceipt)
***
### initIfNeeded()
[Section titled “initIfNeeded()”](#initifneeded)
> `protected` **initIfNeeded**(): `Promise`<`StateInit` | `undefined`>
Defined in: wallet-ton/src/read-only-account.ts:228
StateInit to attach to an external when the wallet is not deployed yet.
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`StateInit` | `undefined`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`initIfNeeded`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#initifneeded)
***
### jettonTransferMessage()
[Section titled “jettonTransferMessage()”](#jettontransfermessage)
> `protected` **jettonTransferMessage**(`o`): `Promise`<[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)>
Defined in: wallet-ton/src/read-only-account.ts:166
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### o
[Section titled “o”](#o)
[`TonTransferOptions`](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`jettonTransferMessage`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#jettontransfermessage)
***
### jettonWalletData()
[Section titled “jettonWalletData()”](#jettonwalletdata)
> `protected` **jettonWalletData**(`token`, `jw`): `Promise`<`bigint`>
Defined in: wallet-ton/src/read-only-account.ts:100
Read a jetton wallet and prove it is ours for `token`: `get_wallet_data` must name this wallet as owner and `token` as master. The master’s own `get_wallet_address` answer is not trusted on its own — a fake master could point at our real wallet of another jetton (e.g. USDT).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### token
[Section titled “token”](#token-2)
`string`
##### jw
[Section titled “jw”](#jw)
`Address`
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`jettonWalletData`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#jettonwalletdata)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-ton/src/read-only-account.ts:268
Estimated fee of a transaction, in nanotons.
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### tx
[Section titled “tx”](#tx-1)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.quoteSendTransaction`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`quoteSendTransaction`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#quotesendtransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<{ `fee`: `bigint`; }>
Defined in: wallet-ton/src/read-only-account.ts:274
Estimated fee of a transfer, in nanotons.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### o
[Section titled “o”](#o-1)
[`TonTransferOptions`](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<{ `fee`: `bigint`; }>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`quoteTransfer`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#quotetransfer)
***
### requireRpc()
[Section titled “requireRpc()”](#requirerpc)
> `protected` **requireRpc**(`what`): [`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/)
Defined in: wallet-ton/src/read-only-account.ts:64
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### what
[Section titled “what”](#what)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
[`TonCenter`](/api/anywalletkit/wallet-ton/classes/toncenter/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`requireRpc`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#requirerpc)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<`TransferResult`>
Defined in: wallet-ton/src/account.ts:198
Sign and broadcast; `hash` is the body hash (hex) — resolve it with getTransactionReceipt.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### tx
[Section titled “tx”](#tx-2)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
##### options?
[Section titled “options?”](#options)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-ton/src/account.ts:76
Hex ed25519 signature over the raw message bytes. A 32-byte message — string or bytes — is refused with [MessageIsTransactionError](/api/anywalletkit/wallet-ton/classes/messageistransactionerror/): the wallet contract checks a transfer’s signature over the 32-byte hash of its signing cell, so those bytes could be one. Bytes that carry this account’s public key are refused as well: one ed25519 key (an external signer) may also be a Solana wallet, and a Solana transaction names its signer’s key. TON Connect goes through [signTonProof](/api/anywalletkit/wallet-ton/classes/walletaccountton/#signtonproof) and [signTonConnectData](/api/anywalletkit/wallet-ton/classes/walletaccountton/#signtonconnectdata).
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sign`
***
### signingCell()
[Section titled “signingCell()”](#signingcell)
> `protected` **signingCell**(`messages`): `Promise`<{ `seqno`: `number`; `signing`: `Cell`; `validUntil`: `number`; }>
Defined in: wallet-ton/src/read-only-account.ts:219
The cell to sign for `messages` at the CURRENT seqno (fetched fresh every time).
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### messages
[Section titled “messages”](#messages)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<{ `seqno`: `number`; `signing`: `Cell`; `validUntil`: `number`; }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`signingCell`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#signingcell)
***
### signTonConnectData()
[Section titled “signTonConnectData()”](#signtonconnectdata)
> **signTonConnectData**(`request`): `Promise`<[`TonSignedData`](/api/anywalletkit/wallet-ton/interfaces/tonsigneddata/)>
Defined in: wallet-ton/src/account.ts:99
TON Connect `signData` (text / binary) for this wallet’s address: the reply the dApp gets.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### request
[Section titled “request”](#request)
[`TonSignDataRequest`](/api/anywalletkit/wallet-ton/interfaces/tonsigndatarequest/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`TonSignedData`](/api/anywalletkit/wallet-ton/interfaces/tonsigneddata/)>
***
### signTonProof()
[Section titled “signTonProof()”](#signtonproof)
> **signTonProof**(`request`): `Promise`<[`TonProof`](/api/anywalletkit/wallet-ton/interfaces/tonproof/)>
Defined in: wallet-ton/src/account.ts:87
TON Connect `ton_proof` for this wallet’s address: the `proof` object of the connect reply. The digest is built here (0xffff ‖ “ton-connect” ‖ …), so no request can turn it into a transfer. `domain` is the host the wallet saw the request come from.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### request
[Section titled “request”](#request-1)
[`TonProofRequest`](/api/anywalletkit/wallet-ton/interfaces/tonproofrequest/)
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`TonProof`](/api/anywalletkit/wallet-ton/interfaces/tonproof/)>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-ton/src/account.ts:173
Sign without broadcasting. Returns the external-message BODY as base64 BoC (pass it back to sendTransaction as a Cell).
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### tx
[Section titled “tx”](#tx-3)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
##### options?
[Section titled “options?”](#options-1)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.signTransaction`
***
### simulateBody()
[Section titled “simulateBody()”](#simulatebody)
> **simulateBody**(`body`): `Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
Defined in: wallet-ton/src/read-only-account.ts:247
Preflight an external body: fees via estimateFee and, unless `config.emulate === false`, a trace emulation (tonapi by default, see [TonConfig.emulate](/api/anywalletkit/wallet-ton/interfaces/tonconfig/#emulate)) whose compute/action phases — and the first-hop internal messages — decide `ok`. Never throws for a failing emulation, only for transport problems or a malformed emulator response.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### body
[Section titled “body”](#body-1)
`Cell`
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`simulateBody`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#simulatebody)
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
Defined in: wallet-ton/src/read-only-account.ts:262
Preflight a [TonSendable](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/) (unsigned body, current seqno).
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### tx
[Section titled “tx”](#tx-4)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`TonSimulation`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`simulateTransaction`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#simulatetransaction)
***
### stateInitOf()
[Section titled “stateInitOf()”](#stateinitof)
> `protected` **stateInitOf**(`src`): `StateInit` | `undefined`
Defined in: wallet-ton/src/read-only-account.ts:123
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### src
[Section titled “src”](#src)
`string` | `Cell` | `StateInit` | `undefined`
#### Returns
[Section titled “Returns”](#returns-26)
`StateInit` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`stateInitOf`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#stateinitof)
***
### toMessages()
[Section titled “toMessages()”](#tomessages)
> `protected` **toMessages**(`tx`): [`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
Defined in: wallet-ton/src/read-only-account.ts:204
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### tx
[Section titled “tx”](#tx-5)
[`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/) | [`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)\[]
#### Returns
[Section titled “Returns”](#returns-27)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`toMessages`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#tomessages)
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-ton/src/account.ts:216
The same wallet as a [WalletAccountReadOnlyTon](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).
#### Returns
[Section titled “Returns”](#returns-28)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.toReadOnlyAccount`
***
### transactionMessage()
[Section titled “transactionMessage()”](#transactionmessage)
> `protected` **transactionMessage**(`tx`): [`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)
Defined in: wallet-ton/src/read-only-account.ts:156
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### tx
[Section titled “tx”](#tx-6)
[`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)
#### Returns
[Section titled “Returns”](#returns-29)
[`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`transactionMessage`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#transactionmessage)
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`o`, `writeOptions?`): `Promise`<`TransferResult`>
Defined in: wallet-ton/src/account.ts:208
TON (no `token`) or jetton transfer.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### o
[Section titled “o”](#o-2)
[`TonTransferOptions`](/api/anywalletkit/wallet-ton/interfaces/tontransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<`TransferResult`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.transfer`
***
### validUntil()
[Section titled “validUntil()”](#validuntil)
> `protected` **validUntil**(): `number`
Defined in: wallet-ton/src/read-only-account.ts:210
#### Returns
[Section titled “Returns”](#returns-31)
`number`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`validUntil`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#validuntil)
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-ton/src/read-only-account.ts:308
ed25519 over the raw message bytes; `signature` hex.
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-32)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-30)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/).[`verify`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/#verify)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`): `WalletAccountTon`
Defined in: wallet-ton/src/account.ts:58
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-2)
`string`
##### config?
[Section titled “config?”](#config-1)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-33)
`WalletAccountTon`
# WalletManagerTon
Defined in: wallet-ton/src/manager.ts:26
One seed → TON accounts at m/44’/607’/i’ (SLIP-10 ed25519) on Wallet V5R1 — the derivation Trust Wallet and Ledger use for a BIP-39 phrase. Paths may be relative to m/44’/607’ (“0’”) or full.
Built with an ed25519 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at `m/44'/607'` yields `getAccount(i)` → `i'` children;
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’); other indexes/paths throw.
Tonkeeper-style 24-word TON mnemonics (not BIP-39) are imported with [WalletManagerTon.fromTonMnemonic](/api/anywalletkit/wallet-ton/classes/walletmanagerton/#fromtonmnemonic); they yield one account at `ton-mnemonic`.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/), [`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerTon**(`seedOrSigner`, `config?`): `WalletManagerTon`
Defined in: wallet-ton/src/manager.ts:27
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerTon`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/) | `Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
Defined in: wallet-ton/src/manager.ts:49
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
Defined in: wallet-ton/src/manager.ts:59
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-ton/src/manager.ts:101
Gas price from config param 21 via tonapi (normal = fast there; slow = ×0.8 here).
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`publicKey`): [`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/)
Defined in: wallet-ton/src/manager.ts:96
Watch-only account for a public key (hex or bytes) — TON addresses derive from the key, not the other way round.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### publicKey
[Section titled “publicKey”](#publickey)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-7)
[`WalletAccountReadOnlyTon`](/api/anywalletkit/wallet-ton/classes/walletaccountreadonlyton/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-8)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-9)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-ton/classes/walletmanagerton/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`WalletAccountTon`](/api/anywalletkit/wallet-ton/classes/walletaccountton/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### fromTonMnemonic()
[Section titled “fromTonMnemonic()”](#fromtonmnemonic)
> `static` **fromTonMnemonic**(`words`, `config?`): `Promise`<`WalletManagerTon`>
Defined in: wallet-ton/src/manager.ts:37
Import a TON-native mnemonic (24 words, Tonkeeper / Tonhub / MyTonWallet default): PBKDF2 per @ton/crypto, one ed25519 key, one V5R1 account at path `ton-mnemonic` with the address those wallets show.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### words
[Section titled “words”](#words)
`string` | `string`\[]
##### config?
[Section titled “config?”](#config-1)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`WalletManagerTon`>
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-ton/classes/walletmanagerton/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### words?
[Section titled “words?”](#words-1)
`24` | `12`
#### Returns
[Section titled “Returns”](#returns-12)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-ton/classes/walletmanagerton/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-13)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# canonicalBocCell
> **canonicalBocCell**(`b64`, `what?`): `Cell`
Defined in: wallet-ton/src/describe.ts:149
A base64 BoC as its single root Cell, refused when its layout is one other readers may parse differently from @ton/core: a magic other than the generic one, more than one root, absent cells, or any cell that stores its hashes (with_hashes: @ton/core skips a hash area another reader takes for data), has a level mask, or is exotic. What remains is read the same by every reader, the kit’s policy reader included, whatever order the serializer put the cells in (scan 2026-10-27 F2, F4). Real provider BoCs order cells differently from @ton/core, so the bytes are not required to round-trip.
## Parameters
[Section titled “Parameters”](#parameters)
### b64
[Section titled “b64”](#b64)
`string`
### what?
[Section titled “what?”](#what)
`string` = `'bodyBoc'`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# commentCell
> **commentCell**(`text`): `Cell`
Defined in: wallet-ton/src/describe.ts:217
A text comment body (op 0 plus the text), as wallets show it.
## Parameters
[Section titled “Parameters”](#parameters)
### text
[Section titled “text”](#text)
`string`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# createTonClient
> **createTonClient**(`config`): [`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/) | `undefined`
Defined in: wallet-ton/src/toncenter.ts:74
One RPC, or a failover RPC walking the configured list (`retries` extra rounds after the first full pass).
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`TonConfig`](/api/anywalletkit/wallet-ton/interfaces/tonconfig/)
## Returns
[Section titled “Returns”](#returns)
[`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/) | `undefined`
# createTonHistory
> **createTonHistory**(`options?`): [`TonHistorySource`](/api/anywalletkit/wallet-ton/interfaces/tonhistorysource/)
Defined in: wallet-ton/src/history.ts:476
A `HistorySource` for TON: tonapi account events first, toncenter v3 when tonapi is down or disabled. Both page by `lt`, so a cursor from one backend resumes on the other.
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`TonHistoryOptions`](/api/anywalletkit/wallet-ton/interfaces/tonhistoryoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`TonHistorySource`](/api/anywalletkit/wallet-ton/interfaces/tonhistorysource/)
# decodeBody
> **decodeBody**(`body`): [`DecodedBody`](/api/anywalletkit/wallet-ton/type-aliases/decodedbody/)
Defined in: wallet-ton/src/describe.ts:91
Decode a message body cell.
## Parameters
[Section titled “Parameters”](#parameters)
### body
[Section titled “body”](#body)
`Cell`
## Returns
[Section titled “Returns”](#returns)
[`DecodedBody`](/api/anywalletkit/wallet-ton/type-aliases/decodedbody/)
# decodeHistoryCursor
> **decodeHistoryCursor**(`s`): [`TonHistoryCursor`](/api/anywalletkit/wallet-ton/interfaces/tonhistorycursor/)
Defined in: wallet-ton/src/history.ts:107
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TonHistoryCursor`](/api/anywalletkit/wallet-ton/interfaces/tonhistorycursor/)
# describeMessageRelaxed
> **describeMessageRelaxed**(`i`, `m`, `warnings`, `ctx?`): [`TonDescribedMessage`](/api/anywalletkit/wallet-ton/interfaces/tondescribedmessage/)
Defined in: wallet-ton/src/describe.ts:274
Describe one outgoing message and push its warnings into `warnings`.
## Parameters
[Section titled “Parameters”](#parameters)
### i
[Section titled “i”](#i)
`number`
### m
[Section titled “m”](#m)
`MessageRelaxed`
### warnings
[Section titled “warnings”](#warnings)
[`TonWarning`](/api/anywalletkit/wallet-ton/interfaces/tonwarning/)\[]
### ctx?
[Section titled “ctx?”](#ctx)
#### network?
[Section titled “network?”](#network)
`"mainnet"` | `"testnet"`
## Returns
[Section titled “Returns”](#returns)
[`TonDescribedMessage`](/api/anywalletkit/wallet-ton/interfaces/tondescribedmessage/)
# describeTransaction
> **describeTransaction**(`tx`, `ctx?`): [`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
Defined in: wallet-ton/src/describe.ts:286
Describe what a [TonSendable](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/) will do. Offline; never throws on malformed bodies (they become warnings).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TonSendable`](/api/anywalletkit/wallet-ton/type-aliases/tonsendable/)
### ctx?
[Section titled “ctx?”](#ctx)
#### network?
[Section titled “network?”](#network)
`"mainnet"` | `"testnet"`
## Returns
[Section titled “Returns”](#returns)
[`TonDescription`](/api/anywalletkit/wallet-ton/interfaces/tondescription/)
# emulateExternal
> **emulateExternal**(`url`, `message`, `opts?`): `Promise`<[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)>
Defined in: wallet-ton/src/toncenter.ts:289
POST the external message to a toncenter v3 emulation endpoint and reduce the trace.
## Parameters
[Section titled “Parameters”](#parameters)
### url
[Section titled “url”](#url)
`string`
### message
[Section titled “message”](#message)
`Cell`
### opts?
[Section titled “opts?”](#opts)
#### apiKey?
[Section titled “apiKey?”](#apikey)
`string`
#### fetch?
[Section titled “fetch?”](#fetch)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
#### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)>
# emulateViaTonapi
> **emulateViaTonapi**(`baseUrl`, `message`, `opts?`): `Promise`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)>
Defined in: wallet-ton/src/emulation.ts:203
Emulate through tonapi: `/wallet/emulate` first (verdict + risk), then `/traces/emulate` when the first is not served (404). The external carries a zero signature; `ignore_signature_check=true` is sent on both calls.
## Parameters
[Section titled “Parameters”](#parameters)
### baseUrl
[Section titled “baseUrl”](#baseurl)
`string`
### message
[Section titled “message”](#message)
`Cell`
### opts?
[Section titled “opts?”](#opts)
[`EmulateOptions`](/api/anywalletkit/wallet-ton/interfaces/emulateoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)>
# encodeHistoryCursor
> **encodeHistoryCursor**(`c`): `string`
Defined in: wallet-ton/src/history.ts:103
## Parameters
[Section titled “Parameters”](#parameters)
### c
[Section titled “c”](#c)
[`TonHistoryCursor`](/api/anywalletkit/wallet-ton/interfaces/tonhistorycursor/)
## Returns
[Section titled “Returns”](#returns)
`string`
# installBufferGlobal
> **installBufferGlobal**(): `void`
Defined in: wallet-ton/src/buffer-global.ts:13
Set `globalThis.Buffer` to the `buffer` polyfill when the runtime has none (Hermes, browsers). Runs on import.
## Returns
[Section titled “Returns”](#returns)
`void`
# isAnsweredRefusal
> **isAnsweredRefusal**(`e`): `boolean`
Defined in: wallet-ton/src/toncenter.ts:69
An endpoint answered with a node refusal (toncenter’s `ok: false` envelope): nothing was taken. A thrown fetch, a timeout, a non-JSON body or a gateway error may have been.
## Parameters
[Section titled “Parameters”](#parameters)
### e
[Section titled “e”](#e)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# mapTonapiActions
> **mapTonapiActions**(`actions`): [`MappedActions`](/api/anywalletkit/wallet-ton/interfaces/mappedactions/)
Defined in: wallet-ton/src/history.ts:217
tonapi actions → transfers + the contract call. Only `ok` actions move value.
## Parameters
[Section titled “Parameters”](#parameters)
### actions
[Section titled “actions”](#actions)
[`TonapiAction`](/api/anywalletkit/wallet-ton/interfaces/tonapiaction/)\[]
## Returns
[Section titled “Returns”](#returns)
[`MappedActions`](/api/anywalletkit/wallet-ton/interfaces/mappedactions/)
# mapTonapiEvent
> **mapTonapiEvent**(`chain`, `address`, `own`, `event`, `valueFlow?`): [`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)
Defined in: wallet-ton/src/history.ts:367
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### own
[Section titled “own”](#own)
`string`
### event
[Section titled “event”](#event)
[`TonapiEvent`](/api/anywalletkit/wallet-ton/interfaces/tonapievent/)
### valueFlow?
[Section titled “valueFlow?”](#valueflow)
[`TonapiEvent`](/api/anywalletkit/wallet-ton/interfaces/tonapievent/)
## Returns
[Section titled “Returns”](#returns)
[`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)
# mapToncenterTransaction
> **mapToncenterTransaction**(`chain`, `address`, `row`): [`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)
Defined in: wallet-ton/src/history.ts:420
Reduced mapping: TON in / out and op codes of the account’s own transaction; jettons are not visible here.
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### row
[Section titled “row”](#row)
[`V3Transaction`](/api/anywalletkit/wallet-ton/interfaces/v3transaction/)
## Returns
[Section titled “Returns”](#returns)
[`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)
# messageBody
> **messageBody**(`tx`): `Cell` | `undefined`
Defined in: wallet-ton/src/describe.ts:204
The body a message is built with: a Cell, a text comment, or a canonical `bodyBoc`. A `body` that is neither a string nor a Cell is refused rather than replaced by `bodyBoc` (scan 2026-10-27 F4).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)
## Returns
[Section titled “Returns”](#returns)
`Cell` | `undefined`
# parseEmulation
> **parseEmulation**(`json`): [`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)
Defined in: wallet-ton/src/toncenter.ts:260
Reduce an `emulateTrace` response to a verdict for the ROOT transaction (the wallet’s own): compute-phase exit code, aborted flag, action-phase success. Tolerant of the field spellings the v3 API has used (`description.compute_ph` / `compute`, `action.success`); anything unrecognisable is a NetworkError, not a silent pass.
## Parameters
[Section titled “Parameters”](#parameters)
### json
[Section titled “json”](#json)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)
# parseTonapiConsequences
> **parseTonapiConsequences**(`json`): [`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)
Defined in: wallet-ton/src/emulation.ts:159
tonapi `MessageConsequences` (wallet/emulate) → outcome with risk.
## Parameters
[Section titled “Parameters”](#parameters)
### json
[Section titled “json”](#json)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)
# parseTonapiRisk
> **parseTonapiRisk**(`risk`): [`TonRisk`](/api/anywalletkit/wallet-ton/interfaces/tonrisk/)
Defined in: wallet-ton/src/emulation.ts:131
tonapi `Risk` → nanotons / jetton base units as bigints. Malformed → NetworkError.
## Parameters
[Section titled “Parameters”](#parameters)
### risk
[Section titled “risk”](#risk)
`unknown`
## Returns
[Section titled “Returns”](#returns)
[`TonRisk`](/api/anywalletkit/wallet-ton/interfaces/tonrisk/)
# parseTonapiTrace
> **parseTonapiTrace**(`trace`): `Omit`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/), `"source"` | `"risk"`>
Defined in: wallet-ton/src/emulation.ts:91
Reduce a tonapi `Trace` to a verdict. The root (the wallet’s own transaction) decides: compute exit ≠ 0, aborted or a failed action phase → not ok. A failing FIRST-HOP child is also fatal: for every message this wallet builds (TON to a contract, jetton transfer to its own jetton wallet) a bounced first hop means the operation did not happen and the value comes back minus fees. Deeper failures (e.g. a jetton notify the recipient’s wallet rejects) become warnings — the transfer itself already settled.
## Parameters
[Section titled “Parameters”](#parameters)
### trace
[Section titled “trace”](#trace)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`Omit`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/), `"source"` | `"risk"`>
# parseV5R1Body
> **parseV5R1Body**(`body`): [`ParsedV5R1Body`](/api/anywalletkit/wallet-ton/interfaces/parsedv5r1body/) | `null`
Defined in: wallet-ton/src/wallet-v5r1.ts:136
Parse a signed (or zero-signed) V5R1 external body back into its messages. Returns null for anything else.
## Parameters
[Section titled “Parameters”](#parameters)
### body
[Section titled “body”](#body)
`Cell`
## Returns
[Section titled “Returns”](#returns)
[`ParsedV5R1Body`](/api/anywalletkit/wallet-ton/interfaces/parsedv5r1body/) | `null`
# rawTonAddress
> **rawTonAddress**(`a`): `string`
Defined in: wallet-ton/src/history.ts:158
Any spelling → raw lowercase `wc:hex`; unparsable input is returned as-is.
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# resolveEmulate
> **resolveEmulate**(`config`): `false` | { `kind`: `"tonapi"`; `url?`: `string`; } | { `kind`: `"toncenter-v3"`; `url`: `string`; }
Defined in: wallet-ton/src/emulation.ts:220
Resolve the effective emulation config: explicit `emulate`, legacy `emulateUrl`, else tonapi by default.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
#### emulate?
[Section titled “emulate?”](#emulate)
[`TonEmulateConfig`](/api/anywalletkit/wallet-ton/type-aliases/tonemulateconfig/)
#### emulateUrl?
[Section titled “emulateUrl?”](#emulateurl)
`string`
#### tonApiUrl?
[Section titled “tonApiUrl?”](#tonapiurl)
`string`
## Returns
[Section titled “Returns”](#returns)
`false` | { `kind`: `"tonapi"`; `url?`: `string`; } | { `kind`: `"toncenter-v3"`; `url`: `string`; }
# runEmulation
> **runEmulation**(`config`, `message`): `Promise`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/) | `undefined`>
Defined in: wallet-ton/src/emulation.ts:228
Run the configured emulation for an external message.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
#### emulate?
[Section titled “emulate?”](#emulate)
[`TonEmulateConfig`](/api/anywalletkit/wallet-ton/type-aliases/tonemulateconfig/)
#### emulateUrl?
[Section titled “emulateUrl?”](#emulateurl)
`string`
#### fetch?
[Section titled “fetch?”](#fetch)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
#### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number`
#### tonApiKey?
[Section titled “tonApiKey?”](#tonapikey)
`string`
#### tonApiUrl?
[Section titled “tonApiUrl?”](#tonapiurl)
`string`
### message
[Section titled “message”](#message)
`Cell`
## Returns
[Section titled “Returns”](#returns)
`Promise`<[`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/) | `undefined`>
# tonCenterEndpoint
> **tonCenterEndpoint**(`endpoint`, `opts?`): [`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
Defined in: wallet-ton/src/toncenter.ts:16
JSON-RPC over one toncenter v2 endpoint.
## Parameters
[Section titled “Parameters”](#parameters)
### endpoint
[Section titled “endpoint”](#endpoint)
[`TonEndpoint`](/api/anywalletkit/wallet-ton/interfaces/tonendpoint/)
### opts?
[Section titled “opts?”](#opts)
#### fetch?
[Section titled “fetch?”](#fetch)
{(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
#### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
`number`
## Returns
[Section titled “Returns”](#returns)
[`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
# tonExplorerTxUrl
> **tonExplorerTxUrl**(`hash`, `network?`): `string`
Defined in: wallet-ton/src/history.ts:467
Tonviewer link for a transaction.
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### network?
[Section titled “network?”](#network)
`"mainnet"` | `"testnet"`
## Returns
[Section titled “Returns”](#returns)
`string`
# tonProofDigest
> **tonProofDigest**(`address`, `request`): `Uint8Array`
Defined in: wallet-ton/src/tonconnect.ts:83
The 32 bytes a wallet signs for `ton_proof`.
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
[`TonAddressParts`](/api/anywalletkit/wallet-ton/interfaces/tonaddressparts/)
### request
[Section titled “request”](#request)
[`TonProofRequest`](/api/anywalletkit/wallet-ton/interfaces/tonproofrequest/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# tonSignDataDigest
> **tonSignDataDigest**(`address`, `request`): `Uint8Array`
Defined in: wallet-ton/src/tonconnect.ts:92
The 32 bytes a wallet signs for `signData` (text / binary).
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
[`TonAddressParts`](/api/anywalletkit/wallet-ton/interfaces/tonaddressparts/)
### request
[Section titled “request”](#request)
[`TonSignDataRequest`](/api/anywalletkit/wallet-ton/interfaces/tonsigndatarequest/)
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# v5r1Address
> **v5r1Address**(`publicKey`, `opts?`): `Address`
Defined in: wallet-ton/src/wallet-v5r1.ts:75
Address of the V5R1 wallet for a public key.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
### opts?
[Section titled “opts?”](#opts)
#### walletId?
[Section titled “walletId?”](#walletid)
`bigint`
#### workchain?
[Section titled “workchain?”](#workchain)
`number`
## Returns
[Section titled “Returns”](#returns)
`Address`
# v5r1Code
> **v5r1Code**(): `Cell`
Defined in: wallet-ton/src/wallet-v5r1.ts:24
The V5R1 contract code cell (parsed once).
## Returns
[Section titled “Returns”](#returns)
`Cell`
# v5r1ExternalMessage
> **v5r1ExternalMessage**(`to`, `body`, `init?`): `Cell`
Defined in: wallet-ton/src/wallet-v5r1.ts:121
The external-in message (as a cell, ready for sendBoc) carrying `body` to the wallet, with `init` when it is not deployed yet.
## Parameters
[Section titled “Parameters”](#parameters)
### to
[Section titled “to”](#to)
`Address`
### body
[Section titled “body”](#body)
`Cell`
### init?
[Section titled “init?”](#init)
`StateInit`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# v5r1PackSigned
> **v5r1PackSigned**(`signing`, `signature`): `Cell`
Defined in: wallet-ton/src/wallet-v5r1.ts:110
Signature goes at the tail (V5R1 layout).
## Parameters
[Section titled “Parameters”](#parameters)
### signing
[Section titled “signing”](#signing)
`Cell`
### signature
[Section titled “signature”](#signature)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# v5r1PackUnsigned
> **v5r1PackUnsigned**(`signing`): `Cell`
Defined in: wallet-ton/src/wallet-v5r1.ts:116
Same body with a zero signature — what `estimateFee(ignore_chksig)` and emulation take.
## Parameters
[Section titled “Parameters”](#parameters)
### signing
[Section titled “signing”](#signing)
`Cell`
## Returns
[Section titled “Returns”](#returns)
`Cell`
# v5r1SigningMessage
> **v5r1SigningMessage**(`p`): `Cell`
Defined in: wallet-ton/src/wallet-v5r1.ts:90
The cell that gets hashed and signed: op | wallet_id | valid_until | seqno | out-list ref | no extended actions.
## Parameters
[Section titled “Parameters”](#parameters)
### p
[Section titled “p”](#p)
[`V5R1SigningParams`](/api/anywalletkit/wallet-ton/interfaces/v5r1signingparams/)
## Returns
[Section titled “Returns”](#returns)
`Cell`
# v5r1StateInit
> **v5r1StateInit**(`publicKey`, `walletId?`): `StateInit`
Defined in: wallet-ton/src/wallet-v5r1.ts:62
State init (code and data) of a V5R1 wallet for a public key.
## Parameters
[Section titled “Parameters”](#parameters)
### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
### walletId?
[Section titled “walletId?”](#walletid)
`bigint` = `...`
## Returns
[Section titled “Returns”](#returns)
`StateInit`
# v5r1WalletId
> **v5r1WalletId**(`parts?`): `bigint`
Defined in: wallet-ton/src/wallet-v5r1.ts:51
Serialized wallet_id (int32): `networkGlobalId XOR context`, where the client context is {1 bit “client”, int8 workchain, uint8 version (0 = v5r1), uint15 subwallet}.
## Parameters
[Section titled “Parameters”](#parameters)
### parts?
[Section titled “parts?”](#parts)
[`V5R1WalletIdParts`](/api/anywalletkit/wallet-ton/interfaces/v5r1walletidparts/) = `{}`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# valueFlowTransfers
> **valueFlowTransfers**(`event`, `own`, `counterparty`): `ChainTransfer`\[]
Defined in: wallet-ton/src/history.ts:355
The account’s jetton deltas from `value_flow` as transfers against `counterparty`.
## Parameters
[Section titled “Parameters”](#parameters)
### event
[Section titled “event”](#event)
[`TonapiEvent`](/api/anywalletkit/wallet-ton/interfaces/tonapievent/)
### own
[Section titled “own”](#own)
`string`
### counterparty
[Section titled “counterparty”](#counterparty)
`string`
## Returns
[Section titled “Returns”](#returns)
`ChainTransfer`\[]
# EmulateOptions
Defined in: wallet-ton/src/emulation.ts:167
Options for emulating a message through tonapi or toncenter v3.
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: wallet-ton/src/emulation.ts:171
tonapi bearer key / toncenter X-API-Key.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: wallet-ton/src/emulation.ts:168
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-ton/src/emulation.ts:169
# EmulationOutcome
Defined in: wallet-ton/src/emulation.ts:29
An emulation verdict with its source and any deeper failures.
## Extends
[Section titled “Extends”](#extends)
* [`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/)
## Properties
[Section titled “Properties”](#properties)
### aborted?
[Section titled “aborted?”](#aborted)
> `optional` **aborted?**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:248
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/).[`aborted`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/#aborted)
***
### actionSuccess?
[Section titled “actionSuccess?”](#actionsuccess)
> `optional` **actionSuccess?**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:249
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/).[`actionSuccess`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/#actionsuccess)
***
### exitCode?
[Section titled “exitCode?”](#exitcode)
> `optional` **exitCode?**: `number`
Defined in: wallet-ton/src/toncenter.ts:247
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/).[`exitCode`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/#exitcode)
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:246
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/).[`ok`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/#ok)
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: wallet-ton/src/toncenter.ts:250
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`EmulationVerdict`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/).[`reason`](/api/anywalletkit/wallet-ton/interfaces/emulationverdict/#reason)
***
### risk?
[Section titled “risk?”](#risk)
> `optional` **risk?**: [`TonRisk`](/api/anywalletkit/wallet-ton/interfaces/tonrisk/)
Defined in: wallet-ton/src/emulation.ts:34
tonapi `risk`: what the message would move out of the wallet.
***
### source
[Section titled “source”](#source)
> **source**: [`EmulationSource`](/api/anywalletkit/wallet-ton/type-aliases/emulationsource/)
Defined in: wallet-ton/src/emulation.ts:30
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: `string`\[]
Defined in: wallet-ton/src/emulation.ts:32
Failed/bounced transactions deeper than the first hop — informational.
# EmulationVerdict
Defined in: wallet-ton/src/toncenter.ts:245
Whether an emulated wallet transaction succeeded: compute exit code, abort flag, action phase.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`EmulationOutcome`](/api/anywalletkit/wallet-ton/interfaces/emulationoutcome/)
## Properties
[Section titled “Properties”](#properties)
### aborted?
[Section titled “aborted?”](#aborted)
> `optional` **aborted?**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:248
***
### actionSuccess?
[Section titled “actionSuccess?”](#actionsuccess)
> `optional` **actionSuccess?**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:249
***
### exitCode?
[Section titled “exitCode?”](#exitcode)
> `optional` **exitCode?**: `number`
Defined in: wallet-ton/src/toncenter.ts:247
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: wallet-ton/src/toncenter.ts:246
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: wallet-ton/src/toncenter.ts:250
# GetMethodResult
Defined in: wallet-ton/src/toncenter.ts:156
Result of a contract get-method call.
## Properties
[Section titled “Properties”](#properties)
### exitCode
[Section titled “exitCode”](#exitcode)
> **exitCode**: `number`
Defined in: wallet-ton/src/toncenter.ts:156
***
### gasUsed
[Section titled “gasUsed”](#gasused)
> **gasUsed**: `number`
Defined in: wallet-ton/src/toncenter.ts:156
***
### stack
[Section titled “stack”](#stack)
> **stack**: `TupleReader`
Defined in: wallet-ton/src/toncenter.ts:156
# MappedActions
Defined in: wallet-ton/src/history.ts:197
## Properties
[Section titled “Properties”](#properties)
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: wallet-ton/src/history.ts:199
***
### initiator?
[Section titled “initiator?”](#initiator)
> `optional` **initiator?**: `string`
Defined in: wallet-ton/src/history.ts:201
Who initiated the event as far as the first action tells.
***
### needsValueFlow?
[Section titled “needsValueFlow?”](#needsvalueflow)
> `optional` **needsValueFlow?**: `object`
Defined in: wallet-ton/src/history.ts:203
The event needs `value_flow` to recover a jetton movement tonapi did not spell out (unstake requests).
#### counterparty
[Section titled “counterparty”](#counterparty)
> **counterparty**: `string`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: wallet-ton/src/history.ts:198
# ParsedV5R1Body
Defined in: wallet-ton/src/wallet-v5r1.ts:125
## Properties
[Section titled “Properties”](#properties)
### messages
[Section titled “messages”](#messages)
> **messages**: `object`\[]
Defined in: wallet-ton/src/wallet-v5r1.ts:130
#### message
[Section titled “message”](#message)
> **message**: `MessageRelaxed`
#### mode
[Section titled “mode”](#mode)
> **mode**: `number`
***
### op
[Section titled “op”](#op)
> **op**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:126
***
### seqno
[Section titled “seqno”](#seqno)
> **seqno**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:129
***
### signed
[Section titled “signed”](#signed)
> **signed**: `boolean`
Defined in: wallet-ton/src/wallet-v5r1.ts:132
True when the 64-byte tail signature is present (externals and internals carry one).
***
### validUntil
[Section titled “validUntil”](#validuntil)
> **validUntil**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:128
***
### walletId
[Section titled “walletId”](#walletid)
> **walletId**: `bigint`
Defined in: wallet-ton/src/wallet-v5r1.ts:127
# TonAccountState
Defined in: wallet-ton/src/toncenter.ts:147
Balance, status, code and data of an account.
## Properties
[Section titled “Properties”](#properties)
### balance
[Section titled “balance”](#balance)
> **balance**: `bigint`
Defined in: wallet-ton/src/toncenter.ts:148
***
### code
[Section titled “code”](#code)
> **code**: `Cell` | `null`
Defined in: wallet-ton/src/toncenter.ts:150
***
### data
[Section titled “data”](#data)
> **data**: `Cell` | `null`
Defined in: wallet-ton/src/toncenter.ts:151
***
### lastTransaction
[Section titled “lastTransaction”](#lasttransaction)
> **lastTransaction**: { `hash`: `string`; `lt`: `string`; } | `null`
Defined in: wallet-ton/src/toncenter.ts:152
***
### state
[Section titled “state”](#state)
> **state**: [`TonAccountStatus`](/api/anywalletkit/wallet-ton/type-aliases/tonaccountstatus/)
Defined in: wallet-ton/src/toncenter.ts:149
# TonAddressParts
Defined in: wallet-ton/src/tonconnect.ts:60
The address parts the digests bind to.
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash)
> **hash**: `Uint8Array`
Defined in: wallet-ton/src/tonconnect.ts:60
***
### workChain
[Section titled “workChain”](#workchain)
> **workChain**: `number`
Defined in: wallet-ton/src/tonconnect.ts:60
# TonapiAccount
Defined in: wallet-ton/src/history.ts:177
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: wallet-ton/src/history.ts:177
***
### is_scam?
[Section titled “is_scam?”](#is_scam)
> `optional` **is_scam?**: `boolean`
Defined in: wallet-ton/src/history.ts:177
***
### is_wallet?
[Section titled “is_wallet?”](#is_wallet)
> `optional` **is_wallet?**: `boolean`
Defined in: wallet-ton/src/history.ts:177
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: wallet-ton/src/history.ts:177
# TonapiAction
Defined in: wallet-ton/src/history.ts:179
## Indexable
[Section titled “Indexable”](#indexable)
> \[`body`: `string`]: `unknown`
## Properties
[Section titled “Properties”](#properties)
### status
[Section titled “status”](#status)
> **status**: `string`
Defined in: wallet-ton/src/history.ts:181
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: wallet-ton/src/history.ts:180
# TonapiEvent
Defined in: wallet-ton/src/history.ts:184
## Properties
[Section titled “Properties”](#properties)
### account?
[Section titled “account?”](#account)
> `optional` **account?**: [`TonapiAccount`](/api/anywalletkit/wallet-ton/interfaces/tonapiaccount/)
Defined in: wallet-ton/src/history.ts:186
***
### actions
[Section titled “actions”](#actions)
> **actions**: [`TonapiAction`](/api/anywalletkit/wallet-ton/interfaces/tonapiaction/)\[]
Defined in: wallet-ton/src/history.ts:191
***
### event_id
[Section titled “event_id”](#event_id)
> **event_id**: `string`
Defined in: wallet-ton/src/history.ts:185
***
### extra?
[Section titled “extra?”](#extra)
> `optional` **extra?**: `number`
Defined in: wallet-ton/src/history.ts:193
Account-scoped events only: TON the account lost beyond its actions (negative = fees).
***
### in_progress
[Section titled “in_progress”](#in_progress)
> **in_progress**: `boolean`
Defined in: wallet-ton/src/history.ts:189
***
### is_scam
[Section titled “is_scam”](#is_scam)
> **is_scam**: `boolean`
Defined in: wallet-ton/src/history.ts:190
***
### lt
[Section titled “lt”](#lt)
> **lt**: `string` | `number`
Defined in: wallet-ton/src/history.ts:188
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: wallet-ton/src/history.ts:187
***
### value_flow?
[Section titled “value_flow?”](#value_flow)
> `optional` **value_flow?**: `object`\[]
Defined in: wallet-ton/src/history.ts:194
#### account
[Section titled “account”](#account-1)
> **account**: [`TonapiAccount`](/api/anywalletkit/wallet-ton/interfaces/tonapiaccount/)
#### jettons?
[Section titled “jettons?”](#jettons)
> `optional` **jettons?**: `object`\[]
#### ton
[Section titled “ton”](#ton)
> **ton**: `number`
# TonapiJetton
Defined in: wallet-ton/src/history.ts:178
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: wallet-ton/src/history.ts:178
***
### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
Defined in: wallet-ton/src/history.ts:178
***
### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
Defined in: wallet-ton/src/history.ts:178
***
### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
Defined in: wallet-ton/src/history.ts:178
# TonChainTx
Defined in: wallet-ton/src/history.ts:57
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`TonHistoryRaw`](/api/anywalletkit/wallet-ton/interfaces/tonhistoryraw/)
Defined in: wallet-ton/src/history.ts:60
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### scam?
[Section titled “scam?”](#scam)
> `optional` **scam?**: `boolean`
Defined in: wallet-ton/src/history.ts:59
Mirrors `raw.scam`; the app hides these by default.
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# TonConfig
Defined in: wallet-ton/src/types.ts:18
Options for a TON wallet manager or account: toncenter endpoints, network, fee caps and emulation before signing.
## Properties
[Section titled “Properties”](#properties)
### allowDrainingTransactions?
[Section titled “allowDrainingTransactions?”](#allowdrainingtransactions)
> `optional` **allowDrainingTransactions?**: `boolean`
Defined in: wallet-ton/src/types.ts:55
Allow a body whose emulated `risk.transfer_all_remaining_balance` is true (send mode 128 / CARRY_ALL_BALANCE). Refused by default — nothing this wallet builds does that, so it only ever comes from a foreign `bodyBoc`.
***
### emulate?
[Section titled “emulate?”](#emulate)
> `optional` **emulate?**: [`TonEmulateConfig`](/api/anywalletkit/wallet-ton/type-aliases/tonemulateconfig/)
Defined in: wallet-ton/src/types.ts:47
Preflight emulation of every send (zero-signed external). Default `{kind: 'tonapi'}`: `POST {tonApiUrl}/wallet/emulate` (verdict + `risk`), falling back to `/traces/emulate`. `{kind: 'toncenter-v3', url}` posts to a toncenter `emulateTrace` endpoint instead. `false` = `estimateFee` only. A non-zero compute exit, an aborted transaction, a failed action phase or a failed FIRST-HOP internal message throws `SimulationError` before signing.
***
### ~~emulateUrl?~~
[Section titled “emulateUrl?”](#emulateurl)
> `optional` **emulateUrl?**: `string`
Defined in: wallet-ton/src/types.ts:49
Deprecated
Use `emulate: {kind: 'toncenter-v3', url}`. Still honoured when `emulate` is unset.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: {(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }
Defined in: wallet-ton/src/types.ts:28
Injectable fetch (tests, custom agents). Defaults to globalThis.fetch.
#### Call Signature
[Section titled “Call Signature”](#call-signature)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters)
###### input
[Section titled “input”](#input)
`URL` | `RequestInfo`
###### init?
[Section titled “init?”](#init)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns)
`Promise`<`Response`>
#### Call Signature
[Section titled “Call Signature”](#call-signature-1)
> (`input`, `init?`): `Promise`<`Response`>
[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)
##### Parameters
[Section titled “Parameters”](#parameters-1)
###### input
[Section titled “input”](#input-1)
`string` | `URL` | `Request`
###### init?
[Section titled “init?”](#init-1)
`RequestInit`
##### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`Response`>
***
### indexerUrl?
[Section titled “indexerUrl?”](#indexerurl)
> `optional` **indexerUrl?**: `string`
Defined in: wallet-ton/src/types.ts:34
toncenter v3 base used for receipts (default ).
***
### jettonAttachedValue?
[Section titled “jettonAttachedValue?”](#jettonattachedvalue)
> `optional` **jettonAttachedValue?**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:61
Nanotons attached to a jetton transfer on top of `forwardTonAmount` (default 0.05 TON).
***
### maxJettonAttachedValue?
[Section titled “maxJettonAttachedValue?”](#maxjettonattachedvalue)
> `optional` **maxJettonAttachedValue?**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:67
Most nanotons a jetton `transfer()` may attach to the jetton-wallet call, `forwardTonAmount` included (default 1 TON). The contract that receives them is the one the jetton master names, so a fake master gets all of it: the cap bounds what such a call can cost.
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `"mainnet"` | `"testnet"`
Defined in: wallet-ton/src/types.ts:73
‘mainnet’ (ton:-239, default) or ‘testnet’ (ton:-3). Sets the CAIP-2 id, the address flags and the wallet_id network (-239 / -3), so a testnet wallet has its own address and its signed messages are not valid on mainnet (as in Tonkeeper and @ton/ton).
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`TonProvider`](/api/anywalletkit/wallet-ton/type-aliases/tonprovider/) | [`TonProvider`](/api/anywalletkit/wallet-ton/type-aliases/tonprovider/)\[]
Defined in: wallet-ton/src/types.ts:22
Alias of `tonClient`.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-ton/src/types.ts:24
Extra rounds across the endpoint list after the first full pass (default 3).
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-ton/src/types.ts:57
Run the preflight (estimateFee + emulation when configured) before signing. Default true.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-ton/src/types.ts:26
Per-request timeout in ms (default 15 000).
***
### tonApiKey?
[Section titled “tonApiKey?”](#tonapikey)
> `optional` **tonApiKey?**: `string`
Defined in: wallet-ton/src/types.ts:38
tonapi bearer key (sent as `Authorization: Bearer …`); also sent as X-API-Key to a toncenter-v3 emulator.
***
### tonApiUrl?
[Section titled “tonApiUrl?”](#tonapiurl)
> `optional` **tonApiUrl?**: `string`
Defined in: wallet-ton/src/types.ts:36
tonapi base used for fee rates and (by default) emulation (default ).
***
### tonClient?
[Section titled “tonClient?”](#tonclient)
> `optional` **tonClient?**: [`TonProvider`](/api/anywalletkit/wallet-ton/type-aliases/tonprovider/) | [`TonProvider`](/api/anywalletkit/wallet-ton/type-aliases/tonprovider/)\[]
Defined in: wallet-ton/src/types.ts:20
toncenter endpoint(s) or `TonRpc`(s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-ton/src/types.ts:32
Max fee (nanotons) for `sendTransaction` / `signTransaction`.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-ton/src/types.ts:30
Max fee (nanotons) for `transfer`.
***
### validUntilSeconds?
[Section titled “validUntilSeconds?”](#validuntilseconds)
> `optional` **validUntilSeconds?**: `number`
Defined in: wallet-ton/src/types.ts:59
Seconds a signed external stays valid (default 60, max 600).
***
### walletId?
[Section titled “walletId?”](#walletid)
> `optional` **walletId?**: `object`
Defined in: wallet-ton/src/types.ts:80
V5R1 wallet_id parts. Defaults (network id from `network`, subwallet 0) give the addresses Tonkeeper and Tonhub derive for a key; change the subwallet only to reach a wallet that was created with a different one. A networkGlobalId that contradicts `network` is refused.
#### networkGlobalId?
[Section titled “networkGlobalId?”](#networkglobalid)
> `optional` **networkGlobalId?**: `number`
#### subwalletNumber?
[Section titled “subwalletNumber?”](#subwalletnumber)
> `optional` **subwalletNumber?**: `number`
# TonDescribedMessage
Defined in: wallet-ton/src/describe.ts:32
One outgoing message of a wallet transaction, decoded.
## Properties
[Section titled “Properties”](#properties)
### bodyBits
[Section titled “bodyBits”](#bodybits)
> **bodyBits**: `number`
Defined in: wallet-ton/src/describe.ts:46
***
### bounceable
[Section titled “bounceable”](#bounceable)
> **bounceable**: `boolean`
Defined in: wallet-ton/src/describe.ts:37
***
### comment?
[Section titled “comment?”](#comment)
> `optional` **comment?**: `string`
Defined in: wallet-ton/src/describe.ts:41
Text comment (op 0).
***
### hasStateInit
[Section titled “hasStateInit”](#hasstateinit)
> **hasStateInit**: `boolean`
Defined in: wallet-ton/src/describe.ts:45
***
### jetton?
[Section titled “jetton?”](#jetton)
> `optional` **jetton?**: [`TonJettonDetails`](/api/anywalletkit/wallet-ton/interfaces/tonjettondetails/)
Defined in: wallet-ton/src/describe.ts:44
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`TonDescribedKind`](/api/anywalletkit/wallet-ton/type-aliases/tondescribedkind/)
Defined in: wallet-ton/src/describe.ts:33
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: `number`
Defined in: wallet-ton/src/describe.ts:51
Send mode the wallet sends the message with (IGNORE_ERRORS is always added for an external). 128 carries the whole remaining balance, 32 destroys the account when it is left empty.
***
### op?
[Section titled “op?”](#op)
> `optional` **op?**: `string`
Defined in: wallet-ton/src/describe.ts:43
Body op code for contract calls (hex).
***
### testOnly?
[Section titled “testOnly?”](#testonly)
> `optional` **testOnly?**: `boolean`
Defined in: wallet-ton/src/describe.ts:39
Test-only flag of a friendly address; undefined for raw addresses.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-ton/src/describe.ts:35
Destination as given (friendly) or raw `wc:hex`.
***
### value
[Section titled “value”](#value)
> **value**: `bigint`
Defined in: wallet-ton/src/describe.ts:36
# TonDescription
Defined in: wallet-ton/src/describe.ts:74
A TON wallet transaction decoded for a confirmation screen: each outgoing message and the warnings.
## Properties
[Section titled “Properties”](#properties)
### external?
[Section titled “external?”](#external)
> `optional` **external?**: `object`
Defined in: wallet-ton/src/describe.ts:79
Present when the input was a prebuilt V5R1 body.
#### seqno
[Section titled “seqno”](#seqno)
> **seqno**: `number`
#### signed
[Section titled “signed”](#signed)
> **signed**: `boolean`
#### validUntil
[Section titled “validUntil”](#validuntil)
> **validUntil**: `number`
#### walletId
[Section titled “walletId”](#walletid)
> **walletId**: `bigint`
***
### items
[Section titled “items”](#items)
> **items**: [`TonDescribedMessage`](/api/anywalletkit/wallet-ton/interfaces/tondescribedmessage/)\[]
Defined in: wallet-ton/src/describe.ts:76
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`TonDescribedKind`](/api/anywalletkit/wallet-ton/type-aliases/tondescribedkind/) | `"mixed"`
Defined in: wallet-ton/src/describe.ts:75
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`TonWarning`](/api/anywalletkit/wallet-ton/interfaces/tonwarning/)\[]
Defined in: wallet-ton/src/describe.ts:77
# TonEndpoint
Defined in: wallet-ton/src/types.ts:4
A toncenter v2 JSON-RPC endpoint (api keys there are meant for client-side wallets).
## Properties
[Section titled “Properties”](#properties)
### secretKey?
[Section titled “secretKey?”](#secretkey)
> `optional` **secretKey?**: `string`
Defined in: wallet-ton/src/types.ts:4
***
### url
[Section titled “url”](#url)
> **url**: `string`
Defined in: wallet-ton/src/types.ts:4
# TonFees
Defined in: wallet-ton/src/types.ts:138
toncenter `estimateFee` source fees, nanotons.
## Properties
[Section titled “Properties”](#properties)
### fwdFee
[Section titled “fwdFee”](#fwdfee)
> **fwdFee**: `bigint`
Defined in: wallet-ton/src/types.ts:142
***
### gasFee
[Section titled “gasFee”](#gasfee)
> **gasFee**: `bigint`
Defined in: wallet-ton/src/types.ts:141
***
### inFwdFee
[Section titled “inFwdFee”](#infwdfee)
> **inFwdFee**: `bigint`
Defined in: wallet-ton/src/types.ts:139
***
### storageFee
[Section titled “storageFee”](#storagefee)
> **storageFee**: `bigint`
Defined in: wallet-ton/src/types.ts:140
***
### total
[Section titled “total”](#total)
> **total**: `bigint`
Defined in: wallet-ton/src/types.ts:144
Sum of the four.
# TonHistoryCursor
Defined in: wallet-ton/src/history.ts:96
## Properties
[Section titled “Properties”](#properties)
### b
[Section titled “b”](#b)
> **b**: [`TonHistoryBackend`](/api/anywalletkit/wallet-ton/type-aliases/tonhistorybackend/)
Defined in: wallet-ton/src/history.ts:98
***
### lt
[Section titled “lt”](#lt)
> **lt**: `string`
Defined in: wallet-ton/src/history.ts:100
Next page = events / transactions with `lt < this` (decimal string).
***
### v
[Section titled “v”](#v)
> **v**: `1`
Defined in: wallet-ton/src/history.ts:97
# TonHistoryOptions
Defined in: wallet-ton/src/history.ts:30
Options for `createTonHistory`: tonapi first, toncenter v3 as the fallback.
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: wallet-ton/src/history.ts:34
tonapi Bearer key. Keyless tonapi allows \~1 request/s.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`HistoryFetch`](/api/anywalletkit/wallet-ton/type-aliases/historyfetch/)
Defined in: wallet-ton/src/history.ts:40
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `"mainnet"` | `"testnet"`
Defined in: wallet-ton/src/history.ts:39
***
### rateLimit?
[Section titled “rateLimit?”](#ratelimit)
> `optional` **rateLimit?**: `number`
Defined in: wallet-ton/src/history.ts:42
tonapi requests per second. Default 1 without a key, 10 with one.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-ton/src/history.ts:44
Per request, ms. Default 15 000.
***
### tonapiUrl?
[Section titled “tonapiUrl?”](#tonapiurl)
> `optional` **tonapiUrl?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:32
tonapi root. Default `https://tonapi.io` (`https://testnet.tonapi.io` on testnet). `null` disables tonapi.
***
### toncenterApiKey?
[Section titled “toncenterApiKey?”](#toncenterapikey)
> `optional` **toncenterApiKey?**: `string`
Defined in: wallet-ton/src/history.ts:38
toncenter `X-API-Key`.
***
### toncenterUrl?
[Section titled “toncenterUrl?”](#toncenterurl)
> `optional` **toncenterUrl?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:36
toncenter root for the v3 fallback. Default `https://toncenter.com` (`https://testnet.toncenter.com`). `null` disables it.
# TonHistoryPage
Defined in: wallet-ton/src/history.ts:63
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### backend?
[Section titled “backend?”](#backend)
> `optional` **backend?**: [`TonHistoryBackend`](/api/anywalletkit/wallet-ton/type-aliases/tonhistorybackend/)
Defined in: wallet-ton/src/history.ts:65
***
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/)\[]
Defined in: wallet-ton/src/history.ts:64
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
# TonHistoryRaw
Defined in: wallet-ton/src/history.ts:47
## Properties
[Section titled “Properties”](#properties)
### backend
[Section titled “backend”](#backend)
> **backend**: [`TonHistoryBackend`](/api/anywalletkit/wallet-ton/type-aliases/tonhistorybackend/)
Defined in: wallet-ton/src/history.ts:48
***
### event
[Section titled “event”](#event)
> **event**: `unknown`
Defined in: wallet-ton/src/history.ts:50
The tonapi account event, or the toncenter v3 transaction row.
***
### scam?
[Section titled “scam?”](#scam)
> `optional` **scam?**: `boolean`
Defined in: wallet-ton/src/history.ts:52
tonapi flagged the event as scam.
***
### valueFlow?
[Section titled “valueFlow?”](#valueflow)
> `optional` **valueFlow?**: `unknown`
Defined in: wallet-ton/src/history.ts:54
tonapi `value_flow` for the account when it had to be fetched to recover jetton movements.
# TonHistorySource
Defined in: wallet-ton/src/history.ts:71
TON history from tonapi events with a toncenter v3 fallback. Build it with `createTonHistory`.
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/) | `undefined`>
Defined in: wallet-ton/src/history.ts:73
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`TonChainTx`](/api/anywalletkit/wallet-ton/interfaces/tonchaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`TonHistoryPage`](/api/anywalletkit/wallet-ton/interfaces/tonhistorypage/)>
Defined in: wallet-ton/src/history.ts:72
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`TonHistoryPage`](/api/anywalletkit/wallet-ton/interfaces/tonhistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
# TonJettonDetails
Defined in: wallet-ton/src/describe.ts:20
Fields of a TEP-74 jetton `transfer` body.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
Defined in: wallet-ton/src/describe.ts:22
***
### destination
[Section titled “destination”](#destination)
> **destination**: `string`
Defined in: wallet-ton/src/describe.ts:23
***
### forwardComment?
[Section titled “forwardComment?”](#forwardcomment)
> `optional` **forwardComment?**: `string`
Defined in: wallet-ton/src/describe.ts:27
***
### forwardPayload
[Section titled “forwardPayload”](#forwardpayload)
> **forwardPayload**: `"cell"` | `"none"` | `"comment"`
Defined in: wallet-ton/src/describe.ts:26
***
### forwardTonAmount
[Section titled “forwardTonAmount”](#forwardtonamount)
> **forwardTonAmount**: `bigint`
Defined in: wallet-ton/src/describe.ts:25
***
### hasCustomPayload
[Section titled “hasCustomPayload”](#hascustompayload)
> **hasCustomPayload**: `boolean`
Defined in: wallet-ton/src/describe.ts:28
***
### queryId
[Section titled “queryId”](#queryid)
> **queryId**: `bigint`
Defined in: wallet-ton/src/describe.ts:21
***
### responseDestination
[Section titled “responseDestination”](#responsedestination)
> **responseDestination**: `string` | `null`
Defined in: wallet-ton/src/describe.ts:24
# TonProof
Defined in: wallet-ton/src/tonconnect.ts:28
The `proof` object of a TON Connect `ton_proof` reply.
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `object`
Defined in: wallet-ton/src/tonconnect.ts:30
#### lengthBytes
[Section titled “lengthBytes”](#lengthbytes)
> **lengthBytes**: `number`
#### value
[Section titled “value”](#value)
> **value**: `string`
***
### payload
[Section titled “payload”](#payload)
> **payload**: `string`
Defined in: wallet-ton/src/tonconnect.ts:31
***
### signature
[Section titled “signature”](#signature)
> **signature**: `string`
Defined in: wallet-ton/src/tonconnect.ts:33
Base64 ed25519 signature.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: wallet-ton/src/tonconnect.ts:29
# TonProofRequest
Defined in: wallet-ton/src/tonconnect.ts:18
What a dApp asks `ton_proof` for: its domain (host), the time of the proof, its nonce.
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `string`
Defined in: wallet-ton/src/tonconnect.ts:20
The dApp’s host as the wallet saw it (`app.example`), never the dApp’s own claim.
***
### payload
[Section titled “payload”](#payload)
> **payload**: `string`
Defined in: wallet-ton/src/tonconnect.ts:24
The dApp’s `ton_proof` payload.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: wallet-ton/src/tonconnect.ts:22
Unix seconds.
# TonReceipt
Defined in: wallet-ton/src/types.ts:179
Outcome of a sent wallet transaction, found by the body hash `sendTransaction` returned.
## Properties
[Section titled “Properties”](#properties)
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `bigint`
Defined in: wallet-ton/src/types.ts:185
Logical time of the account transaction.
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-ton/src/types.ts:181
The body hash that was returned by sendTransaction.
***
### raw
[Section titled “raw”](#raw)
> **raw**: `unknown`
Defined in: wallet-ton/src/types.ts:191
The raw @ton/core Transaction.
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: wallet-ton/src/types.ts:183
1 when the wallet transaction completed without abort, 0 otherwise.
***
### totalFees
[Section titled “totalFees”](#totalfees)
> **totalFees**: `bigint`
Defined in: wallet-ton/src/types.ts:189
Fees of the account transaction, in nanotons.
***
### transactionHash
[Section titled “transactionHash”](#transactionhash)
> **transactionHash**: `string`
Defined in: wallet-ton/src/types.ts:187
Account transaction hash (base64).
# TonRisk
Defined in: wallet-ton/src/types.ts:157
What a message would move out of the wallet, per tonapi’s `risk`.
## Properties
[Section titled “Properties”](#properties)
### jettons
[Section titled “jettons”](#jettons)
> **jettons**: `object`\[]
Defined in: wallet-ton/src/types.ts:160
#### address
[Section titled “address”](#address)
> **address**: `string`
#### amount
[Section titled “amount”](#amount)
> **amount**: `bigint`
#### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
#### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
#### walletAddress
[Section titled “walletAddress”](#walletaddress)
> **walletAddress**: `string`
***
### ton
[Section titled “ton”](#ton)
> **ton**: `bigint`
Defined in: wallet-ton/src/types.ts:159
Nanotons leaving the wallet (value + fees the emulator attributes).
***
### transferAllRemainingBalance
[Section titled “transferAllRemainingBalance”](#transferallremainingbalance)
> **transferAllRemainingBalance**: `boolean`
Defined in: wallet-ton/src/types.ts:162
Send mode 128: the whole remaining balance goes with the message.
# TonRpc
Defined in: wallet-ton/src/types.ts:7
Anything that can answer a toncenter v2 JSON-RPC call (an endpoint wrapper, a test double, a proxy).
## Methods
[Section titled “Methods”](#methods)
### call()
[Section titled “call()”](#call)
> **call**<`T`>(`method`, `params`): `Promise`<`T`>
Defined in: wallet-ton/src/types.ts:8
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T` = `unknown`
#### Parameters
[Section titled “Parameters”](#parameters)
##### method
[Section titled “method”](#method)
`string`
##### params
[Section titled “params”](#params)
`Record`<`string`, `unknown`>
#### Returns
[Section titled “Returns”](#returns)
`Promise`<`T`>
# TonSignDataRequest
Defined in: wallet-ton/src/tonconnect.ts:40
What a dApp asks `signData` for.
## Properties
[Section titled “Properties”](#properties)
### domain
[Section titled “domain”](#domain)
> **domain**: `string`
Defined in: wallet-ton/src/tonconnect.ts:42
The dApp’s host as the wallet saw it.
***
### payload
[Section titled “payload”](#payload)
> **payload**: [`TonSignDataPayload`](/api/anywalletkit/wallet-ton/type-aliases/tonsigndatapayload/)
Defined in: wallet-ton/src/tonconnect.ts:45
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: wallet-ton/src/tonconnect.ts:44
Unix seconds.
# TonSignedData
Defined in: wallet-ton/src/tonconnect.ts:49
The TON Connect `signData` reply.
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: wallet-ton/src/tonconnect.ts:53
Raw form (`0:…`) of the address that signed.
***
### domain
[Section titled “domain”](#domain)
> **domain**: `string`
Defined in: wallet-ton/src/tonconnect.ts:55
***
### payload
[Section titled “payload”](#payload)
> **payload**: [`TonSignDataPayload`](/api/anywalletkit/wallet-ton/type-aliases/tonsigndatapayload/)
Defined in: wallet-ton/src/tonconnect.ts:56
***
### signature
[Section titled “signature”](#signature)
> **signature**: `string`
Defined in: wallet-ton/src/tonconnect.ts:51
Base64 ed25519 signature.
***
### timestamp
[Section titled “timestamp”](#timestamp)
> **timestamp**: `number`
Defined in: wallet-ton/src/tonconnect.ts:54
# TonTransaction
Defined in: wallet-ton/src/types.ts:84
One internal message. `value` in nanotons. `body`: text comment or a Cell; `bodyBoc`: the same as base64 BoC.
## Properties
[Section titled “Properties”](#properties)
### body?
[Section titled “body?”](#body)
> `optional` **body?**: `string` | `Cell`
Defined in: wallet-ton/src/types.ts:89
***
### bodyBoc?
[Section titled “bodyBoc?”](#bodyboc)
> `optional` **bodyBoc?**: `string`
Defined in: wallet-ton/src/types.ts:91
Prebuilt message body as base64 BoC (e.g. an Omniston escrow payload). Ignored when `body` is set.
***
### bounceable?
[Section titled “bounceable?”](#bounceable)
> `optional` **bounceable?**: `boolean`
Defined in: wallet-ton/src/types.ts:88
Defaults to the flag in a friendly address (EQ… bounceable, UQ… not); raw addresses default to bounceable.
***
### sendMode?
[Section titled “sendMode?”](#sendmode)
> `optional` **sendMode?**: `number`
Defined in: wallet-ton/src/types.ts:95
Send mode for this message (default PAY_GAS_SEPARATELY; IGNORE_ERRORS is always OR-ed in for externals).
***
### stateInit?
[Section titled “stateInit?”](#stateinit)
> `optional` **stateInit?**: `string` | `Cell` | `StateInit`
Defined in: wallet-ton/src/types.ts:93
StateInit to attach (deploys the destination): `{code, data}`, a StateInit cell, or its base64 BoC.
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-ton/src/types.ts:85
***
### value
[Section titled “value”](#value)
> **value**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:86
# TonTransferOptions
Defined in: wallet-ton/src/types.ts:106
A native TON or jetton transfer. Amount in nanotons or the jetton’s base units.
## Properties
[Section titled “Properties”](#properties)
### allowForeignResponseDestination?
[Section titled “allowForeignResponseDestination?”](#allowforeignresponsedestination)
> `optional` **allowForeignResponseDestination?**: `boolean`
Defined in: wallet-ton/src/types.ts:130
Jetton only: let `responseDestination` be another address than this wallet. Off by default.
***
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:111
***
### attachedValue?
[Section titled “attachedValue?”](#attachedvalue)
> `optional` **attachedValue?**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:134
Jetton only: nanotons attached to the jetton-wallet call (default config.jettonAttachedValue + forwardTonAmount).
***
### customPayload?
[Section titled “customPayload?”](#custompayload)
> `optional` **customPayload?**: `Cell`
Defined in: wallet-ton/src/types.ts:122
Jetton only: custom payload cell (rarely needed; e.g. mintless jettons).
***
### forwardPayload?
[Section titled “forwardPayload?”](#forwardpayload)
> `optional` **forwardPayload?**: `string` | `Cell`
Defined in: wallet-ton/src/types.ts:115
Jetton only: forward payload — a text comment or a Cell (DEX / escrow payloads).
***
### forwardTonAmount?
[Section titled “forwardTonAmount?”](#forwardtonamount)
> `optional` **forwardTonAmount?**: `string` | `number` | `bigint`
Defined in: wallet-ton/src/types.ts:113
Jetton only: nanotons forwarded to the recipient with the transfer notification (default 1).
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-ton/src/types.ts:120
Text memo (a deposit memo, an exchange tag). Jetton: sent as the forward-payload comment (TEP-74); native TON: the message comment. Cannot be combined with `forwardPayload`.
***
### queryId?
[Section titled “queryId?”](#queryid)
> `optional` **queryId?**: `number` | `bigint`
Defined in: wallet-ton/src/types.ts:132
Jetton only: query id (default random).
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-ton/src/types.ts:110
Wallet address that receives (for a jetton, its owner, not its jetton wallet).
***
### responseDestination?
[Section titled “responseDestination?”](#responsedestination)
> `optional` **responseDestination?**: `string`
Defined in: wallet-ton/src/types.ts:128
Jetton only: where excess TON returns (default: this wallet). Another address is refused unless `allowForeignResponseDestination` is set: it receives TON the policies’ recipient check never sees.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-ton/src/types.ts:108
Jetton master address. Omit for native TON.
# TonWarning
Defined in: wallet-ton/src/describe.ts:68
One flagged problem; `index` is the message it is about.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`TonWarningCode`](/api/anywalletkit/wallet-ton/type-aliases/tonwarningcode/)
Defined in: wallet-ton/src/describe.ts:68
***
### index?
[Section titled “index?”](#index)
> `optional` **index?**: `number`
Defined in: wallet-ton/src/describe.ts:68
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-ton/src/describe.ts:68
# V3Message
Defined in: wallet-ton/src/history.ts:398
## Properties
[Section titled “Properties”](#properties)
### decoded_opcode?
[Section titled “decoded_opcode?”](#decoded_opcode)
> `optional` **decoded_opcode?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:403
***
### destination?
[Section titled “destination?”](#destination)
> `optional` **destination?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:400
***
### opcode?
[Section titled “opcode?”](#opcode)
> `optional` **opcode?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:402
***
### source?
[Section titled “source?”](#source)
> `optional` **source?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:399
***
### value?
[Section titled “value?”](#value)
> `optional` **value?**: `string` | `null`
Defined in: wallet-ton/src/history.ts:401
# V3Transaction
Defined in: wallet-ton/src/history.ts:405
## Properties
[Section titled “Properties”](#properties)
### account
[Section titled “account”](#account)
> **account**: `string`
Defined in: wallet-ton/src/history.ts:406
***
### description?
[Section titled “description?”](#description)
> `optional` **description?**: `object`
Defined in: wallet-ton/src/history.ts:412
#### aborted?
[Section titled “aborted?”](#aborted)
> `optional` **aborted?**: `boolean`
#### action?
[Section titled “action?”](#action)
> `optional` **action?**: `object`
##### action.success?
[Section titled “action.success?”](#actionsuccess)
> `optional` **success?**: `boolean`
#### compute_ph?
[Section titled “compute_ph?”](#compute_ph)
> `optional` **compute_ph?**: `object`
##### compute_ph.exit_code?
[Section titled “compute_ph.exit_code?”](#compute_phexit_code)
> `optional` **exit_code?**: `number`
##### compute_ph.skipped?
[Section titled “compute_ph.skipped?”](#compute_phskipped)
> `optional` **skipped?**: `boolean`
##### compute_ph.success?
[Section titled “compute_ph.success?”](#compute_phsuccess)
> `optional` **success?**: `boolean`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-ton/src/history.ts:408
base64.
***
### in_msg?
[Section titled “in_msg?”](#in_msg)
> `optional` **in_msg?**: [`V3Message`](/api/anywalletkit/wallet-ton/interfaces/v3message/) | `null`
Defined in: wallet-ton/src/history.ts:413
***
### lt
[Section titled “lt”](#lt)
> **lt**: `string`
Defined in: wallet-ton/src/history.ts:409
***
### now
[Section titled “now”](#now)
> **now**: `number`
Defined in: wallet-ton/src/history.ts:410
***
### out_msgs?
[Section titled “out_msgs?”](#out_msgs)
> `optional` **out_msgs?**: [`V3Message`](/api/anywalletkit/wallet-ton/interfaces/v3message/)\[]
Defined in: wallet-ton/src/history.ts:414
***
### total_fees
[Section titled “total_fees”](#total_fees)
> **total_fees**: `string`
Defined in: wallet-ton/src/history.ts:411
# V5R1Message
Defined in: wallet-ton/src/wallet-v5r1.ts:79
## Properties
[Section titled “Properties”](#properties)
### message
[Section titled “message”](#message)
> **message**: `MessageRelaxed`
Defined in: wallet-ton/src/wallet-v5r1.ts:79
***
### mode?
[Section titled “mode?”](#mode)
> `optional` **mode?**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:79
# V5R1SigningParams
Defined in: wallet-ton/src/wallet-v5r1.ts:81
## Properties
[Section titled “Properties”](#properties)
### messages
[Section titled “messages”](#messages)
> **messages**: [`V5R1Message`](/api/anywalletkit/wallet-ton/interfaces/v5r1message/)\[]
Defined in: wallet-ton/src/wallet-v5r1.ts:86
***
### seqno
[Section titled “seqno”](#seqno)
> **seqno**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:85
***
### validUntil
[Section titled “validUntil”](#validuntil)
> **validUntil**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:84
Unix seconds.
***
### walletId
[Section titled “walletId”](#walletid)
> **walletId**: `bigint`
Defined in: wallet-ton/src/wallet-v5r1.ts:82
# V5R1WalletIdParts
Defined in: wallet-ton/src/wallet-v5r1.ts:45
## Properties
[Section titled “Properties”](#properties)
### networkGlobalId?
[Section titled “networkGlobalId?”](#networkglobalid)
> `optional` **networkGlobalId?**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:45
***
### subwalletNumber?
[Section titled “subwalletNumber?”](#subwalletnumber)
> `optional` **subwalletNumber?**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:45
***
### workchain?
[Section titled “workchain?”](#workchain)
> `optional` **workchain?**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:45
# DecodedBody
> **DecodedBody** = { `type`: `"empty"`; } | { `text`: `string`; `type`: `"comment"`; } | { `jetton`: [`TonJettonDetails`](/api/anywalletkit/wallet-ton/interfaces/tonjettondetails/); `type`: `"jetton-transfer"`; } | { `op`: `number`; `type`: `"op"`; } | { `type`: `"unknown"`; }
Defined in: wallet-ton/src/describe.ts:83
A message body decoded: empty, a text comment, a jetton transfer, or unknown.
# EmulationSource
> **EmulationSource** = `"tonapi"` | `"toncenter-v3"`
Defined in: wallet-ton/src/emulation.ts:26
Service an emulation came from.
# HistoryFetch
> **HistoryFetch** = (`input`, `init?`) => `Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
Defined in: wallet-ton/src/history.ts:21
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### init?
[Section titled “init?”](#init)
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
# TonAccountStatus
> **TonAccountStatus** = `"active"` | `"uninitialized"` | `"frozen"` | `"nonexist"`
Defined in: wallet-ton/src/toncenter.ts:144
State of a TON account on chain.
# TonDescribedKind
> **TonDescribedKind** = `"ton-transfer"` | `"jetton-transfer"` | `"contract-call"`
Defined in: wallet-ton/src/describe.ts:17
What one outgoing message does.
# TonEmulateConfig
> **TonEmulateConfig** = { `kind`: `"tonapi"`; `url?`: `string`; } | { `kind`: `"toncenter-v3"`; `url`: `string`; } | `false`
Defined in: wallet-ton/src/types.ts:151
Where to emulate a transaction before signing: tonapi, a toncenter v3 endpoint, or `false` for a fee estimate only.
# TonHistoryBackend
> **TonHistoryBackend** = `"tonapi"` | `"toncenter"`
Defined in: wallet-ton/src/history.ts:27
Which indexer answered: tonapi events or toncenter v3 transactions.
# TonProvider
> **TonProvider** = [`TonEndpoint`](/api/anywalletkit/wallet-ton/interfaces/tonendpoint/) | [`TonRpc`](/api/anywalletkit/wallet-ton/interfaces/tonrpc/)
Defined in: wallet-ton/src/types.ts:12
A toncenter endpoint (URL and optional key) or a ready `TonRpc`.
# TonSendable
> **TonSendable** = [`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/) | [`TonTransaction`](/api/anywalletkit/wallet-ton/interfaces/tontransaction/)\[] | `Cell`
Defined in: wallet-ton/src/types.ts:103
What `sendTransaction` / `signTransaction` accept: one message, several messages in ONE external (up to 255 — swaps need it), or an already signed V5R1 external-message body Cell.
# TonSignDataPayload
> **TonSignDataPayload** = { `text`: `string`; `type`: `"text"`; } | { `bytes`: `string`; `type`: `"binary"`; }
Defined in: wallet-ton/src/tonconnect.ts:37
A `signData` payload. `cell` payloads need schema-aware rendering and are not signed here.
# TonSimulation
> **TonSimulation** = { `actionSuccess?`: `boolean`; `emulated`: `boolean`; `exitCode?`: `number`; `fees`: [`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/); `ok`: `true`; `risk?`: [`TonRisk`](/api/anywalletkit/wallet-ton/interfaces/tonrisk/); `source`: [`TonSimulationSource`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulationsource/); `warnings`: `string`\[]; } | { `aborted?`: `boolean`; `emulated`: `true`; `exitCode?`: `number`; `fees?`: [`TonFees`](/api/anywalletkit/wallet-ton/interfaces/tonfees/); `ok`: `false`; `reason`: `string`; `risk?`: [`TonRisk`](/api/anywalletkit/wallet-ton/interfaces/tonrisk/); `source`: `Exclude`<[`TonSimulationSource`](/api/anywalletkit/wallet-ton/type-aliases/tonsimulationsource/), `"estimate-only"`>; `warnings`: `string`\[]; }
Defined in: wallet-ton/src/types.ts:174
Outcome of a simulation: the fees and, when emulated, whether the wallet transaction and its actions succeeded.
# TonSimulationSource
> **TonSimulationSource** = `"tonapi"` | `"toncenter-v3"` | `"estimate-only"`
Defined in: wallet-ton/src/types.ts:168
Which service produced a simulation; `estimate-only` means fees were estimated without emulation.
# TonWarningCode
> **TonWarningCode** = `"zero-value"` | `"non-bounceable-contract-call"` | `"unknown-body"` | `"large-forward-amount"` | `"testnet-address"` | `"mainnet-address"` | `"exotic-workchain"` | `"extended-actions"` | `"carries-all-balance"` | `"destroys-account"`
Defined in: wallet-ton/src/describe.ts:55
Problems a TON description is flagged with.
# CAIP2
> `const` **CAIP2**: `Record`<`"mainnet"` | `"testnet"`, `string`>
Defined in: wallet-ton/src/types.ts:195
CAIP-2 ids of TON mainnet and testnet.
# DEFAULT_SEND_MODE
> `const` **DEFAULT_SEND_MODE**: `number`
Defined in: wallet-ton/src/wallet-v5r1.ts:41
PAY_GAS_SEPARATELY | IGNORE_ERRORS — the mode every external-message action carries.
# DEFAULT_TONAPI
> `const` **DEFAULT_TONAPI**: `"https://tonapi.io/v2"` = `'https://tonapi.io/v2'`
Defined in: wallet-ton/src/emulation.ts:23
Default tonapi root used for emulation.
# JETTON_TRANSFER_OP
> `const` **JETTON_TRANSFER_OP**: `260734629` = `0x0f8a7ea5`
Defined in: wallet-ton/src/describe.ts:13
TEP-74 `transfer` op code of a jetton wallet.
# MAINNET_GLOBAL_ID
> `const` **MAINNET_GLOBAL_ID**: `-239` = `-239`
Defined in: wallet-ton/src/wallet-v5r1.ts:37
Global id of TON mainnet, part of the V5R1 wallet id.
# MAX_ACTIONS
> `const` **MAX_ACTIONS**: `255` = `255`
Defined in: wallet-ton/src/wallet-v5r1.ts:43
Most outgoing messages one V5R1 transaction can carry.
# SEND_MODE
> `const` **SEND_MODE**: `number` = `DEFAULT_SEND_MODE`
Defined in: wallet-ton/src/read-only-account.ts:23
PAY_GAS_SEPARATELY | IGNORE_ERRORS, the mode every action in an external carries.
# TESTNET_GLOBAL_ID
> `const` **TESTNET_GLOBAL_ID**: `-3` = `-3`
Defined in: wallet-ton/src/wallet-v5r1.ts:39
Global id of TON testnet.
# TON_BASE_PATH
> `const` **TON_BASE_PATH**: `"m/44'/607'"` = `"m/44'/607'"`
Defined in: wallet-ton/src/manager.ts:8
Base derivation path for BIP-39 seeds; account `i` is at `m/44'/607'/i'`.
# TON_MNEMONIC_PATH
> `const` **TON_MNEMONIC_PATH**: `"ton-mnemonic"` = `'ton-mnemonic'`
Defined in: wallet-ton/src/manager.ts:10
Path label of the account a TON-native (Tonkeeper-style) mnemonic yields — there is exactly one.
# V5R1_CODE_HEX
> `const` **V5R1_CODE_HEX**: `"b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e"` = `'b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e'`
Defined in: wallet-ton/src/wallet-v5r1.ts:19
Code of the Wallet V5R1 contract (BoC hex).
# V5R1_OP
> `const` **V5R1_OP**: `object`
Defined in: wallet-ton/src/wallet-v5r1.ts:30
Op codes of Wallet V5R1 messages.
## Type Declaration
[Section titled “Type Declaration”](#type-declaration)
### extension
[Section titled “extension”](#extension)
> `readonly` **extension**: `1702392942` = `0x6578746e`
### signedExternal
[Section titled “signedExternal”](#signedexternal)
> `readonly` **signedExternal**: `1936287598` = `0x7369676e`
### signedInternal
[Section titled “signedInternal”](#signedinternal)
> `readonly` **signedInternal**: `1936289396` = `0x73696e74`
# @anywalletkit/wallet-tron
# @anywalletkit/wallet-tron
[Section titled “@anywalletkit/wallet-tron”](#anywalletkitwallet-tron)
[](https://www.npmjs.com/package/@anywalletkit/wallet-tron)
Tron accounts at `m/44'/195'/0'/0/i` (BIP-44 — the TronLink default), pinned by golden vectors in `@anywalletkit/conformance`. No tronweb: the full-node HTTP API builds `raw_data`, the account checks it, simulates it, signs `txID` with noble secp256k1 and broadcasts.
## Install
[Section titled “Install”](#install)
```sh
npm install @anywalletkit/wallet-tron
# or: pnpm add @anywalletkit/wallet-tron · yarn add @anywalletkit/wallet-tron
```
On npm: [@anywalletkit/wallet-tron](https://www.npmjs.com/package/@anywalletkit/wallet-tron), published from the [release workflow](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) with provenance.
```ts
import WalletManagerTron from '@anywalletkit/wallet-tron'
const wallet = new WalletManagerTron(seedPhrase, { provider: ['https://api.trongrid.io', 'https://tron-rpc.example'], headers: { 'TRON-PRO-API-KEY': key } })
const account = await wallet.getAccount(0)
await account.transfer({ recipient: 'T…', amount: 1_000_000n }) // 1 TRX (sun)
await account.transfer({ token: USDT_TRC20, recipient: 'T…', amount: 1_000_000n }) // TRC-20
await account.sendTransaction({ contractAddress, functionSelector: 'approve(address,uint256)', parameters: [...] })
const sig = await account.sign('hello') // TIP-191, 0x + r||s||v (27/28)
wallet.dispose()
```
`provider` is one or more full-node urls (or custom transports); a list fails over in order, and every url request times out after `timeoutMs` (default 15 000). A broadcast that meets no answer is re-sent as the same signed bytes (one `txID`, accepted once) to the next provider, and `DUP_TRANSACTION_ERROR` counts as accepted; when no node answers it throws `BroadcastUnknownError` with the `txID` — watch it, do not build and sign again. Sun amounts are read from url providers without rounding (integers above 2^53 stay exact); a custom transport that hands over an unsafe number is refused, and a transfer above 2^53 − 1 sun is refused before the node builds it.
## What happens before a signature
[Section titled “What happens before a signature”](#what-happens-before-a-signature)
Every `signTransaction` / `sendTransaction` / `transfer` goes through the same gate:
1. **Hard checks** (`UnsafeTransactionError`, with a `code`): exactly one contract; `owner_address` is this account; `ref_block_bytes` / `ref_block_hash` present and, with a provider, the reference block a block of the configured network (`ref-block-mismatch`; a Tron signature is bound to its network only by that block) — offline, only a mainnet account signs unless `allowOfflineTestnetSigning: true` (`offline-network`); `raw_data.data` at most 512 bytes (`memo`); `expiration` in the future and at most 24 h away; no TRX / TRC-20 transfer to the zero address unless `allowBurn: true`; `fee_limit` ≤ the tighter of `transactionMaxFee` and `WriteOptions.maxFee`, and `fee_limit` plus the bandwidth / memo / activation fees it does not cover within that cap (`fee-limit`); no `AccountPermissionUpdateContract` (it hands the account’s keys over) unless `allowPermissionChanges: true` (`permission-change`); no contract type the wallet cannot decode unless `allowUndecodedContracts: true` (`undecoded-contract`; `VoteWitnessContract` only re-assigns votes and is signed). The same checks run in `signRaw`, which takes `WriteOptions` and keeps signatures already on the transaction (a multisig co-signer’s): under a fee cap it prices the bytes through the provider and refuses a contract call without `fee_limit`, or any transaction when there is no provider to price it. Contract-call parameters must match the `functionSelector` signature and encode one ABI word each (`encodeCall`).
2. **Simulation** (`SimulationError`, off with `simulate: false`): contract calls run through `/wallet/triggerconstantcontract` and the revert reason is ABI-decoded (`Error(string)`, `Panic`); TRX transfers check that the balance covers amount + fees.
3. **Fee estimate** and the `transferMaxFee` / `transactionMaxFee` cap.
`describeTransaction(tx)` tells you what a transaction does, offline: `trx-transfer`, `trc20-transfer`, `trc20-approve`, `contract-call`, `freeze`, `unfreeze` — with decoded recipient / amount / spender and warnings (`unlimited-approve`, `zero-address`, `memo-fee`, `expired`). `account.describeTransactionOnline(tx)` adds `unactivated-recipient`.
## Fees
[Section titled “Fees”](#fees)
`account.estimateFee(tx)` → `{ bandwidth, energy, trxBurn, breakdown }`, where `trxBurn` is what the sender actually pays (sun) after staked / free resources:
* **bandwidth** points = serialized size (`raw_data` + protobuf envelope + 65-byte signature)
* 64-byte result reserve — 268 for a TRX transfer, \~345 for a TRC-20 transfer. Staked bandwidth is used first, then the free daily allowance, else `getTransactionFee` sun per point.
* **energy** = `energy_used` of a constant call; what staked energy does not cover is burned at `getEnergyFee`. `fee_limit` defaults to energy × price × 1.2 (capped at `transactionMaxFee` and the call’s `maxFee`).
* **account creation** (TRX transfer to an unseen address): `getCreateNewAccountFeeInSystemContract` (1 TRX) plus `getCreateAccountFee` (0.1 TRX) unless staked bandwidth covers the bytes — free bandwidth is not accepted for creation.
* **memo** (`raw_data.data`): `getMemoFee` (1 TRX).
`quoteSendTransaction` / `quoteTransfer` return `{ fee: trxBurn, activationFee, estimate }`.
## Memo (`raw_data.data`)
[Section titled “Memo (raw_data.data)”](#memo-raw_datadata)
`transfer({ …, memo })`, `{ to, value, memo }` and contract calls with `memo` attach the text as protobuf field 10 of the node-built `raw_data`. The record is spliced at its canonical position (after `expiration`, before `contract`) so the `txID` we sign equals the one java-tron recomputes from its own re-serialization; the JSON broadcast carries the same bytes as `raw_data.data` (hex). The memo fee (`getMemoFee`, 1 TRX) and the extra bandwidth show up in `estimateFee`, and `describeTransaction` reports the memo with a `memo-fee` warning. Memos are capped at 512 UTF-8 bytes; attaching one to a transaction that already carries `raw_data.data` is refused.
## Signers
[Section titled “Signers”](#signers)
Accounts sign through a secp256k1 `Signer` from `@anywalletkit/core`: the seed path uses a `LocalSigner` (zeroized on `dispose()`); `new WalletManagerTron(signer)` wraps an external one (hardware, MPC, backend). Transactions ask for `ecdsa-recoverable` over `sha256(raw_data)` with context `tron-tx`, TIP-191 messages with `tron-message`. A derivable `SeedSigner` at `m/44'/195'/0'/0` yields `getAccount(i)` children; any other signer is `getAccount(0)` only. `WalletAccountTron.fromPrivateKey(…)` keeps the raw-key shape.
## Activity history
[Section titled “Activity history”](#activity-history)
`createTronHistory` is the chain’s `HistorySource` (`@anywalletkit/core`) over TronGrid.
```ts
import { createTronHistory } from '@anywalletkit/wallet-tron/history'
const history = createTronHistory({ apiKey: process.env.TRONGRID_KEY })
const page = await history.listActivity('TVSz6xJL2M53HDZyFTeDcGCmEDdwmU4zbv', { limit: 25 })
const older = await history.listActivity(address, { cursor: page.cursor })
const one = await history.getTransaction(page.items[0].hash, address)
history.explorerTxUrl(one.hash) // https://tronscan.org/#/transaction/…
```
| option | default | notes |
| -------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| `apiUrl` | `https://api.trongrid.io` (shasta / nile roots by `network`) | Any TronGrid-compatible host. |
| `apiKey` | none | `TRON-PRO-API-KEY`. Keyless TronGrid allows **1 request/s per endpoint** (it answers `request rate exceeded the allowed_rps(1)`). |
| `network` | `mainnet` | `tron:0x2b6653dc` / shasta / nile. |
| `rateLimit` | 1 rps keyless, 10 with a key | |
| `fetch`, `timeoutMs` | global, 15 000 | |
**Lists.** `GET /v1/accounts/{a}/transactions` and `GET /v1/accounts/{a}/transactions/trc20`, both with `limit`, `order_by=block_timestamp,desc`, `fingerprint` to continue and `min_timestamp` when `since` is given, merged by txID: a `TriggerSmartContract` row plus its TRC-20 rows is one `ChainTx` whose token legs come from the TRC-20 rows (`token` = contract, `standard: 'trc20'`, `symbol`, `decimals` from `token_info`). A transfer known only from the TRC-20 list (someone else’s call that moved tokens to the address) is a row of its own: `confirmed`, no `fee`, no `call`, no `block`. `TransferContract` → native transfer and `nativeValue`; `TransferAssetContract` → a transfer with the TRC-10 id as `token`; `TriggerSmartContract` → `call.to` = contract (base58), `call.selector` = first 4 bytes of `data`, `call.data` = `0x` + data, `call.method = 'transfer'` for `a9059cbb`, `nativeValue` = `call_value`; other system contracts (freeze, vote, delegate…) → `call.method` = contract type, `call.to` = receiver or the owner. `internal_transactions` with TRX call values become native transfers. `fee` = `ret[0].fee` (falls back to `net_fee + energy_fee`), `status` from `contractRet`, `block` = `blockNumber`.
**Cursor.** Each list is read along its own `meta.fingerprint`. The rows of one transaction share a block timestamp, so a page takes the next timestamp’s rows from both lists, merges them by txID and emits them in txID order; when they do not fit in `limit`, the page ends inside that timestamp. The cursor is base64 JSON `{ v: 2, n, s: { tx, trc20 }, t?, g? }`: the rows per API request `n` the positions were taken with (kept for the whole listing, whatever `limit` later pages ask), per list the fingerprint of the page holding its unread rows and how many of them were consumed (`null` once read to the end), plus — for a timestamp emitted only in part — its value `t` and the transactions of it already emitted `g`. Nothing is lost or repeated however many rows share a timestamp; a fingerprint the API does not advance (a gateway dropping the parameter) ends that list instead of looping, and more than 500 pages of one list in one call fail it with `HistoryUnavailableError` (the cursor stays usable) rather than cut the list; a `v: 1` cursor from an earlier version is refused (start the listing again).
**Single transaction.** `POST /wallet/gettransactionbyid` + `POST /wallet/gettransactioninfobyid` (two requests): exact `fee`, `status` from `receipt.result`, block / time from the info, TRC-20 legs decoded from `Transfer` logs (symbol / decimals unknown there). The info endpoint is **not** called while listing — the fee of a TRC-20-only row stays undefined (it was paid by the other party), the fee of the address’s own transactions is already in the list row.
Fixtures in `test/fixtures/history/` were captured on 2026-10-14 from `api.trongrid.io` (keyless, paced): the test wallet’s `/transactions` page (TRX in / out, TRC-10 airdrops) and its empty `/trc20` page, plus — because the test wallet has no TRC-20 or contract activity — the pages of `TCanhfMgr9RsFRoxkJ8YkJD8Faha85a14p` (a counterparty of the wallet: USDT `transfer` via `TriggerSmartContract`, TRC-20 rows) and the full-node `gettransactionbyid` / `gettransactioninfobyid` of that USDT transfer. No protocol module recognizes Tron transactions yet, so there is no recognizer cross-check.
## Classes
[Section titled “Classes”](#classes)
* [BroadcastUnknownError](/api/anywalletkit/wallet-tron/classes/broadcastunknownerror/)
* [HistoryUnavailableError](/api/anywalletkit/wallet-tron/classes/historyunavailableerror/)
* [NonCanonicalError](/api/anywalletkit/wallet-tron/classes/noncanonicalerror/)
* [SimulationError](/api/anywalletkit/wallet-tron/classes/simulationerror/)
* [UnsafeTransactionError](/api/anywalletkit/wallet-tron/classes/unsafetransactionerror/)
* [WalletAccountReadOnlyTron](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/)
* [WalletAccountTron](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)
* [WalletManagerTron](/api/anywalletkit/wallet-tron/classes/walletmanagertron/)
## Interfaces
[Section titled “Interfaces”](#interfaces)
* [ConstantCallResponse](/api/anywalletkit/wallet-tron/interfaces/constantcallresponse/)
* [Contract](/api/anywalletkit/wallet-tron/interfaces/contract/)
* [DescribeContext](/api/anywalletkit/wallet-tron/interfaces/describecontext/)
* [Field](/api/anywalletkit/wallet-tron/interfaces/field/)
* [FullNodeTxInfo](/api/anywalletkit/wallet-tron/interfaces/fullnodetxinfo/)
* [Resources](/api/anywalletkit/wallet-tron/interfaces/resources/)
* [TronChainTx](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)
* [TronConfig](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)
* [TronContractCall](/api/anywalletkit/wallet-tron/interfaces/troncontractcall/)
* [TronDecodedContract](/api/anywalletkit/wallet-tron/interfaces/trondecodedcontract/)
* [TronDecodedRaw](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/)
* [TronFeeBreakdown](/api/anywalletkit/wallet-tron/interfaces/tronfeebreakdown/)
* [TronFeeEstimate](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)
* [TronGridTrc20](/api/anywalletkit/wallet-tron/interfaces/trongridtrc20/)
* [TronGridTx](/api/anywalletkit/wallet-tron/interfaces/trongridtx/)
* [TronHistoryCursor](/api/anywalletkit/wallet-tron/interfaces/tronhistorycursor/)
* [TronHistoryOptions](/api/anywalletkit/wallet-tron/interfaces/tronhistoryoptions/)
* [TronHistoryPage](/api/anywalletkit/wallet-tron/interfaces/tronhistorypage/)
* [TronHistoryRaw](/api/anywalletkit/wallet-tron/interfaces/tronhistoryraw/)
* [TronHistorySource](/api/anywalletkit/wallet-tron/interfaces/tronhistorysource/)
* [TronListPosition](/api/anywalletkit/wallet-tron/interfaces/tronlistposition/)
* [TronNativeTransfer](/api/anywalletkit/wallet-tron/interfaces/tronnativetransfer/)
* [TronQuote](/api/anywalletkit/wallet-tron/interfaces/tronquote/)
* [TronRawTransaction](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
* [TronReceipt](/api/anywalletkit/wallet-tron/interfaces/tronreceipt/)
* [TronSimulation](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)
* [TronTransferOptions](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
* [TronTransferResult](/api/anywalletkit/wallet-tron/interfaces/trontransferresult/)
* [TronTxDescription](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)
* [TronTxWarning](/api/anywalletkit/wallet-tron/interfaces/trontxwarning/)
* [VerifiedRaw](/api/anywalletkit/wallet-tron/interfaces/verifiedraw/)
## Type Aliases
[Section titled “Type Aliases”](#type-aliases)
* [ExpectedBuild](/api/anywalletkit/wallet-tron/type-aliases/expectedbuild/)
* [HistoryFetch](/api/anywalletkit/wallet-tron/type-aliases/historyfetch/)
* [MemoEncoding](/api/anywalletkit/wallet-tron/type-aliases/memoencoding/)
* [TronFetch](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
* [TronNetwork](/api/anywalletkit/wallet-tron/type-aliases/tronnetwork/)
* [TronProvider](/api/anywalletkit/wallet-tron/type-aliases/tronprovider/)
* [TronTransaction](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
* [TronTxKind](/api/anywalletkit/wallet-tron/type-aliases/trontxkind/)
* [TronTxWarningCode](/api/anywalletkit/wallet-tron/type-aliases/trontxwarningcode/)
* [UnsafeTransactionCode](/api/anywalletkit/wallet-tron/type-aliases/unsafetransactioncode/)
## Variables
[Section titled “Variables”](#variables)
* [CAIP2_GENESIS](/api/anywalletkit/wallet-tron/variables/caip2_genesis/)
* [CONTRACT_TYPES](/api/anywalletkit/wallet-tron/variables/contract_types/)
* [DEFAULT_FEE_LIMIT_SUN](/api/anywalletkit/wallet-tron/variables/default_fee_limit_sun/)
* [FEE_LIMIT_MARGIN](/api/anywalletkit/wallet-tron/variables/fee_limit_margin/)
* [MAX_EXPIRATION_MS](/api/anywalletkit/wallet-tron/variables/max_expiration_ms/)
* [MAX_MEMO_BYTES](/api/anywalletkit/wallet-tron/variables/max_memo_bytes/)
* [MEMO_FIELD](/api/anywalletkit/wallet-tron/variables/memo_field/)
* [TRANSFER_TOPIC](/api/anywalletkit/wallet-tron/variables/transfer_topic/)
* [TRON_ACCOUNT_BRANCH](/api/anywalletkit/wallet-tron/variables/tron_account_branch/)
* [TRON_BASE_PATH](/api/anywalletkit/wallet-tron/variables/tron_base_path/)
* [ZERO_ADDRESS](/api/anywalletkit/wallet-tron/variables/zero_address/)
* [ZERO_ADDRESS_HEX](/api/anywalletkit/wallet-tron/variables/zero_address_hex/)
## Functions
[Section titled “Functions”](#functions)
* [addressFromPublicKey](/api/anywalletkit/wallet-tron/functions/addressfrompublickey/)
* [assertNodeBuild](/api/anywalletkit/wallet-tron/functions/assertnodebuild/)
* [attachMemo](/api/anywalletkit/wallet-tron/functions/attachmemo/)
* [bandwidthPoints](/api/anywalletkit/wallet-tron/functions/bandwidthpoints/)
* [createClient](/api/anywalletkit/wallet-tron/functions/createclient/)
* [createTronHistory](/api/anywalletkit/wallet-tron/functions/createtronhistory/)
* [decodeAddressWord](/api/anywalletkit/wallet-tron/functions/decodeaddressword/)
* [decodeHistoryCursor](/api/anywalletkit/wallet-tron/functions/decodehistorycursor/)
* [decodeRawData](/api/anywalletkit/wallet-tron/functions/decoderawdata/)
* [decodeRevertReason](/api/anywalletkit/wallet-tron/functions/decoderevertreason/)
* [decodeUint](/api/anywalletkit/wallet-tron/functions/decodeuint/)
* [describeTransaction](/api/anywalletkit/wallet-tron/functions/describetransaction/)
* [encodeCall](/api/anywalletkit/wallet-tron/functions/encodecall/)
* [encodeHistoryCursor](/api/anywalletkit/wallet-tron/functions/encodehistorycursor/)
* [encodeMemoRecord](/api/anywalletkit/wallet-tron/functions/encodememorecord/)
* [encodeParameters](/api/anywalletkit/wallet-tron/functions/encodeparameters/)
* [encodeRawData](/api/anywalletkit/wallet-tron/functions/encoderawdata/)
* [hashMessage](/api/anywalletkit/wallet-tron/functions/hashmessage/)
* [hexToText](/api/anywalletkit/wallet-tron/functions/hextotext/)
* [isContractCall](/api/anywalletkit/wallet-tron/functions/iscontractcall/)
* [isDecodedContractType](/api/anywalletkit/wallet-tron/functions/isdecodedcontracttype/)
* [isHexAddress](/api/anywalletkit/wallet-tron/functions/ishexaddress/)
* [isPrebuilt](/api/anywalletkit/wallet-tron/functions/isprebuilt/)
* [mapHistoryTransactionRow](/api/anywalletkit/wallet-tron/functions/maphistorytransactionrow/)
* [mapHistoryTrc20Only](/api/anywalletkit/wallet-tron/functions/maphistorytrc20only/)
* [memoBytes](/api/anywalletkit/wallet-tron/functions/memobytes/)
* [rawMismatch](/api/anywalletkit/wallet-tron/functions/rawmismatch/)
* [readFields](/api/anywalletkit/wallet-tron/functions/readfields/)
* [recoverMessageAddress](/api/anywalletkit/wallet-tron/functions/recovermessageaddress/)
* [selector](/api/anywalletkit/wallet-tron/functions/selector/)
* [splitCalldata](/api/anywalletkit/wallet-tron/functions/splitcalldata/)
* [toBase58Address](/api/anywalletkit/wallet-tron/functions/tobase58address/)
* [toHexAddress](/api/anywalletkit/wallet-tron/functions/tohexaddress/)
* [tronExplorerTxUrl](/api/anywalletkit/wallet-tron/functions/tronexplorertxurl/)
* [verifyRawTransaction](/api/anywalletkit/wallet-tron/functions/verifyrawtransaction/)
## References
[Section titled “References”](#references)
### default
[Section titled “default”](#default)
Renames and re-exports [WalletManagerTron](/api/anywalletkit/wallet-tron/classes/walletmanagertron/)
# BroadcastUnknownError
Defined in: wallet-tron/src/errors.ts:56
The signed transaction was handed to the network but no node answered: it MAY be on its way. Do not build and sign it again (a new `txID` would pay twice) — watch `hash` instead.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new BroadcastUnknownError**(`hash`, `cause`): `BroadcastUnknownError`
Defined in: wallet-tron/src/errors.ts:61
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
##### cause
[Section titled “cause”](#cause)
`unknown`
#### Returns
[Section titled “Returns”](#returns)
`BroadcastUnknownError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### hash
[Section titled “hash”](#hash-1)
> `readonly` **hash**: `string`
Defined in: wallet-tron/src/errors.ts:60
The signed transaction’s `txID`.
***
### maybeSent
[Section titled “maybeSent”](#maybesent)
> `readonly` **maybeSent**: `true` = `true`
Defined in: wallet-tron/src/errors.ts:58
Always true: the transaction may be on its way.
# HistoryUnavailableError
Defined in: wallet-tron/src/history.ts:75
Every configured TronGrid endpoint failed.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new HistoryUnavailableError**(`chain`, `reason`, `attempts?`): `HistoryUnavailableError`
Defined in: wallet-tron/src/history.ts:79
#### Parameters
[Section titled “Parameters”](#parameters)
##### chain
[Section titled “chain”](#chain)
`string`
##### reason
[Section titled “reason”](#reason)
`string`
##### attempts?
[Section titled “attempts?”](#attempts)
readonly `string`\[] = `[]`
#### Returns
[Section titled “Returns”](#returns)
`HistoryUnavailableError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### attempts
[Section titled “attempts”](#attempts-1)
> `readonly` **attempts**: readonly `string`\[]
Defined in: wallet-tron/src/history.ts:78
***
### chain
[Section titled “chain”](#chain-1)
> `readonly` **chain**: `string`
Defined in: wallet-tron/src/history.ts:76
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-tron/src/history.ts:77
# NonCanonicalError
Defined in: wallet-tron/src/raw\.ts:35
Bytes that a strict protobuf reader would not produce or that java-tron would read differently from this codec (scan F4). The wallet refuses them rather than guess: protobuf-java keeps only the low 32 bits of an over-long tag, so a field this codec would call “unknown 536870916” is `data` to the node.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new NonCanonicalError**(`message`): `NonCanonicalError`
Defined in: wallet-tron/src/raw\.ts:36
#### Parameters
[Section titled “Parameters”](#parameters)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`NonCanonicalError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
# SimulationError
Defined in: wallet-tron/src/errors.ts:41
A constant call (or balance pre-check) predicted failure; nothing was signed or broadcast.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new SimulationError**(`reason`, `energy?`): `SimulationError`
Defined in: wallet-tron/src/errors.ts:44
#### Parameters
[Section titled “Parameters”](#parameters)
##### reason
[Section titled “reason”](#reason)
`string`
##### energy?
[Section titled “energy?”](#energy)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns)
`SimulationError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### energy
[Section titled “energy”](#energy-1)
> `readonly` **energy**: `number`
Defined in: wallet-tron/src/errors.ts:43
***
### reason
[Section titled “reason”](#reason-1)
> `readonly` **reason**: `string`
Defined in: wallet-tron/src/errors.ts:42
# UnsafeTransactionError
Defined in: wallet-tron/src/errors.ts:31
A transaction failed a hard check and was not signed.
## Extends
[Section titled “Extends”](#extends)
* `Error`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new UnsafeTransactionError**(`code`, `message`): `UnsafeTransactionError`
Defined in: wallet-tron/src/errors.ts:33
#### Parameters
[Section titled “Parameters”](#parameters)
##### code
[Section titled “code”](#code)
[`UnsafeTransactionCode`](/api/anywalletkit/wallet-tron/type-aliases/unsafetransactioncode/)
##### message
[Section titled “message”](#message)
`string`
#### Returns
[Section titled “Returns”](#returns)
`UnsafeTransactionError`
#### Overrides
[Section titled “Overrides”](#overrides)
`Error.constructor`
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code-1)
> `readonly` **code**: [`UnsafeTransactionCode`](/api/anywalletkit/wallet-tron/type-aliases/unsafetransactioncode/)
Defined in: wallet-tron/src/errors.ts:32
# WalletAccountReadOnlyTron
Defined in: wallet-tron/src/read-only-account.ts:101
A Tron address without a key: TRX and TRC-20 balances, allowances, resources, fee estimates, simulation, receipts and signature checks.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccountReadOnly`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountReadOnlyTron**(`address`, `config?`): `WalletAccountReadOnlyTron`
Defined in: wallet-tron/src/read-only-account.ts:110
#### Parameters
[Section titled “Parameters”](#parameters)
##### address
[Section titled “address”](#address)
`string`
##### config?
[Section titled “config?”](#config)
[`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountReadOnlyTron`
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/) | `undefined`
Defined in: wallet-tron/src/read-only-account.ts:108
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)
Defined in: wallet-tron/src/read-only-account.ts:107
***
### address
[Section titled “address”](#address-1)
> `readonly` **address**: `string`
Defined in: wallet-tron/src/read-only-account.ts:103
base58 T…
***
### addressHex
[Section titled “addressHex”](#addresshex)
> `readonly` **addressHex**: `string`
Defined in: wallet-tron/src/read-only-account.ts:105
Hex form (`41…`).
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-tron/src/read-only-account.ts:106
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccountReadOnly.chain`
## Methods
[Section titled “Methods”](#methods)
### accountExists()
[Section titled “accountExists()”](#accountexists)
> **accountExists**(`address`): `Promise`<`boolean`>
Defined in: wallet-tron/src/read-only-account.ts:168
Does an account exist on chain (`/wallet/getaccount` non-empty)?
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### address
[Section titled “address”](#address-2)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<`boolean`>
***
### asTransaction()
[Section titled “asTransaction()”](#astransaction)
> `protected` **asTransaction**(`o`): [`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
Defined in: wallet-tron/src/read-only-account.ts:361
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### o
[Section titled “o”](#o)
[`TronTransferOptions`](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-2)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
***
### buildTransaction()
[Section titled “buildTransaction()”](#buildtransaction)
> `protected` **buildTransaction**(`tx`): `Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
Defined in: wallet-tron/src/read-only-account.ts:214
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
***
### buildWithSimulation()
[Section titled “buildWithSimulation()”](#buildwithsimulation)
> `protected` **buildWithSimulation**(`tx`, `cap?`): `Promise`<{ `built`: [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/); `sim?`: [`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/); }>
Defined in: wallet-tron/src/read-only-account.ts:180
Ask the node for `raw_data`. Contract calls are simulated first so `fee_limit` can be derived from the energy they need (×1.2, capped at `transactionMaxFee` and the call’s `cap`) when the caller gives none; the simulation rides along so nobody pays for a second one.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx-1)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### cap?
[Section titled “cap?”](#cap)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<{ `built`: [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/); `sim?`: [`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/); }>
***
### constantCall()
[Section titled “constantCall()”](#constantcall)
> `protected` **constantCall**(`contract`, `functionSelector`, `parameters`, `what`, `extra?`): `Promise`<[`ConstantCallResponse`](/api/anywalletkit/wallet-tron/interfaces/constantcallresponse/)>
Defined in: wallet-tron/src/read-only-account.ts:140
Read-only contract call. Returns constant_result hex strings.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### contract
[Section titled “contract”](#contract)
`string`
##### functionSelector
[Section titled “functionSelector”](#functionselector)
`string`
##### parameters
[Section titled “parameters”](#parameters-6)
`object`\[]
##### what
[Section titled “what”](#what)
`string`
##### extra?
[Section titled “extra?”](#extra)
`Record`<`string`, `unknown`> = `{}`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`ConstantCallResponse`](/api/anywalletkit/wallet-tron/interfaces/constantcallresponse/)>
***
### describeTransactionOnline()
[Section titled “describeTransactionOnline()”](#describetransactiononline)
> **describeTransactionOnline**(`tx`, `ctx?`): `Promise`<[`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)>
Defined in: wallet-tron/src/read-only-account.ts:377
`describeTransaction` plus the `unactivated-recipient` check against the node.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx-2)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-tron/interfaces/describecontext/) = `{}`
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<[`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)>
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`tx`): `Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
Defined in: wallet-tron/src/read-only-account.ts:339
Build (if needed) and price a transaction: bandwidth, energy and the sun the sender burns.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### tx
[Section titled “tx”](#tx-3)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
***
### estimateRaw()
[Section titled “estimateRaw()”](#estimateraw)
> `protected` **estimateRaw**(`tx`, `sim?`): `Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
Defined in: wallet-tron/src/read-only-account.ts:301
Resource-by-resource cost of a node-built transaction. `energy` comes from a constant call unless the caller already has one (`sim`).
#### Parameters
[Section titled “Parameters”](#parameters-9)
##### tx
[Section titled “tx”](#tx-4)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### sim?
[Section titled “sim?”](#sim)
[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-tron/src/read-only-account.ts:131
The base58 address.
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccountReadOnly.getAddress`
***
### getAllowance()
[Section titled “getAllowance()”](#getallowance)
> **getAllowance**(`token`, `spender`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:162
TRC-20 `allowance(owner, spender)` in base units.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### token
[Section titled “token”](#token)
`string`
##### spender
[Section titled “spender”](#spender)
`string`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<`bigint`>
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:134
TRX balance in sun; 0 for an account that does not exist yet.
#### Returns
[Section titled “Returns”](#returns-11)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccountReadOnly.getBalance`
***
### getChainParameter()
[Section titled “getChainParameter()”](#getchainparameter)
> `protected` **getChainParameter**(`key`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:291
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<`bigint`>
***
### getChainParameters()
[Section titled “getChainParameters()”](#getchainparameters)
> `protected` **getChainParameters**(): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-tron/src/read-only-account.ts:284
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<`Record`<`string`, `bigint`>>
***
### getResources()
[Section titled “getResources()”](#getresources)
> `protected` **getResources**(): `Promise`<[`Resources`](/api/anywalletkit/wallet-tron/interfaces/resources/)>
Defined in: wallet-tron/src/read-only-account.ts:280
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<[`Resources`](/api/anywalletkit/wallet-tron/interfaces/resources/)>
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:149
TRC-20 `balanceOf` in the token’s base units.
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccountReadOnly.getTokenBalance`
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-tron/src/read-only-account.ts:155
Several TRC-20 balances in parallel, keyed by the tokens as given.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`Record`<`string`, `bigint`>>
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`TronReceipt`](/api/anywalletkit/wallet-tron/interfaces/tronreceipt/) | `undefined`>
Defined in: wallet-tron/src/read-only-account.ts:384
The receipt, or `undefined` while the transaction is unconfirmed.
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<[`TronReceipt`](/api/anywalletkit/wallet-tron/interfaces/tronreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccountReadOnly.getTransactionReceipt`
***
### post()
[Section titled “post()”](#post)
> `protected` **post**<`T`>(`path`, `body`, `what`): `Promise`<`T`>
Defined in: wallet-tron/src/read-only-account.ts:124
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T`
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### path
[Section titled “path”](#path)
`string`
##### body
[Section titled “body”](#body)
`unknown`
##### what
[Section titled “what”](#what-1)
`string`
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`T`>
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:351
`fee` = the sun the sender burns, after staked / free resources.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tx
[Section titled “tx”](#tx-5)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccountReadOnly.quoteSendTransaction`
***
### quoteTransaction()
[Section titled “quoteTransaction()”](#quotetransaction)
> `protected` **quoteTransaction**(`tx`, `sim?`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:345
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### tx
[Section titled “tx”](#tx-6)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### sim?
[Section titled “sim?”](#sim-1)
[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:369
Fee of a transfer in sun, including account activation when the recipient is new.
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### o
[Section titled “o”](#o-1)
[`TronTransferOptions`](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccountReadOnly.quoteTransfer`
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
Defined in: wallet-tron/src/read-only-account.ts:119
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### what
[Section titled “what”](#what-2)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
[`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
***
### simulateCall()
[Section titled “simulateCall()”](#simulatecall)
> `protected` **simulateCall**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:221
Constant call by selector + params (unbuilt contract call). Never throws on a revert.
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-7)
[`TronContractCall`](/api/anywalletkit/wallet-tron/interfaces/troncontractcall/)
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
***
### simulateRaw()
[Section titled “simulateRaw()”](#simulateraw)
> `protected` **simulateRaw**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:260
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### tx
[Section titled “tx”](#tx-8)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:250
Predict the outcome without signing: contract calls run through `/wallet/triggerconstantcontract` (revert reason ABI-decoded); TRX transfers check that the balance covers amount + fees. Transport failures throw, predicted failures don’t.
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### tx
[Section titled “tx”](#tx-9)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
***
### trc20TransferParams()
[Section titled “trc20TransferParams()”](#trc20transferparams)
> `protected` **trc20TransferParams**(`recipient`, `amount`): ({ `type`: `string`; `value`: `string`; } | { `type`: `string`; `value`: `bigint`; })\[]
Defined in: wallet-tron/src/read-only-account.ts:357
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### recipient
[Section titled “recipient”](#recipient)
`string`
##### amount
[Section titled “amount”](#amount)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-26)
({ `type`: `string`; `value`: `string`; } | { `type`: `string`; `value`: `bigint`; })\[]
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-tron/src/read-only-account.ts:393
Verify a TIP-191 signature produced by `sign` (0x + r||s||v, v = 27|28 or 0|1).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-27)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccountReadOnly.verify`
# WalletAccountTron
Defined in: wallet-tron/src/account.ts:41
Signing Tron account. The key lives in a secp256k1 Signer (a local key zeroized by `dispose()`, or an external hardware / MPC / backend signer). The full node builds `raw_data`; we check it, simulate it, have the signer sign `txID` (= sha256(raw_data)) as recoverable ECDSA (context `tron-tx`) and broadcast.
## Extends
[Section titled “Extends”](#extends)
* [`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/)
## Implements
[Section titled “Implements”](#implements)
* `IWalletAccount`
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletAccountTron**(`signer`, `publicKey`, `path`, `config?`): `WalletAccountTron`
Defined in: wallet-tron/src/account.ts:59
#### Parameters
[Section titled “Parameters”](#parameters)
##### signer
[Section titled “signer”](#signer)
`Signer`
##### publicKey
[Section titled “publicKey”](#publickey)
`Uint8Array`
##### path
[Section titled “path”](#path)
`string`
##### config?
[Section titled “config?”](#config)
[`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletAccountTron`
#### Overrides
[Section titled “Overrides”](#overrides)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`constructor`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#constructor)
## Properties
[Section titled “Properties”](#properties)
### \_client
[Section titled “\_client”](#_client)
> `protected` `readonly` **\_client**: [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/) | `undefined`
Defined in: wallet-tron/src/read-only-account.ts:108
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`_client`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#_client)
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)
Defined in: wallet-tron/src/read-only-account.ts:107
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`_config`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#_config)
***
### address
[Section titled “address”](#address)
> `readonly` **address**: `string`
Defined in: wallet-tron/src/read-only-account.ts:103
base58 T…
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`address`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#address)
***
### addressHex
[Section titled “addressHex”](#addresshex)
> `readonly` **addressHex**: `string`
Defined in: wallet-tron/src/read-only-account.ts:105
Hex form (`41…`).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`addressHex`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#addresshex)
***
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: wallet-tron/src/read-only-account.ts:106
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
#### Implementation of
[Section titled “Implementation of”](#implementation-of)
`IWalletAccount.chain`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`chain`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#chain)
***
### needsNetwork
[Section titled “needsNetwork”](#needsnetwork)
> `readonly` **needsNetwork**: `true` = `true`
Defined in: wallet-tron/src/account.ts:43
ref block / expiration come from the node, so building needs the network.
#### Implementation of
[Section titled “Implementation of”](#implementation-of-1)
`IWalletAccount.needsNetwork`
***
### path
[Section titled “path”](#path-1)
> `readonly` **path**: `string`
Defined in: wallet-tron/src/account.ts:45
Derivation path, or `external` for an external signer.
***
### publicKey
[Section titled “publicKey”](#publickey-1)
> `readonly` **publicKey**: `Uint8Array`
Defined in: wallet-tron/src/account.ts:47
Compressed secp256k1 key (33 bytes); needed synchronously for the address.
***
### signerKind
[Section titled “signerKind”](#signerkind)
> `readonly` **signerKind**: `"seed"` | `"key"` | `"external"`
Defined in: wallet-tron/src/account.ts:55
What holds the key: `seed`, `key` (one imported key) or `external`.
## Accessors
[Section titled “Accessors”](#accessors)
### index
[Section titled “index”](#index)
#### Get Signature
[Section titled “Get Signature”](#get-signature)
> **get** **index**(): `number` | `undefined`
Defined in: wallet-tron/src/account.ts:73
Account index for the standard m/44’/195’/0’/0/i path.
##### Returns
[Section titled “Returns”](#returns-1)
`number` | `undefined`
## Methods
[Section titled “Methods”](#methods)
### accountExists()
[Section titled “accountExists()”](#accountexists)
> **accountExists**(`address`): `Promise`<`boolean`>
Defined in: wallet-tron/src/read-only-account.ts:168
Does an account exist on chain (`/wallet/getaccount` non-empty)?
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### address
[Section titled “address”](#address-1)
`string`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<`boolean`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`accountExists`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#accountexists)
***
### assertRefBlock()
[Section titled “assertRefBlock()”](#assertrefblock)
> `protected` **assertRefBlock**(`tx`): `Promise`<`void`>
Defined in: wallet-tron/src/account.ts:131
A Tron transaction is bound to its network only by its reference block (TaPoS), and the key is the same on every network. With a provider, the block at `ref_block_bytes` (the latest one with those low 16 bits) must have the `ref_block_hash` the transaction names; offline, only a mainnet account signs, unless `allowOfflineTestnetSigning` (scan 2026-10-27 F22, F27).
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### tx
[Section titled “tx”](#tx)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
#### Returns
[Section titled “Returns”](#returns-3)
`Promise`<`void`>
***
### assertSafe()
[Section titled “assertSafe()”](#assertsafe)
> `protected` **assertSafe**(`tx`, `now?`, `limit?`): `void`
Defined in: wallet-tron/src/account.ts:183
Refuse to sign what cannot be right: a foreign owner, a missing or expired (or >24h) expiration, no ref block, more than one contract, a TRX / TRC-20 transfer to the zero address (unless `allowBurn`), a `fee_limit` above `transactionMaxFee` or the call’s cap (`limit`), an `AccountPermissionUpdateContract` (unless `allowPermissionChanges`), a contract type the wallet cannot decode (unless `allowUndecodedContracts`; `VoteWitnessContract` only re-assigns votes and passes).
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### tx
[Section titled “tx”](#tx-1)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### now?
[Section titled “now?”](#now)
`number` = `...`
##### limit?
[Section titled “limit?”](#limit)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-4)
`void`
***
### assertWorstFee()
[Section titled “assertWorstFee()”](#assertworstfee)
> `protected` **assertWorstFee**(`tx`, `cap`): `Promise`<`void`>
Defined in: wallet-tron/src/account.ts:162
What prebuilt bytes may burn at worst, held to `cap`: fee_limit of energy, plus the bandwidth, memo and activation fees fee_limit does not cover — the bound prepare() applies (round 3, M8). A contract call without fee_limit, or no provider to price the rest, is refused (scan 2026-10-27 F25).
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### tx
[Section titled “tx”](#tx-2)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### cap
[Section titled “cap”](#cap)
`bigint`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<`void`>
***
### asTransaction()
[Section titled “asTransaction()”](#astransaction)
> `protected` **asTransaction**(`o`): [`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
Defined in: wallet-tron/src/read-only-account.ts:361
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### o
[Section titled “o”](#o)
[`TronTransferOptions`](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-6)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`asTransaction`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#astransaction)
***
### buildTransaction()
[Section titled “buildTransaction()”](#buildtransaction)
> `protected` **buildTransaction**(`tx`): `Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
Defined in: wallet-tron/src/read-only-account.ts:214
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### tx
[Section titled “tx”](#tx-3)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-7)
`Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`buildTransaction`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#buildtransaction)
***
### buildWithSimulation()
[Section titled “buildWithSimulation()”](#buildwithsimulation)
> `protected` **buildWithSimulation**(`tx`, `cap?`): `Promise`<{ `built`: [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/); `sim?`: [`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/); }>
Defined in: wallet-tron/src/read-only-account.ts:180
Ask the node for `raw_data`. Contract calls are simulated first so `fee_limit` can be derived from the energy they need (×1.2, capped at `transactionMaxFee` and the call’s `cap`) when the caller gives none; the simulation rides along so nobody pays for a second one.
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### tx
[Section titled “tx”](#tx-4)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### cap?
[Section titled “cap?”](#cap-1)
`number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-8)
`Promise`<{ `built`: [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/); `sim?`: [`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/); }>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`buildWithSimulation`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#buildwithsimulation)
***
### constantCall()
[Section titled “constantCall()”](#constantcall)
> `protected` **constantCall**(`contract`, `functionSelector`, `parameters`, `what`, `extra?`): `Promise`<[`ConstantCallResponse`](/api/anywalletkit/wallet-tron/interfaces/constantcallresponse/)>
Defined in: wallet-tron/src/read-only-account.ts:140
Read-only contract call. Returns constant_result hex strings.
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### contract
[Section titled “contract”](#contract)
`string`
##### functionSelector
[Section titled “functionSelector”](#functionselector)
`string`
##### parameters
[Section titled “parameters”](#parameters-9)
`object`\[]
##### what
[Section titled “what”](#what)
`string`
##### extra?
[Section titled “extra?”](#extra)
`Record`<`string`, `unknown`> = `{}`
#### Returns
[Section titled “Returns”](#returns-9)
`Promise`<[`ConstantCallResponse`](/api/anywalletkit/wallet-tron/interfaces/constantcallresponse/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`constantCall`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#constantcall)
***
### describeTransactionOnline()
[Section titled “describeTransactionOnline()”](#describetransactiononline)
> **describeTransactionOnline**(`tx`, `ctx?`): `Promise`<[`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)>
Defined in: wallet-tron/src/read-only-account.ts:377
`describeTransaction` plus the `unactivated-recipient` check against the node.
#### Parameters
[Section titled “Parameters”](#parameters-10)
##### tx
[Section titled “tx”](#tx-5)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-tron/interfaces/describecontext/) = `{}`
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`describeTransactionOnline`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#describetransactiononline)
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: wallet-tron/src/account.ts:291
Dispose the signer (zeroizes a local key). Idempotent.
#### Returns
[Section titled “Returns”](#returns-11)
`void`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-2)
`IWalletAccount.dispose`
***
### estimateFee()
[Section titled “estimateFee()”](#estimatefee)
> **estimateFee**(`tx`): `Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
Defined in: wallet-tron/src/read-only-account.ts:339
Build (if needed) and price a transaction: bandwidth, energy and the sun the sender burns.
#### Parameters
[Section titled “Parameters”](#parameters-11)
##### tx
[Section titled “tx”](#tx-6)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-12)
`Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`estimateFee`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#estimatefee)
***
### estimateRaw()
[Section titled “estimateRaw()”](#estimateraw)
> `protected` **estimateRaw**(`tx`, `sim?`): `Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
Defined in: wallet-tron/src/read-only-account.ts:301
Resource-by-resource cost of a node-built transaction. `energy` comes from a constant call unless the caller already has one (`sim`).
#### Parameters
[Section titled “Parameters”](#parameters-12)
##### tx
[Section titled “tx”](#tx-7)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### sim?
[Section titled “sim?”](#sim)
[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)
#### Returns
[Section titled “Returns”](#returns-13)
`Promise`<[`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-12)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`estimateRaw`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#estimateraw)
***
### getAddress()
[Section titled “getAddress()”](#getaddress)
> **getAddress**(): `Promise`<`string`>
Defined in: wallet-tron/src/read-only-account.ts:131
The base58 address.
#### Returns
[Section titled “Returns”](#returns-14)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-3)
`IWalletAccount.getAddress`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-13)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getAddress`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getaddress)
***
### getAllowance()
[Section titled “getAllowance()”](#getallowance)
> **getAllowance**(`token`, `spender`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:162
TRC-20 `allowance(owner, spender)` in base units.
#### Parameters
[Section titled “Parameters”](#parameters-13)
##### token
[Section titled “token”](#token)
`string`
##### spender
[Section titled “spender”](#spender)
`string`
#### Returns
[Section titled “Returns”](#returns-15)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-14)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getAllowance`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getallowance)
***
### getBalance()
[Section titled “getBalance()”](#getbalance)
> **getBalance**(): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:134
TRX balance in sun; 0 for an account that does not exist yet.
#### Returns
[Section titled “Returns”](#returns-16)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-4)
`IWalletAccount.getBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-15)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getBalance`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getbalance)
***
### getChainParameter()
[Section titled “getChainParameter()”](#getchainparameter)
> `protected` **getChainParameter**(`key`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:291
#### Parameters
[Section titled “Parameters”](#parameters-14)
##### key
[Section titled “key”](#key)
`string`
#### Returns
[Section titled “Returns”](#returns-17)
`Promise`<`bigint`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-16)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getChainParameter`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getchainparameter)
***
### getChainParameters()
[Section titled “getChainParameters()”](#getchainparameters)
> `protected` **getChainParameters**(): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-tron/src/read-only-account.ts:284
#### Returns
[Section titled “Returns”](#returns-18)
`Promise`<`Record`<`string`, `bigint`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-17)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getChainParameters`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getchainparameters)
***
### getResources()
[Section titled “getResources()”](#getresources)
> `protected` **getResources**(): `Promise`<[`Resources`](/api/anywalletkit/wallet-tron/interfaces/resources/)>
Defined in: wallet-tron/src/read-only-account.ts:280
#### Returns
[Section titled “Returns”](#returns-19)
`Promise`<[`Resources`](/api/anywalletkit/wallet-tron/interfaces/resources/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-18)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getResources`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#getresources)
***
### getTokenBalance()
[Section titled “getTokenBalance()”](#gettokenbalance)
> **getTokenBalance**(`token`): `Promise`<`bigint`>
Defined in: wallet-tron/src/read-only-account.ts:149
TRC-20 `balanceOf` in the token’s base units.
#### Parameters
[Section titled “Parameters”](#parameters-15)
##### token
[Section titled “token”](#token-1)
`string`
#### Returns
[Section titled “Returns”](#returns-20)
`Promise`<`bigint`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-5)
`IWalletAccount.getTokenBalance`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-19)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getTokenBalance`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#gettokenbalance)
***
### getTokenBalances()
[Section titled “getTokenBalances()”](#gettokenbalances)
> **getTokenBalances**(`tokens`): `Promise`<`Record`<`string`, `bigint`>>
Defined in: wallet-tron/src/read-only-account.ts:155
Several TRC-20 balances in parallel, keyed by the tokens as given.
#### Parameters
[Section titled “Parameters”](#parameters-16)
##### tokens
[Section titled “tokens”](#tokens)
`string`\[]
#### Returns
[Section titled “Returns”](#returns-21)
`Promise`<`Record`<`string`, `bigint`>>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-20)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getTokenBalances`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#gettokenbalances)
***
### getTransactionReceipt()
[Section titled “getTransactionReceipt()”](#gettransactionreceipt)
> **getTransactionReceipt**(`hash`): `Promise`<[`TronReceipt`](/api/anywalletkit/wallet-tron/interfaces/tronreceipt/) | `undefined`>
Defined in: wallet-tron/src/read-only-account.ts:384
The receipt, or `undefined` while the transaction is unconfirmed.
#### Parameters
[Section titled “Parameters”](#parameters-17)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns-22)
`Promise`<[`TronReceipt`](/api/anywalletkit/wallet-tron/interfaces/tronreceipt/) | `undefined`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-6)
`IWalletAccount.getTransactionReceipt`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-21)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`getTransactionReceipt`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#gettransactionreceipt)
***
### post()
[Section titled “post()”](#post)
> `protected` **post**<`T`>(`path`, `body`, `what`): `Promise`<`T`>
Defined in: wallet-tron/src/read-only-account.ts:124
#### Type Parameters
[Section titled “Type Parameters”](#type-parameters)
##### T
[Section titled “T”](#t)
`T`
#### Parameters
[Section titled “Parameters”](#parameters-18)
##### path
[Section titled “path”](#path-2)
`string`
##### body
[Section titled “body”](#body)
`unknown`
##### what
[Section titled “what”](#what-1)
`string`
#### Returns
[Section titled “Returns”](#returns-23)
`Promise`<`T`>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-22)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`post`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#post)
***
### quoteSendTransaction()
[Section titled “quoteSendTransaction()”](#quotesendtransaction)
> **quoteSendTransaction**(`tx`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:351
`fee` = the sun the sender burns, after staked / free resources.
#### Parameters
[Section titled “Parameters”](#parameters-19)
##### tx
[Section titled “tx”](#tx-8)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-24)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-7)
`IWalletAccount.quoteSendTransaction`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-23)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`quoteSendTransaction`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#quotesendtransaction)
***
### quoteTransaction()
[Section titled “quoteTransaction()”](#quotetransaction)
> `protected` **quoteTransaction**(`tx`, `sim?`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:345
#### Parameters
[Section titled “Parameters”](#parameters-20)
##### tx
[Section titled “tx”](#tx-9)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### sim?
[Section titled “sim?”](#sim-1)
[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)
#### Returns
[Section titled “Returns”](#returns-25)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-24)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`quoteTransaction`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#quotetransaction)
***
### quoteTransfer()
[Section titled “quoteTransfer()”](#quotetransfer)
> **quoteTransfer**(`o`): `Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
Defined in: wallet-tron/src/read-only-account.ts:369
Fee of a transfer in sun, including account activation when the recipient is new.
#### Parameters
[Section titled “Parameters”](#parameters-21)
##### o
[Section titled “o”](#o-1)
[`TronTransferOptions`](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
#### Returns
[Section titled “Returns”](#returns-26)
`Promise`<[`TronQuote`](/api/anywalletkit/wallet-tron/interfaces/tronquote/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-8)
`IWalletAccount.quoteTransfer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-25)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`quoteTransfer`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#quotetransfer)
***
### requireClient()
[Section titled “requireClient()”](#requireclient)
> `protected` **requireClient**(`what`): [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
Defined in: wallet-tron/src/read-only-account.ts:119
#### Parameters
[Section titled “Parameters”](#parameters-22)
##### what
[Section titled “what”](#what-2)
`string`
#### Returns
[Section titled “Returns”](#returns-27)
[`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
#### Inherited from
[Section titled “Inherited from”](#inherited-from-26)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`requireClient`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#requireclient)
***
### sendTransaction()
[Section titled “sendTransaction()”](#sendtransaction)
> **sendTransaction**(`tx`, `options?`): `Promise`<[`TronTransferResult`](/api/anywalletkit/wallet-tron/interfaces/trontransferresult/)>
Defined in: wallet-tron/src/account.ts:267
Sign and broadcast.
#### Parameters
[Section titled “Parameters”](#parameters-23)
##### tx
[Section titled “tx”](#tx-10)
`string` | [`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### options?
[Section titled “options?”](#options)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-28)
`Promise`<[`TronTransferResult`](/api/anywalletkit/wallet-tron/interfaces/trontransferresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-9)
`IWalletAccount.sendTransaction`
***
### sign()
[Section titled “sign()”](#sign)
> **sign**(`message`): `Promise`<`string`>
Defined in: wallet-tron/src/account.ts:89
TIP-191 message signature: 0x + r||s||(27 + recovery) hex (tronweb `signMessageV2` encoding).
#### Parameters
[Section titled “Parameters”](#parameters-24)
##### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
#### Returns
[Section titled “Returns”](#returns-29)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-10)
`IWalletAccount.sign`
***
### signRaw()
[Section titled “signRaw()”](#signraw)
> **signRaw**(`tx`, `options?`): `Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
Defined in: wallet-tron/src/account.ts:104
Sign a prebuilt transaction (ours or a dApp’s) and attach `signature: [r||s||recovery]` (recovery as 00/01, tronweb encoding). The signature covers `sha256(raw_data_hex)`, so that is what is checked and signed: `txID` must equal it, the JSON `raw_data` must agree with the bytes field by field, and the hard checks ([assertSafe](/api/anywalletkit/wallet-tron/classes/walletaccounttron/#assertsafe)) run on the bytes. A transaction whose JSON says “1 TRX to me” while the bytes say otherwise is refused (`raw-mismatch`), as is a `txID` that does not belong to the bytes (`txid-mismatch`). `fee_limit` is held to the tighter of `transactionMaxFee` and `options.maxFee` (round 3, M8). Signatures already on the transaction (a multisig co-signer’s) are kept; ours is added once (L11).
#### Parameters
[Section titled “Parameters”](#parameters-25)
##### tx
[Section titled “tx”](#tx-11)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
##### options?
[Section titled “options?”](#options-1)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-30)
`Promise`<[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)>
***
### signTransaction()
[Section titled “signTransaction()”](#signtransaction)
> **signTransaction**(`tx`, `options?`): `Promise`<`string`>
Defined in: wallet-tron/src/account.ts:244
Build (via the node), check, simulate and sign; returns broadcast-ready transaction JSON.
#### Parameters
[Section titled “Parameters”](#parameters-26)
##### tx
[Section titled “tx”](#tx-12)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
##### options?
[Section titled “options?”](#options-2)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-31)
`Promise`<`string`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-11)
`IWalletAccount.signTransaction`
***
### simulateCall()
[Section titled “simulateCall()”](#simulatecall)
> `protected` **simulateCall**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:221
Constant call by selector + params (unbuilt contract call). Never throws on a revert.
#### Parameters
[Section titled “Parameters”](#parameters-27)
##### tx
[Section titled “tx”](#tx-13)
[`TronContractCall`](/api/anywalletkit/wallet-tron/interfaces/troncontractcall/)
#### Returns
[Section titled “Returns”](#returns-32)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-27)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`simulateCall`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#simulatecall)
***
### simulateRaw()
[Section titled “simulateRaw()”](#simulateraw)
> `protected` **simulateRaw**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:260
#### Parameters
[Section titled “Parameters”](#parameters-28)
##### tx
[Section titled “tx”](#tx-14)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
#### Returns
[Section titled “Returns”](#returns-33)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-28)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`simulateRaw`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#simulateraw)
***
### simulateTransaction()
[Section titled “simulateTransaction()”](#simulatetransaction)
> **simulateTransaction**(`tx`): `Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
Defined in: wallet-tron/src/read-only-account.ts:250
Predict the outcome without signing: contract calls run through `/wallet/triggerconstantcontract` (revert reason ABI-decoded); TRX transfers check that the balance covers amount + fees. Transport failures throw, predicted failures don’t.
#### Parameters
[Section titled “Parameters”](#parameters-29)
##### tx
[Section titled “tx”](#tx-15)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
#### Returns
[Section titled “Returns”](#returns-34)
`Promise`<[`TronSimulation`](/api/anywalletkit/wallet-tron/interfaces/tronsimulation/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-29)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`simulateTransaction`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#simulatetransaction)
***
### toReadOnlyAccount()
[Section titled “toReadOnlyAccount()”](#toreadonlyaccount)
> **toReadOnlyAccount**(): `IWalletAccountReadOnly`
Defined in: wallet-tron/src/account.ts:285
The same address as a [WalletAccountReadOnlyTron](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).
#### Returns
[Section titled “Returns”](#returns-35)
`IWalletAccountReadOnly`
#### Implementation of
[Section titled “Implementation of”](#implementation-of-12)
`IWalletAccount.toReadOnlyAccount`
***
### transfer()
[Section titled “transfer()”](#transfer)
> **transfer**(`o`, `writeOptions?`): `Promise`<[`TronTransferResult`](/api/anywalletkit/wallet-tron/interfaces/trontransferresult/)>
Defined in: wallet-tron/src/account.ts:277
TRX (no `token`) or TRC-20 `transfer(address,uint256)`.
#### Parameters
[Section titled “Parameters”](#parameters-30)
##### o
[Section titled “o”](#o-2)
[`TronTransferOptions`](/api/anywalletkit/wallet-tron/interfaces/trontransferoptions/)
##### writeOptions?
[Section titled “writeOptions?”](#writeoptions)
`WriteOptions` = `{}`
#### Returns
[Section titled “Returns”](#returns-36)
`Promise`<[`TronTransferResult`](/api/anywalletkit/wallet-tron/interfaces/trontransferresult/)>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-13)
`IWalletAccount.transfer`
***
### trc20TransferParams()
[Section titled “trc20TransferParams()”](#trc20transferparams)
> `protected` **trc20TransferParams**(`recipient`, `amount`): ({ `type`: `string`; `value`: `string`; } | { `type`: `string`; `value`: `bigint`; })\[]
Defined in: wallet-tron/src/read-only-account.ts:357
#### Parameters
[Section titled “Parameters”](#parameters-31)
##### recipient
[Section titled “recipient”](#recipient)
`string`
##### amount
[Section titled “amount”](#amount)
`string` | `number` | `bigint`
#### Returns
[Section titled “Returns”](#returns-37)
({ `type`: `string`; `value`: `string`; } | { `type`: `string`; `value`: `bigint`; })\[]
#### Inherited from
[Section titled “Inherited from”](#inherited-from-30)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`trc20TransferParams`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#trc20transferparams)
***
### verify()
[Section titled “verify()”](#verify)
> **verify**(`message`, `signature`): `Promise`<`boolean`>
Defined in: wallet-tron/src/read-only-account.ts:393
Verify a TIP-191 signature produced by `sign` (0x + r||s||v, v = 27|28 or 0|1).
#### Parameters
[Section titled “Parameters”](#parameters-32)
##### message
[Section titled “message”](#message-1)
`string` | `Uint8Array`<`ArrayBufferLike`>
##### signature
[Section titled “signature”](#signature)
`string`
#### Returns
[Section titled “Returns”](#returns-38)
`Promise`<`boolean`>
#### Implementation of
[Section titled “Implementation of”](#implementation-of-14)
`IWalletAccount.verify`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-31)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/).[`verify`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/#verify)
***
### fromPrivateKey()
[Section titled “fromPrivateKey()”](#fromprivatekey)
> `static` **fromPrivateKey**(`privateKey`, `publicKey`, `path`, `config?`): `WalletAccountTron`
Defined in: wallet-tron/src/account.ts:68
Wrap a raw derived key (takes ownership; zeroized on dispose). Kept for callers that derive themselves.
#### Parameters
[Section titled “Parameters”](#parameters-33)
##### privateKey
[Section titled “privateKey”](#privatekey)
`Uint8Array`
##### publicKey
[Section titled “publicKey”](#publickey-2)
`Uint8Array`
##### path
[Section titled “path”](#path-3)
`string`
##### config?
[Section titled “config?”](#config-1)
[`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns-39)
`WalletAccountTron`
# WalletManagerTron
Defined in: wallet-tron/src/manager.ts:20
One seed → Tron accounts at m/44’/195’/0’/0/i (BIP-44; TronLink default). Paths may be relative to m/44’/195’ (“0’/0/3”) or full.
Built with a secp256k1 `Signer` instead of a seed, the manager wraps it:
* a derivable `SeedSigner` sitting at `m/44'/195'/0'/0` yields `getAccount(i)` children;
* a `SeedSigner` at a leaf, or any external signer, is `getAccount(0)` (path = the signer’s path, or ‘external’); other indexes/paths throw.
## Extends
[Section titled “Extends”](#extends)
* `WalletManager`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/), [`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)>
## Constructors
[Section titled “Constructors”](#constructors)
### Constructor
[Section titled “Constructor”](#constructor)
> **new WalletManagerTron**(`seedOrSigner`, `config?`): `WalletManagerTron`
Defined in: wallet-tron/src/manager.ts:21
#### Parameters
[Section titled “Parameters”](#parameters)
##### seedOrSigner
[Section titled “seedOrSigner”](#seedorsigner)
`string` | `Uint8Array`<`ArrayBufferLike`> | `Signer`
##### config?
[Section titled “config?”](#config)
[`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/) = `{}`
#### Returns
[Section titled “Returns”](#returns)
`WalletManagerTron`
#### Overrides
[Section titled “Overrides”](#overrides)
`WalletManager.constructor`
## Properties
[Section titled “Properties”](#properties)
### \_accounts
[Section titled “\_accounts”](#_accounts)
> `protected` `readonly` **\_accounts**: `Map`<`string`, [`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
Defined in: core/dist/index.d.ts:271
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`WalletManager._accounts`
***
### \_config
[Section titled “\_config”](#_config)
> `protected` `readonly` **\_config**: [`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)
Defined in: core/dist/index.d.ts:270
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`WalletManager._config`
***
### \_signer
[Section titled “\_signer”](#_signer)
> `protected` `readonly` **\_signer**: `Signer` | `undefined`
Defined in: core/dist/index.d.ts:269
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`WalletManager._signer`
## Methods
[Section titled “Methods”](#methods)
### cachedAccount()
[Section titled “cachedAccount()”](#cachedaccount)
> `protected` **cachedAccount**(`key`, `create`): `Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
Defined in: core/dist/index.d.ts:295
The account cached under `key`, built by `create` at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after `dispose()` is disposed itself and the call throws, so no live signing account outlives the manager.
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### key
[Section titled “key”](#key)
`string`
##### create
[Section titled “create”](#create)
() => [`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/) | `Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`WalletManager.cachedAccount`
***
### dispose()
[Section titled “dispose()”](#dispose)
> **dispose**(): `void`
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
#### Returns
[Section titled “Returns”](#returns-2)
`void`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`WalletManager.dispose`
***
### externalSigner()
[Section titled “externalSigner()”](#externalsigner)
> `protected` **externalSigner**(): `Signer` | `undefined`
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
#### Returns
[Section titled “Returns”](#returns-3)
`Signer` | `undefined`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`WalletManager.externalSigner`
***
### getAccount()
[Section titled “getAccount()”](#getaccount)
> **getAccount**(`index?`): `Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
Defined in: wallet-tron/src/manager.ts:26
Account `index` on the chain’s standard path. Cached per index.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### index?
[Section titled “index?”](#index)
`number` = `0`
#### Returns
[Section titled “Returns”](#returns-4)
`Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`WalletManager.getAccount`
***
### getAccountByPath()
[Section titled “getAccountByPath()”](#getaccountbypath)
> **getAccountByPath**(`path`): `Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
Defined in: wallet-tron/src/manager.ts:30
Account at an explicit path. Cached per path.
#### Parameters
[Section titled “Parameters”](#parameters-3)
##### path
[Section titled “path”](#path)
`string`
#### Returns
[Section titled “Returns”](#returns-5)
`Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
#### Overrides
[Section titled “Overrides”](#overrides-2)
`WalletManager.getAccountByPath`
***
### getFeeRates()
[Section titled “getFeeRates()”](#getfeerates)
> **getFeeRates**(): `Promise`<`FeeRates`>
Defined in: wallet-tron/src/manager.ts:63
getTransactionFee chain parameter; normal = ×1.1, fast = ×2.0; slow = ×1.0.
#### Returns
[Section titled “Returns”](#returns-6)
`Promise`<`FeeRates`>
#### Overrides
[Section titled “Overrides”](#overrides-3)
`WalletManager.getFeeRates`
***
### getReadOnlyAccount()
[Section titled “getReadOnlyAccount()”](#getreadonlyaccount)
> **getReadOnlyAccount**(`address`): [`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/)
Defined in: wallet-tron/src/manager.ts:58
A read-only account for any address, with this manager’s config.
#### Parameters
[Section titled “Parameters”](#parameters-4)
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-7)
[`WalletAccountReadOnlyTron`](/api/anywalletkit/wallet-tron/classes/walletaccountreadonlytron/)
***
### requireSigner()
[Section titled “requireSigner()”](#requiresigner)
> `protected` **requireSigner**(`curve`): `Signer`
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on `curve`; throws when the manager holds a mnemonic instead.
#### Parameters
[Section titled “Parameters”](#parameters-5)
##### curve
[Section titled “curve”](#curve)
`SignerCurve`
#### Returns
[Section titled “Returns”](#returns-8)
`Signer`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`WalletManager.requireSigner`
***
### seedBytes()
[Section titled “seedBytes()”](#seedbytes)
> `protected` **seedBytes**(): `Uint8Array`
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
#### Returns
[Section titled “Returns”](#returns-9)
`Uint8Array`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`WalletManager.seedBytes`
***
### signerAccount()
[Section titled “signerAccount()”](#signeraccount)
> `protected` **signerAccount**(`key`, `signer`, `relativePath`, `build`): `Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
Defined in: core/dist/index.d.ts:300
[cachedAccount](/api/anywalletkit/wallet-tron/classes/walletmanagertron/#cachedaccount) over an injected signer: the signer itself (`relativePath` undefined) or its child along `relativePath`. A child that never becomes an account is disposed.
#### Parameters
[Section titled “Parameters”](#parameters-6)
##### key
[Section titled “key”](#key-1)
`string`
##### signer
[Section titled “signer”](#signer)
`Signer`
##### relativePath
[Section titled “relativePath”](#relativepath)
`string` | `undefined`
##### build
[Section titled “build”](#build)
(`leaf`, `publicKey`) => [`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)
#### Returns
[Section titled “Returns”](#returns-10)
`Promise`<[`WalletAccountTron`](/api/anywalletkit/wallet-tron/classes/walletaccounttron/)>
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`WalletManager.signerAccount`
***
### getRandomSeedPhrase()
[Section titled “getRandomSeedPhrase()”](#getrandomseedphrase)
> `static` **getRandomSeedPhrase**(`words?`): `string`
Defined in: core/dist/index.d.ts:279
Same as the core [getRandomSeedPhrase](/api/anywalletkit/wallet-tron/classes/walletmanagertron/#getrandomseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-7)
##### words?
[Section titled “words?”](#words)
`12` | `24`
#### Returns
[Section titled “Returns”](#returns-11)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`WalletManager.getRandomSeedPhrase`
***
### isValidSeedPhrase()
[Section titled “isValidSeedPhrase()”](#isvalidseedphrase)
> `static` **isValidSeedPhrase**(`seed`): `boolean`
Defined in: core/dist/index.d.ts:277
Same as the core [isValidSeedPhrase](/api/anywalletkit/wallet-tron/classes/walletmanagertron/#isvalidseedphrase).
#### Parameters
[Section titled “Parameters”](#parameters-8)
##### seed
[Section titled “seed”](#seed)
`string`
#### Returns
[Section titled “Returns”](#returns-12)
`boolean`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`WalletManager.isValidSeedPhrase`
# addressFromPublicKey
> **addressFromPublicKey**(`compressed`): `string`
Defined in: wallet-tron/src/address.ts:11
Compressed secp256k1 pubkey → base58 T… address (keccak of X||Y, last 20 bytes, 0x41 prefix, sha256d checksum).
## Parameters
[Section titled “Parameters”](#parameters)
### compressed
[Section titled “compressed”](#compressed)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
`string`
# assertNodeBuild
> **assertNodeBuild**(`tx`, `expected`, `memo?`): `void`
Defined in: wallet-tron/src/build-check.ts:47
Refuse a node-built transaction unless its bytes are exactly one contract of the expected type with the expected owner, recipient / contract, amount / calldata, call value and fee limit — no Permission_id, no TRC-10 token on the call, no second contract, no field the request did not produce. `memo` = the bytes the wallet spliced into `raw_data.data` (none → the field must be absent).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
### expected
[Section titled “expected”](#expected)
[`ExpectedBuild`](/api/anywalletkit/wallet-tron/type-aliases/expectedbuild/)
### memo?
[Section titled “memo?”](#memo)
`Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
`void`
# attachMemo
> **attachMemo**(`tx`, `memo`, `encoding?`): [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
Defined in: wallet-tron/src/memo.ts:105
Splice `memo` into a node-built transaction: canonical-position `raw_data` field 10, fresh `txID` = sha256(raw_data), and `raw_data.data` (hex) for the JSON broadcast. A transaction that already carries a memo is refused (the node’s own `data` would have to be re-signed anyway and we cannot know which the caller meant).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
### memo
[Section titled “memo”](#memo)
`string`
### encoding?
[Section titled “encoding?”](#encoding)
[`MemoEncoding`](/api/anywalletkit/wallet-tron/type-aliases/memoencoding/) = `'utf8'`
## Returns
[Section titled “Returns”](#returns)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
# bandwidthPoints
> **bandwidthPoints**(`rawDataHex`, `signatures?`): `number`
Defined in: wallet-tron/src/read-only-account.ts:42
Bandwidth points a transaction consumes: its serialized size with signatures plus the 64-byte result reserve.
## Parameters
[Section titled “Parameters”](#parameters)
### rawDataHex
[Section titled “rawDataHex”](#rawdatahex)
`string`
### signatures?
[Section titled “signatures?”](#signatures)
`number` = `1`
## Returns
[Section titled “Returns”](#returns)
`number`
# createClient
> **createClient**(`config`): [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/) | `undefined`
Defined in: wallet-tron/src/client.ts:44
One transport, or a failover transport over the list. Any failure without a node’s answer (a timeout, a dropped connection, an HTTP error) moves on to the next provider. That holds for a broadcast too: it re-sends the SAME signed bytes (one `txID`, accepted by the chain once), and the account reads a duplicate answer as accepted.
## Parameters
[Section titled “Parameters”](#parameters)
### config
[Section titled “config”](#config)
[`TronConfig`](/api/anywalletkit/wallet-tron/interfaces/tronconfig/)
## Returns
[Section titled “Returns”](#returns)
[`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/) | `undefined`
# createTronHistory
> **createTronHistory**(`options?`): [`TronHistorySource`](/api/anywalletkit/wallet-tron/interfaces/tronhistorysource/)
Defined in: wallet-tron/src/history.ts:391
A history source for Tron addresses backed by TronGrid or a compatible API.
## Parameters
[Section titled “Parameters”](#parameters)
### options?
[Section titled “options?”](#options)
[`TronHistoryOptions`](/api/anywalletkit/wallet-tron/interfaces/tronhistoryoptions/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`TronHistorySource`](/api/anywalletkit/wallet-tron/interfaces/tronhistorysource/)
# decodeAddressWord
> **decodeAddressWord**(`word`): `string`
Defined in: wallet-tron/src/abi.ts:87
32-byte ABI word → 21-byte Tron hex address (“41” + last 20 bytes).
## Parameters
[Section titled “Parameters”](#parameters)
### word
[Section titled “word”](#word)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# decodeHistoryCursor
> **decodeHistoryCursor**(`s`): [`TronHistoryCursor`](/api/anywalletkit/wallet-tron/interfaces/tronhistorycursor/)
Defined in: wallet-tron/src/history.ts:150
## Parameters
[Section titled “Parameters”](#parameters)
### s
[Section titled “s”](#s)
`string`
## Returns
[Section titled “Returns”](#returns)
[`TronHistoryCursor`](/api/anywalletkit/wallet-tron/interfaces/tronhistorycursor/)
# decodeRawData
> **decodeRawData**(`raw`): [`TronDecodedRaw`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/)
Defined in: wallet-tron/src/raw\.ts:284
Decode `Transaction.raw` bytes (or hex). Throws a plain `Error` on malformed input; callers wrap it.
## Parameters
[Section titled “Parameters”](#parameters)
### raw
[Section titled “raw”](#raw)
`string` | `Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
[`TronDecodedRaw`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/)
# decodeRevertReason
> **decodeRevertReason**(`hex`): `string` | `undefined`
Defined in: wallet-tron/src/abi.ts:101
ABI-decode `Error(string)` / `Panic(uint256)` revert data; falls back to the hex itself.
## Parameters
[Section titled “Parameters”](#parameters)
### hex
[Section titled “hex”](#hex)
`string` | `undefined`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# decodeUint
> **decodeUint**(`hex`): `bigint`
Defined in: wallet-tron/src/abi.ts:81
A hex word as a bigint (empty hex is 0).
## Parameters
[Section titled “Parameters”](#parameters)
### hex
[Section titled “hex”](#hex)
`string`
## Returns
[Section titled “Returns”](#returns)
`bigint`
# describeTransaction
> **describeTransaction**(`tx`, `ctx?`): [`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)
Defined in: wallet-tron/src/describe.ts:170
What a transaction does — decoded offline, no network. Works on the three input shapes (`{to, value}`, contract call, node-built raw transaction). Only the `unactivated-recipient` warning needs the chain; pass `ctx.recipientExists` or use `describeTransactionOnline`.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TronTransaction`](/api/anywalletkit/wallet-tron/type-aliases/trontransaction/)
### ctx?
[Section titled “ctx?”](#ctx)
[`DescribeContext`](/api/anywalletkit/wallet-tron/interfaces/describecontext/) = `{}`
## Returns
[Section titled “Returns”](#returns)
[`TronTxDescription`](/api/anywalletkit/wallet-tron/interfaces/trontxdescription/)
# encodeCall
> **encodeCall**(`functionSelector`, `params`): `string`
Defined in: wallet-tron/src/abi.ts:69
Calldata words for `functionSelector` (“name(type,…)”, no spaces): the parameters must match the signature in count and type, so the contract decodes exactly the arguments the caller named.
## Parameters
[Section titled “Parameters”](#parameters)
### functionSelector
[Section titled “functionSelector”](#functionselector)
`string`
### params
[Section titled “params”](#params)
`object`\[]
## Returns
[Section titled “Returns”](#returns)
`string`
# encodeHistoryCursor
> **encodeHistoryCursor**(`c`): `string`
Defined in: wallet-tron/src/history.ts:146
## Parameters
[Section titled “Parameters”](#parameters)
### c
[Section titled “c”](#c)
[`TronHistoryCursor`](/api/anywalletkit/wallet-tron/interfaces/tronhistorycursor/)
## Returns
[Section titled “Returns”](#returns)
`string`
# encodeMemoRecord
> **encodeMemoRecord**(`memo`, `encoding?`): `Uint8Array`
Defined in: wallet-tron/src/memo.ts:92
The wire bytes of a memo record: tag (field 10, length-delimited = 0x52) ‖ varint(len) ‖ the memo bytes.
## Parameters
[Section titled “Parameters”](#parameters)
### memo
[Section titled “memo”](#memo)
`string`
### encoding?
[Section titled “encoding?”](#encoding)
[`MemoEncoding`](/api/anywalletkit/wallet-tron/type-aliases/memoencoding/) = `'utf8'`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# encodeParameters
> **encodeParameters**(`params`): `string`
Defined in: wallet-tron/src/abi.ts:37
Minimal static ABI encoder: address, uintN/intN, bool, bytes32. Enough for TRC-20 calls. Every argument encodes to exactly one 32-byte word: a bytes32 longer than 32 bytes or a uint past its width would spill into the next words and shift every argument after it (scan 2026-10-27 F14, F15).
## Parameters
[Section titled “Parameters”](#parameters)
### params
[Section titled “params”](#params)
`object`\[]
## Returns
[Section titled “Returns”](#returns)
`string`
# encodeRawData
> **encodeRawData**(`raw`): `Uint8Array`
Defined in: wallet-tron/src/raw\.ts:338
Serialize a `raw_data` object the way java-tron does (fields in number order, proto3 defaults omitted). Round-trips with [decodeRawData](/api/anywalletkit/wallet-tron/functions/decoderawdata/); `sha256` of the result is the txID.
## Parameters
[Section titled “Parameters”](#parameters)
### raw
[Section titled “raw”](#raw)
`object` & `object`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# hashMessage
> **hashMessage**(`message`): `Uint8Array`
Defined in: wallet-tron/src/read-only-account.ts:66
keccak256(“\x19TRON Signed Message:\n” + byteLength + message) — TIP-191 (tronweb `signMessageV2`).
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
# hexToText
> **hexToText**(`hex`): `string`
Defined in: wallet-tron/src/abi.ts:119
Hex → UTF-8 text when it decodes cleanly, else the hex.
## Parameters
[Section titled “Parameters”](#parameters)
### hex
[Section titled “hex”](#hex)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# isContractCall
> **isContractCall**(`tx`): `tx is TronContractCall`
Defined in: wallet-tron/src/shape.ts:6
Type guard: a contract call (`functionSelector`).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`tx is TronContractCall`
# isDecodedContractType
> **isDecodedContractType**(`type`): `boolean`
Defined in: wallet-tron/src/raw\.ts:276
Whether the wallet decodes this contract type field by field (otherwise only its owner and raw bytes are known).
## Parameters
[Section titled “Parameters”](#parameters)
### type
[Section titled “type”](#type)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isHexAddress
> **isHexAddress**(`a`): `boolean`
Defined in: wallet-tron/src/address.ts:21
True for a hex Tron address (`41` plus 20 bytes, optional `0x`).
## Parameters
[Section titled “Parameters”](#parameters)
### a
[Section titled “a”](#a)
`string`
## Returns
[Section titled “Returns”](#returns)
`boolean`
# isPrebuilt
> **isPrebuilt**(`tx`): `tx is TronRawTransaction`
Defined in: wallet-tron/src/shape.ts:4
Type guard: a transaction prebuilt by a node or provider (has `txID`).
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`tx is TronRawTransaction`
# mapHistoryTransactionRow
> **mapHistoryTransactionRow**(`chain`, `address`, `tx`, `extra?`): [`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)
Defined in: wallet-tron/src/history.ts:271
Decode what a TronGrid / full-node transaction row says on its own (no TRC-20 list rows yet).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### tx
[Section titled “tx”](#tx)
[`TronGridTx`](/api/anywalletkit/wallet-tron/interfaces/trongridtx/)
### extra?
[Section titled “extra?”](#extra)
#### info?
[Section titled “info?”](#info)
[`FullNodeTxInfo`](/api/anywalletkit/wallet-tron/interfaces/fullnodetxinfo/)
#### trc20?
[Section titled “trc20?”](#trc20)
[`TronGridTrc20`](/api/anywalletkit/wallet-tron/interfaces/trongridtrc20/)\[]
## Returns
[Section titled “Returns”](#returns)
[`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)
# mapHistoryTrc20Only
> **mapHistoryTrc20Only**(`chain`, `address`, `rows`): [`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)
Defined in: wallet-tron/src/history.ts:366
A transaction seen only through the TRC-20 list (someone else’s call that moved tokens to / from the address).
## Parameters
[Section titled “Parameters”](#parameters)
### chain
[Section titled “chain”](#chain)
`string`
### address
[Section titled “address”](#address)
`string`
### rows
[Section titled “rows”](#rows)
[`TronGridTrc20`](/api/anywalletkit/wallet-tron/interfaces/trongridtrc20/)\[]
## Returns
[Section titled “Returns”](#returns)
[`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)
# memoBytes
> **memoBytes**(`memo`, `encoding?`): `Uint8Array`
Defined in: wallet-tron/src/memo.ts:84
Bytes of a memo, from UTF-8 text or `0x` hex.
## Parameters
[Section titled “Parameters”](#parameters)
### memo
[Section titled “memo”](#memo)
`string`
### encoding?
[Section titled “encoding?”](#encoding)
[`MemoEncoding`](/api/anywalletkit/wallet-tron/type-aliases/memoencoding/) = `'utf8'`
## Returns
[Section titled “Returns”](#returns)
`Uint8Array`
## Throws
[Section titled “Throws”](#throws)
`UnsafeTransactionError` `memo` for invalid hex.
# rawMismatch
> **rawMismatch**(`json`, `decoded`): `string` | `null`
Defined in: wallet-tron/src/raw\.ts:390
First material difference between the dApp’s JSON `raw_data` and what the bytes say, or `null`.
## Parameters
[Section titled “Parameters”](#parameters)
### json
[Section titled “json”](#json)
{ `contract`: `object`\[]; `data?`: `string`; `expiration?`: `number`; `fee_limit?`: `number`; `ref_block_bytes?`: `string`; `ref_block_hash?`: `string`; `timestamp?`: `number`; } | `undefined`
#### Type Literal
[Section titled “Type Literal”](#type-literal)
{ `contract`: `object`\[]; `data?`: `string`; `expiration?`: `number`; `fee_limit?`: `number`; `ref_block_bytes?`: `string`; `ref_block_hash?`: `string`; `timestamp?`: `number`; }
##### contract
[Section titled “contract”](#contract)
`object`\[]
##### data?
[Section titled “data?”](#data)
`string`
Memo, hex-encoded. Charged `getMemoFee` when present.
##### expiration?
[Section titled “expiration?”](#expiration)
`number`
##### fee_limit?
[Section titled “fee_limit?”](#fee_limit)
`number`
##### ref_block_bytes?
[Section titled “ref_block_bytes?”](#ref_block_bytes)
`string`
##### ref_block_hash?
[Section titled “ref_block_hash?”](#ref_block_hash)
`string`
##### timestamp?
[Section titled “timestamp?”](#timestamp)
`number`
***
`undefined`
### decoded
[Section titled “decoded”](#decoded)
`Omit`<{ `contract`: `object`\[]; `data?`: `string`; `expiration?`: `number`; `fee_limit?`: `number`; `ref_block_bytes?`: `string`; `ref_block_hash?`: `string`; `timestamp?`: `number`; }, `"contract"`> & `object`
## Returns
[Section titled “Returns”](#returns)
`string` | `null`
# readFields
> **readFields**(`bytes`): [`Field`](/api/anywalletkit/wallet-tron/interfaces/field/)\[]
Defined in: wallet-tron/src/raw\.ts:67
Every top-level field of a protobuf message, in wire order. Throws on malformed or non-canonical input.
## Parameters
[Section titled “Parameters”](#parameters)
### bytes
[Section titled “bytes”](#bytes)
`Uint8Array`
## Returns
[Section titled “Returns”](#returns)
[`Field`](/api/anywalletkit/wallet-tron/interfaces/field/)\[]
# recoverMessageAddress
> **recoverMessageAddress**(`message`, `signature`): `string` | `undefined`
Defined in: wallet-tron/src/read-only-account.ts:76
Address that produced a TIP-191 signature (`0x` + r||s||v, v = 27|28 or 0|1), or undefined.
## Parameters
[Section titled “Parameters”](#parameters)
### message
[Section titled “message”](#message)
`string` | `Uint8Array`<`ArrayBufferLike`>
### signature
[Section titled “signature”](#signature)
`string`
## Returns
[Section titled “Returns”](#returns)
`string` | `undefined`
# selector
> **selector**(`signature`): `string`
Defined in: wallet-tron/src/abi.ts:6
4-byte selector of “name(type,…)”.
## Parameters
[Section titled “Parameters”](#parameters)
### signature
[Section titled “signature”](#signature)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# splitCalldata
> **splitCalldata**(`data`): `object`
Defined in: wallet-tron/src/abi.ts:92
Split calldata hex into selector + 32-byte words (partial trailing word dropped).
## Parameters
[Section titled “Parameters”](#parameters)
### data
[Section titled “data”](#data)
`string`
## Returns
[Section titled “Returns”](#returns)
`object`
### selector
[Section titled “selector”](#selector)
> **selector**: `string`
### words
[Section titled “words”](#words)
> **words**: `string`\[]
# toBase58Address
> **toBase58Address**(`address`): `string`
Defined in: wallet-tron/src/address.ts:34
Any accepted form → base58 T…
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# toHexAddress
> **toHexAddress**(`address`): `string`
Defined in: wallet-tron/src/address.ts:26
Any accepted form → 21-byte hex “41…” (lowercase, no 0x).
## Parameters
[Section titled “Parameters”](#parameters)
### address
[Section titled “address”](#address)
`string`
## Returns
[Section titled “Returns”](#returns)
`string`
# tronExplorerTxUrl
> **tronExplorerTxUrl**(`hash`, `network?`): `string`
Defined in: wallet-tron/src/history.ts:385
Tronscan link for a transaction.
## Parameters
[Section titled “Parameters”](#parameters)
### hash
[Section titled “hash”](#hash)
`string`
### network?
[Section titled “network?”](#network)
[`TronNetwork`](/api/anywalletkit/wallet-tron/type-aliases/tronnetwork/) = `'mainnet'`
## Returns
[Section titled “Returns”](#returns)
`string`
# verifyRawTransaction
> **verifyRawTransaction**(`tx`): [`VerifiedRaw`](/api/anywalletkit/wallet-tron/interfaces/verifiedraw/)
Defined in: wallet-tron/src/raw\.ts:425
Everything that must hold before a prebuilt transaction is signed or shown: `raw_data_hex` present and well-formed, `txID == sha256(raw_data_hex)`, and the JSON copy (when there is one) agreeing with the bytes field by field. Returns the decoded bytes; the description and the hard checks run on that, never on the JSON.
## Parameters
[Section titled “Parameters”](#parameters)
### tx
[Section titled “tx”](#tx)
[`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
## Returns
[Section titled “Returns”](#returns)
[`VerifiedRaw`](/api/anywalletkit/wallet-tron/interfaces/verifiedraw/)
# ConstantCallResponse
Defined in: wallet-tron/src/read-only-account.ts:57
## Properties
[Section titled “Properties”](#properties)
### constant_result?
[Section titled “constant_result?”](#constant_result)
> `optional` **constant_result?**: `string`\[]
Defined in: wallet-tron/src/read-only-account.ts:59
***
### energy_used?
[Section titled “energy_used?”](#energy_used)
> `optional` **energy_used?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:60
***
### Error?
[Section titled “Error?”](#error)
> `optional` **Error?**: `string`
Defined in: wallet-tron/src/read-only-account.ts:58
***
### result?
[Section titled “result?”](#result)
> `optional` **result?**: `object`
Defined in: wallet-tron/src/read-only-account.ts:62
#### code?
[Section titled “code?”](#code)
> `optional` **code?**: `string`
#### message?
[Section titled “message?”](#message)
> `optional` **message?**: `string`
#### result?
[Section titled “result?”](#result-1)
> `optional` **result?**: `boolean`
***
### transaction?
[Section titled “transaction?”](#transaction)
> `optional` **transaction?**: [`TronRawTransaction`](/api/anywalletkit/wallet-tron/interfaces/tronrawtransaction/)
Defined in: wallet-tron/src/read-only-account.ts:61
# Contract
Defined in: wallet-tron/src/history.ts:232
## Properties
[Section titled “Properties”](#properties)
### parameter
[Section titled “parameter”](#parameter)
> **parameter**: `object`
Defined in: wallet-tron/src/history.ts:234
#### value
[Section titled “value”](#value)
> **value**: `Record`<`string`, `unknown`>
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: wallet-tron/src/history.ts:233
# DescribeContext
Defined in: wallet-tron/src/describe.ts:21
What an offline description can be told to sharpen its warnings.
## Properties
[Section titled “Properties”](#properties)
### now?
[Section titled “now?”](#now)
> `optional` **now?**: `number`
Defined in: wallet-tron/src/describe.ts:28
Unix ms “now” for the expiry warning (default Date.now()).
***
### recipientExists?
[Section titled “recipientExists?”](#recipientexists)
> `optional` **recipientExists?**: `boolean`
Defined in: wallet-tron/src/describe.ts:26
Whether the recipient account already exists on chain. Offline callers do not know; `WalletAccountReadOnlyTron.describeTransactionOnline` fills it from `/wallet/getaccount`.
# Field
Defined in: wallet-tron/src/raw\.ts:27
## Properties
[Section titled “Properties”](#properties)
### number
[Section titled “number”](#number)
> **number**: `number`
Defined in: wallet-tron/src/raw\.ts:27
***
### value
[Section titled “value”](#value)
> **value**: `bigint` | `Uint8Array`<`ArrayBufferLike`>
Defined in: wallet-tron/src/raw\.ts:27
***
### wire
[Section titled “wire”](#wire)
> **wire**: `number`
Defined in: wallet-tron/src/raw\.ts:27
# FullNodeTxInfo
Defined in: wallet-tron/src/history.ts:255
## Properties
[Section titled “Properties”](#properties)
### blockNumber?
[Section titled “blockNumber?”](#blocknumber)
> `optional` **blockNumber?**: `number`
Defined in: wallet-tron/src/history.ts:258
***
### blockTimeStamp?
[Section titled “blockTimeStamp?”](#blocktimestamp)
> `optional` **blockTimeStamp?**: `number`
Defined in: wallet-tron/src/history.ts:259
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `number`
Defined in: wallet-tron/src/history.ts:257
***
### id?
[Section titled “id?”](#id)
> `optional` **id?**: `string`
Defined in: wallet-tron/src/history.ts:256
***
### log?
[Section titled “log?”](#log)
> `optional` **log?**: `object`\[]
Defined in: wallet-tron/src/history.ts:261
#### address
[Section titled “address”](#address)
> **address**: `string`
#### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
#### topics
[Section titled “topics”](#topics)
> **topics**: `string`\[]
***
### receipt?
[Section titled “receipt?”](#receipt)
> `optional` **receipt?**: `object`
Defined in: wallet-tron/src/history.ts:260
#### energy_fee?
[Section titled “energy_fee?”](#energy_fee)
> `optional` **energy_fee?**: `number`
#### net_fee?
[Section titled “net_fee?”](#net_fee)
> `optional` **net_fee?**: `number`
#### result?
[Section titled “result?”](#result)
> `optional` **result?**: `string`
# Resources
Defined in: wallet-tron/src/read-only-account.ts:55
## Properties
[Section titled “Properties”](#properties)
### EnergyLimit?
[Section titled “EnergyLimit?”](#energylimit)
> `optional` **EnergyLimit?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
***
### EnergyUsed?
[Section titled “EnergyUsed?”](#energyused)
> `optional` **EnergyUsed?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
***
### freeNetLimit?
[Section titled “freeNetLimit?”](#freenetlimit)
> `optional` **freeNetLimit?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
***
### freeNetUsed?
[Section titled “freeNetUsed?”](#freenetused)
> `optional` **freeNetUsed?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
***
### NetLimit?
[Section titled “NetLimit?”](#netlimit)
> `optional` **NetLimit?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
***
### NetUsed?
[Section titled “NetUsed?”](#netused)
> `optional` **NetUsed?**: `number`
Defined in: wallet-tron/src/read-only-account.ts:55
# TronChainTx
Defined in: wallet-tron/src/history.ts:57
## Extends
[Section titled “Extends”](#extends)
* `ChainTx`
## Properties
[Section titled “Properties”](#properties)
### address
[Section titled “address”](#address)
> **address**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:194
The address this history was fetched for (the wallet’s own).
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`ChainTx.address`
***
### block?
[Section titled “block?”](#block)
> `optional` **block?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:208
Block number / slot / lt, for ordering and cursors.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`ChainTx.block`
***
### call?
[Section titled “call?”](#call)
> `optional` **call?**: `ChainCall`
Defined in: core/dist/index-QWdcwE6y.d.ts:206
The invoked contract / program, when it is not a plain transfer.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-2)
`ChainTx.call`
***
### chain
[Section titled “chain”](#chain)
> **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:186
CAIP-2 chain id.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-3)
`ChainTx.chain`
***
### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:204
Network fee paid by `from`, in native base units; undefined when unknown.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-4)
`ChainTx.fee`
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:196
Sender (the fee payer).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-5)
`ChainTx.from`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:188
Transaction hash.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-6)
`ChainTx.hash`
***
### nativeValue
[Section titled “nativeValue”](#nativevalue)
> **nativeValue**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:200
Native value moved by the top-level transaction, base units (0 for pure token / contract calls).
#### Inherited from
[Section titled “Inherited from”](#inherited-from-7)
`ChainTx.nativeValue`
***
### raw
[Section titled “raw”](#raw)
> **raw**: [`TronHistoryRaw`](/api/anywalletkit/wallet-tron/interfaces/tronhistoryraw/)
Defined in: wallet-tron/src/history.ts:58
Chain-specific extras the source wants to keep (parsed TON actions, Solana logs…). Opaque to the kit.
#### Overrides
[Section titled “Overrides”](#overrides)
`ChainTx.raw`
***
### status
[Section titled “status”](#status)
> **status**: `ChainTxStatus`
Defined in: core/dist/index-QWdcwE6y.d.ts:192
Whether it succeeded.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-8)
`ChainTx.status`
***
### time
[Section titled “time”](#time)
> **time**: `number`
Defined in: core/dist/index-QWdcwE6y.d.ts:190
Unix seconds.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-9)
`ChainTx.time`
***
### to
[Section titled “to”](#to)
> **to**: `string` | `null`
Defined in: core/dist/index-QWdcwE6y.d.ts:198
Primary destination: recipient of a transfer or the called contract. Null for contract creation / multi-destination.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-10)
`ChainTx.to`
***
### transfers
[Section titled “transfers”](#transfers)
> **transfers**: `ChainTransfer`\[]
Defined in: core/dist/index-QWdcwE6y.d.ts:202
Every native + token movement the chain reports for this tx, including internal ones, from the explorer / parsed instructions.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-11)
`ChainTx.transfers`
# TronConfig
Defined in: wallet-tron/src/types.ts:11
Options for a Tron wallet manager or account: full-node endpoints, network, fee limits and the pre-sign checks.
## Properties
[Section titled “Properties”](#properties)
### allowBurn?
[Section titled “allowBurn?”](#allowburn)
> `optional` **allowBurn?**: `boolean`
Defined in: wallet-tron/src/types.ts:29
Allow TRX / TRC-20 transfers to the zero address (default false — refused as a burn).
***
### allowOfflineTestnetSigning?
[Section titled “allowOfflineTestnetSigning?”](#allowofflinetestnetsigning)
> `optional` **allowOfflineTestnetSigning?**: `boolean`
Defined in: wallet-tron/src/types.ts:47
Sign for a non-mainnet network without a provider (default false — refused). A Tron transaction is bound to its network only by its reference block, and the key is the same on every network: offline, the wallet cannot tell a mainnet reference block from a testnet one, so a “testnet” signature could move mainnet funds.
***
### allowPermissionChanges?
[Section titled “allowPermissionChanges?”](#allowpermissionchanges)
> `optional` **allowPermissionChanges?**: `boolean`
Defined in: wallet-tron/src/types.ts:34
Sign an `AccountPermissionUpdateContract` (default false — refused): it changes which keys control the account, so one signature can hand the account to someone else.
***
### allowUndecodedContracts?
[Section titled “allowUndecodedContracts?”](#allowundecodedcontracts)
> `optional` **allowUndecodedContracts?**: `boolean`
Defined in: wallet-tron/src/types.ts:40
Sign contract types the wallet has no decoder for (default false — refused, except `VoteWitnessContract`): nothing can be shown about them, and some move TRX or tokens (ParticipateAssetIssue, Exchange\*, MarketSellAsset, CreateSmartContract with a call value).
***
### headers?
[Section titled “headers?”](#headers)
> `optional` **headers?**: `Record`<`string`, `string`>
Defined in: wallet-tron/src/types.ts:17
Optional headers for every request (e.g. `TRON-PRO-API-KEY`).
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: `string`
Defined in: wallet-tron/src/types.ts:25
CAIP-2 suffix; default mainnet genesis “0x2b6653dc”.
***
### provider?
[Section titled “provider?”](#provider)
> `optional` **provider?**: [`TronProvider`](/api/anywalletkit/wallet-tron/type-aliases/tronprovider/) | [`TronProvider`](/api/anywalletkit/wallet-tron/type-aliases/tronprovider/)\[]
Defined in: wallet-tron/src/types.ts:13
Full-node url(s) / transport(s). A list fails over in order. Omit for an offline (sign-only) wallet.
***
### retries?
[Section titled “retries?”](#retries)
> `optional` **retries?**: `number`
Defined in: wallet-tron/src/types.ts:15
Extra attempts across the provider list after the first failure (default 3).
***
### simulate?
[Section titled “simulate?”](#simulate)
> `optional` **simulate?**: `boolean`
Defined in: wallet-tron/src/types.ts:27
Run `simulateTransaction` before signing in `sendTransaction` / `transfer` (default true).
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-tron/src/types.ts:19
Per-request timeout for url providers, in ms (default 15 000): a node that never answers fails over.
***
### transactionMaxFee?
[Section titled “transactionMaxFee?”](#transactionmaxfee)
> `optional` **transactionMaxFee?**: `number` | `bigint`
Defined in: wallet-tron/src/types.ts:23
Max fee (sun) for `sendTransaction` / `signTransaction`.
***
### transferMaxFee?
[Section titled “transferMaxFee?”](#transfermaxfee)
> `optional` **transferMaxFee?**: `number` | `bigint`
Defined in: wallet-tron/src/types.ts:21
Max fee (sun) for `transfer`.
# TronContractCall
Defined in: wallet-tron/src/types.ts:54
Smart-contract call.
## Properties
[Section titled “Properties”](#properties)
### contractAddress
[Section titled “contractAddress”](#contractaddress)
> **contractAddress**: `string`
Defined in: wallet-tron/src/types.ts:55
***
### functionSelector
[Section titled “functionSelector”](#functionselector)
> **functionSelector**: `string`
Defined in: wallet-tron/src/types.ts:57
e.g. “transfer(address,uint256)”
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-tron/src/types.ts:61
Attached as `raw_data.data` (e.g. a THORChain swap memo on a TRC-20 transfer).
***
### memoEncoding?
[Section titled “memoEncoding?”](#memoencoding)
> `optional` **memoEncoding?**: `"utf8"` | `"hex"`
Defined in: wallet-tron/src/types.ts:63
‘hex’ = binary memo given as 0x-hex, e.g. a Chainflip vault-swap note (default ‘utf8’).
***
### options?
[Section titled “options?”](#options)
> `optional` **options?**: `object`
Defined in: wallet-tron/src/types.ts:59
#### callValue?
[Section titled “callValue?”](#callvalue)
> `optional` **callValue?**: `number`
#### feeLimit?
[Section titled “feeLimit?”](#feelimit)
> `optional` **feeLimit?**: `number`
***
### parameters?
[Section titled “parameters?”](#parameters)
> `optional` **parameters?**: `object`\[]
Defined in: wallet-tron/src/types.ts:58
#### type
[Section titled “type”](#type)
> **type**: `string`
#### value
[Section titled “value”](#value)
> **value**: `unknown`
# TronDecodedContract
Defined in: wallet-tron/src/raw\.ts:172
One decoded `Transaction.Contract`. `value` has the node’s JSON keys (hex addresses, hex bytes, numbers as JSON numbers or decimal strings).
## Properties
[Section titled “Properties”](#properties)
### parameter
[Section titled “parameter”](#parameter)
> **parameter**: `object`
Defined in: wallet-tron/src/raw\.ts:174
#### type_url
[Section titled “type_url”](#type_url)
> **type_url**: `string`
#### value
[Section titled “value”](#value)
> **value**: `Record`<`string`, `unknown`>
***
### Permission_id?
[Section titled “Permission_id?”](#permission_id)
> `optional` **Permission_id?**: `number`
Defined in: wallet-tron/src/raw\.ts:175
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: wallet-tron/src/raw\.ts:173
***
### undecoded
[Section titled “undecoded”](#undecoded)
> **undecoded**: `number`\[]
Defined in: wallet-tron/src/raw\.ts:177
Field numbers inside the parameter the wallet has no schema for (or the whole parameter when the type is unknown).
# TronDecodedRaw
Defined in: wallet-tron/src/raw\.ts:181
A transaction’s `raw_data`, decoded from its protobuf bytes.
## Extended by
[Section titled “Extended by”](#extended-by)
* [`VerifiedRaw`](/api/anywalletkit/wallet-tron/interfaces/verifiedraw/)
## Properties
[Section titled “Properties”](#properties)
### raw_data
[Section titled “raw_data”](#raw_data)
> **raw_data**: `Omit`<{ `contract`: `object`\[]; `data?`: `string`; `expiration?`: `number`; `fee_limit?`: `number`; `ref_block_bytes?`: `string`; `ref_block_hash?`: `string`; `timestamp?`: `number`; }, `"contract"`> & `object`
Defined in: wallet-tron/src/raw\.ts:182
#### Type Declaration
[Section titled “Type Declaration”](#type-declaration)
##### contract
[Section titled “contract”](#contract)
> **contract**: [`TronDecodedContract`](/api/anywalletkit/wallet-tron/interfaces/trondecodedcontract/)\[]
##### ref_block_num?
[Section titled “ref_block_num?”](#ref_block_num)
> `optional` **ref_block_num?**: `number`
***
### unknownFields
[Section titled “unknownFields”](#unknownfields)
> **unknownFields**: `number`\[]
Defined in: wallet-tron/src/raw\.ts:184
Top-level `Transaction.raw` field numbers this codec does not know.
# TronFeeBreakdown
Defined in: wallet-tron/src/types.ts:106
What a transaction will cost, resource by resource. All sun values are what the SENDER burns.
## Properties
[Section titled “Properties”](#properties)
### accountCreationFee
[Section titled “accountCreationFee”](#accountcreationfee)
> **accountCreationFee**: `bigint`
Defined in: wallet-tron/src/types.ts:123
sun burned to create the recipient account: `getCreateNewAccountFeeInSystemContract` (1 TRX) plus `getCreateAccountFee` (0.1 TRX) when staked bandwidth cannot cover the creation; 0 when it exists.
***
### bandwidthBurn
[Section titled “bandwidthBurn”](#bandwidthburn)
> **bandwidthBurn**: `bigint`
Defined in: wallet-tron/src/types.ts:125
sun burned for bandwidth not covered by staked/free allowance.
***
### bandwidthFree
[Section titled “bandwidthFree”](#bandwidthfree)
> **bandwidthFree**: `number`
Defined in: wallet-tron/src/types.ts:108
Free bandwidth points left on the account (`freeNetLimit − freeNetUsed`).
***
### bandwidthPrice
[Section titled “bandwidthPrice”](#bandwidthprice)
> **bandwidthPrice**: `bigint`
Defined in: wallet-tron/src/types.ts:116
sun per bandwidth byte (`getTransactionFee`).
***
### bandwidthStaked
[Section titled “bandwidthStaked”](#bandwidthstaked)
> **bandwidthStaked**: `number`
Defined in: wallet-tron/src/types.ts:110
Staked bandwidth points left (`NetLimit − NetUsed`).
***
### energyBurn
[Section titled “energyBurn”](#energyburn)
> **energyBurn**: `bigint`
Defined in: wallet-tron/src/types.ts:127
sun burned for energy not covered by staked energy.
***
### energyPrice
[Section titled “energyPrice”](#energyprice)
> **energyPrice**: `bigint`
Defined in: wallet-tron/src/types.ts:114
sun per energy unit (`getEnergyFee`).
***
### energyStaked
[Section titled “energyStaked”](#energystaked)
> **energyStaked**: `number`
Defined in: wallet-tron/src/types.ts:112
Staked energy left (`EnergyLimit − EnergyUsed`).
***
### memoFee
[Section titled “memoFee”](#memofee)
> **memoFee**: `bigint`
Defined in: wallet-tron/src/types.ts:118
sun burned for a memo (`getMemoFee`), 0 without one.
# TronFeeEstimate
Defined in: wallet-tron/src/types.ts:134
Resources a transaction consumes and the TRX burned for what the account’s free bandwidth and staked energy do not cover.
## Properties
[Section titled “Properties”](#properties)
### bandwidth
[Section titled “bandwidth”](#bandwidth)
> **bandwidth**: `number`
Defined in: wallet-tron/src/types.ts:136
Bandwidth points the transaction consumes (serialized size + signature + 64-byte result reserve).
***
### breakdown
[Section titled “breakdown”](#breakdown)
> **breakdown**: [`TronFeeBreakdown`](/api/anywalletkit/wallet-tron/interfaces/tronfeebreakdown/)
Defined in: wallet-tron/src/types.ts:141
***
### energy
[Section titled “energy”](#energy)
> **energy**: `number`
Defined in: wallet-tron/src/types.ts:138
Energy the call consumes (`energy_used` from a constant call); 0 for non-contract transactions.
***
### trxBurn
[Section titled “trxBurn”](#trxburn)
> **trxBurn**: `bigint`
Defined in: wallet-tron/src/types.ts:140
Total sun the sender pays on top of the amount.
# TronGridTrc20
Defined in: wallet-tron/src/history.ts:246
## Properties
[Section titled “Properties”](#properties)
### block_timestamp
[Section titled “block_timestamp”](#block_timestamp)
> **block_timestamp**: `number`
Defined in: wallet-tron/src/history.ts:249
***
### from
[Section titled “from”](#from)
> **from**: `string`
Defined in: wallet-tron/src/history.ts:250
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-tron/src/history.ts:251
***
### token_info
[Section titled “token_info”](#token_info)
> **token_info**: `object`
Defined in: wallet-tron/src/history.ts:248
#### address
[Section titled “address”](#address)
> **address**: `string`
#### decimals?
[Section titled “decimals?”](#decimals)
> `optional` **decimals?**: `number`
#### name?
[Section titled “name?”](#name)
> `optional` **name?**: `string`
#### symbol?
[Section titled “symbol?”](#symbol)
> `optional` **symbol?**: `string`
***
### transaction_id
[Section titled “transaction_id”](#transaction_id)
> **transaction_id**: `string`
Defined in: wallet-tron/src/history.ts:247
***
### type
[Section titled “type”](#type)
> **type**: `string`
Defined in: wallet-tron/src/history.ts:252
***
### value
[Section titled “value”](#value)
> **value**: `string`
Defined in: wallet-tron/src/history.ts:253
# TronGridTx
Defined in: wallet-tron/src/history.ts:236
## Properties
[Section titled “Properties”](#properties)
### block_timestamp?
[Section titled “block_timestamp?”](#block_timestamp)
> `optional` **block_timestamp?**: `number`
Defined in: wallet-tron/src/history.ts:242
***
### blockNumber?
[Section titled “blockNumber?”](#blocknumber)
> `optional` **blockNumber?**: `number`
Defined in: wallet-tron/src/history.ts:241
***
### energy_fee?
[Section titled “energy_fee?”](#energy_fee)
> `optional` **energy_fee?**: `number`
Defined in: wallet-tron/src/history.ts:240
***
### internal_transactions?
[Section titled “internal_transactions?”](#internal_transactions)
> `optional` **internal_transactions?**: `object`\[]
Defined in: wallet-tron/src/history.ts:243
#### caller_address?
[Section titled “caller_address?”](#caller_address)
> `optional` **caller_address?**: `string`
#### callValueInfo?
[Section titled “callValueInfo?”](#callvalueinfo)
> `optional` **callValueInfo?**: `object`\[]
#### rejected?
[Section titled “rejected?”](#rejected)
> `optional` **rejected?**: `boolean`
#### transferTo_address?
[Section titled “transferTo_address?”](#transferto_address)
> `optional` **transferTo_address?**: `string`
***
### net_fee?
[Section titled “net_fee?”](#net_fee)
> `optional` **net_fee?**: `number`
Defined in: wallet-tron/src/history.ts:239
***
### raw_data
[Section titled “raw_data”](#raw_data)
> **raw_data**: `object`
Defined in: wallet-tron/src/history.ts:244
#### contract
[Section titled “contract”](#contract)
> **contract**: [`Contract`](/api/anywalletkit/wallet-tron/interfaces/contract/)\[]
#### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
#### timestamp?
[Section titled “timestamp?”](#timestamp)
> `optional` **timestamp?**: `number`
***
### ret?
[Section titled “ret?”](#ret)
> `optional` **ret?**: `object`\[]
Defined in: wallet-tron/src/history.ts:238
#### contractRet?
[Section titled “contractRet?”](#contractret)
> `optional` **contractRet?**: `string`
#### fee?
[Section titled “fee?”](#fee)
> `optional` **fee?**: `number`
***
### txID
[Section titled “txID”](#txid)
> **txID**: `string`
Defined in: wallet-tron/src/history.ts:237
# TronHistoryCursor
Defined in: wallet-tron/src/history.ts:107
## Properties
[Section titled “Properties”](#properties)
### g?
[Section titled “g?”](#g)
> `optional` **g?**: `number`
Defined in: wallet-tron/src/history.ts:116
How many of `t`’s transactions (in txID order) were already emitted.
***
### n
[Section titled “n”](#n)
> **n**: `number`
Defined in: wallet-tron/src/history.ts:110
Rows per API request the positions were taken with: a fingerprint’s page is only the same page at the same size.
***
### s
[Section titled “s”](#s)
> **s**: `object`
Defined in: wallet-tron/src/history.ts:112
Per list, where its unread rows start; `null` once the list is read to the end.
#### trc20
[Section titled “trc20”](#trc20)
> **trc20**: [`TronListPosition`](/api/anywalletkit/wallet-tron/interfaces/tronlistposition/) | `null`
#### tx
[Section titled “tx”](#tx)
> **tx**: [`TronListPosition`](/api/anywalletkit/wallet-tron/interfaces/tronlistposition/) | `null`
***
### t?
[Section titled “t?”](#t)
> `optional` **t?**: `number`
Defined in: wallet-tron/src/history.ts:114
Block timestamp (ms) whose transactions were only partly emitted; both positions point at its first row.
***
### v
[Section titled “v”](#v)
> **v**: `2`
Defined in: wallet-tron/src/history.ts:108
# TronHistoryOptions
Defined in: wallet-tron/src/history.ts:33
Options for [createTronHistory](/api/anywalletkit/wallet-tron/functions/createtronhistory/).
## Properties
[Section titled “Properties”](#properties)
### apiKey?
[Section titled “apiKey?”](#apikey)
> `optional` **apiKey?**: `string`
Defined in: wallet-tron/src/history.ts:37
`TRON-PRO-API-KEY`.
***
### apiUrl?
[Section titled “apiUrl?”](#apiurl)
> `optional` **apiUrl?**: `string`
Defined in: wallet-tron/src/history.ts:35
TronGrid-compatible root. Default by network: `https://api.trongrid.io`, `https://api.shasta.trongrid.io`, `https://nile.trongrid.io`.
***
### fetch?
[Section titled “fetch?”](#fetch)
> `optional` **fetch?**: [`HistoryFetch`](/api/anywalletkit/wallet-tron/type-aliases/historyfetch/)
Defined in: wallet-tron/src/history.ts:39
***
### network?
[Section titled “network?”](#network)
> `optional` **network?**: [`TronNetwork`](/api/anywalletkit/wallet-tron/type-aliases/tronnetwork/)
Defined in: wallet-tron/src/history.ts:38
***
### rateLimit?
[Section titled “rateLimit?”](#ratelimit)
> `optional` **rateLimit?**: `number`
Defined in: wallet-tron/src/history.ts:41
Requests per second. Default 1 without a key (TronGrid’s keyless limit), 10 with one.
***
### timeoutMs?
[Section titled “timeoutMs?”](#timeoutms)
> `optional` **timeoutMs?**: `number`
Defined in: wallet-tron/src/history.ts:43
Per request, ms. Default 15 000.
# TronHistoryPage
Defined in: wallet-tron/src/history.ts:61
## Extends
[Section titled “Extends”](#extends)
* `HistoryPage`
## Properties
[Section titled “Properties”](#properties)
### cursor?
[Section titled “cursor?”](#cursor)
> `optional` **cursor?**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:217
Opaque cursor for the next (older) page; absent when the source has no more.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistoryPage.cursor`
***
### items
[Section titled “items”](#items)
> **items**: [`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/)\[]
Defined in: wallet-tron/src/history.ts:62
Transactions, newest first.
#### Overrides
[Section titled “Overrides”](#overrides)
`HistoryPage.items`
# TronHistoryRaw
Defined in: wallet-tron/src/history.ts:46
## Properties
[Section titled “Properties”](#properties)
### info?
[Section titled “info?”](#info)
> `optional` **info?**: `unknown`
Defined in: wallet-tron/src/history.ts:52
`/wallet/gettransactioninfobyid` (single-transaction reads only).
***
### spam?
[Section titled “spam?”](#spam)
> `optional` **spam?**: `true`
Defined in: wallet-tron/src/history.ts:53
***
### spamReason?
[Section titled “spamReason?”](#spamreason)
> `optional` **spamReason?**: `string`
Defined in: wallet-tron/src/history.ts:54
***
### trc20
[Section titled “trc20”](#trc20)
> **trc20**: `unknown`\[]
Defined in: wallet-tron/src/history.ts:50
`/transactions/trc20` rows for this txID.
***
### tx?
[Section titled “tx?”](#tx)
> `optional` **tx?**: `unknown`
Defined in: wallet-tron/src/history.ts:48
The `/transactions` row (absent when only a TRC-20 transfer to the address was indexed).
# TronHistorySource
Defined in: wallet-tron/src/history.ts:69
Tron history from TronGrid’s account endpoints (TRX and TRC-20). Build it with [createTronHistory](/api/anywalletkit/wallet-tron/functions/createtronhistory/).
## Extends
[Section titled “Extends”](#extends)
* `HistorySource`
## Properties
[Section titled “Properties”](#properties)
### chain
[Section titled “chain”](#chain)
> `readonly` **chain**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:231
CAIP-2 chain id this source serves.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`HistorySource.chain`
## Methods
[Section titled “Methods”](#methods)
### explorerTxUrl()
[Section titled “explorerTxUrl()”](#explorertxurl)
> **explorerTxUrl**(`hash`): `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:237
Explorer URL for a transaction.
#### Parameters
[Section titled “Parameters”](#parameters)
##### hash
[Section titled “hash”](#hash)
`string`
#### Returns
[Section titled “Returns”](#returns)
`string`
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`HistorySource.explorerTxUrl`
***
### getTransaction()
[Section titled “getTransaction()”](#gettransaction)
> **getTransaction**(`hash`, `address`): `Promise`<[`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/) | `undefined`>
Defined in: wallet-tron/src/history.ts:71
One transaction by hash, normalized the same way (undefined when unknown / not yet indexed).
#### Parameters
[Section titled “Parameters”](#parameters-1)
##### hash
[Section titled “hash”](#hash-1)
`string`
##### address
[Section titled “address”](#address)
`string`
#### Returns
[Section titled “Returns”](#returns-1)
`Promise`<[`TronChainTx`](/api/anywalletkit/wallet-tron/interfaces/tronchaintx/) | `undefined`>
#### Overrides
[Section titled “Overrides”](#overrides)
`HistorySource.getTransaction`
***
### listActivity()
[Section titled “listActivity()”](#listactivity)
> **listActivity**(`address`, `query?`): `Promise`<[`TronHistoryPage`](/api/anywalletkit/wallet-tron/interfaces/tronhistorypage/)>
Defined in: wallet-tron/src/history.ts:70
Newest first.
#### Parameters
[Section titled “Parameters”](#parameters-2)
##### address
[Section titled “address”](#address-1)
`string`
##### query?
[Section titled “query?”](#query)
`HistoryQuery`
#### Returns
[Section titled “Returns”](#returns-2)
`Promise`<[`TronHistoryPage`](/api/anywalletkit/wallet-tron/interfaces/tronhistorypage/)>
#### Overrides
[Section titled “Overrides”](#overrides-1)
`HistorySource.listActivity`
# TronListPosition
Defined in: wallet-tron/src/history.ts:102
Where a list’s unread rows start: the page (by the fingerprint that fetched it; absent = the first page) and rows of it already consumed.
## Properties
[Section titled “Properties”](#properties)
### f?
[Section titled “f?”](#f)
> `optional` **f?**: `string`
Defined in: wallet-tron/src/history.ts:103
***
### k
[Section titled “k”](#k)
> **k**: `number`
Defined in: wallet-tron/src/history.ts:104
# TronNativeTransfer
Defined in: wallet-tron/src/types.ts:51
Native TRX transfer. `value` in sun. `memo` → `raw_data.data` (charged the memo fee).
## Properties
[Section titled “Properties”](#properties)
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-tron/src/types.ts:51
***
### memoEncoding?
[Section titled “memoEncoding?”](#memoencoding)
> `optional` **memoEncoding?**: `"utf8"` | `"hex"`
Defined in: wallet-tron/src/types.ts:51
***
### to
[Section titled “to”](#to)
> **to**: `string`
Defined in: wallet-tron/src/types.ts:51
***
### value
[Section titled “value”](#value)
> **value**: `string` | `number` | `bigint`
Defined in: wallet-tron/src/types.ts:51
# TronQuote
Defined in: wallet-tron/src/types.ts:145
Fee of a transaction in sun (TRX burned), with the estimate behind it.
## Properties
[Section titled “Properties”](#properties)
### activationFee
[Section titled “activationFee”](#activationfee)
> **activationFee**: `bigint`
Defined in: wallet-tron/src/types.ts:149
\= `estimate.breakdown.accountCreationFee` (TransferContract to a new account).
***
### estimate
[Section titled “estimate”](#estimate)
> **estimate**: [`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)
Defined in: wallet-tron/src/types.ts:150
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-tron/src/types.ts:147
\= `estimate.trxBurn`.
# TronRawTransaction
Defined in: wallet-tron/src/types.ts:67
A transaction as the full node returns it (`/wallet/createtransaction`, `/wallet/triggersmartcontract`).
## Properties
[Section titled “Properties”](#properties)
### raw_data
[Section titled “raw_data”](#raw_data)
> **raw_data**: `object`
Defined in: wallet-tron/src/types.ts:70
#### contract
[Section titled “contract”](#contract)
> **contract**: `object`\[]
#### data?
[Section titled “data?”](#data)
> `optional` **data?**: `string`
Memo, hex-encoded. Charged `getMemoFee` when present.
#### expiration?
[Section titled “expiration?”](#expiration)
> `optional` **expiration?**: `number`
#### fee_limit?
[Section titled “fee_limit?”](#fee_limit)
> `optional` **fee_limit?**: `number`
#### ref_block_bytes?
[Section titled “ref_block_bytes?”](#ref_block_bytes)
> `optional` **ref_block_bytes?**: `string`
#### ref_block_hash?
[Section titled “ref_block_hash?”](#ref_block_hash)
> `optional` **ref_block_hash?**: `string`
#### timestamp?
[Section titled “timestamp?”](#timestamp)
> `optional` **timestamp?**: `number`
***
### raw_data_hex
[Section titled “raw_data_hex”](#raw_data_hex)
> **raw_data_hex**: `string`
Defined in: wallet-tron/src/types.ts:69
***
### ret?
[Section titled “ret?”](#ret)
> `optional` **ret?**: `object`\[]
Defined in: wallet-tron/src/types.ts:81
Execution result the node attaches (also returned by `triggerconstantcontract` on revert: `ret: 'FAILED'`).
#### contractRet?
[Section titled “contractRet?”](#contractret)
> `optional` **contractRet?**: `string`
#### ret?
[Section titled “ret?”](#ret-1)
> `optional` **ret?**: `string`
***
### signature?
[Section titled “signature?”](#signature)
> `optional` **signature?**: `string`\[]
Defined in: wallet-tron/src/types.ts:83
***
### txID
[Section titled “txID”](#txid)
> **txID**: `string`
Defined in: wallet-tron/src/types.ts:68
***
### visible?
[Section titled “visible?”](#visible)
> `optional` **visible?**: `boolean`
Defined in: wallet-tron/src/types.ts:82
# TronReceipt
Defined in: wallet-tron/src/types.ts:212
Outcome of a confirmed Tron transaction.
## Properties
[Section titled “Properties”](#properties)
### blockNumber
[Section titled “blockNumber”](#blocknumber)
> **blockNumber**: `bigint`
Defined in: wallet-tron/src/types.ts:216
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: wallet-tron/src/types.ts:217
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: wallet-tron/src/types.ts:213
***
### raw
[Section titled “raw”](#raw)
> **raw**: `Record`<`string`, `unknown`>
Defined in: wallet-tron/src/types.ts:219
Raw `/wallet/gettransactioninfobyid` payload.
***
### status
[Section titled “status”](#status)
> **status**: `0` | `1`
Defined in: wallet-tron/src/types.ts:215
1 success, 0 failed.
# TronSimulation
Defined in: wallet-tron/src/types.ts:154
Outcome of a constant call (`/wallet/triggerconstantcontract`) or a balance pre-check.
## Properties
[Section titled “Properties”](#properties)
### constantResult?
[Section titled “constantResult?”](#constantresult)
> `optional` **constantResult?**: `string`\[]
Defined in: wallet-tron/src/types.ts:161
Raw `constant_result` entries.
***
### energy
[Section titled “energy”](#energy)
> **energy**: `number`
Defined in: wallet-tron/src/types.ts:157
`energy_used` reported by the node (0 for non-contract transactions).
***
### ok
[Section titled “ok”](#ok)
> **ok**: `boolean`
Defined in: wallet-tron/src/types.ts:155
***
### reason?
[Section titled “reason?”](#reason)
> `optional` **reason?**: `string`
Defined in: wallet-tron/src/types.ts:159
Decoded revert reason / node message when `ok` is false.
# TronTransferOptions
Defined in: wallet-tron/src/types.ts:93
A TRX or TRC-20 transfer. Amount in sun or the token’s base units.
## Properties
[Section titled “Properties”](#properties)
### amount
[Section titled “amount”](#amount)
> **amount**: `string` | `number` | `bigint`
Defined in: wallet-tron/src/types.ts:98
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-tron/src/types.ts:100
Attached as `raw_data.data`; the network charges `getMemoFee` (1 TRX).
***
### memoEncoding?
[Section titled “memoEncoding?”](#memoencoding)
> `optional` **memoEncoding?**: `"utf8"` | `"hex"`
Defined in: wallet-tron/src/types.ts:102
‘hex’ = binary memo given as 0x-hex, e.g. a Chainflip vault-swap note (default ‘utf8’).
***
### recipient
[Section titled “recipient”](#recipient)
> **recipient**: `string`
Defined in: wallet-tron/src/types.ts:97
Address that receives (base58 `T…` or hex `41…`).
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-tron/src/types.ts:95
TRC-20 contract (base58 T… or hex 41…). Omit for native TRX.
# TronTransferResult
Defined in: wallet-tron/src/account.ts:13
## Extends
[Section titled “Extends”](#extends)
* `TransferResult`
## Properties
[Section titled “Properties”](#properties)
### activationFee?
[Section titled “activationFee?”](#activationfee)
> `optional` **activationFee?**: `bigint`
Defined in: wallet-tron/src/account.ts:15
Account creation fee included in `fee` (TRX transfer to a new account).
***
### estimate?
[Section titled “estimate?”](#estimate)
> `optional` **estimate?**: [`TronFeeEstimate`](/api/anywalletkit/wallet-tron/interfaces/tronfeeestimate/)
Defined in: wallet-tron/src/account.ts:16
***
### fee
[Section titled “fee”](#fee)
> **fee**: `bigint`
Defined in: core/dist/index-QWdcwE6y.d.ts:18
Network fee actually paid or quoted, in native base units.
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
`TransferResult.fee`
***
### hash
[Section titled “hash”](#hash)
> **hash**: `string`
Defined in: core/dist/index-QWdcwE6y.d.ts:16
Transaction hash (id) on the chain.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
`TransferResult.hash`
# TronTxDescription
Defined in: wallet-tron/src/types.ts:183
What a transaction does, decoded offline (see `describeTransaction`). Addresses are base58.
## Properties
[Section titled “Properties”](#properties)
### amount?
[Section titled “amount?”](#amount)
> `optional` **amount?**: `bigint`
Defined in: wallet-tron/src/types.ts:192
sun (TRX) or token base units (TRC-20) or frozen/unfrozen sun.
***
### callValue?
[Section titled “callValue?”](#callvalue)
> `optional` **callValue?**: `bigint`
Defined in: wallet-tron/src/types.ts:202
sun attached to the call.
***
### contract?
[Section titled “contract?”](#contract)
> `optional` **contract?**: `string`
Defined in: wallet-tron/src/types.ts:198
Called contract (contract-call).
***
### expiration?
[Section titled “expiration?”](#expiration)
> `optional` **expiration?**: `number`
Defined in: wallet-tron/src/types.ts:208
***
### feeLimit?
[Section titled “feeLimit?”](#feelimit)
> `optional` **feeLimit?**: `number`
Defined in: wallet-tron/src/types.ts:203
***
### from?
[Section titled “from?”](#from)
> `optional` **from?**: `string`
Defined in: wallet-tron/src/types.ts:188
Sender (owner_address) when known.
***
### kind
[Section titled “kind”](#kind)
> **kind**: [`TronTxKind`](/api/anywalletkit/wallet-tron/type-aliases/trontxkind/)
Defined in: wallet-tron/src/types.ts:185
What it does.
***
### memo?
[Section titled “memo?”](#memo)
> `optional` **memo?**: `string`
Defined in: wallet-tron/src/types.ts:205
Decoded memo (`raw_data.data`).
***
### resource?
[Section titled “resource?”](#resource)
> `optional` **resource?**: `"BANDWIDTH"` | `"ENERGY"`
Defined in: wallet-tron/src/types.ts:207
Freeze / unfreeze resource.
***
### selector?
[Section titled “selector?”](#selector)
> `optional` **selector?**: `string`
Defined in: wallet-tron/src/types.ts:200
4-byte selector, hex.
***
### spender?
[Section titled “spender?”](#spender)
> `optional` **spender?**: `string`
Defined in: wallet-tron/src/types.ts:196
Spender of a TRC-20 approval.
***
### to?
[Section titled “to?”](#to)
> `optional` **to?**: `string`
Defined in: wallet-tron/src/types.ts:190
TRX / TRC-20 recipient.
***
### token?
[Section titled “token?”](#token)
> `optional` **token?**: `string`
Defined in: wallet-tron/src/types.ts:194
TRC-20 contract.
***
### warnings
[Section titled “warnings”](#warnings)
> **warnings**: [`TronTxWarning`](/api/anywalletkit/wallet-tron/interfaces/trontxwarning/)\[]
Defined in: wallet-tron/src/types.ts:186
# TronTxWarning
Defined in: wallet-tron/src/types.ts:180
One flagged problem, with a sentence a wallet can show.
## Properties
[Section titled “Properties”](#properties)
### code
[Section titled “code”](#code)
> **code**: [`TronTxWarningCode`](/api/anywalletkit/wallet-tron/type-aliases/trontxwarningcode/)
Defined in: wallet-tron/src/types.ts:180
***
### message
[Section titled “message”](#message)
> **message**: `string`
Defined in: wallet-tron/src/types.ts:180
# VerifiedRaw
Defined in: wallet-tron/src/raw\.ts:365
Decoded `raw_data` with the exact bytes that are signed and their hash.
## Extends
[Section titled “Extends”](#extends)
* [`TronDecodedRaw`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/)
## Properties
[Section titled “Properties”](#properties)
### bytes
[Section titled “bytes”](#bytes)
> **bytes**: `Uint8Array`
Defined in: wallet-tron/src/raw\.ts:367
The bytes that get hashed and signed.
***
### raw_data
[Section titled “raw_data”](#raw_data)
> **raw_data**: `Omit`<{ `contract`: `object`\[]; `data?`: `string`; `expiration?`: `number`; `fee_limit?`: `number`; `ref_block_bytes?`: `string`; `ref_block_hash?`: `string`; `timestamp?`: `number`; }, `"contract"`> & `object`
Defined in: wallet-tron/src/raw\.ts:182
#### Type Declaration
[Section titled “Type Declaration”](#type-declaration)
##### contract
[Section titled “contract”](#contract)
> **contract**: [`TronDecodedContract`](/api/anywalletkit/wallet-tron/interfaces/trondecodedcontract/)\[]
##### ref_block_num?
[Section titled “ref_block_num?”](#ref_block_num)
> `optional` **ref_block_num?**: `number`
#### Inherited from
[Section titled “Inherited from”](#inherited-from)
[`TronDecodedRaw`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/).[`raw_data`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/#raw_data)
***
### txID
[Section titled “txID”](#txid)
> **txID**: `string`
Defined in: wallet-tron/src/raw\.ts:369
Lowercase hex sha256 of `bytes` (= the txID the signature is over).
***
### unknownFields
[Section titled “unknownFields”](#unknownfields)
> **unknownFields**: `number`\[]
Defined in: wallet-tron/src/raw\.ts:184
Top-level `Transaction.raw` field numbers this codec does not know.
#### Inherited from
[Section titled “Inherited from”](#inherited-from-1)
[`TronDecodedRaw`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/).[`unknownFields`](/api/anywalletkit/wallet-tron/interfaces/trondecodedraw/#unknownfields)
# ExpectedBuild
> **ExpectedBuild** = { `amount`: `bigint`; `owner`: `string`; `to`: `string`; `type`: `"TransferContract"`; } | { `callValue`: `bigint`; `contract`: `string`; `data`: `string`; `feeLimit`: `bigint`; `owner`: `string`; `type`: `"TriggerSmartContract"`; }
Defined in: wallet-tron/src/build-check.ts:15
What the wallet asked the node to build. Addresses in any form; numbers in sun.
## Union Members
[Section titled “Union Members”](#union-members)
### Type Literal
[Section titled “Type Literal”](#type-literal)
{ `amount`: `bigint`; `owner`: `string`; `to`: `string`; `type`: `"TransferContract"`; }
***
### Type Literal
[Section titled “Type Literal”](#type-literal-1)
{ `callValue`: `bigint`; `contract`: `string`; `data`: `string`; `feeLimit`: `bigint`; `owner`: `string`; `type`: `"TriggerSmartContract"`; }
#### callValue
[Section titled “callValue”](#callvalue)
> **callValue**: `bigint`
#### contract
[Section titled “contract”](#contract)
> **contract**: `string`
#### data
[Section titled “data”](#data)
> **data**: `string`
selector ‖ ABI-encoded parameters, hex (0x optional, any case).
#### feeLimit
[Section titled “feeLimit”](#feelimit)
> **feeLimit**: `bigint`
The `fee_limit` actually POSTed to `/wallet/triggersmartcontract`.
#### owner
[Section titled “owner”](#owner)
> **owner**: `string`
#### type
[Section titled “type”](#type)
> **type**: `"TriggerSmartContract"`
# HistoryFetch
> **HistoryFetch** = (`input`, `init?`) => `Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
Defined in: wallet-tron/src/history.ts:24
The `fetch` shape the history source uses; pass your own for proxies or tests.
## Parameters
[Section titled “Parameters”](#parameters)
### input
[Section titled “input”](#input)
`string`
### init?
[Section titled “init?”](#init)
#### body?
[Section titled “body?”](#body)
`string`
#### headers?
[Section titled “headers?”](#headers)
`Record`<`string`, `string`>
#### method?
[Section titled “method?”](#method)
`string`
#### signal?
[Section titled “signal?”](#signal)
`AbortSignal`
## Returns
[Section titled “Returns”](#returns)
`Promise`<{ `ok`: `boolean`; `status`: `number`; `json`: `Promise`<`unknown`>; }>
# MemoEncoding
> **MemoEncoding** = `"utf8"` | `"hex"`
Defined in: wallet-tron/src/memo.ts:77
How a memo string becomes `raw_data.data` bytes: ‘utf8’ (a text memo — THORChain, exchanges) or ‘hex’ (binary payloads — a Chainflip vault swap’s SCALE-encoded note, given as 0x-hex).
# TronFetch
> **TronFetch** = (`path`, `body`) => `Promise`<`unknown`>
Defined in: wallet-tron/src/types.ts:2
JSON-RPC-ish HTTP transport: POST `path` with a JSON body, returns parsed JSON.
## Parameters
[Section titled “Parameters”](#parameters)
### path
[Section titled “path”](#path)
`string`
### body
[Section titled “body”](#body)
`unknown`
## Returns
[Section titled “Returns”](#returns)
`Promise`<`unknown`>
# TronNetwork
> **TronNetwork** = `"mainnet"` | `"shasta"` | `"nile"`
Defined in: wallet-tron/src/history.ts:30
Tron mainnet or the Shasta and Nile testnets.
# TronProvider
> **TronProvider** = `string` | [`TronFetch`](/api/anywalletkit/wallet-tron/type-aliases/tronfetch/)
Defined in: wallet-tron/src/types.ts:5
One full-node base url (e.g. “