Skip to content

Commit 30158d2

Browse files
committed
TICKET: WP-5445
2 parents 515807f + 2828138 commit 30158d2

File tree

358 files changed

+22028
-2806
lines changed

Some content is hidden

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

358 files changed

+22028
-2806
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,52 @@ jobs:
288288
context: .
289289
file: ./Dockerfile
290290
push: false
291+
load: true
291292
tags: |
292293
bitgo/express:${{ github.sha }}
293294
build-args: |
294295
VERSION=${{ steps.build-info.outputs.version }}
295296
BUILD_DATE=${{ steps.build-info.outputs.date }}
296297
GIT_HASH=${{ github.sha }}
297298
299+
- name: Test Express Docker image
300+
id: docker-test
301+
run: |
302+
echo "Testing Docker image bitgo/express:${{ github.sha }}"
303+
304+
CONTAINER_ID=$(docker run -d -p 3080:3080 bitgo/express:${{ github.sha }})
305+
echo "Started container: $CONTAINER_ID"
306+
307+
# Wait for the service to be ready with timeout
308+
echo "Waiting for service to be ready..."
309+
310+
for i in {1..30}; do
311+
if curl -f -s --max-time 5 http://localhost:3080/api/v2/ping > /dev/null 2>&1; then
312+
echo "✅ API health check passed"
313+
break
314+
fi
315+
316+
if [ $i -eq 30 ]; then
317+
echo "::error::API health check failed after 30 attempts"
318+
docker logs "$CONTAINER_ID"
319+
docker stop "$CONTAINER_ID"
320+
docker rm "$CONTAINER_ID"
321+
exit 1
322+
fi
323+
324+
echo "Waiting for API... (attempt $i/30)"
325+
sleep 2
326+
done
327+
328+
# Check container logs for errors
329+
docker logs "$CONTAINER_ID"
330+
331+
# Stop the container
332+
docker stop "$CONTAINER_ID"
333+
docker rm "$CONTAINER_ID"
334+
335+
echo "✅ Docker image tests passed"
336+
298337
dockerfile-check:
299338
runs-on: ubuntu-latest
300339

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
/modules/sdk-coin-baby/ @BitGo/ethalt-team
6161
/modules/sdk-coin-bera/ @BitGo/ethalt-team
6262
/modules/sdk-coin-bsc/ @BitGo/ethalt-team
63+
/module/sdk-coin-canton/ @BitGo/ethalt-team
6364
/modules/sdk-coin-coredao/ @BitGo/ethalt-team
6465
/modules/sdk-coin-cosmos/ @BitGo/ethalt-team
6566
/modules/sdk-coin-cronos/ @BitGo/ethalt-team

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module.exports = {
6565
'COIN-',
6666
'FIAT-',
6767
'ME-',
68+
'ANT-',
6869
'#', // Prefix used by GitHub issues
6970
],
7071
},

examples/ts/create-go-account.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* Create a Go Account wallet at BitGo.
3+
* This makes use of the convenience function generateWallet with type: 'trading'
4+
*
5+
* IMPORTANT: You must backup the encrypted private key and encrypted wallet passphrase!
6+
*
7+
* Copyright 2025, BitGo, Inc. All Rights Reserved.
8+
*/
9+
10+
import { BitGoAPI } from '@bitgo/sdk-api';
11+
import { coins } from 'bitgo';
12+
require('dotenv').config({ path: '../../.env' });
13+
14+
const bitgo = new BitGoAPI({
15+
accessToken: process.env.TESTNET_ACCESS_TOKEN,
16+
env: 'test', // Change this to env: 'production' when you are ready for production
17+
});
18+
19+
// Go Accounts use the 'ofc' (Off-Chain) coin
20+
const coin = 'ofc';
21+
bitgo.register(coin, coins.Ofc.createInstance);
22+
23+
// TODO: set a label for your new Go Account here
24+
const label = 'Example Go Account Wallet';
25+
26+
// TODO: set your passphrase for your new wallet here (encrypts the private key)
27+
const passphrase = 'go_account_wallet_passphrase';
28+
29+
// TODO: set your passcode encryption code here (encrypts the passphrase itself)
30+
const passcodeEncryptionCode = 'encryption_code_for_passphrase';
31+
32+
// TODO: set your enterprise ID for your new wallet here
33+
const enterprise = 'your_enterprise_id';
34+
35+
async function main() {
36+
const response = await bitgo.coin(coin).wallets().generateWallet({
37+
label,
38+
passphrase,
39+
passcodeEncryptionCode,
40+
enterprise,
41+
type: 'trading', // Required for Go Accounts
42+
});
43+
44+
// Type guard to ensure we got a Go Account response
45+
if (!('userKeychain' in response)) {
46+
throw new Error('Go account missing required user keychain');
47+
}
48+
49+
const { wallet, userKeychain, encryptedWalletPassphrase } = response;
50+
51+
console.log(`Wallet ID: ${wallet.id()}`);
52+
53+
console.log('BACKUP THE FOLLOWING INFORMATION: ');
54+
console.log('User Keychain:');
55+
console.log(`Keychain ID: ${userKeychain.id}`);
56+
console.log(`Public Key: ${userKeychain.pub}`);
57+
console.log(`Encrypted Private Key: ${userKeychain.encryptedPrv}`);
58+
59+
console.log(`Encrypted Wallet Passphrase: ${encryptedWalletPassphrase}`);
60+
61+
// Create receive address for Go Account
62+
const receiveAddress = await wallet.createAddress();
63+
console.log('Go Account Receive Address:', receiveAddress.address);
64+
}
65+
66+
main().catch((e) => console.error('Error creating Go Account:', e));
67+

