Skip to content

Commit 721e4e1

Browse files
authored
Merge pull request #80 from virtualeconomy/fix/fix-account-getTokBal
fix: fix method getTokBal in class Account
2 parents 983c18c + 139c185 commit 721e4e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/account.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,11 @@ export class Account {
150150
NOTE that the token ID from the system contract is not supported due to the pre-defined & built-in nature
151151
of system contract.
152152
* @param {string} tokId - The token ID.
153-
* @returns {md.VSYS} The account's effective balance.
153+
* @returns {md.Token} The account's balance of the given token.
154154
*/
155155
async getTokBal(tokId) {
156-
const tc = await tcf.fromTokId(new md.TokenID(tokId), this.chain);
157156
const resp = await this.api.ctrt.getTokBal(this.addr.data, tokId);
158-
return new md.Token(resp.balance, await tc.getUnit());
157+
return md.Token.fromNumber(resp.balance, resp.unity);
159158
}
160159

161160
/**

0 commit comments

Comments
 (0)