Add setWallet function for typescript compatibility
In typescript, getters and setters must accept/return the same type. In order to accept a string, a new function must be made since Matic.wallet is of the type Web3.Account
MODIFY
src/index.js
src/index.js
@@ -95,6 +95,11 @@ export default class Matic {
this._parentWeb3.eth.accounts.wallet.add(_wallet)
}
+ setWallet(_wallet) {
+ this._web3.eth.accounts.wallet.add(_wallet)
+ this._parentWeb3.eth.accounts.wallet.add(_wallet)
+ }
+
//
// Actions
//

Add setWallet function for typescript compatibility

In typescript, getters and setters must accept/return the same type. In order to accept a string, a new function must be made since Matic.wallet is of the type Web3.Account