Skip to content

Commit 9352c72

Browse files
committed
refactor: adding missed changes
TICKET: WP-5444
1 parent 685ae3c commit 9352c72

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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;

0 commit comments

Comments
 (0)