Skip to content

Commit 42df930

Browse files
Merge branch 'master' into rel/latest
2 parents c029b3e + 63603b3 commit 42df930

File tree

106 files changed

+1076
-3583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1076
-3583
lines changed

CODEOWNERS

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/modules/bitgo/test/v2/unit/coins/utxo/ @BitGo/btc-team
1212
/modules/bitgo/test/v2/unit/lightning.ts @BitGo/btc-team
1313
/modules/blockapis/ @BitGo/btc-team
14-
/modules/bls-dkg/ @BitGo/hsm
1514
/modules/sdk-coin-bch/ @BitGo/btc-team
1615
/modules/sdk-coin-bcha/ @BitGo/btc-team
1716
/modules/sdk-coin-bsv/ @BitGo/btc-team
@@ -40,7 +39,6 @@
4039
/modules/sdk-coin-etc/ @BitGo/ethalt-team
4140
/modules/abstract-eth/ @BitGo/ethalt-team
4241
/modules/sdk-coin-eth/ @BitGo/ethalt-team
43-
/modules/sdk-coin-eth2/ @BitGo/ethalt-team
4442
/modules/sdk-coin-rbtc/ @BitGo/ethalt-team
4543
/modules/bitgo/test/v2/unit/coins/staking/ @BitGo/ethalt-team
4644
/modules/bitgo/test/v2/unit/coins/token.ts @BitGo/ethalt-team
@@ -66,6 +64,7 @@
6664
/modules/sdk-coin-ethlike/ @BitGo/ethalt-team
6765
/modules/sdk-coin-hbar/ @BitGo/ethalt-team
6866
/modules/sdk-coin-icp/ @BitGo/ethalt-team
67+
/modules/sdk-coin-mon/ @BitGo/ethalt-team
6968
/modules/sdk-coin-mantra/ @BitGo/ethalt-team
7069
/modules/sdk-coin-near/ @BitGo/ethalt-team
7170
/modules/sdk-coin-oas/ @BitGo/ethalt-team

Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ COPY --from=builder /tmp/bitgo/modules/express /var/bitgo-express/
4040
#COPY_START
4141
COPY --from=builder /tmp/bitgo/modules/abstract-lightning /var/modules/abstract-lightning/
4242
COPY --from=builder /tmp/bitgo/modules/sdk-core /var/modules/sdk-core/
43-
COPY --from=builder /tmp/bitgo/modules/bls-dkg /var/modules/bls-dkg/
4443
COPY --from=builder /tmp/bitgo/modules/sdk-lib-mpc /var/modules/sdk-lib-mpc/
4544
COPY --from=builder /tmp/bitgo/modules/sdk-opensslbytes /var/modules/sdk-opensslbytes/
4645
COPY --from=builder /tmp/bitgo/modules/secp256k1 /var/modules/secp256k1/
@@ -76,13 +75,13 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-coreum /var/modules/sdk-coin-cor
7675
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cspr /var/modules/sdk-coin-cspr/
7776
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dot /var/modules/sdk-coin-dot/
7877
COPY --from=builder /tmp/bitgo/modules/sdk-coin-etc /var/modules/sdk-coin-etc/
79-
COPY --from=builder /tmp/bitgo/modules/sdk-coin-eth2 /var/modules/sdk-coin-eth2/
8078
COPY --from=builder /tmp/bitgo/modules/sdk-coin-flr /var/modules/sdk-coin-flr/
8179
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hash /var/modules/sdk-coin-hash/
8280
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hbar /var/modules/sdk-coin-hbar/
8381
COPY --from=builder /tmp/bitgo/modules/sdk-coin-icp /var/modules/sdk-coin-icp/
8482
COPY --from=builder /tmp/bitgo/modules/sdk-coin-injective /var/modules/sdk-coin-injective/
8583
COPY --from=builder /tmp/bitgo/modules/sdk-coin-islm /var/modules/sdk-coin-islm/
84+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-mon /var/modules/sdk-coin-mon/
8685
COPY --from=builder /tmp/bitgo/modules/sdk-coin-mantra /var/modules/sdk-coin-mantra/
8786
COPY --from=builder /tmp/bitgo/modules/sdk-coin-near /var/modules/sdk-coin-near/
8887
COPY --from=builder /tmp/bitgo/modules/sdk-coin-oas /var/modules/sdk-coin-oas/
@@ -127,7 +126,6 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-zec /var/modules/sdk-coin-zec/
127126

