Closed mehrdadmms closed 1 month ago
there are 2 problems with your test:
token name should be upper case: try using this instead:
import { Ergo } from './ergo';
const ergo = new Ergo('Testnet');
(async function x() {
ergo['_assetMap'] = {
'$BASS TOKEN': {
tokenId:
'ba553573f83c61be880d79db0f4068177fa75ab7c250ce3543f7e7aeb471a9d2',
} as any,
};
console.log(
await ergo['getAssetBalance'](
{
address: '9how9k2dp67jXDnCM6TeRPKtQrToCs5MYL2JoSgyGHLXm1eHxWs',
} as any,
'$Bass Token',
),
);
})();
the address that you used contains lots of utxos so getting all of them take some time. instead use this address: 9gxhg94hCN4KdnCam6ef8i43eZrhZdohG2ahiRsXk9XU5FpUKbC
Case
When calling getAssetBalance, I set the below configurations. For some addresses, I get 0 and for some other addresses, the code does not exit and doesn't return anything: this is my code:
and my terminal gets stuck like this: