3. Check Funds
Last updated
[{
"inputs": [{
"internalType": "address",
"name": "",
"type": "address"
}],
"name": "userAccount",
"outputs": [{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
}, {
"internalType": "uint256",
"name": "availableAmount",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}]// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/
var Web3 = require('web3');
const BigNumber = require('bignumber.js');
// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");
const CONTRACT_ADDRESS = "Replace with trading contract address";
const ABI = [{
"inputs": [{
"internalType": "address",
"name": "",
"type": "address"
}],
"name": "userAccount",
"outputs": [{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
}, {
"internalType": "uint256",
"name": "availableAmount",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}];
var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);
contract.methods.userAccount("Replace with User Address").call({
}, function(error, result){
if(!error) {
console.log('Response:', result);
} else {
console.log(error);
}
});# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/
{
"jsonrpc": "2.0",
"id": 1234,
"result": "0x00000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000000006c6b935b8bbd400000"
}{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
"data": "0xea5eda32000000000000000000000000834c673130c085057531f227dcbd375d803d9a98"
},
"latest"
],
"id": 1234
}curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x32c10ce5f9f47ab82141d73a136823d3e20408e0",
"data": "0xea5eda32000000000000000000000000834c673130c085057531f227dcbd375d803d9a98"
},
"latest"
],
"id": 1234
}'