/
types.ts
36 lines (32 loc) · 1.04 KB
/
types.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
30
31
32
33
34
35
36
import { providers } from 'ethers';
/** @group Ethereum Plugin */
export type EthereumPluginMethods = {
getEthereumAddress: () => string; // TODO is there a way for this to just be a property?
getBalance: (symbolOrAddress?: string) => Promise<string>;
getBalanceForAddress: (walletAddress: string, symbolOrAddress?: string) => Promise<string>;
transferTokens: (
tokenSymbolOrAddress: string,
amount: number,
toAddress: string
) => Promise<string>;
getCurrentNetwork: () => providers.Networkish;
changeNetwork: (network: providers.Networkish) => void;
addInfuraProjectId: (infuraProjectIdToAdd: string) => void;
};
/** @group Ethereum Plugin */
export type EthereumConfig = {
infuraProjectId?: string;
network?: providers.Networkish;
};
/** @group Ethereum Plugin */
export type Token = {
chainId: number;
address: string;
name: string;
symbol: string;
decimals: number;
logoURI: string;
extensions: any;
};
/** @group Ethereum Plugin */
export type TokenList = Token[];