### Interactive Module Creation Session Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Demonstrates the step-by-step interactive prompts when running the CLI without arguments, guiding the user through module setup. ```bash $ npx @tetherto/create-wdk-module@latest Create WDK Module ? What type of module do you want to create? > Wallet Module (blockchain wallet integration) Swap Module (DEX/token swap integration) Bridge Module (cross-chain bridging) Lending Module (DeFi lending protocol) Fiat Module (fiat on/off-ramp) Swidge Module (cross-chain swap (swidge = swap + bridge)) ? What is the blockchain name? (e.g., "stellar", "solana") > stellar ? npm scope (leave empty for none, e.g., @myorg): > ? Initialize git repository? > Yes Creating wdk-wallet-stellar... ✓ Template files copied ✓ Initialized git repository Success! Created wdk-wallet-stellar at ./wdk-wallet-stellar Next steps: cd wdk-wallet-stellar npm install npm test ``` -------------------------------- ### Example wdk.config.js Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/worklet-bundler/configuration.mdx An example configuration file demonstrating the structure and common fields like networks, protocols, preloadModules, output, and options. ```javascript module.exports = { networks: { ethereum: { package: '@tetherto/wdk-wallet-evm-erc-4337' }, bitcoin: { package: '@tetherto/wdk-wallet-btc' } }, protocols: { moonpay: { package: '@tetherto/wdk-protocol-fiat-moonpay' } }, preloadModules: [ 'spark-frost-bare-addon' ], output: { bundle: './.wdk-bundle/wdk-worklet.bundle.js', types: './.wdk/index.d.ts' }, options: { minify: false, sourceMaps: false, targets: ['ios-arm64', 'android-arm64'] } } ``` -------------------------------- ### Complete Wallet Solana Configuration Example Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-solana/configuration.mdx A comprehensive example demonstrating the initialization of WalletManagerSolana with both recommended provider settings and optional fee protection. ```javascript import WalletManagerSolana from '@tetherto/wdk-wallet-solana' const config = { // Recommended for operations that query or submit transactions provider: 'https://api.mainnet-beta.solana.com', // Optional: Fee protection transferMaxFee: 10000000 // 0.01 SOL maximum fee } const wallet = new WalletManagerSolana(seedPhrase, config) ``` -------------------------------- ### Initialize Project and Install Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/start-building/nodejs-bare-quickstart.mdx Create a new project directory, initialize it with npm, set the type to module, and install the required WDK modules for EVM, TRON, and Bitcoin. ```bash mkdir wdk-quickstart && cd wdk-quickstart && npm init -y && npm pkg set type=module npm install @tetherto/wdk @tetherto/wdk-wallet-evm @tetherto/wdk-wallet-tron @tetherto/wdk-wallet-btc ``` -------------------------------- ### Install Pre-built WDK Bundle Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/start-building/react-native-quickstart.mdx For quick prototyping, install the pre-built bundle from @tetherto/pear-wrk-wdk. This bundle includes all blockchain modules. ```bash npm install @tetherto/pear-wrk-wdk ``` -------------------------------- ### Install @tetherto/wdk-wallet-evm Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-evm/guides/getting-started.mdx Install the Wallet EVM SDK package using npm. Ensure Node.js version 18 or higher is installed. ```bash npm install @tetherto/wdk-wallet-evm ``` -------------------------------- ### Clone and Install React Native Starter Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/examples-and-starters/react-native-starter.mdx Clone the React Native starter repository and install its dependencies. ```bash git clone https://github.com/tetherto/wdk-starter-react-native.git && cd wdk-starter-react-native && npm install ``` -------------------------------- ### Install @tetherto/wdk-utils Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/wdk-utils/configuration.mdx Install the @tetherto/wdk-utils package using npm. ```bash npm install @tetherto/wdk-utils ``` -------------------------------- ### Aave V3 Lending Protocol - Installation and Initialization Source: https://github.com/tetherto/wdk-docs/blob/main/skills/wdk/references/protocol-lending.md Instructions on how to install the Aave V3 Lending Protocol package and initialize the client. ```APIDOC ## Installation ```bash npm install @tetherto/wdk-protocol-lending-aave-evm ``` ## Initialization ```javascript import AaveProtocolEvm from '@tetherto/wdk-protocol-lending-aave-evm' const aave = new AaveProtocolEvm(evmAccount) ``` ``` -------------------------------- ### Start MCP Server Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/mcp-toolkit/langchain.mdx Use the `serve` command to start a fully configured MCP server on stdio. This command requires no server script. ```bash npx @tetherto/wdk-mcp-toolkit serve ``` -------------------------------- ### Install Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/x402.mdx Install necessary packages for WDK Wallet EVM, x402 Express middleware, and core components. ```bash npm install @tetherto/wdk-wallet-evm @x402/express @x402/evm @x402/core express dotenv ``` -------------------------------- ### Install Velora Protocol EVM with npm Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/swap-modules/swap-velora-evm/guides/get-started.mdx Install the necessary package for Velora Protocol EVM swaps using npm. Ensure you have Node.js and npm installed. ```bash npm install @tetherto/wdk-protocol-swap-velora-evm ``` -------------------------------- ### Install x402 Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/x402.mdx Install the necessary packages for x402 payments and EVM wallet management. ```bash npm install @tetherto/wdk-wallet-evm @x402/fetch @x402/evm ``` -------------------------------- ### Install @tetherto/wdk-provider-failover Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/core-module/guides/middleware.mdx Install the provider failover package using npm. ```bash npm install @tetherto/wdk-provider-failover ``` -------------------------------- ### Basic Theme Setup Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ui-kits/react-native-ui-kit/theming.mdx Wrap your app with the ThemeProvider to enable theming. Use the 'lightTheme' for a basic light mode setup. ```tsx import { ThemeProvider, lightTheme } from '@tetherto/wdk-uikit-react-native' function App() { return ( {/* Your app content */} ) } ``` -------------------------------- ### Start Local Docs Server Source: https://github.com/tetherto/wdk-docs/blob/main/README.md Starts the local development server for the WDK documentation. This command generates the search index and then launches Next.js with Fumadocs. ```bash npm run dev ``` -------------------------------- ### Install Bridge Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/x402.mdx Install the WDK wallet and the USD₮0 EVM bridge protocol packages. ```bash npm install @tetherto/wdk-wallet-evm @tetherto/wdk-protocol-bridge-usdt0-evm ``` -------------------------------- ### Install Aave Protocol EVM with npm Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/lending-modules/lending-aave-evm/guides/get-started.mdx Install the @tetherto/wdk-protocol-lending-aave-evm package using npm. ```bash npm install @tetherto/wdk-protocol-lending-aave-evm ``` -------------------------------- ### Install Protocol Modules Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/core-module/guides/protocol-integration.mdx Install the necessary npm packages for Velora Swap and USDT0 Bridge protocols. ```bash npm install @tetherto/wdk-protocol-swap-velora-evm && npm install @tetherto/wdk-protocol-bridge-usdt0-evm ``` -------------------------------- ### Install Wallet Packages Source: https://github.com/tetherto/wdk-docs/blob/main/skills/wdk/references/wallet-evm.md Install the required npm packages for standard EVM and Account Abstraction support. ```bash npm install @tetherto/wdk-wallet-evm npm install @tetherto/wdk-wallet-evm-erc-4337 # for Account Abstraction ``` -------------------------------- ### Install with npm Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/lending-modules/lending-morpho-evm/guides/get-started.mdx Install the Morpho Protocol EVM lending module, the EVM wallet module, and the viem peer dependency using npm. ```bash npm install @morpho-org/wdk-protocol-lending-morpho-evm @tetherto/wdk-wallet-evm viem ``` -------------------------------- ### Install WDK Modules Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/start-building/react-native-quickstart.mdx Install the necessary WDK modules for your project. Choose the wallet modules specific to the blockchains you need to support. ```bash npm install @tetherto/wdk @tetherto/wdk-wallet-evm-erc-4337 ``` -------------------------------- ### Install @tetherto/wdk-wallet-ton-gasless Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-ton-gasless/guides/get-started.mdx Install the necessary package using npm. Ensure you have Node.js version 18 or higher. ```bash npm install @tetherto/wdk-wallet-ton-gasless ``` -------------------------------- ### Install Self-Hosted Facilitator Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/x402.mdx Install the necessary npm packages for running an in-process x402 facilitator, including the facilitator module, WDK wallet, and related core/evm packages. ```bash npm install @semanticio/wdk-wallet-evm-x402-facilitator @tetherto/wdk-wallet-evm @x402/core @x402/evm @x402/express express dotenv ``` -------------------------------- ### Install with pnpm Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/lending-modules/lending-morpho-evm/guides/get-started.mdx Install the Morpho Protocol EVM lending module, the EVM wallet module, and the viem peer dependency using pnpm. ```bash pnpm add @morpho-org/wdk-protocol-lending-morpho-evm @tetherto/wdk-wallet-evm viem ``` -------------------------------- ### WDK Worklet Bundler Configuration Example Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/react-native-core/index.mdx Example configuration file (wdk.config.js) for the WDK worklet bundler, specifying modules and network settings. ```javascript module.exports = { modules: { core: '@tetherto/wdk', erc4337: '@tetherto/wdk-wallet-evm-erc-4337', }, networks: { ethereum: { module: 'erc4337', chainId: 1, blockchain: 'ethereum', provider: 'https://eth.drpc.org', }, polygon: { module: 'erc4337', chainId: 137, blockchain: 'polygon', provider: 'https://polygon.drpc.org', }, }, } ``` -------------------------------- ### Set up the generated project Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/create-wdk-module.mdx After scaffolding, navigate to the new project directory, install dependencies, and run tests. ```bash cd wdk-wallet-stellar npm install npm test ``` -------------------------------- ### Query Token Balance with JavaScript Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/indexer-api/get-started.mdx This JavaScript example demonstrates how to fetch a token balance using the axios library. Ensure you have axios installed (`npm install axios`). Replace 'your-api-key-here' with your actual API key. ```javascript const axios = require('axios'); async function getTokenBalance(blockchain, token, address) { const response = await axios.get( `https://wdk-api.tether.io/api/v1/${blockchain}/${token}/${address}/token-balances`, { headers: { 'x-api-key': 'your-api-key-here' } } ); return response.data.tokenBalance; } const balance = await getTokenBalance('ethereum', 'usdt', '0xdac17f958d2ee523a2206206994597c13d831ec7'); console.log(`Balance: ${balance.amount} ${balance.token.toUpperCase()}`); ``` -------------------------------- ### Get TRON Account Address Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-tron/api-reference.mdx Retrieves the Tron address associated with the wallet account. The address typically starts with 'T'. ```javascript const address = await account.getAddress() console.log('Account address:', address) // T... ``` -------------------------------- ### Complete WDK Flow Example Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/core-module/api-reference.mdx Demonstrates a comprehensive workflow using the WDK, including initialization, wallet and protocol registration, account retrieval, and interaction with wallet and protocol methods for transactions, swaps, and bridges. ```javascript import WDK from '@tetherto/wdk' import WalletManagerEvm from '@tetherto/wdk-wallet-evm' import WalletManagerTon from '@tetherto/wdk-wallet-ton' import veloraProtocolEvm from '@tetherto/wdk-protocol-swap-velora-evm' import Usdt0ProtocolEvm from '@tetherto/wdk-protocol-bridge-usdt0-evm' // Initialize WDK Manager const wdk = new WDK(seedPhrase) .registerWallet('ethereum', WalletManagerEvm, { provider: 'https://eth.drpc.org' }) .registerWallet('ton', WalletManagerTon, { tonApiKey: 'YOUR_TON_API_KEY', tonApiEndpoint: 'https://tonapi.io' }) .registerProtocol('ethereum', 'velora', veloraProtocolEvm, { apiKey: 'YOUR_velora_API_KEY' }) .registerProtocol('ethereum', 'usdt0', Usdt0ProtocolEvm) // Get accounts const accountEth = await wdk.getAccount('ethereum', 3) const accountTon = await wdk.getAccountByPath('ton', "1'/2/3") // Use wallet account methods const { hash, fee } = await accountEth.sendTransaction({ to: '0x...', value: 1000000000000000000n // 1 ETH }) // Use protocols const velora = accountEth.getSwapProtocol('velora') const swapResult = await velora.swap(swapOptions) const usdt0 = accountEth.getBridgeProtocol('usdt0') // bridgeOptions.oftContractAddress is the source-chain bridge spender. await accountEth.approve({ token: bridgeOptions.token, spender: bridgeOptions.oftContractAddress, amount: bridgeOptions.amount }) const bridgeResult = await usdt0.bridge(bridgeOptions) // Clean up wdk.dispose() ``` -------------------------------- ### Configure for Stable Network Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Example configuration for connecting to the Stable network, which uses USD₮ as its native gas token. No ERC-4337 setup is required. ```javascript // Stable (uses USD₮ as native gas token) // No need for ERC-4337 paymaster/bundler setup. const stableConfig = { provider: 'https://rpc.stable.xyz', } ``` -------------------------------- ### Add Solana Wallet Support Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/start-building/nodejs-bare-quickstart.mdx Installs the Solana wallet manager and registers it with an existing WDK instance. This example shows how to extend WDK to support additional blockchains. ```bash npm install @tetherto/wdk-wallet-solana ``` ```typescript import WalletManagerSolana from '@tetherto/wdk-wallet-solana' // New or existing WDK instance const wdk = new WDK(seedPhrase) wdk.registerWallet('solana', WalletManagerSolana, { rpcUrl: 'https://api.mainnet-beta.solana.com', wsUrl: 'https://api.mainnet-beta.solana.com' }) ``` -------------------------------- ### Basic MoonPay Protocol Configuration Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/fiat-modules/fiat-moonpay/configuration.mdx Configure the MoonPay protocol with an API key and a backend endpoint for signing URLs. This example demonstrates a common setup for integrating MoonPay into your application. ```typescript import MoonPayProtocol from '@tetherto/wdk-protocol-fiat-moonpay'; const moonpay = new MoonPayProtocol(walletAccount, { apiKey: 'pk_live_xxxxx', // Your MoonPay publishable API key signUrl: async (urlForSignature) => { const response = await fetch('/api/moonpay/sign-url', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ urlForSignature }), }); if (!response.ok) { throw new Error(`Failed to sign MoonPay URL: ${response.status} ${response.statusText}`); } const { signedUrl } = await response.json(); return signedUrl; }, environment: 'sandbox', }); ``` -------------------------------- ### Wallet BTC Configuration Example Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-btc/configuration.mdx Demonstrates how to initialize the WalletManagerBtc with an Electrum TLS client, specify the network, and set the BIP derivation path. Shows how to retrieve accounts using default or custom paths. ```javascript import WalletManagerBtc, { ElectrumTls } from '@tetherto/wdk-wallet-btc' // Create Electrum client const client = new ElectrumTls({ host: 'your-electrum-server.com', // Replace with your server port: 50002 }) // Create wallet manager with configuration const wallet = new WalletManagerBtc(seedPhrase, { client, network: 'bitcoin', bip: 84 // Native SegWit (default) }) // Get accounts (inherit configuration from manager) const account0 = await wallet.getAccount(0) const account1 = await wallet.getAccount(1) const customAccount = await wallet.getAccountByPath("0'/0/5") // Clean up when done wallet.dispose() ``` -------------------------------- ### Get Historical Prices from Bitfinex Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/price-rates/configuration.mdx Fetch historical price data for an asset pair, with options to specify start and end times. The data is downscaled to a maximum of 100 points. ```javascript const series = await client.getHistoricalPrice('BTC', 'USD', { start: 1709906400000, // optional (ms) end: 1709913600000 // optional (ms) }) ``` -------------------------------- ### Instantiate WdkMcpServer Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/mcp-toolkit/api-reference.mdx Create a new instance of WdkMcpServer. This is the entry point for setting up the server with WDK capabilities. ```javascript const server = new WdkMcpServer(name: string, version: string) ``` -------------------------------- ### Complete WDK Application Setup Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Initializes WDK, registers wallets for Ethereum, TRON, and Bitcoin with specified configurations, retrieves accounts, resolves addresses, and checks balances. This is the main application logic. ```javascript import WDK from '@tetherto/wdk' import WalletManagerEvm from '@tetherto/wdk-wallet-evm' import WalletManagerTron from '@tetherto/wdk-wallet-tron' import WalletManagerBtc from '@tetherto/wdk-wallet-btc' console.log('Starting WDK App...') try { const seedPhrase = WDK.getRandomSeedPhrase() console.log('Generated seed phrase:', seedPhrase) console.log('Registering wallets...') const wdkWithWallets = new WDK(seedPhrase) .registerWallet('ethereum', WalletManagerEvm, { provider: 'https://eth.drpc.org' }) .registerWallet('tron', WalletManagerTron, { provider: 'https://api.trongrid.io' }) .registerWallet('bitcoin', WalletManagerBtc, { network: 'mainnet', host: 'electrum.blockstream.info', port: 50001 }) console.log('Wallets registered for Ethereum, TRON, and Bitcoin') const accounts = { ethereum: await wdkWithWallets.getAccount('ethereum', 0), tron: await wdkWithWallets.getAccount('tron', 0), bitcoin: await wdkWithWallets.getAccount('bitcoin', 0) } console.log('Resolving addresses:') for (const [chain, account] of Object.entries(accounts)) { const address = await account.getAddress() console.log(` ${chain.toUpperCase()}: ${address}`) } console.log('Checking balances...') for (const [chain, account] of Object.entries(accounts)) { const balance = await account.getBalance() console.log(` ${chain.toUpperCase()}: ${balance.toString()} units`) } console.log('Application completed successfully!') process.exit(0) } catch (error) { console.error('Application error:', error.message) process.exit(1) } ``` -------------------------------- ### Install @tetherto/wdk-wallet-evm-erc-4337 Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-evm-erc-4337/guides/get-started.mdx Install the necessary package using npm. Ensure Node.js version 18 or higher is installed. ```bash npm install @tetherto/wdk-wallet-evm-erc-4337 ``` -------------------------------- ### Install Solana Wallet Package Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-solana/guides/getting-started.mdx Install the @tetherto/wdk-wallet-solana package using npm. Ensure Node.js version 18 or higher is installed. ```bash npm install @tetherto/wdk-wallet-solana ``` -------------------------------- ### Clone Repository and Run Setup Wizard Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/mcp-toolkit/get-started.mdx Clone the MCP Toolkit repository and run the setup wizard to automatically configure your project. This includes setting up your seed phrase and optional API keys. ```bash git clone https://github.com/tetherto/wdk-mcp-toolkit.git cd wdk-mcp-toolkit npm install npm run setup ``` -------------------------------- ### Complete Wallet Manager Initialization and Usage Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-spark/configuration.mdx A comprehensive example demonstrating the initialization of WalletManagerSpark with all configuration options, fetching accounts, and proper disposal. ```javascript import WalletManagerSpark from '@tetherto/wdk-wallet-spark' // Create wallet manager with configuration const seedPhrase = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about' const wallet = new WalletManagerSpark(seedPhrase, { network: 'MAINNET', sparkscan: { apiKey: 'your-api-key-here' }, syncAndRetry: true }) // Get accounts (no additional configuration needed) const account0 = await wallet.getAccount(0) const account1 = await wallet.getAccount(1) // Clean up when done wallet.dispose() ``` -------------------------------- ### Install Bitcoin Wallet Package Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-btc/guides/get-started.mdx Install the `@tetherto/wdk-wallet-btc` package using npm. Ensure you have Node.js version 18 or higher installed. ```bash npm install @tetherto/wdk-wallet-btc ``` -------------------------------- ### Initialize A Starter Config Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/worklet-bundler/configuration.mdx Use the `init` command to create a starter configuration file for the worklet bundler. ```bash npx wdk-worklet-bundler init ``` -------------------------------- ### Use Pre-built Bundle Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/react-native-core/index.mdx Import and use the pre-built bundle from '@tetherto/pear-wrk-wdk' for quick prototyping. ```typescript import { bundle } from '@tetherto/pear-wrk-wdk' ``` -------------------------------- ### Install USDT0 EVM Bridge Package Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/bridge-modules/bridge-usdt0-evm/guides/get-started.mdx Install the @tetherto/wdk-protocol-bridge-usdt0-evm package using npm. Ensure Node.js version 18 or higher is installed. ```bash npm install @tetherto/wdk-protocol-bridge-usdt0-evm ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/examples-and-starters/react-native-starter.mdx Copy the example environment file and set up WDK Indexer API key and optional Tron API keys. ```bash cp .env.example .env EXPO_PUBLIC_WDK_INDEXER_BASE_URL=https://wdk-api.tether.io EXPO_PUBLIC_WDK_INDEXER_API_KEY=your_actual_api_key_here # Optional: For Tron network support EXPO_PUBLIC_TRON_API_KEY=your_tron_api_key EXPO_PUBLIC_TRON_API_SECRET=your_tron_api_secret ``` -------------------------------- ### Install @tetherto/wdk-worklet-bundler Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/worklet-bundler/configuration.mdx Install the bundler as a development dependency in your project. ```bash npm install --save-dev @tetherto/wdk-worklet-bundler ``` -------------------------------- ### Install Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/start-building/react-native-quickstart.mdx Install project dependencies using npm. ```bash npm install ``` -------------------------------- ### GET /api/v1/chains Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/indexer-api/api-reference.mdx Get a list of supported chains and tokens. ```APIDOC ## GET /api/v1/chains ### Description Get list of supported chains and tokens. ### Method GET ### Endpoint /api/v1/chains ``` -------------------------------- ### WdkMcpServer Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Create a server instance with a name and version. ```APIDOC ## WdkMcpServer(name, version) ### Description Create a server instance with a name and version. The `WdkMcpServer` extends `McpServer` from the official [`@modelcontextprotocol/sdk`](https://github.com/modelcontextprotocol/typescript-sdk) with WDK-specific capabilities. All standard MCP server features are available. ### Parameters - **name** (string) - Required - The name of the server. - **version** (string) - Required - The version of the server. ### Example ```javascript import { WdkMcpServer } from '@tetherto/wdk-mcp-toolkit' const server = new WdkMcpServer('my-server', '1.0.0') ``` ``` -------------------------------- ### Create with All Defaults (No Prompts) Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Use the `--yes` flag to skip all interactive prompts and use default settings for module creation. ```bash npx @tetherto/create-wdk-module@latest wallet stellar --yes ``` -------------------------------- ### Install @tetherto/wdk-failover-provider Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/failover-provider/configuration.mdx Install the failover provider package using npm. ```bash npm install @tetherto/wdk-failover-provider ``` -------------------------------- ### Common CLI usage patterns Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/create-wdk-module.mdx Examples demonstrating various ways to use the CLI, including specifying module type, blockchain, npm scope, and skipping prompts. ```bash # Create a wallet module with an npm scope npx @tetherto/create-wdk-module@latest wallet stellar --scope @myorg # Create a swap protocol module npx @tetherto/create-wdk-module@latest swap jupiter solana # Create with all defaults, no prompts npx @tetherto/create-wdk-module@latest wallet stellar --yes ``` -------------------------------- ### Install MCP Toolkit and Wallet Modules Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/mcp-toolkit/get-started.mdx Install the core MCP Toolkit and specific wallet modules for the blockchains you need to support. This command installs the necessary packages via npm. ```bash npm install @tetherto/wdk-mcp-toolkit @modelcontextprotocol/sdk # Wallet modules (add any combination) npm install @tetherto/wdk-wallet-evm # Ethereum, Polygon, Arbitrum, etc. npm install @tetherto/wdk-wallet-btc # Bitcoin ``` -------------------------------- ### Initialize WDK with Multiple Wallets Source: https://github.com/tetherto/wdk-docs/blob/main/skills/wdk/SKILL.md Register and initialize multiple wallet managers with WDK for multi-chain support. Ensure the necessary wallet packages are installed. ```javascript import WDK from '@tetherto/wdk' import WalletManagerEvm from '@tetherto/wdk-wallet-evm' import WalletManagerBtc from '@tetherto/wdk-wallet-btc' const wdk = new WDK(seedPhrase) .registerWallet('ethereum', WalletManagerEvm, { provider: 'https://eth.drpc.org' }) .registerWallet('bitcoin', WalletManagerBtc, { host: 'electrum.blockstream.info', port: 50001 }) const ethAccount = await wdk.getAccount('ethereum', 0) const btcAccount = await wdk.getAccount('bitcoin', 0) ``` -------------------------------- ### Install Expo Build Properties Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Install the expo-build-properties package if it's not already present. ```bash npx expo install expo-build-properties ``` -------------------------------- ### Initialize AaveProtocolEvm Service Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/lending-modules/lending-aave-evm/configuration.mdx Demonstrates how to initialize the AaveProtocolEvm service with a wallet account. Ensure a wallet account is created first. ```javascript import AaveProtocolEvm from '@tetherto/wdk-protocol-lending-aave-evm' import { WalletAccountEvm } from '@tetherto/wdk-wallet-evm' // Create wallet account first const account = new WalletAccountEvm(seedPhrase, "0'/0/0", { provider: 'https://ethereum-rpc.publicnode.com' }) // Create lending service const aave = new AaveProtocolEvm(account) ``` -------------------------------- ### Generate An Install Command Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/worklet-bundler/api-reference.mdx Build the install command string without mutating the project. ```typescript import { generateInstallCommand } from '@tetherto/wdk-worklet-bundler' const command = generateInstallCommand( ['@tetherto/wdk-wallet-btc', '@tetherto/pear-wrk-wdk'], 'npm' ) ``` -------------------------------- ### Copy Environment File Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Copies the example environment file to a new file for local configuration. ```bash cp .env.example .env ``` -------------------------------- ### Create WDK Instance Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/core-module/configuration.mdx Initialize the WDK Manager with a seed phrase. This is the basic setup required before registering wallets or protocols. ```javascript import WDK from '@tetherto/wdk' const wdk = new WDK(seedPhrase) ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ai/mcp-toolkit/langchain.mdx Install the necessary LangChain and WDK MCP adapter packages for Python. ```bash pip install langchain-mcp-adapters langgraph langchain-openai ``` -------------------------------- ### Install TON wallet packages Source: https://github.com/tetherto/wdk-docs/blob/main/skills/wdk/references/wallet-ton.md Use npm to install the standard and gasless TON wallet modules. ```bash npm install @tetherto/wdk-wallet-ton npm install @tetherto/wdk-wallet-ton-gasless # for gasless variant ``` -------------------------------- ### Initialize WDK Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/core-module/api-reference.mdx Instantiate the WDK class using either a BIP-39 mnemonic seed phrase or seed bytes. This is the primary step to begin managing wallets. ```javascript import WDK from '@tetherto/wdk' // With seed phrase const wdk = new WDK('abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about') // With seed bytes const seedBytes = new Uint8Array([...]) const wdk2 = new WDK(seedBytes) ``` -------------------------------- ### Install WDK React Native UI Kit Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/ui-kits/react-native-ui-kit/get-started.mdx Install the UI Kit package using npm. ```bash npm install @tetherto/wdk-uikit-react-native ``` -------------------------------- ### Configure for Ethereum Mainnet Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Example configuration for connecting to the Ethereum Mainnet. ```javascript // Ethereum Mainnet const mainnetConfig = { provider: 'https://eth.drpc.org' } ``` -------------------------------- ### Basic Theme Setup with ThemeProvider Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Wraps the application with ThemeProvider to enable the WDK UI Kit's theming system. Uses the built-in light theme. ```tsx import { ThemeProvider, lightTheme } from '@tetherto/wdk-uikit-react-native' function App() { return ( {/* Your app content */} ) } ``` -------------------------------- ### Install @tetherto/wdk-wallet-tron-gasfree Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/sdk/wallet-modules/wallet-tron-gasfree/guides/get-started.mdx Install the necessary package using npm. Ensure you have Node.js version 18 or higher. ```bash npm install @tetherto/wdk-wallet-wallet-tron-gasfree ``` -------------------------------- ### Configure for BSC (Binance Smart Chain) Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Example configuration for connecting to the Binance Smart Chain. ```javascript // BSC (Binance Smart Chain) const bscConfig = { provider: 'https://bsc-dataseed.binance.org' } ``` -------------------------------- ### workletStart Source: https://github.com/tetherto/wdk-docs/blob/main/public/llms-full.txt Deprecated worklet startup request. Prefer `initializeWDK()`. ```APIDOC ## workletStart ### Description Deprecated worklet startup request. Prefer `initializeWDK()`. ### Method `workletStart(args: WorkletStartRequest): Promise` ### Parameters #### Request Body - **args** (WorkletStartRequest) - Required - Description of WorkletStartRequest ``` -------------------------------- ### GET /api/v1/{blockchain}/{token}/{address}/token-balances Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/indexer-api/api-reference.mdx Get the current token balance for a specific address. ```APIDOC ## GET /api/v1/{blockchain}/{token}/{address}/token-balances ### Description Get current token balance for an address. ### Method GET ### Endpoint /api/v1/{blockchain}/{token}/{address}/token-balances ### Parameters #### Path Parameters - **blockchain** (string) - Required - The blockchain network. - **token** (string) - Required - The token symbol. - **address** (string) - Required - The address to query. ``` -------------------------------- ### GET /api/v1/{blockchain}/{token}/{address}/token-transfers Source: https://github.com/tetherto/wdk-docs/blob/main/content/docs/tools/indexer-api/api-reference.mdx Get token transfer history for a specific address. ```APIDOC ## GET /api/v1/{blockchain}/{token}/{address}/token-transfers ### Description Get token transfer history for an address. ### Method GET ### Endpoint /api/v1/{blockchain}/{token}/{address}/token-transfers ### Parameters #### Path Parameters - **blockchain** (string) - Required - The blockchain network. - **token** (string) - Required - The token symbol. - **address** (string) - Required - The address to query. ```