@talismn/balances 0.0.0-pr2043-20250703063531 → 0.0.0-pr2059-20250626001054

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 (46) hide show
  1. package/dist/declarations/src/BalanceModule.d.ts +12 -23
  2. package/dist/declarations/src/EvmTokenFetcher.d.ts +11 -0
  3. package/dist/declarations/src/MiniMetadataUpdater.d.ts +43 -0
  4. package/dist/declarations/src/index.d.ts +3 -0
  5. package/dist/declarations/src/modules/EvmErc20Module.d.ts +23 -20
  6. package/dist/declarations/src/modules/EvmNativeModule.d.ts +18 -19
  7. package/dist/declarations/src/modules/EvmUniswapV2Module.d.ts +30 -28
  8. package/dist/declarations/src/modules/SubstrateAssetsModule.d.ts +18 -20
  9. package/dist/declarations/src/modules/SubstrateEquilibriumModule.d.ts +39 -0
  10. package/dist/declarations/src/modules/SubstrateForeignAssetsModule.d.ts +18 -20
  11. package/dist/declarations/src/modules/SubstrateNativeModule/index.d.ts +4 -17
  12. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeCrowdloans.d.ts +5 -0
  13. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeNompoolStaking.d.ts +3 -3
  14. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeSubtensorStaking.d.ts +3 -3
  15. package/dist/declarations/src/modules/SubstrateNativeModule/types.d.ts +23 -6
  16. package/dist/declarations/src/modules/SubstrateNativeModule/util/QueryCache.d.ts +6 -6
  17. package/dist/declarations/src/modules/SubstrateNativeModule/util/buildQueries.d.ts +4 -5
  18. package/dist/declarations/src/modules/SubstrateNativeModule/util/crowdloanFundContributionsChildKey.d.ts +4 -0
  19. package/dist/declarations/src/modules/SubstrateNativeModule/util/detectMiniMetadataChanges.d.ts +2 -0
  20. package/dist/declarations/src/modules/SubstrateNativeModule/util/sortChains.d.ts +1 -1
  21. package/dist/declarations/src/modules/SubstratePsp22Module.d.ts +19 -20
  22. package/dist/declarations/src/modules/SubstrateTokensModule.d.ts +22 -22
  23. package/dist/declarations/src/modules/index.d.ts +38 -213
  24. package/dist/declarations/src/modules/util/InferBalanceModuleTypes.d.ts +3 -5
  25. package/dist/declarations/src/modules/util/buildStorageCoders.d.ts +7 -16
  26. package/dist/declarations/src/modules/util/findChainMeta.d.ts +8 -0
  27. package/dist/declarations/src/modules/util/getUniqueChainIds.d.ts +2 -2
  28. package/dist/declarations/src/modules/util/index.d.ts +1 -0
  29. package/dist/declarations/src/types/balances.d.ts +72 -203
  30. package/dist/declarations/src/types/balancetypes.d.ts +18 -8
  31. package/dist/declarations/src/types/minimetadatas.d.ts +24 -6
  32. package/dist/declarations/src/util/hydrateChaindata.d.ts +8 -0
  33. package/dist/declarations/src/util/index.d.ts +1 -0
  34. package/dist/talismn-balances.cjs.dev.js +2099 -1423
  35. package/dist/talismn-balances.cjs.prod.js +2099 -1423
  36. package/dist/talismn-balances.esm.js +2083 -1413
  37. package/package.json +10 -11
  38. package/dist/declarations/src/getMiniMetadata/getMetadataRpc.d.ts +0 -3
  39. package/dist/declarations/src/getMiniMetadata/getMiniMetadatas.d.ts +0 -4
  40. package/dist/declarations/src/getMiniMetadata/getSpecVersion.d.ts +0 -6
  41. package/dist/declarations/src/getMiniMetadata/getUpdatedMiniMetadatas.d.ts +0 -4
  42. package/dist/declarations/src/getMiniMetadata/index.d.ts +0 -5
  43. package/dist/declarations/src/libVersion.d.ts +0 -1
  44. package/dist/declarations/src/modules/SubstrateNativeModule/util/systemProperties.d.ts +0 -5
  45. package/dist/declarations/src/modules/util/getAddresssesByTokenByNetwork.d.ts +0 -3
  46. package/dist/declarations/src/types/tokens.d.ts +0 -11
