@firefly-exchange/firefly-client
Version:
The Firefly Client Library allows traders to sign, create, retrieve and listen to orders on Firefly Exchange.
31 lines (25 loc) • 915 B
text/typescript
/**
* Getting user's USDC balance locked in Margin Bank
*/
/* eslint-disable no-console */
import { Networks, FireflyClient } from "../index";
async function main() {
const dummyAccountKey =
"a182091b4d5a090b65d604e36f68629a692e3bf2aa864bd3f037854034cdd676";
// using TESTNET network
const client = new FireflyClient(true, Networks.TESTNET_ARBITRUM, dummyAccountKey); //passing isTermAccepted = true for compliance and authorizarion
await client.init()
// will use margin bank contract from contractAddresses (initialized above)
console.log(
"User's locked USDC in margin bank are: ",
await client.getMarginBankBalance()
);
// will use the provided MarginBank contract address"
console.log(
"User's locked USDC in margin bank are: ",
await client.getMarginBankBalance(
"0xbDd8210d4F74fC97d4E93950a1FF201fe425C68f"
)
);
}
main().then().catch(console.warn);