Skip to content

Commit f7fcd32

Browse files
authored
Merge pull request #165 from BitGo/WP-7175-update-unique-api-paths
feat: rename MBE API paths to /api/v1/{coin}/advancedwallet/*
2 parents cf5300a + fc80522 commit f7fcd32

24 files changed

+174
-155
lines changed

CLAUDE.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ API responses follow a standard error format with `error` and `details` fields.
139139

140140
#### Wallet Management
141141

142-
- `POST /api/:coin/wallet/generate` - Generate wallet (supports onchain and TSS multisig types)
142+
- `POST /api/v1/:coin/advancedwallet/generate` - Generate wallet (supports onchain and TSS multisig types)
143143

144144
#### Transaction Operations
145145

146-
- `POST /api/:coin/wallet/:walletId/sendMany` - Send transaction with multiple recipients
147-
- `POST /api/:coin/wallet/:walletId/accelerate` - Accelerate pending transactions (CPFP/RBF)
148-
- `POST /api/:coin/wallet/:walletId/consolidate` - Consolidate wallet addresses
149-
- `POST /api/:coin/wallet/:walletId/consolidateunspents` - Consolidate unspent transaction outputs
146+
- `POST /api/v1/:coin/advancedwallet/:walletId/sendMany` - Send transaction with multiple recipients
147+
- `POST /api/v1/:coin/advancedwallet/:walletId/accelerate` - Accelerate pending transactions (CPFP/RBF)
148+
- `POST /api/v1/:coin/advancedwallet/:walletId/consolidate` - Consolidate wallet addresses
149+
- `POST /api/v1/:coin/advancedwallet/:walletId/consolidateunspents` - Consolidate unspent transaction outputs
150+
- `POST /api/v1/:coin/advancedwallet/:walletId/txrequest/:txRequestId/signAndSend` - Sign a TxRequest and broadcast it (MPC wallets only)
150151

151152
#### Recovery
152153

153-
- `POST /api/:coin/wallet/recovery` - Recover wallet funds
154+
- `POST /api/v1/:coin/advancedwallet/recovery` - Recover wallet funds
155+
- `POST /api/v1/:coin/advancedwallet/recoveryconsolidations` - Consolidate and recover funds from multiple addresses

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,14 @@ docker-compose down
385385
- `POST /ping` - Health check.
386386
- `GET /version` - Version information.
387387
- `POST /ping/advancedWalletManager` - Test connection to Advanced Wallet Manager.
388-
- `POST /api/:coin/wallet/generate` - Generate wallet (with Advanced Wallet Manager integration).
388+
- `POST /api/v1/:coin/advancedwallet/generate` - Generate wallet (with Advanced Wallet Manager integration).
389+
- `POST /api/v1/:coin/advancedwallet/:walletId/sendMany` - Send transaction with multiple recipients.
390+
- `POST /api/v1/:coin/advancedwallet/:walletId/accelerate` - Accelerate pending transactions (CPFP/RBF).
391+
- `POST /api/v1/:coin/advancedwallet/:walletId/consolidate` - Consolidate wallet addresses.
392+
- `POST /api/v1/:coin/advancedwallet/:walletId/consolidateunspents` - Consolidate unspent transaction outputs.
393+
- `POST /api/v1/:coin/advancedwallet/:walletId/txrequest/:txRequestId/signAndSend` - Sign a TxRequest and broadcast it (MPC wallets only).
394+
- `POST /api/v1/:coin/advancedwallet/recovery` - Recover wallet funds.
395+
- `POST /api/v1/:coin/advancedwallet/recoveryconsolidations` - Consolidate and recover funds from multiple addresses.
389396

390397
### API Documentation
391398

masterBitgoExpress.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"description": "Advanced Wallets - On-Premises Key Management with BitGo Express"
77
},
88
"paths": {
9-
"/api/{coin}/wallet/{walletId}/accelerate": {
9+
"/api/v1/{coin}/advancedwallet/{walletId}/accelerate": {
1010
"post": {
1111
"summary": "Accelerate unconfirmed transactions on UTXO-based blockchains.",
1212
"description": "Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.",
@@ -188,7 +188,7 @@
188188
}
189189
}
190190
},
191-
"/api/{coin}/wallet/{walletId}/consolidate": {
191+
"/api/v1/{coin}/advancedwallet/{walletId}/consolidate": {
192192
"post": {
193193
"summary": "Build, sign, and send a consolidation transaction for an account-based asset all in 1 call.",
194194
"description": "For account-based assets, consolidating the balances in the receive addresses to the base address maximizes the spendable balance of a wallet.",
@@ -327,7 +327,7 @@
327327
}
328328
}
329329
},
330-
"/api/{coin}/wallet/{walletId}/consolidateunspents": {
330+
"/api/v1/{coin}/advancedwallet/{walletId}/consolidateunspents": {
331331
"post": {
332332
"summary": "Build and send a transaction to consolidate unspents in a wallet.",
333333
"description": "Consolidating unspents is only for UTXO-based assets.",
@@ -528,7 +528,7 @@
528528
}
529529
}
530530
},
531-
"/api/{coin}/wallet/{walletId}/sendMany": {
531+
"/api/v1/{coin}/advancedwallet/{walletId}/sendMany": {
532532
"post": {
533533
"parameters": [
534534
{
@@ -821,7 +821,7 @@
821821
}
822822
}
823823
},
824-
"/api/{coin}/wallet/{walletId}/txrequest/{txRequestId}/signAndSend": {
824+
"/api/v1/{coin}/advancedwallet/{walletId}/txrequest/{txRequestId}/signAndSend": {
825825
"post": {
826826
"summary": "Sign a TxRequest and Broadcast it (MPC wallets only)",
827827
"description": "This is usually needed after resolving a pending approval for a MPC wallet",
@@ -950,7 +950,7 @@
950950
}
951951
}
952952
},
953-
"/api/{coin}/wallet/generate": {
953+
"/api/v1/{coin}/advancedwallet/generate": {
954954
"post": {
955955
"summary": "Generates a new advanced wallet.",
956956
"description": "The wallet creation process involves several steps that happen automatically:\n1. User Keychain Creation: Creates the user keychain in the advanced wallet manager and encrypts it with the respective KMS.\n2. Backup Keychain Creation: Creates the backup keychain in the advanced wallet manager and encrypts it with the respective KMS.\n3. Keychain Upload: Uploads the user/backup public keys to BitGo.\n4. BitGo Key Creation: Creates the BitGo key on the BitGo service.\n5. Wallet Creation: Creates the wallet on BitGo with the 3 keys.",
@@ -1115,7 +1115,7 @@
11151115
}
11161116
}
11171117
},
1118-
"/api/{coin}/wallet/recovery": {
1118+
"/api/v1/{coin}/advancedwallet/recovery": {
11191119
"post": {
11201120
"summary": "Recover funds from an existing wallet using user and backup keys.",
11211121
"description": "This endpoint allows for both standard multisig and TSS wallet recovery.",
@@ -1470,7 +1470,7 @@
14701470
}
14711471
}
14721472
},
1473-
"/api/{coin}/wallet/recoveryconsolidations": {
1473+
"/api/v1/{coin}/advancedwallet/recoveryconsolidations": {
14741474
"post": {
14751475
"summary": "Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.",
14761476
"description": "Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.",

package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"store2": "^2.14.4",
138138
"tar": "^6.2.1",
139139
"tough-cookie": "^4.1.3",
140-
"validator": "^13.15.15",
140+
"validator": "^13.15.22",
141+
"node-forge": "^1.3.2",
141142
"xml2js": "^0.5.0",
142143
"glob": "^11.1.0"
143144
},

src/__tests__/api/master/accelerate.test.ts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { app as expressApp } from '../../../masterBitGoExpressApp';
66
import { AppMode, MasterExpressConfig, TlsMode } from '../../../shared/types';
77
import { Environments, Wallet } from '@bitgo-beta/sdk-core';
88

9-
describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
9+
describe('POST /api/v1/:coin/advancedwallet/:walletId/accelerate', () => {
1010
let agent: request.SuperAgentTest;
1111
const coin = 'tbtc';
1212
const walletId = 'test-wallet-id';
@@ -91,7 +91,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
9191
};
9292

9393
const response = await agent
94-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
94+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
9595
.set('Authorization', `Bearer ${accessToken}`)
9696
.send(requestPayload);
9797

@@ -138,7 +138,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
138138
};
139139

140140
const response = await agent
141-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
141+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
142142
.set('Authorization', `Bearer ${accessToken}`)
143143
.send(requestPayload);
144144

@@ -180,7 +180,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
180180
};
181181

182182
const response = await agent
183-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
183+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
184184
.set('Authorization', `Bearer ${accessToken}`)
185185
.send(requestPayload);
186186

@@ -200,7 +200,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
200200
.reply(404, { error: 'Wallet not found', name: 'WalletNotFoundError' });
201201

202202
const response = await agent
203-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
203+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
204204
.set('Authorization', `Bearer ${accessToken}`)
205205
.send({
206206
pubkey: mockUserKeychain.pub,
@@ -225,7 +225,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
225225
.reply(404, { error: 'Keychain not found', name: 'KeychainNotFoundError' });
226226

227227
const response = await agent
228-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
228+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
229229
.set('Authorization', `Bearer ${accessToken}`)
230230
.send({
231231
pubkey: mockUserKeychain.pub,
@@ -250,7 +250,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
250250
.reply(200, mockUserKeychain);
251251

252252
const response = await agent
253-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
253+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
254254
.set('Authorization', `Bearer ${accessToken}`)
255255
.send({
256256
pubkey: 'xpub661MyMwAqRbcWRONG_PUBKEY_THAT_DOES_NOT_MATCH',
@@ -266,7 +266,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
266266

267267
it('should fail when required pubkey parameter is missing', async () => {
268268
const response = await agent
269-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
269+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
270270
.set('Authorization', `Bearer ${accessToken}`)
271271
.send({
272272
source: 'user',
@@ -279,7 +279,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
279279

280280
it('should fail when required source parameter is missing', async () => {
281281
const response = await agent
282-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
282+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
283283
.set('Authorization', `Bearer ${accessToken}`)
284284
.send({
285285
pubkey: mockUserKeychain.pub,
@@ -292,7 +292,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
292292

293293
it('should fail when source parameter has invalid value', async () => {
294294
const response = await agent
295-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
295+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
296296
.set('Authorization', `Bearer ${accessToken}`)
297297
.send({
298298
pubkey: mockUserKeychain.pub,
@@ -305,11 +305,13 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
305305
});
306306

307307
it('should fail when authorization header is missing', async () => {
308-
const response = await agent.post(`/api/${coin}/wallet/${walletId}/accelerate`).send({
309-
pubkey: mockUserKeychain.pub,
310-
source: 'user',
311-
cpfpTxIds: ['test-tx-id'],
312-
});
308+
const response = await agent
309+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
310+
.send({
311+
pubkey: mockUserKeychain.pub,
312+
source: 'user',
313+
cpfpTxIds: ['test-tx-id'],
314+
});
313315

314316
response.status.should.equal(500);
315317
response.body.should.have.property('error', 'Internal Server Error');
@@ -332,7 +334,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
332334
.rejects(new Error('Insufficient funds for acceleration'));
333335

334336
const response = await agent
335-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
337+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
336338
.set('Authorization', `Bearer ${accessToken}`)
337339
.send({
338340
pubkey: mockUserKeychain.pub,
@@ -353,7 +355,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
353355

354356
it('should fail when cpfpTxIds parameter is not an array', async () => {
355357
const response = await agent
356-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
358+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
357359
.set('Authorization', `Bearer ${accessToken}`)
358360
.send({
359361
pubkey: mockUserKeychain.pub,
@@ -367,7 +369,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
367369

368370
it('should fail when rbfTxIds parameter is not an array', async () => {
369371
const response = await agent
370-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
372+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
371373
.set('Authorization', `Bearer ${accessToken}`)
372374
.send({
373375
pubkey: mockUserKeychain.pub,
@@ -381,7 +383,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
381383

382384
it('should fail when pubkey parameter is not a string', async () => {
383385
const response = await agent
384-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
386+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
385387
.set('Authorization', `Bearer ${accessToken}`)
386388
.send({
387389
pubkey: 12345,
@@ -395,7 +397,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
395397

396398
it('should fail when both cpfpTxIds and rbfTxIds are missing', async () => {
397399
const response = await agent
398-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
400+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
399401
.set('Authorization', `Bearer ${accessToken}`)
400402
.send({
401403
pubkey: mockUserKeychain.pub,

0 commit comments

Comments
 (0)