From af7cc28134ff3da88e52169f504a60d2811ca7df Mon Sep 17 00:00:00 2001 From: Parv Tiwari Date: Mon, 8 Sep 2025 13:26:34 +0530 Subject: [PATCH 1/3] feat: added fundpsbtrequest codec TICKET: BTC-2438 --- .../abstract-lightning/src/codecs/api/withdraw.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/abstract-lightning/src/codecs/api/withdraw.ts b/modules/abstract-lightning/src/codecs/api/withdraw.ts index 136154c795..65103d3870 100644 --- a/modules/abstract-lightning/src/codecs/api/withdraw.ts +++ b/modules/abstract-lightning/src/codecs/api/withdraw.ts @@ -1,5 +1,5 @@ import * as t from 'io-ts'; -import { LightningOnchainRecipient, optionalString } from '@bitgo/public-types'; +import { LightningOnchainRecipient, LightningOnchainRequest, optionalString } from '@bitgo/public-types'; import { PendingApprovalData, TxRequestState } from '@bitgo/sdk-core'; import { BigIntFromString } from 'io-ts-types'; @@ -73,6 +73,17 @@ export type LightningOnchainWithdrawResponse = { transfer?: any; }; +export const FundPsbtRequest = t.intersection( + [ + LightningOnchainRequest, + t.type({ + txRequestId: t.string, + }), + ], + 'FundPsbtRequest' +); +export type FundPsbtRequest = t.TypeOf; + export const FundPsbtResponse = t.type( { fundedPsbt: t.string, From 6bd0aecb700a740f76c169b1476e1832bc3abe22 Mon Sep 17 00:00:00 2001 From: Parv Tiwari Date: Mon, 8 Sep 2025 13:35:28 +0530 Subject: [PATCH 2/3] feat: bumped public types TICKET: BTC-2438 --- modules/abstract-lightning/package.json | 2 +- modules/bitgo/package.json | 2 +- modules/express/package.json | 2 +- modules/sdk-core/package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/abstract-lightning/package.json b/modules/abstract-lightning/package.json index bebbf1e340..b5fbe506d5 100644 --- a/modules/abstract-lightning/package.json +++ b/modules/abstract-lightning/package.json @@ -39,7 +39,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "5.20.0", + "@bitgo/public-types": "5.22.0", "@bitgo/sdk-core": "^36.8.0", "@bitgo/statics": "^57.8.0", "@bitgo/utxo-lib": "^11.10.0", diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index e7eac79ea0..b526c3bd8a 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -138,7 +138,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "5.20.0", + "@bitgo/public-types": "5.22.0", "@bitgo/sdk-opensslbytes": "^2.0.0", "@bitgo/sdk-test": "^9.0.9", "@openpgp/web-stream-tools": "0.0.14", diff --git a/modules/express/package.json b/modules/express/package.json index 3e5d280c20..accb3bafb8 100644 --- a/modules/express/package.json +++ b/modules/express/package.json @@ -58,7 +58,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "5.20.0", + "@bitgo/public-types": "5.22.0", "@bitgo/sdk-lib-mpc": "^10.7.0", "@bitgo/sdk-test": "^9.0.9", "@types/argparse": "^1.0.36", diff --git a/modules/sdk-core/package.json b/modules/sdk-core/package.json index ce9a281ef8..76c55232c0 100644 --- a/modules/sdk-core/package.json +++ b/modules/sdk-core/package.json @@ -37,7 +37,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "5.20.0", + "@bitgo/public-types": "5.22.0", "@bitgo/sdk-lib-mpc": "^10.7.0", "@bitgo/secp256k1": "^1.5.0", "@bitgo/sjcl": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index 3d15035df8..32ca81e5b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -945,10 +945,10 @@ monocle-ts "^2.3.13" newtype-ts "^0.3.5" -"@bitgo/public-types@5.20.0": - version "5.20.0" - resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.20.0.tgz" - integrity sha512-OOVs9eGviJtSdpWvWb9uPUezM9Qyy/ERAQFifZZ8NB8Sq8RxAjMlXinzazEHveRtHi9aaEd6jxzEnatnFLCE0w== +"@bitgo/public-types@5.22.0": + version "5.22.0" + resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.22.0.tgz#eec37aa28b3979c6e9ba2dda8f3bb35472b0eaad" + integrity sha512-1j9c3hYn9SmxV2oAq5NBOOS8Hpm6f9B9eKNUH1qpELrktEA/qkg4YCm4/uILWPb0BN5fluhMk0G0XCkMybt7vA== dependencies: fp-ts "^2.0.0" io-ts "npm:@bitgo-forks/io-ts@2.1.4" From c01af4f541efc3406a31e615e338adef7e31b39e Mon Sep 17 00:00:00 2001 From: Parv Tiwari Date: Mon, 8 Sep 2025 13:37:04 +0530 Subject: [PATCH 3/3] feat: import onchain withdraw from public types TICKET: BTC-2438 --- modules/abstract-lightning/src/codecs/api/withdraw.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/abstract-lightning/src/codecs/api/withdraw.ts b/modules/abstract-lightning/src/codecs/api/withdraw.ts index 65103d3870..2f2a8d0dc7 100644 --- a/modules/abstract-lightning/src/codecs/api/withdraw.ts +++ b/modules/abstract-lightning/src/codecs/api/withdraw.ts @@ -1,19 +1,15 @@ import * as t from 'io-ts'; -import { LightningOnchainRecipient, LightningOnchainRequest, optionalString } from '@bitgo/public-types'; +import { LightningOnchainRequest, optionalString } from '@bitgo/public-types'; import { PendingApprovalData, TxRequestState } from '@bitgo/sdk-core'; -import { BigIntFromString } from 'io-ts-types'; export const WithdrawStatusDelivered = 'delivered'; export const WithdrawStatusFailed = 'failed'; export const WithdrawStatus = t.union([t.literal(WithdrawStatusDelivered), t.literal(WithdrawStatusFailed)]); -// todo: import LightningOnchainRequest from public-types after it is published export const LightningOnchainWithdrawParams = t.intersection([ - // LightningOnchainRequest, + LightningOnchainRequest, t.type({ - recipients: t.array(LightningOnchainRecipient), - satsPerVbyte: BigIntFromString, passphrase: t.string, }), t.partial({