New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@keepix/wallets-bitcoin

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keepix/wallets-bitcoin

Wallets bitcoin library

latest
Source
npmnpm
Version
0.0.25
Version published
Maintainers
0
Created
Source

Keepix.Wallets.bitcoin

Install

npm i @keepix/wallets-bitcoin

Use

import { Wallet } from '@keepix/wallets-bitcoin';

const wallet = new Wallet({ password: 'test', type: 'bitcoin' });

console.log(await wallet.getCoinBalance());
// 0.00000000

console.log(wallet.getPrivateKey());
// xxxxxxxxxxx

console.log(wallet.getAddress());
// 1HxJKBJso1jGJNoo5XmkiygE6c1gB1PQDo

Information

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,
        type: string,
        apis?: any,
        privateKeyTemplate?: string
    }) {}

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

    btcToSatoshi: (btc: number) => number;

    // 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;
};

Keywords

bitcoin

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts