Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please export PsbtInputExtended and PsbtOutputExtended #2199

Open
koa202405 opened this issue Jan 22, 2025 · 2 comments
Open

Please export PsbtInputExtended and PsbtOutputExtended #2199

koa202405 opened this issue Jan 22, 2025 · 2 comments

Comments

@koa202405
Copy link

So that I can remove following code in my project

// Following types are not exported by BitcoinJS, so they need to be manually extracted
export type PsbtInputExtended = Parameters<
  typeof bitcoin.Psbt.prototype.addInput
>[0];

export type PsbtOutputExtended = Parameters<
  typeof bitcoin.Psbt.prototype.addOutput
>[0];
@jasonandjay
Copy link
Member

We need to evaluate it.
Is there any deeper reason?

@koa202405
Copy link
Author

koa202405 commented Jan 23, 2025

We need to evaluate it. Is there any deeper reason?

addInput and addOutput are public APIs, so I think you should export the public param types too.

I will use these types because I need to define functions like

function buildPsbtInput(...params: MyParams): PsbtInputExtended {
  // implementation
}

const input = buildPsbtInput(myParams);
psbt.addInput(input);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants