### Example Request Source: https://voyager.online/docs/api/getting-started This example demonstrates how to make a GET request to the blocks endpoint, including necessary headers for authentication and content type. ```APIDOC ## GET /blocks ### Description Retrieves blockchain block data. ### Method GET ### Endpoint https://api.voyager.online/beta/blocks ### Query Parameters - **p** (integer) - Optional - Page number (starts from 1) - **ps** (integer) - Optional - Page size (number of items per page) - **timestampFrom** (integer) - Optional - Start timestamp (Unix seconds) - **timestampTo** (integer) - Optional - End timestamp (Unix seconds) - **order_by** (string) - Optional - Sort order: `asc` or `desc` ### Request Example ```curl curl -X GET "https://api.voyager.online/beta/blocks?p=1&ps=10" \ -H "x-api-key: your_api_key_here" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **items** (array) - Array of data objects - **lastPage** (integer) - The last page number - **hasMore** (boolean) - Indicates if there are more pages #### Response Example ```json { "items": [ { "blockNumber": 123456, "blockHash": "0x...", "timestamp": 1640995200 } ], "lastPage": 1000 } ``` ``` -------------------------------- ### Setup Node.js Project and Install Dependencies Source: https://voyager.online/docs/setup Create a new Node.js project and install the axios and dotenv packages for making API requests and managing environment variables. ```bash mkdir voyager-api-test cd voyager-api-test npm init -y npm install axios dotenv ``` -------------------------------- ### Example API Request with Python Source: https://voyager.online/docs/authentication This Python example shows how to make a GET request to the /beta/blocks endpoint using the requests library, including the API key in the headers. ```python import requests headers = { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } response = requests.get( 'https://api.voyager.online/beta/blocks', headers=headers ) data = response.json() ``` -------------------------------- ### Example API Request with cURL Source: https://voyager.online/docs/authentication This example shows how to make a GET request to the /beta/blocks endpoint using cURL, including the API key in the header. ```curl curl -X GET "https://api.voyager.online/beta/blocks" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" ``` -------------------------------- ### Example API Request (cURL) Source: https://voyager.online/docs/api/getting-started Demonstrates how to make a GET request to the blocks endpoint with pagination parameters and API key authentication. ```bash curl -X GET "https://api.voyager.online/beta/blocks?p=1&ps=10" \ -H "x-api-key: your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### Example API Request with JavaScript Source: https://voyager.online/docs/authentication This JavaScript example demonstrates how to fetch data from the /beta/blocks endpoint using the Fetch API, including the API key in the headers. ```javascript const response = await fetch('https://api.voyager.online/beta/blocks', { headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } }); const data = await response.json(); ``` -------------------------------- ### Get Staking Overview (Python) Source: https://voyager.online/docs/api/staking/overview Utilize the requests library to fetch staking overview data. Ensure you have the 'requests' library installed and replace 'your_api_key_here' with your valid API key. ```python import requests url = "https://api.voyager.online/beta/staking/overview" headers = { "x-api-key": "your_api_key_here", "Content-Type": "application/json" } response = requests.get(url, headers=headers) data = response.json() print(data) ``` -------------------------------- ### JavaScript SDK Example Source: https://voyager.online/docs/api/getting-started Example of how to fetch data from the blocks endpoint using JavaScript's fetch API. ```APIDOC ## JavaScript Fetch Example ### Description This code snippet shows how to use the `fetch` API in JavaScript to retrieve data from the Voyager API. ### Code ```javascript // Using fetch (Node.js 18+ or with node-fetch) const response = await fetch('https://api.voyager.online/beta/blocks', { headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); ``` ``` -------------------------------- ### Get All Messages (Python) Source: https://voyager.online/docs/api/message/get-all Example using the requests library to fetch messages. Remember to include your API key in the headers. ```python import requests url = "https://api.voyager.online/beta/messages?limit=10" headers = { "x-api-key": "your_api_key_here", "Content-Type": "application/json" } response = requests.get(url, headers=headers) data = response.json() print(data) ``` -------------------------------- ### Example Response for Get Verification Job Source: https://voyager.online/docs/api/class-verify/get-job This is an example of a successful response when querying the status of a verification job. It includes the job ID, status, and contract details. ```json { "status": 1, "job_id": "1985c0c9-c4f0-4000-8881-93ab2a614101", "class_hash": "0x0421dbe408553c0a49267f752565277123f437145463e4670e3da70fe69ed285", "created_timestamp": 1758640000, "updated_timestamp": 1758640300, "status_description": "Verification completed successfully", "address": "0x07faf54d35eb92d381cb5d3b9ba6b35ccf297980e35be22ecfe07eafd2a4ac48", "contract_file": "src/lib.cairo", "name": "MyToken", "version": "2.4.0", "license": "MIT" } ``` -------------------------------- ### Example Wallet Staking Info Response Source: https://voyager.online/docs/api/staking/wallet-info This is an example JSON response detailing the staking overview and individual staking positions for a wallet address. ```json { "overview": { "totalStakedStrk": "12736221.177654454", "totalStakedBtc": "0", "totalRewardsClaimedStrk": "911083.4789124725", "totalRewardsClaimedBtc": "0", "totalRewardsUnclaimedStrk": "4959.92173511402", "totalRewardsUnclaimedBtc": "0" }, "staked": [ { "tokenAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "poolContract": "0x02cb02c72e8a0975e69e88298443e984d965a49eab38f5bdde1f5072daa09cfe", "amount": "12736221177654455077713510", "rewardAddress": "0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18", "rewardsClaimed": "911083478912472488513493", "rewardsUnclaimed": "4959921735114019219571", "startTime": 1734401823, "status": "active", "validatorRowInfo": { "address": "0x00d3b910d8c528bf0216866053c3821ac6c97983dc096bff642e9a3549210ee7", "name": "Ready (prev. Argent)", "imgSrc": "https://dv3jj1unlp2jl.cloudfront.net/argent-assets/hito-orange-on-white.png", "isVerified": true, "totalStakeStrk": "94316196.33822665", "totalDelegators": 34634, "aprStrk": 1213, "rank": "1", "liveness": 99.9 } } ] } ``` -------------------------------- ### Get Staking Overview (JavaScript) Source: https://voyager.online/docs/api/staking/overview Use the fetch API to make a GET request to the /staking/overview endpoint. Remember to replace 'your_api_key_here' with your actual API key. ```javascript // Using fetch const response = await fetch('https://api.voyager.online/beta/staking/overview', { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Example Response - Standard Metric Source: https://voyager.online/docs/api/daily-stats/historical This is an example of a response for a standard metric like 'transactions_count'. It includes the date, the daily value, and the cumulative value. ```json { "items": [ { "date": "2025-10-03", "value": 285671, "commulative_value": "234297810" }, { "date": "2025-10-09", "value": 566253, "commulative_value": "236766700" } ] } ``` -------------------------------- ### Example API Response Source: https://voyager.online/docs/setup This is an example of a successful response when fetching block data. ```json { "items": [ { "blockNumber": 2385197, "hash": "0x28a0ac373064c630d248e4bb71ef2d192d635935ca87f34fbcb66b211774865", "timestamp": 1758625454, "stateRoot": "0x531cf5199112be1591d9478007c1227879d687a726ca8728d466e9e8b5ba6fe", "txnCount": 41, "eventCount": 497, "messageCount": 0, "l1VerificationTxHash": null, "status": "Accepted on L2" } ], "lastPage": 2385199 } ``` -------------------------------- ### Install Python Packages for API Testing Source: https://voyager.online/docs/setup Install the requests library for making HTTP requests and python-dotenv for managing environment variables in your Python project. ```bash pip install requests python-dotenv ``` -------------------------------- ### Example Wallet Activity Response Source: https://voyager.online/docs/api/staking/wallet-activity This is an example of a successful response when querying wallet staking activity. It includes a list of activities, pagination details, and metadata about available operations and destinations. ```json { "items": [ { "timestamp": "2025-10-12T18:11:57.000Z", "name": "delegator_claim_rewards", "amount": "4433882725066115659691", "delegatorAddress": "0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18", "stakerAddress": "0x00d3b910d8c528bf0216866053c3821ac6c97983dc096bff642e9a3549210ee7", "destinationName": "wallet", "destinationIcon": null, "source": "0x02cb02c72e8a0975e69e88298443e984d965a49eab38f5bdde1f5072daa09cfe", "destination": "0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18", "txnHash": "0x6bbc6b138244c1871c2a81895b798dd1e3fea3e91bcd10bf58e710198455553", "tokenAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "tokenInfo": { "tokenAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "price": 0.132298, "decimals": 18, "logoUrl": "https://coin-images.coingecko.com/coins/images/26433/small/starknet.png?1696525507", "name": "Starknet", "symbol": "strk" } } ], "pagination": { "prev": null, "next": "/staking/wallet-info/activity?p=2&ps=10&address=0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18&sort=DESC", "totalPages": 28, "pageSize": 10, "prevPage": null, "nextPage": 2, "currentPage": 1 }, "meta": { "operationsAvailable": [ "delegator_claim_rewards", "delegator_stake" ], "destinationsAvailable": [ { "value": "0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18", "name": "wallet", "iconSrc": null }, { "value": "0x02cb02c72e8a0975e69e88298443e984d965a49eab38f5bdde1f5072daa09cfe", "name": "Ready (prev. Argent)", "iconSrc": "https://dv3jj1unlp2jl.cloudfront.net/argent-assets/hito-orange-on-white.png" } ] } } ``` -------------------------------- ### Wallet Stake Over Time Response Example Source: https://voyager.online/docs/api/staking/wallet-stake-over-time This is an example of the JSON response structure for the wallet stake over time endpoint. It includes daily staking totals and changes in STRK and BTC. ```json [ { "date": "2025-09-14", "totalStakeStrk": "12615228.283518454", "totalStakeBtc": "0", "totalStakeChangeStrk": "0", "totalStakeChangeBtc": "0" }, { "date": "2025-09-17", "totalStakeStrk": "12626783.528718455", "totalStakeBtc": "0", "totalStakeChangeStrk": "11555.245200000001", "totalStakeChangeBtc": "0" }, { "date": "2025-09-25", "totalStakeStrk": "12736221.177654454", "totalStakeBtc": "0", "totalStakeChangeStrk": "87423.73013", "totalStakeChangeBtc": "0" } ] ``` -------------------------------- ### Get Block by Hash using Go Source: https://voyager.online/docs/api/blocks/get-by-hash Employ the net/http package to construct and execute a GET request to the /blocks/{blockHash} endpoint. Replace 'your_api_key_here' with your actual API key. ```go package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" ) func main() { blockHash := "0x19402ac841080ad4849ac0209265cb6e82856036ffce993e7f583b322c61092" apiKey := "your_api_key_here" url := fmt.Sprintf("https://api.voyager.online/beta/blocks/%s", blockHash) req, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatalf("Error creating request: %v", err) } req.Header.Set("x-api-key", apiKey) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatalf("Error sending request: %v", err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalf("Error reading response body: %v", err) } var data map[string]interface{}/ err = json.Unmarshal(body, &data) if err != nil { log.Fatalf("Error unmarshalling JSON: %v", err) } fmt.Println(data) } ``` -------------------------------- ### Example API Response Source: https://voyager.online/docs/api/balances/get-balances This is an example of the JSON response structure when retrieving token balances. It includes details for each ERC20 token, such as name, address, balance, and USD value. ```json { "erc20TokenBalances": [ { "name": "Tether USD", "address": "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", "balance": "120196", "usdBalance": "0.12", "usdFormattedBalance": "$0.12", "decimals": "0x6", "symbol": "USDT", "formattedBalance": "0.120196", "iconLogo": "https://coin-images.coingecko.com/coins/images/32210/small/usdt_%281%29.png?1696752003", "isVerified": true } ], "verfiedTokensCount": 4, "totalTokensCount": 5, "totalUsdValue": "0.22" } ``` -------------------------------- ### Initialize Go Module for API Testing Source: https://voyager.online/docs/setup Create a new Go module and initialize it for your API testing project. ```bash mkdir voyager-api-test cd voyager-api-test go mod init voyager-test ``` -------------------------------- ### Set API Key and Run Go Program Source: https://voyager.online/docs/setup Export your API key as an environment variable and then run the Go program to test the Voyager API. ```bash export VOYAGER_API_KEY=your_api_key_here go run main.go ``` -------------------------------- ### Get NFT Contract Information (JavaScript) Source: https://voyager.online/docs/api/nfts/get-nft-contract Use the fetch API to make a GET request to the /nft-contract endpoint. Ensure you include your API key in the headers. This example demonstrates how to retrieve contract details using a provided contract address. ```javascript // Using fetch const contractAddress = "0x01435498bf393da86b4733b9264a86b58a42b31f8d8b8ba309593e5c17847672"; const response = await fetch(`https://api.voyager.online/beta/nft-contract/${contractAddress}`, { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Example Response - Fee Comparison Metric (eth_transfer_fee) Source: https://voyager.online/docs/api/daily-stats/historical This example shows the response structure for fee comparison metrics, such as 'eth_transfer_fee'. It provides L1 and L2 costs in both ETH and USD, along with the L2 vs L1 ratio. ```json { "items": [ { "date": "2025-10-03", "l1_value_eth": 0.000882886290308206, "l1_value_usd": 3.89594764869463, "l2_value_eth": 0.000001994813164636, "l2_value_usd": 0.00880259184411586, "l2_vs_l1": 0.0022594225174112 } ] } ``` -------------------------------- ### Example Response for Get All Tokens Source: https://voyager.online/docs/api/tokens/get-all This is an example of the JSON response structure when retrieving a list of tokens. It includes an array of token objects, each with details like address, decimals, holders, name, symbol, transfers, and type, along with pagination data. ```json { "items": [ { "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "decimals": "18", "holders": "4494104", "name": "Ether", "symbol": "ETH", "transfers": "229585280", "type": "erc20" }, { "address": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "decimals": "18", "holders": "991560", "name": "Starknet Token", "symbol": "STRK", "transfers": "116525724", "type": "erc20" } ], "lastPage": 8298 } ``` -------------------------------- ### Error Response for Get All Tokens Source: https://voyager.online/docs/api/tokens/get-all This is an example of a 400 Bad Request error response. It indicates that an invalid token type or attribute parameter was provided in the query. ```json { "error": "Invalid token type or attribute parameter" } ``` -------------------------------- ### Get Staking Overview (Go) Source: https://voyager.online/docs/api/staking/overview This Go code snippet demonstrates how to retrieve staking overview data using the http package. Replace 'YOUR_API_KEY' with your actual API key. ```go package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" ) func main() { url := "https://api.voyager.online/beta/staking/overview" apiKey := "YOUR_API_KEY" req, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatalf("Failed to create request: %v", err) } req.Header.Set("x-api-key", apiKey) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatalf("Failed to send request: %v", err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalf("Failed to read response body: %v", err) } var data map[string]interface{} if err := json.Unmarshal(body, &data); err != nil { log.Fatalf("Failed to unmarshal JSON: %v", err) } fmt.Println(data) } ``` -------------------------------- ### Bad Request Error Response Source: https://voyager.online/docs/api/contracts/get-by-address This is an example of a 400 Bad Request error response. It indicates that the provided contract address has an invalid format and must be a valid hex string starting with '0x'. ```json { "error": "Invalid contract address format", "message": "Address must be a valid hex string starting with 0x" } ``` -------------------------------- ### Get All Messages (Go) Source: https://voyager.online/docs/api/message/get-all Demonstrates how to fetch messages using Go's standard http library. Replace the placeholder API key with your own. ```go package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" ) func main() { url := "https://api.voyager.online/beta/messages?limit=10" client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatalf("Error creating request: %v", err) } req.Header.Add("x-api-key", "your_api_key_here") req.Header.Add("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { log.Fatalf("Error sending request: %v", err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalf("Error reading response body: %v", err) } var data map[string]interface{} if err := json.Unmarshal(body, &data); err != nil { log.Fatalf("Error unmarshalling JSON: %v", err) } fmt.Println(data) } ``` -------------------------------- ### Fetch Network Stats using JavaScript Source: https://voyager.online/docs/api/stats/get-stats Use the fetch API to make a GET request to the /stats endpoint. Ensure you include your API key in the headers. This example demonstrates how to retrieve and log the JSON response. ```javascript // Using fetch const response = await fetch('https://api.voyager.online/beta/stats', { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Example Response - All Metrics (*) - Single Day Snapshot Source: https://voyager.online/docs/api/daily-stats/historical When requesting all metrics with `metrics=*`, the API returns the latest daily snapshot. This includes a wide range of network and transaction data for a single day. ```json { "items": [ { "date": "2025-10-10", "transactions_per_block": 15.1263, "transactions_per_second": 5, "transactions_count": 236929217, "max_transactions_per_second": 75, "classes_count": 69141, "events_count": 1714988557, "messages_count": 2124208, "contracts_count": 6474504, "account_contracts_count": 5940126, "active_account_contracts": 13225, "l1_block_creation_time": 0.1423, "l2_block_creation_time": 2.7074, "proof_generation_time": 20412.98, "user_operations_count": 517262851, "fee_per_block": 0.00012555, "eth_transfer_fee": 0.000002205, "tvl_total": 842484712.88, "last_updated": 1760083682 } ] } ``` -------------------------------- ### Fetch Contracts for a Class (JavaScript) Source: https://voyager.online/docs/api/classes/get-contracts Use the fetch API to make a GET request to the /classes/{classHash}/contracts endpoint. Include your API key in the headers. This example demonstrates how to retrieve contract data and log it to the console. ```javascript const classHash = "0x0421dbe408553c0a49267f752565277123f437145463e4670e3da70fe69ed285"; const response = await fetch(`https://api.voyager.online/beta/classes/${classHash}/contracts`, { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Get Delegators Source: https://voyager.online/docs/api/staking/delegators Returns detailed information about delegators for a specific validator, including delegator addresses, staked amounts, share percentages, and start times. Supports filtering by specific delegator and asset type (STRK or BTC). ```APIDOC ## GET /staking/delegators ### Description Retrieves a list of delegators for a given validator, with options for pagination and filtering. ### Method GET ### Endpoint /staking/delegators ### Query Parameters - **validator** (string) - Required - Validator's address (hex string) - **p** (integer) - Optional - Page number (default: 1) - **ps** (integer) - Optional - Page size (default: 25) - **delegator** (string) - Optional - Specific delegator address (hex string) or Starknet ID (.stark domain). Returns only that delegator without pagination. - **asset** (string) - Optional - Asset type: `strk` or `btc` (default: `strk`) ### Request Example ```json { "example": "curl -X GET \"https://api.voyager.online/beta/staking/delegators?validator=0x00d3b910d8c528bf0216866053c3821ac6c97983dc096bff642e9a3549210ee7&p=1&ps=25&asset=strk\" \ -H \"x-api-key: your_api_key_here\" \ -H \"Content-Type: application/json\"" } ``` ### Response #### Success Response (200) - **items** (array) - Array of delegator objects - **items[].address** (string) - Delegator wallet address - **items[].delegatedStake** (string) - Amount staked (formatted with decimals) - **items[].share** (number) - Delegator's share percentage (basis points) - **items[].startTime** (integer) - Unix timestamp when delegation started - **pagination** (object) - Pagination information #### Response Example ```json { "items": [ { "address": "0x01bed88e5027795facabb1a8fe8fa882f56a734412697232d9e7c86e18589b18", "delegatedStake": "12736221.177654454", "share": 1350.37799439353, "startTime": 1734401823 }, { "address": "0x03651b83fb30ad6bb33a96eeb522631a56ccb2f59695c6b812e32417abfd8e2d", "delegatedStake": "4278570", "share": 453.642151379188, "startTime": 1759328875 } ], "pagination": { "prev": null, "next": "/staking/delegators?p=2&ps=25&validator=0x00d3b910d8c528bf0216866053c3821ac6c97983dc096bff642e9a3549210ee7", "totalPages": 1375, "pageSize": 25, "prevPage": null, "nextPage": 2, "currentPage": 1 } } ``` ``` -------------------------------- ### Retrieve Class Details using Fetch API Source: https://voyager.online/docs/api/classes/get-by-hash Use the fetch API to make a GET request to the /classes/{classHash} endpoint. Ensure you include your API key in the headers. This example demonstrates how to retrieve class details and parse the JSON response. ```javascript // Using fetch const classHash = "0x0421dbe408553c0a49267f752565277123f437145463e4670e3da70fe69ed285"; const response = await fetch(`https://api.voyager.online/beta/classes/${classHash}`, { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Get Staking Overview (cURL) Source: https://voyager.online/docs/api/staking/overview Execute a cURL command to fetch staking overview data. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X GET "https://api.voyager.online/beta/staking/overview" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" ``` -------------------------------- ### Example API Response Source: https://voyager.online/docs/api/message/get-by-hash This is an example of the JSON response structure you can expect when retrieving message details. ```json { "metadata": { "hash": "0xfccbe5f6486f30a8da921c94bd3f9b847c58306439235504f5bbf935d5643886", "count": 4, "type": "l2l1", "from_address": "0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82", "to_address": "0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419", "selector": null, "payload": [ "0", "634620463854586859851242826670858498842198099023", "4543560", "35000000000000000000", "0" ], "l1ContractAlias": "L1 StarkGate: ETH Bridge", "l2ContractAlias": "StarkGate: ETH Bridge", "metaInfo": [ { "timestamp": 1744696813, "txHash": "0x3254fb74139e2097351ea3b31cb4e0c7e7e0d1605bcf4b7274aa1a565ce10cd", "blockHash": "0x32c315cba601b0cf81675642b0b673d98c8d6d3d62c2cd014d701cd47216dc6", "status": "sent" }, { "timestamp": 1750542105, "txHash": "0x25f5a6d626efc443ca290c6853bba69806c1b772d5f9619a30695f30754f96", "blockHash": "0x3d7f87d70ff4fcbe793352e3b6dd119c86b8cc5e3b29bef519b2f1d2465ecfc", "status": "sent" } ], "displayInfo": [ { "status": "sent" }, { "status": "consumed" } ], "l1_transaction_hash": null }, "l1l2": null, "l2l1": { "hash": "0xfccbe5f6486f30a8da921c94bd3f9b847c58306439235504f5bbf935d5643886", "from_address": "0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82", "to_address": "0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419", "payload": [ "0", "634620463854586859851242826670858498842198099023", "4543560", "35000000000000000000", "0" ] } } ``` -------------------------------- ### Example Success Response Source: https://voyager.online/docs/api/nfts/post-metadata-update This is a sample successful response indicating that the metadata update request has been successfully queued. ```json { "success": true } ``` -------------------------------- ### Example Response - Structured Metric (account_contracts) Source: https://voyager.online/docs/api/daily-stats/historical This JSON structure shows an example response for a structured metric like 'account_contracts'. It breaks down the values by wallet type for both daily and cumulative counts. ```json { "items": [ { "date": "2025-10-03", "value": 3436, "argentx_value": 2872, "braavos_value": 29, "okx_value": 27, "cartridge_value": 70, "xverse_value": 0, "cex_value": 54, "others_value": 384, "commulative_value": 5905805, "argentx_commulative_value": 3220775 } ] } ``` -------------------------------- ### Example Bad Request Response Source: https://voyager.online/docs/api/classes/get-verified This is an example of an error response for a 400 Bad Request, indicating an invalid page number was provided. ```json { "error": "Invalid page number" } ``` -------------------------------- ### Example API Response (JSON) Source: https://voyager.online/docs/api/getting-started Illustrates the structure of a successful API response, including an array of data items and pagination metadata. ```json { "items": [ { "blockNumber": 123456, "blockHash": "0x...", "timestamp": 1640995200 } ], "lastPage": 1000 } ``` -------------------------------- ### Get Event Activities Source: https://voyager.online/docs/api/activities/get-activities Lists event activities with filtering options. For contract-specific transfers, use the Get Contract Transfers endpoint. ```APIDOC ## GET /event-activity ### Description Lists event activities such as token transfers with detailed filtering options. For contract-specific transfers, see Get Contract Transfers. ### Method GET ### Endpoint /event-activity ### Query Parameters #### Query Parameters - **token_type** (string) - No - Token standards filter (e.g., "erc20", "erc721", "erc1155") - **from_block** (integer) - No - Starting block number for the query - **to_block** (integer) - No - Ending block number for the query - **from_timestamp** (integer) - No - Lower time boundary (seconds since Unix epoch) - **to_timestamp** (integer) - No - Upper time boundary (seconds since Unix epoch) - **from_address** (string) - No - Address sending tokens - **to_address** (string) - No - Address receiving tokens - **sort** (string) - No - Order of results ("asc" or "desc") - **page_size** (integer) - No - Number of items per page - **last_id** (string) - No - ID of the last transfer for pagination ### Request Example ```javascript // Using fetch const response = await fetch('https://api.voyager.online/beta/event-activity?token_type=erc20&page_size=10&sort=desc', { method: 'GET', headers: { 'x-api-key': 'your_api_key_here', 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data); ``` ### Response #### Success Response (200) - **hasMore** (boolean) - Indicates if there are more results available. - **items** (array) - An array of event activity objects. - **blockHash** (string) - The hash of the block. - **blockNumber** (integer) - The number of the block. - **timestamp** (integer) - The Unix timestamp of the event. - **tokenAddress** (string) - The address of the token. - **tokenName** (string) - The name of the token. - **tokenSymbol** (string) - The symbol of the token. - **tokenDecimals** (string) - The number of decimals for the token. - **txHash** (string) - The hash of the transaction. - **callName** (string) - The name of the call that triggered the event. - **invocationType** (string) - The type of invocation. - **eventId** (string) - The unique ID of the event. - **data** (array) - Raw event data. - **keys** (array) - Event keys. - **id** (string) - The unique identifier for the activity. - **transferFrom** (string) - The address from which the token was transferred. - **transferTo** (string) - The address to which the token was transferred. - **transferDataLen** (integer) - The length of the transfer data. - **transferValues** (array) - The values transferred. - **selector** (string) - The event selector. - **name** (string) - The name of the event. - **nestedName** (string) - The nested name of the event. - **nestedEventNames** (array) - Nested event names. - **dataDecoded** (array) - Decoded event data. - **name** (string) - The name of the decoded data field. - **value** (string) - The value of the decoded data field. - **type** (string) - The type of the decoded data field. - **keyDecoded** (array) - Decoded event keys. - **fromAlias** (string) - Alias for the 'from' address. - **toAlias** (string) - Alias for the 'to' address. - **abiVerified** (boolean) - Indicates if the ABI was verified. #### Response Example ```json { "hasMore": false, "items": [ { "blockHash": "0x61a4a7b548fde072087b1544d9307a2e00fdd604218fcb1c579468192bffe86", "blockNumber": 192179, "timestamp": 1726677511, "tokenAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "tokenName": "Ether", "tokenSymbol": "ETH", "tokenDecimals": "0x12", "txHash": "0x21bd605123b087472e0a3217f622b864e46c8caadd5f5ac4899520e641efa60", "callName": "transfer", "invocationType": "FEE_TRANSFER", "eventId": "192179_0_1", "data": [ "0x2dc3f265d7e99089460a98721b1dec131147402b6ce0a64487238f96872b649", "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2c7c67f30f79", "0x0" ], "keys": [ "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9" ], "id": "32894032", "transferFrom": "0x02dc3f265d7e99089460a98721b1dec131147402b6ce0a64487238f96872b649", "transferTo": "0x01176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "transferDataLen": 1, "transferValues": [ "48912831549305" ], "selector": "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9", "name": "Transfer", "nestedName": "Transfer", "nestedEventNames": [], "dataDecoded": [ { "name": "from", "value": "0x2dc3f265d7e99089460a98721b1dec131147402b6ce0a64487238f96872b649", "type": "core::starknet::contract_address::ContractAddress" }, { "name": "to", "value": "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "type": "core::starknet::contract_address::ContractAddress" }, { "name": "value", "value": "0x2c7c67f30f79", "type": "core::integer::u256" } ], "keyDecoded": [], "fromAlias": null, "toAlias": null, "abiVerified": false } ] } ```