npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

debeem-wallet

v1.0.70

Published

Ethereum Wallet by DeBeem, Team.

Downloads

306

Readme

debeem-wallet

A complete, compact, and simple Ethereum wallet library based on the ethers library.

Table of contents

Features

  1. Easy to use, whether you have experience in Ethereum wallet development or not, you can easily get started.
  2. Provides complete functions such as creation, import, and backup of Ethereum wallets.
  3. Provides balance query, total value statistics, and real-time trading pair quotes for Ethereum native token and derivative tokens.
  4. Provides transfer, real-time transaction gas fee estimating, transaction history query, transaction details query, and transaction receipt query functions for Ethereum native token and derivative tokens.
  5. Provides information query for Ethereum native token and derivative tokens.
  6. Provides network information query by chainId.
  7. Provide local structured data storage based on AES256 encryption algorithm, and the password can be modified at will.

Architecture

UML Graph

flowchart TD

    id([debeem-id])
    cipher([debeem-cipher])
    ethers([ethers])
    idb([idb])

    ethers -. «extend» .-> root
    id -. «extend» .-> root
    cipher -. «extend» .-> root
    idb -. «extend» .-> root

    subgraph debeem-wallet
        root([debeem-wallet])

        config(Config)
        walletServices(Wallet Services)
        storageServices(Storage Services)
        chainService(Chain Service)
        tokenService(Token Service)
        root --- config
        root --- walletServices
        root --- storageServices
        root --- chainService
        root --- tokenService

        %% wallet service list
        walletServiceList["WalletFactory
            WalletAccount
            WalletTransaction
            WalletNFT"]
        walletServices --- walletServiceList

        %% storage service list
        encryptedStorageServices(Encrypted Storage Services)
        storageServicesList["SysUserStorageService
            BasicStorageService
            ChainStorageService
            TokenStorageService
            WalletStorageService"]
        storageServices --- encryptedStorageServices
        encryptedStorageServices --- storageServicesList

        %% chain service list
        tokenServiceList["TokenService"]
        tokenService --- tokenServiceList

        %% token service list
        chainServiceList["ChainService"]
        chainService --- chainServiceList

    end

Dependency Packages

Installation

1, install nvm

use the following cURL or Wget command to install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

2, install node

install the latest LTS version of node, for example: v18.20.3 (Latest LTS: Hydrogen)

nvm install v18.20.3
nvm use v18.20.3

3, install our package

npm i debeem-wallet

to fix issue: Module not found: Error: Can't resolve 'fake-indexeddb/auto'

npm i -D fake-indexeddb

Configuration

About chain

There are many chains in the entire blockchain world, such as the Bitcoin chain, Ethereum chain, etc. Every wallet MUST work on a certain chain (or call it a network).

So, before using any functions or classes in this development package, you MUST first configure a chain/network for your wallet.

View all chains on:
https://chainlist.org/

Configurations

1, Chain Configuration

| Function | Invocations | Storage | Description | |---------------------------------------------------------------------------------------------------------------------------------------|-------------|----------|--------------------------------------------------------------------------------------------| | getDefaultChain | sync | memory | get default chainId from memory | | getCurrentChain | sync | memory | get current chainId from memory | | setCurrentChain | sync | memory | set/update current chainId to memory | | revertToDefaultChain | sync | memory | revert the current chain to the default value in memory | | getCurrentChainAsync | async | database | asynchronously get current chainId from the database | | putCurrentChainAsync | async | database | asynchronously set/update current chainId into the database | | revertToDefaultChainAsync | async | database | asynchronously revert the current chain to the default value and save it into the database |

2, Wallet Configuration

| Function | Invocations | Storage | Description | |-------------------------------------------------------------------------------------------------------------------------------|-------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | getCurrentWalletAsync | async | database | asynchronously get current wallet from the database | | putCurrentWalletAsync | async | database | asynchronously put current wallet into the database | | initWalletAsync | async | database | asynchronously create or recover an account. For detailed usage instructions, please refer to the unit tests: config.test.ts, SysUserStorageService.test.ts, WalletStorageService.test.ts. |

Usage

Wallet Services

| Class | Description | |----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | WalletFactory | create a new wallet, or import a wallet from a mnemonic, keystore, private key or a wallet address | | WalletAccount | query balance, calculate total value, and request quotes in real-time for the Ethereum native token or any derivative tokens | | WalletTransaction | send and receive your Ethereum native token or any derivative tokens, estimate transaction gas fee, and query transaction history, details and receipt | | WalletNFT | query NFTs information |

Storage Services

| Class | Description | |------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------| | SysUserStorageService | manage encryption information table and modify PIN code | | BasicStorageService | simple storage based on key-value | | ChainStorageService | get the default supported chain list, get information of a chain, add, delete and update the information of a chain | | TokenStorageService | manage tokens of a wallet on a specified chain. get the token list, add, delete and update the token information | | WalletStorageService | based on secure encryption, obtain information of a wallet, add, delete and update a wallet |

Chain Service

| Class | Description | |------------------------------------------------|----------------------------------------------------------------------------| | ChainService | check whether a chain exists and obtain the chain information by chain id. |

Token Service

| Class | Description | |------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| | TokenService | check whether a token exists and obtain the token information by contract address. |

Unit Tests

This project has complete unit tests with an average coverage of over 90%. Run the unit tests in the project root directory:

jest

Documentation

API Docs

License