UNPKG

1.22 kBPlain TextView Raw
1/**
2 * @prettier
3 */
4//
5// index.js - Module definition for BitGoJS
6//
7// Copyright 2022, BitGo, Inc. All Rights Reserved.
8//
9import * as _ from 'lodash';
10import { common } from '@bitgo/sdk-core';
11export * from '@bitgo/sdk-api';
12import * as utxolib from '@bitgo/utxo-lib';
13import GlobalCoinFactory from './v2/coinFactory';
14
15export * from './bitgo';
16
17// Expose legacy "bitcoin" API (mostly HDNode)
18/** @deprecated */
19export * as bitcoin from './legacyBitcoin';
20
21/** @deprecated */
22export const sjcl = require('@bitgo/sjcl');
23
24export { Buffer } from 'buffer';
25
26export const Environments = _.cloneDeep(common.Environments);
27export * from '@bitgo/sdk-core';
28export { GlobalCoinFactory };
29export * from './v2';
30
31/**
32 * Set the network, i.e. either "bitcoin" for production with real bitcoin, or
33 * "testnet" for development with testnet bitcoin.
34 *
35 * @deprecated
36 */
37export function setNetwork(network) {
38 common.setNetwork(network);
39}
40
41/**
42 * Get the network. Returns either "bitcoin" or "testnet".
43 *
44 * @deprecated
45 */
46export function getNetwork() {
47 return common.getNetwork();
48}
49
50/**
51 * @deprecated
52 */
53export function getNetworkObj() {
54 return utxolib.networks[common.getNetwork()];
55}
56
57setNetwork('testnet');