### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/unit/about-unit/supported-assets Perform an HTTP GET request on a documentation page URL with the `ask` query parameter to get dynamic answers. The question should be specific and in natural language. ```http GET https://docs.hyperunit.xyz/unit/about-unit/supported-assets.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/faq/can-i-generate-multiple-deposit-addresses-for-my-hyperliquid-wallet To get more information not directly on the page, make an HTTP GET request to the page URL with the `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.hyperunit.xyz/faq/can-i-generate-multiple-deposit-addresses-for-my-hyperliquid-wallet.md?ask= ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://docs.hyperunit.xyz/faq/wheres-my-transaction Perform an HTTP GET request to query documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language to get direct answers and relevant excerpts. ```HTTP GET https://docs.hyperunit.xyz/faq/wheres-my-transaction.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.hyperunit.xyz/faq/what-if-my-deposit-fails Use this method to ask questions about the documentation dynamically. Include your specific question as the value for the 'ask' query parameter. ```http GET https://docs.hyperunit.xyz/faq/what-if-my-deposit-fails.md?ask= ``` -------------------------------- ### Query Documentation via GET Request Source: https://docs.hyperunit.xyz/developers/api To get additional information not directly present on a page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. The response includes a direct answer and relevant excerpts. ```http GET https://docs.hyperunit.xyz/developers/api.md?ask= ``` -------------------------------- ### Agent Instructions: Querying Documentation Source: https://docs.hyperunit.xyz/how-to/revert/reverting-evm-transactions Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific and self-contained. ```http GET https://docs.hyperunit.xyz/how-to/revert/reverting-evm-transactions.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.hyperunit.xyz/architecture/quickstart To get information not directly on the page, make an HTTP GET request to the current page URL with an 'ask' query parameter containing your question. ```http GET https://docs.hyperunit.xyz/architecture/quickstart.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.hyperunit.xyz/faq/what-type-of-bitcoin-deposit-address-does-unit-derive To get more information not present on the page, make an HTTP GET request to the current URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.hyperunit.xyz/faq/what-type-of-bitcoin-deposit-address-does-unit-derive.md?ask= ``` -------------------------------- ### Querying Documentation with GET Request Source: https://docs.hyperunit.xyz/developers/api/withdraw-queue To get additional information not directly present on a page, perform an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.hyperunit.xyz/developers/api/withdraw-queue.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.hyperunit.xyz/architecture/components To get additional information not directly present on a page, perform an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. The response will include an answer and relevant excerpts. ```http GET https://docs.hyperunit.xyz/architecture/components.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.hyperunit.xyz/developers/api/generate-address/guardian-signatures Use this method to ask questions about the documentation when information is not explicitly present. The question should be specific and self-contained. ```http GET https://docs.hyperunit.xyz/developers/api/generate-address/guardian-signatures.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/faq/how-long-does-a-deposit-withdrawal-take Perform an HTTP GET request to query the documentation dynamically. Use this when the answer is not explicitly present, requires clarification, or needs related documentation. ```HTTP GET https://docs.hyperunit.xyz/faq/how-long-does-a-deposit-withdrawal-take.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/developers/api/estimate-fees To get additional information not directly present on the page, make an HTTP GET request to the current URL with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.hyperunit.xyz/developers/api/estimate-fees.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/faq/is-my-unique-deposit-address-permanent Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query the documentation. Use this mechanism when the answer is not explicitly present, clarification is needed, or related sections are desired. ```http GET https://docs.hyperunit.xyz/faq/is-my-unique-deposit-address-permanent.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/legal/terms-of-service Perform an HTTP GET request to the current page URL with the `ask` query parameter to retrieve specific information or clarifications not explicitly present on the page. The question should be specific and self-contained. ```http GET https://docs.hyperunit.xyz/legal/terms-of-service.md?ask= ``` -------------------------------- ### Querying Documentation via API Source: https://docs.hyperunit.xyz/developers/key-addresses/mainnet To get additional information not directly present on the page, make an HTTP GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://docs.hyperunit.xyz/developers/key-addresses/mainnet.md?ask= ``` -------------------------------- ### Query Documentation Source: https://docs.hyperunit.xyz/llms.txt You can query the documentation dynamically by performing an HTTP GET request to a page URL with the `ask` query parameter. This is useful for getting specific answers or related documentation sections not immediately apparent. ```APIDOC ## Query Documentation ### Description Perform an HTTP GET request on a page URL with the `ask` query parameter to dynamically query the documentation. This allows for retrieving specific answers, clarifications, or related documentation sections. ### Method GET ### Endpoint `https://docs.hyperunit.xyz/?ask=` ### Parameters #### Query Parameters - **ask** (string) - Required - Your specific question in natural language. ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/faq/how-do-fees-on-unit-work Perform an HTTP GET request to query the documentation dynamically. Use this when the answer is not explicitly present, you need clarification, or want to retrieve related documentation sections. ```http GET https://docs.hyperunit.xyz/faq/how-do-fees-on-unit-work.md?ask= ``` -------------------------------- ### GET /withdrawal-queue Error Response Source: https://docs.hyperunit.xyz/developers/api/withdraw-queue This JSON object indicates an invalid request was made to the withdrawal queue endpoint. ```json {"error":"invalid request"} ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.hyperunit.xyz/unit/about-unit Perform an HTTP GET request to query documentation dynamically. Use the `ask` query parameter with a specific, self-contained question in natural language. This mechanism is useful when the answer is not explicitly present, requires clarification, or you want to retrieve related documentation sections. ```http GET https://docs.hyperunit.xyz/unit/about-unit.md?ask= ``` -------------------------------- ### GET /withdrawal-queue Successful Response Source: https://docs.hyperunit.xyz/developers/api/withdraw-queue This JSON object details the status of withdrawal operations for Bitcoin and Ethereum. It includes the transaction ID of the last processed operation and the current number of pending operations in the queue for each cryptocurrency. ```json { "bitcoin": { "lastWithdrawQueueOperationTxID": "f15cf8bb590cd7d50dc9d892c9d4d5ba370887f462cd5ac5e61ad2696b19e6cd", "withdrawalQueueLength": 2 }, "ethereum": { "lastWithdrawQueueOperationTxID": "0x95f792c9ba7d31d33b6d631824756e74cd85e6c1cb5d677b4614c324f57c6aa7", "withdrawalQueueLength": 0 } } ``` -------------------------------- ### Get Withdrawal Queue Status Source: https://docs.hyperunit.xyz/developers/api/withdraw-queue Retrieves the current status of the withdrawal queue for Bitcoin and Ethereum. This includes the transaction ID of the last processed withdrawal operation and the number of pending operations in the queue. ```APIDOC ## GET /withdrawal-queue ### Description Retrieves the current status of the withdrawal queue for Bitcoin and Ethereum. This includes the transaction ID of the last processed withdrawal operation and the number of pending operations in the queue. ### Method GET ### Endpoint /withdrawal-queue ### Response #### Success Response (200) - **bitcoin** (object) - Information about the Bitcoin withdrawal queue. - **lastWithdrawQueueOperationTxID** (string) - The transaction ID of the last Bitcoin withdrawal operation. - **withdrawalQueueLength** (integer) - The number of pending Bitcoin withdrawal operations. - **ethereum** (object) - Information about the Ethereum withdrawal queue. - **lastWithdrawQueueOperationTxID** (string) - The transaction ID of the last Ethereum withdrawal operation. - **withdrawalQueueLength** (integer) - The number of pending Ethereum withdrawal operations. #### Response Example ```json { "bitcoin": { "lastWithdrawQueueOperationTxID": "f15cf8bb590cd7d50dc9d892c9d4d5ba370887f462cd5ac5e61ad2696b19e6cd", "withdrawalQueueLength": 2 }, "ethereum": { "lastWithdrawQueueOperationTxID": "0x95f792c9ba7d31d33b6d631824756e74cd85e6c1cb5d677b4614c324f57c6aa7", "withdrawalQueueLength": 0 } } ``` #### Error Response (400) - **error** (string) - Description of the error, e.g., "invalid request". #### Error Response Example ```json {"error":"invalid request"} ``` ``` -------------------------------- ### Generate Bitcoin Deposit Address Source: https://docs.hyperunit.xyz/developers/api/generate-address Use this endpoint to generate a Bitcoin deposit address for a Hyperliquid user. Ensure the destination address is correctly formatted. ```bash curl -X GET https://api.hyperunit-testnet.xyz/gen/bitcoin/hyperliquid/btc/0x99a5F7202c4983a6f0Ca9d8F0526Fcd9d2be9e1D ``` -------------------------------- ### Retrieve All Operations for a User Source: https://docs.hyperunit.xyz/developers/api/operations Use this cURL command to fetch all operations linked to a given Hyperliquid user address. Ensure the address is correctly formatted. ```bash curl -X GET https://api.hyperunit-testnet.xyz/operations/0xa6f1Ef42D335Ec7CbfC39f57269c851568300132 ``` -------------------------------- ### Reverting with require in Solidity Source: https://docs.hyperunit.xyz/how-to/revert/reverting-evm-transactions Utilize the `require` statement to validate conditions before proceeding. If the condition is false, the transaction is reverted with an optional error message. ```solidity pragma solidity ^0.8.0; contract RequireExample { function checkCondition(uint _input) public pure { require(_input > 10, "Input must be greater than 10"); // ... execution continues if condition is met ... } } ``` -------------------------------- ### Successful Response for Estimate Fees Source: https://docs.hyperunit.xyz/developers/api/estimate-fees This JSON object details the estimated fees and processing times for various networks. It includes base fees, deposit and withdrawal fees in both raw values and native units, and estimated transaction times (ETA). ```json { "avalanche": { "base-fee": 1265625000, "deposit-fee-in-units": 0.1333599114583543, "depositEta": "1m", "depositFee": 133359911458354333, "eth-deposit-gas": 21000, "eth-withdrawal-gas": 50000, "priority-fee": 1, "withdrawal-fee-in-units": 0.00006328125005, "withdrawalEta": "4m", "withdrawalFee": 63281250050000 }, "base": { "base-fee": 126562500, "deposit-fee-in-units": 0.0005409764462333, "depositEta": "4m", "depositFee": 540976446233318, "erc20-deposit-eta": "4m", "erc20-deposit-fee": 560149561733318, "erc20-deposit-fee-in-units": 0.0005601495617333, "erc20-deposit-gas": 192528, "erc20-withdrawal-eta": "4m", "erc20-withdrawal-fee": 24379092928764, "erc20-withdrawal-fee-in-units": 0.0000243790929288, "erc20-withdrawal-gas": 170028, "eth-deposit-gas": 21000, "eth-withdrawal-gas": 50000, "priority-fee": 1000000, "withdrawal-fee-in-units": 0.000006378125, "withdrawalEta": "4m", "withdrawalFee": 6378125000000 }, "base-erc20": { "erc20-deposit-eta": "4m", "erc20-deposit-fee": 560149561733318, "erc20-deposit-fee-in-units": 0.0005601495617333, "erc20-deposit-gas": 192528, "erc20-withdrawal-eta": "4m", "erc20-withdrawal-fee": 24379092928764, "erc20-withdrawal-fee-in-units": 0.0000243790929288, "erc20-withdrawal-gas": 170028 }, "bitcoin": { "deposit-fee-in-units": 0.0000257913540678, "deposit-fee-rate-sats-per-vb": 8, "deposit-size-v-bytes": 113, "depositEta": "31m", "depositFee": 2579, "withdrawal-fee-in-units": 0.00000715, "withdrawal-fee-rate-sats-per-vb": 5, "withdrawal-size-v-bytes": 143, "withdrawalEta": "14m", "withdrawalFee": 715 }, "ethereum": { "base-fee": 1265625000, "deposit-fee-in-units": 0.0005648968082093, "depositEta": "3m", "depositFee": 564896808209318, "eth-deposit-gas": 21000, "eth-withdrawal-gas": 50000, "priority-fee": 1002356, "withdrawal-fee-in-units": 0.0000633313678, "withdrawalEta": "7m", "withdrawalFee": 63331367800000 }, "monad": { "base-fee": 126562500000, "deposit-fee-in-units": 39.88305873573031, "depositEta": "1m", "depositFee": 18446744073709551615, "eth-deposit-gas": 21000, "eth-withdrawal-gas": 50000, "priority-fee": 2000000000, "withdrawal-fee-in-units": 0.006428125, "withdrawalEta": "4m", "withdrawalFee": 6428125000000000 }, "plasma": { "base-fee": 1265625000, "deposit-fee-in-units": 9.33611010537424, "depositEta": "1m", "depositFee": 9336110105374240326, "eth-deposit-gas": 21000, "eth-withdrawal-gas": 50000, "priority-fee": 4999999993, "withdrawal-fee-in-units": 0.00031328124965, "withdrawalEta": "4m", "withdrawalFee": 313281249650000 }, "solana": { "deposit-fee-in-units": 0.015111584, "depositEta": "1m", "depositFee": 15111584, "withdrawal-fee-in-units": 0.000008, "withdrawalEta": "4m", "withdrawalFee": 8000 }, "spl": { "deposit-fee-in-units": 0.014257704, "depositEta": "1m", "depositFee": 14257704, "withdrawal-fee-in-units": 0.002815836, "withdrawalEta": "4m", "withdrawalFee": 2815836 }, "zcash": { "deposit-fee-in-units": 0.00581428, "depositEta": "26m", "depositFee": 581428, "withdrawal-fee-in-units": 0.00015, "withdrawalEta": "5m", "withdrawalFee": 15000 } } ``` -------------------------------- ### Reverting with custom error in Solidity Source: https://docs.hyperunit.xyz/how-to/revert/reverting-evm-transactions Define and use custom errors in Solidity for more gas-efficient reverts. This is preferred over string-based reverts in newer Solidity versions. ```solidity pragma solidity ^0.8.4; contract CustomErrorRevert { error InsufficientBalance(uint requested, uint available); function withdraw(uint _amount) public { uint balance = address(this).balance; if (_amount > balance) { revert InsufficientBalance({requested: _amount, available: balance}); } // ... withdraw logic ... } } ``` -------------------------------- ### Using revert in Solidity Source: https://docs.hyperunit.xyz/how-to/revert/reverting-evm-transactions Use the `revert` statement in Solidity to stop execution and undo state changes. This is typically used within `require` or `if` statements to handle error conditions. ```solidity pragma solidity ^0.8.0; contract RevertExample { address public owner; constructor() { owner = msg.sender; } function doSomething(uint _value) public { if (_value == 0) { revert("Value cannot be zero"); } // ... proceed with logic ... } function onlyOwnerFunction() public { require(msg.sender == owner, "Only the owner can call this function"); // ... owner-specific logic ... } } ``` -------------------------------- ### Proposal and Verification Interfaces Source: https://docs.hyperunit.xyz/developers/api/generate-address/guardian-signatures Defines TypeScript interfaces for representing a proposal and the result of a signature verification process. These structures help in organizing data for address generation and validation. ```typescript interface Proposal { destinationAddress: string; destinationChain: string; asset: string; address: string; sourceChain: string; coinType?: string; keyType?: string; } interface VerificationResult { success: boolean; verifiedCount: number; errors?: string[]; verificationDetails?: { [nodeId: string]: boolean }; } ``` -------------------------------- ### Retrieve Operations by Address Source: https://docs.hyperunit.xyz/developers/api/operations Fetches all operations associated with a given address. This endpoint is useful for tracking transaction statuses and details for a specific user. ```APIDOC ## GET /operations/:address ### Description Retrieves all operations associated with a specific address. This is useful for tracking the status and details of transactions linked to a user. ### Method GET ### Endpoint /operations/:address #### Path Parameters - **address** (String) - Required - The address associated with the operations to retrieve. ### Request Example ```bash curl -X GET https://api.hyperunit-testnet.xyz/operations/0xa6f1Ef42D335Ec7CbfC39f57269c851568300132 ``` ### Response #### Success Response (200) - **addresses** (Array) - A list of addresses with associated signatures. - **sourceCoinType** (String) - The type of coin used as the source. - **destinationChain** (String) - The destination chain for the operation. - **address** (String) - The specific address. - **signatures** (Object) - An object containing signatures from different nodes. - **field-node** (String) - Signature from the field node. - **hl-node-testnet** (String) - Signature from the Hyperliquid testnet node. - **node-1** (String) - Signature from node 1. - **operations** (Array) - A list of operations associated with the address. - **opCreatedAt** (String) - Timestamp when the operation was created. - **operationId** (String) - Unique identifier for the operation. - **protocolAddress** (String) - The address of the protocol. - **sourceAddress** (String) - The originating address of the transaction. - **destinationAddress** (String) - The destination address for the transaction. - **sourceChain** (String) - The source chain of the operation. - **destinationChain** (String) - The destination chain of the operation. - **sourceAmount** (String) - The amount transferred from the source. - **destinationFeeAmount** (String) - The fee amount for the destination chain. - **sweepFeeAmount** (String) - The sweep fee amount. - **stateStartedAt** (String) - Timestamp when the operation state started. - **stateUpdatedAt** (String) - Timestamp when the operation state was last updated. - **stateNextAttemptAt** (String) - Timestamp for the next state attempt. - **sourceTxHash** (String) - The transaction hash on the source chain. - **sourceTxConfirmations** (Integer) - Number of confirmations on the source transaction. - **destinationTxHash** (String) - The transaction hash on the destination chain. - **broadcastAt** (String) - Timestamp when the transaction was broadcast. - **asset** (String) - The asset being transferred. - **state** (String) - The current state of the operation. #### Response Example ```json { "addresses": [ { "sourceCoinType": "bitcoin", "destinationChain": "hyperliquid", "address": "tb1pncsdk2979x2nksu5mvf9uu6z0v0a7632ss5vuw3fu4wv8805d09sjd7m3e", "signatures": { "field-node": "KU9w0QF1/lJECrkPSz8ssUmcWpD6ZshftuONYSO/ockUgeovGgmAPKbBBBLt4A0X0WsqaTaFYwEQcRyTGp7xWQ==", "hl-node-testnet": "/lElUTMr/4q7QBV6fur2b4LqV7c9DCMDHnMZiC73XO5WOfy46Q+t+2ZmbiPCaW7THLW9r13otiVCjeb/zAfAKA==", "node-1": "PXtxH2B/KtCaceEeAD9/pZ37c+Ryv4FmdC7QeN1AB+D1HzjhDtJs75P4Xi3YQB4pP46ycyZkhXnz65AJvFahuA==" } } ], "operations": [ { "opCreatedAt": "2025-03-12T23:42:27Z", "operationId": "", "protocolAddress": "tb1pncsdk2979x2nksu5mvf9uu6z0v0a7632ss5vuw3fu4wv8805d09sjd7m3e", "sourceAddress": "tb1qkwl2vjeplzj76qz544qzenl26w0fscsfmxlews", "destinationAddress": "", "sourceChain": "bitcoin", "destinationChain": "hyperliquid", "sourceAmount": "10000000", "destinationFeeAmount": "0", "sweepFeeAmount": "0", "stateStartedAt": "0001-01-01T00:00:00Z", "stateUpdatedAt": "0001-01-01T00:00:00Z", "stateNextAttemptAt": "0001-01-01T00:00:00Z", "sourceTxHash": "1c6f6abc977ec3ba381ad99f3903a258eaae366adf7c7a7627ef159357cd67a6", "sourceTxConfirmations": 0, "destinationTxHash": "", "asset": "btc", "state": "sourceTxDiscovered" } ] } ``` #### Error Response (400) ```json { "error": "Invalid input address" } ``` ``` -------------------------------- ### Generate Address API Source: https://docs.hyperunit.xyz/llms.txt This API allows you to generate a unique address for depositing or withdrawing assets. ```APIDOC ## Generate Address ### Description Generate an address for deposit/withdrawal. This endpoint is part of the Unit Protocol public APIs. ### Endpoint `/developers/api/generate-address.md` ``` -------------------------------- ### Proposal Payload Generation (New) Source: https://docs.hyperunit.xyz/developers/api/generate-address/guardian-signatures Generates a Uint8Array payload from a proposal object for newer systems, particularly for Ethereum-related proposals. It formats the payload based on coin type and destination. ```typescript function newProposalToPayload(nodeId: string, proposal: Proposal): Uint8Array { const payloadString = `${nodeId}:${[ 'user', proposal.coinType, proposal.destinationChain, proposal.destinationAddress, proposal.address ].join('-')}`; return new TextEncoder().encode(payloadString); } ```