example - add proof api value in config
MODIFY
examples/config.js
examples/config.js
@@ -40,5 +40,5 @@ module.exports = {
user2: {
address: process.env.USER2_FROM
},
- proofApi: process.env.PROOF_API
+ proofApi: process.env.PROOF_API || 'https://apis.matic.network/'
}

MODIFY
examples/pos/erc20/withdraw_exit_faster.js
examples/pos/erc20/withdraw_exit_faster.js
+const { setProofApi } = require("@maticnetwork/maticjs");
const { pos } = require('../../config');
-const { getPOSClient, from } = require('../../utils');
+const { getPOSClient, proofApi } = require('../../utils');
+
+setProofApi(proofApi);
const execute = async () => {
const client = await getPOSClient();
const erc20Token = client.erc20(pos.parent.erc20, true);
- const result = await erc20Token.withdrawExitFaster('0x2ad031ed56a12f917d20e056c06b0d60bf83665b7ac26b8d40b1bef93f922fdc');
+ const result = await erc20Token.withdrawExitFaster(
+ '0x2ad031ed56a12f917d20e056c06b0d60bf83665b7ac26b8d40b1bef93f922fdc'
+ );
const txHash = await result.getTransactionHash();
console.log("txHash", txHash);
+
const receipt = await result.getReceipt();
console.log("receipt", receipt);

MODIFY
examples/utils.js
examples/utils.js
@@ -44,4 +44,5 @@ module.exports = {
from: config.user1.address,
privateKey: config.user1.privateKey,
to: config.user2.address,
+ proofApi: config.proofApi
}

example - add proof api value in config