1.3.14 • Published 2 years ago

@challengesoft/coingrig-core v1.3.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

🅒🅖🅒 Coingrig Core

The Coingrig Core library handling the wallet interactions

Usage in your project

Import the library in your project with yarn add @coingrig/core

Library Development setup

Run yarn. (Installs dependencies and links packages in the workspace.)

Compilation

Create an .env file to configure the platform: TESTNET=true|false.
The default value is TESTNET=false.

Test

Jest tests are set up to run with TESTNET=true yarn test.


Documentation

Classes

BitcoinGenerator ⇐ GenericGenerator

Kind: global class
Extends: GenericGenerator

BscGenerator ⇐ EthereumGenerator

Kind: global class
Extends: EthereumGenerator

EthereumGenerator ⇐ GenericGenerator

Kind: global class
Extends: GenericGenerator

PolygonGenerator ⇐ EthereumGenerator

Kind: global class
Extends: EthereumGenerator

GenericGenerator

Kind: global class

GenericGenerator.generateWalletXpub(mnemonic, config) ⇒ string

Kind: static method of GenericGenerator
Returns: string - The XPUB value

ParamType
mnemonicstring
config*

GenericGenerator.generatePrivateKeyFromMnemonic(mnemonic, derivation, config) ⇒ string

Kind: static method of GenericGenerator
Returns: string - The Private Key

ParamType
mnemonicstring
derivationinteger
config*

GenericGenerator.generateAddressFromXPub(xpub, derivation, config) ⇒ string

Kind: static method of GenericGenerator
Returns: string - The Public Key

ParamType
xpubstring
derivationinteger
config*

WalletFactory

Kind: global class

new WalletFactory()

WalletGenerator

Kind: global class

WalletGenerator.generateMnemonic(size) ⇒ string

Kind: static method of WalletGenerator
Returns: string - The mnemonic

ParamTypeDefaultDescription
sizenumber128Or use 256 for 24 words

WalletGenerator.getDriver(chain) ⇒ GenericGenerator

Kind: static method of WalletGenerator

ParamType
chainChains

WalletGenerator.generateWalletXpub(chain, mnemonic, config) ⇒ string

Kind: static method of WalletGenerator
Returns: string - The wallet's XPUB address

ParamTypeDefaultDescription
chainChainsThe type of chain
mnemonicstring
config*CONFIG

WalletGenerator.generatePrivateKeyFromMnemonic(chain, mnemonic, derivation, config) ⇒ string

Kind: static method of WalletGenerator
Returns: string - The wallet's private key

ParamTypeDefaultDescription
chainChainsThe type of chain
mnemonicstring
derivationintegerThe derivation key to allow generation of more private keys for the same chain
config*CONFIG

WalletGenerator.generateAddressFromXPub(chain, xpub, derivation, config) ⇒ string

Kind: static method of WalletGenerator
Returns: string - The wallet's public address

ParamTypeDefaultDescription
chainChainsThe type of chain
xpubstring
derivationinteger
config*CONFIG

GenericWallet

Kind: global class

Chains : enum

Kind: global enum
Read only: true
Properties

NameTypeDescription
BTCstring"BTC"
ETHstring"ETH"
MATICstring"MATIC"
BSCstring"BSC"

Code of Conduct

This library has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

License

The Coingrig Core Library is licensed under the MIT License.