Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/docs/cli/guides/swap-and-bridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: ArrowLeftRight

WDK CLI beta.6 can quote installed swap and bridge protocols, select a route, and execute it from an unlocked wallet. Use `wdk token list` to find the registered network and token names accepted by these commands.

Use this guide to [Select The Account And Recipient](#select-the-account-and-recipient), [Prepare A Velora Token Allowance](#prepare-a-velora-token-allowance), [Preview A Swap](#preview-a-swap), [Execute A Swap](#execute-a-swap), [Preview And Execute A Bridge](#preview-and-execute-a-bridge), [Choose A Protocol](#choose-a-protocol).

Before you begin, [set up and unlock a wallet](/cli/guides/get-started) and check the source and destination token names with `wdk token list`. Built-in entries need no registration. If an entry is missing, [add a custom token](/cli/guides/manage-tokens#add-a-custom-token). Fund the source account with the tokens and native gas asset needed for execution.

If you register a custom or overriding native token, read [Manage Tokens](/cli/guides/manage-tokens) first: `wdk token add` cannot retain `nativeId`, so routing works only when the selected protocol discovers the asset by symbol or does not require a native route identifier. Custom native tokens are not guaranteed to swap or bridge.
Expand Down
2 changes: 2 additions & 0 deletions content/docs/sdk/core-module/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new WDK(seed, options?)
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `options` (`WdkOptions`, optional): Instance settings. `maxConditionTimeoutMs` is a finite positive number that caps every policy condition timeout on this WDK instance and defaults to `30000` milliseconds. `policyExclusions?: string[]` appends non-empty method names to the default policy exclusions.

For base `WalletManager` implementations, `@tetherto/wdk-wallet@1.0.0-beta.20` clarifies that byte input is a raw BIP-32 master seed of 16–64 bytes. It need not have been generated from a BIP-39 mnemonic. This is a declaration clarification, not a new derivation algorithm; check each concrete wallet's seed and derivation requirements.

**Throws:** `Error` if the seed is invalid. Throws `PolicyConfigurationError` if `options` fails the published options schema, such as an array or primitive value, if `maxConditionTimeoutMs` is not a finite positive number, or if `policyExclusions` is not an array of non-empty strings.

**Example:**
Expand Down
2 changes: 1 addition & 1 deletion content/docs/sdk/core-module/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WDK Core is the main runtime for registering and managing wallet, protocol, midd
<Callout type="info">
These pages reflect `@tetherto/wdk@1.0.0-beta.18`. This release adds machine-readable policy denial codes; integrations can branch on `DENIAL_CODES`, `PolicyViolationError.code`, or `SimulationResult.code` instead of parsing `reason`.

The base-wallet reference also covers `@tetherto/wdk-wallet@1.0.0-beta.22`, including signer capabilities, disposal state, and `DisposalError`. This is a separate package from the WDK orchestrator; see the [base-wallet migration notes](/sdk/core-module/api-reference#base-wallet-signer-contracts).
The base-wallet reference also covers `@tetherto/wdk-wallet@1.0.0-beta.22`, including raw BIP-32 seed input, signer capabilities, disposal state, and `DisposalError`. This is a separate package from the WDK orchestrator; see the [base-wallet migration notes](/sdk/core-module/api-reference#base-wallet-signer-contracts).
</Callout>

Use WDK Core to:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const provider = new PricingProvider({
const btcUsd = await provider.getLastPrice('BTC', 'USD')
```

The provider failover layer retries connection errors. A pair that resolves to `null` is still an unavailable result for that client.
With multiple clients, `PricingProvider` retries failures matching `error instanceof Error` within its `retries` limit, including application and HTTP errors. A resolved `null` is an unavailable result and does not trigger failover.

## Runtime Notes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ try {
}
```

When using `PricingProvider` with multiple clients, connection errors can trigger failover to the next client in the ordered list. A `null` result means the client completed the request but did not resolve that pair.
When using `PricingProvider` with multiple clients, failures matching `error instanceof Error` can trigger failover within its `retries` limit, including application and HTTP errors. A resolved `null` means the client did not resolve that pair and does not trigger failover.

## Next Steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ Execution fetches a new rate and rejects a mismatched pair, mismatched input amo

## Exact output swap

You can receive an exact amount of the output token by passing `tokenOutAmount` to [`swap()`](/sdk/swap-modules/swap-velora-evm/api-reference):

```javascript title="Exact output amount"
const result = await swapProtocol.swap({
tokenIn: ETHEREUM_USDT,
tokenOut: ETHEREUM_WETH,
tokenOutAmount: 500000000000000000n // 0.5 WETH (18 decimals)
})

console.log('Swap hash:', result.hash)
console.log('Quoted input (base units):', result.tokenInAmount)
console.log('Quoted output (base units):', result.tokenOutAmount)
```

BUY validates the requested exact output and retains it in the transaction build. An optional `minAmountOut` also rejects an output below that floor; it does not add an input-token spending cap.

## Swap with ERC-4337
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import WalletManagerAptos, {

Creates and manages seed-derived Aptos accounts.

Beta.3 reuses one manager-created REST client across derived accounts and their read-only conversions.
`seed` accepts a BIP-39 mnemonic or raw 16–64-byte seed for SLIP-0010 derivation. Beta.3 reuses one manager-created REST client across derived accounts and their read-only conversions.

```typescript
new WalletManagerAptos(
Expand Down
2 changes: 1 addition & 1 deletion content/docs/sdk/wallet-modules/wallet-aptos/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Use this module when an app needs Aptos account derivation, APT balances, fungib

## Features

- **BIP-39 seed support**: Accepts a mnemonic phrase or seed bytes.
- **Seed inputs**: Accepts a BIP-39 mnemonic phrase or raw 16–64-byte seed for SLIP-0010 derivation.
- **Shared RPC client**: Beta.3 shares the manager's Aptos REST client across derived accounts and their read-only conversions.
- **SLIP-0010 Ed25519 derivation**: Uses Aptos coin type `637` and hardened path segments.
- **Aptos addresses**: Derives 32-byte Aptos addresses from the public key.
Expand Down
4 changes: 2 additions & 2 deletions content/docs/sdk/wallet-modules/wallet-btc/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Extends `WalletManager` from `@tetherto/wdk-wallet`.
new WalletManagerBtc(seed, config)
```
**Parameters:**
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or raw BIP-32 master seed (16–64 bytes)
- `config` (BtcWalletConfig, optional): Configuration object
- `client` (`IBtcClient | BtcClientDescriptor | Array<IBtcClient | BtcClientDescriptor>`, optional): Bitcoin client, descriptor, or ordered failover list
- `network` (string, optional): "bitcoin", "testnet", or "regtest" (default: "bitcoin")
Expand Down Expand Up @@ -115,7 +115,7 @@ new WalletAccountBtc(seed, path, config)
```

**Parameters:**
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or raw BIP-32 master seed (16–64 bytes)
- `path` (string): Derivation path suffix (e.g., "0'/0/0")
- `config` (BtcWalletConfig, optional): Configuration object
- `client` (`IBtcClient | BtcClientDescriptor | Array<IBtcClient | BtcClientDescriptor>`, optional): Bitcoin client, descriptor, or ordered failover list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Handle Errors
description: Handle errors, manage fees, and dispose of sensitive data.
---

This guide explains how to [handle transaction errors](#transaction-errors), [handle connection errors](#connection-errors), and follow [best practices](#best-practices) for fee management and memory cleanup.
This guide explains how to [handle transaction errors](#transaction-errors), [handle connection errors](#connection-errors), [handle transaction status errors](#transaction-status-errors), and follow [best practices](#best-practices) for fee management and memory cleanup.

## Transaction Errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ new WalletManagerEvm7702Gasless(seed, config)

| Parameter | Type | Description |
|-----------|------|-------------|
| `seed` | `string \| Uint8Array` | BIP-39 mnemonic seed phrase or seed bytes. |
| `seed` | `string \| Uint8Array` | BIP-39 mnemonic or raw BIP-32 master seed (16–64 bytes). |
| `config` | `Evm7702GaslessWalletConfig` | Wallet configuration with common fields and one fee mode. |

In beta.7, the manager builds one RPC client and shares it across the accounts it derives. A supplied ethers provider is reused; see [provider configuration](/sdk/wallet-modules/wallet-evm-7702-gasless/configuration#provider-failover).
Expand Down Expand Up @@ -65,7 +65,7 @@ new WalletAccountEvm7702Gasless(walletAccountEvm, config)

| Parameter | Type | Description |
|-----------|------|-------------|
| `seed` | `string \| Uint8Array` | BIP-39 mnemonic seed phrase or seed bytes. |
| `seed` | `string \| Uint8Array` | BIP-39 mnemonic or raw BIP-32 master seed (16–64 bytes). |
| `path` | `string` | EVM derivation path suffix, for example `"0'/0/0"`. |
| `walletAccountEvm` | `WalletAccountEvm` | Existing EVM account from the same beta.19 package instance used by this module; see [wrapping an account](/sdk/wallet-modules/wallet-evm-7702-gasless/guides/manage-accounts#wrap-an-existing-evm-account). |
| `config` | `Evm7702GaslessWalletConfig` | Wallet configuration. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ new WalletManagerEvmErc4337(seed, config)
In beta.21, this manager builds one RPC client and shares it across derived accounts and their read-only views. See [provider configuration](/sdk/wallet-modules/wallet-evm-erc-4337/configuration#provider).

**Parameters:**
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `seed` (string | Uint8Array): BIP-39 mnemonic or raw BIP-32 master seed (16–64 bytes)
- `config` (EvmErc4337WalletConfig): Configuration object with common fields and a gas payment mode

**Common config fields (required for all modes):**
Expand Down Expand Up @@ -227,7 +227,7 @@ wallet.dispose()

| Property | Type | Description |
|----------|------|-------------|
| `seed` | `Uint8Array` | Seed bytes |
| `seed` | `Uint8Array` | Raw BIP-32 master seed bytes, including bytes derived from a supplied mnemonic |

## WalletAccountEvmErc4337

Expand All @@ -251,7 +251,7 @@ new WalletAccountEvmErc4337(seed, path, config)
```

**Parameters:**
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `seed` (string | Uint8Array): BIP-39 mnemonic or raw BIP-32 master seed (16–64 bytes)
- `path` (string): BIP-44 derivation path (e.g., "0'/0/0")
- `config` (EvmErc4337WalletConfig): Configuration object (same as [WalletManagerEvmErc4337](#constructor))

Expand Down
4 changes: 2 additions & 2 deletions content/docs/sdk/wallet-modules/wallet-evm/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ new WalletManagerEvm(seedOrSigner, config?)
```

**Parameters:**
- `seedOrSigner` (`string | Uint8Array | ISigner`): BIP-39 mnemonic seed phrase, seed bytes, or a derivable root signer
- `seedOrSigner` (`string | Uint8Array | ISigner`): BIP-39 mnemonic, raw BIP-32 master seed (16–64 bytes), or a derivable root signer
- `config` (object, optional): Configuration object
- `provider` (`string | Eip1193Provider | Array<string | Eip1193Provider>`, optional): RPC endpoint URL, EIP-1193 provider instance, or ordered failover list
- `retries` (number, optional): Additional retry attempts when `provider` is an array
Expand Down Expand Up @@ -242,7 +242,7 @@ new WalletAccountEvm(signer, config?)
```

**Parameters:**
- `seed` (string | Uint8Array): BIP-39 mnemonic seed phrase or seed bytes
- `seed` (string | Uint8Array): BIP-39 mnemonic or raw BIP-32 master seed (16–64 bytes)
- `path` (string): BIP-44 derivation path (e.g., "0'/0/0")
- `signer`: Object implementing the EVM signer shape
- `config` (object, optional): Configuration object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const wallet = new WalletManagerEvm(seedPhrase, config)

## Signer Configuration

`WalletManagerEvm` accepts either a BIP-39 seed phrase/seed bytes or a derivable EVM signer as its first argument. Use the `@tetherto/wdk-wallet-evm/signers` entrypoint when you need explicit signer objects:
`WalletManagerEvm` accepts a BIP-39 mnemonic, raw BIP-32 master seed bytes (16–64 bytes), or a derivable EVM signer as its first argument. Raw seed bytes do not have to originate from BIP-39. Use the `@tetherto/wdk-wallet-evm/signers` entrypoint when you need explicit signer objects:

```javascript title="Create A Manager From A Seed Signer"
import WalletManagerEvm from '@tetherto/wdk-wallet-evm'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,36 @@ This guide explains how to [transfer ERC-20 tokens](#transfer-tokens), [estimate

Use [`account.transfer()`](/sdk/wallet-modules/wallet-evm/api-reference#transferoptions) to send ERC-20 tokens to a recipient address.

```javascript title="Transfer ERC-20 Tokens"
const USDT_ETHEREUM = '0xdAC17F958D2ee523a2206206994597C13D831ec7'

const transferResult = await account.transfer({
token: USDT_ETHEREUM,
recipient: '0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6',
amount: 1000000n // 1 USDt on Ethereum (6 decimals)
})
console.log('Transfer hash:', transferResult.hash)
console.log('Transfer fee:', transferResult.fee, 'wei')
```

## Estimate Transfer Fees

Use [`account.quoteTransfer()`](/sdk/wallet-modules/wallet-evm/api-reference#quotetransferoptions) to get a fee estimate before executing the transfer.

```javascript title="Quote Token Transfer"
const transferQuote = await account.quoteTransfer({
token: USDT_ETHEREUM,
recipient: '0x742d35cc6634c0532925a3b8d4c9db96c4b4d8b6',
amount: 1000000n
})
console.log('Transfer fee estimate:', transferQuote.fee, 'wei')
```

## Override Gas and Fees (optional)

Starting in beta.20, pass gas overrides directly in the options for [`quoteTransfer()`](/sdk/wallet-modules/wallet-evm/api-reference#quotetransferoptions) and [`transfer()`](/sdk/wallet-modules/wallet-evm/api-reference#transferoptions). Use EIP-1559 fee fields or legacy `gasPrice`; do not combine them.

```javascript title="Quote a Transfer with Explicit Fee Rates"
const USDT_ETHEREUM = '0xdAC17F958D2ee523a2206206994597C13D831ec7'
const transfer = {
token: USDT_ETHEREUM,
recipient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {

## WalletManagerSolanaGasless

Derives and returns owned Solana gasless accounts from a BIP-39 seed phrase or seed bytes. Extends `WalletManager` from `@tetherto/wdk-wallet`. The manager shares one Solana RPC client and one Kora paymaster client across derived accounts and their read-only conversions.
Derives and returns owned Solana gasless accounts from a BIP-39 mnemonic or raw 16–64-byte seed for SLIP-0010 derivation. Extends `WalletManager` from `@tetherto/wdk-wallet`. The manager shares one Solana RPC client and one Kora paymaster client across derived accounts and their read-only conversions.

### Constructor

Expand All @@ -61,7 +61,7 @@ new WalletManagerSolanaGasless(

**Parameters:**

- `seed`: BIP-39 mnemonic seed phrase or seed bytes.
- `seed`: BIP-39 mnemonic seed phrase or raw 16–64-byte seed for SLIP-0010 derivation.
- `config`: Solana RPC and Kora-compatible paymaster configuration.

### Methods
Expand Down Expand Up @@ -112,7 +112,7 @@ new WalletAccountSolanaGasless(

**Parameters:**

- `seed`: BIP-39 mnemonic seed phrase or seed bytes.
- `seed`: BIP-39 mnemonic seed phrase or raw 16–64-byte seed for SLIP-0010 derivation.
- `path`: SLIP-0010 derivation path, for example `"0'/0'/0'"`.
- `config`: Solana RPC and Kora-compatible paymaster configuration.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: Settings

## Wallet Configuration

`WalletManagerSolanaGasless` accepts a seed phrase or seed bytes plus a Solana gasless wallet configuration. Beta.6 shares one Solana RPC client and one Kora paymaster client across manager-derived accounts and their read-only conversions:
`WalletManagerSolanaGasless` accepts a BIP-39 mnemonic or raw 16–64-byte seed for SLIP-0010 derivation plus a Solana gasless wallet configuration. Beta.6 shares one Solana RPC client and one Kora paymaster client across manager-derived accounts and their read-only conversions:

```javascript title="Create a gasless Solana wallet"
import WalletManagerSolanaGasless from '@tetherto/wdk-wallet-solana-gasless'
Expand Down
Loading