71
71
</template >
72
72
73
73
<script lang="ts">
74
- import nacl from ' tweetnacl' ;
75
74
import {
76
75
computed ,
77
76
defineComponent ,
@@ -83,11 +82,12 @@ import { Field } from 'vee-validate';
83
82
import {
84
83
AE_AMOUNT_FORMATS ,
85
84
encode ,
86
- getAddressFromPriv ,
87
85
Encoding ,
88
86
} from ' @aeternity/aepp-sdk' ;
89
87
import { useStore } from ' vuex' ;
90
88
import { useRouter } from ' vue-router' ;
89
+
90
+ import { getAccountFromSecret } from ' @/protocols/aeternity/helpers' ;
91
91
import type { IFormModel } from ' @/types' ;
92
92
import { formatDate } from ' @/utils' ;
93
93
import {
@@ -96,6 +96,7 @@ import {
96
96
} from ' @/constants' ;
97
97
import { ROUTE_INVITE_CLAIM } from ' @/popup/router/routeNames' ;
98
98
import {
99
+ useAccounts ,
99
100
useBalances ,
100
101
useMaxAmount ,
101
102
useAeSdk ,
@@ -127,6 +128,7 @@ export default defineComponent({
127
128
const { marketData } = useCurrencies ({ store });
128
129
const { getAeSdk } = useAeSdk ({ store });
129
130
const { balance } = useBalances ({ store });
131
+ const { getLastActiveProtocolAccount } = useAccounts ({ store });
130
132
131
133
const formModel = ref <IFormModel >({
132
134
amount: ' ' ,
@@ -150,9 +152,7 @@ export default defineComponent({
150
152
);
151
153
});
152
154
153
- const address = computed (() => getAddressFromPriv (
154
- nacl .sign .keyPair .fromSeed (Buffer .from (props .secretKey )).secretKey ,
155
- ));
155
+ const address = computed (() => getAccountFromSecret (props .secretKey ).address );
156
156
157
157
function deleteItem() {
158
158
store .commit (' invites/delete' , props .secretKey );
@@ -172,7 +172,11 @@ export default defineComponent({
172
172
async function claim() {
173
173
emit (' loading' , true );
174
174
try {
175
- await store .dispatch (' invites/claim' , Buffer .from (props .secretKey ));
175
+ await store .dispatch (' invites/claim' , {
176
+ secretKey: Buffer .from (props .secretKey ),
177
+ recipientId: getLastActiveProtocolAccount (PROTOCOL_AETERNITY )?.address ,
178
+ isMax: true ,
179
+ });
176
180
await updateBalance ();
177
181
} catch (error ) {
178
182
if (await store .dispatch (' invites/handleNotEnoughFoundsError' , { error , isInviteError: true })) {
0 commit comments