### Example GET Request for Transaction Details Source: https://docs.socket.tech/api This is an example of how to make a GET request to the `/getDetailsByTxHash` endpoint, specifying the transaction hash as a query parameter. ```http GET /getDetailsByTxHash?txHash=0x1c1eddc12771a9f9a9d9b2882c0d7012fcf9b8ee2bb85a76fcb77ce4226340b8 ``` -------------------------------- ### CURL Request Example Source: https://docs.socket.tech/api-reference/get-timeout-details This example demonstrates how to make a GET request to the timeout endpoint using cURL. It shows the base URL and the 'Accept' header. ```bash curl -L 'https://api-evmx-devnet.socket.tech/timeout' \ -H 'Accept: application/json' ``` -------------------------------- ### Install Foundry Dependencies Source: https://docs.socket.tech/getting-started Install the required Foundry dependencies for the project. ```bash forge install ``` -------------------------------- ### Get Addresses Example Request Source: https://docs.socket.tech/api Example GET request to retrieve onchain and forwarder addresses using AppGateway contract details and chain slug. ```http GET /getAddresses?appGatewayAddress=0xD6E4aA932147A3FE5311dA1b67D9e73da06F9cEf&contractId=0xbeca3ec2d1dd91b46d9eccba1f77d96f5e4fe32fc344efb846bbf5cbad45e19e&chainSlug=421614 ``` -------------------------------- ### Get Trigger Details - CURL Request Example Source: https://docs.socket.tech/api-reference/get-trigger-details This example shows how to make a GET request to the trigger endpoint using cURL. It includes the necessary URL and headers. ```curl curl -L 'https://api-evmx-devnet.socket.tech/inbox' \ -H 'Accept: application/json' ``` -------------------------------- ### Get Forwarder Address Example Request Source: https://docs.socket.tech/api Example GET request to retrieve the forwarder address for a specific onchain address and chain. ```http GET /getForwarderAddress?onChainAddress=0x7Fe1141202de13F6884d2A50612DC7685eC68640&chainSlug=421614" ``` -------------------------------- ### cURL Request Example Source: https://docs.socket.tech/api-reference/get-payload-details This example demonstrates how to make a request to the payload endpoint using cURL. Ensure the Accept header is set to application/json. ```bash curl -L 'https://api-evmx-devnet.socket.tech/payload' \ -H 'Accept: application/json' ``` -------------------------------- ### Successful Response Example Source: https://docs.socket.tech/api-reference/get-payload-details This is an example of a successful response when retrieving payload details. It includes hash, creation, and update timestamps. ```json { "prevDigestsHash": "0x5b3110a56c258b59d9c2b743755ad7365bf2769d3b1e9179d7ac7ac117f6af41", "createdAt": "2025-04-25T09:10:54.067Z", "updatedAt": "2025-04-25T09:11:21.028Z" } ``` -------------------------------- ### Example Timeout Request Source: https://docs.socket.tech/api This is an example of an HTTP GET request to the /timeout endpoint, querying for timeout details using a specific 'timeoutId'. ```http GET /timeout?timeoutId=0x0000002b4b5bcb38014cbdf852ae6429871e0b1ac0a05df80000000000000074 ``` -------------------------------- ### Example Contract Deployment with IsPlug Source: https://docs.socket.tech/writing-apps Demonstrates deploying contracts with and without SOCKET infrastructure integration. Use IsPlug.YES for contracts needing direct SOCKET communication, and IsPlug.NO for internal-only contracts. ```Solidity // For contracts requiring SOCKET communication _deploy(multichainContract, chainSlug_, IsPlug.YES); // For contracts that only need internal calls _deploy(someHelperContract, chainSlug_, IsPlug.NO); ``` -------------------------------- ### Get Trigger Details - Success Response Example Source: https://docs.socket.tech/api-reference/get-trigger-details This example shows a successful response when retrieving trigger details. It includes transaction status, on-chain hash, call ID, chain slug, plug address, payload, and execution details. ```json { "status": "string", "response": [ { "status": "Executed", "onChainTxHash": "0xc48db420119faf3abd6417711bc80ed1435d506411ebd0ff9c42a95b6dc10735", "callId": "0x00066eeecfd84fb831faca500101decab714ba9d8f012613000000000000000f", "chainSlug": 421614, "plug": "0x62e16f19ddcfb0fb30330d5e130da4f6b73d5432", "payload": { "appGateway": "0xcfd84fb831faca500101decab714ba9d8f012613", "payload": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005", "params": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "ExecutionDetails": { "appGatewayTxHash": "0xc6f4e87e88c7c6a17379564e7525464b337b702b2b68a723d71508666185257e", "simulationStatus": "SIMULATION_SUCCESS", "revertString": "" } } ] } ``` ```json { "status": "SUCCESS", "response": [ { "status": "Executed", "onChainTxHash": "0xc48db420119faf3abd6417711bc80ed1435d506411ebd0ff9c42a95b6dc10735", "callId": "0x00066eeecfd84fb831faca500101decab714ba9d8f012613000000000000000f", "chainSlug": 421614, "plug": "0x62e16f19ddcfb0fb30330d5e130da4f6b73d5432", "payload": { "appGateway": "0xcfd84fb831faca500101decab714ba9d8f012613", "payload": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005", "params": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "ExecutionDetails": { "appGatewayTxHash": "0xc6f4e87e88c7c6a17379564e7525464b337b702b2b68a723d71508666185257e", "simulationStatus": "SIMULATION_SUCCESS", "revertString": "" } } ] } ``` -------------------------------- ### Example Timeout Response Source: https://docs.socket.tech/api This is an example of a successful response from a timeout-related API call, detailing a resolved timeout record. ```json { "status": "SUCCESS", "response": [ { "id": 180, "timeoutId": "0x0000002b4b5bcb38014cbdf852ae6429871e0b1ac0a05df80000000000000074", "target": "0xeeadf7db616a5acc6031687b1fe4ed40f5feb55e", "payload": "0x292f3da50000000000000000000000000000000000000000000000000000000067c87ec4", "executeAt": 1741192910, "executedAt": 1741192912, "isResolved": true, "status": "RESOLVED", "resolveTxHash": "0x743831d51a632036459d948152c27fc876a998dd477774361cc749496c1c62bf", "simulationStatus": "NO", "revertString": null, "originTxHash": "0xd82a8e5d191b2cc0f3d98c32ba83ce9db7c287581833705598dcaeaddd2cdc1f", "createdAt": "2025-03-05T16:41:40.052Z", "updatedAt": "2025-03-05T16:41:50.456Z" } ] } ``` -------------------------------- ### Example API Response Source: https://docs.socket.tech/api This is an example of a successful API response for a transaction, showing its status, payload details, and fee information. Note the 'callType' field which can indicate 'DEPLOY' for on-chain deployments. ```json { "apiStatus": "SUCCESS", "response": [ { "status": "REVERTING", "Payloads": [ { "payloadId": "0x00066eee82dc804b1a84474266d59e1ccd51fae43b4df19b000000000000001f", "chainSlug": 421614, "target": "0x82dc804b1a84474266d59e1ccd51fae43b4df19b", "payload": "0x052c5084...00000", "callType": "WRITE", "executeDetails": { "executeTxHash": "0x0e1b95a6258666ba8ab50ab86891df9b1761b9b55320e1ed18d85f40d59c51ee", "executionStatus": "PROMISE_RESOLVED", "returnData": "0x", "callbackTxHash": "0x0e1b95a6258666ba8ab50ab86891df9b1761b9b55320e1ed18d85f40d59c51ee" }, "simulationDetails": { "executeSimulationStatus": "SIMULATION_SUCCESS", "executeRevertString": "", "callbackSimulationStatus": "SIMULATION_SUCCESS", "callbackRevertString": "" } } ], "feesInfo": { "feePoolChain": 421614, "feePoolToken": "ETH", "maxFees": "0.001", "fee": "0.00001" } } ] } ``` -------------------------------- ### Deploy Settlement Contracts Source: https://docs.socket.tech/eip7683 Deploys the required settlement contracts across multiple chains using a provided chain slug. This is a setup function for new deployments. ```Solidity function deployContracts(uint32 chainSlug) external async { _deploy(settlementId, chainSlug); } ``` -------------------------------- ### Get Transaction Details by Hash (cURL) Source: https://docs.socket.tech/api-reference/get-details-by-tx-hash Use this cURL command to send a GET request to the API endpoint to retrieve transaction details. Ensure you replace the placeholder with the actual transaction hash. ```bash curl -L 'https://api-evmx-devnet.socket.tech/getDetailsByTxHash?txHash=YOUR_TX_HASH' \ -H 'Accept: application/json' ``` -------------------------------- ### Successful Transaction Details Response Source: https://docs.socket.tech/api-reference/get-details-by-tx-hash This example shows a successful response when retrieving transaction details. It includes completed write and read payloads, along with fee information. ```json { "status": "string", "response": [ { "status": "COMPLETED", "writePayloads": [ { "payloadId": "0x1cc09d4b5d6fc66447c7ef6551e1f0e576133f3b4924671105b64c77700531ee", "chainSlug": 11155420, "batchCount": 356, "target": "0x853939f827a2a3ae7c27fd57783af1dea7a75885", "callType": "WRITE", "payload": "0xe8927fbc", "simulationDetails": { "executeSimulationStatus": "NO", "executeRevertString": null, "callbackSimulationStatus": "SIMULATION_SUCCESS", "callbackRevertString": "" }, "executeDetails": { "isExecuted": true, "executeTxHash": "0xde6f06c616ffe018ae492aaa638c42320dcbaa758150266dee813f2c9e8aa37f", "executeStatus": "EXECUTED", "returnData": "0x0000000000000000000000000000000000000000000000000000000000000003" }, "callBackDetails": { "callbackTxHash": "0xed4a1ab8ef0558be6d900d76db8e47fbb6715e1f44b9b4b48c4f8233998eef96", "callbackStatus": "PROMISE_RESOLVED" }, "finalizeDetails": { "finalizeTxHash": "0x625fccf51cf5c289bd36a0066f671daa71eb21cabe70774565dc3731493d54f2", "finalizeStatus": "FINALIZED" } } ], "readPayloads": [ { "payloadId": "0x6ea9df682fd227782ea250143d1322af2f83d9ba12c4e19ba4fe36987bfaa556", "chainSlug": 421614, "target": "0xd5ea574941b024fb3d4be542908bd67367d75137", "batchCount": 378, "callType": "READ", "payload": "0x5e383d210000000000000000000000000000000000000000000000000000000000000008", "simulationDetails": { "executeSimulationStatus": "SIMULATION_SUCCESS", "executeRevertString": "", "callbackSimulationStatus": "SIMULATION_SUCCESS", "callbackRevertString": "" }, "executeDetails": { "isExecuted": true, "returnData": "0x0000000000000000000000000000000000000000000000000000000000000007" }, "callBackDetails": { "callbackTxHash": "0x3d566266f4552d89784e18659021abe8589ffff7eaae9d58bcfe4fc41f66d8c8", "callbackStatus": "PROMISE_RESOLVED" } } ], "feeInfo": { "feePoolChain": 0, "feePoolToken": "string", "feePoolTokenName": "string", "maxFees": "string", "fee": "string" }, "requestCount": 0 } ] } ``` -------------------------------- ### Bad Request Error Response Source: https://docs.socket.tech/api-reference/get-timeout-details This example illustrates the response format for a bad request, typically due to invalid input parameters like an incorrect transaction hash. ```json { "error": "Invalid transaction hash" } ``` -------------------------------- ### Successful Timeout Details Response Source: https://docs.socket.tech/api-reference/get-timeout-details This example shows a successful response when querying timeout details. It includes a 'status' field and an array of 'response' objects, each containing detailed information about a timeout transaction. ```json { "status": "string", "response": [ { "id": 686, "timeoutId": "0x0000002bebda834fac9ca4b86add442083c1650f8497edcb00000000000002c6", "target": "0xfc8520c008f1a9b05989f0773c0115839995c194", "payload": "0xbaaa06f3000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000680b532c", "executeAt": 1745577652, "executedAt": null, "isResolved": null, "status": "ADDED_TO_QUEUE", "resolveTxHash": null, "simulationStatus": "NO", "revertString": null, "originTxHash": "0x289e0a1cc4fb420f0cd700ac38495dccd35a146756e7c065b7a0f18d65a9695d", "createdAt": "2025-04-25T09:17:32.295Z", "updatedAt": "2025-04-25T09:17:32.295Z" } ] } ``` ```json { "status": "SUCCESS", "response": [ { "id": 686, "timeoutId": "0x0000002bebda834fac9ca4b86add442083c1650f8497edcb00000000000002c6", "target": "0xfc8520c008f1a9b05989f0773c0115839995c194", "payload": "0xbaaa06f3000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000680b532c", "executeAt": 1745577652, "executedAt": null, "isResolved": null, "status": "ADDED_TO_QUEUE", "resolveTxHash": null, "simulationStatus": "NO", "revertString": null, "originTxHash": "0x289e0a1cc4fb420f0cd700ac38495dccd35a146756e7c065b7a0f18d65a9695d", "createdAt": "2025-04-25T09:17:32.295Z", "updatedAt": "2025-04-25T09:17:32.295Z" } ] } ``` -------------------------------- ### Successful Payload Details Response (Alternative Status) Source: https://docs.socket.tech/api-reference/get-payload-details This JSON object shows an alternative successful response, where the 'status' field is set to 'SUCCESS'. It contains the same detailed payload information as the previous example. ```json { "status": "SUCCESS", "response": { "id": 2222, "payloadId": "0xe878de8efff3688aaa2da0aecde6442e31e494621a1461355069b9b7b12b8c8b", "requestCount": 256, "batchCount": 369, "payloadCount": 653, "asyncPromise": "0x0ecea1cF732ccb6F2b485Fd726bFA297a26947dC", "chainSlug": 11155420, "target": "0x853939f827a2a3ae7c27fd57783af1dea7a75885", "payload": "0xe8927fbc", "value": "0", "appGateway": "0x2c3783588FFECD25F936AA036432D408CBFF057B", "deadline": 1745572577, "isParallel": false, "writeFinality": 0, "isReadAnchorBlockNumber": true, "readAt": 0, "finalizeTxHash": "0xcd95da822ff81dd2a3654922355e789adee6d00a511c4b366da94a93441d3bf5", "finalizeStatus": "FINALIZED", "isFinalized": true, "executeTxHash": "0x2b7b03b99754a974da4b885004d2324daab815e900ac5120adf693f8552e3826", "submitOrderTxHash": null, "executeStatus": "EXECUTED", "isExecuted": true, "executeSimulationStatus": "NO", "executeRevertString": null, "callbackTxHash": "0x52af4b47e02b33d709fd7fd17fe4a5b54091e7caef410d50f268638a76d6caca", "callbackStatus": "PROMISE_RESOLVED", "callbackSimulationStatus": "SIMULATION_SUCCESS", "callbackRevertString": "", "isCallbackCompleted": true, "callType": 1, "returnData": "0x000000000000000000000000000000000000000000000000000000000000000d", "proof": "0x36166ad86a4f8e5471f9f401f00b6d2c31c9332e49874d2e9cd331540e07e0f51301bf0def0e00a16b1fe9096d2a4994a21bbbbeef161f838c15fe761a035bcb1c", "gasLimit": 10000000, "estimatedGasLimit": null, "digest": "0x682169aa7ce5b255e9b078f34a43fa979c79cfcaddd6e957723fdb39b8134a7f", "switchboard": "0xd94741a4654953817faee228739a6d10c0683839" } } ``` -------------------------------- ### Set Up Environment Variables Source: https://docs.socket.tech/getting-started Copy the .env.sample file and add your private key to the .env file. ```bash cp .env.sample .env vi .env ``` -------------------------------- ### Clone Starter Kit Repository Source: https://docs.socket.tech/getting-started Clone the starter kit repository which contains the necessary contracts and helper scripts for chain-abstracted deployment. ```bash git clone https://github.com/SocketDotTech/socket-starter-kit cd socket-starter-kit ``` -------------------------------- ### Check Available Credits Balance Source: https://docs.socket.tech/getting-started Verify your available credits balance on the EVMx by running this script. ```bash forge script script/helpers/CheckAvailableCredits.s.sol ``` -------------------------------- ### Initialize SomeContract with Chain-Specific Mint Limits Source: https://docs.socket.tech/deploy Use this contract to define minting logic with a configurable limit. The `initialize` function in the gateway sets this limit dynamically based on the chain. ```solidity contract SomeContract is ERC20, PlugBase { (...) error ExceedsMintLimit(uint256 amount, uint256 limit); uint256 mintLimit; function mint(address to_, uint256 amount_) external onlyOwner { if (amount_ > mintLimit) revert ExceedsMintLimit(amount_, mintLimit); _mint(to_, amount_); } function setMintLimit(uint256 newLimit) external onlyOwner { mintLimit = newLimit; } } ``` ```solidity interface ISomeContract { function setMintLimit(uint256 newLimit) external; } contract SomeContractAppGateway is AppGatewayBase { (...) function initialize(uint32 chainSlug) public override async { uint256 mintLimit; if (chainSlug == 1) { mintLimit = 1 ether; } else { mintLimit = 10 ether; } ISomeContract(forwarderAddresses[someRelevantName][chainSlug]).setMintLimit(mintLimit); } } ``` -------------------------------- ### Deploy Onchain Counter Contracts Source: https://docs.socket.tech/getting-started Deploys and initializes Counter contracts across multiple EVM chains. This command automates the deployment process for Base Sepolia, Arbitrum Sepolia, Optimism Sepolia, Base, Arbitrum, and Optimism. ```bash forge script script/counter/DeployOnchainCounters.s.sol --broadcast --skip-simulation --legacy --with-gas-price 0 ``` -------------------------------- ### Set up Test Environment with DeliveryHelperTest Source: https://docs.socket.tech/write-tests Inherit from DeliveryHelperTest in your test contract to provide the necessary infrastructure for simulating SOCKET Protocol's chain-abstracted components. ```solidity function setUp() public { setUpDeliveryHelper(); } ``` -------------------------------- ### Get Payload Details - Success Response Source: https://docs.socket.tech/api-reference/get-payload-details This snippet shows a successful response from the Get Payload Details API, detailing a processed payload. ```APIDOC ## Get Payload Details ### Description Retrieves detailed information about a specific payload. ### Method GET ### Endpoint /payloads/{payloadId} ### Parameters #### Path Parameters - **payloadId** (string) - Required - The unique identifier of the payload. ### Response #### Success Response (200) - **status** (string) - The status of the request. - **response** (object) - An object containing the payload details. - **id** (integer) - The internal ID of the payload. - **payloadId** (string) - The unique identifier of the payload. - **requestCount** (integer) - The number of requests associated with the payload. - **batchCount** (integer) - The number of batches the payload is part of. - **payloadCount** (integer) - The total count of payloads. - **asyncPromise** (string) - The asynchronous promise identifier. - **chainSlug** (integer) - The identifier for the blockchain chain. - **target** (string) - The target address for the payload. - **payload** (string) - The payload data. - **value** (string) - The value associated with the payload. - **appGateway** (string) - The application gateway address. - **deadline** (integer) - The deadline for the payload execution. - **isParallel** (boolean) - Indicates if the payload processing is parallel. - **writeFinality** (integer) - The write finality setting. - **isReadAnchorBlockNumber** (boolean) - Indicates if anchor block number is read. - **readAt** (integer) - The timestamp when the payload was read. - **finalizeTxHash** (string) - The transaction hash for finalization. - **finalizeStatus** (string) - The status of the finalization. - **isFinalized** (boolean) - Indicates if the payload is finalized. - **executeTxHash** (string) - The transaction hash for execution. - **submitOrderTxHash** (string) - The transaction hash for submitting the order (nullable). - **executeStatus** (string) - The status of the execution. - **isExecuted** (boolean) - Indicates if the payload has been executed. - **executeSimulationStatus** (string) - The simulation status of the execution. - **executeRevertString** (string) - The revert string from execution (nullable). - **callbackTxHash** (string) - The transaction hash for the callback. - **callbackStatus** (string) - The status of the callback. - **callbackSimulationStatus** (string) - The simulation status of the callback. - **callbackRevertString** (string) - The revert string from the callback. - **isCallbackCompleted** (boolean) - Indicates if the callback is completed. - **callType** (integer) - The type of call. - **returnData** (string) - The return data from the call. - **proof** (string) - The proof associated with the payload. - **gasLimit** (integer) - The gas limit for the transaction. - **estimatedGasLimit** (integer) - The estimated gas limit (nullable). - **digest** (string) - The digest of the payload. - **switchboard** (string) - The switchboard address. - **prevDigestsHash** (string) - The hash of previous digests. - **createdAt** (date-time) - The timestamp when the payload was created. - **updatedAt** (date-time) - The timestamp when the payload was last updated. ### Response Example ```json { "status": "SUCCESS", "response": { "id": 2222, "payloadId": "0xe878de8efff3688aaa2da0aecde6442e31e494621a1461355069b9b7b12b8c8b", "requestCount": 256, "batchCount": 369, "payloadCount": 653, "asyncPromise": "0x0ecea1cF732ccb6F2b485Fd726bFA297a26947dC", "chainSlug": 11155420, "target": "0x853939f827a2a3ae7c27fd57783af1dea7a75885", "payload": "0xe8927fbc", "value": "0", "appGateway": "0x2c3783588FFECD25F936AA036432D408CBFF057B", "deadline": 1745572577, "isParallel": false, "writeFinality": 0, "isReadAnchorBlockNumber": true, "readAt": 0, "finalizeTxHash": "0xcd95da822ff81dd2a3654922355e789adee6d00a511c4b366da94a93441d3bf5", "finalizeStatus": "FINALIZED", "isFinalized": true, "executeTxHash": "0x2b7b03b99754a974da4b885004d2324daab815e900ac5120adf693f8552e3826", "submitOrderTxHash": null, "executeStatus": "EXECUTED", "isExecuted": true, "executeSimulationStatus": "NO", "executeRevertString": null, "callbackTxHash": "0x52af4b47e02b33d709fd7fd17fe4a5b54091e7caef410d50f268638a76d6caca", "callbackStatus": "PROMISE_RESOLVED", "callbackSimulationStatus": "SIMULATION_SUCCESS", "callbackRevertString": "", "isCallbackCompleted": true, "callType": 1, "returnData": "0x000000000000000000000000000000000000000000000000000000000000000d", "proof": "0x36166ad86a4f8e5471f9f401f00b6d2c31c9332e49874d2e9cd331540e07e0f51301bf0def0e00a16b1fe9096d2a4994a21bbbbeef161f838c15fe761a035bcb1c", "gasLimit": 10000000, "estimatedGasLimit": null, "digest": "0x682169aa7ce5b255e9b078f34a43fa979c79cfcaddd6e957723fdb39b8134a7f", "switchboard": "0xd94741a4654953817faee228739a6d10c0683839", "prevDigestsHash": "0x5b3110a56c258b59d9c2b743755ad7365bf2769d3b1e9179d7ac7ac117f6af41", "createdAt": "2025-04-25T09:10:54.067Z", "updatedAt": "2025-04-25T09:11:21.028Z" } } ``` ``` -------------------------------- ### Multi-Chain Read Operation with Promises Source: https://docs.socket.tech/promises Demonstrates enabling read mode for balance checks across multiple chains and setting up promise callbacks. Remember to return to write mode after read operations. ```solidity function multiChainOperation() external async returns (bytes32 asyncId) { // Enable read mode for balance checks _setOverrides(Read.ON); // Read balances from multiple chains ISuperToken(chain1Forwarder).balanceOf(msg.sender); ISuperToken(chain2Forwarder).balanceOf(msg.sender); // Set up promise callbacks then(this.chainOperation.selector, abi.encode(1)); then(this.chainOperation.selector, abi.encode(2)); // Consecutive reads on the same chain need to be handled as first come first serve ISuperToken(chain3Forwarder).balanceOf(msg.sender); then(this.chainOperation.selector, abi.encode(3)); ISuperToken(chain3Forwarder).balanceOf(msg.sender); then(this.chainOperation.selector, abi.encode(3)); // Return to write mode for subsequent operations _setOverrides(Read.OFF); } ``` -------------------------------- ### Get Payload Details Source: https://docs.socket.tech/api-reference/get-payload-details Retrieves details for a specific payload by ID. ```APIDOC ## GET /payload ### Description Retrieves details for a specific payload by ID. ### Method GET ### Endpoint https://api-evmx-devnet.socket.tech/payload ### Parameters #### Query Parameters - **payloadId** (string) - Required - ID of the payload to query ### Request Example ``` https://api-evmx-devnet.socket.tech/payload?payloadId=0xe878de8efff3688aaa2da0aecde6442e31e494621a1461355069b9b7b12b8c8b ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "response body" } ``` -------------------------------- ### Get Timeout Details Source: https://docs.socket.tech/api-reference/get-timeout-details Retrieves timeout details by txHash, timeoutId, or target. ```APIDOC ## GET /timeout ### Description Retrieves timeout details based on timeoutId, txHash, or target. ### Method GET ### Endpoint https://api-evmx-devnet.socket.tech/timeout ### Parameters #### Query Parameters - **txHash** (string) - Optional - Transaction hash to query. - **timeoutId** (string) - Optional - Timeout ID to query. - **target** (string) - Optional - Target address to query. ### Response #### Success Response (200) - **status** (string) - Indicates the status of the request. - **response** (object[]) - An array of timeout transaction details. - **id** (integer) - Unique identifier for the timeout record. - **timeoutId** (string) - The ID of the timeout. - **target** (string) - The target address associated with the timeout. - **payload** (string) - The payload of the transaction. - **executeAt** (integer) - Timestamp when the transaction is scheduled to execute. - **executedAt** (integer | null) - Timestamp when the transaction was executed. - **isResolved** (boolean | null) - Indicates if the timeout has been resolved. - **status** (string) - The current status of the timeout. - **resolveTxHash** (string | null) - The transaction hash used to resolve the timeout. - **simulationStatus** (string) - The status of the simulation for the timeout. - **revertString** (string | null) - Information if the transaction reverted. - **originTxHash** (string) - The original transaction hash that initiated the timeout. - **createdAt** (date-time) - Timestamp when the record was created. - **updatedAt** (date-time) - Timestamp when the record was last updated. #### Response Example (200) ```json { "status": "string", "response": [ { "id": 686, "timeoutId": "0x0000002bebda834fac9ca4b86add442083c1650f8497edcb00000000000002c6", "target": "0xfc8520c008f1a9b05989f0773c0115839995c194", "payload": "0xbaaa06f3000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000680b532c", "executeAt": 1745577652, "executedAt": null, "isResolved": null, "status": "ADDED_TO_QUEUE", "resolveTxHash": null, "simulationStatus": "NO", "revertString": null, "originTxHash": "0x289e0a1cc4fb420f0cd700ac38495dccd35a146756e7c065b7a0f18d65a9695d", "createdAt": "2025-04-25T09:17:32.295Z", "updatedAt": "2025-04-25T09:17:32.295Z" } ] } ``` #### Error Response (400) - **error** (string) - Error message indicating an invalid request. #### Response Example (400) ```json { "error": "Invalid transaction hash" } ``` ### Example #### CURL ```bash curl -L 'https://api-evmx-devnet.socket.tech/timeout' \ -H 'Accept: application/json' ``` ``` -------------------------------- ### Initialize Contract with Chain-Specific Parameters Source: https://docs.socket.tech/deploy Allows setting dynamic or chain-specific parameters after deployment by overriding the `initialize` function. This is useful for configuring contracts based on the target chain. ```Solidity function initialize(uint32 chainSlug) public override async { if (chainSlug == 1) { // Fill in some special variable here } } ``` -------------------------------- ### Get EVMx Transaction Details Source: https://docs.socket.tech/api-reference/get-details-by-tx-hash Retrieves detailed information about payloads associated with a transaction hash. ```APIDOC ## GET https://api-evmx-devnet.socket.tech/getDetailsByTxHash ### Description Retrieves detailed information about payloads associated with a transaction hash. ### Method GET ### Endpoint https://api-evmx-devnet.socket.tech/getDetailsByTxHash ### Parameters #### Query Parameters - **txHash** (string) - Required - Transaction hash to query ### Request Example ``` https://api-evmx-devnet.socket.tech/getDetailsByTxHash?txHash=0xaf92e0f81c6d384b39c04401abdf7d07bc2b784434facec8658dc5c06f65f76e ``` ``` -------------------------------- ### Execute Multi-Chain Operations with _executeWriteBatchMultiChain Source: https://docs.socket.tech/write-tests Simulate the complete chain-abstracted delivery process, including bidding, transaction execution, and fee handling, for batches of operations that cannot be read or written synchronously across chains. ```solidity _executeWriteBatchMultiChain(chainSlugs); ``` -------------------------------- ### Get Payload Details Source: https://docs.socket.tech/api-reference/get-payload-details Fetches the details of a payload using its ID. Requires a `payloadId` query parameter. ```APIDOC ## GET /payload ### Description Retrieves the details of a specific payload. ### Method GET ### Endpoint /payload ### Parameters #### Query Parameters - **payloadId** (string) - Required - The unique identifier of the payload. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **prevDigestsHash** (string) - The hash of previous digests. - **createdAt** (string) - The timestamp when the payload was created. - **updatedAt** (string) - The timestamp when the payload was last updated. #### Response Example ```json { "prevDigestsHash": "0x5b3110a56c258b59d9c2b743755ad7365bf2769d3b1e9179d7ac7ac117f6af41", "createdAt": "2025-04-25T09:10:54.067Z", "updatedAt": "2025-04-25T09:11:21.028Z" } ``` #### Error Response (400) - **error** (string) - Error message indicating an invalid request. #### Error Response Example ```json { "error": "Invalid transaction hash" } ``` ``` -------------------------------- ### Extend AppGateway to Deploy and Initialize Multiple Contracts Source: https://docs.socket.tech/deploy This contract extends the AppGateway to deploy both `SomeContract` and `SomeOtherContract`. It initializes `SomeContract`'s mint limit and sets `SomeContract`'s address in `SomeOtherContract`. ```solidity contract SomeContractAppGateway is AppGatewayBase { (...) bytes32 public someOtherRelevantName = _createContractId("someOtherRelevantName"); constructor( address addressResolver_, uint256 fees_, string calldata name_, string calldata symbol_, uint8 decimals_ ) AppGatewayBase(addressResolver_, fees_) { (...) creationCodeWithArgs[someOtherRelevantName] = type(SomeOtherContract).creationCode; } function deployContracts(uint32 chainSlug) external async { _deploy(someRelevantName, chainSlug, IsPlug.YES); _deploy(someOtherRelevantName, chainSlug, IsPlug.YES); } function initialize(uint32 chainSlug) public override async { address someOtherContractForwarder = forwarderAddresses[someOtherRelevantName][chainSlug]; address someContractOnchainAddress = getOnChainAddress(someRelevantName, chainSlug); SomeOtherContract(someOtherContractForwarder).setToken(someContractOnchainAddress); } } ``` -------------------------------- ### Get Trigger Details Source: https://docs.socket.tech/api-reference/get-trigger-details Retrieves details for trigger transactions by providing the transaction hash as a query parameter. ```APIDOC ## GET https://api-evmx-devnet.socket.tech/trigger ### Description Retrieves details for trigger transactions. ### Method GET ### Endpoint https://api-evmx-devnet.socket.tech/trigger ### Parameters #### Query Parameters - **txHash** (string) - Required - Transaction hash to query Example: 0xc48db420119faf3abd6417711bc80ed1435d506411ebd0ff9c42a95b6dc10735 ### Responses #### Success Response (200) - **status** (string) - **response** (object[]) - **status** (string) - **onChainTxHash** (string) - **callId** (string) - **chainSlug** (integer) - **plug** (string) - **payload** (object) - **appGateway** (string) - **payload** (string) - **params** (string) - **ExecutionDetails** (object) - **appGatewayTxHash** (string) - **simulationStatus** (string) - **revertString** (string) #### Success Response Example (200) ```json { "status": "string", "response": [ { "status": "Executed", "onChainTxHash": "0xc48db420119faf3abd6417711bc80ed1435d506411ebd0ff9c42a95b6dc10735", "callId": "0x00066eeecfd84fb831faca500101decab714ba9d8f012613000000000000000f", "chainSlug": 421614, "plug": "0x62e16f19ddcfb0fb30330d5e130da4f6b73d5432", "payload": { "appGateway": "0xcfd84fb831faca500101decab714ba9d8f012613", "payload": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005", "params": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "ExecutionDetails": { "appGatewayTxHash": "0xc6f4e87e88c7c6a17379564e7525464b337b702b2b68a723d71508666185257e", "simulationStatus": "SIMULATION_SUCCESS", "revertString": "" } } ] } ``` #### Error Response (400) - **error** (string) - Error message #### Error Response Example (400) ```json { "error": "Invalid transaction hash" } ``` ``` -------------------------------- ### Deploy AppGateway Contract on EVMx Source: https://docs.socket.tech/getting-started Deploys the CounterAppGateway contract on EVMx. Always include the `--skip-simulation` flag when deploying to EVMx. This flag prevents Foundry from incorrectly estimating gas costs due to EVMx's unique execution model. ```bash forge script script/counter/DeployEVMxCounterApp.s.sol --broadcast --skip-simulation --legacy --with-gas-price 0 ``` -------------------------------- ### Check Foundry Version Source: https://docs.socket.tech/getting-started Check your current Foundry version. This project requires Foundry version 0.2.0 or later. ```bash forge --version ```