do not convert chainId to hex
MODIFY
src/utils/base_token.ts
src/utils/base_token.ts
@@ -178,7 +178,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
client.estimateGas(config);
};
txConfig.chainId = !txConfig.chainId ? await client.getChainId() : txConfig.chainId;
- txConfig.chainId = Converter.toHex(txConfig.chainId) as any;
+ // txConfig.chainId = Converter.toHex(txConfig.chainId) as any;
if (isWrite) {
const { maxFeePerGas, maxPriorityFeePerGas } = txConfig;
const isEIP1559Supported = this.client.isEIP1559Supported(isParent);

MODIFY
test/debug.js
test/debug.js
@@ -43,10 +43,10 @@ const execute = async () => {
// return console.log(await client.isDeposited('0xc67599f5c967f2040786d5924ec55d37bf943c009bdd23f3b50e5ae66efde258'));
- // const balance = await mumbaiERC20Token.getBalance(
- // from
- // );
- // return console.log("balance", balance);
+ const balance = await mumbaiERC20Token.getBalance(
+ from
+ );
+ return console.log("balance", balance);
// const tokens = await goerliERC721Token.getAllTokens(
// from

MODIFY
test/specs/erc20.spec.ts
test/specs/erc20.spec.ts
@@ -77,7 +77,8 @@ describe('ERC20', () => {
expect(result).to.have.not.property('maxPriorityFeePerGas')
expect(result).to.have.property('gasPrice')
expect(result['gasPrice']).to.be.an('number').gt(0);
- expect(result).to.have.property('chainId', '0x13881');
+ expect(result).to.have.property('chainId', 80001);
+ expect(result['chainId']).to.be.an('number');
});
it('parent transfer returnTransaction with erp1159', async () => {
@@ -91,7 +92,7 @@ describe('ERC20', () => {
expect(result).to.have.property('maxFeePerGas', 20)
expect(result).to.have.property('maxPriorityFeePerGas', 20)
expect(result).to.have.not.property('gasPrice')
- expect(result).to.have.property('chainId', '0x5');
+ expect(result).to.have.property('chainId', 5);
});

do not convert chainId to hex