Skip to content

Commit a974bb1

Browse files
authored
Merge pull request #7114 from BitGo/COIN-5805
feat(sdk-coin-canton): added new coin, canton skeleton
2 parents ef0f38d + 9aa34bb commit a974bb1

30 files changed

+559
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-bsv /var/modules/sdk-coin-bsv/
123123
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btc /var/modules/sdk-coin-btc/
124124
COPY --from=builder /tmp/bitgo/modules/utxo-ord /var/modules/utxo-ord/
125125
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btg /var/modules/sdk-coin-btg/
126+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-canton /var/modules/sdk-coin-canton/
126127
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dash /var/modules/sdk-coin-dash/
127128
COPY --from=builder /tmp/bitgo/modules/sdk-coin-doge /var/modules/sdk-coin-doge/
128129
COPY --from=builder /tmp/bitgo/modules/sdk-coin-eos /var/modules/sdk-coin-eos/
@@ -219,6 +220,7 @@ cd /var/modules/sdk-coin-bsv && yarn link && \
219220
cd /var/modules/sdk-coin-btc && yarn link && \
220221
cd /var/modules/utxo-ord && yarn link && \
221222
cd /var/modules/sdk-coin-btg && yarn link && \
223+
cd /var/modules/sdk-coin-canton && yarn link && \
222224
cd /var/modules/sdk-coin-dash && yarn link && \
223225
cd /var/modules/sdk-coin-doge && yarn link && \
224226
cd /var/modules/sdk-coin-eos && yarn link && \
@@ -318,6 +320,7 @@ RUN cd /var/bitgo-express && \
318320
yarn link @bitgo/sdk-coin-btc && \
319321
yarn link @bitgo/utxo-ord && \
320322
yarn link @bitgo/sdk-coin-btg && \
323+
yarn link @bitgo/sdk-coin-canton && \
321324
yarn link @bitgo/sdk-coin-dash && \
322325
yarn link @bitgo/sdk-coin-doge && \
323326
yarn link @bitgo/sdk-coin-eos && \

modules/bitgo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@bitgo/sdk-coin-bsv": "^2.4.2",
6868
"@bitgo/sdk-coin-btc": "^2.9.1",
6969
"@bitgo/sdk-coin-btg": "^2.4.2",
70+
"@bitgo/sdk-coin-canton": "^1.0.0",
7071
"@bitgo/sdk-coin-celo": "^5.3.2",
7172
"@bitgo/sdk-coin-coredao": "^2.6.2",
7273
"@bitgo/sdk-coin-coreum": "^21.5.2",

modules/bitgo/src/v2/coinFactory.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import {
6262
Bsv,
6363
Btc,
6464
Btg,
65+
Canton,
6566
Celo,
6667
CeloToken,
6768
Coredao,
@@ -149,6 +150,7 @@ import {
149150
Tbtcsig,
150151
Tbtc4,
151152
Tbtcbgsig,
153+
Tcanton,
152154
Tcelo,
153155
Tcoredao,
154156
Tcoreum,
@@ -241,6 +243,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
241243
coinFactory.register('bsv', Bsv.createInstance);
242244
coinFactory.register('btc', Btc.createInstance);
243245
coinFactory.register('btg', Btg.createInstance);
246+
coinFactory.register('canton', Canton.createInstance);
244247
coinFactory.register('celo', Celo.createInstance);
245248
coinFactory.register('coredao', Coredao.createInstance);
246249
coinFactory.register('coreum', Coreum.createInstance);
@@ -605,6 +608,8 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
605608
return Btc.createInstance;
606609
case 'btg':
607610
return Btg.createInstance;
611+
case 'canton':
612+
return Canton.createInstance;
608613
case 'celo':
609614
return Celo.createInstance;
610615
case 'coredao':
@@ -747,6 +752,8 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
747752
return Tbtc4.createInstance;
748753
case 'tbtcbgsig':
749754
return Tbtcbgsig.createInstance;
755+
case 'tcanton':
756+
return Tcanton.createInstance;
750757
case 'tcelo':
751758
return Tcelo.createInstance;
752759
case 'tcoredao':

modules/bitgo/src/v2/coins/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Bsc, BscToken, Tbsc } from '@bitgo/sdk-coin-bsc';
1818
import { Bsv, Tbsv } from '@bitgo/sdk-coin-bsv';
1919
import { Btc, Tbtc, Tbtcsig, Tbtc4, Tbtcbgsig } from '@bitgo/sdk-coin-btc';
2020
import { Btg } from '@bitgo/sdk-coin-btg';
21+
import { Canton, Tcanton } from '@bitgo/sdk-coin-canton';
2122
import { Celo, CeloToken, Tcelo } from '@bitgo/sdk-coin-celo';
2223
import { Coredao, Tcoredao, CoredaoToken } from '@bitgo/sdk-coin-coredao';
2324
import { Coreum, Tcoreum } from '@bitgo/sdk-coin-coreum';
@@ -91,6 +92,7 @@ export { Bsc, BscToken, Tbsc };
9192
export { Bsv, Tbsv };
9293
export { Btc, Tbtc, Tbtcsig, Tbtc4, Tbtcbgsig };
9394
export { Btg };
95+
export { Canton, Tcanton };
9496
export { Celo, CeloToken, Tcelo };
9597
export { Coredao, Tcoredao, CoredaoToken };
9698
export { Coreum, Tcoreum };

modules/bitgo/test/browser/browser.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ describe('Coins', () => {
5858
HashToken: 1,
5959
FlrToken: 1,
6060
JettonToken: 1,
61+
Canton: 1,
62+
Tcanton: 1,
6163
};
6264
Object.keys(BitGoJS.Coin)
6365
.filter((coinName) => !excludedKeys[coinName])

modules/bitgo/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
{
114114
"path": "../sdk-coin-btg"
115115
},
116+
{
117+
"path": "../sdk-coin-canton"
118+
},
116119
{
117120
"path": "../sdk-coin-celo"
118121
},
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-canton/.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/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require: 'tsx'
2+
timeout: '60000'
3+
reporter: 'min'
4+
reporter-option:
5+
- 'cdn=true'
6+
- 'json=false'
7+
exit: true
8+
spec: ['test/unit/**/*.ts']

modules/sdk-coin-canton/.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

0 commit comments

Comments
 (0)