process exits
MODIFY
README.md
README.md
@@ -120,6 +120,11 @@ await matic.confirmWithdrawERC721(
options // transaction fields
)
+await matic.processExits(
+ tokenAddress, // root `token` addres
+ options // transaction fields
+)
+
```
### How it works?
@@ -160,7 +165,8 @@ Please write to info@matic.network to request TEST tokens for development purpos
- <a href="#startWithdraw"><code>matic.<b>startWithdraw()</b></code></a>
- <a href="#startWithdrawERC721"><code>matic.<b>startWithdrawERC721()</b></code></a>
- <a href="#withdraw"><code>matic.<b>withdraw()</b></code></a>
-- <a href="#confirmWithdrawERC721"><code>matic.<b>confirmWithdrawERC721()</b></code></a>
+- <a href="#confirmWithdrawERC721"><code>matic.<b>confirmWithdrawERC721()</b></code><a>
+- <a href="#processExits"><code>matic.<b>processExits()</b></code><a>
---
<a name="initialize"></a>
@@ -412,6 +418,28 @@ matic.confirmWithdrawERC721("0xabcd...789", {
})
```
+---
+
+<a name="processExits"></a>
+
+#### matic.processExits(rootTokenAddress, options)
+
+Call processExits after completion of challenge period, after that withdrawn funds get transfered to your account on mainchain
+
+- `rootTokenAddress` RootToken address
+- `options` see [more infomation here](#approveERC20TokensForDeposit)
+ - `encodeAbi` must be boolean value. For Byte code of transaction, use `encodeAbi: true`
+
+This returns `Promise` object, which will be fulfilled when transaction gets confirmed (when receipt is generated).
+
+Example:
+
+```js
+matic.processExits("0xabcd...789", {
+ from: "0xABc578455..."
+})
+```
+
### Support
Please write to info@matic.network for integration support. If you have any queries, feedback or feature requests, feel free to reach out to us on telegram: [t.me/maticnetwork](https://t.me/maticnetwork)

MODIFY
src/index.ts
src/index.ts
@@ -179,4 +179,8 @@ export default class Matic extends ContractsBase {
confirmWithdrawERC721(txHash: string, options?: SendOptions) {
return this.withdrawManager.startExitWithBurntERC721Tokens(txHash, options)
}
+
+ processExits(tokenAddress: string, options?: SendOptions) {
+ return this.withdrawManager.processExits(tokenAddress, options)
+ }
}

MODIFY
src/root/WithdrawManager.ts
src/root/WithdrawManager.ts
@@ -100,7 +100,7 @@ export default class WithdrawManager extends ContractsBase {
return this.web3Client.send(txObject, _options)
}
- processExits(token: address, options?: SendOptions) {
+ async processExits(rootTokenAddress: address, options?: SendOptions) {
options = options || {}
if (!options || !options.gas || options.gas < 2000000) {
console.log(
@@ -108,6 +108,20 @@ export default class WithdrawManager extends ContractsBase {
)
options.gas = 2000000
}
+ const txObject = this.withdrawManager.methods.processExits(token)
+
+ const _options = await this._fillOptions(
+ options,
+ txObject,
+ this.web3Client.getParentWeb3(),
+ )
+
+ if (options.encodeAbi) {
+ _options.data = txObject.encodeABI()
+ _options.to = token
+ return _options
+ }
+
return this.web3Client.send(
this.withdrawManager.methods.processExits(token),
options,

process exits