{"_id":"@reown/appkit-blockchain-api","_rev":"6-c687e1520dd3b6dd93bd1c12bf8249be","name":"@reown/appkit-blockchain-api","dist-tags":{"canary":"1.7.1-b-api-client.0","latest":"1.7.1-b-api-client.0"},"versions":{"1.7.1-b-api-client.0":{"name":"@reown/appkit-blockchain-api","version":"1.7.1-b-api-client.0","keywords":["appkit","wallet","onboarding","reown","dapps","web3","wagmi","ethereum","solana","bitcoin"],"author":{"url":"https://reown.com","name":"Reown","email":"support@reown.com"},"license":"Apache-2.0","_id":"@reown/appkit-blockchain-api@1.7.1-b-api-client.0","maintainers":[{"name":"gancho_walletconnect","email":"gancho@walletconnect.com"},{"name":"lukaisailovic","email":"lukaisailovic@gmail.com"},{"name":"nachosan","email":"ignacio.santise@gmail.com"},{"name":"rocky-wc","email":"tomas@walletconnect.com"},{"name":"cyberdrk","email":"alexanderderekrein@gmail.com"},{"name":"bkrem","email":"ben.kremer@hotmail.co.uk"},{"name":"enesozturk","email":"enesozturk.d@gmail.com"}],"homepage":"https://github.com/reown-com/appkit","bugs":{"url":"https://github.com/reown-com/appkit/issues"},"dist":{"shasum":"5cd7fb79529f91cc4b7ab358c215f3c3b58d3a51","tarball":"https://registry.npmjs.org/@reown/appkit-blockchain-api/-/appkit-blockchain-api-1.7.1-b-api-client.0.tgz","fileCount":28,"integrity":"sha512-8aRGQGkLb680U+OZbhxBHGzOXyECm5+q4Wt9Ybfn7cWj8iYH2CBuKKD9OByK5AVW47TZzf+n+/FAN0ArSRiH+w==","signatures":[{"sig":"MEUCIQCt2V6NxOpljTxh3VTUa72p/HbOWjXSHJS4bwvcflmBdgIgAukIB95RRyuANYeDEGluYj9OKbSw1qWsCP11aGEpY7g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":460833},"main":"./dist/esm/exports/index.js","type":"module","_from":"file:reown-appkit-blockchain-api-1.7.1-b-api-client.0.tgz","types":"./dist/types/exports/index.d.ts","exports":{".":{"types":"./dist/types/exports/index.d.ts","import":"./dist/esm/exports/index.js","default":"./dist/esm/exports/index.js"}},"scripts":{"lint":"eslint . --ext .js,.jsx,.ts,.tsx","test":"vitest run --dir tests --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true","build":"tsc --build","watch":"tsc --watch","lint:fix":"eslint . --ext .js,.jsx,.ts,.tsx --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"enesozturk","email":"enesozturk.d@gmail.com"},"_resolved":"/private/var/folders/_g/x2q31_ps7nz_vk6xxdbz8rs80000gn/T/1c4a827f5e6c53391954277edc594564/reown-appkit-blockchain-api-1.7.1-b-api-client.0.tgz","_integrity":"sha512-8aRGQGkLb680U+OZbhxBHGzOXyECm5+q4Wt9Ybfn7cWj8iYH2CBuKKD9OByK5AVW47TZzf+n+/FAN0ArSRiH+w==","repository":{"url":"git+https://github.com/reown-com/appkit.git","type":"git"},"_npmVersion":"10.1.0","description":"A client library for interacting with the WalletConnect Blockchain API.","directories":{},"_nodeVersion":"20.9.0","dependencies":{"@reown/appkit-common":"*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/appkit-blockchain-api_1.7.1-b-api-client.0_1742940899677_0.4468075210454794","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-25T22:14:59.616Z","modified":"2026-04-10T15:06:15.509Z","1.7.1-b-api-client.0":"2025-03-25T22:14:59.831Z"},"bugs":{"url":"https://github.com/reown-com/appkit/issues"},"author":{"url":"https://reown.com","name":"Reown","email":"support@reown.com"},"license":"Apache-2.0","homepage":"https://github.com/reown-com/appkit","keywords":["appkit","wallet","onboarding","reown","dapps","web3","wagmi","ethereum","solana","bitcoin"],"repository":{"url":"git+https://github.com/reown-com/appkit.git","type":"git"},"description":"A client library for interacting with the WalletConnect Blockchain API.","maintainers":[{"email":"alexanderderekrein@gmail.com","name":"cyberdrk"},{"email":"npm-org@reown.com","name":"reown-npm-org"}],"readme":"# @reown/blockchain-api\n\nA client library for interacting with the WalletConnect Blockchain API.\n\n## Installation\n\n```bash\nnpm install @reown/blockchain-api\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport { BlockchainApiClient } from '@reown/blockchain-api'\n\n// Create a client\nconst client = new BlockchainApiClient({\n  projectId: 'YOUR_PROJECT_ID',\n  sdkType: 'web-app',\n  sdkVersion: '1.0.0'\n})\n\n// Get supported networks\nconst supportedNetworks = await client.getSupportedNetworks()\n\n// Get account balance\nconst balance = await client.getBalance('0x123...', '1') // address, chainId\n```\n\n### Advanced Configuration\n\nYou can configure the client with additional options:\n\n```typescript\nimport { BLOCKCHAIN_API_URL, BlockchainApiClient } from '@reown/blockchain-api'\n\nconst client = new BlockchainApiClient({\n  baseUrl: BLOCKCHAIN_API_URL, // Defaults to 'https://rpc.walletconnect.org'\n  projectId: 'YOUR_PROJECT_ID',\n  clientId: 'YOUR_CLIENT_ID', // Optional\n  sdkType: 'web-app',\n  sdkVersion: '1.0.0'\n})\n\n// Update configuration later\nclient.setProjectId('NEW_PROJECT_ID')\nclient.setClientId('NEW_CLIENT_ID')\nclient.setSdkType('mobile-app')\nclient.setSdkVersion('1.1.0')\n```\n\n## Features\n\n### Account Information\n\n```typescript\n// Get account identity\nconst identity = await client.fetchIdentity({\n  address: '0x123...',\n  caipNetworkId: 'eip155:1',\n  sender: '0x456...' // Optional\n})\n\n// Get account transactions\nconst transactions = await client.fetchTransactions({\n  account: '0x123...',\n  chainId: '1',\n  cursor: 'next_page_cursor' // Optional, for pagination\n})\n\n// Get account balance\nconst balance = await client.getBalance('0x123...', '1')\n```\n\n### Token Swaps\n\n```typescript\n// Get available tokens for swapping\nconst tokens = await client.fetchSwapTokens({ chainId: '1' })\n\n// Get token prices\nconst prices = await client.fetchTokenPrice({\n  addresses: ['0x123...', '0x456...']\n})\n\n// Get swap quote\nconst quote = await client.fetchSwapQuote({\n  amount: '1000000000000000000', // 1 ETH in wei\n  userAddress: '0x123...',\n  from: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', // ETH\n  to: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' // USDC\n})\n\n// Check token allowance\nconst allowance = await client.fetchSwapAllowance({\n  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n  userAddress: '0x123...'\n})\n\n// Generate approve calldata\nconst approveCalldata = await client.generateApproveCalldata({\n  userAddress: '0x123...',\n  from: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n  to: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\n})\n\n// Generate swap calldata\nconst swapCalldata = await client.generateSwapCalldata({\n  amount: '1000000000000000000',\n  userAddress: '0x123...',\n  from: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',\n  to: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'\n})\n```\n\n### ENS\n\n```typescript\n// Lookup ENS name\nconst ensInfo = await client.lookupEnsName('vitalik.eth')\n\n// Reverse lookup ENS name\nconst ensNames = await client.reverseLookupEnsName({\n  address: '0x123...',\n  sender: '0x456...' // Optional\n})\n\n// Get name suggestions\nconst suggestions = await client.getEnsNameSuggestions('vitalik')\n\n// Register ENS name\nconst registration = await client.registerEnsName({\n  coinType: 60, // ETH\n  address: '0x123...',\n  message: 'Message to sign',\n  signature: '0x456...'\n})\n```\n\n### On-ramp\n\n```typescript\n// Get on-ramp options\nconst options = await client.getOnrampOptions()\n\n// Get on-ramp quote\nconst quote = await client.getOnrampQuote({\n  purchaseCurrency: { id: 'ETH', symbol: 'ETH' },\n  paymentCurrency: { id: 'USD' },\n  amount: '100',\n  network: 'ethereum'\n})\n\n// Generate on-ramp URL\nconst url = await client.generateOnRampURL({\n  destinationWallets: [{ address: '0x123...', blockchains: ['ethereum'] }],\n  partnerUserId: 'user123',\n  defaultNetwork: 'ethereum',\n  purchaseAmount: '0.1', // Optional\n  paymentAmount: '100' // Optional\n})\n```\n\n### Smart Sessions\n\n```typescript\n// Get smart sessions\nconst sessions = await client.getSmartSessions('eip155:1:0x123...')\n\n// Revoke smart session\nconst revocation = await client.revokeSmartSession('0x123...', 'pci_value', 'signature_value')\n```\n\n## Utility Functions\n\n```typescript\nimport {\n  formatAddress,\n  formatCaipAddress,\n  getChainIdFromCaipAddress,\n  getPlainAddress\n} from '@reown/blockchain-api'\n\n// Extract plain address from CAIP format\nconst address = getPlainAddress('eip155:1:0x123...')\n// Result: '0x123...'\n\n// Get chain ID from CAIP address\nconst chainId = getChainIdFromCaipAddress('eip155:1:0x123...')\n// Result: '1'\n\n// Format CAIP address\nconst caipAddress = formatCaipAddress('0x123...', 'eip155', '1')\n// Result: 'eip155:1:0x123...'\n\n// Format address for display\nconst displayAddress = formatAddress('0x1234567890abcdef1234567890abcdef12345678')\n// Result: '0x1234...5678'\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}