Example Allowance Requests
curl -X POST https://api.dangeracorn.com/sunpump/allowance\
-H "Content-Type: application/json" \
-H "api-key: your-api-key" \
-d '{
"tokenAddress": "token-contract-address",
"userAddress": "sender-public-tron-address"
}'
const axios = require('axios');
const buyRequest = async () => {
const response = await axios.post('https://api.dangeracorn.com/sunpump/allowance', {
tokenAddress: 'token-contract-address',
userAddress: 'sender-public-tron-address'
}, {
headers: {
'Content-Type': 'application/json',
'api-key': 'your-api-key'
}
});
console.log(response.json());
};
buyRequest();
import requests
url = 'https://api.dangeracorn.com/sunpump/allowance'
headers = {
'Content-Type': 'application/json',
'api-key': 'your-api-key'
}
data = {
"tokenAddress": "token-contract-address",
"userAddress": "sender-public-tron-address"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
"fmt"
)
func main() {
data := map[string]interface{}{
"tokenAddress": "token-contract-address",
"userAddress": "sender-public-tron-address",
}
payload, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dangeracorn.com/sunpump/allowance", bytes.NewBuffer(payload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("api-key", "your-api-key")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
<?php
$url = 'https://api.dangeracorn.com/sunpump/allowance';
$data = array(
'tokenAddress' => 'token-contract-address',
'userAddress' => 'sender-public-tron-address'
);
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n" .
"api-key: your-api-key\r\n",
'method' => 'POST',
'content' => json_encode($data),
),
);
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
echo $response;
{
"amount": "999999999000000000000000000000",
"status": "unsigned",
"code": "200"
}
{
"error": "Invalid parameters",
"message": "You must only provide tokenAddress and userAddress",
"code": "400"
}