diff --git a/src/svm/v2/YVMQN27RnCNt23NRxzJPumXRd8iovEfKtzkqyMc5vDt-idl.json b/src/svm/v2/YVMQN27RnCNt23NRxzJPumXRd8iovEfKtzkqyMc5vDt-idl.json new file mode 100644 index 000000000..6043fc8af --- /dev/null +++ b/src/svm/v2/YVMQN27RnCNt23NRxzJPumXRd8iovEfKtzkqyMc5vDt-idl.json @@ -0,0 +1,4024 @@ +{ + "address": "YVMQN27RnCNt23NRxzJPumXRd8iovEfKtzkqyMc5vDt", + "metadata": { + "name": "svm_spoke", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "bridge_tokens_to_hub_pool", + "docs": [ + "Bridges tokens to the Hub Pool.", + "", + "This function initiates the process of sending tokens from the vault to the Hub Pool based on the outstanding", + "token liability this Spoke Pool has accrued. Enables the caller to choose a custom amount to work around CCTP", + "bridging limits. enforces that amount is less than or equal to liability. On execution decrements liability.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the bridge operation.", + "- payer (Signer): The account responsible for paying the transaction fees.", + "- mint (InterfaceAccount): The mint account for the token being bridged.", + "- state (Account): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- transfer_liability (Account): Account tracking the pending amount to be sent to the Hub Pool. Incremented on", + "relayRootBundle() and decremented on when this function is called. Seed: [\"transfer_liability\",mint].", + "- vault (InterfaceAccount): The ATA for the token being bridged. Authority must be the state.", + "- token_messenger_minter_sender_authority (UncheckedAccount): Authority for the token messenger minter.", + "- message_transmitter (UncheckedAccount): Account for the message transmitter.", + "- token_messenger (UncheckedAccount): Account for the token messenger.", + "- remote_token_messenger (UncheckedAccount): Account for the remote token messenger.", + "- token_minter (UncheckedAccount): Account for the token minter.", + "- local_token (UncheckedAccount): Account for the local token.", + "- cctp_event_authority (UncheckedAccount): Authority for CCTP events.", + "- message_sent_event_data (Signer): Account for message sent event data.", + "- message_transmitter_program (Program): Program for the message transmitter.", + "- token_messenger_minter_program (Program): Program for the token messenger minter.", + "- token_program (Interface): The token program.", + "- system_program (Program): The system program.", + "", + "### Parameters:", + "- amount: The amount of tokens to bridge to the Hub Pool." + ], + "discriminator": [1, 83, 255, 59, 232, 55, 64, 216], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "mint", + "writable": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "transfer_liability", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 97, 110, 115, 102, 101, 114, 95, 108, 105, 97, 98, 105, 108, 105, 116, 121] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "token_messenger_minter_sender_authority" + }, + { + "name": "message_transmitter", + "docs": ["program)."], + "writable": true + }, + { + "name": "token_messenger", + "docs": ["program)."] + }, + { + "name": "remote_token_messenger", + "docs": ["remote_domain.to_string()] (CCTP Token Messenger Minter program)."] + }, + { + "name": "token_minter" + }, + { + "name": "local_token", + "docs": ["program)."], + "writable": true + }, + { + "name": "cctp_event_authority", + "docs": ["program)."] + }, + { + "name": "message_sent_event_data", + "writable": true, + "signer": true + }, + { + "name": "message_transmitter_program", + "address": "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd" + }, + { + "name": "token_messenger_minter_program", + "address": "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3" + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "claim_relayer_refund", + "docs": [ + "Claims a relayer refund for the caller.", + "", + "In the event a relayer refund was sent to a claim account, then this function enables the relayer to claim it by", + "transferring the claim amount from the vault to their token account. The claim account is closed after refund.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the claim.", + "- initializer (UncheckedAccount): Must be the same account that initialized the claim account.", + "- state (Account): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- vault (InterfaceAccount): The ATA for the refunded mint. Authority must be the state.", + "- mint (InterfaceAccount): The mint account for the token being refunded.", + "- token_account (InterfaceAccount): The ATA for the token being refunded to.", + "- claim_account (Account): The claim account PDA. Seed: [\"claim_account\",mint,refund_address].", + "- token_program (Interface): The token program." + ], + "discriminator": [205, 34, 34, 224, 204, 103, 81, 176], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "initializer", + "writable": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "token_account", + "writable": true + }, + { + "name": "claim_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 97, 99, 99, 111, 117, 110, 116] + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "claim_relayer_refund_for", + "docs": [ + "Functionally identical to claim_relayer_refund() except the refund is sent to a specified refund address." + ], + "discriminator": [1, 29, 127, 24, 137, 224, 73, 186], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "initializer", + "writable": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "refund_address" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "claim_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 97, 99, 99, 111, 117, 110, 116] + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "arg", + "path": "refund_address" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "refund_address", + "type": "pubkey" + } + ] + }, + { + "name": "close_claim_account", + "docs": [ + "Closes a claim account for a relayer refund.", + "", + "This function is used to close the claim account associated with a specific mint and refund address,", + "effectively marking the end of its lifecycle. It can only be called once the claim account is empty. It", + "transfers any remaining lamports to the signer and resets the account.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the closure. Must be the initializer of the claim account.", + "- claim_account (Writable): The claim account PDA to be closed. Seed: [\"claim_account\",mint,refund_address].", + "", + "### Parameters:", + "- _mint: The public key of the mint associated with the claim account.", + "- _refund_address: The public key of the refund address associated with the claim account." + ], + "discriminator": [241, 146, 203, 216, 58, 222, 91, 118], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "claim_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 97, 99, 99, 111, 117, 110, 116] + }, + { + "kind": "arg", + "path": "mint" + }, + { + "kind": "arg", + "path": "refund_address" + } + ] + } + } + ], + "args": [ + { + "name": "_mint", + "type": "pubkey" + }, + { + "name": "_refund_address", + "type": "pubkey" + } + ] + }, + { + "name": "close_fill_pda", + "docs": [ + "Closes the FillStatusAccount PDA to reclaim relayer rent.", + "", + "This function is used to close the FillStatusAccount associated with a specific relay hash, effectively marking", + "the end of its lifecycle. This can only be done once the fill deadline has passed. Relayers should do this for", + "all fills once they expire to reclaim their rent.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the closure. Must be the relayer in the fill_status PDA.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- fill_status (Writable): The FillStatusAccount PDA to be closed. Seed: [\"fills\",relay_hash].", + "", + "### Parameters:", + "- _relay_hash: The hash identifying the relay for which the fill status account is being closed.", + "- relay_data: The data structure containing information about the relay." + ], + "discriminator": [224, 39, 208, 68, 8, 226, 23, 214], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "fill_status", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [102, 105, 108, 108, 115] + }, + { + "kind": "arg", + "path": "relay_hash" + } + ] + } + } + ], + "args": [ + { + "name": "_relay_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "relay_data", + "type": { + "defined": { + "name": "V3RelayData" + } + } + } + ] + }, + { + "name": "close_instruction_params", + "docs": [ + "Closes the instruction parameters account.", + "", + "This function is used to close the instruction parameters account, effectively marking the end of its lifecycle.", + "It transfers any remaining lamports to the signer and resets the account.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the closure.", + "- instruction_params (UncheckedAccount): The account to be closed. seed: [\"instruction_params\",signer]. Not", + "the signer being within the seed here implicitly protects this from only being called by the creator." + ], + "discriminator": [224, 44, 254, 10, 216, 8, 172, 96], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + } + ], + "args": [] + }, + { + "name": "create_token_accounts", + "docs": [ + "Creates token accounts in batch for a set of addresses.", + "", + "This helper function allows the caller to pass in a set of remaining accounts to create a batch of Associated", + "Token Accounts (ATAs) for addresses. It is particularly useful for relayers to call before filling a deposit.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the creation of token accounts.", + "- mint (InterfaceAccount): The mint account for the token.", + "- token_program (Interface): The token program.", + "- associated_token_program (Program): The associated token program.", + "- system_program (Program): The system program required for account creation." + ], + "discriminator": [163, 216, 49, 204, 97, 16, 80, 167], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "mint" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "deposit_v3", + "docs": [ + "**************************************", + "DEPOSIT FUNCTIONS *", + "*************************************", + "Request to bridge input_token to a target chain and receive output_token.", + "", + "The fee paid to relayers and the system is captured in the spread between the input and output amounts,", + "denominated in the input token. A relayer on the destination chain will send `output_amount` of `output_token`", + "to the recipient and receive `input_token` on a repayment chain of their choice. The fee accounts for:", + "Destination transaction costs, relayer's opportunity cost of capital while waiting for a refund during the", + "optimistic challenge window in the HubPool, and the system fee charged to the relayer.", + "", + "On the destination chain, a unique hash of the deposit data is used to identify this deposit. Modifying any", + "parameters will result in a different hash, creating a separate deposit. The hash is computed using all parameters", + "of this function along with the chain's `chainId()`. Relayers are refunded only for deposits with hashes that", + "exactly match those emitted by this contract.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the deposit.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- route (Account): The route PDA for the particular bridged route in question. Validates a route is enabled.", + "Seed: [\"route\",input_token,state.seed,destination_chain_id].", + "- depositor_token_account (Writable): The depositor's ATA for the input token.", + "- vault (Writable): Programs ATA for the associated input token. This is where the depositor's assets are sent.", + "Authority must be the state.", + "- mint (Account): The mint account for the input token.", + "- token_program (Interface): The token program.", + "", + "### Parameters", + "- depositor: The account credited with the deposit. Can be different from the signer.", + "- recipient: The account receiving funds on the destination chain. Depending on the output chain can be an ETH", + "address or a contract address or any other address type encoded as a bytes32 field.", + "- input_token: The token pulled from the caller's account and locked into this program's vault on deposit.", + "- output_token: The token that the relayer will send to the recipient on the destination chain.", + "- input_amount: The amount of input tokens to pull from the caller's account and lock into the vault. This", + "amount will be sent to the relayer on their repayment chain of choice as a refund following an optimistic", + "challenge window in the HubPool, less a system fee.", + "- output_amount: The amount of output tokens that the relayer will send to the recipient on the destination.", + "- destination_chain_id: The destination chain identifier. Must be enabled along with the input token as a valid", + "deposit route from this spoke pool or this transaction will revert.", + "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the exclusivity", + "deadline timestamp. This must be a valid, non-zero address if the exclusivity deadline is greater than the", + "current block timestamp.", + "- quote_timestamp: The HubPool timestamp that is used to determine the system fee paid by the depositor. This", + "must be set to some time between [currentTime - depositQuoteTimeBuffer, currentTime].", + "- fill_deadline: The deadline for the relayer to fill the deposit. After this destination chain timestamp, the", + "fill will revert on the destination chain. Must be set between [currentTime,currentTime+fillDeadlineBuffer].", + "- exclusivity_parameter: Sets the exclusivity deadline timestamp for the exclusiveRelayer to fill the deposit.", + "1. If 0, no exclusivity period.", + "2. If less than MAX_EXCLUSIVITY_PERIOD_SECONDS, adds this value to the current block timestamp.", + "3. Otherwise, uses this value as the exclusivity deadline timestamp.", + "- message: The message to send to the recipient on the destination chain if the recipient is a contract.", + "If not empty, the recipient contract must implement handleV3AcrossMessage() or the fill will revert." + ], + "discriminator": [143, 121, 102, 14, 14, 12, 216, 226], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "route", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 117, 116, 101] + }, + { + "kind": "arg", + "path": "input_token" + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "destination_chain_id" + } + ] + } + }, + { + "name": "depositor_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "depositor" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "quote_timestamp", + "type": "u32" + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_parameter", + "type": "u32" + }, + { + "name": "message", + "type": "bytes" + } + ] + }, + { + "name": "deposit_v3_now", + "discriminator": [139, 2, 230, 236, 252, 188, 136, 68], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "route", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 117, 116, 101] + }, + { + "kind": "arg", + "path": "input_token" + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "destination_chain_id" + } + ] + } + }, + { + "name": "depositor_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "depositor" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_parameter", + "type": "u32" + }, + { + "name": "message", + "type": "bytes" + } + ] + }, + { + "name": "emergency_delete_root_bundle", + "docs": [ + "Deletes a root bundle in case of emergencies where bad bundle has reached the Spoke. Only callable by the owner.", + "", + "This function will close the PDA for the associated `root_bundle_id`.", + "Note: Using this function does not decrement `state.root_bundle_id`.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the deletion.", + "- closer (SystemAccount): The account that will receive the lamports from closing the root_bundle account.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- root_bundle (Writable): The root bundle PDA to be closed. Seed: [\"root_bundle\",state.seed,root_bundle_id].", + "", + "### Parameters:", + "- root_bundle_id: Index of the root bundle that needs to be deleted." + ], + "discriminator": [226, 158, 1, 74, 84, 113, 24, 152], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "closer", + "writable": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "root_bundle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 111, 116, 95, 98, 117, 110, 100, 108, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "root_bundle_id" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "root_bundle_id", + "type": "u32" + } + ] + }, + { + "name": "execute_relayer_refund_leaf", + "docs": [ + "**************************************", + "BUNDLE FUNCTIONS *", + "*************************************", + "Executes relayer refund leaf. Only callable by owner.", + "", + "Processes a relayer refund leaf, verifying its inclusion in a previous Merkle root and that it was not", + "previously executed. Function has two modes of operation: a) transfers all relayer refunds directly to", + "relayers ATA or b) credits relayers with claimable claim_account PDA that they can use later to claim their", + "refund. In the happy path, (a) should be used. (b) should only be used if there is a relayer within the bundle", + "who can't receive the transfer for some reason, such as failed token transfers due to blacklisting. Executing", + "relayer refunds requires the caller to create a LUT and load the execution params into it. This is needed to", + "fit the data in a single instruction. The exact structure and validation of the leaf is defined in the UMIP.", + "", + "instruction_params Parameters:", + "- root_bundle_id: The ID of the root bundle containing the relayer refund root.", + "- relayer_refund_leaf: The relayer refund leaf to be executed. Contents must include:", + "- amount_to_return: The amount to be to be sent back to mainnet Ethereum from this Spoke pool.", + "- chain_id: The targeted chainId for the refund. Validated against state.chain_id.", + "- refund_amounts: The amounts to be returned to the relayer for each refund_address.", + "- leaf_id: The leaf ID of the relayer refund leaf.", + "- mint_public_key: The public key of the mint (refunded token) being refunded.", + "- refund_addresses: The addresses to be refunded.", + "- proof: The Merkle proof for the relayer refund leaf.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the execution. No permission requirements.", + "- instruction_params (Account): LUT containing the execution parameters. seed: [\"instruction_params\",signer]", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- root_bundle (Writable): The root bundle PDA containing the relayer refund root, created when the root bundle", + "was initially bridged. seed: [\"root_bundle\",state.seed,root_bundle_id].", + "- vault (Writable): The ATA for refunded mint. Authority must be the state.", + "- mint (Account): The mint account for the token being refunded.", + "- transfer_liability (Writable): Account to track pending refunds to be sent to the Ethereum hub pool. Only used", + "if the amount_to_return value is non-zero within the leaf. Seed: [\"transfer_liability\",mint]", + "- token_program: The token program.", + "- system_program: The system program required for account creation.", + "", + "execute_relayer_refund_leaf executes in mode (a) where refunds are sent to ATA directly.", + "execute_relayer_refund_leaf_deferred executes in mode (b) where refunds are allocated to the claim_account PDA." + ], + "discriminator": [27, 136, 159, 240, 127, 68, 123, 164], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "root_bundle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 111, 116, 95, 98, 117, 110, 100, 108, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "account", + "path": "instruction_params.root_bundle_id", + "account": "ExecuteRelayerRefundLeafParams" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "transfer_liability", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 97, 110, 115, 102, 101, 114, 95, 108, 105, 97, 98, 105, 108, 105, 116, 121] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "execute_relayer_refund_leaf_deferred", + "discriminator": [110, 112, 89, 208, 38, 116, 93, 10], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "root_bundle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 111, 116, 95, 98, 117, 110, 100, 108, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "account", + "path": "instruction_params.root_bundle_id", + "account": "ExecuteRelayerRefundLeafParams" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "transfer_liability", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 97, 110, 115, 102, 101, 114, 95, 108, 105, 97, 98, 105, 108, 105, 116, 121] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "execute_v3_slow_relay_leaf", + "docs": [ + "Executes a slow relay leaf stored as part of a root bundle relayed by the HubPool.", + "", + "Executing a slow fill leaf is equivalent to filling the relayData, so this function cannot be used to", + "double fill a recipient. The relayData that is filled is included in the slowFillLeaf and is hashed", + "like any other fill sent through fillV3Relay(). There is no relayer credited with filling this relay since funds", + "are sent directly out of this program's vault.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the execution. No permission requirements.", + "- instruction_params (Account): Optional account to load instruction parameters when they are not passed in the", + "instruction data due to message size constraints. Pass this program ID to represent None. When Some, this must", + "be derived from the signer's public key with seed [\"instruction_params\",signer].", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- root_bundle (Account): Root bundle PDA with slowRelayRoot. Seed: [\"root_bundle\",state.seed,root_bundle_id].", + "- fill_status (Writable): The fill status PDA, created when slow request was made. Updated to track slow fill.", + "Used to prevent double request and fill. Seed: [\"fills\",relay_hash].", + "- mint (Account): The mint account for the output token.", + "- recipient_token_account (Writable): The recipient's ATA for the output token.", + "- vault (Writable): The ATA for refunded mint. Authority must be the state.", + "- token_program (Interface): The token program.", + "- system_program (Program): The system program.", + "", + "### Parameters:", + "- _relay_hash: The hash identifying the deposit to be filled. Used to identify the deposit to be filled.", + "- slow_fill_leaf: Contains all data necessary to uniquely verify the slow fill. This struct contains:", + "- relayData: Struct containing all the data needed to identify the original deposit to be slow filled. Same", + "as the relay_data struct in fill_v3_relay().", + "- chainId: Chain identifier where slow fill leaf should be executed. If this doesn't match this chain's", + "chainId, then this function will revert.", + "- updatedOutputAmount: Amount to be sent to recipient out of this contract's balance. Can be set differently", + "from relayData.outputAmount to charge a different fee because this deposit was \"slow\" filled. Usually,", + "this will be set higher to reimburse the recipient for waiting for the slow fill.", + "- _root_bundle_id: Unique ID of root bundle containing slow relay root that this leaf is contained in.", + "- proof: Inclusion proof for this leaf in slow relay root in root bundle.", + "Note: slow_fill_leaf, _root_bundle_id, and proof are optional parameters. If None for any of these is passed,", + "the caller must load them via the instruction_params account." + ], + "discriminator": [198, 223, 194, 60, 138, 154, 62, 53], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "root_bundle", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 111, 116, 95, 98, 117, 110, 100, 108, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "root_bundle_id.unwrap_or_else(| |\ninstruction_params" + } + ] + } + }, + { + "name": "fill_status", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [102, 105, 108, 108, 115] + }, + { + "kind": "arg", + "path": "relay_hash" + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "slow_fill_leaf" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "_relay_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "slow_fill_leaf", + "type": { + "option": { + "defined": { + "name": "V3SlowFill" + } + } + } + }, + { + "name": "_root_bundle_id", + "type": { + "option": "u32" + } + }, + { + "name": "proof", + "type": { + "option": { + "vec": { + "array": ["u8", 32] + } + } + } + } + ] + }, + { + "name": "fill_v3_relay", + "docs": [ + "**************************************", + "RELAYER FUNCTIONS *", + "*************************************", + "Fulfill request to bridge cross chain by sending specified output tokens to recipient.", + "", + "Relayer & system fee is captured in the spread between input and output amounts. This fee accounts for tx costs,", + "relayer's capital opportunity cost, and a system fee. The relay_data hash uniquely identifies the deposit to", + "fill, ensuring relayers are refunded only for deposits matching the original hash from the origin SpokePool.", + "This hash includes all parameters from deposit_v3() and must match the destination_chain_id. Note the relayer", + "creates an ATA in calling this method to store the fill_status. This should be closed once the deposit has", + "expired to let the relayer re-claim their rent. Cannot fill more than once. Partial fills are not supported.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the fill (filler). No permission requirements.", + "- instruction_params (Account): Optional account to load instruction parameters when they are not passed in the", + "instruction data due to message size constraints. Pass this program ID to represent None. When Some, this must", + "be derived from the signer's public key with seed [\"instruction_params\",signer].", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- route (Account): The route PDA for the particular bridged route in question. Validates a route is enabled.", + "Seed: [\"route\",input_token,state.seed,destination_chain_id].", + "- vault (Writable): The ATA for refunded mint. Authority must be the state.", + "- mint (Account): The mint of the output token, sent from the relayer to the recipient.", + "- relayer_token_account (Writable): The relayer's ATA for the input token.", + "- recipient_token_account (Writable): The recipient's ATA for the output token.", + "- fill_status (Writable): The fill status PDA, created on this function call to track the fill status to prevent", + "re-entrancy & double fills. Also used to track requested slow fills. Seed: [\"fills\",relay_hash].", + "- token_program (Interface): The token program.", + "- associated_token_program (Interface): The associated token program.", + "- system_program (Interface): The system program.", + "", + "### Parameters:", + "- _relay_hash: The hash identifying the deposit to be filled. Caller must pass this in. Computed as hash of", + "the flattened relay_data & destination_chain_id.", + "- relay_data: Struct containing all the data needed to identify the deposit to be filled. Should match", + "all the same-named parameters emitted in the origin chain V3FundsDeposited event.", + "- depositor: The account credited with the deposit.", + "- recipient: The account receiving funds on this chain.", + "- input_token: The token pulled from the caller's account to initiate the deposit. The equivalent of this", + "token on the repayment chain will be sent as a refund to the caller.", + "- output_token: The token that the caller will send to the recipient on this chain.", + "- input_amount: This amount, less a system fee, will be sent to the caller on their repayment chain.", + "- output_amount: The amount of output tokens that the caller will send to the recipient.", + "- origin_chain_id: The origin chain identifier.", + "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the", + "exclusivity deadline timestamp.", + "- fill_deadline: The deadline for the caller to fill the deposit. After this timestamp, the deposit will be", + "cancelled and the depositor will be refunded on the origin chain.", + "- exclusivity_deadline: The deadline for the exclusive relayer to fill the deposit. After this timestamp,", + "anyone can fill this deposit.", + "- message: The message to send to the recipient if the recipient is a contract that implements a", + "handle_v3_across_message() public function.", + "- repayment_chain_id: Chain of SpokePool where relayer wants to be refunded after the challenge window has", + "passed. Will receive input_amount of the equivalent token to input_token on the repayment chain.", + "- repayment_address: The address of the recipient on the repayment chain that they want to be refunded to.", + "Note: relay_data, repayment_chain_id, and repayment_address are optional parameters. If None for any of these", + "is passed, the caller must load them via the instruction_params account." + ], + "discriminator": [178, 52, 228, 191, 48, 254, 230, 50], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "relayer_token_account", + "writable": true + }, + { + "name": "recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "relay_data" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "fill_status", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [102, 105, 108, 108, 115] + }, + { + "kind": "arg", + "path": "relay_hash" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "_relay_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "relay_data", + "type": { + "option": { + "defined": { + "name": "V3RelayData" + } + } + } + }, + { + "name": "repayment_chain_id", + "type": { + "option": "u64" + } + }, + { + "name": "repayment_address", + "type": { + "option": "pubkey" + } + } + ] + }, + { + "name": "get_unsafe_deposit_id", + "docs": [ + "Computes the deposit ID for the depositor using the provided deposit_nonce. This acts like a \"view\" function for", + "off-chain actors to compute what the expected deposit ID is for a given depositor and deposit nonce will be.", + "", + "### Parameters:", + "- signer: The public key of the depositor sender.", + "- depositor: The public key of the depositor.", + "- deposit_nonce: The nonce used to derive the deposit ID." + ], + "discriminator": [118, 10, 135, 0, 168, 243, 223, 117], + "accounts": [], + "args": [ + { + "name": "signer", + "type": "pubkey" + }, + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "deposit_nonce", + "type": "u64" + } + ], + "returns": { + "array": ["u8", 32] + } + }, + { + "name": "handle_receive_message", + "docs": [ + "**************************************", + "CCTP FUNCTIONS FUNCTIONS *", + "*************************************", + "Handles cross-chain messages received from L1 Ethereum over CCTP.", + "", + "This function serves as the permissioned entry point for messages sent from the Ethereum mainnet to the Solana", + "SVM Spoke program over CCTP. It processes the incoming message by translating it into a corresponding Solana", + "instruction and then invokes the instruction within this program.", + "", + "### Required Accounts:", + "- authority_pda: A signer account that ensures this instruction can only be called by the Message Transmitter.", + "This acts to block that only the CCTP Message Transmitter can send messages to this program.", + "seed:[\"message_transmitter_authority\", program_id]", + "- state (Account): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet. Enforces that the", + "remote domain and sender are valid.", + "- self_authority: An unchecked account used for authenticating self-CPI invoked by the received message.", + "seed: [\"self_authority\"].", + "- program: The SVM Spoke program account.", + "", + "### Parameters:", + "- params: Contains information to process the received message, containing the following fields:", + "- remote_domain: The remote domain of the message sender.", + "- sender: The sender of the message.", + "- message_body: The body of the message.", + "- authority_bump: The authority bump for the message transmitter." + ], + "discriminator": [133, 102, 1, 180, 145, 11, 138, 180], + "accounts": [ + { + "name": "authority_pda", + "signer": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, 101, 115, 115, 97, 103, 101, 95, 116, 114, 97, 110, 115, 109, 105, 116, 116, 101, 114, 95, 97, + 117, 116, 104, 111, 114, 105, 116, 121 + ] + }, + { + "kind": "const", + "value": [ + 8, 17, 16, 2, 34, 218, 221, 145, 9, 153, 51, 69, 221, 195, 150, 15, 223, 69, 22, 215, 97, 239, 23, + 156, 243, 205, 59, 253, 230, 92, 68, 175 + ] + } + ], + "program": { + "kind": "const", + "value": [ + 166, 95, 201, 137, 219, 95, 93, 66, 117, 159, 58, 84, 96, 88, 239, 205, 205, 192, 191, 60, 24, 152, 7, + 45, 142, 180, 93, 209, 216, 5, 8, 206 + ] + } + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "self_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 101, 108, 102, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program", + "address": "YVMQN27RnCNt23NRxzJPumXRd8iovEfKtzkqyMc5vDt" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "HandleReceiveMessageParams" + } + } + } + ] + }, + { + "name": "initialize", + "docs": [ + "**************************************", + "ADMIN FUNCTIONS *", + "*************************************", + "Initializes the state for the SVM Spoke Pool. Only callable once.", + "", + "### Required Accounts:", + "- signer (Writable, Signer): The account that pays for the transaction and will own the state.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- system_program: The system program required for account creation.", + "", + "### Parameters:", + "- seed: A unique seed used to derive the state account's address. Must be 0 on Mainnet.", + "- initial_number_of_deposits: The initial number of deposits. Used to offset in upgrades.", + "- chain_id: The chain ID for Solana, used to identify the Solana spoke in the rest of the Across protocol.", + "- remote_domain: The CCTP domain for Mainnet Ethereum.", + "- cross_domain_admin: The HubPool on Mainnet Ethereum.", + "- deposit_quote_time_buffer: Quote timestamps can't be set more than this amount into the past from deposit.", + "- fill_deadline_buffer: Fill deadlines can't be set more than this amount into the future from deposit." + ], + "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "arg", + "path": "seed" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "seed", + "type": "u64" + }, + { + "name": "initial_number_of_deposits", + "type": "u32" + }, + { + "name": "chain_id", + "type": "u64" + }, + { + "name": "remote_domain", + "type": "u32" + }, + { + "name": "cross_domain_admin", + "type": "pubkey" + }, + { + "name": "deposit_quote_time_buffer", + "type": "u32" + }, + { + "name": "fill_deadline_buffer", + "type": "u32" + } + ] + }, + { + "name": "initialize_claim_account", + "docs": [ + "Initializes a claim account for a relayer refund.", + "", + "This function sets up a claim account for a relayer to claim their refund at a later time and should only be", + "used in the un-happy path where a bundle cant not be executed due to a recipient in the bundle having a blocked", + "or uninitialized claim ATA. The refund address becomes the \"owner\" of the claim_account.", + "", + "### Required Accounts:", + "- signer (Signer): The account that pays for the transaction and initializes the claim account.", + "- claim_account (Writable): The newly created claim account PDA to store claim data for this associated mint.", + "Seed: [\"claim_account\",mint,refund_address].", + "- system_program: The system program required for account creation.", + "", + "### Parameters:", + "- _mint: The public key of the mint associated with the claim account.", + "- _refund_address: The public key of the refund address associated with the claim account." + ], + "discriminator": [22, 247, 214, 191, 90, 74, 87, 216], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "claim_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 97, 99, 99, 111, 117, 110, 116] + }, + { + "kind": "arg", + "path": "mint" + }, + { + "kind": "arg", + "path": "refund_address" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "_mint", + "type": "pubkey" + }, + { + "name": "_refund_address", + "type": "pubkey" + } + ] + }, + { + "name": "initialize_instruction_params", + "docs": [ + "Initializes the instruction parameters account. Used by data worker when relaying bundles", + "", + "This function sets up an account to store raw data fragments for instructions (LUT).", + "", + "### Required Accounts:", + "- signer (Signer): The account that pays for the transaction and initializes the instruction parameters.", + "- instruction_params (UncheckedAccount): The account where raw data will be stored. Initialized with specified", + "size. seed: [\"instruction_params\",signer].", + "- system_program: The system program required for account creation.", + "", + "### Parameters:", + "- _total_size: The total size of the instruction parameters account." + ], + "discriminator": [94, 206, 190, 192, 127, 8, 186, 28], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "_total_size", + "type": "u32" + } + ] + }, + { + "name": "pause_deposits", + "docs": [ + "Pauses the Spoke Pool from accepting deposits. Only callable by the owner.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the pause.", + "- state (Writable): The Spoke state PDA. Seed: [\"state\",state.seed], where `seed` is 0 on mainnet.", + "", + "### Parameters:", + "- pause: `true` to pause the system, `false` to unpause it." + ], + "discriminator": [206, 186, 203, 153, 253, 61, 206, 122], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "pause", + "type": "bool" + } + ] + }, + { + "name": "pause_fills", + "docs": [ + "Pauses the Spoke Pool from processing fills. Only callable by the owner.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the pause.", + "- state (Writable): The Spoke state PDA. Seed: [\"state\",state.seed], where `seed` is 0 on mainnet.", + "", + "### Parameters:", + "- pause: `true` to pause the system, `false` to unpause it." + ], + "discriminator": [92, 114, 214, 49, 13, 243, 73, 35], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "pause", + "type": "bool" + } + ] + }, + { + "name": "relay_root_bundle", + "docs": [ + "Stores a new root bundle for later execution. Only callable by the owner.", + "", + "Once stored, these roots are used to execute relayer refunds, slow fills, and pool rebalancing actions.", + "This method initializes a root_bundle PDA to store the root bundle data. The caller", + "of this method is responsible for paying the rent for this PDA.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the addition of the new root bundle.", + "- payer (Signer): The account who pays rent to create root_bundle PDA.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- root_bundle (Writable): The newly created bundle PDA to store root bundle data. Each root bundle has an", + "incrementing ID, stored in the state. Seed: [\"root_bundle\",state.seed,root_bundle_id].", + "- system_program (Program): The system program required for account creation.", + "", + "### Parameters:", + "- relayer_refund_root: Merkle root of the relayer refund tree.", + "- slow_relay_root: Merkle root of the slow relay tree." + ], + "discriminator": [69, 13, 223, 204, 251, 61, 105, 6], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "root_bundle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 111, 116, 95, 98, 117, 110, 100, 108, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "account", + "path": "state.root_bundle_id", + "account": "State" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "relayer_refund_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "slow_relay_root", + "type": { + "array": ["u8", 32] + } + } + ] + }, + { + "name": "request_v3_slow_fill", + "docs": [ + "**************************************", + "SLOW FILL FUNCTIONS *", + "*************************************", + "Requests Across to send LP funds to this program to fulfill a slow fill.", + "", + "Slow fills are not possible unless the input and output tokens are \"equivalent\", i.e., they route to the same L1", + "token via PoolRebalanceRoutes. Slow fills are created by inserting slow fill objects into a Merkle tree that is", + "included in the next HubPool \"root bundle\". Once the optimistic challenge window has passed, the HubPool will", + "relay the slow root to this chain via relayRootBundle(). Once the slow root is relayed, the slow fill can be", + "executed by anyone who calls executeV3SlowRelayLeaf(). Cant request a slow fill if the fill deadline has", + "passed. Cant request a slow fill if the relay has already been filled or a slow fill has already been requested.", + "", + "### Required Accounts:", + "- signer (Signer): The account that authorizes the slow fill request.", + "- instruction_params (Account): Optional account to load instruction parameters when they are not passed in the", + "instruction data due to message size constraints. Pass this program ID to represent None. When Some, this must", + "be derived from the signer's public key with seed [\"instruction_params\",signer].", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "- fill_status (Writable): The fill status PDA, created on this function call. Updated to track slow fill status.", + "Used to prevent double request and fill. Seed: [\"fills\",relay_hash].", + "- system_program (Interface): The system program.", + "", + "### Parameters:", + "- _relay_hash: The hash identifying the deposit to be filled. Caller must pass this in. Computed as hash of", + "the flattened relay_data & destination_chain_id.", + "- relay_data: Struct containing all the data needed to identify the deposit that should be slow filled. If any", + "of the params are missing or different from the origin chain deposit, then Across will not include a slow", + "fill for the intended deposit. See fill_v3_relay & V3RelayData struct for more details.", + "Note: relay_data is optional parameter. If None for it is passed, the caller must load it via the", + "instruction_params account." + ], + "discriminator": [31, 152, 13, 30, 27, 122, 29, 97], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "fill_status", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [102, 105, 108, 108, 115] + }, + { + "kind": "arg", + "path": "relay_hash" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "_relay_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "relay_data", + "type": { + "option": { + "defined": { + "name": "V3RelayData" + } + } + } + } + ] + }, + { + "name": "set_cross_domain_admin", + "docs": [ + "Sets the cross-domain admin for the Spoke Pool. Only callable by owner. Used if Hubpool upgrades.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the admin change.", + "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.", + "", + "### Parameters:", + "- cross_domain_admin: The public key of the new cross-domain admin." + ], + "discriminator": [102, 206, 237, 106, 63, 141, 42, 248], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "cross_domain_admin", + "type": "pubkey" + } + ] + }, + { + "name": "set_current_time", + "docs": ["Sets the current time for the SVM Spoke Pool when running in test mode. Disabled on Mainnet."], + "discriminator": [69, 100, 169, 193, 125, 0, 150, 69], + "accounts": [ + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "signer", + "signer": true + } + ], + "args": [ + { + "name": "new_time", + "type": "u32" + } + ] + }, + { + "name": "set_enable_route", + "docs": [ + "Enables or disables a route for deposits from origin token to destination chain ID. Callable only by the owner.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the owner to authorize the route change.", + "- payer (Signer): The account responsible for paying the transaction fees.", + "- state (Writable): The Spoke state PDA. Seed: [\"state\",state.seed] where `seed` is 0 on mainnet.", + "- route (Writable): PDA to store route information. Created on the first call, updated subsequently.", + "Seed: [\"route\",origin_token,state.seed,destination_chain_id].", + "- vault (Writable): ATA to hold the origin token for the associated route. Created on the first call.", + "Authority must be set as the state, and mint must be the origin_token_mint.", + "- origin_token_mint: The mint account for the origin token.", + "- token_program: The token program.", + "- associated_token_program: The associated token program.", + "- system_program: The system program required for account creation.", + "", + "### Parameters:", + "- origin_token: The public key of the origin token.", + "- destination_chain_id: The chain ID of the destination.", + "- enabled: Boolean indicating whether the route is enabled or disabled." + ], + "discriminator": [166, 66, 33, 156, 122, 251, 223, 34], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "state", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "route", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 117, 116, 101] + }, + { + "kind": "arg", + "path": "origin_token" + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "destination_chain_id" + } + ] + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "origin_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "origin_token_mint" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "origin_token", + "type": "pubkey" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "transfer_ownership", + "docs": [ + "Transfers ownership of the Spoke Pool. Only callable by the current owner.", + "", + "### Required Accounts:", + "- signer (Signer): The account that must be the current owner to authorize the transfer.", + "- state (Writable): The Spoke state PDA. Seed: [\"state\",state.seed] where `seed` is 0 on mainnet.", + "", + "### Parameters:", + "- new_owner: The public key of the new owner." + ], + "discriminator": [65, 177, 215, 73, 53, 45, 99, 47], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + } + ], + "args": [ + { + "name": "new_owner", + "type": "pubkey" + } + ] + }, + { + "name": "unsafe_deposit_v3", + "docs": [ + "Equivalent to deposit_v3 except the deposit_nonce is not used to derive the deposit_id for the depositor. This", + "Lets the caller influence the deposit ID to make it deterministic for the depositor. The computed depositID is", + "the keccak256 hash of [signer, depositor, deposit_nonce]." + ], + "discriminator": [53, 27, 226, 193, 54, 134, 223, 89], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 97, 116, 101] + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + } + ] + } + }, + { + "name": "route", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 111, 117, 116, 101] + }, + { + "kind": "arg", + "path": "input_token" + }, + { + "kind": "account", + "path": "state.seed", + "account": "State" + }, + { + "kind": "arg", + "path": "destination_chain_id" + } + ] + } + }, + { + "name": "depositor_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "arg", + "path": "depositor" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "state" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "deposit_nonce", + "type": "u64" + }, + { + "name": "quote_timestamp", + "type": "u32" + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_parameter", + "type": "u32" + }, + { + "name": "message", + "type": "bytes" + } + ] + }, + { + "name": "write_instruction_params_fragment", + "docs": [ + "Writes a fragment of raw data into the instruction parameters account.", + "", + "This function allows writing a fragment of data into a specified offset within the instruction parameters", + "account. It ensures that the data does not overflow the account's allocated space.", + "", + "### Required Accounts:", + "- signer (Signer): Account that authorizes the write operation.", + "- instruction_params (UncheckedAccount): Account to write raw data to. seed: [\"instruction_params\",signer].", + "- system_program: The system program required for account operations.", + "", + "### Parameters:", + "- offset: The starting position within the account's data where the fragment will be written.", + "- fragment: The raw data fragment to be written into the account." + ], + "discriminator": [238, 182, 109, 113, 124, 255, 72, 18], + "accounts": [ + { + "name": "signer", + "signer": true + }, + { + "name": "instruction_params", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [105, 110, 115, 116, 114, 117, 99, 116, 105, 111, 110, 95, 112, 97, 114, 97, 109, 115] + }, + { + "kind": "account", + "path": "signer" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "offset", + "type": "u32" + }, + { + "name": "fragment", + "type": "bytes" + } + ] + } + ], + "accounts": [ + { + "name": "ClaimAccount", + "discriminator": [113, 109, 47, 96, 242, 219, 61, 165] + }, + { + "name": "ExecuteRelayerRefundLeafParams", + "discriminator": [192, 59, 93, 9, 171, 77, 28, 250] + }, + { + "name": "ExecuteV3SlowRelayLeafParams", + "discriminator": [190, 110, 37, 249, 117, 253, 160, 111] + }, + { + "name": "FillStatusAccount", + "discriminator": [105, 89, 88, 35, 24, 147, 178, 137] + }, + { + "name": "FillV3RelayParams", + "discriminator": [45, 184, 9, 102, 46, 87, 53, 8] + }, + { + "name": "RequestV3SlowFillParams", + "discriminator": [62, 245, 2, 87, 82, 84, 51, 225] + }, + { + "name": "RootBundle", + "discriminator": [66, 221, 214, 231, 25, 222, 184, 219] + }, + { + "name": "Route", + "discriminator": [80, 179, 58, 115, 52, 19, 146, 134] + }, + { + "name": "State", + "discriminator": [216, 146, 107, 94, 104, 75, 182, 177] + }, + { + "name": "TransferLiability", + "discriminator": [157, 137, 86, 109, 206, 241, 183, 79] + } + ], + "events": [ + { + "name": "BridgedToHubPool", + "discriminator": [181, 111, 52, 218, 105, 53, 240, 205] + }, + { + "name": "ClaimedRelayerRefund", + "discriminator": [161, 134, 155, 159, 211, 37, 150, 41] + }, + { + "name": "EmergencyDeletedRootBundle", + "discriminator": [45, 150, 89, 248, 134, 142, 200, 114] + }, + { + "name": "EnabledDepositRoute", + "discriminator": [37, 128, 171, 126, 10, 179, 154, 241] + }, + { + "name": "ExecutedRelayerRefundRoot", + "discriminator": [198, 167, 248, 175, 34, 3, 4, 240] + }, + { + "name": "FilledV3Relay", + "discriminator": [49, 94, 16, 27, 139, 89, 112, 246] + }, + { + "name": "PausedDeposits", + "discriminator": [94, 129, 187, 122, 94, 30, 91, 247] + }, + { + "name": "PausedFills", + "discriminator": [81, 4, 134, 23, 170, 56, 234, 234] + }, + { + "name": "RelayedRootBundle", + "discriminator": [188, 206, 117, 10, 66, 78, 77, 115] + }, + { + "name": "RequestedV3SlowFill", + "discriminator": [190, 71, 44, 1, 74, 222, 254, 129] + }, + { + "name": "SetXDomainAdmin", + "discriminator": [164, 13, 119, 18, 103, 226, 98, 66] + }, + { + "name": "V3FundsDeposited", + "discriminator": [224, 136, 127, 43, 200, 41, 47, 142] + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidSelector", + "msg": "Invalid solidity selector" + }, + { + "code": 6001, + "name": "InvalidArgument", + "msg": "Invalid solidity argument" + }, + { + "code": 6002, + "name": "InvalidBool", + "msg": "Invalid solidity bool argument" + }, + { + "code": 6003, + "name": "InvalidAddress", + "msg": "Invalid solidity address argument" + }, + { + "code": 6004, + "name": "InvalidUint32", + "msg": "Invalid solidity uint32 argument" + }, + { + "code": 6005, + "name": "InvalidUint64", + "msg": "Invalid solidity uint64 argument" + }, + { + "code": 6006, + "name": "InvalidUint128", + "msg": "Invalid solidity uint128 argument" + }, + { + "code": 6007, + "name": "UnsupportedSelector", + "msg": "Unsupported solidity selector" + } + ], + "types": [ + { + "name": "BridgedToHubPool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "ClaimAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "initializer", + "type": "pubkey" + } + ] + } + }, + { + "name": "ClaimedRelayerRefund", + "type": { + "kind": "struct", + "fields": [ + { + "name": "l2_token_address", + "type": "pubkey" + }, + { + "name": "claim_amount", + "type": "u64" + }, + { + "name": "refund_address", + "type": "pubkey" + } + ] + } + }, + { + "name": "EmergencyDeletedRootBundle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root_bundle_id", + "type": "u32" + } + ] + } + }, + { + "name": "EnabledDepositRoute", + "type": { + "kind": "struct", + "fields": [ + { + "name": "origin_token", + "type": "pubkey" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "enabled", + "type": "bool" + } + ] + } + }, + { + "name": "ExecuteRelayerRefundLeafParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root_bundle_id", + "type": "u32" + }, + { + "name": "relayer_refund_leaf", + "type": { + "defined": { + "name": "RelayerRefundLeaf" + } + } + }, + { + "name": "proof", + "type": { + "vec": { + "array": ["u8", 32] + } + } + } + ] + } + }, + { + "name": "ExecuteV3SlowRelayLeafParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slow_fill_leaf", + "type": { + "defined": { + "name": "V3SlowFill" + } + } + }, + { + "name": "root_bundle_id", + "type": "u32" + }, + { + "name": "proof", + "type": { + "vec": { + "array": ["u8", 32] + } + } + } + ] + } + }, + { + "name": "ExecutedRelayerRefundRoot", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_to_return", + "type": "u64" + }, + { + "name": "chain_id", + "type": "u64" + }, + { + "name": "refund_amounts", + "type": { + "vec": "u64" + } + }, + { + "name": "root_bundle_id", + "type": "u32" + }, + { + "name": "leaf_id", + "type": "u32" + }, + { + "name": "l2_token_address", + "type": "pubkey" + }, + { + "name": "refund_addresses", + "type": { + "vec": "pubkey" + } + }, + { + "name": "deferred_refunds", + "type": "bool" + }, + { + "name": "caller", + "type": "pubkey" + } + ] + } + }, + { + "name": "FillStatus", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Unfilled" + }, + { + "name": "RequestedSlowFill" + }, + { + "name": "Filled" + } + ] + } + }, + { + "name": "FillStatusAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "status", + "type": { + "defined": { + "name": "FillStatus" + } + } + }, + { + "name": "relayer", + "type": "pubkey" + } + ] + } + }, + { + "name": "FillType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "FastFill" + }, + { + "name": "ReplacedSlowFill" + }, + { + "name": "SlowFill" + } + ] + } + }, + { + "name": "FillV3RelayParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "relay_data", + "type": { + "defined": { + "name": "V3RelayData" + } + } + }, + { + "name": "repayment_chain_id", + "type": "u64" + }, + { + "name": "repayment_address", + "type": "pubkey" + } + ] + } + }, + { + "name": "FilledV3Relay", + "type": { + "kind": "struct", + "fields": [ + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "repayment_chain_id", + "type": "u64" + }, + { + "name": "origin_chain_id", + "type": "u64" + }, + { + "name": "deposit_id", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_deadline", + "type": "u32" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "relayer", + "type": "pubkey" + }, + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "message_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "relay_execution_info", + "type": { + "defined": { + "name": "V3RelayExecutionEventInfo" + } + } + } + ] + } + }, + { + "name": "HandleReceiveMessageParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "remote_domain", + "type": "u32" + }, + { + "name": "sender", + "type": "pubkey" + }, + { + "name": "message_body", + "type": "bytes" + }, + { + "name": "authority_bump", + "type": "u8" + } + ] + } + }, + { + "name": "PausedDeposits", + "type": { + "kind": "struct", + "fields": [ + { + "name": "is_paused", + "type": "bool" + } + ] + } + }, + { + "name": "PausedFills", + "type": { + "kind": "struct", + "fields": [ + { + "name": "is_paused", + "type": "bool" + } + ] + } + }, + { + "name": "RelayedRootBundle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root_bundle_id", + "type": "u32" + }, + { + "name": "relayer_refund_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "slow_relay_root", + "type": { + "array": ["u8", 32] + } + } + ] + } + }, + { + "name": "RelayerRefundLeaf", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_to_return", + "type": "u64" + }, + { + "name": "chain_id", + "type": "u64" + }, + { + "name": "refund_amounts", + "type": { + "vec": "u64" + } + }, + { + "name": "leaf_id", + "type": "u32" + }, + { + "name": "mint_public_key", + "type": "pubkey" + }, + { + "name": "refund_addresses", + "type": { + "vec": "pubkey" + } + } + ] + } + }, + { + "name": "RequestV3SlowFillParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "relay_data", + "type": { + "defined": { + "name": "V3RelayData" + } + } + } + ] + } + }, + { + "name": "RequestedV3SlowFill", + "type": { + "kind": "struct", + "fields": [ + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "origin_chain_id", + "type": "u64" + }, + { + "name": "deposit_id", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_deadline", + "type": "u32" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "message_hash", + "type": { + "array": ["u8", 32] + } + } + ] + } + }, + { + "name": "RootBundle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "relayer_refund_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "slow_relay_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "claimed_bitmap", + "type": "bytes" + } + ] + } + }, + { + "name": "Route", + "type": { + "kind": "struct", + "fields": [ + { + "name": "enabled", + "type": "bool" + } + ] + } + }, + { + "name": "SetXDomainAdmin", + "type": { + "kind": "struct", + "fields": [ + { + "name": "new_admin", + "type": "pubkey" + } + ] + } + }, + { + "name": "State", + "type": { + "kind": "struct", + "fields": [ + { + "name": "paused_deposits", + "type": "bool" + }, + { + "name": "paused_fills", + "type": "bool" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "seed", + "type": "u64" + }, + { + "name": "number_of_deposits", + "type": "u32" + }, + { + "name": "chain_id", + "type": "u64" + }, + { + "name": "current_time", + "type": "u32" + }, + { + "name": "remote_domain", + "type": "u32" + }, + { + "name": "cross_domain_admin", + "type": "pubkey" + }, + { + "name": "root_bundle_id", + "type": "u32" + }, + { + "name": "deposit_quote_time_buffer", + "type": "u32" + }, + { + "name": "fill_deadline_buffer", + "type": "u32" + } + ] + } + }, + { + "name": "TransferLiability", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pending_to_hub_pool", + "type": "u64" + } + ] + } + }, + { + "name": "V3FundsDeposited", + "type": { + "kind": "struct", + "fields": [ + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "destination_chain_id", + "type": "u64" + }, + { + "name": "deposit_id", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "quote_timestamp", + "type": "u32" + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_deadline", + "type": "u32" + }, + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "message", + "type": "bytes" + } + ] + } + }, + { + "name": "V3RelayData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "exclusive_relayer", + "type": "pubkey" + }, + { + "name": "input_token", + "type": "pubkey" + }, + { + "name": "output_token", + "type": "pubkey" + }, + { + "name": "input_amount", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "origin_chain_id", + "type": "u64" + }, + { + "name": "deposit_id", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "fill_deadline", + "type": "u32" + }, + { + "name": "exclusivity_deadline", + "type": "u32" + }, + { + "name": "message", + "type": "bytes" + } + ] + } + }, + { + "name": "V3RelayExecutionEventInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "updated_recipient", + "type": "pubkey" + }, + { + "name": "updated_message_hash", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "updated_output_amount", + "type": "u64" + }, + { + "name": "fill_type", + "type": { + "defined": { + "name": "FillType" + } + } + } + ] + } + }, + { + "name": "V3SlowFill", + "type": { + "kind": "struct", + "fields": [ + { + "name": "relay_data", + "type": { + "defined": { + "name": "V3RelayData" + } + } + }, + { + "name": "chain_id", + "type": "u64" + }, + { + "name": "updated_output_amount", + "type": "u64" + } + ] + } + } + ] +} diff --git a/src/svm/v2/solanaProgramUtilsV2.ts b/src/svm/v2/solanaProgramUtilsV2.ts new file mode 100644 index 000000000..850701870 --- /dev/null +++ b/src/svm/v2/solanaProgramUtilsV2.ts @@ -0,0 +1,140 @@ +import { BorshEventCoder, Idl, utils } from "@coral-xyz/anchor"; +import web3, { + Address, + Commitment, + GetTransactionApi, + Signature, + Slot, + TransactionError, + UnixTimestamp, +} from "@solana/web3-v2.js"; + +type GetTransactionReturnType = ReturnType; + +type GetSignaturesForAddressConfig = Readonly<{ + /** start searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block. */ + before?: Signature; + commitment?: Exclude; + /** maximum transaction signatures to return (between 1 and 1,000). Default: 1000 */ + limit?: number; + /** The minimum slot that the request can be evaluated at */ + minContextSlot?: Slot; + /** search until this transaction signature, if found before limit reached */ + until?: Signature; +}>; + +type GetSignaturesForAddressTransaction = { + /** estimated production time of when transaction was processed. null if not available. */ + blockTime: UnixTimestamp | null; + /** The transaction's cluster confirmation status */ + confirmationStatus: Commitment | null; + /** Error if transaction failed, null if transaction succeeded. */ + err: TransactionError | null; + /** Memo associated with the transaction, null if no memo is present */ + memo: string | null; + /** transaction signature as base-58 encoded string */ + signature: Signature; + /** The slot that contains the block with the transaction */ + slot: Slot; +}; + +/** + * Reads all events for a specific program. + */ +export async function readProgramEvents( + rpc: web3.Rpc>, + program: Address, + anchorIdl: Idl, + finality: Commitment = "confirmed", + options: GetSignaturesForAddressConfig = { limit: 1000 } +) { + const allSignatures: GetSignaturesForAddressTransaction[] = []; + + // Fetch all signatures in sequential batches + while (true) { + const signatures = await rpc.getSignaturesForAddress(program, options).send(); + allSignatures.push(...signatures); + + // Update options for the next batch. Set before to the last fetched signature. + if (signatures.length > 0) { + options = { ...options, before: signatures[signatures.length - 1].signature }; + } + + if (options.limit && signatures.length < options.limit) break; // Exit early if the number of signatures < limit + } + + // Fetch events for all signatures in parallel + const eventsWithSlots = await Promise.all( + allSignatures.map(async (signatureTransaction) => { + const events = await readEvents(rpc, signatureTransaction.signature, program, anchorIdl, finality); + + return events.map((event) => ({ + ...event, + confirmationStatus: signatureTransaction.confirmationStatus || "Unknown", + blockTime: signatureTransaction.blockTime || 0, + signature: signatureTransaction.signature, + slot: signatureTransaction.slot, + name: event.name || "Unknown", + })); + }) + ); + return eventsWithSlots.flat(); +} + +/** + * Reads events from a transaction. + */ +export async function readEvents( + rpc: web3.Rpc>, + txSignature: Signature, + programId: Address, + programIdl: Idl, + commitment: Commitment = "confirmed" +) { + const txResult = await rpc.getTransaction(txSignature, { commitment, maxSupportedTransactionVersion: 0 }).send(); + + if (txResult === null) return []; + + return processEventFromTx(txResult, programId, programIdl); +} + +/** + * Processes events from a transaction. + */ +async function processEventFromTx( + txResult: GetTransactionReturnType, + programId: Address, + programIdl: Idl +): Promise<{ program: Address; data: any; name: string | undefined }[]> { + if (!txResult) return []; + const eventAuthorities: Map = new Map(); + const events: { program: Address; data: any; name: string | undefined }[] = []; + const [pda] = await web3.getProgramDerivedAddress({ programAddress: programId, seeds: ["__event_authority"] }); + eventAuthorities.set(programId, pda); + + const messageAccountKeys = txResult.transaction.message.accountKeys; + + for (const ixBlock of txResult.meta?.innerInstructions ?? []) { + for (const ix of ixBlock.instructions) { + const ixProgramId = messageAccountKeys[ix.programIdIndex]; + const singleIxAccount = ix.accounts.length === 1 ? messageAccountKeys[ix.accounts[0]] : undefined; + if ( + ixProgramId !== undefined && + singleIxAccount !== undefined && + programId == ixProgramId && + eventAuthorities.get(ixProgramId.toString()) == singleIxAccount + ) { + const ixData = utils.bytes.bs58.decode(ix.data); + const eventData = utils.bytes.base64.encode(Buffer.from(new Uint8Array(ixData).slice(8))); + let event = new BorshEventCoder(programIdl).decode(eventData); + events.push({ + program: programId, + data: event?.data, + name: event?.name, + }); + } + } + } + + return events; +}