Skip to content

Commit 3a2a0d4

Browse files
committed
feat: rename MBE API paths to /api/v1/{coin}/advancedwallet/*
BREAKING CHANGE: All Master Express API endpoints have been renamed from /api/{coin}/wallet/* to /api/v1/{coin}/advancedwallet/* to differentiate from BitGoJS Express APIs and add versioning support. Ticket: WP-7175
1 parent cf5300a commit 3a2a0d4

22 files changed

+145
-136
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.",

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

Lines changed: 16 additions & 16 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,7 +305,7 @@ 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({
308+
const response = await agent.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`).send({
309309
pubkey: mockUserKeychain.pub,
310310
source: 'user',
311311
cpfpTxIds: ['test-tx-id'],
@@ -332,7 +332,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
332332
.rejects(new Error('Insufficient funds for acceleration'));
333333

334334
const response = await agent
335-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
335+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
336336
.set('Authorization', `Bearer ${accessToken}`)
337337
.send({
338338
pubkey: mockUserKeychain.pub,
@@ -353,7 +353,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
353353

354354
it('should fail when cpfpTxIds parameter is not an array', async () => {
355355
const response = await agent
356-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
356+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
357357
.set('Authorization', `Bearer ${accessToken}`)
358358
.send({
359359
pubkey: mockUserKeychain.pub,
@@ -367,7 +367,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
367367

368368
it('should fail when rbfTxIds parameter is not an array', async () => {
369369
const response = await agent
370-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
370+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
371371
.set('Authorization', `Bearer ${accessToken}`)
372372
.send({
373373
pubkey: mockUserKeychain.pub,
@@ -381,7 +381,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
381381

382382
it('should fail when pubkey parameter is not a string', async () => {
383383
const response = await agent
384-
.post(`/api/${coin}/wallet/${walletId}/accelerate`)
384+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/accelerate`)
385385
.set('Authorization', `Bearer ${accessToken}`)
386386
.send({
387387
pubkey: 12345,
@@ -395,7 +395,7 @@ describe('POST /api/:coin/wallet/:walletId/accelerate', () => {
395395

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

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Hteth } from '@bitgo-beta/sdk-coin-eth';
99
import * as transactionRequests from '../../../masterBitgoExpress/handlers/transactionRequests';
1010
import * as handlerUtils from '../../../masterBitgoExpress/handlers/utils/utils';
1111

12-
describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
12+
describe('POST /api/v1/:coin/advancedwallet/:walletId/consolidate', () => {
1313
let agent: request.SuperAgentTest;
1414
const coin = 'hteth';
1515
const walletId = 'test-wallet-id';
@@ -118,7 +118,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
118118
};
119119

120120
const response = await agent
121-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
121+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
122122
.set('Authorization', `Bearer ${accessToken}`)
123123
.send(requestPayload);
124124

@@ -204,7 +204,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
204204
};
205205

206206
const response = await agent
207-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
207+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
208208
.set('Authorization', `Bearer ${accessToken}`)
209209
.send(requestPayload);
210210

@@ -267,7 +267,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
267267
};
268268

269269
const response = await agent
270-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
270+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
271271
.set('Authorization', `Bearer ${accessToken}`)
272272
.send(requestPayload);
273273

@@ -290,7 +290,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
290290
.reply(404, { error: 'Wallet not found', name: 'WalletNotFoundError' });
291291

292292
const response = await agent
293-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
293+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
294294
.set('Authorization', `Bearer ${accessToken}`)
295295
.send({
296296
pubkey: mockUserKeychain.pub,
@@ -315,7 +315,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
315315
.reply(404, { error: 'Keychain not found', name: 'KeychainNotFoundError' });
316316

317317
const response = await agent
318-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
318+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
319319
.set('Authorization', `Bearer ${accessToken}`)
320320
.send({
321321
pubkey: mockUserKeychain.pub,
@@ -340,7 +340,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
340340
.reply(200, mockUserKeychain);
341341

342342
const response = await agent
343-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
343+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
344344
.set('Authorization', `Bearer ${accessToken}`)
345345
.send({
346346
pubkey: 'xpub661MyMwAqRbcWRONG_PUBKEY_THAT_DOES_NOT_MATCH',
@@ -370,7 +370,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
370370
.returns(false);
371371

372372
const response = await agent
373-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
373+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
374374
.set('Authorization', `Bearer ${accessToken}`)
375375
.send({
376376
pubkey: mockUserKeychain.pub,
@@ -392,7 +392,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
392392

393393
it('should fail when required pubkey parameter is missing', async () => {
394394
const response = await agent
395-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
395+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
396396
.set('Authorization', `Bearer ${accessToken}`)
397397
.send({
398398
source: 'user',
@@ -406,7 +406,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
406406

407407
it('should fail when required source parameter is missing', async () => {
408408
const response = await agent
409-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
409+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
410410
.set('Authorization', `Bearer ${accessToken}`)
411411
.send({
412412
pubkey: mockUserKeychain.pub,
@@ -420,7 +420,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
420420

421421
it('should fail when source parameter has invalid value', async () => {
422422
const response = await agent
423-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
423+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
424424
.set('Authorization', `Bearer ${accessToken}`)
425425
.send({
426426
pubkey: mockUserKeychain.pub,
@@ -434,7 +434,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
434434
});
435435

436436
it('should fail when authorization header is missing', async () => {
437-
const response = await agent.post(`/api/${coin}/wallet/${walletId}/consolidate`).send({
437+
const response = await agent.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`).send({
438438
pubkey: mockUserKeychain.pub,
439439
source: 'user',
440440
consolidateAddresses: ['0x1234567890abcdef'],
@@ -481,7 +481,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
481481
.returns(true);
482482

483483
const response = await agent
484-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
484+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
485485
.set('Authorization', `Bearer ${accessToken}`)
486486
.send({
487487
pubkey: mockUserKeychain.pub,
@@ -536,7 +536,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
536536
.returns(true);
537537

538538
const response = await agent
539-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
539+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
540540
.set('Authorization', `Bearer ${accessToken}`)
541541
.send({
542542
pubkey: mockUserKeychain.pub,
@@ -558,7 +558,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
558558

559559
it('should fail when consolidateAddresses parameter is not an array', async () => {
560560
const response = await agent
561-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
561+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
562562
.set('Authorization', `Bearer ${accessToken}`)
563563
.send({
564564
pubkey: mockUserKeychain.pub,
@@ -573,7 +573,7 @@ describe('POST /api/:coin/wallet/:walletId/consolidate', () => {
573573

574574
it('should fail when apiVersion parameter has invalid value', async () => {
575575
const response = await agent
576-
.post(`/api/${coin}/wallet/${walletId}/consolidate`)
576+
.post(`/api/v1/${coin}/advancedwallet/${walletId}/consolidate`)
577577
.set('Authorization', `Bearer ${accessToken}`)
578578
.send({
579579
pubkey: mockUserKeychain.pub,

0 commit comments

Comments
 (0)