Skip to content

Commit a6a3b8f

Browse files
authored
Merge pull request #6901 from BitGo/BTC-2438-add-fund-psbt-request
feat: added fundpsbtrequest codec
2 parents a3eb8b9 + c01af4f commit a6a3b8f

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

modules/abstract-lightning/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
]
4040
},
4141
"dependencies": {
42-
"@bitgo/public-types": "5.20.0",
42+
"@bitgo/public-types": "5.22.0",
4343
"@bitgo/sdk-core": "^36.8.0",
4444
"@bitgo/statics": "^57.8.0",
4545
"@bitgo/utxo-lib": "^11.10.0",

modules/abstract-lightning/src/codecs/api/withdraw.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import * as t from 'io-ts';
2-
import { LightningOnchainRecipient, optionalString } from '@bitgo/public-types';
2+
import { LightningOnchainRequest, optionalString } from '@bitgo/public-types';
33
import { PendingApprovalData, TxRequestState } from '@bitgo/sdk-core';
4-
import { BigIntFromString } from 'io-ts-types';
54

65
export const WithdrawStatusDelivered = 'delivered';
76
export const WithdrawStatusFailed = 'failed';
87

98
export const WithdrawStatus = t.union([t.literal(WithdrawStatusDelivered), t.literal(WithdrawStatusFailed)]);
109

11-
// todo: import LightningOnchainRequest from public-types after it is published
1210
export const LightningOnchainWithdrawParams = t.intersection([
13-
// LightningOnchainRequest,
11+
LightningOnchainRequest,
1412
t.type({
15-
recipients: t.array(LightningOnchainRecipient),
16-
satsPerVbyte: BigIntFromString,
1713
passphrase: t.string,
1814
}),
1915
t.partial({
@@ -73,6 +69,17 @@ export type LightningOnchainWithdrawResponse = {
7369
transfer?: any;
7470
};
7571

72+
export const FundPsbtRequest = t.intersection(
73+
[
74+
LightningOnchainRequest,
75+
t.type({
76+
txRequestId: t.string,
77+
}),
78+
],
79+
'FundPsbtRequest'
80+
);
81+
export type FundPsbtRequest = t.TypeOf<typeof FundPsbtRequest>;
82+
7683
export const FundPsbtResponse = t.type(
7784
{
7885
fundedPsbt: t.string,

modules/bitgo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
"superagent": "^9.0.1"
139139
},
140140
"devDependencies": {
141-
"@bitgo/public-types": "5.20.0",
141+
"@bitgo/public-types": "5.22.0",
142142
"@bitgo/sdk-opensslbytes": "^2.0.0",
143143
"@bitgo/sdk-test": "^9.0.9",
144144
"@openpgp/web-stream-tools": "0.0.14",

modules/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"superagent": "^9.0.1"
5959
},
6060
"devDependencies": {
61-
"@bitgo/public-types": "5.20.0",
61+
"@bitgo/public-types": "5.22.0",
6262
"@bitgo/sdk-lib-mpc": "^10.7.0",
6363
"@bitgo/sdk-test": "^9.0.9",
6464
"@types/argparse": "^1.0.36",

modules/sdk-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838
},
3939
"dependencies": {
40-
"@bitgo/public-types": "5.20.0",
40+
"@bitgo/public-types": "5.22.0",
4141
"@bitgo/sdk-lib-mpc": "^10.7.0",
4242
"@bitgo/secp256k1": "^1.5.0",
4343
"@bitgo/sjcl": "^1.0.1",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,10 +945,10 @@
945945
monocle-ts "^2.3.13"
946946
newtype-ts "^0.3.5"
947947

948-
"@bitgo/public-types@5.20.0":
949-
version "5.20.0"
950-
resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.20.0.tgz"
951-
integrity sha512-OOVs9eGviJtSdpWvWb9uPUezM9Qyy/ERAQFifZZ8NB8Sq8RxAjMlXinzazEHveRtHi9aaEd6jxzEnatnFLCE0w==
948+
"@bitgo/public-types@5.22.0":
949+
version "5.22.0"
950+
resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.22.0.tgz#eec37aa28b3979c6e9ba2dda8f3bb35472b0eaad"
951+
integrity sha512-1j9c3hYn9SmxV2oAq5NBOOS8Hpm6f9B9eKNUH1qpELrktEA/qkg4YCm4/uILWPb0BN5fluhMk0G0XCkMybt7vA==
952952
dependencies:
953953
fp-ts "^2.0.0"
954954
io-ts "npm:@bitgo-forks/[email protected]"

0 commit comments

Comments
 (0)