Overview
The notify-deposit endpoint notifies the NEAR 1Click API about a completed deposit transaction. This allows NEAR to preemptively verify the deposit, speeding up swap processing.
This endpoint is specifically for NEAR protocol swaps. It’s optional but recommended for faster swap execution.
Endpoint
POST /leokit/notify-deposit
Request
| Header | Value |
|---|
Content-Type | application/json |
Api-Key | Your API key |
Body
{
"txHash": "0x1234567890abcdef...",
"depositAddress": "0xabcdef1234567890..."
}
Parameters
| Parameter | Type | Required | Description |
|---|
txHash | string | Yes | Transaction hash of the deposit (must start with 0x) |
depositAddress | string | Yes | Deposit address provided in the quote (must start with 0x) |
Response
Success (200)
{
"success": true,
"status": "submitted",
"correlationId": "abc123-def456",
"message": "Deposit notification sent to NEAR"
}
| Field | Description |
|---|
success | Whether the notification was accepted |
status | Status from NEAR 1Click API |
correlationId | Tracking ID from NEAR |
message | Human-readable status message |
Error Responses
400 Bad Request
4xx/5xx from NEAR
500 Internal Error
Missing or invalid parameters:{
"error": "Missing required fields: txHash, depositAddress"
}
Or invalid format:{
"error": "Invalid format: txHash and depositAddress must be hex strings starting with 0x"
}
NEAR API error forwarded:{
"error": "NEAR 1Click API error",
"details": { ... }
}
Server error:{
"error": "Failed to notify NEAR about deposit",
"details": "Connection timeout"
}
Example
curl -X POST https://api.leokit.dev/leokit/notify-deposit \
-H "Content-Type: application/json" \
-H "Api-Key: your_api_key" \
-d '{
"txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"depositAddress": "0xabcdef1234567890abcdef1234567890abcdef12"
}'
When to Use
Call this endpoint after broadcasting a deposit transaction for a NEAR-routed swap:
Get Quote
Request a quote with NEAR as the destination or intermediary
Generate Deposit
Call /leokit/deposit to get the deposit address and transaction
Sign & Broadcast
Sign and broadcast the transaction to the source chain
Notify Deposit
Call this endpoint with the transaction hash and deposit address
Track Status
Monitor the swap via /leokit/status
Notes
- This endpoint forwards requests to NEAR’s 1Click API at
https://1click.chaindefuser.com/v0/deposit/submit
- The timeout for NEAR API calls is 10 seconds
- Notification is optional but can significantly speed up swap processing
- Only applicable for swaps routed through the NEAR protocol