⚖️Users Holdings
Returns all the token holdings details of a user
API https://api.autosnipe.ai/sniper-api/user/holdings
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 |
---|---|---|
page | number | 0 - default |
Response Params
{
"status": 1,
"message": "Success!",
"data": {
"holdingsList": {
"5iTrKEyVWiQNoUFfwNZeFCYEwPDgrXCzke9Nz1Dk6g9K": {
"pair_address": "5Un4GXoP85LvucCcx1PFuQrMxL7XasvqefLVAYYGmJ57",
"curr_price": "0.00000004943",
"current_liquidity": 75.62,
"base_name": "VODKA",
"profit": 87013.8508317289,
"token_balance": 0,
"total_buy": 23.22320616,
"on_hold_balance": 0,
"sol_invest": 0.001,
"sol_sold": 0.000999101,
"icon": "https://pbs.twimg.com/profile_images/1816044468845375488/7EPVZrUT_400x400.jpg",
"id": <>,
"isPump": 0,
"metadata": {
"image": "https://pbs.twimg.com/profile_images/1816044468845375488/7EPVZrUT_400x400.jpg",
"supply": 1000000000,
"symbol": "VODKA",
"twitter": "https://x.com/VodkaMemeSol",
"website": "",
"telegram": "https://t.me/VodkaMemeSol",
"isMutable": 0,
"description": "$VODKA is the ultimate Solana meme token for those who love a good laugh and a great investment. Dive into the fun and join our vibrant community as we shake up the crypto world with humor and innovation. Get ready for exhilarating airdrops, exciting partnerships, and a roadmap thats anything but ordinary. $VODKA is here to bring a new twist to the Solana ecosystem. Stay tuned for updates, and let’s toast to a future filled with both profits and punchlines.",
"mintAuthorityAddress": "F76es5rHqE8bqPJf3ZnMMkQqndrkA9MEbAVvFNfVz7sJ",
"freezeAuthorityAddress": "EQFeTo74EyAVUfPu5J112eZJ52eFF8HJ1V3n15rAC47t"
},
"last_updated": "2024-07-24T09:20:53.000Z"
},
.
.
.
},
"isNext": true
}
}
status - (api status, 1 on success, 0 on failure)
holdingsList - Object array of all the tokens user is holding , key - token_address
isNext - false (no more holdings), true - (call with page+1 for more holdings)
let body = {page}
callAuthAPI("/user/holdings", 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="/user/holdings"
# Replace these variables with actual values
page="0"
TIME_STAMP_NONCE=$(date +%s000)
URL="$BASE_URL$END_POINT"
# Prepare body
BODY=$(cat <<EOF
{
"url": "$URL",
"timeStamp_nonce": "$TIME_STAMP_NONCE",
"page": "0"
}
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