BitGoJS 开源项目教程
BitGoJSBitGo JavaScript SDK项目地址:https://gitcode.com/gh_mirrors/bi/BitGoJS
1. 项目的目录结构及介绍
BitGoJS 项目的目录结构如下:
BitGoJS/
├── docs/
├── examples/
├── packages/
│ ├── bitgo/
│ ├── common/
│ ├── express/
│ ├── keycard/
│ ├── mgmt/
│ ├── sdk/
│ ├── statics/
│ ├── test/
│ └── wallet/
├── scripts/
├── test/
└── tsconfig.json
目录介绍:
- docs/: 包含项目的文档文件。
- examples/: 包含使用 BitGoJS 的示例代码。
- packages/: 包含多个子包,每个子包都是一个独立的模块,例如
bitgo
,common
,express
等。 - scripts/: 包含项目的脚本文件,用于自动化任务。
- test/: 包含项目的测试文件。
- tsconfig.json: TypeScript 配置文件。
2. 项目的启动文件介绍
BitGoJS 项目的启动文件位于 packages/bitgo/src/index.ts
。这个文件是整个项目的入口点,负责初始化和导出主要的 API 接口。
// packages/bitgo/src/index.ts
export * from './bitgo';
export * from './v2';
export * from './v1';
export * from './wallet';
export * from './keychain';
export * from './tss';
export * from './internal';
export * from './utils';
export * from './resources';
export * from './account-lib';
export * from './recovery';
export * from './trading';
export * from './trading/v2';
export * from './trading/v1';
export * from './trading/v1/market';
export * from './trading/v1/order';
export * from './trading/v1/trade';
export * from './trading/v1/wallet';
export * from './trading/v1/account';
export * from './trading/v1/marketData';
export * from './trading/v1/orderBook';
export * from './trading/v1/tradeHistory';
export * from './trading/v1/walletHistory';
export * from './trading/v1/accountHistory';
export * from './trading/v1/marketDataHistory';
export * from './trading/v1/orderBookHistory';
export * from './trading/v1/tradeHistoryHistory';
export * from './trading/v1/walletHistoryHistory';
export * from './trading/v1/accountHistoryHistory';
export * from './trading/v1/marketDataHistoryHistory';
export * from './trading/v1/orderBookHistoryHistory';
export * from './trading/v1/tradeHistoryHistoryHistory';
export * from './trading/v1/walletHistoryHistoryHistory';
export * from './trading/v1/accountHistoryHistoryHistory';
export * from './trading/v1/marketDataHistoryHistoryHistory';
export * from './trading/v1/orderBookHistoryHistoryHistory';
export * from './trading/v1/tradeHistoryHistoryHistoryHistory';
export * from './trading/v1/walletHistoryHistoryHistoryHistory';
export * from './trading/v1/accountHistoryHistoryHistoryHistory';
export * from './trading/v1/marketDataHistoryHistoryHistoryHistory';
export * from './trading/v1/orderBookHistoryHistoryHistoryHistory';
export * from './trading/v1/tradeHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/walletHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/accountHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/marketDataHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/orderBookHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/tradeHistoryHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/walletHistoryHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/accountHistoryHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/marketDataHistoryHistoryHistoryHistoryHistoryHistory';
export * from './trading/v1/orderBookHistoryHistoryHistoryHistoryHistoryHistory';
BitGoJSBitGo JavaScript SDK项目地址:https://gitcode.com/gh_mirrors/bi/BitGoJS