remove transfer custom Ethers on matic
DELETE
examples/node/transfer-matic-ethers.js
-const Matic = require('maticjs').default
-const config = require('./config')
-
-const from = config.FROM_ADDRESS // from address
-const to = '0x7ed7f36694153ba6eff6ca6726b60f6e2bb17fcf' // to address
-const amount = '100000000000000' // amount in wei
-
-// Create object of Matic
-const matic = new Matic({
- maticProvider: config.MATIC_PROVIDER,
- parentProvider: config.PARENT_PROVIDER,
- rootChainAddress: config.ROOTCHAIN_ADDRESS,
- syncerUrl: config.SYNCER_URL,
- watcherUrl: config.WATCHER_URL,
- maticWethAddress: config.MATICWETH_ADDRESS,
-})
-
-matic.wallet = config.PRIVATE_KEY // prefix with `0x`
-
-// Send Matic Ethers
-matic.transferMaticEthers(to, amount, {
- from,
- onTransactionHash: () => {
- // action on Transaction success
- },
-})

MODIFY
src/index.js
src/index.js
@@ -205,27 +205,6 @@ export default class Matic {
return this._wrapWeb3Promise(depositTx.send(_options), options)
}
- async transferMaticEthers(to, amount, options) {
- if (options && (!options.from || !amount || !to)) {
- throw new Error('Missing Parameters')
- }
- const from = options.from
-
- const gasLimit = await this._web3.eth.estimateGas({
- from,
- value: amount,
- })
- options.gasLimit = gasLimit
- options.value = amount
- options.to = to
- const _options = await this._fillOptions(options, {}, this._web3)
-
- return this._wrapWeb3Promise(
- this._web3.eth.sendTransaction(_options),
- options
- )
- }
-
async transferTokens(token, user, amount, options = {}) {
if (options && (!options.from || !amount || !user || !token)) {
throw new Error('Missing Parameters')

remove transfer custom Ethers on matic