Skip to content

Commit 031e5b1

Browse files
authored
Merge pull request #168 from BitGo/tw-138-clean-up-js-doc
docs: Cleaned up JS Doc
2 parents c6884ac + f1d4c99 commit 031e5b1

File tree

11 files changed

+121
-45
lines changed

11 files changed

+121
-45
lines changed

src/advancedWalletManager/routers/healthCheck.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ const VersionResponse: HttpResponse = {
1515
200: VersionResponseType,
1616
};
1717

18-
// API Specification
18+
/**
19+
* Ping Check
20+
*
21+
* @tag Advanced Wallets
22+
* @operationId v1.health.ping
23+
* @private
24+
*/
1925
export const HealthCheckApiSpec = apiSpec({
2026
'v1.health.ping': {
2127
post: httpRoute({
@@ -26,6 +32,13 @@ export const HealthCheckApiSpec = apiSpec({
2632
description: 'Health check endpoint that returns server status',
2733
}),
2834
},
35+
/**
36+
* Version Check
37+
*
38+
* @tag Advanced Wallets
39+
* @operationId v1.health.version
40+
* @private
41+
*/
2942
'v1.health.version': {
3043
get: httpRoute({
3144
method: 'GET',

src/masterBitgoExpress/routers/accelerateRoute.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ import { httpRequest, HttpResponse, httpRoute, optional } from '@api-ts/io-ts-ht
22
import * as t from 'io-ts';
33
import { ErrorResponses } from '../../shared/errors';
44

5-
/**
6-
* Request type for the transaction acceleration endpoint.
7-
* Used to accelerate unconfirmed transactions on UTXO-based blockchains using CPFP or RBF.
8-
*
9-
* @endpoint POST /api/v1/{coin}/advancedwallet/{walletId}/accelerate
10-
* @description Speeds up unconfirmed transactions by creating a child transaction (CPFP) or replacing the original transaction (RBF)
11-
*/
125
export const AccelerateRequest = {
136
/**
147
* Public key used for signing the acceleration transaction.
@@ -59,12 +52,6 @@ export const AccelerateRequest = {
5952
feeMultiplier: optional(t.number),
6053
};
6154

62-
/**
63-
* Response type for the transaction acceleration endpoint.
64-
*
65-
* @endpoint POST /api/v1/{coin}/advancedwallet/{walletId}/accelerate
66-
* @description Sign an acceleration transaction and send to BitGo to sign and broadcast
67-
*/
6855
const AccelerateResponse: HttpResponse = {
6956
/**
7057
* Successful acceleration response.
@@ -89,8 +76,14 @@ const AccelerateResponse: HttpResponse = {
8976
};
9077

9178
/**
92-
* Accelerate unconfirmed transactions on UTXO-based blockchains.
93-
* Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.
79+
* Accelerate transaction (advanced)
80+
*
81+
* Send a new transaction to accelerate the targeted unconfirmed transaction either by using Child-Pays-For-Parent (CPFP) or Replace-By-Fee (RBF).
82+
*
83+
* Use this endpoint only with advanced wallets. For other wallet types, use [Accelerate Transaction](https://developers.bitgo.com/reference/expresswalletacceleratetx).
84+
*
85+
* @tag Advanced Wallets
86+
* @operationId advancedwalletacceleratetx
9487
*/
9588
export const AccelerateRoute = httpRoute({
9689
method: 'POST',

src/masterBitgoExpress/routers/awmExpressHealth.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ const VersionAwmResponse: HttpResponse = {
2929
}),
3030
};
3131

32-
// API Specification
32+
/**
33+
* Ping Check
34+
*
35+
* @tag Advanced Wallets
36+
* @operationId v1.advancedwalletmanager.ping
37+
* @private
38+
*/
3339
export const AdvancedWalletManagerHealthSpec = apiSpec({
3440
'v1.advancedwalletmanager.ping': {
3541
post: httpRoute({
@@ -40,6 +46,13 @@ export const AdvancedWalletManagerHealthSpec = apiSpec({
4046
description: 'Ping the advanced wallet manager server',
4147
}),
4248
},
49+
/**
50+
* Version Check
51+
*
52+
* @tag Advanced Wallets
53+
* @operationId v1.advancedwalletmanager.version
54+
* @private
55+
*/
4356
'v1.advancedwalletmanager.version': {
4457
get: httpRoute({
4558
method: 'GET',

src/masterBitgoExpress/routers/consolidateRoute.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ export const ConsolidateResponse: HttpResponse = {
3535
};
3636

3737
/**
38-
* Build, sign, and send a consolidation transaction for an account-based asset all in 1 call.
39-
* For account-based assets, consolidating the balances in the receive addresses to the base address maximizes the spendable balance of a wallet.
38+
* Consolidate account (advanced)
39+
*
40+
* Build, sign, and send a consolidation transaction, all in one call. For account-based assets, consolidating the balances in the receive addresses to the base address maximizes the spendable balance of a wallet.
41+
*
42+
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate account (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateaccount).
43+
*
44+
* @tag Advanced Wallets
45+
* @operationId advancedwalletconsolidate
4046
*/
4147
export const ConsolidateRoute = httpRoute({
4248
method: 'POST',

src/masterBitgoExpress/routers/consolidateUnspentsRoute.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ export const ConsolidateUnspentsResponse: HttpResponse = {
7474
};
7575

7676
/**
77-
* Build and send a transaction to consolidate unspents in a wallet.
78-
* Consolidating unspents is only for UTXO-based assets.
77+
* Consolidate unspents (advanced)
78+
*
79+
* Builds, signs, and sends a transaction to consolidate unspents all in 1 call. Consolidating unspents is only for UTXO-based assets.
80+
*
81+
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate unspents (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateunspents).
82+
*
83+
* @tag Advanced Wallets
84+
* @operationId advancedwalletconsolidateunspents
7985
*/
8086
export const ConsolidateUnspentsRoute = httpRoute({
8187
method: 'POST',

src/masterBitgoExpress/routers/generateWalletRoute.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,17 @@ const GenerateWalletRequest = {
332332
};
333333

334334
/**
335-
* Generates a new advanced wallet.
336-
* The wallet creation process involves several steps that happen automatically:
337-
* 1. User Keychain Creation: Creates the user keychain in the advanced wallet manager and encrypts it with the respective KMS.
338-
* 2. Backup Keychain Creation: Creates the backup keychain in the advanced wallet manager and encrypts it with the respective KMS.
339-
* 3. Keychain Upload: Uploads the user/backup public keys to BitGo.
340-
* 4. BitGo Key Creation: Creates the BitGo key on the BitGo service.
341-
* 5. Wallet Creation: Creates the wallet on BitGo with the 3 keys.
335+
* Generate wallet (advanced)
336+
*
337+
* Create a new advanced wallet. Calling this endpoint does the following:
338+
* 1. Creates the user keychain in the advanced wallet manager and encrypts it with the respective key management service (KMS).
339+
* 2. Creates the backup keychain in the advanced wallet manager and encrypts it with the respective KMS.
340+
* 3. Uploads the public user and backup keys to BitGo.
341+
* 4. Creates the BitGo key on the BitGo service.
342+
* 5. Creates the wallet on BitGo with the 3 keys.
343+
*
344+
* @tag Advanced Wallets
345+
* @operationId advancedwalletgenerate
342346
*/
343347
export const WalletGenerateRoute = httpRoute({
344348
method: 'POST',

src/masterBitgoExpress/routers/healthCheck.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ const VersionResponse: HttpResponse = {
1515
200: VersionResponseType,
1616
};
1717

18-
// API Specification
18+
/**
19+
* Ping Check
20+
*
21+
* @tag Advanced Wallets
22+
* @operationId v1.health.ping
23+
* @private
24+
*/
1925
export const HealthCheckApiSpec = apiSpec({
2026
'v1.health.ping': {
2127
post: httpRoute({
@@ -26,6 +32,13 @@ export const HealthCheckApiSpec = apiSpec({
2632
description: 'Health check endpoint that returns server status',
2733
}),
2834
},
35+
/**
36+
* Version Check
37+
*
38+
* @tag Advanced Wallets
39+
* @operationId v1.health.version
40+
* @private
41+
*/
2942
'v1.health.version': {
3043
get: httpRoute({
3144
method: 'GET',

src/masterBitgoExpress/routers/recoveryConsolidationsRoute.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ErrorResponses } from '../../shared/errors';
66
* Request type for wallet recovery consolidations endpoint.
77
* Used to consolidate and recover funds from multiple addresses in a wallet, via signing with user and backup keys.
88
*
9-
* @endpoint POST /api/v1/{coin}/advancedwallet/recoveryconsolidations
109
* @description Consolidates and recovers funds from multiple addresses in a wallet
1110
*/
1211
const RecoveryConsolidationsWalletRequest = {
@@ -101,7 +100,6 @@ const RecoveryConsolidationsWalletRequest = {
101100
/**
102101
* Response type for the wallet recovery consolidations endpoint
103102
*
104-
* @endpoint POST /api/v1/{coin}/advancedwallet/recoveryconsolidations
105103
* @description Returns the signed consolidation transactions
106104
*/
107105
const RecoveryConsolidationsWalletResponse: HttpResponse = {
@@ -115,8 +113,16 @@ const RecoveryConsolidationsWalletResponse: HttpResponse = {
115113
};
116114

117115
/**
118-
* Consolidate funds from multiple addresses in a wallet and sign with user & backup keys in a recovery situation.
119-
* Used for both standard multisig wallets and TSS wallets to consolidate funds from various addresses.
116+
* Consolidate and recover assets (advanced)
117+
*
118+
* Recover assets from an advanced wallet with a balance in multiple receive addresses. Build, sign, and send a consolidation and recovery, all in one call. Sign using your user and backup keys. Works for both multisignature and MPC recoveries.
119+
*
120+
* To recover assets from an advanced wallet with a balance only in the base address, use [Recover assets (advanced)](https://developers.bitgo.com/reference/advancedwalletrecovery).
121+
*
122+
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
123+
*
124+
* @tag Advanced Wallets
125+
* @operationId advancedwalletconsolidaterecovery
120126
*/
121127
export const RecoveryConsolidationsRoute = httpRoute({
122128
method: 'POST',

src/masterBitgoExpress/routers/recoveryRoute.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,7 @@ export type CoinSpecificParamsUnion =
189189
| EcdsaCosmosLikeRecoverySpecificParams;
190190

191191
/**
192-
* Response type for the wallet recovery endpoint.
193-
*
194-
* @endpoint POST /api/v1/{coin}/advancedwallet/recovery
195-
* @description Returns the signed recovery transaction that can be broadcast to the network
192+
* Response type for the wallet recovery endpoint. Returns the signed recovery transaction that can be broadcast to the network
196193
*/
197194
const RecoveryWalletResponse: HttpResponse = {
198195
/**
@@ -212,10 +209,7 @@ const RecoveryWalletResponse: HttpResponse = {
212209

213210
/**
214211
* Request type for the wallet recovery endpoint.
215-
* Used to recover funds from both standard multisig and TSS wallets.
216-
*
217-
* @endpoint POST /api/v1/{coin}/advancedwallet/recovery
218-
* @description Recover funds from a wallet by building a transaction with user and backup keys
212+
* Used to recover funds from both standard multisig and TSS wallets. Recover funds from an advanced wallet by building a transaction with user and backup keys.
219213
*/
220214
const RecoveryWalletRequest = {
221215
/**
@@ -291,8 +285,16 @@ const RecoveryWalletRequest = {
291285
};
292286

293287
/**
294-
* Recover funds from an existing wallet using user and backup keys.
295-
* This endpoint allows for both standard multisig and TSS wallet recovery.
288+
* Recover assets (advanced)
289+
*
290+
* Recover assets from an advanced wallet with a balance only in the base address. Works for both multisignature and MPC recoveries.
291+
*
292+
* To recover assets from an advanced wallet with balances in multiple receive addresses, use [Consolidate and recover assets (advanced)](https://developers.bitgo.com/reference/advancedwalletconsolidaterecovery).
293+
*
294+
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
295+
*
296+
* @tag Advanced Wallets
297+
* @operationId advancedwalletrecovery
296298
*/
297299
export const RecoveryRoute = httpRoute({
298300
method: 'POST',

src/masterBitgoExpress/routers/sendManyRoute.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,20 @@ export const SendManyResponse: HttpResponse = {
207207
...ErrorResponses,
208208
};
209209

210+
/**
211+
* Send to many (advanced)
212+
*
213+
* Send coins or tokens to one or more recipients. You can use this endpoint to schedule outgoing transactions in bulk, lowering your aggregate amount of blockchain fees.
214+
*
215+
* Works with both multisignature and MPC wallets. Also supports external-signer mode.
216+
*
217+
* Works with most BitGo-supported assets, but currently unavailable for: ALGO, ARBETH, AVAXC, CELO, CELO:CUSD, CSPR, DOT, EOS, HTETH:BGERCH, NEAR, OPETH, STX, TON, TRX, TRX:USDC, XLM, XRP, XTZ
218+
*
219+
* Use this endpoint only with advanced wallets. For other wallet types, use [Send to many](https://developers.bitgo.com/reference/expresswalletsendmany).
220+
*
221+
* @tag Advanced Wallets
222+
* @operationId advancedwalletsendmany
223+
*/
210224
export const SendManyRoute = httpRoute({
211225
method: 'POST',
212226
path: '/api/v1/{coin}/advancedwallet/{walletId}/sendMany',

0 commit comments

Comments
 (0)