Skip to content

Commit

Permalink
add signing account
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Jun 20, 2024
1 parent 4f58cf2 commit 9eda592
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions resources/js/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export class ApiService {
variables: {
recipient: transferBalanceData.recipient,
amount: transferBalanceData.amount,
signingAccount: transferBalanceData.signingAccount,
keepAlive: transferBalanceData.keepAlive,
idempotencyKey: transferBalanceData.idempotencyKey,
skipValidation: transferBalanceData.skipValidation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
required
:prefix="currencySymbol"
/>
<FormInput
v-model="signingAccount"
name="signingAccount"
label="Signing Account"
description="The signing wallet for this transaction. Defaults to wallet daemon."
tooltip="Wallet Address"
/>
<FormInput
v-if="useAppStore().advanced"
v-model="idempotencyKey"
Expand Down Expand Up @@ -76,6 +83,7 @@ import snackbar from '~/util/snackbar';
import { currencySymbolByNetwork, formatData, formatPriceToENJ, snackbarErrors } from '~/util';
import { useAppStore } from '~/store';
import {
addressNotRequiredSchema,
addressRequiredSchema,
booleanNotRequiredSchema,
numberRequiredSchema,
Expand All @@ -87,6 +95,7 @@ const emit = defineEmits(['close']);
const isLoading = ref(false);
const recipient = ref('');
const amount = ref('');
const signingAccount = ref('');
const idempotencyKey = ref('');
const keepAlive = ref(false);
const skipValidation = ref(false);
Expand All @@ -97,6 +106,7 @@ const currencySymbol = computed(() => currencySymbolByNetwork(useAppStore().conf
const validation = yup.object({
recipient: addressRequiredSchema,
amount: numberRequiredSchema.typeError('Amount must be a number').min(0),
signingAccount: addressNotRequiredSchema,
idempotencyKey: stringNotRequiredSchema,
keepALive: booleanNotRequiredSchema,
skipValidation: booleanNotRequiredSchema,
Expand All @@ -121,6 +131,7 @@ const transfer = async () => {
formatData({
recipient: recipient.value,
amount: formatPriceToENJ(amount.value) ?? null,
signingAccount: signingAccount.value,
keepAlive: keepAlive.value,
idempotencyKey: idempotencyKey.value,
skipValidation: skipValidation.value,
Expand Down
3 changes: 2 additions & 1 deletion resources/js/graphql/mutation/TransferBalance.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default `mutation TransferBalance($recipient: String!, $amount: BigInt!, $keepAlive: Boolean = false, $idempotencyKey: String, $skipValidation: Boolean = false) {
export default `mutation TransferBalance($recipient: String!, $amount: BigInt!, $signingAccount: String, $keepAlive: Boolean = false, $idempotencyKey: String, $skipValidation: Boolean = false) {
TransferBalance(
recipient: $recipient
amount: $amount
signingAccount: $signingAccount
keepAlive: $keepAlive
idempotencyKey: $idempotencyKey
skipValidation: $skipValidation
Expand Down

0 comments on commit 9eda592

Please sign in to comment.