Skip to content
Snippets Groups Projects
Verified Commit 7b203da5 authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll:
Browse files

Allow broadcasting signed transaction

parent 69faf1e5
No related branches found
No related tags found
No related merge requests found
Pipeline #117629 passed
......@@ -87,6 +87,7 @@ const updateAuthority = async() => {
<Input id="updateAuthority_ownerKey" placeholder="Nothing to add" v-model="ownerKey" class="my-2" />
</div>
<Button class="my-2" @click="updateAuthority">Update Authority</Button>
<p>Note: By clicking the above button, the transaction will be created, signed, and broadcasted immediately to the mainnet chain</p>
</div>
</CardContent>
</Card>
......
......@@ -168,6 +168,7 @@ const createAccount = async() => {
</div>
</RadioGroup>
<Button @click="createAccount">Create account</Button>
<p>Note: By clicking the above button, the transaction will be created, signed, and broadcasted immediately to the mainnet chain</p>
</div>
</CardContent>
</Card>
......
......@@ -36,6 +36,15 @@ const sign = async () => {
outputData.value = await wallet.value!.signTransaction(tx, authorityLevel);
};
const broadcast = async () => {
const wax = await getWax();
const tx = wax.createTransactionFromJson(inputData.value);
tx.sign(outputData.value);
wax.broadcast(tx);
};
onMounted(() => {
inputData.value = decodeURIComponent(atob(router.currentRoute.value.query.data as string ?? ''));
});
......@@ -55,7 +64,10 @@ onMounted(() => {
<div class="my-4 space-x-4">
<Button :disabled="!hasWallet" @click="sign">Sign transaction</Button>
</div>
<Textarea v-model="outputData" placeholder="Signed Transaction output" copy-enabled class="my-4" disabled/>
<Textarea v-model="outputData" placeholder="Signature" copy-enabled class="my-4" disabled/>
<div class="my-4 space-x-4">
<Button :disabled="!outputData" @click="broadcast">Broadcast signed transaction</Button>
</div>
</CardContent>
</Card>
</template>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment