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

also return the response after onFinish #38

Closed
wants to merge 0 commits into from

Conversation

devlz303
Copy link

@devlz303 devlz303 commented Sep 24, 2023

Instead of (only) using the onFinish also return the response so you don't have to use the onFinish / onCancel callbacks and you can just await the response.

For example:

const signPsbtOptions = {
  payload: {
    network: {
      type:'Mainnet'
    },
    message: 'Sign Transaction',
    psbtBase64: `cHNidP8BAJwCAmO+JvQJxhVDDpm3tV5PmPfzvJOSL4GOdjEOpAAAAAAnrAAA==`,
    broadcast: false,
    inputsToSign: [{
        address: "33TKH4kkiFPyTLDNmdNsLggyLeAYre57Qm",
        signingIndexes: [1],
    }],
  },
}

const response = await signTransaction(signPsbtOptions); // response is returned from signTransaction

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

Successfully merging this pull request may close these issues.

Difficult to use sats-connect with onFinish callback in async methods
1 participant