@firefly-exchange/firefly-client
Version:
The Firefly Client Library allows traders to sign, create, retrieve and listen to orders on Firefly Exchange.
24 lines (18 loc) • 768 B
text/typescript
/**
* Checks Native(gas) tokens balance
*/
/* eslint-disable no-console */
import { Networks, FireflyClient, bnStrToBaseNumber } from "../index";
async function main() {
// ensure that account has enough native gas tokens to perform on-chain USDC.mint() call
const dummyAccountKey =
"a182091b4d5a090b65d604e36f68629a692e3bf2aa864bd3f037854034cdd676";
// using TESTNET network, fundGas() does not work on MAINNET
const client = new FireflyClient(true, Networks.TESTNET_ARBITRUM, dummyAccountKey); //passing isTermAccepted = true for compliance and authorizarion
await client.init()
console.log(
"User's balance is: ",
bnStrToBaseNumber(await client.getChainNativeBalance())
);
}
main().then().catch(console.warn);