128127
RUN cd /var/modules/abstract-lightning && yarn link && \
129128
cd /var/modules/sdk-core && yarn link && \
130-
cd /var/modules/bls-dkg && yarn link && \
131129
cd /var/modules/sdk-lib-mpc && yarn link && \
132130
cd /var/modules/sdk-opensslbytes && yarn link && \
133131
cd /var/modules/secp256k1 && yarn link && \
@@ -163,14 +161,14 @@ cd /var/modules/sdk-coin-coreum && yarn link && \
163161
cd /var/modules/sdk-coin-cspr && yarn link && \
164162
cd /var/modules/sdk-coin-dot && yarn link && \
165163
cd /var/modules/sdk-coin-etc && yarn link && \
166-
cd /var/modules/sdk-coin-eth2 && yarn link && \
167164
cd /var/modules/sdk-coin-flr && yarn link && \
168165
cd /var/modules/sdk-coin-hash && yarn link && \
169166
cd /var/modules/sdk-coin-hbar && yarn link && \
170167
cd /var/modules/sdk-coin-icp && yarn link && \
171168
cd /var/modules/sdk-coin-injective && yarn link && \
172169
cd /var/modules/sdk-coin-islm && yarn link && \
173170
cd /var/modules/sdk-coin-mantra && yarn link && \
171+
cd /var/modules/sdk-coin-mon && yarn link && \
174172
cd /var/modules/sdk-coin-near && yarn link && \
175173
cd /var/modules/sdk-coin-oas && yarn link && \
176174
cd /var/modules/sdk-coin-opeth && yarn link && \
@@ -217,7 +215,6 @@ cd /var/modules/sdk-coin-zec && yarn link
217215
RUN cd /var/bitgo-express && \
218216
yarn link @bitgo/abstract-lightning && \
219217
yarn link @bitgo/sdk-core && \
220-
yarn link @bitgo/bls-dkg && \
221218
yarn link @bitgo/sdk-lib-mpc && \
222219
yarn link @bitgo/sdk-opensslbytes && \
223220
yarn link @bitgo/secp256k1 && \
@@ -253,14 +250,14 @@ RUN cd /var/bitgo-express && \
253250
yarn link @bitgo/sdk-coin-cspr && \
254251
yarn link @bitgo/sdk-coin-dot && \
255252
yarn link @bitgo/sdk-coin-etc && \
256-
yarn link @bitgo/sdk-coin-eth2 && \
257253
yarn link @bitgo/sdk-coin-flr && \
258254
yarn link @bitgo/sdk-coin-hash && \
259255
yarn link @bitgo/sdk-coin-hbar && \
260256
yarn link @bitgo/sdk-coin-icp && \
261257
yarn link @bitgo/sdk-coin-injective && \
262258
yarn link @bitgo/sdk-coin-islm && \
263259
yarn link @bitgo/sdk-coin-mantra && \
260+
yarn link @bitgo/sdk-coin-mon && \
264261
yarn link @bitgo/sdk-coin-near && \
265262
yarn link @bitgo/sdk-coin-oas && \
266263
yarn link @bitgo/sdk-coin-opeth && \

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The BitGo SDK repository is a monorepo composed of separate modules, each of whi
1818
| @bitgo/blake2b | `blake2b` | Blake2b (64-bit version) in pure JavaScript. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/blake2b) |
1919
| @bitgo/blake2b-wasm | `blake2b-wasm` | Blake2b implemented in WASM. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/blake2b-wasm) |
2020
| @bitgo/blockapis | `blockapis` | Access public block explorer APIs for a variety of coins. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/blockapis) |
21-
| @bitgo/bls-dkg | `bls-dkg` | A simple implementation of BLS (Boneh-Lynn-Shacham signature scheme) + DKG (Distributed Key Generation) | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/bls-dkg) |
2221
| @bitgo/express | `express` | Local BitGo transaction signing server and proxy. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/express) |
2322
| @bitgo/statics | `statics` | Static configuration values used across the BitGo platform. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/statics) |
2423
| @bitgo/unspents | `unspents` | Defines the chain codes used for different unspent types and methods to calculate bitcoin transaction sizes. | [Link](https://github.com/BitGo/BitGoJS/tree/master/modules/unspents) |

examples/ts/nft/get-wallet-nfts.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Get the NFT balance of a wallet at BitGo.
3+
* This makes use of the convenience function wallets().get()
4+
*
5+
* Copyright 2025, BitGo, Inc. All Rights Reserved.
6+
*/
7+
import { BitGoAPI } from '@bitgo/sdk-api';
8+
import { Tapt } from "@bitgo/sdk-coin-apt";
9+
require('dotenv').config({ path: '../../../.env' });
10+
11+
const bitgo = new BitGoAPI({
12+
accessToken: '',
13+
env: 'test',
14+
});
15+
16+
const coin = 'tapt';
17+
bitgo.register(coin, Tapt.createInstance);
18+
19+
const walletId = '';
20+
21+
async function main() {
22+
const wallet = await bitgo.coin(coin).wallets().get({ id: walletId, allTokens: true });
23+
24+
console.log('\nWallet ID:', wallet.id());
25+
console.log('\nSupported NFTs:', );
26+
console.log(wallet.nftBalances());
27+
console.log('\nUnsupported NFTs:', );
28+
console.log(wallet.unsupportedNftBalances());
29+
}
30+
31+
main().catch((e) => console.error(e));

examples/ts/nft/send-wallet-nfts.ts

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Send an NFT of a wallet at BitGo.
3+
*
4+
* Copyright 2025, BitGo, Inc. All Rights Reserved.
5+
*/
6+
import { BitGoAPI } from '@bitgo/sdk-api';
7+
import { Tapt } from "@bitgo/sdk-coin-apt";
8+
import { TokenType } from "@bitgo/sdk-core";
9+
10+
require('dotenv').config({ path: '../../../.env' });
11+
12+
const bitgo = new BitGoAPI({
13+
accessToken: '',
14+
env: 'test',
15+
});
16+
17+
const coin = 'tapt';
18+
bitgo.register(coin, Tapt.createInstance);
19+
20+
const walletId = '';
21+
22+
async function main() {
23+
bitgo.unlock({ otp: '000000' });
24+
const wallet = await bitgo.coin(coin).wallets().get({id: walletId, allTokens: true});
25+
26+
console.log('\nWallet ID:', wallet.id());
27+
console.log('\nSupported NFTs:', );
28+
console.log(wallet.nftBalances());
29+
30+
const resp = await wallet.sendNft({
31+
walletPassphrase: '',
32+
type: 'transfer',
33+
}, {
34+
type: TokenType.DIGITAL_ASSET,
35+
tokenId: '',
36+
tokenContractAddress: '',
37+
recipientAddress: '',
38+
});
39+
console.log('\nSend NFT Response:', resp);
40+
}
41+
42+
main().catch((e) => console.error(e));

modules/abstract-eth/src/abstractEthLikeNewCoins.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,9 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
27282728

27292729
return transferBuilder.build();
27302730
}
2731+
2732+
default:
2733+
throw new Error(`Unsupported NFT type: ${params.type}`);
27312734
}
27322735
}
27332736

