3.1.1 • Published 3 years ago
vipay-multichain v3.1.1
Vipay-Wallet
installation
npm install vipay-multichain-walletimport (es5)
const vipay = require('vipay-multichain-wallet/src');import (es6)
import vipay from 'vipay-multichain-wallet/src';functions (ethereum)
- Create Wallet
- Recover wallet from phrase words
- Import account from private key
- Get ETH balance
- Send ETH
- Approve/Transfer Token
usage (ethereum)
//Create Wallet
const wallet = await vipay.Ethereum.createWallet({});
//Import Wallet
const wallet = await vipay.Ethereum.importWallet({
	mnemonic: 'sea glup tiger cup zoo ...', //phrase words
});
//Import Account
const account = await vipay.Ethereum.importAccount({
	privateKey: '0x....' //private key
});
//Get ETH balance
const balance = await vipay.Ethereum.getBalance({
	defaultProviderRpcUrl: 'https://https://bsc-dataseed1.defibit.io/', //this is bsc mainnet rpc url (put any ethereum network rpc url here)
	address: '0x...'
});
//Send ETH
const tx = await vipay.Ethereum.sendEther({
	rpcUrl: 'https://....',// (pur rpc url here)
	privateKey: '0x....',
	receiveAddress: '0x...',
	amount: '0.1', //ETH amount
	gasPrice: 'xxx', //transaction gas fee
	gasLimit: 'xxx', //gas limit
});
//Token Transfer
const tx = await vipay.Ethereum.tokenTransfer({
	rpcUrl: 'https://....',// (pur rpc url here)
	privateKey: '0x....',
	receiveAddress: '0x...',
	tokenAddress: '0x...',
	amount: '0.1', //Token amount
	gasPrice: 'xxx', //transaction gas fee
	gasLimit: 'xxx', //gas limit
});
//Token Approve
const tx = await vipay.Ethereum.tokenApprove({
	rpcUrl: 'https://....',// (pur rpc url here)
	privateKey: '0x....',
	receiveAddress: '0x...',
	tokenAddress: '0x...',
	amount: '0.1', //Token amount
	gasPrice: 'xxx', //transaction gas fee
	gasLimit: 'xxx', //gas limit
})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'//mnemonic
})
const importAccount = await vipay.Solana.importWallet({
	privateKey: 'xxx' //privatekey
})
const tx = await vipay.Solana.transfer({
	rpcUrl: 'https://api.devnet.solana.com', //rpcurl
	privateKey: 'xxx',
	from: 'xxx',
	to: 'xxx',
	amount: 0.1
})
// please refer library for more functionsMore blockchains and networks will be added.
Estimated next update time: Aug 15 2022 :tw-1f551:
Enjoy your work ~!!!
3.1.1
3 years ago
3.1.0
3 years ago
3.0.9
3 years ago
3.0.7
3 years ago
3.0.6
3 years ago
3.0.5
3 years ago
3.0.4
3 years ago
3.0.3
3 years ago
3.0.2
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
1.3.6
3 years ago
1.3.4
3 years ago
1.3.3
3 years ago
1.3.2
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.2.6
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.1
3 years ago
1.2.0
3 years ago
1.1.39
3 years ago
1.1.38
3 years ago
1.1.37
3 years ago
1.1.36
3 years ago