use setWallet to set private key
MODIFY
README.md
README.md
@@ -53,7 +53,7 @@ matic.initialize()
// Set wallet
// Warning: Not-safe
-// matic.wallet(<private-key>) // Use metamask provider or use WalletConnect provider instead.
+// matic.setWallet(<private-key>) // Use metamask provider or use WalletConnect provider instead.
// Approve ERC20 token for deposit

MODIFY
examples/node/approve-ERC20.js
examples/node/approve-ERC20.js
@@ -19,7 +19,7 @@ const matic = new Matic({
})
matic.initialize().then(() => {
- matic.wallet(config.PRIVATE_KEY)
+ matic.setWallet(config.PRIVATE_KEY)
// Approve token
matic
.approveERC20TokensForDeposit(token, amount, {

MODIFY
examples/node/confirm-withdraw.js
examples/node/confirm-withdraw.js
@@ -18,7 +18,7 @@ const matic = new Matic({
})
matic.initialize().then(() => {
- matic.wallet(config.PRIVATE_KEY)
+ matic.setWallet(config.PRIVATE_KEY)
matic.withdraw(transactionHash, {
from,
}).then((res) => {

MODIFY
examples/node/deposit-ERC20.js
examples/node/deposit-ERC20.js
@@ -20,7 +20,7 @@ const matic = new Matic({
})
matic.initialize().then(() => {
- matic.wallet(config.PRIVATE_KEY)
+ matic.setWallet(config.PRIVATE_KEY)
matic.depositERC20ForUser(token, from, amount, {
from,
}).then((receipt) => {

MODIFY
examples/node/initiate-withdraw-ERC20.js
examples/node/initiate-withdraw-ERC20.js
@@ -20,7 +20,7 @@ const matic = new Matic({
})
matic.initialize().then(() => {
- matic.wallet(config.PRIVATE_KEY)
+ matic.setWallet(config.PRIVATE_KEY)
matic
.startWithdraw(token, amount, {
from,

MODIFY
examples/node/transfer-ERC20.js
examples/node/transfer-ERC20.js
@@ -22,8 +22,7 @@ const matic = new Matic({
})
matic.initialize().then(() => {
- matic.wallet(config.PRIVATE_KEY)
- // Send Tokens
+ matic.setWallet(config.PRIVATE_KEY)
matic.transferERC20Tokens(token, recipient, amount, {
from,
// parent: true, // For token transfer on Main network (false for Matic Network)

use setWallet to set private key