forked from Alethio/explorer-core-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
accountContractModule.ts
29 lines (24 loc) · 1.04 KB
/
accountContractModule.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { IModuleDef } from "plugin-api/IModuleDef";
import { IAccountContext } from "app/shared/context/IAccountContext";
import { IAccountDetails } from "app/eth-lite/data/account/IAccountDetails";
import { Contract, IContractProps } from "app/shared/module/account/lite/component/Contract";
import { AlethioAdapterType } from "app/shared/adapter/AlethioAdapterType";
import { accountContextType } from "app/shared/context/accountContextType";
export const accountContractModule: IModuleDef<IContractProps, IAccountContext> = {
contextType: accountContextType,
dataAdapters: [{
ref: AlethioAdapterType.AccountDetailsLite
}],
getContentComponent: async () => Contract,
getContentProps(data) {
let { translation, logger, locale, asyncData } = data;
let accountDetails = asyncData.get(AlethioAdapterType.AccountDetailsLite)!.data as IAccountDetails;
let props: IContractProps = {
accountDetails,
locale,
logger,
translation
};
return props;
}
};