Discussions

Ask a Question
Back to All

I am trying to use nodejs and get undefined from the request. but the example gives me data.

What can be wrong with this.

async function test() {
let chainId = "56";
let addresses = ["0x9EE8a61b82D12B4E86e792f5a368a3B86f6B1D69"];

// It will only return 1 result for the 1st token address if not called getAccessToken before
let res = await GoPlus.tokenSecurity(chainId, addresses, 30);
if (res.code != ErrorCode.SUCCESS) {
  console.error(res.message);
} else {
  console.log(res.result["0x9EE8a61b82D12B4E86e792f5a368a3B86f6B1D69"]);
}

}
test();

I've been trying all day with all kinds of tricks to get this to work.. But finally I tried the example from website and got ok and information. But when I whanged to BSC chain and try this i get undefined.

But on website I get data
{
"code": 1,
"message": "OK",
"result": {
"0x9ee8a61b82d12b4e86e792f5a368a3b86f6b1d69": {
"anti_whale_modifiable": "1",
"buy_tax": "0.04",
"can_take_back_ownership": "0",
"cannot_buy": "0",
"cannot_sell_all": "0",
"creator_address": "0x7a491dc7cae7f1240f53de2ea38ab205a77b7ac3",
"creator_balance": "30000000",
"creator_percent": "0.030000",
"dex": [
{
"liquidity_type": "UniV2",
"name": "PancakeV2",
"liquidity": "444.85747017",
"pair": "0x1ee6c3394db5e4ae69ca7fd433c77aea4d5e33af"
}
],
"external_call": "0",
"hidden_owner": "0",
"holder_count": "16",
"holders": [
{
"address": "0x1ee6c3394db5e4ae69ca7fd433c77aea4d5e33af",
"tag": "PancakeV2",
"is_contract": 1,
"balance": "528347366.069547316",
"percent": "0.528347366069547316",
"is_locked": 0
},
{
"address": "0x02d07077e0eb0ad69707dae29413466254052421",
"tag": "",
"is_contract": 0,
"balance": "43320350.140972386",
"percent": "0.043320350140972386",
"is_locked": 0
},
{
"address": "0xe1ae8972e4804317b07af6faafd2dc1e3827f202",
"tag": "",
"is_contract": 0,
"balance": "42762085.255772522",
"percent": "0.042762085255772522",
"is_locked": 0
},
{
"address": "0x4ce511053a4fd9a2fd2c484092777db7fc63f977",
"tag": "",
"is_contract": 0,
"balance": "39697755.263459139",
"percent": "0.039697755263459139",
"is_locked": 0
},
{
"address": "0xfeb892b28125439b5ede50d47df4fce42125736d",
"tag": "",
"is_contract": 0,
"balance": "38920207.654885275",
"percent": "0.038920207654885275",
"is_locked": 0
},
{
"address": "0xec098eb5b95bbf7f7f0b5dd807ae064a22ad99ed",
"tag": "",
"is_contract": 0,
"balance": "38403664.838763859",
"percent": "0.038403664838763859",
"is_locked": 0
},
{
"address": "0xd6cb8b3edca7c4ba5e8b44fe022813e355b3616c",
"tag": "",
"is_contract": 0,
"balance": "37871543.262802563",
"percent": "0.037871543262802563",
"is_locked": 0
},
{
"address": "0x9cef029bbd145501b48aa3a0f73be302d2d25404",
"tag": "",
"is_contract": 0,
"balance": "37661651.1963931",
"percent": "0.037661651196393100",
"is_locked": 0
},
{
"address": "0xae70047e5c87270e3d150e0ff222f5e22940d673",
"tag": "",
"is_contract": 0,
"balance": "37266672.262603336",
"percent": "0.037266672262603336",
"is_locked": 0
},
{
"address": "0x91e99935d2d9a33b1baa40494edf3a10171401eb",
"tag": "",
"is_contract": 0,
"balance": "34344675.174133326",
"percent": "0.034344675174133326",
"is_locked": 0
}
],
"honeypot_with_same_creator": "0",
"is_anti_whale": "1",
"is_blacklisted": "0",
"is_honeypot": "0",
"is_in_dex": "1",
"is_mintable": "0",
"is_open_source": "1",
"is_proxy": "0",
"is_whitelisted": "1",
"lp_holder_count": "2",
"lp_holders": [
{
"address": "0x7a491dc7cae7f1240f53de2ea38ab205a77b7ac3",
"tag": "",
"value": null,
"is_contract": 0,
"balance": "0.984885780179609472",
"percent": "0.999999999999998984",
"NFT_list": null,
"is_locked": 0
},
{
"address": "0x0000000000000000000000000000000000000000",
"tag": "Null Address",
"value": null,
"is_contract": 0,
"balance": "0.000000000000001",
"percent": "0.000000000000001015",
"NFT_list": null,
"is_locked": 1
}
],
"lp_total_supply": "0.984885780179610472",
"owner_address": "0x7a491dc7cae7f1240f53de2ea38ab205a77b7ac3",
"owner_balance": "30000000",
"owner_change_balance": "0",
"owner_percent": "0.030000",
"personal_slippage_modifiable": "0",
"selfdestruct": "0",
"sell_tax": "0.9906",
"slippage_modifiable": "1",
"token_name": "SANTA INU",
"token_symbol": "SANTA",
"total_supply": "1000000000",
"trading_cooldown": "0",
"transfer_pausable": "0"
}
}
}

on my computer I get

undefined

What can be the problem?