update deposit ethers example
ADD
examples/node/deposit-ether.js
+const Matic = require('maticjs').default
+const config = require('./config')
+
+const amount = '1000000000000000000' // amount in wei
+const from = config.FROM_ADDRESS // from address
+
+// 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,
+})
+
+matic.wallet = config.PRIVATE_KEY // prefix with `0x`
+
+// deposit ethers
+matic.depositEthers({
+ from,
+ value: amount,
+ onTransactionHash: (hash) => {
+ // action on Transaction success
+ console.log(hash) // eslint-disable-line
+ },
+})

update deposit ethers example