@@ -1,26 +1,25 @@
1
1
  import { TypeRegistry } from "@polkadot/types";
2
2
  import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
3
- import { SubPsp22Token } from "@talismn/chaindata-provider";
4
- import z from "zod/v4";
5
- import { DefaultChainMeta, DefaultModuleConfig, NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
3
+ import { BalancesConfigTokenParams, ChainId, Token } from "@talismn/chaindata-provider";
4
+ import { NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
6
5
  import { NewBalanceType } from "../types";
7
6
  type ModuleType = "substrate-psp22";
8
- export declare const SubPsp22TokenConfigSchema: z.ZodObject<{
9
- symbol: z.ZodOptional<z.ZodString>;
10
- networkId: z.ZodOptional<z.ZodString>;
11
- isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
12
- decimals: z.ZodOptional<z.ZodInt>;
13
- name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
14
- logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
15
- coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
16
- noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
17
- mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
18
- contractAddress: z.ZodString;
19
- }, z.core.$strict>;
20
- export type SubPsp22TokenConfig = z.infer<typeof SubPsp22TokenConfigSchema>;
21
- export type SubPsp22ChainMeta = DefaultChainMeta;
22
- export type SubPsp22ModuleConfig = DefaultModuleConfig;
23
- export type SubPsp22Balance = NewBalanceType<ModuleType, "simple">;
7
+ export type SubPsp22Token = Extract<Token, {
8
+ type: ModuleType;
9
+ }>;
10
+ export declare const subPsp22TokenId: (chainId: ChainId, tokenSymbol: string) => string;
11
+ export type SubPsp22ChainMeta = {
12
+ isTestnet: boolean;
13
+ };
14
+ export type SubPsp22ModuleConfig = {
15
+ tokens?: Array<{
16
+ symbol?: string;
17
+ decimals?: number;
18
+ ed?: string;
19
+ contractAddress?: string;
20
+ } & BalancesConfigTokenParams>;
21
+ };
22
+ export type SubPsp22Balance = NewBalanceType<ModuleType, "simple", "substrate">;
24
23
  declare module "@talismn/balances/plugins" {
25
24
  interface PluginBalanceTypes {
26
25
  "substrate-psp22": SubPsp22Balance;
@@ -36,5 +35,5 @@ export type SubPsp22TransferParams = NewTransferParamsType<{
36
35
  tip?: string;
37
36
  userExtensions?: ExtDef;
38
37
  }>;
39
- export declare const SubPsp22Module: NewBalanceModule<ModuleType, SubPsp22Token, SubPsp22ChainMeta, SubPsp22ModuleConfig, SubPsp22TokenConfig, SubPsp22TransferParams>;
38
+ export declare const SubPsp22Module: NewBalanceModule<ModuleType, SubPsp22Token, SubPsp22ChainMeta, SubPsp22ModuleConfig, SubPsp22TransferParams>;
40
39
  export {};
@@ -1,29 +1,29 @@
1
1
  import { TypeRegistry } from "@polkadot/types";
2
2
  import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
3
- import { SubTokensBalancesConfig, SubTokensToken } from "@talismn/chaindata-provider";
4
- import z from "zod/v4";
5
- import { ChainMeta, NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
3
+ import { BalancesConfigTokenParams, ChainId, Token } from "@talismn/chaindata-provider";
4
+ import { NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
6
5
  import { NewBalanceType } from "../types";
7
6
  type ModuleType = "substrate-tokens";
8
- export declare const SubTokensTokenConfigSchema: z.ZodObject<{
9
- existentialDeposit: z.ZodOptional<z.ZodString>;
10
- symbol: z.ZodOptional<z.ZodString>;
11
- networkId: z.ZodOptional<z.ZodString>;
12
- isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
13
- decimals: z.ZodOptional<z.ZodInt>;
14
- name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
15
- logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
16
- coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
17
- noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
18
- mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
- onChainId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
20
- }, z.core.$strict>;
21
- export type SubTokensTokenConfig = z.infer<typeof SubTokensTokenConfigSchema>;
22
- export type SubTokensChainMeta = ChainMeta<{
23
- palletId?: string;
7
+ export type SubTokensToken = Extract<Token, {
8
+ type: ModuleType;
24
9
  }>;
25
- export type SubTokensModuleConfig = SubTokensBalancesConfig;
26
- export type SubTokensBalance = NewBalanceType<ModuleType, "complex">;
10
+ export declare const subTokensTokenId: (chainId: ChainId, onChainId: string | number) => string;
11
+ export type SubTokensChainMeta = {
12
+ isTestnet: boolean;
13
+ palletId?: string;
14
+ miniMetadata?: string;
15
+ metadataVersion?: number;
16
+ };
17
+ export type SubTokensModuleConfig = {
18
+ palletId?: string;
19
+ tokens?: Array<{
20
+ symbol?: string;
21
+ decimals?: number;
22
+ ed?: string;
23
+ onChainId?: string | number;
24
+ } & BalancesConfigTokenParams>;
25
+ };
26
+ export type SubTokensBalance = NewBalanceType<ModuleType, "complex", "substrate">;
27
27
  declare module "@talismn/balances/plugins" {
28
28
  interface PluginBalanceTypes {
29
29
  "substrate-tokens": SubTokensBalance;
@@ -39,5 +39,5 @@ export type SubTokensTransferParams = NewTransferParamsType<{
39
39
  tip?: string;
40
40
  userExtensions?: ExtDef;
41
41
  }>;
42
- export declare const SubTokensModule: NewBalanceModule<ModuleType, SubTokensToken, SubTokensChainMeta, SubTokensModuleConfig, SubTokensTokenConfig, SubTokensTransferParams>;
42
+ export declare const SubTokensModule: NewBalanceModule<ModuleType, SubTokensToken, SubTokensChainMeta, SubTokensModuleConfig, SubTokensTransferParams>;
43
43
  export {};
@@ -1,233 +1,58 @@
1
- export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-erc20", {
2
- id: string;
3
- networkId: string;
4
- decimals: number;
5
- symbol: string;
6
- type: "evm-erc20";
7
- platform: "ethereum";
8
- contractAddress: `0x${string}`;
9
- isDefault?: boolean | undefined;
10
- name?: string | undefined;
11
- logo?: string | undefined;
12
- coingeckoId?: string | undefined;
13
- noDiscovery?: boolean | undefined;
14
- mirrorOf?: string | undefined;
15
- isCustom?: boolean | undefined;
16
- }, import("..").DefaultChainMeta, undefined, {
17
- contractAddress: `0x${string}`;
18
- symbol?: string | undefined;
19
- networkId?: string | undefined;
20
- isDefault?: boolean | undefined;
21
- decimals?: number | undefined;
22
- name?: string | undefined;
23
- logo?: string | undefined;
24
- coingeckoId?: string | undefined;
25
- noDiscovery?: boolean | undefined;
26
- mirrorOf?: string | undefined;
27
- }> | import("..").NewBalanceModule<"evm-native", {
28
- id: string;
29
- networkId: string;
30
- decimals: number;
31
- symbol: string;
1
+ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-erc20", import("./EvmErc20Module").EvmErc20Token, import("./EvmErc20Module").EvmErc20ChainMeta, import("./EvmErc20Module").EvmErc20ModuleConfig> | import("..").NewBalanceModule<"evm-native", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
32
2
  type: "evm-native";
33
- platform: "ethereum";
34
- isDefault?: boolean | undefined;
35
- name?: string | undefined;
36
- logo?: string | undefined;
37
- coingeckoId?: string | undefined;
38
- noDiscovery?: boolean | undefined;
39
- mirrorOf?: string | undefined;
40
- }, import("..").DefaultChainMeta, undefined, {
41
- symbol?: string | undefined;
42
- networkId?: string | undefined;
43
- isDefault?: boolean | undefined;
44
- decimals?: number | undefined;
45
- name?: string | undefined;
46
- logo?: string | undefined;
47
- coingeckoId?: string | undefined;
48
- noDiscovery?: boolean | undefined;
49
- mirrorOf?: string | undefined;
50
- }> | import("..").NewBalanceModule<"evm-uniswapv2", {
51
- id: string;
52
- networkId: string;
53
- decimals: number;
54
- symbol: string;
55
- type: "evm-uniswapv2";
56
- platform: "ethereum";
57
- contractAddress: `0x${string}`;
58
- symbol0: string;
59
- symbol1: string;
60
- decimals0: number;
61
- decimals1: number;
62
- tokenAddress0: `0x${string}`;
63
- tokenAddress1: `0x${string}`;
64
- isDefault?: boolean | undefined;
65
- name?: string | undefined;
66
- logo?: string | undefined;
67
- coingeckoId?: string | undefined;
68
- noDiscovery?: boolean | undefined;
69
- mirrorOf?: string | undefined;
70
- isCustom?: boolean | undefined;
71
- coingeckoId0?: string | undefined;
72
- coingeckoId1?: string | undefined;
73
- }, import("..").DefaultChainMeta, undefined, {
74
- contractAddress: `0x${string}`;
75
- symbol0?: string | undefined;
76
- symbol1?: string | undefined;
77
- decimals0?: number | undefined;
78
- decimals1?: number | undefined;
79
- tokenAddress0?: `0x${string}` | undefined;
80
- tokenAddress1?: `0x${string}` | undefined;
81
- coingeckoId0?: string | undefined;
82
- coingeckoId1?: string | undefined;
83
- symbol?: string | undefined;
84
- networkId?: string | undefined;
85
- isDefault?: boolean | undefined;
86
- decimals?: number | undefined;
87
- name?: string | undefined;
88
- logo?: string | undefined;
89
- coingeckoId?: string | undefined;
90
- noDiscovery?: boolean | undefined;
91
- mirrorOf?: string | undefined;
92
- }> | import("..").NewBalanceModule<"substrate-assets", {
93
- id: string;
94
- networkId: string;
95
- decimals: number;
96
- symbol: string;
3
+ } & {
4
+ evmNetwork: {
5
+ id: import("@talismn/chaindata-provider").EvmNetworkId;
6
+ };
7
+ isCustom?: true;
8
+ }, import("./EvmNativeModule").EvmNativeChainMeta, import("./EvmNativeModule").EvmNativeModuleConfig> | import("..").NewBalanceModule<"evm-uniswapv2", import("./EvmUniswapV2Module").EvmUniswapV2Token, import("./EvmUniswapV2Module").EvmUniswapV2ChainMeta, import("./EvmUniswapV2Module").EvmUniswapV2ModuleConfig> | import("..").NewBalanceModule<"substrate-assets", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
97
9
  type: "substrate-assets";
98
- platform: "polkadot";
10
+ } & {
11
+ existentialDeposit: string;
99
12
  assetId: string;
13
+ isFrozen: boolean;
14
+ chain: {
15
+ id: import("@talismn/chaindata-provider").ChainId;
16
+ };
17
+ }, import("./SubstrateAssetsModule").SubAssetsChainMeta, import("./SubstrateAssetsModule").SubAssetsModuleConfig, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-equilibrium", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
18
+ type: "substrate-equilibrium";
19
+ } & {
100
20
  existentialDeposit: string;
101
- isDefault?: boolean | undefined;
102
- name?: string | undefined;
103
- logo?: string | undefined;
104
- coingeckoId?: string | undefined;
105
- noDiscovery?: boolean | undefined;
106
- mirrorOf?: string | undefined;
107
- isFrozen?: boolean | undefined;
108
- }, import("./SubstrateAssetsModule").SubAssetsChainMeta, undefined, {
109
21
  assetId: string;
110
- symbol?: string | undefined;
111
- networkId?: string | undefined;
112
- isDefault?: boolean | undefined;
113
- decimals?: number | undefined;
114
- name?: string | undefined;
115
- logo?: string | undefined;
116
- coingeckoId?: string | undefined;
117
- noDiscovery?: boolean | undefined;
118
- mirrorOf?: string | undefined;
119
- }, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", {
120
- id: string;
121
- networkId: string;
122
- decimals: number;
123
- symbol: string;
22
+ chain: {
23
+ id: import("@talismn/chaindata-provider").ChainId;
24
+ };
25
+ }, import("./SubstrateEquilibriumModule").SubEquilibriumChainMeta, import("./SubstrateEquilibriumModule").SubEquilibriumModuleConfig, import("./SubstrateEquilibriumModule").SubEquilibriumTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
124
26
  type: "substrate-foreignassets";
125
- platform: "polkadot";
126
- onChainId: string;
27
+ } & {
127
28
  existentialDeposit: string;
128
- isDefault?: boolean | undefined;
129
- name?: string | undefined;
130
- logo?: string | undefined;
131
- coingeckoId?: string | undefined;
132
- noDiscovery?: boolean | undefined;
133
- mirrorOf?: string | undefined;
134
- isFrozen?: boolean | undefined;
135
- }, import("..").DefaultChainMeta, undefined, {
136
29
  onChainId: string;
137
- symbol?: string | undefined;
138
- networkId?: string | undefined;
139
- isDefault?: boolean | undefined;
140
- decimals?: number | undefined;
141
- name?: string | undefined;
142
- logo?: string | undefined;
143
- coingeckoId?: string | undefined;
144
- noDiscovery?: boolean | undefined;
145
- mirrorOf?: string | undefined;
146
- }, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", {
147
- id: string;
148
- networkId: string;
149
- decimals: number;
150
- symbol: string;
151
- type: "substrate-native";
152
- platform: "polkadot";
153
- existentialDeposit: string;
154
- isDefault?: boolean | undefined;
155
- name?: string | undefined;
156
- logo?: string | undefined;
157
- coingeckoId?: string | undefined;
158
- noDiscovery?: boolean | undefined;
159
- mirrorOf?: string | undefined;
160
- }, import("./SubstrateNativeModule").SubNativeChainMeta, {
161
- disable?: boolean | undefined;
162
- }, {
163
- symbol?: string | undefined;
164
- networkId?: string | undefined;
165
- isDefault?: boolean | undefined;
166
- decimals?: number | undefined;
167
- name?: string | undefined;
168
- logo?: string | undefined;
169
- coingeckoId?: string | undefined;
170
- noDiscovery?: boolean | undefined;
171
- mirrorOf?: string | undefined;
172
- }, import("./SubstrateNativeModule").SubNativeTransferParams> | import("..").NewBalanceModule<"substrate-psp22", {
173
- id: string;
174
- networkId: string;
175
- decimals: number;
176
- symbol: string;
30
+ isFrozen: boolean;
31
+ chain: {
32
+ id: import("@talismn/chaindata-provider").ChainId;
33
+ };
34
+ }, import("./SubstrateForeignAssetsModule").SubForeignAssetsChainMeta, import("./SubstrateForeignAssetsModule").SubForeignAssetsModuleConfig, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", import("./SubstrateNativeModule").SubNativeToken, import("./SubstrateNativeModule").SubNativeChainMeta, import("./SubstrateNativeModule").SubNativeModuleConfig, import("./SubstrateNativeModule").SubNativeTransferParams> | import("..").NewBalanceModule<"substrate-psp22", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
177
35
  type: "substrate-psp22";
178
- platform: "polkadot";
179
- contractAddress: string;
180
- isDefault?: boolean | undefined;
181
- name?: string | undefined;
182
- logo?: string | undefined;
183
- coingeckoId?: string | undefined;
184
- noDiscovery?: boolean | undefined;
185
- mirrorOf?: string | undefined;
186
- }, import("..").DefaultChainMeta, undefined, {
36
+ } & {
37
+ existentialDeposit: string;
187
38
  contractAddress: string;
188
- symbol?: string | undefined;
189
- networkId?: string | undefined;
190
- isDefault?: boolean | undefined;
191
- decimals?: number | undefined;
192
- name?: string | undefined;
193
- logo?: string | undefined;
194
- coingeckoId?: string | undefined;
195
- noDiscovery?: boolean | undefined;
196
- mirrorOf?: string | undefined;
197
- }, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", {
198
- id: string;
199
- networkId: string;
200
- decimals: number;
201
- symbol: string;
39
+ chain: {
40
+ id: import("@talismn/chaindata-provider").ChainId;
41
+ };
42
+ }, import("./SubstratePsp22Module").SubPsp22ChainMeta, import("./SubstratePsp22Module").SubPsp22ModuleConfig, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
202
43
  type: "substrate-tokens";
203
- platform: "polkadot";
204
- onChainId: string | number;
44
+ } & {
205
45
  existentialDeposit: string;
206
- isDefault?: boolean | undefined;
207
- name?: string | undefined;
208
- logo?: string | undefined;
209
- coingeckoId?: string | undefined;
210
- noDiscovery?: boolean | undefined;
211
- mirrorOf?: string | undefined;
212
- }, import("./SubstrateTokensModule").SubTokensChainMeta, {
213
- palletId?: string | undefined;
214
- }, {
215
46
  onChainId: string | number;
216
- existentialDeposit?: string | undefined;
217
- symbol?: string | undefined;
218
- networkId?: string | undefined;
219
- isDefault?: boolean | undefined;
220
- decimals?: number | undefined;
221
- name?: string | undefined;
222
- logo?: string | undefined;
223
- coingeckoId?: string | undefined;
224
- noDiscovery?: boolean | undefined;
225
- mirrorOf?: string | undefined;
226
- }, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
47
+ chain: {
48
+ id: import("@talismn/chaindata-provider").ChainId;
49
+ };
50
+ }, import("./SubstrateTokensModule").SubTokensChainMeta, import("./SubstrateTokensModule").SubTokensModuleConfig, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
227
51
  export * from "./EvmErc20Module";
