add type in tx config
MODIFY
src/interfaces/transaction_config.ts
src/interfaces/transaction_config.ts
@@ -13,4 +13,5 @@ export interface ITransactionConfig {
hardfork?: string;
maxFeePerGas?: number | string;
maxPriorityFeePerGas?: number | string;
+ type?: string;
}
\ No newline at end of file

MODIFY
src/utils/base_token.ts
src/utils/base_token.ts
@@ -198,10 +198,13 @@ export class BaseToken<T_CLIENT_CONFIG> {
txConfig.gasLimit = Number(gasLimit);
txConfig.nonce = nonce;
if (isEIP1559Supported && isMaxFeeProvided) {
+ client.logger.log("tx config created for EIP1559");
+ // txConfig.type = '0x2';
txConfig.maxFeePerGas = maxFeePerGas;
txConfig.maxPriorityFeePerGas = maxPriorityFeePerGas;
}
else {
+ client.logger.log("tx config created for legacy");
const gasPrice = !txConfig.gasPrice ? await client.getGasPrice() : txConfig.gasPrice;
client.logger.log('gas price calculated', gasPrice);
txConfig.gasPrice = Number(gasPrice);

MODIFY
test/debug.js
test/debug.js
@@ -53,12 +53,15 @@ const execute = async () => {
// );
// return console.log("tokens", tokens);
- // const tx = await goerliERC721Token.approveAll();
-
- const tx = await goerliERC721Token.depositMany(['70362948865848051982628883253610138761681237831617060123833093242173388773544'], from, {
- returnTransaction: true
+ const tx = await goerliERC721Token.approveAll({
+ maxPriorityFeePerGas: 2000000000,
+ // returnTransaction: true
});
- return console.log('tx', tx);
+
+ // const tx = await goerliERC721Token.depositMany(['70362948865848051982628883253610138761681237831617060123833093242173388773544'], from, {
+ // returnTransaction: true
+ // });
+ console.log('tx', tx);
// // setProofApi("https://apis.matic.network")
// // const tx = await goerliERC20Token.withdrawExit('0xd6f7f4c6052611761946519076de28fbd091693af974e7d4abc1b17fd7926fd7');
console.log("txHash", await tx.getTransactionHash());

MODIFY
test/package-lock.json
test/package-lock.json
}
},
"@maticnetwork/maticjs-web3": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.2.0.tgz",
- "integrity": "sha512-cyp5MqIssFN6RxtjmdTq+T0rF+6VlwcjglR0z5KE1BZ+ytOab3syE7YmXnZp8pm/sZ+uh5XV3Ce7e5V52Y36MA==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.4.0.tgz",
+ "integrity": "sha512-Cxa/sQy3GIo8b9KQax8IWmX3GHVNKgQSuxfswBh5eS4gsu4Y2mw3SLU9pdeD0OatfbW28LiCasHU4EzOZF7iAg==",
"requires": {
"web3": "^1.6.0"
}

MODIFY
test/package.json
test/package.json
"webpack-cli": "^4.2.0"
},
"dependencies": {
- "@maticnetwork/maticjs-web3": "^0.2.0",
+ "@maticnetwork/maticjs-web3": "^0.4.0",
"mochapack": "^2.1.2"
}
}

add type in tx config