@uniswap/token-list-bridge-utils 0.1.1-beta.1 → 0.1.1-beta.2
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/arbitrum/gateway.d.ts +2 -0
- package/dist/{arb-token-lists/src/lib → arbitrum}/instantiate_bridge.d.ts +3 -4
- package/dist/constants/types.d.ts +30 -0
- package/dist/fixtures/index.d.ts +9 -0
- package/dist/providers/ArbitrumMappingProvider.d.ts +7 -6
- package/dist/providers/MappingProvider.d.ts +4 -2
- package/dist/providers/OptimismMappingProvider.d.ts +5 -4
- package/dist/providers/PolygonMappingProvider.d.ts +4 -2
- package/dist/providers/index.d.ts +2 -4
- package/dist/token-list-bridge-utils.cjs.development.js +324 -904
- 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 +326 -900
- package/dist/token-list-bridge-utils.esm.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/package.json +7 -4
- package/src/arbitrum/gateway.ts +25 -0
- package/src/{arb-token-lists/src/lib → arbitrum}/instantiate_bridge.ts +11 -15
- package/src/constants/types.ts +28 -0
- package/src/fixtures/index.ts +40 -5
- package/src/index.test.ts +60 -18
- package/src/index.ts +5 -7
- package/src/providers/ArbitrumMappingProvider.ts +31 -21
- package/src/providers/MappingProvider.ts +4 -2
- package/src/providers/OptimismMappingProvider.ts +21 -5
- package/src/providers/PolygonMappingProvider.ts +22 -114
- package/src/providers/index.ts +81 -2
- package/src/utils.ts +71 -1
- package/dist/arb-token-lists/server/app.d.ts +0 -1
- package/dist/arb-token-lists/src/lib/getClargs.d.ts +0 -8
- package/dist/arb-token-lists/src/lib/graph.d.ts +0 -2
- package/dist/arb-token-lists/src/lib/token_list_gen.d.ts +0 -23
- package/dist/arb-token-lists/src/lib/types.d.ts +0 -36
- package/dist/arb-token-lists/src/lib/utils.d.ts +0 -18
- package/dist/arb-token-lists/src/main.d.ts +0 -1
- package/src/arb-token-lists/.env.sample +0 -4
- package/src/arb-token-lists/.eslintrc.js +0 -43
- package/src/arb-token-lists/.gitignore +0 -4
- package/src/arb-token-lists/package.json +0 -40
- package/src/arb-token-lists/readme.md +0 -14
- package/src/arb-token-lists/server/app.ts +0 -21
- package/src/arb-token-lists/src/Assets/coingecko_uris.json +0 -5108
- package/src/arb-token-lists/src/Assets/logo_uris.json +0 -44
- package/src/arb-token-lists/src/WarningList/warningTokens.json +0 -290
- package/src/arb-token-lists/src/lib/getClargs.ts +0 -32
- package/src/arb-token-lists/src/lib/graph.ts +0 -116
- package/src/arb-token-lists/src/lib/token_list_gen.ts +0 -334
- package/src/arb-token-lists/src/lib/types.ts +0 -44
- package/src/arb-token-lists/src/lib/utils.ts +0 -285
- package/src/arb-token-lists/src/main.ts +0 -54
- package/src/arb-token-lists/tsconfig.json +0 -20
- package/src/arb-token-lists/update_all +0 -6
- package/src/arb-token-lists/yarn.lock +0 -4273
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { providers } from 'ethers';
|
|
2
|
-
import { MultiCaller
|
|
2
|
+
import { MultiCaller } from '@arbitrum/sdk';
|
|
3
3
|
export declare const getNetworkConfig: () => Promise<{
|
|
4
4
|
l1: {
|
|
5
|
-
network: import("
|
|
5
|
+
network: import("@arbitrum/sdk").L1Network;
|
|
6
6
|
provider: providers.JsonRpcProvider;
|
|
7
7
|
multiCaller: MultiCaller;
|
|
8
8
|
};
|
|
9
9
|
l2: {
|
|
10
|
-
network: import("
|
|
10
|
+
network: import("@arbitrum/sdk").L2Network;
|
|
11
11
|
provider: providers.JsonRpcProvider;
|
|
12
12
|
multiCaller: MultiCaller;
|
|
13
13
|
};
|
|
14
|
-
tokenBridger: TokenBridger;
|
|
15
14
|
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface PolygonMappedToken {
|
|
2
|
+
chainId: number;
|
|
3
|
+
child_address_passed_by_user: boolean;
|
|
4
|
+
child_token: string;
|
|
5
|
+
count: number;
|
|
6
|
+
created_at: string;
|
|
7
|
+
decimals: number;
|
|
8
|
+
deleted: boolean;
|
|
9
|
+
id: number;
|
|
10
|
+
map_type: 'POS';
|
|
11
|
+
mintable: boolean;
|
|
12
|
+
name: string;
|
|
13
|
+
new_child_token: string;
|
|
14
|
+
new_mintable: boolean;
|
|
15
|
+
owner: string;
|
|
16
|
+
reason: string;
|
|
17
|
+
reason_for_remapping: string;
|
|
18
|
+
remapping_allowed: boolean;
|
|
19
|
+
remapping_request_submitted: boolean;
|
|
20
|
+
remapping_verified: boolean;
|
|
21
|
+
root_token: string;
|
|
22
|
+
status: number;
|
|
23
|
+
symbol: string;
|
|
24
|
+
token_type: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
uri: string;
|
|
27
|
+
}
|
|
28
|
+
export declare type PolygonMappedTokenData = {
|
|
29
|
+
[key: string]: PolygonMappedToken;
|
|
30
|
+
};
|
package/dist/fixtures/index.d.ts
CHANGED
|
@@ -22,3 +22,12 @@ export declare const polygonedSampleTokenList: {
|
|
|
22
22
|
tags?: import("@uniswap/token-lists").Tags | undefined;
|
|
23
23
|
logoURI?: string | undefined;
|
|
24
24
|
};
|
|
25
|
+
export declare const optimizedSampleTokenList: {
|
|
26
|
+
name: string;
|
|
27
|
+
tokens: TokenInfo[];
|
|
28
|
+
timestamp: string;
|
|
29
|
+
version: import("@uniswap/token-lists").Version;
|
|
30
|
+
keywords?: string[] | undefined;
|
|
31
|
+
tags?: import("@uniswap/token-lists").Tags | undefined;
|
|
32
|
+
logoURI?: string | undefined;
|
|
33
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { TokenList } from '@uniswap/token-lists';
|
|
2
1
|
import { MappingProvider } from './MappingProvider';
|
|
2
|
+
import { TokenList } from '@uniswap/token-lists';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* token list.
|
|
6
|
-
*
|
|
7
|
-
* The provider simply invokes this package which we host as a submodule.
|
|
4
|
+
* This provider provides the l1->l2(Arbitrum) address mappings using the arbitrum SDK.
|
|
8
5
|
*/
|
|
9
6
|
export declare class ArbitrumMappingProvider implements MappingProvider {
|
|
10
|
-
|
|
7
|
+
l1TokenList: TokenList;
|
|
8
|
+
constructor(l1TokenList: TokenList);
|
|
9
|
+
provide(): Promise<{
|
|
10
|
+
[key: string]: string | undefined;
|
|
11
|
+
}>;
|
|
11
12
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PolygonMappedTokenData } from '../constants/types';
|
|
2
2
|
export interface MappingProvider {
|
|
3
|
-
provide(
|
|
3
|
+
provide(): Promise<PolygonMappedTokenData | {
|
|
4
|
+
[key: string]: string | undefined;
|
|
5
|
+
}>;
|
|
4
6
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TokenList } from '@uniswap/token-lists';
|
|
2
1
|
import { MappingProvider } from './MappingProvider';
|
|
3
2
|
/**
|
|
4
|
-
* The Optimism L2 mapping is manually maintained by the Optimism team.
|
|
3
|
+
* The Optimism L2 mapping (linked above) is manually maintained by the Optimism team.
|
|
5
4
|
*
|
|
6
|
-
* This provider
|
|
5
|
+
* This provider provides the l1->l2(Optimism) token mappings.
|
|
7
6
|
*/
|
|
8
7
|
export declare class OptimismMappingProvider implements MappingProvider {
|
|
9
|
-
provide(
|
|
8
|
+
provide(): Promise<{
|
|
9
|
+
[key: string]: string | undefined;
|
|
10
|
+
}>;
|
|
10
11
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TokenList } from '@uniswap/token-lists';
|
|
2
1
|
import { MappingProvider } from './MappingProvider';
|
|
2
|
+
import { PolygonMappedTokenData } from '../constants/types';
|
|
3
3
|
/**
|
|
4
4
|
* The Polygon team manually maintains the mapping via user submissions at
|
|
5
5
|
* https://mapper.polygon.technology.
|
|
6
|
+
*
|
|
7
|
+
* This provider provides the l1->l2(Polygon) token mappings.
|
|
6
8
|
*/
|
|
7
9
|
export declare class PolygonMappingProvider implements MappingProvider {
|
|
8
|
-
provide(
|
|
10
|
+
provide(): Promise<PolygonMappedTokenData>;
|
|
9
11
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { ChainId } from '../constants/chainId';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { PolygonMappingProvider } from './PolygonMappingProvider';
|
|
5
|
-
export declare function getMappingProvider(chainId: ChainId): ArbitrumMappingProvider | OptimismMappingProvider | PolygonMappingProvider;
|
|
2
|
+
import { TokenList } from '@uniswap/token-lists';
|
|
3
|
+
export declare function buildList(chainId: ChainId, l1TokenList: TokenList): Promise<TokenList>;
|