Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions masterBitgoExpress.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"paths": {
"/api/{coin}/wallet/{walletId}/accelerate": {
"post": {
"summary": "Accelerate unconfirmed transactions on UTXO-based blockchains.",
"description": "Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.",
"parameters": [
{
"name": "walletId",
Expand Down Expand Up @@ -710,6 +712,16 @@
}
}
},
"400": {

Copilot AI Aug 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 400 Bad Request response is only added to the accelerate endpoint but not to the recovery endpoints. For consistency, all endpoints should have the same error response codes documented.

Copilot uses AI. Check for mistakes.
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
Expand All @@ -725,6 +737,8 @@
},
"/api/{coin}/wallet/recovery": {
"post": {
"summary": "Recover funds from an existing wallet using user and backup keys.",
"description": "This endpoint allows for both standard multisig and TSS wallet recovery.",
"parameters": [
{
"name": "coin",
Expand Down Expand Up @@ -1038,6 +1052,8 @@
},
"/api/{coin}/wallet/recoveryconsolidations": {
"post": {
"summary": "Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.",
"description": "Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.",
"parameters": [
{
"name": "coin",
Expand Down
92 changes: 55 additions & 37 deletions src/api/master/routers/masterBitGoExpressApiSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,58 @@ const SignMpcResponse: HttpResponse = {
...InternalServerErrorResponse,
};

/**
* Accelerate unconfirmed transactions on UTXO-based blockchains.
* Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.
*/
const AccelerateRoute = httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/{walletId}/accelerate',
request: httpRequest({
params: {
walletId: t.string,
coin: t.string,
},
body: AccelerateRequest,
}),
response: AccelerateResponse,
description: 'Accelerate transaction',
});

/**
* Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.
* Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.
*/
const RecoveryConsolidationsRoute = httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/recoveryconsolidations',
request: httpRequest({
params: {
coin: t.string,
},
body: RecoveryConsolidationsWalletRequest,
}),
response: RecoveryConsolidationsWalletResponse,
description: 'Consolidate and recover an existing wallet',
});

/**
* Recover funds from an existing wallet using user and backup keys.
* This endpoint allows for both standard multisig and TSS wallet recovery.
*/
const RecoveryRoute = httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/recovery',
request: httpRequest({
params: {
coin: t.string,
},
body: RecoveryWalletRequest,
}),
response: RecoveryWalletResponse,
description: 'Recover an existing wallet',
});

// API Specification
export const MasterBitGoExpressApiSpec = apiSpec({
'v1.wallet.generate': {
Expand Down Expand Up @@ -702,32 +754,10 @@ export const MasterBitGoExpressApiSpec = apiSpec({
}),
},
'v1.wallet.recovery': {
post: httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/recovery',
request: httpRequest({
params: {
coin: t.string,
},
body: RecoveryWalletRequest,
}),
response: RecoveryWalletResponse,
description: 'Recover an existing wallet',
}),
post: RecoveryRoute,
},
'v1.wallet.recoveryConsolidations': {
post: httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/recoveryconsolidations',
request: httpRequest({
params: {
coin: t.string,
},
body: RecoveryConsolidationsWalletRequest,
}),
response: RecoveryConsolidationsWalletResponse,
description: 'Consolidate and recover an existing wallet',
}),
post: RecoveryConsolidationsRoute,
},
'v1.wallet.consolidate': {
post: httpRoute({
Expand All @@ -745,19 +775,7 @@ export const MasterBitGoExpressApiSpec = apiSpec({
}),
},
'v1.wallet.accelerate': {
post: httpRoute({
method: 'POST',
path: '/api/{coin}/wallet/{walletId}/accelerate',
request: httpRequest({
params: {
walletId: t.string,
coin: t.string,
},
body: AccelerateRequest,
}),
response: AccelerateResponse,
description: 'Accelerate transaction',
}),
post: AccelerateRoute,
},
'v1.wallet.consolidateunspents': {
post: httpRoute({
Expand Down