add depositEther in readme
MODIFY
README.md
README.md
@@ -56,6 +56,11 @@ matic.initialize()
// Warning: Not-safe
// matic.setWallet(<private-key>) // Use metamask provider or use WalletConnect provider instead.
+// Deposit Ether into Matic chain
+await matic.depositEthers(
+ amount, // amount in wei for deposit
+ options // transaction fields
+)
// Approve ERC20 token for deposit
await matic.approveERC20TokensForDeposit(
@@ -158,6 +163,7 @@ Please write to info@matic.network to request TEST tokens for development purpos
### API
- <a href="#initialize"><code>new Matic()</code></a>
+- <a href="#depositEther"><code>matic.<b>depositEther()</b></code></a>
- <a href="#approveERC20TokensForDeposit"><code>matic.<b>approveERC20TokensForDeposit()</b></code></a>
- <a href="#depositERC20ForUser"><code>matic.<b>depositERC20ForUser()</b></code></a>
- <a href="#safeDepositERC721Tokens"><code>matic.<b>safeDepositERC721Tokens()</b></code></a>
@@ -204,6 +210,26 @@ matic.initialize()
- `depositManager` must be valid Ethereum contract address.
---
+<a name="depositEthers"></a>
+
+#### matic.depositEthers(amount, options)
+
+Deposit `options.value`
+- `amount` must be token amount in wei (string, not in Number)
+- `options` see [more infomation here](#approveERC20TokensForDeposit).
+ - `from` must be valid account address(required)
+ - `encodeAbi` must be boolean value. For Byte code of transaction, use `encodeAbi: true`
+
+This returns `Promise` object, which will be fulfilled when transaction gets confirmed (when receipt is generated).
+
+Example:
+
+```js
+matic.depositEthers(amount, {
+ from: '0xABc578455...'
+})
+```
+
---
<a name="approveERC20TokensForDeposit"></a>

MODIFY
package-lock.json
package-lock.json
"code-point-at": {
"version": "1.1.0",
"resolved": false,
- "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"console-control-strings": {
"version": "1.1.0",
"resolved": false,
- "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
+ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "optional": true
},
"ini": {
"version": "1.3.5",
"version": "1.0.0",
"resolved": false,
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
"number-is-nan": {
"version": "1.0.1",
"resolved": false,
- "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
"version": "1.0.2",
"resolved": false,
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"integrity": "sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA==",
"requires": {
"underscore": "1.9.1",
- "web3-core-helpers": "1.2.1",
- "websocket": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e"
+ "web3-core-helpers": "1.2.1"
+ },
+ "dependencies": {
+ "websocket": {
+ "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e",
+ "from": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e",
+ "requires": {
+ "debug": "^2.2.0",
+ "es5-ext": "^0.10.50",
+ "nan": "^2.14.0",
+ "typedarray-to-buffer": "^3.1.5",
+ "yaeti": "^0.0.6"
+ }
+ }
}
},
"websocket": {

add depositEther in readme