curl --request POST \
--url https://mpc.hex-api.app/relay/deposit \
--header 'Content-Type: application/json' \
--data '
{
"tx": "3b1f6c0e9d2a47c58e6f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f",
"chain": 1100,
"intent_account": "alice.near"
}
'{
"status": "credited",
"chain_id": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT",
"intent_account": "alice.near",
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"near_tx": "2rQmS4n4TxT7GJ26XLDDZEHEmsizLb1ezGC81zr8dpkR"
}Credit a bridge deposit to NEAR Intents
Credits a HOT bridge deposit to its NEAR Intents account: what the old backend’s process_bridge_deposit did.
Give the deposit either by its source tx (tx, chain optional) or by its fields (chain_id, nonce, amount, token_id, receiver_id), plus the intent_account to credit. When tx is present the fields are ignored.
- By tx, the service reads the deposit on chain: the bridge’s
NewTransferlog on EVM, itswasmdeposit event on CosmWasm (Gonka), the treasury’s deposit message in the tonapi trace on TON (any hash of the trace), the bridge’sdepositcall in the envelope on Stellar (Soroban RPC keeps transactions for about a week; send an older one by its fields). Withoutchain, a0xhash is looked for on every EVM chain and a bare hash on Gonka, TON and Stellar. - By fields, nothing is trusted: the deposit is checked on its chain through omni’s AuthCall before it is signed.
The deposit’s receiver must be intent_account’s NEAR Intents receiver (sha256 of {"account_id":"intents.near","msg":"{\"receiver_id\":\"<account>\"}"}, see POST /bridge/register); a checksummed EVM address is also tried lowercased. Then the deposit wallet signs it and a relay account sends mt_deposit_call to v2_1.omni.hot.tg.
Idempotent: a deposit already credited answers already_credited, and a call repeated within 24 hours answers the first NEAR tx. With dry_run: true the deposit is read and signed, and nothing is sent (status: signed).
curl --request POST \
--url https://mpc.hex-api.app/relay/deposit \
--header 'Content-Type: application/json' \
--data '
{
"tx": "3b1f6c0e9d2a47c58e6f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f",
"chain": 1100,
"intent_account": "alice.near"
}
'{
"status": "credited",
"chain_id": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT",
"intent_account": "alice.near",
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"near_tx": "2rQmS4n4TxT7GJ26XLDDZEHEmsizLb1ezGC81zr8dpkR"
}Body
- Option 1
- Option 2
A deposit by its source tx, or by its fields. When tx is present the fields are ignored.
Response
The deposit is credited (now or before), or signed on a dry run.
Chain ids are omni's (v2_1.omni.hot.tg), not always the chain's own: EVM chains use their EIP-155 id (Ethereum 1, Optimism 10, BNB 56, Polygon 137, Monad 143, X Layer 196, Base 8453, Arbitrum 42161, Avalanche 43114, ...); the others have omni's numbers: Solana 1001, NEAR 1010, Stellar 1100, TON 1117 (TON v1, 1111, is dead), Juno 4444118, Gonka 4444119.
x >= 11100
1117
137
4444119