examples/ts/share-wallet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ bitgo.register(coin, Tbtc.createInstance);
2222
const walletId = '';
2323

2424
// TODO: set BitGo account email of wallet share recipient
25-
const recipient = null;
25+
const recipient = "recipient_email";
2626

2727
// TODO: set share permissions as a comma-separated list
2828
// Valid permissions to choose from are: view, spend, manage, admin
2929
const perms = 'view';
3030

3131
// TODO: provide the passphrase for the wallet being shared
32-
const passphrase = null;
32+
const passphrase = "passhrase";
3333

3434
async function main() {
3535
const wallet = await bitgo.coin(coin).wallets().get({ id: walletId });

modules/abstract-cosmos/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [11.15.7](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.6...@bitgo/abstract-cosmos@11.15.7) (2025-10-21)
7+
8+
**Note:** Version bump only for package @bitgo/abstract-cosmos
9+
10+
11+
12+
13+
14+
## [11.15.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.5...@bitgo/abstract-cosmos@11.15.6) (2025-10-16)
15+
16+
**Note:** Version bump only for package @bitgo/abstract-cosmos
17+
18+
19+
20+
21+
22+
## [11.15.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.4...@bitgo/abstract-cosmos@11.15.5) (2025-10-13)
23+
24+
**Note:** Version bump only for package @bitgo/abstract-cosmos
25+
26+
27+
28+
29+
630
## [11.15.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.3...@bitgo/abstract-cosmos@11.15.4) (2025-10-09)
731

832

modules/abstract-cosmos/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitgo/abstract-cosmos",
3-
"version": "11.15.4",
3+
"version": "11.15.7",
44
"description": "BitGo SDK coin library for COSMOS base implementation",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
@@ -38,10 +38,10 @@
3838
]
3939
},
4040
"dependencies": {
41-
"@bitgo/sdk-core": "^36.12.0",
41+
"@bitgo/sdk-core": "^36.15.0",
4242
"@bitgo/sdk-lib-mpc": "^10.8.1",
43-
"@bitgo/secp256k1": "^1.5.0",
44-
"@bitgo/statics": "^58.4.0",
43+
"@bitgo/secp256k1": "^1.6.0",
44+
"@bitgo/statics": "^58.7.0",
4545
"@cosmjs/amino": "^0.29.5",
4646
"@cosmjs/crypto": "^0.30.1",
4747
"@cosmjs/encoding": "^0.29.5",

modules/abstract-eth/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [24.13.7](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.13.6...@bitgo/abstract-eth@24.13.7) (2025-10-21)
7+
8+
**Note:** Version bump only for package @bitgo/abstract-eth
9+
10+
11+
12+
13+
14+
## [24.13.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.13.5...@bitgo/abstract-eth@24.13.6) (2025-10-16)
15+
16+
**Note:** Version bump only for package @bitgo/abstract-eth
17+
18+
19+
20+
21+
22+
## [24.13.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.13.4...@bitgo/abstract-eth@24.13.5) (2025-10-13)
23+
24+
**Note:** Version bump only for package @bitgo/abstract-eth
25+
26+
27+
28+
29+
630
## [24.13.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.13.3...@bitgo/abstract-eth@24.13.4) (2025-10-09)
731

832

modules/abstract-eth/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitgo/abstract-eth",
3-
"version": "24.13.4",
3+
"version": "24.13.7",
44
"description": "BitGo SDK coin library for ETH base implementation",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
@@ -40,10 +40,10 @@
4040
]
4141
},
4242
"dependencies": {
43-
"@bitgo/sdk-core": "^36.12.0",
43+
"@bitgo/sdk-core": "^36.15.0",
4444
"@bitgo/sdk-lib-mpc": "^10.8.1",
45-
"@bitgo/secp256k1": "^1.5.0",
46-
"@bitgo/statics": "^58.4.0",
45+
"@bitgo/secp256k1": "^1.6.0",
46+
"@bitgo/statics": "^58.7.0",
4747
"@ethereumjs/common": "^2.6.5",
4848
"@ethereumjs/rlp": "^4.0.0",
4949
"@ethereumjs/tx": "^3.3.0",
@@ -60,8 +60,8 @@
6060
"superagent": "^9.0.1"
6161
},
6262
"devDependencies": {
63-
"@bitgo/sdk-api": "^1.70.1",
64-
"@bitgo/sdk-test": "^9.1.4",
63+
"@bitgo/sdk-api": "^1.70.4",
64+
"@bitgo/sdk-test": "^9.1.7",
6565
"@types/keccak": "^3.0.5"
6666
},
6767
"gitHead": "18e460ddf02de2dbf13c2aa243478188fb539f0c",

