@keepix/wallets-solana
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Keepix.Wallets.Solana

Library that respects the WalletLibraryInterface.
This library is used to create wallets, hold coin and token balances and carry out transactions.

class Wallet {
    constructor({}: {
        password?: string,
        mnemonic?: string,
        privateKey?: string,
        privateKeyTemplate?: string
    }) {}

    getPrivateKey: () => string;
    getMnemonic: () => string | undefined;
    getAddress: () => string;
    getProdiver: () => Promise<any>;

    // returns like 1.01 (Always in readable value)
    getCoinBalance: (walletAddress?: string) => Promise<string>;
    // returns like 1.01 (Always in readable value)
    getTokenBalance: (tokenAddress: string, walletAddress?: string) => Promise<string>;

    // amount is always like 1.20 ETH 
    estimateCostSendCoinTo: (receiverAddress: string, amount: string) => Promise<{ success: boolean, description: string }>;
    estimateCostSendTokenTo: (tokenAddress: string, receiverAddress: string, amount: string) => Promise<{ success: boolean, description: string }>;
    sendCoinTo: (receiverAddress: string, amount: string) => Promise<{ success: boolean, description: string }>;
    sendTokenTo: (tokenAddress: string, receiverAddress: string, amount: string) => Promise<{ success: boolean, description: string }>;
}

export interface WalletLibraryInterface {
    Wallet: typeof Wallet;
};

Readme

Keywords

Package Sidebar

Install

npm i @keepix/wallets-solana

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

135 kB

Total Files

13

Last publish

Collaborators

  • jguyet