@talismn/chaindata-provider 1.0.1 → 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.
Files changed (31) hide show
  1. package/dist/declarations/src/chaindata/index.d.ts +1 -0
  2. package/dist/declarations/src/chaindata/networks/EthNetwork.d.ts +4 -4
  3. package/dist/declarations/src/chaindata/networks/Network.d.ts +29 -4
  4. package/dist/declarations/src/chaindata/networks/SolNetwork.d.ts +35 -0
  5. package/dist/declarations/src/chaindata/networks/index.d.ts +1 -0
  6. package/dist/declarations/src/chaindata/shared/SolanaAddress.d.ts +3 -0
  7. package/dist/declarations/src/chaindata/shared/index.d.ts +1 -0
  8. package/dist/declarations/src/chaindata/tokens/SolNativeToken.d.ts +28 -0
  9. package/dist/declarations/src/chaindata/tokens/SolSplToken.d.ts +30 -0
  10. package/dist/declarations/src/chaindata/tokens/Token.d.ts +113 -1
  11. package/dist/declarations/src/chaindata/tokens/index.d.ts +2 -0
  12. package/dist/declarations/src/chaindata/utils.d.ts +48 -1
  13. package/dist/declarations/src/constants.d.ts +2 -2
  14. package/dist/declarations/src/getBlockExplorerUrls.d.ts +24 -0
  15. package/dist/declarations/src/index.d.ts +8 -3
  16. package/dist/declarations/src/provider/ChaindataProvider.d.ts +79 -12
  17. package/dist/declarations/src/state/combinedChaindata.d.ts +11 -0
  18. package/dist/declarations/src/state/defaultChaindata.d.ts +59 -3
  19. package/dist/declarations/src/state/githubChaindata.d.ts +303 -0
  20. package/dist/declarations/src/state/net.d.ts +57 -2
  21. package/dist/declarations/src/state/oldDb.d.ts +1 -0
  22. package/dist/declarations/src/state/schema.d.ts +220 -8
  23. package/dist/talismn-chaindata-provider.cjs.dev.js +1051 -777
  24. package/dist/talismn-chaindata-provider.cjs.prod.js +1051 -777
  25. package/dist/talismn-chaindata-provider.esm.js +1039 -781
  26. package/package.json +8 -8
  27. package/dist/declarations/src/legacy/index.d.ts +0 -3
  28. package/dist/declarations/src/provider/index.d.ts +0 -2
  29. package/dist/declarations/src/state/db.d.ts +0 -11
  30. package/dist/declarations/src/state/index.d.ts +0 -2
  31. package/dist/declarations/src/upgrades/index.d.ts +0 -1
