1 | import { TokenInfo } from './types';
|
2 | export declare type TokenInfoChangeKey = Exclude<keyof TokenInfo, 'address' | 'chainId'>;
|
3 | export declare type TokenInfoChanges = Array<TokenInfoChangeKey>;
|
4 | /**
|
5 | * Differences between a base list and an updated list.
|
6 | */
|
7 | export interface TokenListDiff {
|
8 | /**
|
9 | * Tokens from updated with chainId/address not present in base list
|
10 | */
|
11 | readonly added: TokenInfo[];
|
12 | /**
|
13 | * Tokens from base with chainId/address not present in the updated list
|
14 | */
|
15 | readonly removed: TokenInfo[];
|
16 | /**
|
17 | * The token info that changed
|
18 | */
|
19 | readonly changed: {
|
20 | [chainId: number]: {
|
21 | [address: string]: TokenInfoChanges;
|
22 | };
|
23 | };
|
24 | }
|
25 | /**
|
26 | * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
|
27 | * @param base base list
|
28 | * @param update updated list
|
29 | */
|
30 | export declare function diffTokenLists(base: TokenInfo[], update: TokenInfo[]): TokenListDiff;
|