Commit 7ce4ba87 authored by Daniel Edgecumbe's avatar Daniel Edgecumbe

frontend: Add submitPSBT

parent 8ad93c0e
...@@ -225,6 +225,14 @@ along with bitcoin-top. If not, see <http://www.gnu.org/licenses/>. ...@@ -225,6 +225,14 @@ along with bitcoin-top. If not, see <http://www.gnu.org/licenses/>.
v-on:input="submitCreatePSBT()" v-on:input="submitCreatePSBT()"
> >
</input> </input>
<input
v-if="wallet_createpsbt"
type="button"
v-on:click="submitSubmitPSBT()"
value="omg send"
>
</input>
</template> </template>
<template v-if="wallet_createpsbt"> <template v-if="wallet_createpsbt">
......
...@@ -188,6 +188,23 @@ onload = function() { ...@@ -188,6 +188,23 @@ onload = function() {
}, },
}, },
methods: { methods: {
submitSubmitPSBT: function() {
if (app.wallet_createpsbt === null) { return; }
let psbt = app.wallet_createpsbt.psbt;
if (psbt === null) { return; }
let tosend = psbt
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=/g, "");
let l = [
"submitpsbt",
tosend,
];
let request = l.join("/");
asyncRequest(request, dealWithSubmitPSBT);
},
submitCreatePSBT: function() { submitCreatePSBT: function() {
let l = [ let l = [
"createpsbt", "createpsbt",
...@@ -324,6 +341,10 @@ onload = function() { ...@@ -324,6 +341,10 @@ onload = function() {
asyncRequest(`nettotalsrange/${range}`, processAsyncResponse); asyncRequest(`nettotalsrange/${range}`, processAsyncResponse);
} }
let dealWithSubmitPSBT = function(r, j) {
console.log(j);
}
let dealWithCreatePSBT = function(r, j) { let dealWithCreatePSBT = function(r, j) {
// TODO: it should really be result, error // TODO: it should really be result, error
// so that we can nuke this on a bad // so that we can nuke this on a bad
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment