Skip to main content

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

Headers

HeaderValue
Content-Typeapplication/json
Api-KeyYour API key

Body

{
  "txHash": "0x1234567890abcdef...",
  "depositAddress": "0xabcdef1234567890..."
}

Parameters

ParameterTypeRequiredDescription
txHashstringYesTransaction hash of the deposit (must start with 0x)
depositAddressstringYesDeposit 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"
}
FieldDescription
successWhether the notification was accepted
statusStatus from NEAR 1Click API
correlationIdTracking ID from NEAR
messageHuman-readable status message

Error Responses

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"
}

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:
1

Get Quote

Request a quote with NEAR as the destination or intermediary
2

Generate Deposit

Call /leokit/deposit to get the deposit address and transaction
3

Sign & Broadcast

Sign and broadcast the transaction to the source chain
4

Notify Deposit

Call this endpoint with the transaction hash and deposit address
5

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