@@ -13,7 +13,7 @@ import {
1313} from '@api-ts/typed-express-router' ;
1414import { Response } from '@api-ts/response' ;
1515import express from 'express' ;
16- import { BitGoRequest , isBitGoRequest } from '../../types/request' ;
16+ import { BitGoRequest } from '../../types/request' ;
1717import { MasterExpressConfig } from '../../config' ;
1818import { handleGenerateWalletOnPrem } from '../generateWallet' ;
1919import { prepareBitGo , responseHandler } from '../../shared/middleware' ;
@@ -44,50 +44,37 @@ const GenerateWalletRequest = {
4444 isDistributedCustody : t . union ( [ t . undefined , t . boolean ] ) ,
4545} ;
4646
47- export const SendManyRequest = t . intersection ( [
48- t . type ( {
49- pubkey : t . string ,
50- source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
51- recipients : t . array (
52- t . type ( {
53- address : t . string ,
54- amount : t . union ( [ t . string , t . number ] ) ,
55- feeLimit : t . union ( [ t . undefined , t . string ] ) ,
56- data : t . union ( [ t . undefined , t . string ] ) ,
57- tokenName : t . union ( [ t . undefined , t . string ] ) ,
58- tokenData : t . union ( [ t . undefined , t . any ] ) ,
59- } ) ,
60- ) ,
61- } ) ,
62- t . partial ( {
63- numBlocks : t . number ,
64- feeRate : t . number ,
65- feeMultiplier : t . number ,
66- maxFeeRate : t . number ,
67- minConfirms : t . number ,
68- enforceMinConfirmsForChange : t . boolean ,
69- targetWalletUnspents : t . number ,
70- message : t . string ,
71- minValue : t . union ( [ t . number , t . string ] ) ,
72- maxValue : t . union ( [ t . number , t . string ] ) ,
73- sequenceId : t . string ,
74- lastLedgerSequence : t . number ,
75- ledgerSequenceDelta : t . number ,
76- gasPrice : t . number ,
77- noSplitChange : t . boolean ,
78- unspents : t . array ( t . string ) ,
79- comment : t . string ,
80- otp : t . string ,
81- changeAddress : t . string ,
82- allowExternalChangeAddress : t . boolean ,
83- instant : t . boolean ,
84- memo : t . string ,
85- transferId : t . number ,
86- eip1559 : t . any ,
87- gasLimit : t . number ,
88- custodianTransactionId : t . string ,
89- } ) ,
90- ] ) ;
47+ export const SendManyRequest = {
48+ pubkey : t . string ,
49+ source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
50+ recipients : t . array ( t . any ) ,
51+ numBlocks : t . union ( [ t . undefined , t . number ] ) ,
52+ feeRate : t . union ( [ t . undefined , t . number ] ) ,
53+ feeMultiplier : t . union ( [ t . undefined , t . number ] ) ,
54+ maxFeeRate : t . union ( [ t . undefined , t . number ] ) ,
55+ minConfirms : t . union ( [ t . undefined , t . number ] ) ,
56+ enforceMinConfirmsForChange : t . union ( [ t . undefined , t . boolean ] ) ,
57+ targetWalletUnspents : t . union ( [ t . undefined , t . number ] ) ,
58+ message : t . union ( [ t . undefined , t . string ] ) ,
59+ minValue : t . union ( [ t . undefined , t . union ( [ t . number , t . string ] ) ] ) ,
60+ maxValue : t . union ( [ t . undefined , t . union ( [ t . number , t . string ] ) ] ) ,
61+ sequenceId : t . union ( [ t . undefined , t . string ] ) ,
62+ lastLedgerSequence : t . union ( [ t . undefined , t . number ] ) ,
63+ ledgerSequenceDelta : t . union ( [ t . undefined , t . number ] ) ,
64+ gasPrice : t . union ( [ t . undefined , t . number ] ) ,
65+ noSplitChange : t . union ( [ t . undefined , t . boolean ] ) ,
66+ unspents : t . union ( [ t . undefined , t . array ( t . string ) ] ) ,
67+ comment : t . union ( [ t . undefined , t . string ] ) ,
68+ otp : t . union ( [ t . undefined , t . string ] ) ,
69+ changeAddress : t . union ( [ t . undefined , t . string ] ) ,
70+ allowExternalChangeAddress : t . union ( [ t . undefined , t . boolean ] ) ,
71+ instant : t . union ( [ t . undefined , t . boolean ] ) ,
72+ memo : t . union ( [ t . undefined , t . string ] ) ,
73+ transferId : t . union ( [ t . undefined , t . number ] ) ,
74+ eip1559 : t . union ( [ t . undefined , t . any ] ) ,
75+ gasLimit : t . union ( [ t . undefined , t . number ] ) ,
76+ custodianTransactionId : t . union ( [ t . undefined , t . string ] ) ,
77+ } ;
9178
9279export const SendManyResponse : HttpResponse = {
9380 // TODO: Get type from public types repo / Wallet Platform
@@ -102,7 +89,7 @@ export const SendManyResponse: HttpResponse = {
10289export const MasterApiSpec = apiSpec ( {
10390 'v1.wallet.generate' : {
10491 post : httpRoute ( {
105- method : 'POST' ,
92+ method : 'POST' as const ,
10693 path : '/{coin}/wallet/generate' ,
10794 request : httpRequest ( {
10895 params : {
0 commit comments