File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
modules/express/src/typedRoutes/api/v2 Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import * as t from 'io-ts' ;
2+ import { httpRoute , httpRequest , optional } from '@api-ts/io-ts-http' ;
3+ import { BitgoExpressError } from '../../schemas/error' ;
4+
5+ // Params: coin (lightning coin), walletId path parameter
6+ export const LightningInitWalletParams = {
7+ coin : t . string ,
8+ walletId : t . string ,
9+ } ;
10+
11+ // Body shape (required + optional). We intentionally do NOT reuse the composite
12+ // InitLightningWalletRequest intersection codec here because httpRequest expects
13+ // a plain object mapping of field -> codec, not an io-ts Type instance.
14+ export const LightningInitWalletBody = {
15+ passphrase : t . string ,
16+ expressHost : optional ( t . string ) ,
17+ } ;
18+
19+ /**
20+ * Lightning - Initialize node
21+ * @operationId express.lightning.initWallet
22+ * POST /api/v2/{coin}/wallet/{walletId}/initwallet
23+ */
24+ export const PostLightningInitWallet = httpRoute ( {
25+ path : '/api/v2/:coin/wallet/:walletId/initwallet' ,
26+ method : 'POST' ,
27+ request : httpRequest ( { params : LightningInitWalletParams , body : LightningInitWalletBody } ) ,
28+ response : { 200 : t . unknown , 400 : BitgoExpressError } ,
29+ } ) ;
30+
31+ export type PostLightningInitWallet = typeof PostLightningInitWallet ;
You can’t perform that action at this time.
0 commit comments