### Prometheus Docker Compose Setup (Shell) Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework Command to start Prometheus locally using Docker Compose for collecting Vixen metrics. This assumes a docker-compose.yml file is present for Prometheus setup. ```shell sudo docker-compose up ``` -------------------------------- ### Monad WebSocket Subscription Example Source: https://docs.triton.one/chains/monad This snippet shows how to subscribe to Monad's WebSocket API for new block heads using the `wscat` utility. It includes commands for installing the necessary tool and initiating the subscription. Replace with your Monad WebSocket endpoint. ```bash sudo apt update sudo apt install node-ws ``` ```bash wscat -c wss:// Connected (press CTRL+C to quit) > { "id": 1, "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newHeads"] } ``` -------------------------------- ### Initialize Yellowstone gRPC Client in NodeJS/TypeScript Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions This example demonstrates how to install and initialize the @triton-one/yellowstone-grpc client library in a NodeJS or TypeScript project. It shows the npm/yarn installation command and a basic code snippet for creating a client instance and fetching the version information. All client calls are asynchronous. ```bash npm install --save @triton-one/yellowstone-grpc # or, for yarn: yarn add @triton-one/yellowstone-grpc ``` ```javascript import Client from "@triton-one/yellowstone-grpc"; const client = new Client("https://api.rpcpool.com:443", ""); // now you can call the client methods, e.g.: const version = await client.getVersion(); // gets the version information console.log(version); ``` -------------------------------- ### Quick Start: Vixen Token Program Logging Pipeline (Rust) Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework A minimal example demonstrating how to set up a Vixen pipeline to listen to Token Program updates and log parsed account and instruction data. It utilizes Yellowstone Vixen's `Pipeline`, `YellowstoneGrpcSource`, and specific `AccountParser` and `InstructionParser` from the `token_program` crate. The `Logger` handler is a custom implementation for logging. ```rust use yellowstone_vixen::Pipeline; use yellowstone_vixen_parser::token_program::{AccountParser, InstructionParser}; use yellowstone_vixen_yellowstone_grpc_source::YellowstoneGrpcSource; #[derive(Debug)] pub struct Logger; impl vixen::Handler for Logger { async fn handle(&self, value: &V) -> vixen::HandlerResult<()> { tracing::info!(?value); Ok(()) } } fn main() { // Set up logging and config parsing ... yellowstone_vixen::Runtime::builder() .source(YellowstoneGrpcSource::new()) .account(Pipeline::new(AccountParser, [Logger])) .instruction(Pipeline::new(InstructionParser, [Logger])) .metrics(yellowstone_vixen::metrics::Prometheus) .commitment_level(yellowstone_vixen::CommitmentLevel::Confirmed) .build(config) .run(); } ``` -------------------------------- ### Install Codama Vixen Parser Renderer Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework/generate-parsers-with-codama Installs the necessary Codama package for rendering Vixen parsers. This package contains the core logic for generating the parser code. ```bash pnpm install @codama/renderers-vixen-parser ``` -------------------------------- ### Install Codama Dependencies for Parser Generation Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework/generate-parsers-with-codama Installs additional Codama packages required for the parser generation script. These include nodes, anchor integration, and core rendering/visitor utilities. ```bash pnpm install \ @codama/nodes \ @codama/nodes-from-anchor \ @codama/renderers-core \ @codama/visitors-core ``` -------------------------------- ### Geyser Subscribe (client-ubuntu Example) Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions Example usage of the `client-ubuntu` binary for subscribing to Geyser data streams, including options for subscribing to all accounts, specific programs, and enabling statistics. ```APIDOC ## POST /geyser/Subscribe (client-ubuntu) ### Description Uses the `client-ubuntu` binary to subscribe to Geyser data streams. Supports subscribing to all accounts, specific programs by owner, and includes an option for statistics. ### Method POST ### Endpoint `./client-ubuntu-22.04 --endpoint https:// --x-token subscribe ...` ### Parameters #### Command Line Arguments - **--endpoint** (string) - Required - The Geyser API endpoint URL. - **--x-token** (string) - Required - Your authentication token. - **subscribe** (command) - Required - Initiates a subscription. - **--accounts** (flag) - Optional - Subscribe to all account updates. - **--slots** (flag) - Optional - Subscribe to slot notifications. - **--accounts-owner** (string) - Optional - Subscribe to accounts owned by a specific program ID. - **--stats** (flag) - Optional - Display subscription statistics (bandwidth, data counts). ### Request Example ```bash ./client-ubuntu-22.04 --endpoint https:// --x-token subscribe --accounts --slots ``` ### Request Example (Specific Program) ```bash ./client-ubuntu-22.04 --endpoint https:// --x-token subscribe --accounts --slots --accounts-owner 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 ``` ### Response #### Success Response (200) - **stream** (stream) - A stream of data objects corresponding to the requested subscription types. #### Response Example (Response is a stream of data, example depends on subscription type) ``` -------------------------------- ### Install Triton One Vixen Stream TypeScript SDK Source: https://docs.triton.one/project-yellowstone/program-data-streams Installs the Triton One Vixen Stream TypeScript SDK using npm. This SDK provides a simple and secure way to interact with the Program Data Streams. ```bash npm install @triton-one/vixen-stream ``` -------------------------------- ### Get Asset Proof Request (JSON) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-asset-proof Demonstrates the JSON-RPC request structure for the getAssetProof method. It requires the unique identifier of the compressed asset to fetch its proof path. ```json { "jsonrpc": "2.0", "id": "123", "method": "getAssetProof", "params": { "id": "EZsmgudhX6EFVfrdxmShDiNj365E85x7kpLJCVvPLVSH" } } ``` -------------------------------- ### Geyser Subscribe (grpcurl Example) Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions Example of subscribing to various data streams using the grpcurl client. This demonstrates how to specify subscription types (slots, accounts, transactions, blocks) and authentication. ```APIDOC ## POST /geyser/Subscribe ### Description Subscribes to real-time data streams from the Geyser interface, including account updates, transactions, and block notifications. ### Method POST ### Endpoint `api.rpcpool.com:443/geyser/Subscribe` ### Parameters #### Headers - **x-token** (string) - Required - Your authentication token. #### Request Body - **slots** (object) - Optional - Subscribe to slot notifications. - **accounts** (object) - Optional - Subscribe to account updates. Can specify specific accounts or programs. - **usdc** (object) - Example for a specific account. - **account** (array of strings) - Array of account addresses. - **transactions** (object) - Optional - Subscribe to transaction streams. - **blocks** (object) - Optional - Subscribe to block notifications. - **blocks_meta** (object) - Optional - Subscribe to block metadata notifications. ### Request Example ```json { "slots": {}, "accounts": { "usdc": { "account": ["9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT"] } }, "transactions": {}, "blocks": {}, "blocks_meta": {} } ``` ### Response #### Success Response (200) - **stream** (stream) - A stream of data objects corresponding to the requested subscription types. #### Response Example (Response is a stream of data, example depends on subscription type) ``` -------------------------------- ### Get NFT Editions Request (JSON) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-nft-editions Example JSON payload for the 'getNftEditions' method. It includes the master edition's mint address and pagination parameters like page and limit. ```json { "id": "123", "jsonrpc": "2.0", "method": "getNftEditions", "params": { "mintAddress": "BUaiggSfm81ZRAeW572dNf1BhXCzZxaWrGNRm5PjSQzY", "page": 1, "limit": 100 } } ``` -------------------------------- ### Get Token Accounts Request (JSON-RPC) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-token-accounts Example JSON-RPC request to retrieve token accounts. Requires either a mintAddress or ownerAddress. Supports pagination parameters like page, limit, cursor, before, and after. ```json { "id": "123", "jsonrpc": "2.0", "method": "getTokenAccounts", "params": { "mintAddress": "BUaiggSfm81ZRAeW572dNf1BhXCzZxaWrGNRm5PjSQzY", "ownerAddress": "BiKcVb6t6YDZczYjWLjXKwdgAUecdQrp1EJXAfRmu3VR", "page": 1, "limit": 100 } } ``` -------------------------------- ### Get NFT Editions Response (JSON) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-nft-editions Example successful JSON response for the 'getNftEditions' method. It contains details about the NFT editions, including total supply, master edition address, and pagination information. ```json { "jsonrpc": "2.0", "result": { "total": 0, "limit": 100, "master_edition_address": "4faJkL1F5yLKTf9DSgqBmp2DJeUKk9fyfZzMKM1nMbzD", "supply": 0, "max_supply": 0, "page": 1 }, "id": "123" } ``` -------------------------------- ### Initialize JavaScript Project with pnpm Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework/generate-parsers-with-codama Initializes a new JavaScript project using pnpm. This is a prerequisite for installing Codama packages and running the generation script. ```bash pnpm init ``` -------------------------------- ### DAS API Request: Get Assets By Authority (JSON) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-assets-by-authority Example JSON payload for the 'getAssetsByAuthority' method in the DAS API. This request fetches assets for a given authority address, with specified sorting, limit, and pagination parameters. ```json { "jsonrpc": "2.0", "id": "123", "method": "getAssetsByAuthority", "params": [ "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", { "sortBy": "created", "sortDirection": "desc" }, 50, 1, null, null ] } ``` -------------------------------- ### Photon API Methods Source: https://docs.triton.one/chains/solana/photon/api-methods This section details the various ZK Compression methods provided by the Photon API, extending the standard Solana JSON RPC API. ```APIDOC ## Photon API Methods ### Description Provides ZK Compression methods that extend the default Solana JSON RPC API. ### Methods - **getCompressedAccount** - **Description**: Retrieve a compressed account by its address or hash. - **Method**: POST (Assumed, as JSON RPC methods typically use POST) - **Endpoint**: `/` (Assumed, standard for JSON RPC) - **getCompressedBalance** - **Description**: Retrieve the balance of a compressed account. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedTokenAccountBalance** - **Description**: Retrieve the balance of a compressed token account. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedBalanceByOwner** - **Description**: Retrieve the balance of all compressed accounts owned by a specific address. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedMintTokenHolders** - **Description**: Retrieve the owner balances of compressed mint, descending order. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedTokenBalancesByOwnerV2** - **Description**: Retrieve the balance of all compressed accounts owned by a specific address, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedAccountsByOwner** - **Description**: Retrieve all owner's compressed accounts, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getMultipleCompressedAccounts** - **Description**: Retrieve multiple compressed accounts by their addresses or hashes. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedTokenAccountsByDelegate** - **Description**: Retrieve all compressed token accounts delegated fully or partially to a specific address, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getTransactionWithCompressionInfo** - **Description**: Retrieve transaction details along with compression information. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressedAccountProof** - **Description**: Retrieve the proof that compression program uses to verify validity of account. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getMultipleCompressedAccountProofs** - **Description**: Retrieve proofs for multiple compressed accounts. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getMultipleNewAddressProofs** - **Description**: Retrieve proofs that the new addresses are not taken already and can be created. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getValidityProof** - **Description**: Retrieve a single ZK Proof that is used by the compression program to check if the account is valid and new addresses can be created. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressionSignaturesForAccount** - **Description**: Retrieve signatures of the transaction that opened or closed a compressed account for a specific hash, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressionSignaturesForAddress** - **Description**: Retrieve signatures of the transaction that opened or closed a compressed account for a specific address, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressionSignaturesForOwner** - **Description**: Retrieve signatures of the transaction that modified a compressed account of a specific owner, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getCompressionSignaturesForTokenOwner** - **Description**: Retrieve signatures of the transaction that modified a compressed token account of a specific owner, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getLatestCompressionSignatures** - **Description**: Retrieve signatures of the latest transactions, paginated. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getLatestNonVotingSignatures** - **Description**: Retrieve signatures of the latest non-voting transactions. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getIndexerSlot** - **Description**: Retrieve slot number of latest indexed block by the indexer. - **Method**: POST (Assumed) - **Endpoint**: `/ - **getIndexerHealth** - **Description**: Retrieve the status of the indexer, `ok` if indexer is not stale. - **Method**: POST (Assumed) - **Endpoint**: `/ ### Note Detailed documentation for Photon API methods can be found in the [ZK Compression JSON RPC Methods](https://www.zkcompression.com/developers/json-rpc-methods). ``` -------------------------------- ### Get Token Accounts Response (JSON-RPC) Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-token-accounts Example successful JSON-RPC response for getTokenAccounts. It includes pagination details (total, limit, page) and a list of token accounts, each with its address, mint, amount, owner, and other relevant information. ```json { "jsonrpc": "2.0", "result": { "total": 1, "limit": 100, "page": 1, "token_accounts": [ { "address": "EFaMF6bbRnTwDFUZt9FiTjF8hj6w65kLW43YyhyM85HJ", "mint": "BUaiggSfm81ZRAeW572dNf1BhXCzZxaWrGNRm5PjSQzY", "amount": 1, "owner": "BiKcVb6t6YDZczYjWLjXKwdgAUecdQrp1EJXAfRmu3VR", "frozen": true, "delegate": null, "delegated_amount": 0, "close_authority": null, "extensions": null } ] }, "id": "123" } ``` -------------------------------- ### Get Metis Swap API Quote - Bash Example Source: https://docs.triton.one/trading-apis/metis-swap-api This bash script demonstrates how to request a swap quote from the Metis Swap API. It requires your private token and specifies input/output tokens, the amount to swap, and slippage tolerance. ```bash curl 'https://endpoint.rpcpool.com/private_token/metis/quote?\ inputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&\ outputMint=So11111111111111111111111111111111111111112&\ amount=1000000&\ slippageBps=50' ``` -------------------------------- ### POST /simulateBundle Source: https://docs.triton.one/trading-apis/bundle-simulation-with-jito Simulates a transaction bundle using Jito RPC. This method allows for the testing of multiple transactions grouped together before sending them to the network. ```APIDOC ## POST /simulateBundle ### Description Simulates a transaction bundle. This endpoint is exclusive to Jito RPC and requires a connection to the Jito Block Engine. ### Method POST ### Endpoint `https://xyz.mainnet.rpcpool.com/` ### Parameters #### Request Body - **transactions** (Vector) - Required - List of transactions to simulate. - **config** (Object) - Optional - Configuration object of type `RpcSimulateBundleConfig` for transaction simulation. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "simulateBundle", "params": [ [ "tx1_base64", "tx2_base64" ], { "skip_sig_verify": true } ] } ``` ### Response #### Success Response (200) - **summary** (Object) - An object detailing the simulation outcome (`RpcBundleSimulationSummary`). - **transaction_results** (Array) - An array of objects detailing the results for each transaction in the bundle (`RpcSimulateBundleTransactionResult`). #### Response Example ```json { "jsonrpc": "2.0", "result": { "summary": { "Succeeded": null }, "transaction_results": [ { "err": null, "logs": [], "pre_execution_accounts": null, "post_execution_accounts": null, "units_consumed": 1000, "return_data": null } ] }, "id": 1 } ``` ### Error Handling - **RpcBundleExecutionError**: Various error types can be returned, such as `BankProcessingTimeLimitReached`, `BundleLockError`, `BundleExecutionTimeout`, `ExceedsCostModel`, `InvalidPreOrPostAccounts`, `PohRecordError`, `TipError`, or `TransactionFailure`. ### Configuration Details (RpcSimulateBundleConfig) - **pre_execution_accounts_configs** (Array>) - Optional - Configuration for accounts before transaction execution. Each element corresponds to a transaction. - **post_execution_accounts_configs** (Array>) - Optional - Configuration for accounts after transaction execution. Each element corresponds to a transaction. - **transaction_encoding** (String) - Optional - Encoding scheme of the transactions. - **simulation_bank** (Object) - Optional - Specifies the bank to run the simulation against (`SimulationSlotConfig`). - **skip_sig_verify** (Boolean) - Optional - Set to `true` to skip signature verification for faster performance. Defaults to `false`. - **replace_recent_blockhash** (Boolean) - Optional - Set to `true` to simulate old transactions without resigning. Defaults to `false`. ``` -------------------------------- ### Account Response Structure (JSON) Source: https://docs.triton.one/account-management/api-access/accounts Example JSON structure for a single account object, detailing fields like UUID, name, billing information, and subscription counts. This structure is returned by both the 'List Accounts' and 'Get Account' API endpoints. ```json { "account": { "uuid": "c92a9cea-47cc-494b-b1b0-4230a2316ee5", "name": "John Doe", "billing_address1": "1645 S Telegraph Rd", "billing_address2": null, "billing_address3": null, "billing_city": "Bloomfield Hills", "billing_state_or_province": "Michigan", "billing_postal_code": "48302", "billing_country_code": "US", "telephone_country_code": "US", "telephone": "(248) 858-2300", "last_time_activated":"28/06/2023", "is_active": true, "created_at": "2023-06-22T09:11:11Z", "updated_at": "2023-06-28T11:26:52Z", "users_count": 1, "tokens_count": 6, "endpoints_count": 4, "subscriptions_count": 2, "is_helio_pay_stream_active": true, "pay_stream_id": "639cbc90a989eacb2574a055", "metrics_enabled": false, "payment_method": "manual", "maximum_tokens": -1, "address_watch_lists": false, "allow_ip_ranges": false, "subscriptions": [ { "uuid": "74ea9d9a-4b2a-4f01-af47-1c175f8a2af6", "name": "Mainnet Shared Subscription", "account_uuid": "c92a9cea-47cc-494b-b1b0-4230a2316ee5", "subscription_type": "mainnet-shared", "starts_at": null, "ends_at": null, "is_active": true, "endpoints_count": 2, "tokens_count": 4, "supported_rate_tiers": [ { "uuid": "ca141949-a46f-446a-abee-a031e501fea0", "name": "developer", "active_tokens_count": 5, "active_endpoints_count": 4, "supported_subscription_type_uuids": [ "413defdd-b011-4dda-8145-fa782524284c" ] } ] } ], "deactivation_reasons": [ { "description": "Deactivation reason description", "created_at": "2023-06-26T20:16:05Z" } ] } } ``` -------------------------------- ### Subscribe to Solana Data using client-ubuntu Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions This example shows how to subscribe to Solana data streams using the `client-ubuntu` binary provided by the yellowstone-grpc project. It supports subscribing to all accounts and slots, or filtering by a specific program owner. The `--stats` flag can be added to view subscription statistics. ```shell ./client-ubuntu-22.04 --endpoint https:// --x-token subscribe --accounts --slots ``` ```shell ./client-ubuntu-22.04 --endpoint https:// --x-token subscribe --accounts --slots --accounts-owner 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 ``` -------------------------------- ### Running Vixen with Token Program Logging (Shell) Source: https://docs.triton.one/project-yellowstone/vixen-parsing-framework Command to run the Vixen application with the Token Program logging pipeline. It sets the RUST_LOG environment variable to 'info' for logging and specifies the configuration file path. ```shell RUST_LOG=info cargo run -- --config ./Vixen.toml ``` -------------------------------- ### Subscribe to Account with Data Slice (gRPC and NodeJS) Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions Shows how to subscribe to an account and retrieve only a specific portion of its data using `accounts_data_slice`. This example targets USDC Tokenkeg accounts and retrieves 40 bytes of data starting from offset 32. ```json { "accounts": { "usdc": { "owner": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "filters": [{ "token_account_state": true }, { "memcmp": { "offset": 0, "data": { "base58": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }] } }, "accounts_data_slice": [{ "offset": 32, "length": 40 }] } ``` ```javascript import { CommitmentLevel } from "@triton-one/yellowstone-grpc"; const request = { "slots": {}, "accounts": { "usdc": { "owner": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "filters": [{ "tokenAccountState": true }, { "memcmp": { "offset": 0, "data": { "base58": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }] } }, "transactions": {}, "blocks": {}, "blocksMeta": {}, "entry": {}, "commitment": CommitmentLevel.CONFIRMED "accountsDataSlice": [{ "offset": 32, "length": 40 }] }; ``` -------------------------------- ### Metis Swap API Execution Flow - Bash Example Source: https://docs.triton.one/trading-apis/metis-swap-api This bash script illustrates the two-step process for executing a swap using the Metis Swap API. First, it retrieves a quote, and then it indicates where to use the quote response to execute the actual swap. ```bash # Step 1: Get a quote curl 'https://endpoint.rpcpool.com/private_token/metis/quote?inputMint=...&outputMint=...&amount=...' # Step 2: Use the quote response to execute the swap # (See full documentation for swap endpoint details) ``` -------------------------------- ### GET /v1/assets/authority/{authorityAddress} Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-assets-by-authority Fetches assets by authority address. Supports sorting, pagination, and filtering by before/after IDs. ```APIDOC ## GET /v1/assets/authority/{authorityAddress} ### Description Fetches all assets belonging to a specific authority. This endpoint supports paged responses to efficiently handle large numbers of records. ### Method GET ### Endpoint /v1/assets/authority/{authorityAddress} ### Parameters #### Path Parameters - **authorityAddress** (string) - Required - The public key address of the asset authority. #### Query Parameters - **sortBy** (string) - Optional - The sorting criteria. Can be "created", "updated", "recentAction", or "none". - **sortDirection** (string) - Optional - The direction of sorting. Can be "asc" or "desc". - **limit** (integer) - Optional - The maximum number of assets to retrieve per page. Defaults to 50. - **page** (integer) - Optional - The index of the page to retrieve. Defaults to 1. - **before** (string) - Optional - Fetch assets created before the specified asset ID. - **after** (string) - Optional - Fetch assets created after the specified asset ID. ### Request Example ```bash GET /v1/assets/authority/3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA?sortBy=created&sortDirection=desc&limit=50&page=1 ``` ### Response #### Success Response (200) - **result** (array) - An array of asset objects. - **id** (string) - The unique identifier of the asset. - **authority** (string) - The authority address of the asset. - **name** (string) - The name of the asset. - **symbol** (string) - The symbol of the asset. - **uri** (string) - The URI pointing to the asset's metadata. - **supply** (integer) - The supply of the asset. - **royalties** (object) - Royalty information for the asset. - **createdAt** (string) - Timestamp when the asset was created. - **updatedAt** (string) - Timestamp when the asset was last updated. #### Response Example ```json { "result": [ { "id": "assetId1", "authority": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", "name": "Example Asset 1", "symbol": "EXA1", "uri": "https://example.com/metadata/1.json", "supply": 1000, "royalties": { "share": 500, "address": "royaltyAddress1" }, "createdAt": "2023-01-01T12:00:00Z", "updatedAt": "2023-01-01T12:00:00Z" } ], "total": 100, "page": 1, "limit": 50 } ``` ``` -------------------------------- ### Get Asset Proofs Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-asset-proofs Fetches Merkle proofs for compressed assets based on a provided list of asset IDs. ```APIDOC ## POST /getAssetProofs ### Description Get merkle proofs for compressed assets by their IDs. ### Method POST ### Endpoint /getAssetProofs ### Parameters #### Query Parameters - **ids** (array[string]) - Required - A set of asset IDs used to retrieve proofs. ### Request Example ```json { "jsonrpc": "2.0", "id": "123", "method": "getAssetProofs", "params": { "ids": [ "EZsmgudhX6EFVfrdxmShDiNj365E85x7kpLJCVvPLVSH", "Hhxb7pNvwi76WTSqFjMX5yXjSso1S3agEJ9kQZP9NQeJ" ] } } ``` ### Response #### Success Response (200) - **result** (object) - Contains the Merkle proofs for the requested assets. - **proofs** (array[object]) - An array of proof objects. - **asset_id** (string) - The ID of the asset. - **merkle_tree** (string) - The Merkle tree data. - **proof** (array[string]) - The Merkle proof path. - **id** (string) - The ID of the request. - **jsonrpc** (string) - The JSON-RPC version. #### Response Example ```json { "jsonrpc": "2.0", "result": { "proofs": [ { "asset_id": "EZsmgudhX6EFVfrdxmShDiNj365E85x7kpLJCVvPLVSH", "merkle_tree": "...", "proof": [ "..." ] } ] }, "id": "123" } ``` ``` -------------------------------- ### Install and Build Shield CLI Source: https://docs.triton.one/project-yellowstone/shield-transaction-policies This bash script demonstrates the steps to clone the Yellowstone Shield repository, navigate into the directory, and build the release version of the Shield CLI tool. This is a prerequisite for creating custom Shield policies. ```bash git clone https://github.com/rpcpool/yellowstone-shield cd yellowstone-shield cargo build --release --bin yellowstone-shield-cli ``` -------------------------------- ### Get Asset Proofs API Source: https://docs.triton.one/digital-assets-api Retrieves proofs for multiple digital assets. ```APIDOC ## GET /digital-assets-api/metaplex-digital-assets-api/get-asset-proofs.md ### Description Retrieves proofs for multiple digital assets. ### Method GET ### Endpoint /digital-assets-api/metaplex-digital-assets-api/get-asset-proofs.md ### Parameters #### Query Parameters - **assetIds** (array) - Required - A list of unique identifiers for the assets. ### Response #### Success Response (200) - **proofs** (object) - An object mapping asset IDs to their proofs. #### Response Example ```json { "proofs": { "asset_id_1": "proof_data_1", "asset_id_2": "proof_data_2" } } ``` ``` -------------------------------- ### Get Token Largest Accounts Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-token-largest-accounts Retrieve the 20 largest token accounts for a specific SPL Token. ```APIDOC ## POST /websites/triton_one/getTokenLargestAccounts ### Description Retrieve the 20 largest token accounts for a specific SPL Token. ### Method POST ### Endpoint /websites/triton_one ### Parameters #### Query Parameters - **pubkey** (string) - Required - The unique identifier of the token to retrieve. - **commitment** (string) - Optional - Commitment level for the query. ### Request Example ```json { "jsonrpc": "2.0", "id": "123", "method": "getTokenLargestAccounts", "params": [ "jovWMTogqDpoEWUSFSns2Y9rkJkfJHsTgPWJgzCjwCF", { "commitment": "confirmed" } ] } ``` ### Response #### Success Response (200) - **value** (array) - An array of the largest token accounts. - **address** (string) - The account address. - **amount** (string) - The token amount. - **uiAmount** (number) - The token amount in UI representation. - **decimals** (number) - The number of decimals for the token. - **context** (object) - The context of the response. - **apiVersion** (string) - The API version. - **slot** (number) - The slot number. #### Response Example ```json { "jsonrpc": "2.0", "result": { "value": [ { "address": "6U59Z2hXfM6uQhS214742rW7W8s1rW8s1rW8s1rW8s1", "amount": "1000000000000000000", "uiAmount": 1000000000, "decimals": 9 } ], "context": { "apiVersion": "1.17.0", "slot": 184888370 } }, "id": "123" } ``` ``` -------------------------------- ### Bundle Simulation Configuration (Rust) Source: https://docs.triton.one/trading-apis/bundle-simulation-with-jito Defines the configuration options for simulating a transaction bundle via Jito RPC. This Rust struct allows customization of account states, transaction encoding, simulation bank, and signature verification. ```rust pub struct RpcSimulateBundleConfig { /// Gives the state of accounts pre/post transaction execution. /// The length of each of these must be equal to the number transactions. pub pre_execution_accounts_configs: Vec>, pub post_execution_accounts_configs: Vec>, /// Specifies the encoding scheme of the contained transactions. pub transaction_encoding: Option, /// Specifies the bank to run simulation against. pub simulation_bank: Option, /// Opt to skip sig-verify for faster performance. #[serde(default)] pub skip_sig_verify: bool, /// Replace recent blockhash to simulate old transactions without resigning. #[serde(default)] pub replace_recent_blockhash: bool, } pub struct RpcSimulateTransactionAccountsConfig { pub encoding: Option, pub addresses: Vec, } pub enum SimulationSlotConfig { /// Simulate on top of bank with the provided commitment. Commitment(CommitmentConfig), /// Simulate on the provided slot's bank. Slot(Slot), /// Simulates on top of the RPC's highest slot's bank i.e. the working bank. Tip, } ``` -------------------------------- ### Get Assets By Owner Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-assets-by-owner Fetches a list of assets owned by a specified address. Supports sorting, pagination, and filtering by asset ID. ```APIDOC ## GET /assets/owner ### Description Retrieves a list of assets owned by a specific address. This method is an efficient way to access and retrieve assets associated with an owner, useful for displaying collections or managing ownership. ### Method GET ### Endpoint /assets/owner ### Parameters #### Query Parameters - **ownerAddress** (string) - Required - The public key of the asset owner. - **sortBy** (string) - Optional - The criteria for sorting assets. Possible values: "created", "updated", "recentAction", "none". - **sortDirection** (string) - Optional - The direction for sorting. Possible values: "asc", "desc". - **limit** (integer) - Optional - The maximum number of assets to retrieve per page. - **page** (integer) - Optional - The page number to retrieve. - **before** (string) - Optional - Fetch assets created before the specified asset ID. - **after** (string) - Optional - Fetch assets created after the specified asset ID. ### Request Example ``` GET /assets/owner?ownerAddress=9kPPbeBAvCtJCZ98EFKabxp7wTeFQRseCYDRdovyfUfz&sortBy=created&sortDirection=desc&limit=50 ``` ### Response #### Success Response (200) - **total** (integer) - The total number of assets owned by the address. - **limit** (integer) - The limit set for the current request. - **page** (integer) - The current page number. - **cursor** (string) - A cursor for fetching the next page of results. - **items** (array) - An array of asset objects. - **id** (string) - The unique identifier of the asset. - **content** (object) - Contains details about the asset's content. - **authorities** (array) - List of authorities for the asset. - **ownership** (object) - Information about the asset's ownership. - **group** (object) - Information about the asset's group, if any. #### Response Example ```json { "total": 150, "limit": 50, "page": 1, "cursor": "some_cursor_string", "items": [ { "id": "asset_id_1", "content": { "metadata": { "name": "Example NFT" } }, "ownership": { "owner": "9kPPbeBAvCtJCZ98EFKabxp7wTeFQRseCYDRdovyfUfz" } } // ... more assets ] } ``` ``` -------------------------------- ### Get Assets By Group Source: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-assets-by-group Fetches assets associated with a specified group key and value. Supports sorting and pagination parameters. ```APIDOC ## POST /getAssetsByGroup ### Description Retrieves a list of assets that belong to a specific group, identified by a group key and value. This is useful for fetching all NFTs within a collection, for example. ### Method POST ### Endpoint /getAssetsByGroup ### Parameters #### Query Parameters - **groupKey** (string) - Required - The key of the group (e.g., "collection"). - **groupValue** (string) - Required - The value of the group. - **sortBy** (object) - Optional - Sorting criteria. Specified as `{ sortBy: , sortDirection: }`, where `sortBy` is one of `["created", "updated", "recentAction", "none"]` and `sortDirection` is one of `["asc", "desc"]`. - **page** (integer) - Optional - The index of the "page" to retrieve. - **limit** (integer) - Optional - The maximum number of assets to return per page. Defaults to 50. - **before** (string) - Optional - Fetch assets before the given ID. - **after** (string) - Optional - Fetch assets after the given ID. ### Request Example ```json { "jsonrpc": "2.0", "id": "123", "method": "getAssetsByGroup", "params": { "groupKey": "collection", "groupValue": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac", "page": 1, "limit": 50 } } ``` ### Response #### Success Response (200) - **result** (array) - An array of asset objects. - **id** (string) - The unique identifier of the asset. - **content** (object) - Contains metadata about the asset's content. - **group** (object) - Information about the group the asset belongs to. - **interface** (string) - The interface the asset conforms to. - **name** (string) - The name of the asset. - **owner** (string) - The owner's public key. - **supply** (integer) - The total supply of the asset. - **symbol** (string) - The symbol representing the asset. - ** Telangana** (string) - The Telangana identifier for the asset. - ** Telangana_id** (string) - The Telangana ID of the asset. - ** Telangana_uri** (string) - The URI for the Telangana metadata. - ** Telangana_version** (string) - The version of the Telangana standard. #### Response Example ```json { "jsonrpc": "2.0", "id": "123", "result": [ { "id": "asset_id_1", "content": { "json_uri": "https://example.com/asset1.json", "files": [ { "uri": "https://example.com/asset1.png", "mime": "image/png" } ], "metadata": { "name": "Example NFT 1", "description": "This is the first example NFT.", "symbol": "EX1", "properties": { "files": [ { "uri": "https://example.com/asset1.png", "type": "image/png" } ] } } }, "group": { "group_key": "collection", "group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac" }, "interface": "V1_NFT", "name": "Example NFT 1", "owner": "owner_public_key_1", "supply": 1, "symbol": "EX1", " Telangana": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac", " Telangana_id": "asset_id_1", " Telangana_uri": "https://example.com/asset1.json", " Telangana_version": "1" } // ... more assets ] } ``` ``` -------------------------------- ### Subscribe to Solana Data using grpcurl Source: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions This example demonstrates how to subscribe to various Solana data streams (slots, accounts, transactions, blocks) using the grpcurl command-line tool. It requires the geyser.proto file and specifies an endpoint, token, and the Subscribe RPC method. Adjust the payload to filter specific accounts or data types. ```shell ./grpcurl \ -proto geyser.proto \ -d '{"slots": { "slots": { } }, "accounts": { "usdc": { "account": ["9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT"] } }, "transactions": {}, "blocks": {}, "blocks_meta": {}}' \ -H "x-token: " \ api.rpcpool.com:443 \ geyser.Geyser/Subscribe ```