Skip to content

Commit f23039b

Browse files
Merge pull request #5416 from BitGo/WIN-4180-sgb-txn-builder
feat(sdk-coin-sgb): add transaction builder
2 parents 07b95bf + bf2c507 commit f23039b

25 files changed

+410
-0
lines changed

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
/modules/sdk-coin-cspr/ @BitGo/ethalt-team
6161
/modules/sdk-coin-dot/ @BitGo/ethalt-team
6262
/modules/sdk-coin-eos/ @BitGo/ethalt-team
63+
/modules/sdk-coin-flr/ @BitGo/ethalt-team
6364
/modules/sdk-coin-ethlike/ @BitGo/ethalt-team
6465
/modules/sdk-coin-hbar/ @BitGo/ethalt-team
6566
/modules/sdk-coin-icp/ @BitGo/ethalt-team
@@ -68,12 +69,14 @@
6869
/modules/sdk-coin-opeth/ @BitGo/ethalt-team
6970
/modules/sdk-coin-polygon/ @BitGo/ethalt-team
7071
/modules/sdk-coin-rune/ @BitGo/ethalt-team
72+
/modules/sdk-coin-sgb/ @BitGo/ethalt-team
7173
/modules/sdk-coin-sol/ @BitGo/ethalt-team
7274
/modules/sdk-coin-stx/ @BitGo/ethalt-team
7375
/modules/sdk-coin-sui/ @BitGo/ethalt-team
7476
/modules/sdk-coin-tao/ @BitGo/ethalt-team
7577
/modules/sdk-coin-ton/ @BitGo/ethalt-team
7678
/modules/sdk-coin-trx/ @BitGo/ethalt-team
79+
/modules/sdk-coin-xdc/ @BitGo/ethalt-team
7780
/modules/sdk-coin-xlm/ @BitGo/ethalt-team
7881
/modules/sdk-coin-xrp/ @BitGo/ethalt-team
7982
/modules/sdk-coin-xtz/ @BitGo/ethalt-team

modules/sdk-coin-sgb/.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.idea
3+
public
4+
dist
5+

modules/sdk-coin-sgb/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.idea/
3+
dist/

modules/sdk-coin-sgb/.mocharc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require: 'ts-node/register'
2+
timeout: '120000'
3+
reporter: 'min'
4+
reporter-option:
5+
- 'cdn=true'
6+
- 'json=false'
7+
exit: true
8+
spec: ['test/unit/**/*.ts']

modules/sdk-coin-sgb/.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
!dist/
2+
dist/test/
3+
dist/tsconfig.tsbuildinfo
4+
.idea/
5+
.prettierrc.yml
6+
tsconfig.json
7+
src/
8+
test/
9+
scripts/
10+
.nyc_output
11+
CODEOWNERS
12+
node_modules/
13+
.prettierignore
14+
.mocharc.js
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc_output/
2+
dist/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
printWidth: 120
2+
singleQuote: true
3+
trailingComma: 'es5'

modules/sdk-coin-sgb/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
**Note:** Version bump only for package @bitgo/sdk-coin-sgb
7+
8+
### Features

modules/sdk-coin-sgb/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# BitGo sdk-coin-sgb
2+
3+
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.
4+
5+
## Installation
6+
7+
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.
8+
9+
In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-sgb`.
10+
11+
```shell
12+
npm i @bitgo/sdk-api @bitgo/sdk-coin-sgb
13+
```
14+
15+
Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of `bitgo`.
16+
17+
```javascript
18+
import { BitGoAPI } from '@bitgo/sdk-api';
19+
import { sgb } from '@bitgo/sdk-coin-sgb';
20+
21+
const sdk = new BitGoAPI();
22+
23+
sdk.register('sgb', sgb.createInstance);
24+
```
25+
26+
## Development
27+
28+
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.
29+
30+
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.

modules/sdk-coin-sgb/package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@bitgo/sdk-coin-sgb",
3+
"version": "1.0.0",
4+
"description": "BitGo SDK coin library for Sgb",
5+
"main": "./dist/src/index.js",
6+
"types": "./dist/src/index.d.ts",
7+
"scripts": {
8+
"build": "yarn tsc --build --incremental --verbose .",
9+
"fmt": "prettier --write .",
10+
"check-fmt": "prettier --check .",
11+
"clean": "rm -r ./dist",
12+
"lint": "eslint --quiet .",
13+
"prepare": "npm run build",
14+
"test": "npm run coverage",
15+
"coverage": "nyc -- npm run unit-test",
16+
"unit-test": "mocha"
17+
},
18+
"author": "BitGo SDK Team <[email protected]>",
19+
"license": "MIT",
20+
"engines": {
21+
"node": ">=18 <21"
22+
},
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/BitGo/BitGoJS.git",
26+
"directory": "modules/sdk-coin-sgb"
27+
},
28+
"lint-staged": {
29+
"*.{js,ts}": [
30+
"yarn prettier --write",
31+
"yarn eslint --fix"
32+
]
33+
},
34+
"publishConfig": {
35+
"access": "public"
36+
},
37+
"nyc": {
38+
"extension": [
39+
".ts"
40+
]
41+
},
42+
"dependencies": {
43+
"@bitgo/abstract-eth": "^22.4.10",
44+
"@bitgo/sdk-core": "^28.20.0",
45+
"@bitgo/statics": "^50.20.0",
46+
"@ethereumjs/common": "^2.6.5"
47+
},
48+
"devDependencies": {
49+
"@bitgo/sdk-api": "^1.58.2",
50+
"@bitgo/sdk-test": "^8.0.65"
51+
}
52+
}

0 commit comments

Comments
 (0)