Utility to work with solana wallets
[GitHub]
To install package:
npm install @cryptoscan/solana-wallet-sdk
Usage
import { createWallet, getBalance } from '@cryptoscan/solana-wallet-sdk';
const wallet = createWallet();
console.log('Private key: ' + getPrivateKey(wallet))
console.log('Public key: ' + getPublicKey(wallet))
getBalance(wallet).then((balance) => {
console.log('Balance: ' + balance);
});
getBalance(wallet, process.env.COIN_ADDRESS).then((balance) => {
console.log('Coin balance: ' + balance);
});
import { getWallet, getBalance } from '@cryptoscan/solana-wallet-sdk';
const wallet = getWallet(process.env.SECRET_KEY);
getBalance(wallet).then((balance) => {
console.log('Balance: ' + balance);
});
createWallet(): Keypair
getBalance(wallet: Keypair, coinAddress: string): Promise<number>
getPrivateKey(wallet: Keypair): string
getPublicKey(wallet: Keypair): string
makeWallets(path: string, count: number): void
To install project
git clone https://github.com/cryptoscan-pro/swap-sdk
To install dependencies:
npm install
To build:
npm build
This project was created using bun init
in bun v1.1.0. Bun is a fast all-in-one JavaScript runtime.