228
52
  export * from "./EvmNativeModule";
229
53
  export * from "./EvmUniswapV2Module";
230
54
  export * from "./SubstrateAssetsModule";
55
+ export * from "./SubstrateEquilibriumModule";
231
56
  export * from "./SubstrateForeignAssetsModule";
232
57
  export * from "./SubstrateNativeModule";
233
58
  export * from "./SubstratePsp22Module";
@@ -1,6 +1,6 @@
1
1
  import { BalanceModule, NewBalanceModule } from "../../BalanceModule";
2
- export type AnyBalanceModule = BalanceModule<any, any, any, any, any, any>;
3
- export type AnyNewBalanceModule = NewBalanceModule<any, any, any, any, any, any>;
2
+ export type AnyBalanceModule = BalanceModule<any, any, any, any, any>;
3
+ export type AnyNewBalanceModule = NewBalanceModule<any, any, any, any, any>;
4
4
  /**
5
5
  * The following `Infer*` collection of generic types can be used when you want to
6
6
  * extract one of the generic type arguments from an existing BalanceModule.
@@ -13,12 +13,11 @@ export type AnyNewBalanceModule = NewBalanceModule<any, any, any, any, any, any>
13
13
  * string as input, and then return some data associated with that module with the correct type:
14
14
  * function getChainMeta<T extends AnyBalanceModule>(type: InferModuleType<T>): InferChainMeta<T> | undefined
15
15
  */
