> For the complete documentation index, see [llms.txt](https://hinkal-team.gitbook.io/hinkal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hinkal-team.gitbook.io/hinkal/hinkal-api/api-reference/deposit.md).

# Deposit

## Build a deposit transaction (public → shielded)

> Returns an unsigned transaction that moves tokens from the caller's public balance\
> into their Hinkal shielded balance.\
> \
> \*\*EVM / Tron\*\*: Returns an unsigned \`txData\` object (EVM \`TransactionRequest\` shape or\
> Tron transaction object). Authorized by a normal mode session (secp256k1 request signature via \`x-hinkal-request-signature\`\
> header) or an EIP-712 mode session with a per-transaction EIP-712 typed-data signature\
> (primary type \`Deposit\`).\
> \
> \*\*Solana\*\*: Returns \`txData\` as a base64-encoded serialized transaction for the client\
> to sign and broadcast. Only \*\*one token\*\* is supported per Solana deposit. Authorized by a\
> normal mode session (secp256k1 request signature) or a per-transaction ed25519 plain-text signature.\
> \
> \*\*Normal mode\*\*: include \`sessionId\` and \`nonce\` in the body; add\
> \`x-hinkal-request-signature: secp256k1\_sign(SHA256("POST /deposit\n" + JSON.stringify(body)))\` header.\
> \
> \*\*EIP-712 mode\*\*: include \`sessionId\`, \`nonce\`, and \`signature\` in the body.<br>

```json
{"openapi":"3.0.3","info":{"title":"Hinkal API","version":"1.0.0"},"tags":[{"name":"Deposit"}],"servers":[{"url":"https://api.hinkal.io","description":"Production"}],"paths":{"/deposit":{"post":{"operationId":"deposit","summary":"Build a deposit transaction (public → shielded)","description":"Returns an unsigned transaction that moves tokens from the caller's public balance\ninto their Hinkal shielded balance.\n\n**EVM / Tron**: Returns an unsigned `txData` object (EVM `TransactionRequest` shape or\nTron transaction object). Authorized by a normal mode session (secp256k1 request signature via `x-hinkal-request-signature`\nheader) or an EIP-712 mode session with a per-transaction EIP-712 typed-data signature\n(primary type `Deposit`).\n\n**Solana**: Returns `txData` as a base64-encoded serialized transaction for the client\nto sign and broadcast. Only **one token** is supported per Solana deposit. Authorized by a\nnormal mode session (secp256k1 request signature) or a per-transaction ed25519 plain-text signature.\n\n**Normal mode**: include `sessionId` and `nonce` in the body; add\n`x-hinkal-request-signature: secp256k1_sign(SHA256(\"POST /deposit\\n\" + JSON.stringify(body)))` header.\n\n**EIP-712 mode**: include `sessionId`, `nonce`, and `signature` in the body.\n","tags":["Deposit"],"parameters":[{"$ref":"#/components/parameters/XHinkalRequestSignatureNormalMode"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","format":"uuid","description":"Session identifier from POST /create-session"},"nonce":{"type":"string","format":"uuid","description":"Per-request UUID. Echoed back in the response."},"signature":{"type":"string","description":"EIP-712 or ed25519 signature (EIP-712 mode only; omit for normal mode)"},"chainId":{"type":"integer"},"tokenAddresses":{"type":"array","items":{"type":"string"},"description":"One or more token addresses. Solana supports exactly one token per deposit.\n"},"amounts":{"type":"array","items":{"type":"string"},"description":"Amounts in smallest units, index-aligned with tokenAddresses"}},"required":["sessionId","nonce","chainId","tokenAddresses","amounts"]}}}},"responses":{"200":{"description":"Unsigned deposit transaction.\n- EVM/Tron: `txData` is an EVM TransactionRequest or Tron transaction object.\n- Solana: `txData` is a base64-encoded serialized transaction.\n","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"txData":{"oneOf":[{"$ref":"#/components/schemas/EvmTransactionRequest"},{"type":"string","description":"Base64-encoded serialized transaction (Solana)"}]},"nonce":{"type":"string","description":"Echoed per-request `nonce` from the request, added before signing."}},"required":["success","txData","nonce"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/NonceConflict"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"XHinkalRequestSignatureNormalMode":{"name":"x-hinkal-request-signature","in":"header","required":false,"schema":{"type":"string"},"description":"Required for **normal mode** sessions: hex-encoded compact secp256k1 signature `secp256k1_sign(SHA256(binding + \"\\n\" + JSON.stringify(body)))`, where `binding` is `\"POST <routePath>\"` for this endpoint. Omit for **EIP-712 mode** sessions — include `signature` in the request body instead. See [Authentication](/enclave-api/authentication) for the full signing scheme."}},"schemas":{"EvmTransactionRequest":{"type":"object","description":"Unsigned EVM transaction request (ethers TransactionRequest shape)","properties":{"type":{"type":"integer","description":"Transaction type (0 = legacy, 2 = EIP-1559)"},"to":{"type":"string","description":"Target contract address"},"from":{"type":"string","description":"Sender address (may be omitted)"},"nonce":{"type":"integer","description":"Not set by the server — client must fill before signing"},"gasLimit":{"type":"string","description":"Max gas, as a decimal string"},"gasPrice":{"type":"string","description":"Gas price — present on legacy (type 0) transactions only"},"maxFeePerGas":{"type":"string","description":"EIP-1559 max total fee per gas — present on type 2 transactions only"},"maxPriorityFeePerGas":{"type":"string","description":"EIP-1559 max priority fee per gas — present on type 2 transactions only"},"data":{"type":"string","description":"Hex-encoded calldata"},"value":{"type":"string","description":"Native token value in wei, as a decimal string"},"chainId":{"type":"integer"}}},"FailedResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"}},"required":["success","error"]}},"responses":{"BadRequest":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"Unauthorized":{"description":"Invalid signature or reused nonce","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"NonceConflict":{"description":"Request `nonce` already consumed. Each `nonce` is single-use; generate a fresh UUID for every request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}}}}}
```
