-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add sign multiple transactions api
- Loading branch information
1 parent
a04b133
commit 947e7d0
Showing
7 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { getAddress, getCurrentAccount, privateKey } from '../account' | ||
import connector from '../connector' | ||
import { signTransaction } from '../crypto' | ||
|
||
export async function process(params: any, host: string) { | ||
const wif = await getCurrentAccount().then((account) => privateKey.value) | ||
|
||
const signingTransactions = params.transactions | ||
|
||
const signatures = signingTransactions.map((transaction: any) => { | ||
const signature = signTransaction(wif, transaction) | ||
|
||
return signature | ||
}) | ||
|
||
return { signatures } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script lang="ts" setup> | ||
import { CheckBadgeIcon } from '@heroicons/vue/24/solid' | ||
import actions from '@/data/authorize-actions' | ||
const action = actions.SignTransactions | ||
const props = defineProps<{ | ||
params: { | ||
transactions: any | ||
} | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<h3 class="text-base font-bold">{{ action.title }}</h3> | ||
|
||
<ul class="mt-6 space-y-4"> | ||
<li v-for="access in action.description" class="flex items-start gap-x-2"> | ||
<CheckBadgeIcon class="h-6 w-6 text-primary-blue" /> | ||
<div class="text-sm text-gray-700">{{ access }}</div> | ||
</li> | ||
</ul> | ||
|
||
<!-- transactions count --> | ||
<div class="mt-6"> | ||
<div class="label">Transactions Count</div> | ||
<div class="value text-sm">{{ params.transactions.length }}</div> | ||
</div> | ||
</template> |