16
- type InferBalanceModuleTypes<T extends AnyNewBalanceModule> = T extends NewBalanceModule<infer TModuleType, infer TTokenType, infer TChainMeta, infer TModuleConfig, infer TTokenConfig, infer TTransferParams> ? {
16
+ type InferBalanceModuleTypes<T extends AnyNewBalanceModule> = T extends NewBalanceModule<infer TModuleType, infer TTokenType, infer TChainMeta, infer TModuleConfig, infer TTransferParams> ? {
17
17
  TModuleType: TModuleType;
18
18
  TTokenType: TTokenType;
19
19
  TChainMeta: TChainMeta;
20
20
  TModuleConfig: TModuleConfig;
21
- TTokenConfig: TTokenConfig;
22
21
  TTransferParams: TTransferParams;
23
22
  } : never;
24
23
  export type InferModuleType<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TModuleType"];
@@ -26,5 +25,4 @@ export type InferTokenType<T extends AnyNewBalanceModule> = InferBalanceModuleTy
26
25
  export type InferChainMeta<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TChainMeta"];
27
26
  export type InferModuleConfig<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TModuleConfig"];
28
27
  export type InferTransferParams<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TTransferParams"];
29
- export type InferTTokenConfig<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TTokenConfig"];
30
28
  export {};
@@ -1,7 +1,7 @@
1
- import { DotNetwork, DotNetworkId, NetworkId } from "@talismn/chaindata-provider";
1
+ import { ChainId, ChainList } from "@talismn/chaindata-provider";
2
2
  import { getDynamicBuilder } from "@talismn/scale";
3
3
  import { MiniMetadata } from "../../types";
4
- import { AnyNewBalanceModule } from "./InferBalanceModuleTypes";
4
+ import { AnyNewBalanceModule, InferModuleType } from "./InferBalanceModuleTypes";
5
5
  export type StorageCoders<TCoders extends {
6
6
  [key: string]: [string, string];
7
7
  }> = Map<string, {
@@ -11,10 +11,11 @@ export declare const buildStorageCoders: <TBalanceModule extends AnyNewBalanceMo
11
11
  [key: string]: [string, string] | ((params: {
12
12
  chainId: string;
13
13
  }) => [string, string]);
14
- }>({ chainIds, chains, miniMetadatas, coders, }: {
15
- chainIds: DotNetworkId[];
16
- chains: Record<NetworkId, DotNetwork>;
17
- miniMetadatas: Map<DotNetworkId, MiniMetadata<TBalanceModule>>;
14
+ }>({ chainIds, chains, miniMetadatas, moduleType, coders, }: {
15
+ chainIds: ChainId[];
16
+ chains: ChainList;
17
+ miniMetadatas: Map<string, MiniMetadata>;
18
+ moduleType: InferModuleType<TBalanceModule>;
18
19
  coders: TCoders;
19
20
  }) => Map<string, { [Property in keyof TCoders]: {
20
21
  args: [import("scale-ts").Encoder<any[]>, import("scale-ts").Decoder<any[]>] & {
@@ -31,13 +32,3 @@ export declare const buildStorageCoders: <TBalanceModule extends AnyNewBalanceMo
31
32
  len: number;
32
33
  fallback: any;
33
34
  } | undefined; }>;
34
- type NetworkCoders = {
35
- [key: string]: [string, string];
36
- };
37
- type NetworkStorageCoders<TCoders extends NetworkCoders> = {
38
- [Property in keyof TCoders]: ReturnType<ReturnType<typeof getDynamicBuilder>["buildStorage"]> | undefined;
39
- };
40
- export declare const buildNetworkStorageCoders: <TCoders extends {
41
- [key: string]: [string, string];
42
- }>(chainId: DotNetworkId, miniMetadata: MiniMetadata, coders: TCoders) => NetworkStorageCoders<TCoders> | null;
43
- export {};
@@ -0,0 +1,8 @@
1
+ import { Chain } from "@talismn/chaindata-provider";
2
+ import { MiniMetadata } from "../../types";
3
+ import { AnyNewBalanceModule, InferChainMeta, InferModuleType } from "./InferBalanceModuleTypes";
4
+ /**
5
+ * Given a `moduleType` and a `chain` from a chaindataProvider, this function will find the chainMeta
6
+ * associated with the given balanceModule for the given chain.
7
+ */
8
+ export declare const findChainMeta: <TBalanceModule extends AnyNewBalanceModule>(miniMetadatas: Map<string, MiniMetadata>, moduleType: InferModuleType<TBalanceModule>, chain?: Chain) => [InferChainMeta<TBalanceModule> | undefined, MiniMetadata | undefined];
@@ -1,5 +1,5 @@
1
- import { NetworkId, TokenList } from "@talismn/chaindata-provider";
1
+ import { ChainId, TokenList } from "@talismn/chaindata-provider";
2
2
  import { AddressesByToken } from "../../types";
3
3
  export declare const getUniqueChainIds: (addressesByToken: AddressesByToken<{
4
4
  id: string;
5
- }>, tokens: TokenList) => NetworkId[];
5
+ }>, tokens: TokenList) => ChainId[];
@@ -2,6 +2,7 @@ export * from "./balances";
2
2
  export * from "./buildStorageCoders";
3
3
  export * from "./decodeOutput";
4
4
  export * from "./detectTransferMethod";
5
+ export * from "./findChainMeta";
5
6
  export * from "./getUniqueChainIds";
6
7
  export * from "./InferBalanceModuleTypes";
7
8
  export * from "./makeContractCaller";