Generate PSBTs from the greenfield API for hot and cold wallet #5477
Urban-Hacker
started this conversation in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be useful to have the ability to generate and sign PSBTs through the greenfield API. This seems to be mostly already available through the GUI but is not exposed.
1) Ability to generate from cold wallet
Currently if using /api/v1/stores/{storeId}/payment-methods/onchain/btc/wallet/transactions with a cold wallet the server will answer this cryptic message:
{"code":"not-available","message":"BTC sending services are not currently available"}
It should return a message telling its a cold wallet and the user must instead request a PSBT.
2) Add a flag to return a PSBT instead of the transaction itself.
"destinations":
[{}],
"feerate": 0,
"proceedWithPayjoin": true,
"proceedWithBroadcast": true,
"proceedWithPSBT":false,
"noChange": false,
"rbf": true,
"excludeUnconfirmed": false,
"selectedInputs":
["string"]
}
This would return the PSBT if set to true
3) Update the greenfield API to add the following:
Sign a PSBT:
/api/v1/stores/{storeId}/payment-methods/onchain/btc/wallet/transactions/PSBT/sign
Obviously this would only work if done on hot wallet. There would be the flag, "proceedWithBroadcast": true,
Update a PSBT:
/api/v1/stores/{storeId}/payment-methods/onchain/btc/wallet/transactions/PSBT/update
Combine a PSBT:
/api/v1/stores/{storeId}/payment-methods/onchain/btc/wallet/transactions/PSBT/combine
For coinjoin, batching transaction, or when using the balance of multiple stores
The reason why I want something like this is when you have 2 or 3 stores and you want to send an amount that is too large for the balance of one store only. This would enable to trivially create a PSBT for one wallet and update it on the second wallet to then sign it and broadcast it.
Beta Was this translation helpful? Give feedback.
All reactions