Vipay-Wallet
installation
npm install vipay-multichain-wallet
import (es5)
const vipay = require('vipay-multichain-wallet');
import (es6)
import vipay from 'vipay-multichain-wallet';
Create Wallet (Phrase words) using common
function
const mnemonic = vipay.Common.generateMnemonic();
console.log(mnemonic);
functions (ethereum)
- Create Wallet
- Recover wallet from phrase words
- Import account from private key
- Get ETH balance
- Send ETH
- Approve/Transfer Token
usage (ethereum)
const wallet = await vipay.Ethereum.createWallet({});
const wallet = await vipay.Ethereum.importWallet({
mnemonic: 'sea glup tiger cup zoo ...',
});
const account = await vipay.Ethereum.importAccount({
privateKey: '0x....'
});
const balance = await vipay.Ethereum.getBalance({
defaultProviderRpcUrl: 'https://https://bsc-dataseed1.defibit.io/',
address: '0x...'
});
const tx = await vipay.Ethereum.sendEther({
rpcUrl: 'https://....',
privateKey: '0x....',
receiveAddress: '0x...',
amount: '0.1',
gasPrice: 'xxx',
gasLimit: 'xxx',
});
const tx = await vipay.Ethereum.tokenTransfer({
rpcUrl: 'https://....',
privateKey: '0x....',
receiveAddress: '0x...',
tokenAddress: '0x...',
amount: '0.1',
gasPrice: 'xxx',
gasLimit: 'xxx',
});
const tx = await vipay.Ethereum.tokenApprove({
rpcUrl: 'https://....',
privateKey: '0x....',
receiveAddress: '0x...',
tokenAddress: '0x...',
amount: '0.1',
gasPrice: 'xxx',
gasLimit: 'xxx',
})
functions (solana)
- Create Wallet
- Recover wallet from phrase words
- Import account from private key
- Send SOL token
- Get token info
- Get availale token list
- Get balance
- Get transaction
usage (solana)
const wallet = await vipay.Solana.createWallet({});
const importWallet = await vipay.Solana.importWallet({
mnemonic: 'xxx'
})
const importAccount = await vipay.Solana.importWallet({
privateKey: 'xxx'
})
const tx = await vipay.Solana.transfer({
rpcUrl: 'https://api.devnet.solana.com',
privateKey: 'xxx',
from: 'xxx',
to: 'xxx',
amount: 0.1
})
More blockchains and networks will be added.
Enjoy your work ~!!!