MCPcopy Index your code
hub / github.com/bitaccess/coinlib

github.com/bitaccess/coinlib @v8.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v8.0.1 ↗ · + Follow
1,444 symbols 3,743 edges 327 files 70 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

coinlib monorepo

A nodejs library providing a unified API for sending and receiving crypto payments for multiple coin networks.

Setting Up

  1. Install required compiler tools
brew install autoconf automake libtool

  1. Install root dependencies:
npm install
  1. Set environment variables
export BITCOIN_SERVER_URL="btc1.<my-blockbook-url>,btc2.<my-blockbook-url>"
export BITCOIN_TESTNET_SERVER_URL="tbtc1.<my-blockbook-url>"
  1. Execute tests (done by Jest)
npm run test
  1. Dependency management

  2. To remove dependency from leaf package, remove it from its package.json and run lerna bootstrap

  3. To regenerate package-lock.json for package, run npm install --package-lock-only

Contribution guide

Pull Request process

  1. Ensure following branch naming conventions <tag>/<subject_message>;
  2. Ensure following commit message conventions (templated);
  3. Ensure test and linting are executed successfully;
  4. You may merge the Pull Request in once you have the sign-off of other developers, or if you do not have permission to do that, you may request the reviewer to merge it for you;

Commit message template

Run

git config commit.template  ./.gitmessage

Adding new assets

Importing packages

Use lerna to import packages (More info in lerna docs)

Configuring assets

Add payment factory to packages/coinlib/src/constants.ts

Registering assets

Add payment config to packages/coinlib/src/types.ts

Abstractions to implement

Find types and interfaces at packages/coinlib-types/src/

Usage

npm i @bitaccess/coinlib

See @bitaccess/coinlib README for usage.

Packages

Publishing new version

Note: Never use npm version, it doesn't work with lerna monorepo

Version types

  • patch - fixes only, no feature or breaking changes
  • minor - feature changes
  • major - breaking changes

Steps to version & publish

  1. Run tests npm run test
  2. Create release candidate PR bin/version.sh
  3. Have someone review & approve new release. Merge PR, pull master
  4. Publish to npm bin/publish.sh

Extension points exported contracts — how you extend this code

EthereumNetworkDataProvider (Interface)
(no doc) [5 implementers]
packages/coinlib-ethereum/src/types.ts
PaymentsUtils (Interface)
(no doc) [5 implementers]
packages/coinlib-types/src/PaymentsUtils.ts
PsbtInputData (Interface)
(no doc)
packages/coinlib-bitcoin/src/types.ts
PsbtTxInput (Interface)
(no doc)
packages/coinlib-doge/src/types.ts
GetEventResultOptions (Interface)
(no doc)
packages/coinlib-tron/src/@types/tronweb/index.d.ts
PsbtInputData (Interface)
(no doc)
packages/coinlib-litecoin/src/types.ts
PsbtOptsOptional (Interface)
(no doc)
packages/coinlib-bitcoin-cash/src/multisigPaymentHelper.ts
EthereumNodesConnection (Interface)
(no doc)
packages/coinlib-ethereum/src/types.ts

Core symbols most depended-on inside this repo

getBalance
called by 103
packages/coinlib-types/src/BasePayments.ts
resolvePayport
called by 67
packages/coinlib-types/src/BasePayments.ts
createSweepTransaction
called by 61
packages/coinlib-types/src/BasePayments.ts
getPayport
called by 60
packages/coinlib-types/src/BasePayments.ts
isValidAddress
called by 59
packages/coinlib-types/src/PaymentsUtils.ts
createTransaction
called by 53
packages/coinlib-types/src/BasePayments.ts
signTransaction
called by 53
packages/coinlib-types/src/BasePayments.ts
getPublicConfig
called by 51
packages/coinlib-types/src/BasePayments.ts

Shape

Function 671
Method 556
Class 165
Interface 42
Enum 10

Languages

TypeScript100%

Modules by API surface

packages/coinlib-bitcoin/src/bitcoinish/BitcoinishPayments.ts51 symbols
packages/coinlib-ethereum/src/EthereumPaymentsUtils.ts39 symbols
packages/coinlib-ethereum/test/fixtures/mocks.ts33 symbols
packages/coinlib-ripple/src/BaseRipplePayments.ts32 symbols
packages/coinlib-stellar/src/BaseStellarPayments.ts31 symbols
packages/coinlib-tron/src/TronPaymentsUtils.ts29 symbols
packages/coinlib-ethereum/src/BaseEthereumPayments.ts29 symbols
packages/coinlib-types/src/BasePayments.ts25 symbols
packages/coinlib-stellar/src/StellarPaymentsUtil.ts25 symbols
packages/coinlib-types/src/PaymentsUtils.ts23 symbols
packages/coinlib-ripple/src/RipplePaymentsUtils.ts23 symbols
packages/coinlib-ethereum/src/NetworkData.ts23 symbols

For agents

$ claude mcp add coinlib \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact