Forkast Developer Docs
Forkast SDK Integration Guide
Balance
4 min
this section documents the core interfaces used when working with user balances in forkastsdk functions get balance import { forkastsdk, network, balanceresponse } from "@forkastgg/client"; const sdk = new forkastsdk(network mainnet, "your api key"); const accountservice = sdk getaccountservice(); const balanceservice = sdk getbalanceservice(); const { accesstoken } = await accountservice loginwithprivatekey( "your private key" ); const balances\ balanceresponse = await balanceservice getbalances(accesstoken); console log(balances); parameters field type required description accesstoken string yes access token received from login response types balance represents a user's wallet and proxy wallet balances across different stablecoins and platform tokens interface balanceresponse { id string; createdat string; updatedat string; deletedat string; userid number; balanceusdc string; lockbalanceusdc string; balanceusdt string; lockbalanceusdt string; balancecgpc string; lockbalancecgpc string; walletproxyaddress string; walletaddress string; } key fields field type description id string createdat string iso timestamp of when the balance record was created uppdatedat string iso timestamp of last update deletedat string iso timestamp if the record is soft deleted userid number id of the user balanceusdc number 1 = yes outcome 0 = no outcome lockbalanceusdc number price per unit of outcome token balancecgpc number number of shares to buy/sell lockbalancecgpc number total value (price amount)