move depositEther to client
MODIFY
src/plasma/erc20.ts
src/plasma/erc20.ts
@@ -93,7 +93,7 @@ export class ERC20 extends PlasmaToken {
});
}
- depositEther(amount: TYPE_AMOUNT, option: ITransactionOption = {}) {
+ private depositEther__(amount: TYPE_AMOUNT, option: ITransactionOption = {}) {
this.checkForRoot_("depositEther");
return this.contracts_.depositManager.getContract().then(contract => {

MODIFY
src/plasma/index.ts
src/plasma/index.ts
@@ -7,6 +7,7 @@ import { RegistryContract } from "./registry";
import { ExitManager, RootChain } from "../pos";
import { WithdrawManager } from "./withdraw_manager";
import { MATIC_TOKEN_ADDRESS_ON_POLYGON } from "../constant";
+import { TYPE_AMOUNT } from "../types";
export class PlasmaClient extends BridgeClient {
@@ -106,4 +107,11 @@ export class PlasmaClient extends BridgeClient {
);
}
+ depositEther(amount: TYPE_AMOUNT, option: ITransactionOption) {
+ return new ERC20(
+ '', true, this.client_,
+ this.getContracts__()
+ )['depositEther__'](amount, option);
+ }
+
}

MODIFY
src/pos/erc20.ts
src/pos/erc20.ts
@@ -103,7 +103,7 @@ export class ERC20 extends POSToken {
);
}
- depositEther(amount: TYPE_AMOUNT, option: ITransactionOption = {}) {
+ private depositEther__(amount: TYPE_AMOUNT, option: ITransactionOption = {}) {
this.checkForRoot_("depositEther");

MODIFY
src/pos/index.ts
src/pos/index.ts
import { ERC20 } from "./erc20";
import { RootChainManager } from "./root_chain_manager";
-import { BridgeClient, Web3SideChainClient } from "../utils";
-import { IPOSClientConfig } from "../interfaces";
+import { BaseToken, BridgeClient, Web3SideChainClient } from "../utils";
+import { IPOSClientConfig, ITransactionOption } from "../interfaces";
import { ExitManager } from "./exit_manager";
import { RootChain } from "./root_chain";
import { ERC721 } from "./erc721";
+import { TYPE_AMOUNT } from "../types";
export * from "./exit_manager";
export * from "./root_chain_manager";
@@ -77,4 +78,12 @@ export class POSClient extends BridgeClient {
this.exitManager
);
}
+
+ depositEther(amount: TYPE_AMOUNT, option: ITransactionOption) {
+ return new ERC20(
+ '', true, this.client_,
+ this.rootChainManager,
+ this.exitManager
+ )['depositEther__'](amount, option);
+ }
}
\ No newline at end of file

move depositEther to client