-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3686 from BitGo/BG-79064-injective-sdk-impl
feat(sdk-coin-injective): injective sdk init along with testcases
- Loading branch information
Showing
42 changed files
with
2,047 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,85 @@ | ||
import { AbstractUtxoCoin } from '@bitgo/abstract-utxo'; | ||
export { AbstractUtxoCoin }; | ||
import { Ada, Tada } from '@bitgo/sdk-coin-ada'; | ||
import { Algo, AlgoToken, Talgo } from '@bitgo/sdk-coin-algo'; | ||
import { Atom, Tatom } from '@bitgo/sdk-coin-atom'; | ||
import { AvaxC, AvaxCToken, TavaxC } from '@bitgo/sdk-coin-avaxc'; | ||
import { AvaxP, TavaxP } from '@bitgo/sdk-coin-avaxp'; | ||
import { Bch, Tbch } from '@bitgo/sdk-coin-bch'; | ||
import { Bcha, Tbcha } from '@bitgo/sdk-coin-bcha'; | ||
import { Bld, Tbld } from '@bitgo/sdk-coin-bld'; | ||
import { Bsc, BscToken, Tbsc } from '@bitgo/sdk-coin-bsc'; | ||
import { Bsv, Tbsv } from '@bitgo/sdk-coin-bsv'; | ||
import { Btc, Tbtc } from '@bitgo/sdk-coin-btc'; | ||
import { Btg } from '@bitgo/sdk-coin-btg'; | ||
import { Celo, CeloToken, Tcelo } from '@bitgo/sdk-coin-celo'; | ||
import { Cspr, Tcspr } from '@bitgo/sdk-coin-cspr'; | ||
import { Dash, Tdash } from '@bitgo/sdk-coin-dash'; | ||
import { Doge, Tdoge } from '@bitgo/sdk-coin-doge'; | ||
import { Dot, Tdot } from '@bitgo/sdk-coin-dot'; | ||
import { Eos, EosToken, Teos } from '@bitgo/sdk-coin-eos'; | ||
import { Etc, Tetc } from '@bitgo/sdk-coin-etc'; | ||
import { Erc20Token, Eth, Gteth, Teth } from '@bitgo/sdk-coin-eth'; | ||
import { Eth2, Teth2 } from '@bitgo/sdk-coin-eth2'; | ||
import { Ethw } from '@bitgo/sdk-coin-ethw'; | ||
import { Hash, Thash } from '@bitgo/sdk-coin-hash'; | ||
import { Hbar, Thbar } from '@bitgo/sdk-coin-hbar'; | ||
import { Injective, Tinjective } from '@bitgo/sdk-coin-injective'; | ||
import { Ltc, Tltc } from '@bitgo/sdk-coin-ltc'; | ||
import { Osmo, Tosmo } from '@bitgo/sdk-coin-osmo'; | ||
import { Polygon, PolygonToken, Tpolygon } from '@bitgo/sdk-coin-polygon'; | ||
import { Rbtc, Trbtc } from '@bitgo/sdk-coin-rbtc'; | ||
import { Sei, Tsei } from '@bitgo/sdk-coin-sei'; | ||
import { Sol, Tsol } from '@bitgo/sdk-coin-sol'; | ||
import { Stx, Tstx } from '@bitgo/sdk-coin-stx'; | ||
import { Sui, Tsui } from '@bitgo/sdk-coin-sui'; | ||
import { Tia, Ttia } from '@bitgo/sdk-coin-tia'; | ||
import { Trx, Ttrx } from '@bitgo/sdk-coin-trx'; | ||
import { StellarToken, Txlm, Xlm } from '@bitgo/sdk-coin-xlm'; | ||
import { Txrp, Xrp } from '@bitgo/sdk-coin-xrp'; | ||
import { Txtz, Xtz } from '@bitgo/sdk-coin-xtz'; | ||
import { Tzec, Zec } from '@bitgo/sdk-coin-zec'; | ||
export { AbstractUtxoCoin }; | ||
export { Algo, AlgoToken, Talgo }; | ||
import { Ada, Tada } from '@bitgo/sdk-coin-ada'; | ||
export { Ada, Tada }; | ||
import { Atom, Tatom } from '@bitgo/sdk-coin-atom'; | ||
export { Atom, Tatom }; | ||
import { AvaxC, TavaxC, AvaxCToken } from '@bitgo/sdk-coin-avaxc'; | ||
export { AvaxC, TavaxC, AvaxCToken }; | ||
import { AvaxP, TavaxP } from '@bitgo/sdk-coin-avaxp'; | ||
export { AvaxC, AvaxCToken, TavaxC }; | ||
export { AvaxP, TavaxP }; | ||
import { Bch, Tbch } from '@bitgo/sdk-coin-bch'; | ||
export { Bch, Tbch }; | ||
import { Bsc, Tbsc, BscToken } from '@bitgo/sdk-coin-bsc'; | ||
export { Bsc, Tbsc, BscToken }; | ||
import { Bsv, Tbsv } from '@bitgo/sdk-coin-bsv'; | ||
export { Bsc, BscToken, Tbsc }; | ||
export { Bsv, Tbsv }; | ||
import { Btc, Tbtc } from '@bitgo/sdk-coin-btc'; | ||
export { Btc, Tbtc }; | ||
import { Btg } from '@bitgo/sdk-coin-btg'; | ||
export { Btg }; | ||
import { Celo, CeloToken, Tcelo } from '@bitgo/sdk-coin-celo'; | ||
export { Celo, CeloToken, Tcelo }; | ||
import { Cspr, Tcspr } from '@bitgo/sdk-coin-cspr'; | ||
export { Cspr, Tcspr }; | ||
import { Dash, Tdash } from '@bitgo/sdk-coin-dash'; | ||
export { Dash, Tdash }; | ||
import { Doge, Tdoge } from '@bitgo/sdk-coin-doge'; | ||
export { Doge, Tdoge }; | ||
import { Dot, Tdot } from '@bitgo/sdk-coin-dot'; | ||
export { Dot, Tdot }; | ||
import { Bcha, Tbcha } from '@bitgo/sdk-coin-bcha'; | ||
export { Bcha, Tbcha }; | ||
import { EosToken, Eos, Teos } from '@bitgo/sdk-coin-eos'; | ||
export { EosToken, Eos, Teos }; | ||
import { Erc20Token, Eth, Gteth, Teth } from '@bitgo/sdk-coin-eth'; | ||
export { Eos, EosToken, Teos }; | ||
export { Erc20Token, Eth, Gteth, Teth }; | ||
import { Eth2, Teth2 } from '@bitgo/sdk-coin-eth2'; | ||
export { Eth2, Teth2 }; | ||
import { Ethw } from '@bitgo/sdk-coin-ethw'; | ||
export { Ethw }; | ||
import { Etc, Tetc } from '@bitgo/sdk-coin-etc'; | ||
export { Etc, Tetc }; | ||
import { Hash, Thash } from '@bitgo/sdk-coin-hash'; | ||
export { Hash, Thash }; | ||
import { Hbar, Thbar } from '@bitgo/sdk-coin-hbar'; | ||
export { Hbar, Thbar }; | ||
import { Ltc, Tltc } from '@bitgo/sdk-coin-ltc'; | ||
export { Ltc, Tltc }; | ||
import { Osmo, Tosmo } from '@bitgo/sdk-coin-osmo'; | ||
export { Osmo, Tosmo }; | ||
import { Polygon, Tpolygon, PolygonToken } from '@bitgo/sdk-coin-polygon'; | ||
export { Polygon, Tpolygon, PolygonToken }; | ||
import { Rbtc, Trbtc } from '@bitgo/sdk-coin-rbtc'; | ||
export { Polygon, PolygonToken, Tpolygon }; | ||
export { Rbtc, Trbtc }; | ||
import { Sol, Tsol } from '@bitgo/sdk-coin-sol'; | ||
export { Sol, Tsol }; | ||
import { Stx, Tstx } from '@bitgo/sdk-coin-stx'; | ||
export { Stx, Tstx }; | ||
import { Sui, Tsui } from '@bitgo/sdk-coin-sui'; | ||
export { Sui, Tsui }; | ||
import { Tia, Ttia } from '@bitgo/sdk-coin-tia'; | ||
export { Tia, Ttia }; | ||
import { Bld, Tbld } from '@bitgo/sdk-coin-bld'; | ||
export { Bld, Tbld }; | ||
import { Sei, Tsei } from '@bitgo/sdk-coin-sei'; | ||
export { Sei, Tsei }; | ||
import { Trx, Ttrx } from '@bitgo/sdk-coin-trx'; | ||
export { Injective, Tinjective }; | ||
export { Trx, Ttrx }; | ||
import { StellarToken, Txlm, Xlm } from '@bitgo/sdk-coin-xlm'; | ||
export { StellarToken, Txlm, Xlm }; | ||
import { Xrp, Txrp } from '@bitgo/sdk-coin-xrp'; | ||
export { Xrp, Txrp }; | ||
import { Xtz, Txtz } from '@bitgo/sdk-coin-xtz'; | ||
export { Xtz, Txtz }; | ||
import { Zec, Tzec } from '@bitgo/sdk-coin-zec'; | ||
export { Zec, Tzec }; | ||
export { Txrp, Xrp }; | ||
export { Txtz, Xtz }; | ||
export { Tzec, Zec }; | ||
|
||
import { coins } from '@bitgo/sdk-core'; | ||
const { Ofc, OfcToken, Susd, FiatUsd, FiatEur, FiatGBP, Tsusd, TfiatUsd, TfiatEur, TfiatGBP } = coins; | ||
export { Ofc, OfcToken, Susd, FiatUsd, FiatEur, FiatGBP, Tsusd, TfiatUsd, TfiatEur, TfiatGBP }; | ||
export { FiatEur, FiatGBP, FiatUsd, Ofc, OfcToken, Susd, TfiatEur, TfiatGBP, TfiatUsd, Tsusd }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.idea | ||
public | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.idea/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require: 'ts-node/register' | ||
timeout: '60000' | ||
reporter: 'min' | ||
reporter-option: | ||
- 'cdn=true' | ||
- 'json=false' | ||
exit: true | ||
spec: ['test/unit/**/*.ts'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
!dist/ | ||
dist/test/ | ||
dist/tsconfig.tsbuildinfo | ||
.idea/ | ||
.prettierrc.yml | ||
tsconfig.json | ||
src/ | ||
test/ | ||
scripts/ | ||
.nyc_output | ||
CODEOWNERS | ||
node_modules/ | ||
.prettierignore | ||
.mocharc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.nyc_output/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
printWidth: 120 | ||
singleQuote: true | ||
trailingComma: 'es5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# BitGo sdk-coin-injective | ||
|
||
SDK coins provide a modular approach to a monolithic architecture. This and all BitGoJS SDK coins allow developers to use only the coins needed for a given project. | ||
|
||
## Installation | ||
|
||
All coins are loaded traditionally through the `bitgo` package. If you are using coins individually, you will be accessing the coin via the `@bitgo/sdk-api` package. | ||
|
||
In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-injective`. | ||
|
||
```shell | ||
npm i @bitgo/sdk-api @bitgo/sdk-coin-injective | ||
``` | ||
|
||
Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of `bitgo`. | ||
|
||
```javascript | ||
import { BitGoAPI } from '@bitgo/sdk-api'; | ||
import { Injective } from '@bitgo/sdk-coin-injective'; | ||
|
||
const sdk = new BitGoAPI(); | ||
|
||
sdk.register('injective', Injective.createInstance); | ||
``` | ||
|
||
## Development | ||
|
||
Most of the coin implementations are derived from `@bitgo/sdk-core`, `@bitgo/statics`, and coin specific packages. These implementations are used to interact with the BitGo API and BitGo platform services. | ||
|
||
You will notice that the basic version of common class extensions have been provided to you and must be resolved before the package build will succeed. Upon initiation of a given SDK coin, you will need to verify that your coin has been included in the root `tsconfig.packages.json` and that the linting, formatting, and testing succeeds when run both within the coin and from the root of BitGoJS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"name": "@bitgo/sdk-coin-injective", | ||
"version": "1.1.2", | ||
"description": "BitGo SDK coin library for Injective", | ||
"main": "./dist/src/index.js", | ||
"types": "./dist/src/index.d.ts", | ||
"scripts": { | ||
"build": "yarn tsc --build --incremental --verbose .", | ||
"fmt": "prettier --write .", | ||
"check-fmt": "prettier --check .", | ||
"clean": "rm -r ./dist", | ||
"lint": "eslint --quiet .", | ||
"prepare": "npm run build", | ||
"test": "npm run coverage", | ||
"coverage": "nyc -- npm run unit-test", | ||
"unit-test": "mocha" | ||
}, | ||
"author": "BitGo SDK Team <[email protected]>", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14 <17" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/BitGo/BitGoJS.git", | ||
"directory": "modules/sdk-coin-injective" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts}": [ | ||
"yarn prettier --write", | ||
"yarn eslint --fix" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
] | ||
}, | ||
"dependencies": { | ||
"@bitgo/abstract-cosmos": "^1.3.0", | ||
"@bitgo/sdk-core": "^8.10.0", | ||
"@bitgo/statics": "^17.0.1", | ||
"@cosmjs/amino": "^0.29.5", | ||
"@cosmjs/encoding": "^0.29.5", | ||
"@cosmjs/stargate": "^0.29.5", | ||
"bignumber.js": "^9.1.1" | ||
}, | ||
"devDependencies": { | ||
"@bitgo/sdk-api": "^1.11.2", | ||
"@bitgo/sdk-test": "^1.2.27", | ||
"@types/lodash": "^4.14.183" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './injective'; | ||
export * from './lib'; | ||
export * from './register'; | ||
export * from './tinjective'; |
Oops, something went wrong.