How to use the @bitgo/statics.coins.get function in @bitgo/statics

To help you get started, we’ve selected a few @bitgo/statics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BitGo / BitGoJS / modules / core / src / v2 / coinFactory.ts View on Github external
public getInstance(bitgo: BitGo, name: string): BaseCoin {
    let staticsCoin;
    try {
      staticsCoin = coins.get(name);
    } catch (e) {
      if (!(e instanceof CoinNotDefinedError)) {
        throw e;
      }
    }

    const constructor = this.coinConstructors.get(name);
    if (constructor) {
      return constructor(bitgo, staticsCoin);
    }

    const ethConstructor = this.coinConstructors.get('eth');
    if (ethConstructor) {
      const ethCoin = ethConstructor(bitgo, staticsCoin);
      if (ethCoin.isValidAddress(name)) {
        const unknownTokenConstructor = Token.createTokenConstructor({

@bitgo/statics

dependency-free static configuration for the bitgo platform

Apache-2.0
Latest version published 3 days ago

Package Health Score

84 / 100
Full package analysis

Popular @bitgo/statics functions