update example as per v3
MODIFY
examples/.env.example
examples/.env.example
-FROM=0x
-PRIVATE_KEY=0x
-USER2_ADDRESS=0x
+USER1_FROM=0x
+USER1_PRIVATE_KEY=0x
+USER2_FROM=0x
ROOT_RPC=
MATIC_RPC=
PROOF_API=

MODIFY
examples/config.js
examples/config.js
@@ -4,6 +4,10 @@ const env = dotenv.config({
path: path.join(__dirname, '.env')
});
+if (env.error) {
+ throw new Error("no env file found");
+}
+
module.exports = {
parent: {
rpc: process.env.ROOT_RPC,
@@ -29,12 +33,12 @@ module.exports = {
WATCHER_URL: 'https://testnetv3-watcher.api.matic.network/api/v1', // Backend service which syncs the Matic Plasma contract events on Ethereum mainchain to a MySQL database which we use for faster querying. This comes in handy especially for listening to asset deposits on the Plasma contract.
user1: {
// '<paste your private key here>' - A sample private key prefix with `0x`
- privateKey: process.env.PRIVATE_KEY,
+ privateKey: process.env.USER1_PRIVATE_KEY,
//'<paste address belonging to private key here>', Your address
- address: process.env.FROM
+ address: process.env.USER1_FROM
},
user2: {
- address: process.env.USER2_ADDRESS
+ address: process.env.USER2_FROM
},
proofApi: process.env.PROOF_API
}

MODIFY
examples/package-lock.json
examples/package-lock.json
}
},
"@maticnetwork/maticjs": {
- "version": "3.0.0-beta.15",
- "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs/-/maticjs-3.0.0-beta.15.tgz",
- "integrity": "sha512-xccRJLow5tOoe+7FCpkyUJBWc/djYdcYrKy9QichlnVN0nSfGAp5lItk7NOuFDlqiH8HJOxeTUjhcle5wh4FYg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs/-/maticjs-3.0.0.tgz",
+ "integrity": "sha512-UOJCzz/jgTDoIkhNducOiVlo8Nk9nyWlgG5eYiicrqXST+lxLIFQpXJEAxLZdnFWO6snpaOetVXGEpMfYlVzTw==",
"requires": {
"eth-sig-util": "^2.5.3",
"ethereumjs-block": "2.2.0",
}
},
"@maticnetwork/maticjs-web3": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.6.0.tgz",
- "integrity": "sha512-dF1wc3VlvwBIIg3hTxN1v64CSwKg3ogcDASGPxVIXPe+hRKYYC2iYmgk0lww4AH7he8eZjRtB7+X1KR2ksh1ig==",
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.8.0.tgz",
+ "integrity": "sha512-GydUqhwwNVnCMfko9ERIgKP56sJq+FQJ+p34wilRDeVz1ca9n+a22yL84X2BYbjgD+o/f27L0tuAYS2/Cz6NjA==",
"requires": {
"web3": "^1.6.0"
}
}
},
"web3": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3/-/web3-1.6.0.tgz",
- "integrity": "sha512-rWpXnO88MiVX5yTRqMBCVKASxc7QDkXZZUl1D48sKlbX4dt3BAV+nVMVUKCBKiluZ5Bp8pDrVCUdPx/jIYai5Q==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3/-/web3-1.6.1.tgz",
+ "integrity": "sha512-c299lLiyb2/WOcxh7TinwvbATaMmrgNIeAzbLbmOKHI0LcwyfsB1eu2ReOIrfrCYDYRW2KAjYr7J7gHawqDNPQ==",
"requires": {
- "web3-bzz": "1.6.0",
- "web3-core": "1.6.0",
- "web3-eth": "1.6.0",
- "web3-eth-personal": "1.6.0",
- "web3-net": "1.6.0",
- "web3-shh": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-bzz": "1.6.1",
+ "web3-core": "1.6.1",
+ "web3-eth": "1.6.1",
+ "web3-eth-personal": "1.6.1",
+ "web3-net": "1.6.1",
+ "web3-shh": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-bzz": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.6.0.tgz",
- "integrity": "sha512-ugYV6BsinwhIi0CsLWINBz4mqN9wR9vNG0WmyEbdECjxcPyr6vkaWt4qi0zqlUxEnYAwGj4EJXNrbjPILntQTQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.6.1.tgz",
+ "integrity": "sha512-JbnFNbRlwwHJZPtVuCxo7rC4U4OTg+mPsyhjgPQJJhS0a6Y54OgVWYk9UA/95HqbmTJwTtX329gJoSsseEfrng==",
"requires": {
"@types/node": "^12.12.6",
"got": "9.6.0",
},
"dependencies": {
"@types/node": {
- "version": "12.20.36",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.36.tgz",
- "integrity": "sha512-+5haRZ9uzI7rYqzDznXgkuacqb6LJhAti8mzZKWxIXn/WEtvB+GHVJ7AuMwcN1HMvXOSJcrvA6PPoYHYOYYebA=="
+ "version": "12.20.37",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.37.tgz",
+ "integrity": "sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA=="
}
}
},
"web3-core": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.6.0.tgz",
- "integrity": "sha512-o0WsLrJ2yD+HAAc29lGMWJef/MutTyuzpJC0UzLJtIAQJqtpDalzWINEu4j8XYXGk34N/V6vudtzRPo23QEE6g==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.6.1.tgz",
+ "integrity": "sha512-m+b7UfYvU5cQUAh6NRfxRzH/5B3to1AdEQi1HIQt570cDWlObOOmoO9tY6iJnI5w4acxIO19LqjDMqEJGBYyRQ==",
"requires": {
"@types/bn.js": "^4.11.5",
"@types/node": "^12.12.6",
"bignumber.js": "^9.0.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-core-requestmanager": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core-helpers": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-core-requestmanager": "1.6.1",
+ "web3-utils": "1.6.1"
},
"dependencies": {
"@types/node": {
- "version": "12.20.36",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.36.tgz",
- "integrity": "sha512-+5haRZ9uzI7rYqzDznXgkuacqb6LJhAti8mzZKWxIXn/WEtvB+GHVJ7AuMwcN1HMvXOSJcrvA6PPoYHYOYYebA=="
+ "version": "12.20.37",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.37.tgz",
+ "integrity": "sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA=="
}
}
},
"web3-core-helpers": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.6.0.tgz",
- "integrity": "sha512-H/IAH/0mrgvad/oxVKiAMC7qDzMrPPe/nRKmJOoIsupRg9/frvL62kZZiHhqVD1HMyyswbQFC69QRl7JqWzvxg==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.6.1.tgz",
+ "integrity": "sha512-om2PZvK1uoWcgMq6JfcSx3241LEIVF6qi2JuHz2SLKiKEW5UsBUaVx0mNCmcZaiuYQCyOsLS3r33q5AdM+v8ng==",
"requires": {
- "web3-eth-iban": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-eth-iban": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-core-method": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.6.0.tgz",
- "integrity": "sha512-cHekyEil4mtcCOk6Q1Zh4y+2o5pTwsLIxP6Bpt4BRtZgdsyPiadYJpkLAVT/quch5xN7Qs5ZwG5AvRCS3VwD2g==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.6.1.tgz",
+ "integrity": "sha512-szH5KyIWIaULQDBdDvevQUCHV9lsExJ/oV0ePqK+w015D2SdMPMuhii0WB+HCePaksWO+rr/GAypvV9g2T3N+w==",
"requires": {
- "@ethereumjs/common": "^2.4.0",
"@ethersproject/transactions": "^5.0.0-beta.135",
- "web3-core-helpers": "1.6.0",
- "web3-core-promievent": "1.6.0",
- "web3-core-subscriptions": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core-helpers": "1.6.1",
+ "web3-core-promievent": "1.6.1",
+ "web3-core-subscriptions": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-core-promievent": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.6.0.tgz",
- "integrity": "sha512-ZzsevjMXWkhqW9dnVfTfb1OUcK7jKcKPvPIbQ4boJccNgvNZPZKlo8xB4pkAX38n4c59O5mC7Lt/z2QL/M5CeQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.6.1.tgz",
+ "integrity": "sha512-byJ5s2MQxrWdXd27pWFmujfzsTZK4ik8rDgIV1RFDFc+rHZ2nZhq+VWk7t/Nkrj7EaVXncEgTdPEHc18nx+ocQ==",
"requires": {
"eventemitter3": "4.0.4"
}
},
"web3-core-requestmanager": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.6.0.tgz",
- "integrity": "sha512-CY5paPdiDXKTXPWaEUZekDfUXSuoE2vPxolwqzsvKwFWH5+H1NaXgrc+D5HpufgSvTXawTw0fy7IAicg8+PWqA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.6.1.tgz",
+ "integrity": "sha512-4y7etYEUtkfflyYVBfN1oJtCbVFNhNX1omlEYzezhTnPj3/dT7n+dhUXcqvIhx9iKA13unGfpFge80XNFfcB8A==",
"requires": {
"util": "^0.12.0",
- "web3-core-helpers": "1.6.0",
- "web3-providers-http": "1.6.0",
- "web3-providers-ipc": "1.6.0",
- "web3-providers-ws": "1.6.0"
+ "web3-core-helpers": "1.6.1",
+ "web3-providers-http": "1.6.1",
+ "web3-providers-ipc": "1.6.1",
+ "web3-providers-ws": "1.6.1"
}
},
"web3-core-subscriptions": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.6.0.tgz",
- "integrity": "sha512-kY9WZUY/m1URSOv3uTLshoZD9ZDiFKReIzHuPUkxFpD5oYNmr1/aPQNPCrrMxKODR7UVX/D90FxWwCYqHhLaxQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.6.1.tgz",
+ "integrity": "sha512-WZwxsYttIojyGQ5RqxuQcKg0IJdDCFpUe4EncS3QKZwxPqWzGmgyLwE0rm7tP+Ux1waJn5CUaaoSCBxWGSun1g==",
"requires": {
"eventemitter3": "4.0.4",
- "web3-core-helpers": "1.6.0"
+ "web3-core-helpers": "1.6.1"
}
},
"web3-eth": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.6.0.tgz",
- "integrity": "sha512-qJMvai//r0be6I9ghU24/152f0zgJfYC23TMszN3Y6jse1JtjCBP2TlTibFcvkUN1RRdIUY5giqO7ZqAYAmp7w==",
- "requires": {
- "web3-core": "1.6.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-core-subscriptions": "1.6.0",
- "web3-eth-abi": "1.6.0",
- "web3-eth-accounts": "1.6.0",
- "web3-eth-contract": "1.6.0",
- "web3-eth-ens": "1.6.0",
- "web3-eth-iban": "1.6.0",
- "web3-eth-personal": "1.6.0",
- "web3-net": "1.6.0",
- "web3-utils": "1.6.0"
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.6.1.tgz",
+ "integrity": "sha512-kOV1ZgCKypSo5BQyltRArS7ZC3bRpIKAxSgzl7pUFinUb/MxfbM9KGeNxUXoCfTSErcCQJaDjcS6bSre5EMKuQ==",
+ "requires": {
+ "web3-core": "1.6.1",
+ "web3-core-helpers": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-core-subscriptions": "1.6.1",
+ "web3-eth-abi": "1.6.1",
+ "web3-eth-accounts": "1.6.1",
+ "web3-eth-contract": "1.6.1",
+ "web3-eth-ens": "1.6.1",
+ "web3-eth-iban": "1.6.1",
+ "web3-eth-personal": "1.6.1",
+ "web3-net": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-eth-abi": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.6.0.tgz",
- "integrity": "sha512-fImomGE9McuTMJLwK8Tp0lTUzXqCkWeMm00qPVIwpJ/h7lCw9UFYV9+4m29wSqW6FF+FIZKwc6UBEf9dlx3orA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.6.1.tgz",
+ "integrity": "sha512-svhYrAlXP9XQtV7poWKydwDJq2CaNLMtmKydNXoOBLcQec6yGMP+v20pgrxF2H6wyTK+Qy0E3/5ciPOqC/VuoQ==",
"requires": {
"@ethersproject/abi": "5.0.7",
- "web3-utils": "1.6.0"
+ "web3-utils": "1.6.1"
}
},
"web3-eth-accounts": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.6.0.tgz",
- "integrity": "sha512-2f6HS4KIH4laAsNCOfbNX3dRiQosqSY2TRK86C8jtAA/QKGdx+5qlPfYzbI2RjG81iayb2+mVbHIaEaBGZ8sGw==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.6.1.tgz",
+ "integrity": "sha512-rGn3jwnuOKwaQRu4SiShz0YAQ87aVDBKs4HO43+XTCI1q1Y1jn3NOsG3BW9ZHaOckev4+zEyxze/Bsh2oEk24w==",
"requires": {
- "@ethereumjs/common": "^2.3.0",
- "@ethereumjs/tx": "^3.2.1",
+ "@ethereumjs/common": "^2.5.0",
+ "@ethereumjs/tx": "^3.3.2",
"crypto-browserify": "3.12.0",
"eth-lib": "0.2.8",
"ethereumjs-util": "^7.0.10",
"scrypt-js": "^3.0.1",
"uuid": "3.3.2",
- "web3-core": "1.6.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-helpers": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-utils": "1.6.1"
},
"dependencies": {
"@types/bn.js": {
}
},
"web3-eth-contract": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.6.0.tgz",
- "integrity": "sha512-ZUtO77zFnxuFtrc+D+iJ3AzNgFXAVcKnhEYN7f1PNz/mFjbtE6dJ+ujO0mvMbxIZF02t9IZv0CIXRpK0rDvZAw==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.6.1.tgz",
+ "integrity": "sha512-GXqTe3mF6kpbOAakiNc7wtJ120/gpuKMTZjuGFKeeY8aobRLfbfgKzM9IpyqVZV2v5RLuGXDuurVN2KPgtu3hQ==",
"requires": {
"@types/bn.js": "^4.11.5",
- "web3-core": "1.6.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-core-promievent": "1.6.0",
- "web3-core-subscriptions": "1.6.0",
- "web3-eth-abi": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-helpers": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-core-promievent": "1.6.1",
+ "web3-core-subscriptions": "1.6.1",
+ "web3-eth-abi": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-eth-ens": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.6.0.tgz",
- "integrity": "sha512-AG24PNv9qbYHSpjHcU2pViOII0jvIR7TeojJ2bxXSDqfcgHuRp3NZGKv6xFvT4uNI4LEQHUhSC7bzHoNF5t8CA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.6.1.tgz",
+ "integrity": "sha512-ngprtbnoRgxg8s1wXt9nXpD3h1P+p7XnKXrp/8GdFI9uDmrbSQPRfzBw86jdZgOmy78hAnWmrHI6pBInmgi2qQ==",
"requires": {
"content-hash": "^2.5.2",
"eth-ens-namehash": "2.0.8",
- "web3-core": "1.6.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-promievent": "1.6.0",
- "web3-eth-abi": "1.6.0",
- "web3-eth-contract": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-helpers": "1.6.1",
+ "web3-core-promievent": "1.6.1",
+ "web3-eth-abi": "1.6.1",
+ "web3-eth-contract": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-eth-iban": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.6.0.tgz",
- "integrity": "sha512-HM/bKBS/e8qg0+Eh7B8C/JVG+GkR4AJty17DKRuwMtrh78YsonPj7GKt99zS4n5sDLFww1Imu/ZIk3+K5uJCjw==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.6.1.tgz",
+ "integrity": "sha512-91H0jXZnWlOoXmc13O9NuQzcjThnWyAHyDn5Yf7u6mmKOhpJSGF/OHlkbpXt1Y4v2eJdEPaVFa+6i8aRyagE7Q==",
"requires": {
"bn.js": "^4.11.9",
- "web3-utils": "1.6.0"
+ "web3-utils": "1.6.1"
}
},
"web3-eth-personal": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.6.0.tgz",
- "integrity": "sha512-8ohf4qAwbShf4RwES2tLHVqa+pHZnS5Q6tV80sU//bivmlZeyO1W4UWyNn59vu9KPpEYvLseOOC6Muxuvr8mFQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.6.1.tgz",
+ "integrity": "sha512-ItsC89Ln02+irzJjK6ALcLrMZfbVUCqVbmb/ieDKJ+eLW3pNkBNwoUzaydh92d5NzxNZgNxuQWVdlFyYX2hkEw==",
"requires": {
"@types/node": "^12.12.6",
- "web3-core": "1.6.0",
- "web3-core-helpers": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-net": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-helpers": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-net": "1.6.1",
+ "web3-utils": "1.6.1"
},
"dependencies": {
"@types/node": {
- "version": "12.20.36",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.36.tgz",
- "integrity": "sha512-+5haRZ9uzI7rYqzDznXgkuacqb6LJhAti8mzZKWxIXn/WEtvB+GHVJ7AuMwcN1HMvXOSJcrvA6PPoYHYOYYebA=="
+ "version": "12.20.37",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.37.tgz",
+ "integrity": "sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA=="
}
}
},
"web3-net": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.6.0.tgz",
- "integrity": "sha512-LFfG95ovTT2sNHkO1TEfsaKpYcxOSUtbuwHQ0K3G0e5nevKDJkPEFIqIcob40yiwcWoqEjENJP9Bjk8CRrZ99Q==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.6.1.tgz",
+ "integrity": "sha512-gpnqKEIwfUHh5ik7wsQFlCje1DfcmGv+Sk7LCh1hCqn++HEDQxJ/mZCrMo11ZZpZHCH7c87imdxTg96GJnRxDw==",
"requires": {
- "web3-core": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-utils": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-utils": "1.6.1"
}
},
"web3-providers-http": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.6.0.tgz",
- "integrity": "sha512-sNxHFNv3lnxpmULt34AS6M36IYB/Hzm2Et4yPNzdP1XE644D8sQBZQZaJQdTaza5HfrlwoqU6AOK935armqGuA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.6.1.tgz",
+ "integrity": "sha512-xBoKOJxu10+kO3ikamXmBfrWZ/xpQOGy0ocdp7Y81B17En5TXELwlmMXt1UlIgWiyYDhjq4OwlH/VODYqHXy3A==",
"requires": {
- "web3-core-helpers": "1.6.0",
+ "web3-core-helpers": "1.6.1",
"xhr2-cookies": "1.1.0"
}
},
"web3-providers-ipc": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.6.0.tgz",
- "integrity": "sha512-ETYdfhpGiGoWpmmSJnONvnPfd3TPivHEGjXyuX+L5FUsbMOVZj9MFLNIS19Cx/YGL8UWJ/8alLJoTcWSIdz/aA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.6.1.tgz",
+ "integrity": "sha512-anyoIZlpMzwEQI4lwylTzDrHsVp20v0QUtSTp2B5jInBinmQtyCE7vnbX20jEQ4j5uPwfJabKNtoJsk6a3O4WQ==",
"requires": {
"oboe": "2.1.5",
- "web3-core-helpers": "1.6.0"
+ "web3-core-helpers": "1.6.1"
}
},
"web3-providers-ws": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.6.0.tgz",
- "integrity": "sha512-eNRmlhOPCpuVYwBrKBBQRLGPFb4U1Uo44r9EWV69Cpo4gP6XeBTl6nkawhLz6DS0fq79apyPfItJVuSfAy77pA==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.6.1.tgz",
+ "integrity": "sha512-FWMEFYb4rYFYRgSFBf/O1Ex4p/YKSlN+JydCtdlJwRimd89qm95CTfs4xGjCskwvXMjV2sarH+f1NPwJXicYpg==",
"requires": {
"eventemitter3": "4.0.4",
- "web3-core-helpers": "1.6.0",
+ "web3-core-helpers": "1.6.1",
"websocket": "^1.0.32"
}
},
"web3-shh": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.6.0.tgz",
- "integrity": "sha512-ymN0OFL81WtEeSyb+PFpuUv39fR3frGwsZnIg5EVPZvrOIdaDSFcGSLDmafUt0vKSubvLMVYIBOCskRD6YdtEQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.6.1.tgz",
+ "integrity": "sha512-oP00HbAtybLCGlLOZUYXOdeB9xq88k2l0TtStvKBtmFqRt+zVk5TxEeuOnVPRxNhcA2Un8RUw6FtvgZlWStu9A==",
"requires": {
- "web3-core": "1.6.0",
- "web3-core-method": "1.6.0",
- "web3-core-subscriptions": "1.6.0",
- "web3-net": "1.6.0"
+ "web3-core": "1.6.1",
+ "web3-core-method": "1.6.1",
+ "web3-core-subscriptions": "1.6.1",
+ "web3-net": "1.6.1"
}
},
"web3-utils": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.6.0.tgz",
- "integrity": "sha512-bgCAWAeQnJF035YTFxrcHJ5mGEfTi/McsjqldZiXRwlHK7L1PyOqvXiQLE053dlzvy1kdAxWl/sSSfLMyNUAXg==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.6.1.tgz",
+ "integrity": "sha512-RidGKv5kOkcerI6jQqDFDoTllQQqV+rPhTzZHhmbqtFObbYpU93uc+yG1LHivRTQhA6llIx67iudc/vzisgO+w==",
"requires": {
"bn.js": "^4.11.9",
"ethereum-bloom-filters": "^1.0.6",

MODIFY
examples/package.json
examples/package.json
"author": "",
"license": "ISC",
"dependencies": {
- "@maticnetwork/maticjs": "^3.0.0-beta.15",
- "@maticnetwork/maticjs-web3": "^0.6.0",
+ "@maticnetwork/maticjs": "^3.0.0",
+ "@maticnetwork/maticjs-web3": "^0.8.0",
"@truffle/hdwallet-provider": "^1.5.1-alpha.1",
"dotenv": "^10.0.0"
}

DELETE
examples/plasma/ether/deposit.js
-const { getMaticPlasmaClient, from } = require('../../utils')
-
-const amount = '100000000000000000' // amount in wei (0.1 eth)
-
-const execute = async () => {
- const { matic } = await getMaticPlasmaClient()
- try {
- const tx = await matic.depositEther(amount, {
- from: from,
- })
- console.log(tx.transactionHash) // eslint-disable-line
- } catch (e) {
- console.error(e) // eslint-disable-line
- }
-}
-
-execute().then(() => process.exit(0))

DELETE
examples/plasma/ether/exit.js
-const { getMaticPlasmaClient, plasma, from } = require('../../utils')
-
-// process exit on parent chain
-const token = plasma.parent.weth
-
-const execute = async () => {
- const { matic } = await getMaticPlasmaClient()
- try {
- const tx = await matic.processExits(token, {
- from: from,
- })
- console.log(tx.transactionHash) // eslint-disable-line
- } catch (e) {
- console.error(e) // eslint-disable-line
- }
-}
-
-execute().then(() => process.exit(0))

DELETE
examples/plasma/ether/start_withdraw.js
-const { getMaticPlasmaClient, plasma, from } = require('../../utils')
-
-const amount = '100000000000000000' // amount in wei (0.1 eth)
-const token = plasma.child.weth
-
-const execute = async () => {
- const { matic } = await getMaticPlasmaClient()
- try {
- const tx = await matic.startWithdraw(token, amount, {
- from: from,
- })
- console.log(tx.transactionHash) // eslint-disable-line
- } catch (e) {
- console.error(e) // eslint-disable-line
- }
-}
-
-execute().then(() => process.exit(0))

DELETE
examples/plasma/ether/withdraw.js
-const { getMaticPlasmaClient, from } = require('../../utils')
-
-// confirm withdraw Ether Plasma txHash
-const txHash = '0x13a1a9e5d4c46eeb38efb6eccfb8fd534985dda5b11ba50f61abd39d83336d8c'
-
-const execute = async () => {
- const { matic } = await getMaticPlasmaClient()
- try {
- const tx = await matic.withdraw(txHash, {
- from: from,
- })
- console.log(tx.transactionHash) // eslint-disable-line
- } catch (e) {
- console.error(e) // eslint-disable-line
- }
-}
-
-execute().then(() => process.exit(0))

MODIFY
examples/utils.js
examples/utils.js
const bn = require('bn.js')
const HDWalletProvider = require('@truffle/hdwallet-provider')
const config = require('./config')
-const { POSClient, PlasmaClient, setProofApi, use } = require('@maticnetwork/maticjs')
+const { POSClient, setProofApi, use } = require('@maticnetwork/maticjs')
const SCALING_FACTOR = new bn(10).pow(new bn(18))
const { Web3ClientPlugin } = require("@maticnetwork/maticjs-web3");
@@ -15,7 +15,8 @@ const privateKey = config.user1.privateKey
const userAddress = config.user1.address
const getPOSClient = (network = 'testnet', version = 'mumbai') => {
- const posClient = new POSClient({
+ const posClient = new POSClient()
+ return posClient.init({
log: true,
network: network,
version: version,
@@ -31,8 +32,7 @@ const getPOSClient = (network = 'testnet', version = 'mumbai') => {
from: userAddress
}
}
- })
- return posClient.init();
+ });
}
module.exports = {

update example as per v3