You can use the getResourcesToSpend
method to retrieve a list of all the resources (coins + assets) that can be spent by a given address.
const account = new Account(
'0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db',
provider
);
const resourcesToSpend = await account.getResourcesToSpend([
{
amount: bn(2),
assetId: '0x0101010101010101010101010101010101010101010101010101010101010101',
},
]);
expect(resourcesToSpend[0].amount.gt(2)).toBeTruthy();
Was this page helpful?