-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsolidateUnspentsRoute.ts
More file actions
97 lines (94 loc) · 2.45 KB
/
consolidateUnspentsRoute.ts
File metadata and controls
97 lines (94 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { httpRequest, HttpResponse, httpRoute, optional } from '@api-ts/io-ts-http';
import * as t from 'io-ts';
import { ErrorResponses } from '../../shared/errors';
export const ConsolidateUnspentsRequest = {
/**
* Public key of the key used for signing multisig transactions
*/
pubkey: t.string,
/**
* The key to use for signing the transaction
*/
source: t.union([t.literal('user'), t.literal('backup')]),
/**
* Custom fee rate (in base units) per kilobyte
*/
feeRate: optional(t.number),
/**
* Maximum fee rate (in base units) per kilobyte
*/
maxFeeRate: optional(t.number),
/**
* Maximum fee percentage
*/
maxFeePercentage: optional(t.number),
/**
* Fee transaction confirmation target
*/
feeTxConfirmTarget: optional(t.number),
/**
* Enable bulk processing
*/
bulk: optional(t.boolean),
/**
* Minimum value for unspents
*/
minValue: optional(t.union([t.string, t.number])),
/**
* Maximum value for unspents
*/
maxValue: optional(t.union([t.string, t.number])),
/**
* Minimum block height
*/
minHeight: optional(t.number),
/**
* Minimum confirmations required
*/
minConfirms: optional(t.number),
/**
* Enforce minimum confirmations for change outputs
*/
enforceMinConfirmsForChange: optional(t.boolean),
/**
* Limit the number of unspents to process
*/
limit: optional(t.number),
/**
* Number of unspents to make
*/
numUnspentsToMake: optional(t.number),
/**
* Target address for consolidation
*/
targetAddress: optional(t.string),
};
export const ConsolidateUnspentsResponse: HttpResponse = {
200: t.type({
tx: t.string,
txid: t.string,
}),
...ErrorResponses,
};
/**
* 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 advancedwallet.consolidate.unspents
*/
export const ConsolidateUnspentsRoute = httpRoute({
method: 'POST',
path: '/api/v1/{coin}/advancedwallet/{walletId}/consolidateunspents',
request: httpRequest({
params: {
walletId: t.string,
coin: t.string,
},
body: ConsolidateUnspentsRequest,
}),
response: ConsolidateUnspentsResponse,
});