π©Limit Order Buy Token
Place Buy order at a particular rate
API https://api.autosnipe.ai/sniper-api/limit/buy
Request Method Post
Request Headers
Name
Value
x-autosnipe-apikey
<YOUR_API_KEY>
x-autosnipe-signature
generated Signature
Content-Type
'application/json'
Request Params
Name
Type
Description
amount*
number
amount in SOL to be bought
token_address*
string
token address to buy
chain_id*
number
0 - Solana
platform*
number
0 - Raydium
rate*
number
Rate at which order is to be placed
expiry_date
epoch
Order will expire if not placed by this time
jito_tip
number
tip for faster confirmation in SOL
Response Params
{
"status": 1,
"message": "Limit Order placed Successfully",
"data": <limitOrderId>
}status - (api status, 1 on success, 0 on failure)
data - limitOrderId generated on successful request
let body = {amount, jito_tip, rate, expiry_date, token_address, platform, chain_id}
callAuthAPI("/limit/buy", body, "POST")// Example in curl
#!/bin/bash
API_KEY="<YOUR_API_KEY>"
API_SECRET="<YOUR_API_SECRET>"
BASE_URL="https://api.autosnipe.ai/sniper-api"
END_POINT="/limit/buy"
# Replace these variables with actual values
amount="your_amount"
jito_tip="your_jito_tip"
token_address="your_token_address"
platform="your_platform"
chain_id="0"
rate="your_rate"
expiry_date="expiry_date"
TIME_STAMP_NONCE=$(date +%s000)
URL="$BASE_URL$END_POINT"
# Prepare body
BODY=$(cat <<EOF
{
"url": "$URL",
"timeStamp_nonce": "$TIME_STAMP_NONCE",
"amount": "$amount",
"jito_tip": "$jito_tip",
"token_address": "$token_address",
"platform": "$platform",
"chain_id": "$chain_id",
"rate": "$rate",
"expiry_date": "$expiry_date"
}
EOF
)
# Create the payload
CONTENT=$(cat <<EOF
{
"url": "$URL",
"timeStamp_nonce": "$TIME_STAMP_NONCE",
"body": "$BODY"
}
EOF
)
PAYLOAD=$(echo -n "$CONTENT" | base64)
# Create the signature
SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha512 -hmac "$API_SECRET" | sed 's/^.* //')
# Make the curl request
curl -X POST "$URL" \
-H "x-autosnipe-apikey: $API_KEY" \
-H "x-autosnipe-signature: $SIGNATURE" \
-H "Content-Type: application/json" \
-d "$BODY"
Last updated