@altiuslabs/tx-sdk 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/rpc.js +2 -2
package/package.json
CHANGED
package/src/rpc.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* RPC Client for Altius
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { num_to_hex, pad_hex } from './utils.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* JSON-RPC client for communicating with Altius node
|
|
@@ -139,7 +139,7 @@ export class RpcClient {
|
|
|
139
139
|
*/
|
|
140
140
|
async get_erc20_balance(token_address, owner_address) {
|
|
141
141
|
// ERC20 balanceOf selector: 0x70a08231
|
|
142
|
-
const data = '0x70a08231' +
|
|
142
|
+
const data = '0x70a08231' + pad_hex(owner_address, 32).slice(2);
|
|
143
143
|
const result = await this.call({ to: token_address, data });
|
|
144
144
|
return BigInt(result);
|
|
145
145
|
}
|