Skip to content

Commit 2ff6514

Browse files
committed
fix: display only multisig transactions on multisig token transaction details
1 parent 1530085 commit 2ff6514

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/popup/pages/FungibleTokens/TokenTransactions.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { computed, defineComponent, ref } from 'vue';
1212
import { useStore } from 'vuex';
1313
import type { ICommonTransaction, ITokenList, ITx } from '@/types';
1414
import { TXS_PER_PAGE } from '@/constants';
15-
import { useAccounts, useTransactionList } from '@/composables';
15+
import { useAccounts, useMultisigAccounts, useTransactionList } from '@/composables';
1616
import { useState } from '@/composables/vuex';
1717
import { AE_CONTRACT_ID } from '@/protocols/aeternity/config';
1818
import { getInnerTransaction } from '@/protocols/aeternity/helpers';
@@ -32,6 +32,7 @@ export default defineComponent({
3232
const store = useStore();
3333
3434
const { activeAccount } = useAccounts({ store });
35+
const { activeMultisigAccount } = useMultisigAccounts({ store });
3536
const {
3637
fetchTransactions,
3738
getAccountAllTransactions,
@@ -41,9 +42,14 @@ export default defineComponent({
4142
4243
const availableTokens = useState<ITokenList>('fungibleTokens', 'availableTokens');
4344
const tokensContractIds = computed((): string[] => Object.keys(availableTokens.value));
45+
const currentAddress = computed(
46+
() => (props.isMultisig)
47+
? activeMultisigAccount.value?.gaAccountId
48+
: activeAccount.value.address,
49+
);
4450
4551
const loadedTransactionList = computed(
46-
(): ICommonTransaction[] => getAccountAllTransactions(activeAccount.value.address!),
52+
(): ICommonTransaction[] => getAccountAllTransactions(currentAddress.value!),
4753
);
4854
4955
function isFungibleTokenTx(tx: ITx) {
@@ -75,7 +81,7 @@ export default defineComponent({
7581
await fetchTransactions(
7682
TXS_PER_PAGE,
7783
!!recent,
78-
activeAccount.value.address,
84+
currentAddress.value!,
7985
);
8086
} finally {
8187
loading.value = false;

src/types/index.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface IRequestInitBodyParsed extends Omit<RequestInit, 'body'> {
6464
body?: object;
6565
}
6666

67-
type GenericApiMethod<T = any> = (...args: any) => Promise<T>;
67+
type GenericApiMethod<T = any, U extends unknown[] = any> = (...args: U) => Promise<T>;
6868

6969
export type ResolveCallback = (...args: any) => void;
7070
export type RejectCallback = (error?: RejectedByUserError) => void;
@@ -503,6 +503,7 @@ export interface INameEntryFetched {
503503
/**
504504
* Middleware v1 autogenerated endpoints.
505505
* TODO: Update the list after migrating to v2.
506+
* @link https://testnet.aeternity.io/mdw/swagger/
506507
*/
507508
export interface IMiddleware {
508509
getActiveNames: GenericApiMethod;
@@ -522,7 +523,13 @@ export interface IMiddleware {
522523
getOracle: GenericApiMethod;
523524
getOracles: GenericApiMethod;
524525
getStatus: GenericApiMethod;
525-
getTxs: GenericApiMethod;
526+
getTxs: GenericApiMethod<any, [{
527+
account?: string;
528+
contract?: string;
529+
direction?: 'forward' | 'backward';
530+
limit?: number;
531+
[key: string]: any;
532+
}]>;
526533
getTx: (hash: string) => Promise<any>;
527534
getTxByIndex: GenericApiMethod;
528535
getTxCountById: GenericApiMethod;

0 commit comments

Comments
 (0)