Balance

Get the balance of native token for an account or an address in supported blockchain. Planning to support getting balance of non-native tokens in the future.

Blockchain
Supported

Bitcoin

Cosmos

Ethereum

Polygon

Ripple

Solana

Stellar

Cosmos

import core from '@poro-wallet/core';

const node = 'rpc://sentry-01.theta-testnet.polypore.xyz:26657';
const account = core.utils.conversion.toCosmosAddress('cosmos1m7uyxn26sz6w4755k6rch4dc2fj6cmzajkszvn');

const balances = await core.balance.cosmos(node, account);
// =>
// {
//   balance: [
//     {
//         denom: 'ibc/14F9BC3E44B8A9C1BE1FB08980FAB87034C9905EF17CF2F5008FC085218811CC',
//         amount: '118588692285'
//     },
//     {
//         denom: 'uatom',
//         amount: '27588654548'
//     }
//   ],
//   decimals: '1000000'
// }

Ripple

import core from '@poro-wallet/core';

const node = 'https://s.altnet.rippletest.net:51234';
const account = core.utils.conversion.toRippleAddress('rpBsVC5bsS3LiL6TYyrdjLbrQZvTrsx3GK');

const balances = await core.balance.ripple(node, account);
// =>
// [
//     {
//         ticker: 'XRP',
//         amount: '711156248'
//         decimals: '10000000',
//     },
//     {
//         code: 'TST',
//         amount: '25',
//         decimals: '1',
//     },
//     {
//         code: 'USD',
//         amount: '0.3713618336751303',
//         decimals: '1',
//     }
// ]

Stellar

import core from '@poro-wallet/core';

const node = 'https://horizon-testnet.stellar.org';
const account = core.utils.conversion.toStellarAddress('GCZAOJPVYN5KTBUI6LJ5P7NCP4A43ZGQMBV2O6FB4MY7PD7J5XEU3P2X');

const balances = await core.balance.stellar(node, account);
// =>
// {
//   balance: [
//     {
//         code: 'BSE',
//         amount: '1000000000'
//     },
//     {
//         code: 'XLM',
//         amount: '99628393293'
//     }
//   ],
//   decimals: '10000000'
// }

Last updated