modules/account-lib/src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ export { Xtz };
3535
import * as Eth from '@bitgo/sdk-coin-eth';
3636
export { Eth };
3737

38-
import * as Eth2 from '@bitgo/sdk-coin-eth2';
39-
export { Eth2 };
40-
4138
import * as Etc from '@bitgo/sdk-coin-etc';
4239
export { Etc };
4340

@@ -107,6 +104,9 @@ export { Rune };
107104
import * as Baby from '@bitgo/sdk-coin-baby';
108105
export { Baby };
109106

107+
import * as Mon from '@bitgo/sdk-coin-mon';
108+
export { Mon };
109+
110110
import * as Mantra from '@bitgo/sdk-coin-mantra';
111111
export { Mantra };
112112

@@ -259,6 +259,8 @@ const coinBuilderMap = {
259259
twemix: Wemix.TransactionBuilder,
260260
mantra: Mantra.TransactionBuilder,
261261
tmantra: Mantra.TransactionBuilder,
262+
mon: Mon.TransactionBuilder,
263+
tmon: Mon.TransactionBuilder,
262264
};
263265

264266
/**

modules/account-lib/test/unit/keyPair/index.ts

-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { register } from '../../../src/keyPair';
66
import * as coinModules from '../../../src';
77
import { coins } from '@bitgo/statics';
88
import { KeyPair as EthKeyPair } from '@bitgo/sdk-coin-eth';
9-
import { KeyPair as Eth2KeyPair } from '@bitgo/sdk-coin-eth2';
109
import { Ed25519KeyPair } from '@bitgo/sdk-core';
1110

1211
describe('Key Pair Factory', () => {
@@ -51,17 +50,6 @@ describe('Key Pair Factory', () => {
5150
});
5251
});
5352

54-
// TODO(BG-40990): temporarily disable eth2 from the test for bls not initialized error
55-
describe('blsKey generation', function () {
56-
xit('should initialize eth2 keyPair map', () => {
57-
const eth = coins.get('eth2');
58-
const keyPair = register(eth.name) as Eth2KeyPair;
59-
(typeof keyPair.getKeys).should.equal('function');
60-
(typeof keyPair.getAddress).should.equal('function');
61-
(typeof keyPair.sign).should.equal('function');
62-
});
63-
});
64-
6553
describe('ed25519 generation', function () {
6654
const fixedKeyPair = {
6755
prv: 'e349d47cd4af4644afbc05b8463c0d0d19a0cc742be5c1646af2e7be8aafbd50',

modules/account-lib/tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
{
5050
"path": "../sdk-coin-eth"
5151
},
52-
{
53-
"path": "../sdk-coin-eth2"
54-
},
5552
{
5653
"path": "../sdk-coin-flr"
5754
},
@@ -73,6 +70,9 @@
7370
{
7471
"path": "../sdk-coin-islm"
7572
},
73+
{
74+
"path": "../sdk-coin-mon"
75+
},
7676
{
7777
"path": "../sdk-coin-near"
7878
},

modules/bitgo/src/v2/coinFactory.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import {
4444
Erc20Token,
4545
Etc,
4646
Eth,
47-
Eth2,
4847
Ethw,
4948
EthLikeCoin,
5049
Flr,
@@ -63,6 +62,7 @@ import {
6362
Islm,
6463
Lnbtc,
6564
Ltc,
65+
Mon,
6666
Mantra,
6767
Ofc,
6868
Oas,
@@ -113,8 +113,8 @@ import {
113113
Teos,
114114
Tetc,
115115
Teth,
116-
Teth2,
117116
Tflr,
117+
Tmon,
118118
TfiatAED,
119119
TfiatEur,
120120
TfiatGBP,
@@ -194,7 +194,6 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void {
194194
globalCoinFactory.register('eos', Eos.createInstance);
195195
globalCoinFactory.register('etc', Etc.createInstance);
196196
globalCoinFactory.register('eth', Eth.createInstance);
197-
globalCoinFactory.register('eth2', Eth2.createInstance);
198197
globalCoinFactory.register('ethw', Ethw.createInstance);
199198
globalCoinFactory.register('baseeth', EthLikeCoin.createInstance);
200199
globalCoinFactory.register('tbaseeth', TethLikeCoin.createInstance);
@@ -210,6 +209,7 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void {
210209
globalCoinFactory.register('hteth', Hteth.createInstance);
211210
globalCoinFactory.register('lnbtc', Lnbtc.createInstance);
212211
globalCoinFactory.register('ltc', Ltc.createInstance);
212+
globalCoinFactory.register('mon', Mon.createInstance);
213213
globalCoinFactory.register('mantra', Mantra.createInstance);
214214
globalCoinFactory.register('icp', Icp.createInstance);
215215
globalCoinFactory.register('injective', Injective.createInstance);
@@ -260,13 +260,13 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void {
260260
globalCoinFactory.register('teos', Teos.createInstance);
261261
globalCoinFactory.register('tetc', Tetc.createInstance);
262262
globalCoinFactory.register('teth', Teth.createInstance);
263-
globalCoinFactory.register('teth2', Teth2.createInstance);
264263
globalCoinFactory.register('tfiataed', TfiatAED.createInstance);
265264
globalCoinFactory.register('tfiateur', TfiatEur.createInstance);
266265
globalCoinFactory.register('tfiatgbp', TfiatGBP.createInstance);
267266
globalCoinFactory.register('tfiatsgd', TfiatSGD.createInstance);
268267
globalCoinFactory.register('tfiatusd', TfiatUsd.createInstance);
269268
globalCoinFactory.register('tflr', Tflr.createInstance);
269+
globalCoinFactory.register('tmon', Tmon.createInstance);
270270
globalCoinFactory.register('thash', Thash.createInstance);
271271
globalCoinFactory.register('thbar', Thbar.createInstance);
272272
globalCoinFactory.register('ticp', Ticp.createInstance);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { Dot, Tdot } from '@bitgo/sdk-coin-dot';
2626
import { Eos, EosToken, Teos } from '@bitgo/sdk-coin-eos';
2727
import { Etc, Tetc } from '@bitgo/sdk-coin-etc';
2828
import { Erc20Token, Eth, Gteth, Hteth, Teth } from '@bitgo/sdk-coin-eth';
29-
import { Eth2, Teth2 } from '@bitgo/sdk-coin-eth2';
3029
import { Flr, Tflr } from '@bitgo/sdk-coin-flr';
3130
import { Ethw } from '@bitgo/sdk-coin-ethw';
3231
import { EthLikeCoin, TethLikeCoin } from '@bitgo/sdk-coin-ethlike';
@@ -37,6 +36,7 @@ import { Injective, Tinjective } from '@bitgo/sdk-coin-injective';
3736
import { Islm, Tislm } from '@bitgo/sdk-coin-islm';
3837
import { Lnbtc, Tlnbtc } from '@bitgo/sdk-coin-lnbtc';
3938
import { Ltc, Tltc } from '@bitgo/sdk-coin-ltc';
39+
import { Mon, Tmon } from '@bitgo/sdk-coin-mon';
4040
import { Mantra, Tmantra } from '@bitgo/sdk-coin-mantra';
4141
import { Oas, Toas } from '@bitgo/sdk-coin-oas';
4242
import { Opeth, Topeth, OpethToken } from '@bitgo/sdk-coin-opeth';
@@ -89,7 +89,6 @@ export { Dot, Tdot };
8989
export { Bcha, Tbcha };
9090
export { Eos, EosToken, Teos };
9191
export { Erc20Token, Eth, Gteth, Hteth, Teth };
92-
export { Eth2, Teth2 };
9392
export { Ethw };
9493
export { EthLikeCoin, TethLikeCoin };
9594
export { Etc, Tetc };
@@ -100,6 +99,7 @@ export { Icp, Ticp };
10099
export { Lnbtc, Tlnbtc };
101100
export { Ltc, Tltc };
102101
export { Mantra, Tmantra };
102+
export { Mon, Tmon };
103103
export { Oas, Toas };
104104
export { Opeth, Topeth, OpethToken };
105105
export { Osmo, Tosmo };

0 commit comments

Comments
 (0)