Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
/modules/sdk-coin-bera/ @BitGo/ethalt-team
/modules/sdk-coin-bsc/ @BitGo/ethalt-team
/modules/sdk-coin-coredao/ @BitGo/ethalt-team
/modules/sdk-coin-cosmos/ @BitGo/ethalt-team
/modules/sdk-coin-cronos/ @BitGo/ethalt-team
/modules/sdk-coin-cspr/ @BitGo/ethalt-team
/modules/sdk-coin-dot/ @BitGo/ethalt-team
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-bsc /var/modules/sdk-coin-bsc/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-celo /var/modules/sdk-coin-celo/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-coredao /var/modules/sdk-coin-coredao/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-coreum /var/modules/sdk-coin-coreum/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cosmos /var/modules/sdk-coin-cosmos/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cronos /var/modules/sdk-coin-cronos/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cspr /var/modules/sdk-coin-cspr/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dot /var/modules/sdk-coin-dot/
Expand Down Expand Up @@ -170,6 +171,7 @@ cd /var/modules/sdk-coin-bsc && yarn link && \
cd /var/modules/sdk-coin-celo && yarn link && \
cd /var/modules/sdk-coin-coredao && yarn link && \
cd /var/modules/sdk-coin-coreum && yarn link && \
cd /var/modules/sdk-coin-cosmos && yarn link && \
cd /var/modules/sdk-coin-cronos && yarn link && \
cd /var/modules/sdk-coin-cspr && yarn link && \
cd /var/modules/sdk-coin-dot && yarn link && \
Expand Down Expand Up @@ -268,6 +270,7 @@ RUN cd /var/bitgo-express && \
yarn link @bitgo/sdk-coin-celo && \
yarn link @bitgo/sdk-coin-coredao && \
yarn link @bitgo/sdk-coin-coreum && \
yarn link @bitgo/sdk-coin-cosmos && \
yarn link @bitgo/sdk-coin-cronos && \
yarn link @bitgo/sdk-coin-cspr && \
yarn link @bitgo/sdk-coin-dot && \
Expand Down
5 changes: 5 additions & 0 deletions modules/sdk-coin-cosmos/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.idea
public
dist

3 changes: 3 additions & 0 deletions modules/sdk-coin-cosmos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.idea/
dist/
8 changes: 8 additions & 0 deletions modules/sdk-coin-cosmos/.mocharc.yml
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']
14 changes: 14 additions & 0 deletions modules/sdk-coin-cosmos/.npmignore
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
2 changes: 2 additions & 0 deletions modules/sdk-coin-cosmos/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.nyc_output/
dist/
3 changes: 3 additions & 0 deletions modules/sdk-coin-cosmos/.prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printWidth: 120
singleQuote: true
trailingComma: 'es5'
5 changes: 5 additions & 0 deletions modules/sdk-coin-cosmos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @bitgo/sdk-coin-cosmos

Configurable common module for Cosmos SDK chains, using @bitgo/abstract-cosmos for reduced coin integration boilerplate.

This module provides a shared implementation for Cosmos SDK-based coins, allowing new Cosmos chains to be added through configuration in statics rather than requiring individual coin modules.
47 changes: 47 additions & 0 deletions modules/sdk-coin-cosmos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@bitgo/sdk-coin-cosmos",
"version": "1.0.0",
"description": "BitGo SDK coin library for Cosmos",
"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": ">=18 <23"
},
"repository": {
"type": "git",
"url": "https://github.com/BitGo/BitGoJS.git",
"directory": "modules/sdk-coin-cosmos"
},
"lint-staged": {
"*.{js,ts}": [
"yarn prettier --write",
"yarn eslint --fix"
]
},
"publishConfig": {
"access": "public"
},
"nyc": {
"extension": [
".ts"
]
},
"dependencies": {
"@bitgo/sdk-core": "^35.7.0",
"@bitgo/abstract-cosmos": "^11.9.7"
},
"devDependencies": {}
}
16 changes: 16 additions & 0 deletions modules/sdk-coin-cosmos/src/cosmosSharedCoin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BaseCoin, BitGoBase } from '@bitgo/sdk-core';
import { CosmosCoin } from '@bitgo/abstract-cosmos';

/**
* Shared Cosmos coin implementation that uses configuration from statics
* instead of requiring individual coin modules
*/
export class CosmosSharedCoin extends CosmosCoin {
protected constructor(bitgo: BitGoBase) {
super(bitgo);
}

static createInstance(bitgo: BitGoBase): BaseCoin {
return new CosmosCoin(bitgo);
}
}
1 change: 1 addition & 0 deletions modules/sdk-coin-cosmos/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { CosmosSharedCoin } from './cosmosSharedCoin';
Empty file.
23 changes: 23 additions & 0 deletions modules/sdk-coin-cosmos/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./",
"strictPropertyInitialization": false,
"esModuleInterop": true,
"typeRoots": ["../../types", "./node_modules/@types", "../../node_modules/@types"]
},
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules"],
"references": [
{
"path": "../sdk-api"
},
{
"path": "../sdk-core"
},
{
"path": "../sdk-test"
}
]
}
3 changes: 3 additions & 0 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
{
"path": "./modules/sdk-coin-coreum"
},
{
"path": "./modules/sdk-coin-cosmos"
},
{
"path": "./modules/sdk-coin-cronos"
},
Expand Down