Don't forget that this can also be used to the all of the account information.
On line 15 it's possible to just return the account.
In this example show's how to get the User Balance.
import {PhantasmaAPI, Balance} from'phantasma-ts';constCHAIN_NAME="main"; // This is the name of the chain, please don't change it.constNETWORK_API_URL="https://testnet.phantasma.io/rpc"; // for mainnet this should be https://pharpc1.phantasma.io/rpcconstNETWORK_PEER_URL=undefined; // this the peers URL to get the list of peers, if not provided it will use the default one "https://peers.phantasma.io/"constNEXUS_NAME="testnet"; // For mainnet use this "mainnet"constAPI=newPhantasmaAPI(NETWORK_API_URL,NETWORK_PEER_URL,NEXUS_NAME );/** * Get the user balance * @param address Address of the account you want to get the balance * @returns */asyncfunctionGetUserBalance(address) :Promise<Balance[]> {let account =awaitAPI.getAccount(address);returnaccount.balances;}