@uniswap/token-list-bridge-utils 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abis/erc20.d.ts +3 -0
- package/dist/constants/chainId.d.ts +2 -1
- package/dist/constants/types.d.ts +3 -0
- package/dist/index.d.ts +2 -2
- package/dist/providers/ArbitrumMappingProvider.d.ts +2 -3
- package/dist/providers/MappingProvider.d.ts +2 -4
- package/dist/providers/OptimismMappingProvider.d.ts +2 -3
- package/dist/providers/index.d.ts +1 -1
- package/dist/token-list-bridge-utils.cjs.development.js +673 -237
- package/dist/token-list-bridge-utils.cjs.development.js.map +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js.map +1 -1
- package/dist/token-list-bridge-utils.esm.js +672 -237
- package/dist/token-list-bridge-utils.esm.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/package.json +4 -2
- package/src/abis/erc20.ts +226 -0
- package/src/arbitrum/set_rpc.ts +4 -3
- package/src/constants/chainId.ts +2 -0
- package/src/constants/types.ts +5 -1
- package/src/index.test.ts +3 -3
- package/src/index.ts +9 -15
- package/src/providers/ArbitrumMappingProvider.ts +2 -1
- package/src/providers/MappingProvider.ts +2 -2
- package/src/providers/OptimismMappingProvider.ts +2 -1
- package/src/providers/index.ts +167 -62
- package/src/utils.ts +28 -0
|
@@ -25,6 +25,9 @@ export interface PolygonMappedToken {
|
|
|
25
25
|
updated_at: string;
|
|
26
26
|
uri: string;
|
|
27
27
|
}
|
|
28
|
+
export declare type GenericMappedTokenData = {
|
|
29
|
+
[key: string]: string | undefined;
|
|
30
|
+
};
|
|
28
31
|
export declare type PolygonMappedTokenData = {
|
|
29
32
|
[key: string]: PolygonMappedToken;
|
|
30
33
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ import { TokenListOrFetchableTokenList } from './utils';
|
|
|
9
9
|
export declare function chainify(l1TokenListOrPathOrUrl: TokenListOrFetchableTokenList): Promise<TokenList>;
|
|
10
10
|
/**
|
|
11
11
|
* Given a network and a TokenList, returns the TokenList with `extensions` filled.
|
|
12
|
-
* @param
|
|
12
|
+
* @param l2ChainIds layer 2 chainIds to operate on
|
|
13
13
|
* @param l1TokenListOrPathOrUrl either an L1 TokenList object or a path/url to a TokenList
|
|
14
14
|
* @returns L1 TokenList with `extensions` filled for the given network
|
|
15
15
|
*/
|
|
16
|
-
export declare function chainifyTokenList(
|
|
16
|
+
export declare function chainifyTokenList(l2ChainIds: Array<ChainId>, l1TokenListOrPathOrUrl: TokenListOrFetchableTokenList): Promise<TokenList>;
|
|
17
17
|
/** Merges two token lists, resolving conflicts to primary list. */
|
|
18
18
|
export declare function mergeTokenLists(primary: TokenList, secondary: TokenList): TokenList;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { MappingProvider } from './MappingProvider';
|
|
2
2
|
import { TokenList } from '@uniswap/token-lists';
|
|
3
|
+
import { GenericMappedTokenData } from '../constants/types';
|
|
3
4
|
/**
|
|
4
5
|
* This provider provides the l1->l2(Arbitrum) address mappings using the arbitrum SDK.
|
|
5
6
|
*/
|
|
6
7
|
export declare class ArbitrumMappingProvider implements MappingProvider {
|
|
7
8
|
l1TokenList: TokenList;
|
|
8
9
|
constructor(l1TokenList: TokenList);
|
|
9
|
-
provide(): Promise<
|
|
10
|
-
[key: string]: string | undefined;
|
|
11
|
-
}>;
|
|
10
|
+
provide(): Promise<GenericMappedTokenData>;
|
|
12
11
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { PolygonMappedTokenData } from '../constants/types';
|
|
1
|
+
import { GenericMappedTokenData, PolygonMappedTokenData } from '../constants/types';
|
|
2
2
|
export interface MappingProvider {
|
|
3
|
-
provide(): Promise<PolygonMappedTokenData |
|
|
4
|
-
[key: string]: string | undefined;
|
|
5
|
-
}>;
|
|
3
|
+
provide(): Promise<PolygonMappedTokenData | GenericMappedTokenData>;
|
|
6
4
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { MappingProvider } from './MappingProvider';
|
|
2
|
+
import { GenericMappedTokenData } from '../constants/types';
|
|
2
3
|
/**
|
|
3
4
|
* The Optimism L2 mapping (linked above) is manually maintained by the Optimism team.
|
|
4
5
|
*
|
|
5
6
|
* This provider provides the l1->l2(Optimism) token mappings.
|
|
6
7
|
*/
|
|
7
8
|
export declare class OptimismMappingProvider implements MappingProvider {
|
|
8
|
-
provide(): Promise<
|
|
9
|
-
[key: string]: string | undefined;
|
|
10
|
-
}>;
|
|
9
|
+
provide(): Promise<GenericMappedTokenData>;
|
|
11
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChainId } from '../constants/chainId';
|
|
2
2
|
import { TokenList } from '@uniswap/token-lists';
|
|
3
|
-
export declare function buildList(
|
|
3
|
+
export declare function buildList(l2ChainIds: Array<ChainId>, l1TokenList: TokenList): Promise<TokenList>;
|