Skip to content

Commit 462f455

Browse files
Merge pull request #101 from BitGo/WP-5301/api-descriptions
docs(mbe): add api descriptions for recoveries and accelerations
2 parents 42b7b35 + 7b5a09e commit 462f455

File tree

2 files changed

+71
-37
lines changed

2 files changed

+71
-37
lines changed

masterBitgoExpress.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"paths": {
99
"/api/{coin}/wallet/{walletId}/accelerate": {
1010
"post": {
11+
"summary": "Accelerate unconfirmed transactions on UTXO-based blockchains.",
12+
"description": "Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.",
1113
"parameters": [
1214
{
1315
"name": "walletId",
@@ -710,6 +712,16 @@
710712
}
711713
}
712714
},
715+
"400": {
716+
"description": "Bad Request",
717+
"content": {
718+
"application/json": {
719+
"schema": {
720+
"$ref": "#/components/schemas/ErrorResponse"
721+
}
722+
}
723+
}
724+
},
713725
"500": {
714726
"description": "Internal Server Error",
715727
"content": {
@@ -725,6 +737,8 @@
725737
},
726738
"/api/{coin}/wallet/recovery": {
727739
"post": {
740+
"summary": "Recover funds from an existing wallet using user and backup keys.",
741+
"description": "This endpoint allows for both standard multisig and TSS wallet recovery.",
728742
"parameters": [
729743
{
730744
"name": "coin",
@@ -1038,6 +1052,8 @@
10381052
},
10391053
"/api/{coin}/wallet/recoveryconsolidations": {
10401054
"post": {
1055+
"summary": "Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.",
1056+
"description": "Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.",
10411057
"parameters": [
10421058
{
10431059
"name": "coin",

src/api/master/routers/masterBitGoExpressApiSpec.ts

Lines changed: 55 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,58 @@ const SignMpcResponse: HttpResponse = {
654654
...InternalServerErrorResponse,
655655
};
656656

657+
/**
658+
* Accelerate unconfirmed transactions on UTXO-based blockchains.
659+
* Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.
660+
*/
661+
const AccelerateRoute = httpRoute({
662+
method: 'POST',
663+
path: '/api/{coin}/wallet/{walletId}/accelerate',
664+
request: httpRequest({
665+
params: {
666+
walletId: t.string,
667+
coin: t.string,
668+
},
669+
body: AccelerateRequest,
670+
}),
671+
response: AccelerateResponse,
672+
description: 'Accelerate transaction',
673+
});
674+
675+
/**
676+
* Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.
677+
* Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.
678+
*/
679+
const RecoveryConsolidationsRoute = httpRoute({
680+
method: 'POST',
681+
path: '/api/{coin}/wallet/recoveryconsolidations',
682+
request: httpRequest({
683+
params: {
684+
coin: t.string,
685+
},
686+
body: RecoveryConsolidationsWalletRequest,
687+
}),
688+
response: RecoveryConsolidationsWalletResponse,
689+
description: 'Consolidate and recover an existing wallet',
690+
});
691+
692+
/**
693+
* Recover funds from an existing wallet using user and backup keys.
694+
* This endpoint allows for both standard multisig and TSS wallet recovery.
695+
*/
696+
const RecoveryRoute = httpRoute({
697+
method: 'POST',
698+
path: '/api/{coin}/wallet/recovery',
699+
request: httpRequest({
700+
params: {
701+
coin: t.string,
702+
},
703+
body: RecoveryWalletRequest,
704+
}),
705+
response: RecoveryWalletResponse,
706+
description: 'Recover an existing wallet',
707+
});
708+
657709
// API Specification
658710
export const MasterBitGoExpressApiSpec = apiSpec({
659711
'v1.wallet.generate': {
@@ -702,32 +754,10 @@ export const MasterBitGoExpressApiSpec = apiSpec({
702754
}),
703755
},
704756
'v1.wallet.recovery': {
705-
post: httpRoute({
706-
method: 'POST',
707-
path: '/api/{coin}/wallet/recovery',
708-
request: httpRequest({
709-
params: {
710-
coin: t.string,
711-
},
712-
body: RecoveryWalletRequest,
713-
}),
714-
response: RecoveryWalletResponse,
715-
description: 'Recover an existing wallet',
716-
}),
757+
post: RecoveryRoute,
717758
},
718759
'v1.wallet.recoveryConsolidations': {
719-
post: httpRoute({
720-
method: 'POST',
721-
path: '/api/{coin}/wallet/recoveryconsolidations',
722-
request: httpRequest({
723-
params: {
724-
coin: t.string,
725-
},
726-
body: RecoveryConsolidationsWalletRequest,
727-
}),
728-
response: RecoveryConsolidationsWalletResponse,
729-
description: 'Consolidate and recover an existing wallet',
730-
}),
760+
post: RecoveryConsolidationsRoute,
731761
},
732762
'v1.wallet.consolidate': {
733763
post: httpRoute({
@@ -745,19 +775,7 @@ export const MasterBitGoExpressApiSpec = apiSpec({
745775
}),
746776
},
747777
'v1.wallet.accelerate': {
748-
post: httpRoute({
749-
method: 'POST',
750-
path: '/api/{coin}/wallet/{walletId}/accelerate',
751-
request: httpRequest({
752-
params: {
753-
walletId: t.string,
754-
coin: t.string,
755-
},
756-
body: AccelerateRequest,
757-
}),
758-
response: AccelerateResponse,
759-
description: 'Accelerate transaction',
760-
}),
778+
post: AccelerateRoute,
761779
},
762780
'v1.wallet.consolidateunspents': {
763781
post: httpRoute({

0 commit comments

Comments
 (0)