UNPKG

chaingate

Version:

Multi-chain cryptocurrency SDK for TypeScript — unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO

655 lines (654 loc) 20.5 kB
"use strict"; // This file is auto-generated by @hey-api/openapi-ts Object.defineProperty(exports, "__esModule", { value: true }); exports.getUtxoNetworkUtxosByAddress = exports.getUtxoNetworkTransactionDetails = exports.getUtxoNetworkMempool = exports.getUtxoNetworkLogo = exports.getUtxoNetworkLatestBlock = exports.getUtxoNetworkFeeRate = exports.postUtxoNetworkEstimateTransactionSize = exports.postUtxoNetworkBroadcastTransaction = exports.getUtxoNetworkBlockByHeight = exports.getUtxoNetworkBlockByHash = exports.getUtxoNetworkAddressHistory = exports.getUtxoNetworkAddressBalance = exports.postRpcNetwork = exports.getGlobalLogoNetwork = exports.getGlobalNetworksInfo = exports.getGlobalMarkets = exports.getEvmNetworkNftMetadataImage = exports.getEvmNetworkNftMetadataAnimation = exports.getEvmNetworkNftMetadata = exports.getEvmNetworkTransactionDetails = exports.getEvmNetworkTokenLogo = exports.getEvmNetworkTokenData = exports.getEvmNetworkOwnedTokens = exports.getEvmNetworkNonce = exports.getEvmNetworkNetworkStatus = exports.getEvmNetworkLogo = exports.getEvmNetworkLatestBlock = exports.getEvmNetworkFeeRate = exports.getEvmNetworkEstimateGas = exports.postEvmNetworkCallSmartContractFunction = exports.postEvmNetworkBroadcastTransaction = exports.getEvmNetworkBlockByHeight = exports.getEvmNetworkBlockByHash = exports.getEvmNetworkAddressTransactionCount = exports.getEvmNetworkAddressTokenBalances = exports.getEvmNetworkAddressHistory = exports.getEvmNetworkAddressBalance = void 0; const client_gen_1 = require("./client.gen"); /** * Get address balance * * Returns the confirmed and unconfirmed native balance for an EVM address. */ const getEvmNetworkAddressBalance = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/addressBalance', ...options, }); exports.getEvmNetworkAddressBalance = getEvmNetworkAddressBalance; /** * Get address history * * Returns paginated transaction history for an EVM address, including decoded contract events (transfers, mints, approvals, etc.) */ const getEvmNetworkAddressHistory = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/addressHistory', ...options, }); exports.getEvmNetworkAddressHistory = getEvmNetworkAddressHistory; /** * Get address token balances * * Returns all ERC-20/ERC-721/ERC-1155 token balances for an EVM address. Discovers contracts the address has interacted with and returns balances enriched with token metadata. For ERC-721 contracts that implement ERC721Enumerable, owned token IDs and tokenURIs are included. ERC-721 contracts without ERC721Enumerable will return the balance but not owned token IDs — use /ownedTokens to enumerate those. */ const getEvmNetworkAddressTokenBalances = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/addressTokenBalances', ...options, }); exports.getEvmNetworkAddressTokenBalances = getEvmNetworkAddressTokenBalances; /** * Get address transaction count * * Returns the nonce (transaction count) for an EVM address */ const getEvmNetworkAddressTransactionCount = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/addressTransactionCount', ...options, }); exports.getEvmNetworkAddressTransactionCount = getEvmNetworkAddressTransactionCount; /** * Get block by hash * * Returns block details for the given block hash */ const getEvmNetworkBlockByHash = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/blockByHash', ...options, }); exports.getEvmNetworkBlockByHash = getEvmNetworkBlockByHash; /** * Get block by height * * Returns block details for the given block height */ const getEvmNetworkBlockByHeight = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/blockByHeight', ...options, }); exports.getEvmNetworkBlockByHeight = getEvmNetworkBlockByHeight; /** * Broadcast transaction * * Broadcasts a signed raw transaction to the network */ const postEvmNetworkBroadcastTransaction = (options) => (options.client ?? client_gen_1.client).post({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/broadcastTransaction', ...options, headers: { 'Content-Type': 'application/json', ...options.headers, }, }); exports.postEvmNetworkBroadcastTransaction = postEvmNetworkBroadcastTransaction; /** * Call smart contract function * * Executes a read-only (eth_call) call against a smart contract */ const postEvmNetworkCallSmartContractFunction = (options) => (options.client ?? client_gen_1.client).post({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/callSmartContractFunction', ...options, headers: { 'Content-Type': 'application/json', ...options.headers, }, }); exports.postEvmNetworkCallSmartContractFunction = postEvmNetworkCallSmartContractFunction; /** * Estimate gas * * Estimates the gas required for a transaction */ const getEvmNetworkEstimateGas = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/estimateGas', ...options, }); exports.getEvmNetworkEstimateGas = getEvmNetworkEstimateGas; /** * Get fee rate estimates * * Returns fee rate estimates for 4 priority tiers. EIP-1559 networks return maxFeePerGas/maxPriorityFeePerGas, legacy networks return gasPrice */ const getEvmNetworkFeeRate = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/feeRate', ...options, }); exports.getEvmNetworkFeeRate = getEvmNetworkFeeRate; /** * Get latest block * * Returns the latest block number and hash for the specified EVM network */ const getEvmNetworkLatestBlock = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/latestBlock', ...options, }); exports.getEvmNetworkLatestBlock = getEvmNetworkLatestBlock; /** * Get network logo * * Returns the SVG logo for the specified EVM network. The response is an SVG image. */ const getEvmNetworkLogo = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/logo', ...options, }); exports.getEvmNetworkLogo = getEvmNetworkLogo; /** * Get network status * * Returns current network status including block time, gas usage, and fee predictions */ const getEvmNetworkNetworkStatus = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/networkStatus', ...options, }); exports.getEvmNetworkNetworkStatus = getEvmNetworkNetworkStatus; /** * Get next transaction nonce * * Returns the next nonce for an EVM address. */ const getEvmNetworkNonce = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/nonce', ...options, }); exports.getEvmNetworkNonce = getEvmNetworkNonce; /** * Get owned ERC-721 tokens * * Enumerates ERC-721 token IDs owned by a wallet for a specific contract. Works with any ERC-721 contract, including those that do not implement the ERC721Enumerable extension. Returns the token balance, standard, metadata, and a list of owned token IDs with their tokenURIs. */ const getEvmNetworkOwnedTokens = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/ownedTokens', ...options, }); exports.getEvmNetworkOwnedTokens = getEvmNetworkOwnedTokens; /** * Get token data * * Returns metadata and on-chain information for a token contract, including name, symbol, decimals, total supply, detected token standard (ERC-20/ERC-721/ERC-1155), and logo. Works on all supported EVM networks without requiring a wallet address. */ const getEvmNetworkTokenData = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/tokenData', ...options, }); exports.getEvmNetworkTokenData = getEvmNetworkTokenData; /** * Get token logo * * Returns the logo image for a token contract on the specified EVM network. The response is a binary image (PNG or SVG). */ const getEvmNetworkTokenLogo = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/tokenLogo', ...options, }); exports.getEvmNetworkTokenLogo = getEvmNetworkTokenLogo; /** * Get transaction details * * Returns detailed information about a transaction by its hash */ const getEvmNetworkTransactionDetails = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/transactionDetails', ...options, }); exports.getEvmNetworkTransactionDetails = getEvmNetworkTransactionDetails; /** * Get NFT metadata * * Returns the full decoded metadata for a specific NFT token, including name, description, image, animation URL, external URL, and attributes. Fetches the tokenURI from the contract (ERC-721 tokenURI or ERC-1155 uri), then resolves and decodes the metadata JSON. Supports HTTPS, data: (base64), and IPFS URIs. Results are cached in Redis. */ const getEvmNetworkNftMetadata = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/nft/metadata', ...options, }); exports.getEvmNetworkNftMetadata = getEvmNetworkNftMetadata; /** * Get NFT animation * * Returns the animation or video for a specific NFT token as binary data. Resolves the animation_url from the NFT metadata (supports IPFS, HTTPS, and data: URIs) and proxies it through ChainGate so consumers don't need to handle IPFS resolution. The response content type matches the original format. */ const getEvmNetworkNftMetadataAnimation = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/nft/metadata/animation', ...options, }); exports.getEvmNetworkNftMetadataAnimation = getEvmNetworkNftMetadataAnimation; /** * Get NFT image * * Returns the image for a specific NFT token as binary data. Resolves the image URL from the NFT metadata (supports IPFS, HTTPS, and data: URIs) and proxies the image through ChainGate so consumers don't need to handle IPFS resolution. The response content type matches the original image format. */ const getEvmNetworkNftMetadataImage = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/evm/{network}/nft/metadata/image', ...options, }); exports.getEvmNetworkNftMetadataImage = getEvmNetworkNftMetadataImage; /** * Get market data * * Returns cryptocurrency prices and fiat exchange rates for all supported networks, including many beyond those with dedicated /evm or /utxo endpoints (e.g. Mantle, Celo, Moonbeam, Berachain, etc.) */ const getGlobalMarkets = (options) => (options?.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/global/markets', ...options, }); exports.getGlobalMarkets = getGlobalMarkets; /** * Get networks info * * Returns real-time information for all supported EVM networks, including many that don't have dedicated /evm endpoints (e.g. Mantle, Celo, Moonbeam, Berachain, etc.). Includes block times, gas usage, and fee predictions. */ const getGlobalNetworksInfo = (options) => (options?.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/global/networksInfo', ...options, }); exports.getGlobalNetworksInfo = getGlobalNetworksInfo; /** * Get network logo * * Returns the SVG logo for any supported network, including networks beyond those with dedicated /evm or /utxo endpoints (e.g. Mantle, Celo, Moonbeam, Berachain, etc.). The response is an SVG image. */ const getGlobalLogoNetwork = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/global/logo/{network}', ...options, }); exports.getGlobalLogoNetwork = getGlobalLogoNetwork; /** * JSON-RPC endpoint * * Executes JSON-RPC calls against the specified blockchain network. */ const postRpcNetwork = (options) => (options.client ?? client_gen_1.client).post({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/rpc/{network}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers, }, }); exports.postRpcNetwork = postRpcNetwork; /** * Get address balance * * Returns the confirmed and unconfirmed balance for a UTXO address */ const getUtxoNetworkAddressBalance = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/addressBalance', ...options, }); exports.getUtxoNetworkAddressBalance = getUtxoNetworkAddressBalance; /** * Get address history * * Returns paginated transaction history for a UTXO address */ const getUtxoNetworkAddressHistory = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/addressHistory', ...options, }); exports.getUtxoNetworkAddressHistory = getUtxoNetworkAddressHistory; /** * Get block by hash * * Returns block details for the given block hash */ const getUtxoNetworkBlockByHash = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/blockByHash', ...options, }); exports.getUtxoNetworkBlockByHash = getUtxoNetworkBlockByHash; /** * Get block by height * * Returns block details for the given block height */ const getUtxoNetworkBlockByHeight = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/blockByHeight', ...options, }); exports.getUtxoNetworkBlockByHeight = getUtxoNetworkBlockByHeight; /** * Broadcast transaction * * Broadcasts a signed raw transaction to the UTXO network */ const postUtxoNetworkBroadcastTransaction = (options) => (options.client ?? client_gen_1.client).post({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/broadcastTransaction', ...options, headers: { 'Content-Type': 'application/json', ...options.headers, }, }); exports.postUtxoNetworkBroadcastTransaction = postUtxoNetworkBroadcastTransaction; /** * Estimate transaction size * * Estimates the byte size of a transaction given inputs and outputs */ const postUtxoNetworkEstimateTransactionSize = (options) => (options.client ?? client_gen_1.client).post({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/estimateTransactionSize', ...options, headers: { 'Content-Type': 'application/json', ...options.headers, }, }); exports.postUtxoNetworkEstimateTransactionSize = postUtxoNetworkEstimateTransactionSize; /** * Get fee rate estimates * * Returns fee rate estimates for 4 priority tiers in satoshis per KB */ const getUtxoNetworkFeeRate = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/feeRate', ...options, }); exports.getUtxoNetworkFeeRate = getUtxoNetworkFeeRate; /** * Get latest block * * Returns the latest block number and hash for the specified UTXO network */ const getUtxoNetworkLatestBlock = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/latestBlock', ...options, }); exports.getUtxoNetworkLatestBlock = getUtxoNetworkLatestBlock; /** * Get network logo * * Returns the SVG logo for the specified UTXO network. The response is an SVG image. */ const getUtxoNetworkLogo = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/logo', ...options, }); exports.getUtxoNetworkLogo = getUtxoNetworkLogo; /** * Get mempool * * Returns paginated mempool transaction IDs */ const getUtxoNetworkMempool = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/mempool', ...options, }); exports.getUtxoNetworkMempool = getUtxoNetworkMempool; /** * Get transaction details * * Returns detailed information about a transaction by its ID */ const getUtxoNetworkTransactionDetails = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/transactionDetails', ...options, }); exports.getUtxoNetworkTransactionDetails = getUtxoNetworkTransactionDetails; /** * Get UTXOs by address * * Returns paginated unspent transaction outputs for a UTXO address */ const getUtxoNetworkUtxosByAddress = (options) => (options.client ?? client_gen_1.client).get({ security: [ { in: 'query', name: 'api_key', type: 'apiKey', }, ], url: '/utxo/{network}/utxosByAddress', ...options, }); exports.getUtxoNetworkUtxosByAddress = getUtxoNetworkUtxosByAddress;