use baseToken in `isDeposited`
MODIFY
package.json
package.json
{
"name": "@maticnetwork/maticjs",
- "version": "3.0.0-beta.8",
+ "version": "3.0.0-beta.12",
"description": "Javascript developer library for interacting with Matic Network",
"main": "dist/npm.export.js",
"types": "dist/ts/index.d.ts",

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

MODIFY
src/pos/root_chain_manager.ts
src/pos/root_chain_manager.ts
@@ -42,7 +42,7 @@ export class RootChainManager extends BaseToken<IPOSClientConfig> {
return this.method(
"processedExits", exitHash
).then(method => {
- return method.read<boolean>();
+ return this.processRead<boolean>(method);
});
}

MODIFY
src/utils/bridge_client.ts
src/utils/bridge_client.ts
import BN from "bn.js";
import { Web3SideChainClient } from "../utils";
import { ExitUtil } from "../pos";
+import { BaseToken } from "..";
export class BridgeClient<T> {
@@ -27,17 +28,20 @@ export class BridgeClient<T> {
isDeposited(depositTxHash: string) {
const client = this.client;
- return client.getABI(
- "StateReceiver",
- "genesis",
- ).then(abi => {
- const contract = client.child.getContract(
- client.abiManager.getConfig("Matic.GenesisContracts.StateReceiver"),
- abi
- );
+
+ const token = new BaseToken({
+ address: client.abiManager.getConfig("Matic.GenesisContracts.StateReceiver"),
+ isParent: false,
+ name: 'StateReceiver',
+ bridgeType: 'genesis'
+ }, client);
+
+ return token.getContract().then(contract => {
return Promise.all([
client.parent.getTransactionReceipt(depositTxHash),
- contract.method("lastStateId").read<string>()
+ token['processRead']<string>(
+ contract.method("lastStateId")
+ )
]);
}).then(result => {
const [receipt, lastStateId] = result;

MODIFY
test/package-lock.json
test/package-lock.json
}
},
"@maticnetwork/maticjs-web3": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.4.0.tgz",
- "integrity": "sha512-Cxa/sQy3GIo8b9KQax8IWmX3GHVNKgQSuxfswBh5eS4gsu4Y2mw3SLU9pdeD0OatfbW28LiCasHU4EzOZF7iAg==",
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.5.0.tgz",
+ "integrity": "sha512-qg3QJWCVqucHpTS1RCXI2mgNCrRCoCm9ClwG/nKsGJzwSFFAXIFl/+/lWuhJ7DXe8SYYt0JxfDOBSbHatwWOSQ==",
"requires": {
"web3": "^1.6.0"
}

MODIFY
test/package.json
test/package.json
"webpack-cli": "^4.2.0"
},
"dependencies": {
- "@maticnetwork/maticjs-web3": "^0.4.0",
+ "@maticnetwork/maticjs-web3": "^0.5.0",
"@truffle/hdwallet-provider": "^1.5.1-alpha.1",
"mochapack": "^2.1.2"
}

use baseToken in `isDeposited`