modules/abstract-eth/src/abstractEthLikeNewCoins.ts

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import { AbstractEthLikeCoin } from './abstractEthLikeCoin';
6767
import { EthLikeToken } from './ethLikeToken';
6868
import {
6969
calculateForwarderV1Address,
70+
decodeTransferData,
7071
ERC1155TransferBuilder,
7172
ERC721TransferBuilder,
7273
getBufferedByteCode,
@@ -1570,6 +1571,30 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
15701571
};
15711572
}
15721573

1574+
/**
1575+
* Extract recipients from transaction hex
1576+
* @param txHex - The transaction hex string
1577+
* @returns Array of recipients with address and amount
1578+
*/
1579+
private async extractRecipientsFromTxHex(txHex: string): Promise<Array<{ address: string; amount: string }>> {
1580+
const txBuffer = optionalDeps.ethUtil.toBuffer(txHex);
1581+
const decodedTx = optionalDeps.EthTx.TransactionFactory.fromSerializedData(txBuffer);
1582+
const recipients: Array<{ address: string; amount: string }> = [];
1583+
1584+
if (decodedTx.data && decodedTx.data.length > 0) {
1585+
const dataHex = optionalDeps.ethUtil.bufferToHex(decodedTx.data);
1586+
const transferData = decodeTransferData(dataHex);
1587+
if (transferData.to) {
1588+
recipients.push({
1589+
address: transferData.to,
1590+
amount: transferData.amount,
1591+
});
1592+
}
1593+
}
1594+
1595+
return recipients;
1596+
}
1597+
15731598
async sendCrossChainRecoveryTransaction(
15741599
params: SendCrossChainRecoveryOptions
15751600
): Promise<{ coin: string; txHex?: string; txid: string }> {
@@ -1617,15 +1642,22 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
16171642
};
16181643
}
16191644

1620-
async buildCrossChainRecoveryTransaction(
1621-
recoveryId: string
1622-
): Promise<{ coin: string; txHex: string; txid: string; walletVersion?: number }> {
1645+
async buildCrossChainRecoveryTransaction(recoveryId: string): Promise<{
1646+
coin: string;
1647+
txHex: string;
1648+
txid: string;
1649+
walletVersion?: number;
1650+
recipients: Array<{ address: string; amount: string }>;
1651+
}> {
16231652
const res = await this.bitgo.get(this.bitgo.microservicesUrl(`/api/recovery/v1/crosschain/${recoveryId}/buildtx`));
1653+
// Extract recipients from the transaction hex
1654+
const recipients = await this.extractRecipientsFromTxHex(res.body.txHex);
16241655
return {
16251656
coin: res.body.coin,
16261657
txHex: res.body.txHex,
16271658
txid: res.body.txid,
16281659
walletVersion: res.body.walletVersion,
1660+
recipients,
16291661
};
16301662
}
16311663

0 commit comments

Comments
 (0)