version bump sk/awcp/parasite to add tx_sign_yesprop
There is now an explicit function to have superhero sign the transaction *and* propagate it into the network. JR will simply reject these requests.
This commit is contained in:
@@ -62,11 +62,17 @@
|
||||
<ol>
|
||||
<li><pre class="pv-spendtx-base64"></pre></li>
|
||||
</ol>
|
||||
<button id="sign-spendtx">Sign Transaction</button>
|
||||
|
||||
<button id="sign-spendtx">Sign Transaction but do not propagate</button>
|
||||
<h5>Result:</h5>
|
||||
<pre id="sign-spendtx-result"></pre>
|
||||
<h2>4.4 Propagate the transaction (parasite)</h2>
|
||||
<h2>4.5 Verify the transaction was propagated (parasite)</h2>
|
||||
|
||||
<br>
|
||||
<button id="sign-spendtx-prop">Sign Transaction and have superhero propagate transaction</button>
|
||||
<h5>Result:</h5>
|
||||
<pre id="sign-spendtx-prop-result"></pre>
|
||||
<h2>4.4 Propagate the transaction (parasite) FIXME</h2>
|
||||
<h2>4.5 Verify the transaction was propagated (parasite) FIXME</h2>
|
||||
|
||||
|
||||
<h1>5. Sign a message</h1>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{type, library}.
|
||||
{realm, local}.
|
||||
{name, sidekick_examples}.
|
||||
{version, "0.1.0"}.
|
||||
{deps, ["local-awcp-0.2.1",
|
||||
"local-parasite-0.2.0",
|
||||
"local-sidekick-0.2.1"]}.
|
||||
{version, "0.2.2"}.
|
||||
{deps, ["local-awcp-0.2.2",
|
||||
"local-parasite-0.2.2",
|
||||
"local-sidekick-0.2.2"]}.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as ae_node from './jex_include/local-parasite-0.2.0/dist/ae_node.js';
|
||||
import * as awcp from './jex_include/local-awcp-0.2.1/dist/awcp.js';
|
||||
import * as sk from './jex_include/local-sidekick-0.2.1/dist/sidekick.js';
|
||||
import * as ae_node from './jex_include/local-parasite-0.2.2/dist/ae_node.js';
|
||||
import * as awcp from './jex_include/local-awcp-0.2.2/dist/awcp.js';
|
||||
import * as sk from './jex_include/local-sidekick-0.2.2/dist/sidekick.js';
|
||||
|
||||
var pv_address: string;
|
||||
var pv_spendtx_base64: string;
|
||||
@@ -181,6 +181,7 @@ form_tx
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
async function
|
||||
sign_tx
|
||||
(logger: sk.Logger)
|
||||
@@ -197,6 +198,24 @@ sign_tx
|
||||
document.getElementById("sign-spendtx-result")!.innerHTML = JSON.stringify(signedTx, undefined, 4);
|
||||
}
|
||||
|
||||
|
||||
async function
|
||||
sign_tx_prop
|
||||
(logger: sk.Logger)
|
||||
: Promise<void>
|
||||
{
|
||||
let sign_params = {
|
||||
tx: pv_spendtx_base64,
|
||||
// returnsigned: false tells it to propagate the transaction
|
||||
// returnsigned: true just signs it and returns the signed tx back
|
||||
returnSigned: false as false,
|
||||
networkId: "ae_uat"
|
||||
};
|
||||
let signedTx = await sk.tx_sign_yesprop('sk-tx-sign-2', sign_params, sk.TIMEOUT_DEF_TX_SIGN_NOPROP_MS, 'sign transaction timed out', logger);
|
||||
document.getElementById("sign-spendtx-prop-result")!.innerHTML = JSON.stringify(signedTx, undefined, 4);
|
||||
}
|
||||
|
||||
|
||||
async function
|
||||
sign_msg
|
||||
(logger: sk.Logger)
|
||||
@@ -224,6 +243,7 @@ main
|
||||
document.getElementById('address')!.onclick = function() { address(logger); };
|
||||
document.getElementById('mk-spendtx')!.onclick = function() { form_tx(logger); };
|
||||
document.getElementById('sign-spendtx')!.onclick = function() { sign_tx(logger); };
|
||||
document.getElementById('sign-spendtx-prop')!.onclick = function() { sign_tx_prop(logger); };
|
||||
document.getElementById('sign-message')!.onclick = function() { sign_msg(logger); };
|
||||
|
||||
//set_pv_address("ak_2XhCkjzTwcq1coXSSzHJoMZkUzTwnjH88zmPGkkowUsFNTo9UE");
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import * as sk from './jex_include/local-sidekick-0.2.1/dist/sidekick.js';
|
||||
import * as sk from './jex_include/local-sidekick-0.2.2/dist/sidekick.js';
|
||||
|
||||
sk.hello();
|
||||
|
||||
Reference in New Issue
Block a user