Get approve info
curl --request GET \
--url https://api-v2.rubic.exchange/api/utility/checkApproveimport requests
url = "https://api-v2.rubic.exchange/api/utility/checkApprove"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-v2.rubic.exchange/api/utility/checkApprove', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.rubic.exchange/api/utility/checkApprove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.rubic.exchange/api/utility/checkApprove"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.rubic.exchange/api/utility/checkApprove")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.rubic.exchange/api/utility/checkApprove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"needApprove": true,
"message": "<string>",
"transaction": {
"approvalAddress": "<string>",
"permit2Address": "<string>",
"data": "<string>",
"to": "<string>",
"value": "<string>",
"depositAddress": "<string>",
"amountToSend": "<string>",
"extraFields": {},
"exchangeId": "<string>",
"tonMessages": [
{
"address": "<string>",
"amount": "<string>",
"payload": "<string>",
"stateInit": "<string>"
}
],
"psbt": "<string>",
"signInputs": [
123
],
"feeLimit": 123,
"callValue": "<string>",
"signature": "<string>",
"arguments": [
"<string>"
],
"rawParameter": "<string>",
"transaction": "<string>"
}
}{
"needApprove": true,
"message": "<string>",
"transaction": {
"approvalAddress": "<string>",
"permit2Address": "<string>",
"data": "<string>",
"to": "<string>",
"value": "<string>",
"depositAddress": "<string>",
"amountToSend": "<string>",
"extraFields": {},
"exchangeId": "<string>",
"tonMessages": [
{
"address": "<string>",
"amount": "<string>",
"payload": "<string>",
"stateInit": "<string>"
}
],
"psbt": "<string>",
"signInputs": [
123
],
"feeLimit": 123,
"callValue": "<string>",
"signature": "<string>",
"arguments": [
"<string>"
],
"rawParameter": "<string>",
"transaction": "<string>"
}
}Utility
Get approve info
This endpoint determines whether a token approval is required on the specified blockchain. If approval is needed, it returns all transaction data required to execute the approval on-chain.
GET
/
api
/
utility
/
checkApprove
Get approve info
curl --request GET \
--url https://api-v2.rubic.exchange/api/utility/checkApproveimport requests
url = "https://api-v2.rubic.exchange/api/utility/checkApprove"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-v2.rubic.exchange/api/utility/checkApprove', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.rubic.exchange/api/utility/checkApprove",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.rubic.exchange/api/utility/checkApprove"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.rubic.exchange/api/utility/checkApprove")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.rubic.exchange/api/utility/checkApprove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"needApprove": true,
"message": "<string>",
"transaction": {
"approvalAddress": "<string>",
"permit2Address": "<string>",
"data": "<string>",
"to": "<string>",
"value": "<string>",
"depositAddress": "<string>",
"amountToSend": "<string>",
"extraFields": {},
"exchangeId": "<string>",
"tonMessages": [
{
"address": "<string>",
"amount": "<string>",
"payload": "<string>",
"stateInit": "<string>"
}
],
"psbt": "<string>",
"signInputs": [
123
],
"feeLimit": 123,
"callValue": "<string>",
"signature": "<string>",
"arguments": [
"<string>"
],
"rawParameter": "<string>",
"transaction": "<string>"
}
}{
"needApprove": true,
"message": "<string>",
"transaction": {
"approvalAddress": "<string>",
"permit2Address": "<string>",
"data": "<string>",
"to": "<string>",
"value": "<string>",
"depositAddress": "<string>",
"amountToSend": "<string>",
"extraFields": {},
"exchangeId": "<string>",
"tonMessages": [
{
"address": "<string>",
"amount": "<string>",
"payload": "<string>",
"stateInit": "<string>"
}
],
"psbt": "<string>",
"signInputs": [
123
],
"feeLimit": 123,
"callValue": "<string>",
"signature": "<string>",
"arguments": [
"<string>"
],
"rawParameter": "<string>",
"transaction": "<string>"
}
}Query Parameters
Blockchain name
Available options:
MUMBAI, BSCT, GOERLI, FUJI, SCROLL_SEPOLIA, ARTHERA, SEPOLIA, BERACHAIN_TESTNET, BLAST_TESTNET, HOLESKY, UNICHAIN_SEPOLIA_TESTNET, ETH, BSC, POLYGON, AVALANCHE, MOONRIVER, FANTOM, HARMONY, ARBITRUM, AURORA, TELOS, OPTIMISM, CRONOS, OKX, GNOSIS, FUSE, MOONBEAM, CELO, BOBA, BOBA_BSC, ASTAR_EVM, KAVA, BITGERT, OASIS, METIS, DEFIKINGDOMS, KLAYTN, VELAS, SYSCOIN, ETHEREUM_CLASSIC, FLARE, IOTEX, THETA, ZK_SYNC, PULSECHAIN, LINEA, BASE, MANTLE, MANTA_PACIFIC, SCROLL, ZETACHAIN, BLAST, HORIZEN_EON, MERLIN, ROOTSTOCK, MODE, ZK_FAIR, ZK_LINK, XLAYER, TAIKO, SEI, CORE, BAHAMUT, BITLAYER, GRAVITY, FRAXTAL, BERACHAIN, SONEIUM, UNICHAIN, MORPH, HEMI, PLASMA, MONAD, HYPER_EVM, MEGAETH, BITCOIN_CASH, NEAR, ICP, CARDANO, AION, ALGORAND, APTOS, ARDOR, ARK, ASTAR, COSMOS, BAND_PROTOCOL, BITCOIN_DIAMOND, BSV, BITCOIN_GOLD, CASPER, DASH, DECRED, DIGI_BYTE, DIVI, DOGECOIN, POLKADOT, MULTIVERS_X, FIO_PROTOCOL, FIRO, FLOW, HEDERA, HELIUM, ICON, IOST, IOTA, KADENA, KOMODO, KUSAMA, LISK, LITECOIN, TERRA, TERRA_CLASSIC, MINA_PROTOCOL, NANO, NEO, OSMOSIS, PIVX, POLYX, QTUM, THOR_CHAIN, RAVENCOIN, SIA, SECRET, STEEM, STRATIS, STACKS, SOLAR, VE_CHAIN, WAVES, WAX, DX_CHAIN, E_CASH, NEM, STELLAR, MONERO, RIPPLE, TEZOS, VERGE, SYMBOL, ZCASH, HORIZEN, ZILLIQA, KAVA_COSMOS, FILECOIN, EOS, ONTOLOGY, XDC, STARKNET, TON, SOLANA, BITCOIN, TRON, SUI Address of ERC20 token
Owner wallet address
Address of spender contract
Non wei amount for approve
Example:
10.5