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
15 changes: 14 additions & 1 deletion src/advancedWalletManager/routers/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ const VersionResponse: HttpResponse = {
200: VersionResponseType,
};

// API Specification
/**
* Ping Check
*
* @tag Advanced Wallets
* @operationId v1.health.ping
* @private
*/
export const HealthCheckApiSpec = apiSpec({
'v1.health.ping': {
post: httpRoute({
Expand All @@ -26,6 +32,13 @@ export const HealthCheckApiSpec = apiSpec({
description: 'Health check endpoint that returns server status',
}),
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.health.version
* @private
*/
'v1.health.version': {
get: httpRoute({
method: 'GET',
Expand Down
23 changes: 8 additions & 15 deletions src/masterBitgoExpress/routers/accelerateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ import { httpRequest, HttpResponse, httpRoute, optional } from '@api-ts/io-ts-ht
import * as t from 'io-ts';
import { ErrorResponses } from '../../shared/errors';

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

/**
* Response type for the transaction acceleration endpoint.
*
* @endpoint POST /api/v1/{coin}/advancedwallet/{walletId}/accelerate
* @description Sign an acceleration transaction and send to BitGo to sign and broadcast
*/
const AccelerateResponse: HttpResponse = {
/**
* Successful acceleration response.
Expand All @@ -89,8 +76,14 @@ const AccelerateResponse: HttpResponse = {
};

/**
* Accelerate unconfirmed transactions on UTXO-based blockchains.
* Supports Child-Pays-For-Parent (CPFP) and Replace-By-Fee (RBF) acceleration methods.
* Accelerate transaction (advanced)
*
* Send a new transaction to accelerate the targeted unconfirmed transaction either by using Child-Pays-For-Parent (CPFP) or Replace-By-Fee (RBF).
*
* Use this endpoint only with advanced wallets. For other wallet types, use [Accelerate Transaction](https://developers.bitgo.com/reference/expresswalletacceleratetx).
*
* @tag Advanced Wallets
* @operationId advancedwalletacceleratetx
*/
export const AccelerateRoute = httpRoute({
method: 'POST',
Expand Down
15 changes: 14 additions & 1 deletion src/masterBitgoExpress/routers/awmExpressHealth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ const VersionAwmResponse: HttpResponse = {
}),
};

// API Specification
/**
* Ping Check
*
* @tag Advanced Wallets
* @operationId v1.advancedwalletmanager.ping
* @private
*/
export const AdvancedWalletManagerHealthSpec = apiSpec({
'v1.advancedwalletmanager.ping': {
post: httpRoute({
Expand All @@ -40,6 +46,13 @@ export const AdvancedWalletManagerHealthSpec = apiSpec({
description: 'Ping the advanced wallet manager server',
}),
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.advancedwalletmanager.version
* @private
*/
'v1.advancedwalletmanager.version': {
get: httpRoute({
method: 'GET',
Expand Down
10 changes: 8 additions & 2 deletions src/masterBitgoExpress/routers/consolidateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ export const ConsolidateResponse: HttpResponse = {
};

/**
* Build, sign, and send a consolidation transaction for an account-based asset all in 1 call.
* For account-based assets, consolidating the balances in the receive addresses to the base address maximizes the spendable balance of a wallet.
* Consolidate account (advanced)
*
* 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.
*
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate account (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateaccount).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidate
*/
export const ConsolidateRoute = httpRoute({
method: 'POST',
Expand Down
10 changes: 8 additions & 2 deletions src/masterBitgoExpress/routers/consolidateUnspentsRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ export const ConsolidateUnspentsResponse: HttpResponse = {
};

/**
* Build and send a transaction to consolidate unspents in a wallet.
* Consolidating unspents is only for UTXO-based assets.
* Consolidate unspents (advanced)
*
* Builds, signs, and sends a transaction to consolidate unspents all in 1 call. Consolidating unspents is only for UTXO-based assets.
*
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate unspents (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateunspents).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidateunspents
*/
export const ConsolidateUnspentsRoute = httpRoute({
method: 'POST',
Expand Down
18 changes: 11 additions & 7 deletions src/masterBitgoExpress/routers/generateWalletRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,17 @@ const GenerateWalletRequest = {
};

/**
* Generates a new advanced wallet.
* The wallet creation process involves several steps that happen automatically:
* 1. User Keychain Creation: Creates the user keychain in the advanced wallet manager and encrypts it with the respective KMS.
* 2. Backup Keychain Creation: Creates the backup keychain in the advanced wallet manager and encrypts it with the respective KMS.
* 3. Keychain Upload: Uploads the user/backup public keys to BitGo.
* 4. BitGo Key Creation: Creates the BitGo key on the BitGo service.
* 5. Wallet Creation: Creates the wallet on BitGo with the 3 keys.
* Generate wallet (advanced)
*
* Create a new advanced wallet. Calling this endpoint does the following:
* 1. Creates the user keychain in the advanced wallet manager and encrypts it with the respective key management service (KMS).
* 2. Creates the backup keychain in the advanced wallet manager and encrypts it with the respective KMS.
* 3. Uploads the public user and backup keys to BitGo.
* 4. Creates the BitGo key on the BitGo service.
* 5. Creates the wallet on BitGo with the 3 keys.
*
* @tag Advanced Wallets
* @operationId advancedwalletgenerate
*/
export const WalletGenerateRoute = httpRoute({
method: 'POST',
Expand Down
15 changes: 14 additions & 1 deletion src/masterBitgoExpress/routers/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ const VersionResponse: HttpResponse = {
200: VersionResponseType,
};

// API Specification
/**
* Ping Check
*
* @tag Advanced Wallets
* @operationId v1.health.ping
* @private
*/
export const HealthCheckApiSpec = apiSpec({
'v1.health.ping': {
post: httpRoute({
Expand All @@ -26,6 +32,13 @@ export const HealthCheckApiSpec = apiSpec({
description: 'Health check endpoint that returns server status',
}),
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.health.version
* @private
*/
'v1.health.version': {
get: httpRoute({
method: 'GET',
Expand Down
14 changes: 10 additions & 4 deletions src/masterBitgoExpress/routers/recoveryConsolidationsRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ErrorResponses } from '../../shared/errors';
* Request type for wallet recovery consolidations endpoint.
* Used to consolidate and recover funds from multiple addresses in a wallet, via signing with user and backup keys.
*
* @endpoint POST /api/v1/{coin}/advancedwallet/recoveryconsolidations
* @description Consolidates and recovers funds from multiple addresses in a wallet
*/
const RecoveryConsolidationsWalletRequest = {
Expand Down Expand Up @@ -101,7 +100,6 @@ const RecoveryConsolidationsWalletRequest = {
/**
* Response type for the wallet recovery consolidations endpoint
*
* @endpoint POST /api/v1/{coin}/advancedwallet/recoveryconsolidations
* @description Returns the signed consolidation transactions
*/
const RecoveryConsolidationsWalletResponse: HttpResponse = {
Expand All @@ -115,8 +113,16 @@ const RecoveryConsolidationsWalletResponse: HttpResponse = {
};

/**
* 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.
* Consolidate and recover assets (advanced)
*
* 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.
*
* 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).
*
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidaterecovery
*/
export const RecoveryConsolidationsRoute = httpRoute({
method: 'POST',
Expand Down
22 changes: 12 additions & 10 deletions src/masterBitgoExpress/routers/recoveryRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ export type CoinSpecificParamsUnion =
| EcdsaCosmosLikeRecoverySpecificParams;

/**
* Response type for the wallet recovery endpoint.
*
* @endpoint POST /api/v1/{coin}/advancedwallet/recovery
* @description Returns the signed recovery transaction that can be broadcast to the network
* Response type for the wallet recovery endpoint. Returns the signed recovery transaction that can be broadcast to the network
*/
const RecoveryWalletResponse: HttpResponse = {
/**
Expand All @@ -212,10 +209,7 @@ const RecoveryWalletResponse: HttpResponse = {

/**
* Request type for the wallet recovery endpoint.
* Used to recover funds from both standard multisig and TSS wallets.
*
* @endpoint POST /api/v1/{coin}/advancedwallet/recovery
* @description Recover funds from a wallet by building a transaction with user and backup keys
* 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.
*/
const RecoveryWalletRequest = {
/**
Expand Down Expand Up @@ -291,8 +285,16 @@ const RecoveryWalletRequest = {
};

/**
* Recover funds from an existing wallet using user and backup keys.
* This endpoint allows for both standard multisig and TSS wallet recovery.
* Recover assets (advanced)
*
* Recover assets from an advanced wallet with a balance only in the base address. Works for both multisignature and MPC recoveries.
*
* 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).
*
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
*
* @tag Advanced Wallets
* @operationId advancedwalletrecovery
*/
export const RecoveryRoute = httpRoute({
method: 'POST',
Expand Down
14 changes: 14 additions & 0 deletions src/masterBitgoExpress/routers/sendManyRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@ export const SendManyResponse: HttpResponse = {
...ErrorResponses,
};

/**
* Send to many (advanced)
*
* 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.
*
* Works with both multisignature and MPC wallets. Also supports external-signer mode.
*
* 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
*
* Use this endpoint only with advanced wallets. For other wallet types, use [Send to many](https://developers.bitgo.com/reference/expresswalletsendmany).
*
* @tag Advanced Wallets
* @operationId advancedwalletsendmany
*/
export const SendManyRoute = httpRoute({
method: 'POST',
path: '/api/v1/{coin}/advancedwallet/{walletId}/sendMany',
Expand Down
10 changes: 8 additions & 2 deletions src/masterBitgoExpress/routers/signAndSendMpcRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ export const SignMpcResponse: HttpResponse = {
};

/**
* Sign a TxRequest and Broadcast it (MPC wallets only)
* This is usually needed after resolving a pending approval for a MPC wallet
* Sign and send MPC transaction (advanced)
*
* Sign and send a MPC transaction.
*
* Use this endpoint only with advanced wallets. For other wallet types, use [Sign MPC transaction](https://developers.bitgo.com/reference/expresswalletsigntxtss).
*
* @tag Advanced Wallets
* @operationId advancedwalletsigntxtss
*/
export const SignAndSendMpcRoute = httpRoute({
method: 'POST',
Expand Down