orbs-network / ton-access

Unthrottled anonymous RPC access to TON blockchain via a robust decentralized network
MIT License
71 stars 4 forks source link

npm ton and tonweb examples not working (probably due to POST) #2

Closed talkol closed 1 year ago

talkol commented 2 years ago
import { TonClient, Address } from "ton";
import { getHttpEndpoint } from "@orbs-network/ton-gateway";

async function main() {

  const endpoint = await getHttpEndpoint();
  const client = new TonClient({ endpoint });

  // make a query to mainnet
  const address = Address.parseFriendly("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N").address;
  const balance = await client.getBalance(address);

  console.log(balance);
}

main();

throws error: Sorry, the page you are looking for is currently unavailable. (HTTP POST)

talkol commented 2 years ago
import TonWeb from "tonweb";
import { getHttpEndpoint } from "@orbs-network/ton-gateway";

async function main() {

  const endpoint = await getHttpEndpoint();
  const tonweb = new TonWeb(new TonWeb.HttpProvider(endpoint));

  // make a query to mainnet
  const balance = await tonweb.getBalance("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N");

  console.log(balance);
}

main();

also not working, probably same reason

uv-orbs commented 2 years ago

i'll look into it