rename safeTransferFrom to safeDepositERC721Tokens
MODIFY
README.md
README.md
@@ -125,7 +125,7 @@ await matic.depositERC20Tokens(
// Deposit ERC721 token into Matic chain.(older ERC721 or some newer contracts will not support this.
// in that case, first call `approveERC721TokenForDeposit` and `depositERC721Tokens`)
-await matic.safeTransferFrom(
+await matic.safeDepositERC721Tokens(
token, // Token addres
tokenId, // Token Id for deposit
options // transaction fields
@@ -234,7 +234,7 @@ Please write to info@matic.network to request TEST tokens for development purpos
- <a href="#depositEthers"><code>matic.<b>depositEther()</b></code></a>
- <a href="#approveERC20TokensForDeposit"><code>matic.<b>approveERC20TokensForDeposit()</b></code></a>
- <a href="#depositERC20Tokens"><code>matic.<b>depositERC20Tokens()</b></code></a>
-- <a href="#safeTransferFrom"><code>matic.<b>safeTransferFrom()</b></code></a>
+- <a href="#safeDepositERC721Tokens"><code>matic.<b>safeDepositERC721Tokens()</b></code></a>
- <a href="#approveERC721TokenForDeposit"><code>matic.<b>approveERC721TokenForDeposit()</b></code></a>
- <a href="#depositERC721Tokens"><code>matic.<b>depositERC721Tokens()</b></code></a>
- <a href="#depositEthers"><code>matic.<b>depositEthers()</b></code></a>
@@ -410,9 +410,9 @@ matic.depositToken('0x718Ca123...', user, '1000000000000000000', {
---
-<a name="safeTransferFrom"></a>
+<a name="safeDepositERC721Tokens"></a>
-#### matic.safeTransferFrom(token, tokenId, options)
+#### matic.safeDepositERC721Tokens(token, tokenId, options)
Deposit given `tokenId` of `token`.
@@ -426,7 +426,7 @@ Example:
```js
-matic.safeTransferFrom('0x718Ca123...', '21', {
+matic.safeDepositERC721Tokens('0x718Ca123...', '21', {
from: '0xABc578455...'
})
```

RENAME
examples/node/safeTransferFrom.js
examples/node/safeDepositERC721Tokens.js
@@ -16,7 +16,7 @@ const matic = new Matic({
matic.wallet = config.PRIVATE_KEY // prefix with `0x`
-matic.safeTransferFrom(token, tokenId, {
+matic.safeDepositERC721Tokens(token, tokenId, {
from,
onTransactionHash: (hash) => {
// action on Transaction success

MODIFY
src/index.js
src/index.js
@@ -188,25 +188,25 @@ export default class Matic {
return this._wrapWeb3Promise(depositTx.send(_options), options)
}
- async safeTransferFrom(token, tokenId, options = {}) {
+ async safeDepositERC721Tokens(token, tokenId, options = {}) {
if (options && (!options.from || !tokenId || !token)) {
throw new Error('Missing Parameters')
}
const _tokenContract = this._getERC721TokenContract(token, this._parentWeb3)
- const safeTransferFromTx = await _tokenContract.methods.safeTransferFrom(
+ const safeDepositERC721Tokens = await _tokenContract.methods.safeTransferFrom(
options.from,
this._rootChainAddress,
tokenId
)
const _options = await this._fillOptions(
options,
- safeTransferFromTx,
+ safeDepositERC721Tokens,
this._parentWeb3
)
- return this._wrapWeb3Promise(safeTransferFromTx.send(_options), options)
+ return this._wrapWeb3Promise(safeDepositERC721Tokens.send(_options), options)
}
async approveERC721TokenForDeposit(token, tokenId, options = {}) {

rename safeTransferFrom to safeDepositERC721Tokens