@@ -1,5 +1,6 @@
1
- import { Observable } from "rxjs";
2
- export declare const defaultChaindata$: Observable<{
1
+ import { Observable, Subject } from "rxjs";
2
+ import { ChaindataStorage } from "../provider/ChaindataProvider";
3
+ export declare const getDefaultChaindata$: (storage$: Subject<ChaindataStorage>) => Observable<{
3
4
  networks: ({
4
5
  id: string;
5
6
  name: string;
@@ -84,12 +85,40 @@ export declare const defaultChaindata$: Observable<{
84
85
  type: "scroll";
85
86
  l1GasPriceOracle: `0x${string}`;
86
87
  } | undefined;
87
- contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
88
+ contracts?: {
89
+ Erc20Aggregator?: `0x${string}` | undefined;
90
+ Multicall3?: `0x${string}` | undefined;
91
+ } | undefined;
88
92
  balancesConfig?: {
89
93
  "evm-native"?: undefined;
90
94
  "evm-erc20"?: undefined;
91
95
  "evm-uniswapv2"?: undefined;
92
96
  } | undefined;
97
+ } | {
98
+ id: string;
99
+ name: string;
100
+ nativeTokenId: string;
101
+ nativeCurrency: {
102
+ decimals: number;
103
+ symbol: string;
104
+ name: string;
105
+ coingeckoId?: string | undefined;
106
+ mirrorOf?: string | undefined;
107
+ logo?: string | undefined;
108
+ };
109
+ blockExplorerUrls: string[];
110
+ platform: "solana";
111
+ genesisHash: string;
112
+ rpcs: string[];
113
+ isTestnet?: boolean | undefined;
114
+ isDefault?: boolean | undefined;
115
+ forceScan?: boolean | undefined;
116
+ logo?: string | undefined;
117
+ themeColor?: string | undefined;
118
+ balancesConfig?: {
119
+ "sol-native"?: undefined;
120
+ "sol-spl"?: undefined;
121
+ } | undefined;
93
122
  })[];
94
123
  tokens: ({
95
124
  id: string;
@@ -235,6 +264,33 @@ export declare const defaultChaindata$: Observable<{
235
264
  coingeckoId?: string | undefined;
236
265
  noDiscovery?: boolean | undefined;
237
266
  mirrorOf?: string | undefined;
267
+ } | {
268
+ id: string;
269
+ networkId: string;
270
+ decimals: number;
271
+ symbol: string;
272
+ type: "sol-native";
273
+ platform: "solana";
274
+ isDefault?: boolean | undefined;
275
+ name?: string | undefined;
276
+ logo?: string | undefined;
277
+ coingeckoId?: string | undefined;
278
+ noDiscovery?: boolean | undefined;
279
+ mirrorOf?: string | undefined;
280
+ } | {
281
+ id: string;
282
+ networkId: string;
283
+ decimals: number;
284
+ symbol: string;
285
+ type: "sol-spl";
286
+ platform: "solana";
287
+ mintAddress: string;
288
+ isDefault?: boolean | undefined;
289
+ name?: string | undefined;
290
+ logo?: string | undefined;
291
+ coingeckoId?: string | undefined;
292
+ noDiscovery?: boolean | undefined;
293
+ mirrorOf?: string | undefined;
238
294
  })[];
239
295
  miniMetadatas: {
240
296
  id: string;
@@ -0,0 +1,303 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const githubChaindata$: Observable<{
3
+ networks: ({
4
+ id: string;
5
+ name: string;
6
+ nativeTokenId: string;
7
+ nativeCurrency: {
8
+ decimals: number;
9
+ symbol: string;
10
+ name: string;
11
+ coingeckoId?: string | undefined;
12
+ mirrorOf?: string | undefined;
13
+ logo?: string | undefined;
14
+ };
15
+ blockExplorerUrls: string[];
16
+ genesisHash: `0x${string}`;
17
+ platform: "polkadot";
18
+ chainName: string;
19
+ specName: string;
20
+ specVersion: number;
21
+ account: "secp256k1" | "*25519";
22
+ prefix: number;
23
+ rpcs: string[];
24
+ topology: {
25
+ type: "standalone";
26
+ } | {
27
+ type: "relay";
28
+ } | {
29
+ type: "parachain";
30
+ relayId: string;
31
+ paraId: number;
32
+ };
33
+ isTestnet?: boolean | undefined;
34
+ isDefault?: boolean | undefined;
35
+ forceScan?: boolean | undefined;
36
+ logo?: string | undefined;
37
+ themeColor?: string | undefined;
38
+ chainspecQrUrl?: string | undefined;
39
+ latestMetadataQrUrl?: string | undefined;
40
+ oldPrefix?: number | undefined;
41
+ registryTypes?: any;
42
+ signedExtensions?: any;
43
+ hasCheckMetadataHash?: boolean | undefined;
44
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
45
+ isUnknownFeeToken?: boolean | undefined;
46
+ balancesConfig?: {
47
+ "substrate-native"?: {
48
+ disable?: boolean | undefined;
49
+ } | undefined;
50
+ "substrate-assets"?: undefined;
51
+ "substrate-psp22"?: undefined;
52
+ "substrate-tokens"?: {
53
+ palletId?: string | undefined;
54
+ } | undefined;
55
+ "substrate-foreignassets"?: undefined;
56
+ "substrate-hydration"?: undefined;
57
+ } | undefined;
58
+ } | {
59
+ id: string;
60
+ name: string;
61
+ nativeTokenId: string;
62
+ nativeCurrency: {
63
+ decimals: number;
64
+ symbol: string;
65
+ name: string;
66
+ coingeckoId?: string | undefined;
67
+ mirrorOf?: string | undefined;
68
+ logo?: string | undefined;
69
+ };
70
+ blockExplorerUrls: string[];
71
+ platform: "ethereum";
72
+ rpcs: string[];
73
+ isTestnet?: boolean | undefined;
74
+ isDefault?: boolean | undefined;
75
+ forceScan?: boolean | undefined;
76
+ logo?: string | undefined;
77
+ themeColor?: string | undefined;
78
+ substrateChainId?: string | undefined;
79
+ preserveGasEstimate?: boolean | undefined;
80
+ feeType?: "legacy" | "eip-1559" | undefined;
81
+ l2FeeType?: {
82
+ type: "op-stack";
83
+ } | {
84
+ type: "scroll";
85
+ l1GasPriceOracle: `0x${string}`;
86
+ } | undefined;
87
+ contracts?: {
88
+ Erc20Aggregator?: `0x${string}` | undefined;
89
+ Multicall3?: `0x${string}` | undefined;
90
+ } | undefined;
91
+ balancesConfig?: {
92
+ "evm-native"?: undefined;
93
+ "evm-erc20"?: undefined;
94
+ "evm-uniswapv2"?: undefined;
95
+ } | undefined;
96
+ } | {
97
+ id: string;
98
+ name: string;
99
+ nativeTokenId: string;
100
+ nativeCurrency: {
101
+ decimals: number;
102
+ symbol: string;
103
+ name: string;
104
+ coingeckoId?: string | undefined;
105
+ mirrorOf?: string | undefined;
106
+ logo?: string | undefined;
107
+ };
108
+ blockExplorerUrls: string[];
109
+ platform: "solana";
110
+ genesisHash: string;
111
+ rpcs: string[];
112
+ isTestnet?: boolean | undefined;
113
+ isDefault?: boolean | undefined;
114
+ forceScan?: boolean | undefined;
115
+ logo?: string | undefined;
116
+ themeColor?: string | undefined;
117
+ balancesConfig?: {
118
+ "sol-native"?: undefined;
119
+ "sol-spl"?: undefined;
120
+ } | undefined;
121
+ })[];
122
+ tokens: ({
123
+ id: string;
124
+ networkId: string;
125
+ decimals: number;
126
+ symbol: string;
127
+ type: "evm-erc20";
128
+ platform: "ethereum";
129
+ contractAddress: `0x${string}`;
130
+ isDefault?: boolean | undefined;
131
+ name?: string | undefined;
132
+ logo?: string | undefined;
133
+ coingeckoId?: string | undefined;
134
+ noDiscovery?: boolean | undefined;
135
+ mirrorOf?: string | undefined;
136
+ } | {
137
+ id: string;
138
+ networkId: string;
139
+ decimals: number;
140
+ symbol: string;
141
+ type: "evm-native";
142
+ platform: "ethereum";
143
+ isDefault?: boolean | undefined;
144
+ name?: string | undefined;
145
+ logo?: string | undefined;
146
+ coingeckoId?: string | undefined;
147
+ noDiscovery?: boolean | undefined;
148
+ mirrorOf?: string | undefined;
149
+ } | {
150
+ id: string;
151
+ networkId: string;
152
+ decimals: number;
153
+ symbol: string;
154
+ type: "evm-uniswapv2";
155
+ platform: "ethereum";
156
+ contractAddress: `0x${string}`;
157
+ symbol0: string;
158
+ symbol1: string;
159
+ decimals0: number;
160
+ decimals1: number;
161
+ tokenAddress0: `0x${string}`;
162
+ tokenAddress1: `0x${string}`;
163
+ isDefault?: boolean | undefined;
164
+ name?: string | undefined;
165
+ logo?: string | undefined;
166
+ coingeckoId?: string | undefined;
167
+ noDiscovery?: boolean | undefined;
168
+ mirrorOf?: string | undefined;
169
+ isCustom?: boolean | undefined;
170
+ coingeckoId0?: string | undefined;
171
+ coingeckoId1?: string | undefined;
172
+ } | {
173
+ id: string;
174
+ networkId: string;
175
+ decimals: number;
176
+ symbol: string;
177
+ type: "substrate-assets";
178
+ platform: "polkadot";
179
+ assetId: string;
180
+ isSufficient: boolean;
181
+ existentialDeposit: string;
182
+ isDefault?: boolean | undefined;
183
+ name?: string | undefined;
184
+ logo?: string | undefined;
185
+ coingeckoId?: string | undefined;
186
+ noDiscovery?: boolean | undefined;
187
+ mirrorOf?: string | undefined;
188
+ isFrozen?: boolean | undefined;
189
+ } | {
190
+ id: string;
191
+ networkId: string;
192
+ decimals: number;
193
+ symbol: string;
194
+ type: "substrate-foreignassets";
195
+ platform: "polkadot";
196
+ onChainId: string;
197
+ isSufficient: boolean;
198
+ existentialDeposit: string;
199
+ isDefault?: boolean | undefined;
200
+ name?: string | undefined;
201
+ logo?: string | undefined;
202
+ coingeckoId?: string | undefined;
203
+ noDiscovery?: boolean | undefined;
204
+ mirrorOf?: string | undefined;
205
+ isFrozen?: boolean | undefined;
206
+ } | {
207
+ id: string;
208
+ networkId: string;
209
+ decimals: number;
210
+ symbol: string;
211
+ type: "substrate-native";
212
+ platform: "polkadot";
213
+ existentialDeposit: string;
214
+ isDefault?: boolean | undefined;
215
+ name?: string | undefined;
216
+ logo?: string | undefined;
217
+ coingeckoId?: string | undefined;
218
+ noDiscovery?: boolean | undefined;
219
+ mirrorOf?: string | undefined;
220
+ } | {
221
+ id: string;
222
+ networkId: string;
223
+ decimals: number;
224
+ symbol: string;
225
+ type: "substrate-psp22";
226
+ platform: "polkadot";
227
+ contractAddress: string;
228
+ isDefault?: boolean | undefined;
229
+ name?: string | undefined;
230
+ logo?: string | undefined;
231
+ coingeckoId?: string | undefined;
232
+ noDiscovery?: boolean | undefined;
233
+ mirrorOf?: string | undefined;
234
+ } | {
235
+ id: string;
236
+ networkId: string;
237
+ decimals: number;
238
+ symbol: string;
239
+ type: "substrate-tokens";
240
+ platform: "polkadot";
241
+ onChainId: string | number;
242
+ existentialDeposit: string;
243
+ isDefault?: boolean | undefined;
244
+ name?: string | undefined;
245
+ logo?: string | undefined;
246
+ coingeckoId?: string | undefined;
247
+ noDiscovery?: boolean | undefined;
248
+ mirrorOf?: string | undefined;
249
+ } | {
250
+ id: string;
251
+ networkId: string;
252
+ decimals: number;
253
+ symbol: string;
254
+ type: "substrate-hydration";
255
+ platform: "polkadot";
256
+ onChainId: number;
257
+ assetType: "Token" | "Erc20" | "External";
258
+ isSufficient: boolean;
259
+ existentialDeposit: string;
260
+ isDefault?: boolean | undefined;
261
+ name?: string | undefined;
262
+ logo?: string | undefined;
263
+ coingeckoId?: string | undefined;
264
+ noDiscovery?: boolean | undefined;
265
+ mirrorOf?: string | undefined;
266
+ } | {
267
+ id: string;
268
+ networkId: string;
269
+ decimals: number;
270
+ symbol: string;
271
+ type: "sol-native";
272
+ platform: "solana";
273
+ isDefault?: boolean | undefined;
274
+ name?: string | undefined;
275
+ logo?: string | undefined;
276
+ coingeckoId?: string | undefined;
277
+ noDiscovery?: boolean | undefined;
278
+ mirrorOf?: string | undefined;
279
+ } | {
280
+ id: string;
281
+ networkId: string;
282
+ decimals: number;
283
+ symbol: string;
284
+ type: "sol-spl";
285
+ platform: "solana";
286
+ mintAddress: string;
287
+ isDefault?: boolean | undefined;
288
+ name?: string | undefined;
289
+ logo?: string | undefined;
290
+ coingeckoId?: string | undefined;
291
+ noDiscovery?: boolean | undefined;
292
+ mirrorOf?: string | undefined;
293
+ })[];
294
+ miniMetadatas: {
295
+ id: string;
296
+ source: string;
297
+ chainId: string;
298
+ specVersion: number;
299
+ version: string;
300
+ data: `0x${string}` | null;
301
+ extra: any;
302
+ }[];
303
+ }>;
@@ -1,4 +1,4 @@
1
- export declare const CHAINDATA_CONSOLIDATED_URL = "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/pub/v4/chaindata.min.json";
1
+ export declare const CHAINDATA_CONSOLIDATED_URL = "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/pub/v5/chaindata.min.json";
2
2
  export declare const fetchChaindata: (signal?: AbortSignal) => Promise<{
3
3
  networks: ({
4
4
  id: string;
@@ -84,12 +84,40 @@ export declare const fetchChaindata: (signal?: AbortSignal) => Promise<{
84
84
  type: "scroll";
85
85
  l1GasPriceOracle: `0x${string}`;
86
86
  } | undefined;
87
- contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
87
+ contracts?: {
88
+ Erc20Aggregator?: `0x${string}` | undefined;
89
+ Multicall3?: `0x${string}` | undefined;
90
+ } | undefined;
88
91
  balancesConfig?: {
89
92
  "evm-native"?: undefined;
90
93
  "evm-erc20"?: undefined;
91
94
  "evm-uniswapv2"?: undefined;
92
95
  } | undefined;
96
+ } | {
97
+ id: string;
98
+ name: string;
99
+ nativeTokenId: string;
100
+ nativeCurrency: {
101
+ decimals: number;
102
+ symbol: string;
103
+ name: string;
104
+ coingeckoId?: string | undefined;
105
+ mirrorOf?: string | undefined;
106
+ logo?: string | undefined;
107
+ };
108
+ blockExplorerUrls: string[];
109
+ platform: "solana";
110
+ genesisHash: string;
111
+ rpcs: string[];
112
+ isTestnet?: boolean | undefined;
113
+ isDefault?: boolean | undefined;
114
+ forceScan?: boolean | undefined;
115
+ logo?: string | undefined;
116
+ themeColor?: string | undefined;
117
+ balancesConfig?: {
118
+ "sol-native"?: undefined;
119
+ "sol-spl"?: undefined;
120
+ } | undefined;
93
121
  })[];
94
122
  tokens: ({
95
123
  id: string;
@@ -235,6 +263,33 @@ export declare const fetchChaindata: (signal?: AbortSignal) => Promise<{
235
263
  coingeckoId?: string | undefined;
236
264
  noDiscovery?: boolean | undefined;
237
265
  mirrorOf?: string | undefined;
266
+ } | {
267
+ id: string;
268
+ networkId: string;
269
+ decimals: number;
270
+ symbol: string;
271
+ type: "sol-native";
272
+ platform: "solana";
273
+ isDefault?: boolean | undefined;
274
+ name?: string | undefined;
275
+ logo?: string | undefined;
276
+ coingeckoId?: string | undefined;
277
+ noDiscovery?: boolean | undefined;
278
+ mirrorOf?: string | undefined;
279
+ } | {
280
+ id: string;
281
+ networkId: string;
282
+ decimals: number;
283
+ symbol: string;
284
+ type: "sol-spl";
285
+ platform: "solana";
286
+ mintAddress: string;
287
+ isDefault?: boolean | undefined;
288
+ name?: string | undefined;
289
+ logo?: string | undefined;
290
+ coingeckoId?: string | undefined;
291
+ noDiscovery?: boolean | undefined;
292
+ mirrorOf?: string | undefined;
238
293
  })[];
239
294
  miniMetadatas: {
240
295
  id: string;
@@ -0,0 +1 @@
1
+ export declare const tryToDeleteOldChaindataDb: () => void;