@talismn/balances 1.3.0 → 1.3.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.
Files changed (162) hide show
  1. package/dist/index.d.mts +2100 -0
  2. package/dist/index.d.ts +2100 -0
  3. package/dist/index.js +7960 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +7961 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +30 -38
  8. package/dist/declarations/src/BalancesProvider.d.ts +0 -36
  9. package/dist/declarations/src/getMiniMetadatas/getMetadataRpc.d.ts +0 -3
  10. package/dist/declarations/src/getMiniMetadatas/getSpecVersion.d.ts +0 -6
  11. package/dist/declarations/src/getMiniMetadatas/index.d.ts +0 -5
  12. package/dist/declarations/src/index.d.ts +0 -4
  13. package/dist/declarations/src/log.d.ts +0 -2
  14. package/dist/declarations/src/modules/abis/erc20BalancesAggregator.d.ts +0 -19
  15. package/dist/declarations/src/modules/abis/index.d.ts +0 -3
  16. package/dist/declarations/src/modules/abis/multicall.d.ts +0 -276
  17. package/dist/declarations/src/modules/abis/uniswapV2Pair.d.ts +0 -560
  18. package/dist/declarations/src/modules/evm-erc20/config.d.ts +0 -3
  19. package/dist/declarations/src/modules/evm-erc20/fetchBalances.d.ts +0 -3
  20. package/dist/declarations/src/modules/evm-erc20/fetchTokens.d.ts +0 -3
  21. package/dist/declarations/src/modules/evm-erc20/getMiniMetadata.d.ts +0 -3
  22. package/dist/declarations/src/modules/evm-erc20/getTransferCallData.d.ts +0 -3
  23. package/dist/declarations/src/modules/evm-erc20/index.d.ts +0 -2
  24. package/dist/declarations/src/modules/evm-erc20/module.d.ts +0 -3
  25. package/dist/declarations/src/modules/evm-erc20/subscribeBalances.d.ts +0 -3
  26. package/dist/declarations/src/modules/evm-erc20/types.d.ts +0 -14
  27. package/dist/declarations/src/modules/evm-erc20/utils.d.ts +0 -6
  28. package/dist/declarations/src/modules/evm-native/config.d.ts +0 -3
  29. package/dist/declarations/src/modules/evm-native/fetchBalances.d.ts +0 -3
  30. package/dist/declarations/src/modules/evm-native/fetchTokens.d.ts +0 -3
  31. package/dist/declarations/src/modules/evm-native/getMiniMetadata.d.ts +0 -3
  32. package/dist/declarations/src/modules/evm-native/getTransferCallData.d.ts +0 -3
  33. package/dist/declarations/src/modules/evm-native/index.d.ts +0 -2
  34. package/dist/declarations/src/modules/evm-native/module.d.ts +0 -3
  35. package/dist/declarations/src/modules/evm-native/subscribeBalances.d.ts +0 -3
  36. package/dist/declarations/src/modules/evm-native/types.d.ts +0 -13
  37. package/dist/declarations/src/modules/evm-uniswapv2/config.d.ts +0 -3
  38. package/dist/declarations/src/modules/evm-uniswapv2/fetchBalances.d.ts +0 -3
  39. package/dist/declarations/src/modules/evm-uniswapv2/fetchTokens.d.ts +0 -3
  40. package/dist/declarations/src/modules/evm-uniswapv2/getMiniMetadata.d.ts +0 -3
  41. package/dist/declarations/src/modules/evm-uniswapv2/getTransferCallData.d.ts +0 -3
  42. package/dist/declarations/src/modules/evm-uniswapv2/index.d.ts +0 -2
  43. package/dist/declarations/src/modules/evm-uniswapv2/module.d.ts +0 -3
  44. package/dist/declarations/src/modules/evm-uniswapv2/subscribeBalances.d.ts +0 -3
  45. package/dist/declarations/src/modules/evm-uniswapv2/types.d.ts +0 -14
  46. package/dist/declarations/src/modules/evm-uniswapv2/utils.d.ts +0 -12
  47. package/dist/declarations/src/modules/index.d.ts +0 -157
  48. package/dist/declarations/src/modules/shared/buildNetworkStorageCoders.d.ts +0 -13
  49. package/dist/declarations/src/modules/shared/detectedTokens.d.ts +0 -3
  50. package/dist/declarations/src/modules/shared/errors.d.ts +0 -11
  51. package/dist/declarations/src/modules/shared/fetchRuntimeCallResult.d.ts +0 -2
  52. package/dist/declarations/src/modules/shared/index.d.ts +0 -6
  53. package/dist/declarations/src/modules/shared/rpcQueryPack.d.ts +0 -10
  54. package/dist/declarations/src/modules/shared/types.d.ts +0 -12
  55. package/dist/declarations/src/modules/shared/utils.d.ts +0 -6
  56. package/dist/declarations/src/modules/sol-native/config.d.ts +0 -3
  57. package/dist/declarations/src/modules/sol-native/fetchBalances.d.ts +0 -3
  58. package/dist/declarations/src/modules/sol-native/fetchTokens.d.ts +0 -3
  59. package/dist/declarations/src/modules/sol-native/getMiniMetadata.d.ts +0 -3
  60. package/dist/declarations/src/modules/sol-native/getTransferCallData.d.ts +0 -3
  61. package/dist/declarations/src/modules/sol-native/index.d.ts +0 -2
  62. package/dist/declarations/src/modules/sol-native/module.d.ts +0 -3
  63. package/dist/declarations/src/modules/sol-native/subscribeBalances.d.ts +0 -3
  64. package/dist/declarations/src/modules/sol-native/types.d.ts +0 -13
  65. package/dist/declarations/src/modules/sol-spl/config.d.ts +0 -3
  66. package/dist/declarations/src/modules/sol-spl/fetchBalances.d.ts +0 -3
  67. package/dist/declarations/src/modules/sol-spl/fetchTokens.d.ts +0 -3
  68. package/dist/declarations/src/modules/sol-spl/getMiniMetadata.d.ts +0 -3
  69. package/dist/declarations/src/modules/sol-spl/getTransferCallData.d.ts +0 -3
  70. package/dist/declarations/src/modules/sol-spl/index.d.ts +0 -2
  71. package/dist/declarations/src/modules/sol-spl/module.d.ts +0 -3
  72. package/dist/declarations/src/modules/sol-spl/subscribeBalances.d.ts +0 -3
  73. package/dist/declarations/src/modules/sol-spl/types.d.ts +0 -14
  74. package/dist/declarations/src/modules/substrate-assets/buildQueries.d.ts +0 -5
  75. package/dist/declarations/src/modules/substrate-assets/config.d.ts +0 -5
  76. package/dist/declarations/src/modules/substrate-assets/fetchBalances.d.ts +0 -3
  77. package/dist/declarations/src/modules/substrate-assets/fetchTokens.d.ts +0 -3
  78. package/dist/declarations/src/modules/substrate-assets/getMiniMetadata.d.ts +0 -3
  79. package/dist/declarations/src/modules/substrate-assets/getTransferCallData.d.ts +0 -3
  80. package/dist/declarations/src/modules/substrate-assets/index.d.ts +0 -2
  81. package/dist/declarations/src/modules/substrate-assets/module.d.ts +0 -3
  82. package/dist/declarations/src/modules/substrate-assets/subscribeBalances.d.ts +0 -3
  83. package/dist/declarations/src/modules/substrate-assets/types.d.ts +0 -14
  84. package/dist/declarations/src/modules/substrate-dtao/alphaPrice.d.ts +0 -5
  85. package/dist/declarations/src/modules/substrate-dtao/calculatePendingRootClaimable.d.ts +0 -11
  86. package/dist/declarations/src/modules/substrate-dtao/config.d.ts +0 -5
  87. package/dist/declarations/src/modules/substrate-dtao/fetchBalances.d.ts +0 -3
  88. package/dist/declarations/src/modules/substrate-dtao/fetchTokens.d.ts +0 -3
  89. package/dist/declarations/src/modules/substrate-dtao/getDtaoTokenRates.d.ts +0 -11
  90. package/dist/declarations/src/modules/substrate-dtao/getMiniMetadata.d.ts +0 -3
  91. package/dist/declarations/src/modules/substrate-dtao/getTransferCallData.d.ts +0 -3
  92. package/dist/declarations/src/modules/substrate-dtao/index.d.ts +0 -4
  93. package/dist/declarations/src/modules/substrate-dtao/module.d.ts +0 -3
  94. package/dist/declarations/src/modules/substrate-dtao/subscribeBalances.d.ts +0 -3
  95. package/dist/declarations/src/modules/substrate-dtao/types.d.ts +0 -30
  96. package/dist/declarations/src/modules/substrate-foreignassets/buildQueries.d.ts +0 -6
  97. package/dist/declarations/src/modules/substrate-foreignassets/config.d.ts +0 -3
  98. package/dist/declarations/src/modules/substrate-foreignassets/fetchBalances.d.ts +0 -3
  99. package/dist/declarations/src/modules/substrate-foreignassets/fetchTokens.d.ts +0 -3
  100. package/dist/declarations/src/modules/substrate-foreignassets/getMiniMetadata.d.ts +0 -3
  101. package/dist/declarations/src/modules/substrate-foreignassets/getTransferCallData.d.ts +0 -3
  102. package/dist/declarations/src/modules/substrate-foreignassets/index.d.ts +0 -2
  103. package/dist/declarations/src/modules/substrate-foreignassets/module.d.ts +0 -3
  104. package/dist/declarations/src/modules/substrate-foreignassets/subscribeBalances.d.ts +0 -3
  105. package/dist/declarations/src/modules/substrate-foreignassets/types.d.ts +0 -14
  106. package/dist/declarations/src/modules/substrate-hydration/config.d.ts +0 -3
  107. package/dist/declarations/src/modules/substrate-hydration/fetchBalances.d.ts +0 -3
  108. package/dist/declarations/src/modules/substrate-hydration/fetchTokens.d.ts +0 -3
  109. package/dist/declarations/src/modules/substrate-hydration/getMiniMetadata.d.ts +0 -3
  110. package/dist/declarations/src/modules/substrate-hydration/getTransferCallData.d.ts +0 -3
  111. package/dist/declarations/src/modules/substrate-hydration/index.d.ts +0 -2
  112. package/dist/declarations/src/modules/substrate-hydration/module.d.ts +0 -3
  113. package/dist/declarations/src/modules/substrate-hydration/subscribeBalances.d.ts +0 -3
  114. package/dist/declarations/src/modules/substrate-hydration/types.d.ts +0 -14
  115. package/dist/declarations/src/modules/substrate-native/config.d.ts +0 -3
  116. package/dist/declarations/src/modules/substrate-native/fetchBalances.d.ts +0 -3
  117. package/dist/declarations/src/modules/substrate-native/fetchTokens.d.ts +0 -8
  118. package/dist/declarations/src/modules/substrate-native/getMiniMetadata.d.ts +0 -3
  119. package/dist/declarations/src/modules/substrate-native/getTransferCallData.d.ts +0 -3
  120. package/dist/declarations/src/modules/substrate-native/index.d.ts +0 -3
  121. package/dist/declarations/src/modules/substrate-native/module.d.ts +0 -3
  122. package/dist/declarations/src/modules/substrate-native/queries/buildBaseQueries.d.ts +0 -17
  123. package/dist/declarations/src/modules/substrate-native/queries/buildNomPoolQueries.d.ts +0 -5
  124. package/dist/declarations/src/modules/substrate-native/subscribeBalances.d.ts +0 -3
  125. package/dist/declarations/src/modules/substrate-native/types.d.ts +0 -24
  126. package/dist/declarations/src/modules/substrate-native/util/lockTypes.d.ts +0 -15
  127. package/dist/declarations/src/modules/substrate-native/util/nompoolAccountId.d.ts +0 -5
  128. package/dist/declarations/src/modules/substrate-psp22/config.d.ts +0 -3
  129. package/dist/declarations/src/modules/substrate-psp22/fetchBalances.d.ts +0 -3
  130. package/dist/declarations/src/modules/substrate-psp22/fetchTokens.d.ts +0 -3
  131. package/dist/declarations/src/modules/substrate-psp22/getMiniMetadata.d.ts +0 -3
  132. package/dist/declarations/src/modules/substrate-psp22/getTransferCallData.d.ts +0 -3
  133. package/dist/declarations/src/modules/substrate-psp22/index.d.ts +0 -2
  134. package/dist/declarations/src/modules/substrate-psp22/module.d.ts +0 -3
  135. package/dist/declarations/src/modules/substrate-psp22/subscribeBalances.d.ts +0 -3
  136. package/dist/declarations/src/modules/substrate-psp22/types.d.ts +0 -14
  137. package/dist/declarations/src/modules/substrate-psp22/util.d.ts +0 -10
  138. package/dist/declarations/src/modules/substrate-tokens/buildQueries.d.ts +0 -5
  139. package/dist/declarations/src/modules/substrate-tokens/config.d.ts +0 -5
  140. package/dist/declarations/src/modules/substrate-tokens/fetchBalances.d.ts +0 -3
  141. package/dist/declarations/src/modules/substrate-tokens/fetchTokens.d.ts +0 -3
  142. package/dist/declarations/src/modules/substrate-tokens/getMiniMetadata.d.ts +0 -3
  143. package/dist/declarations/src/modules/substrate-tokens/getTransferCallData.d.ts +0 -3
  144. package/dist/declarations/src/modules/substrate-tokens/index.d.ts +0 -2
  145. package/dist/declarations/src/modules/substrate-tokens/module.d.ts +0 -3
  146. package/dist/declarations/src/modules/substrate-tokens/subscribeBalances.d.ts +0 -3
  147. package/dist/declarations/src/modules/substrate-tokens/types.d.ts +0 -23
  148. package/dist/declarations/src/types/IBalanceModule.d.ts +0 -98
  149. package/dist/declarations/src/types/addresses.d.ts +0 -1
  150. package/dist/declarations/src/types/balances.d.ts +0 -589
  151. package/dist/declarations/src/types/balancetypes.d.ts +0 -71
  152. package/dist/declarations/src/types/chainConnectors.d.ts +0 -6
  153. package/dist/declarations/src/types/index.d.ts +0 -7
  154. package/dist/declarations/src/types/minimetadatas.d.ts +0 -6
  155. package/dist/declarations/src/types/subscriptions.d.ts +0 -11
  156. package/dist/declarations/src/types/tokens.d.ts +0 -11
  157. package/dist/declarations/src/version.d.ts +0 -1
  158. package/dist/talismn-balances.cjs.d.ts +0 -1
  159. package/dist/talismn-balances.cjs.dev.js +0 -7601
  160. package/dist/talismn-balances.cjs.js +0 -7
  161. package/dist/talismn-balances.cjs.prod.js +0 -7601
  162. package/dist/talismn-balances.esm.js +0 -7532
@@ -0,0 +1,2100 @@
1
+ import { TokenId, NetworkId, NetworkList, TokenList, TokenType, TokenOfType, Token, DotNetworkId, SolNetworkId, EthNetworkId, AnyMiniMetadata, ChaindataProvider, SubDTaoToken } from '@talismn/chaindata-provider';
2
+ export { MINIMETADATA_VERSION } from '@talismn/chaindata-provider';
3
+ import { Observable } from 'rxjs';
4
+ import { IChainConnectorDot, IChainConnectorEth, IChainConnectorSol } from '@talismn/chain-connectors';
5
+ import { TransactionInstruction } from '@solana/web3.js';
6
+ import * as _talismn_token_rates from '@talismn/token-rates';
7
+ import { TokenRates, TokenRateCurrency, TokenRatesList } from '@talismn/token-rates';
8
+ import { NonFunctionProperties } from '@talismn/util';
9
+ import z from 'zod/v4';
10
+ import { bittensor } from '@polkadot-api/descriptors';
11
+
12
+ type Address = string;
13
+
14
+ type BalanceStatus = "live" | "cache" | "stale";
15
+ type IBalanceBase = {
16
+ /** The module that this balance was retrieved by */
17
+ source: string;
18
+ useLegacyTransferableCalculation?: boolean;
19
+ /** Has this balance never been fetched, or is it from a cache, or is it up to date? */
20
+ status: BalanceStatus;
21
+ /** The address of the account which owns this balance */
22
+ address: Address;
23
+ /** The token this balance is for */
24
+ tokenId: TokenId;
25
+ networkId: NetworkId;
26
+ };
27
+ type IBalanceSimpleValues = {
28
+ /** For balance types with a simple value, this is the value of the balance (eg, evm native token balance) */
29
+ value: Amount;
30
+ values?: Array<AmountWithLabel<string>>;
31
+ };
32
+ type IBalanceComplexValues = {
33
+ /** For balance types with multple possible states, these are the values of the balance (eg, substrate native token balance) */
34
+ values: Array<AmountWithLabel<string>>;
35
+ value?: undefined;
36
+ };
37
+ /** `IBalance` is a common interface which all balance types must implement. */
38
+ type IBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues);
39
+ type BalanceJson = IBalance;
40
+ /** A collection of `BalanceJson` objects */
41
+ type BalanceJsonList = Record<string, BalanceJson>;
42
+ /** An unlabelled amount of a balance */
43
+ type Amount = string;
44
+ type BalanceStatusTypes = "free" | "reserved" | "locked" | "extra" | "nompool";
45
+ /** A labelled amount of a balance */
46
+ type BaseAmountWithLabel<TLabel extends string> = {
47
+ type: BalanceStatusTypes;
48
+ /**
49
+ * For modules which fetch balances via module sources, the source is equivalent to previous 'subSource' field
50
+ * on the parent balance object
51
+ * e.g. `staking`
52
+ **/
53
+ source?: string;
54
+ label: TLabel;
55
+ amount: Amount;
56
+ meta?: unknown;
57
+ };
58
+ declare const getValueId: (amount: AmountWithLabel<string>) => string;
59
+ /** A labelled locked amount of a balance */
60
+ type LockedAmount<TLabel extends string> = BaseAmountWithLabel<TLabel> & {
61
+ /**
62
+ * By default, the largest locked amount is subtrated from the transferable amount of this balance.
63
+ * If this property is set to true, this particular lock will be skipped when making this calculation.
64
+ * As such, this locked amount will be included in the calculated transferable amount.
65
+ */
66
+ includeInTransferable?: boolean;
67
+ /**
68
+ * By default, tx fees can be deducted from locked amounts of balance.
69
+ * As such, locked amounts are ignored when calculating if the user has enough funds to pay tx fees.
70
+ * If this property is set to true, this particular lock will be subtracted from the available funds when making this calculation.
71
+ * As such, this locked amount will not be included in the calculated available funds.
72
+ */
73
+ excludeFromFeePayable?: boolean;
74
+ };
75
+ type AmountWithLabel<TLabel extends string> = BaseAmountWithLabel<TLabel> | LockedAmount<TLabel> | ExtraAmount<TLabel>;
76
+ /** A labelled extra amount of a balance */
77
+ type ExtraAmount<TLabel extends string> = BaseAmountWithLabel<TLabel> & {
78
+ type: "extra";
79
+ /** If set to true, this extra amount will be included in the calculation of the total amount of this balance. */
80
+ includeInTotal?: boolean;
81
+ };
82
+
83
+ type FormattedAmount<GenericAmount extends AmountWithLabel<TLabel>, TLabel extends string> = Omit<GenericAmount, "amount"> & {
84
+ amount: BalanceFormatter;
85
+ };
86
+ declare function excludeFromTransferableAmount(locks: Amount | FormattedAmount<LockedAmount<string>, string> | Array<FormattedAmount<LockedAmount<string>, string>>): bigint;
87
+ declare function excludeFromFeePayableLocks(locks: Amount | LockedAmount<string> | Array<LockedAmount<string>>): Array<LockedAmount<string>>;
88
+ declare function includeInTotalExtraAmount(extra?: FormattedAmount<ExtraAmount<string>, string> | Array<FormattedAmount<ExtraAmount<string>, string>>): bigint;
89
+ /** A utility type used to extract the underlying `BalanceType` of a specific source from a generalised `BalanceJson` */
90
+ type NarrowBalanceType<S extends IBalance, P> = S extends {
91
+ source: P;
92
+ } ? S : never;
93
+ type BalanceSource = BalanceJson["source"];
94
+ /** TODO: Remove this in favour of a frontend-friendly `ChaindataProvider` */
95
+ type HydrateDb = Partial<{
96
+ networks: NetworkList;
97
+ tokens: TokenList;
98
+ tokenRates: TokenRatesList;
99
+ }>;
100
+ type BalanceSearchQuery = Partial<NonFunctionProperties<Balance>> | ((balance: Balance) => boolean);
101
+ /**
102
+ * A collection of balances.
103
+ */
104
+ declare class Balances {
105
+ #private;
106
+ constructor(balances: Balances | BalanceJsonList | Balance[] | IBalance[] | BalanceJson[] | Balance, hydrate?: HydrateDb);
107
+ /**
108
+ * Calling toJSON on a collection of balances will return the underlying BalanceJsonList.
109
+ */
110
+ toJSON: () => BalanceJsonList;
111
+ /**
112
+ * Allows the collection to be iterated over.
113
+ *
114
+ * @example
115
+ * [...balances].forEach(balance => { // do something // })
116
+ *
117
+ * @example
118
+ * for (const balance of balances) {
119
+ * // do something
120
+ * }
121
+ */
122
+ [Symbol.iterator]: () => ArrayIterator<Balance>;
123
+ /**
124
+ * Hydrates all balances in this collection.
125
+ *
126
+ * @param sources - The sources to hydrate from.
127
+ */
128
+ hydrate: (sources: HydrateDb) => void;
129
+ /**
130
+ * Retrieve a balance from this collection by id.
131
+ *
132
+ * @param id - The id of the balance to fetch.
133
+ * @returns The balance if one exists, or none.
134
+ */
135
+ get: (id: string) => Balance | null;
136
+ /**
137
+ * Retrieve balances from this collection by search query.
138
+ *
139
+ * @param query - The search query.
140
+ * @returns All balances which match the query.
141
+ */
142
+ find: (query: BalanceSearchQuery | BalanceSearchQuery[]) => Balances;
143
+ /**
144
+ * Filters this collection to exclude token balances where the token has a `mirrorOf` field
145
+ * and another balance exists in this collection for the token specified by the `mirrorOf` field.
146
+ */
147
+ filterMirrorTokens: () => Balances;
148
+ /**
149
+ * Filters this collection to only include balances which are not zero AND have a fiat conversion rate.
150
+ */
151
+ filterNonZeroFiat: (type: "total" | "free" | "reserved" | "locked" | "frozen" | "transferable" | "unavailable" | "feePayable", currency: TokenRateCurrency) => Balances;
152
+ /**
153
+ * Add some balances to this collection.
154
+ * Added balances take priority over existing balances.
155
+ * The aggregation of the two collections is returned.
156
+ * The original collection is not mutated.
157
+ *
158
+ * @param balances - Either a balance or collection of balances to add.
159
+ * @returns The new collection of balances.
160
+ */
161
+ add: (balances: Balances | Balance) => Balances;
162
+ /**
163
+ * Remove balances from this collection by id.
164
+ * A new collection without these balances is returned.
165
+ * The original collection is not mutated.
166
+ *
167
+ * @param ids - The id(s) of the balances to remove.
168
+ * @returns The new collection of balances.
169
+ */
170
+ remove: (ids: string[] | string) => Balances;
171
+ get each(): Balance[];
172
+ /** @deprecated use each instead */
173
+ get sorted(): Balance[];
174
+ /**
175
+ * Get the number of balances in this collection.
176
+ *
177
+ * @returns The number of balances in this collection.
178
+ */
179
+ get count(): number;
180
+ /**
181
+ * Get the summed value of balances in this collection.
182
+ * TODO: Sum up token amounts AND fiat amounts
183
+ *
184
+ * @example
185
+ * // Get the sum of all transferable balances in usd.
186
+ * balances.sum.fiat('usd').transferable
187
+ */
188
+ get sum(): SumBalancesFormatter;
189
+ }
190
+ declare const getBalanceId: (balance: Pick<IBalance, "address" | "tokenId">) => string;
191
+ /**
192
+ * An individual balance.
193
+ */
194
+ declare class Balance {
195
+ #private;
196
+ constructor(storage: BalanceJson | IBalance, hydrate?: HydrateDb);
197
+ toJSON: () => BalanceJson;
198
+ isSource: (source: BalanceSource) => boolean;
199
+ hydrate: (hydrate?: HydrateDb) => void;
200
+ get id(): string;
201
+ get source(): string;
202
+ get status(): BalanceStatus;
203
+ get address(): string;
204
+ get networkId(): string;
205
+ get network(): {
206
+ id: string;
207
+ name: string;
208
+ nativeTokenId: string;
209
+ nativeCurrency: {
210
+ decimals: number;
211
+ symbol: string;
212
+ name: string;
213
+ coingeckoId?: string | undefined;
214
+ mirrorOf?: string | undefined;
215
+ logo?: string | undefined;
216
+ };
217
+ blockExplorerUrls: string[];
218
+ genesisHash: `0x${string}`;
219
+ platform: "polkadot";
220
+ chainName: string;
221
+ specName: string;
222
+ specVersion: number;
223
+ account: "secp256k1" | "*25519";
224
+ prefix: number;
225
+ rpcs: string[];
226
+ topology: {
227
+ type: "standalone";
228
+ } | {
229
+ type: "relay";
230
+ } | {
231
+ type: "parachain";
232
+ relayId: string;
233
+ paraId: number;
234
+ };
235
+ isTestnet?: boolean | undefined;
236
+ isDefault?: boolean | undefined;
237
+ forceScan?: boolean | undefined;
238
+ logo?: string | undefined;
239
+ themeColor?: string | undefined;
240
+ chainspecQrUrl?: string | undefined;
241
+ latestMetadataQrUrl?: string | undefined;
242
+ oldPrefix?: number | undefined;
243
+ registryTypes?: any;
244
+ signedExtensions?: any;
245
+ hasCheckMetadataHash?: boolean | undefined;
246
+ hasExtrinsicSignatureTypePrefix?: boolean | undefined;
247
+ isUnknownFeeToken?: boolean | undefined;
248
+ balancesConfig?: {
249
+ "substrate-native"?: {
250
+ disable?: boolean | undefined;
251
+ } | undefined;
252
+ "substrate-assets"?: Record<string, never> | undefined;
253
+ "substrate-psp22"?: Record<string, never> | undefined;
254
+ "substrate-tokens"?: {
255
+ palletId?: string | undefined;
256
+ } | undefined;
257
+ "substrate-foreignassets"?: Record<string, never> | undefined;
258
+ "substrate-hydration"?: Record<string, never> | undefined;
259
+ "substrate-dtao"?: Record<string, never> | undefined;
260
+ } | undefined;
261
+ } | {
262
+ id: string;
263
+ name: string;
264
+ nativeTokenId: string;
265
+ nativeCurrency: {
266
+ decimals: number;
267
+ symbol: string;
268
+ name: string;
269
+ coingeckoId?: string | undefined;
270
+ mirrorOf?: string | undefined;
271
+ logo?: string | undefined;
272
+ };
273
+ blockExplorerUrls: string[];
274
+ platform: "ethereum";
275
+ rpcs: string[];
276
+ isTestnet?: boolean | undefined;
277
+ isDefault?: boolean | undefined;
278
+ forceScan?: boolean | undefined;
279
+ logo?: string | undefined;
280
+ themeColor?: string | undefined;
281
+ substrateChainId?: string | undefined;
282
+ preserveGasEstimate?: boolean | undefined;
283
+ feeType?: "legacy" | "eip-1559" | undefined;
284
+ l2FeeType?: {
285
+ type: "op-stack";
286
+ } | {
287
+ type: "scroll";
288
+ l1GasPriceOracle: `0x${string}`;
289
+ } | undefined;
290
+ contracts?: {
291
+ Erc20Aggregator?: `0x${string}` | undefined;
292
+ Multicall3?: `0x${string}` | undefined;
293
+ } | undefined;
294
+ balancesConfig?: {
295
+ "evm-native"?: Record<string, never> | undefined;
296
+ "evm-erc20"?: Record<string, never> | undefined;
297
+ "evm-uniswapv2"?: Record<string, never> | undefined;
298
+ } | undefined;
299
+ } | {
300
+ id: string;
301
+ name: string;
302
+ nativeTokenId: string;
303
+ nativeCurrency: {
304
+ decimals: number;
305
+ symbol: string;
306
+ name: string;
307
+ coingeckoId?: string | undefined;
308
+ mirrorOf?: string | undefined;
309
+ logo?: string | undefined;
310
+ };
311
+ blockExplorerUrls: string[];
312
+ platform: "solana";
313
+ genesisHash: string;
314
+ rpcs: string[];
315
+ isTestnet?: boolean | undefined;
316
+ isDefault?: boolean | undefined;
317
+ forceScan?: boolean | undefined;
318
+ logo?: string | undefined;
319
+ themeColor?: string | undefined;
320
+ balancesConfig?: {
321
+ "sol-native"?: Record<string, never> | undefined;
322
+ "sol-spl"?: Record<string, never> | undefined;
323
+ } | undefined;
324
+ } | null;
325
+ get tokenId(): string;
326
+ get token(): {
327
+ id: string;
328
+ networkId: string;
329
+ decimals: number;
330
+ symbol: string;
331
+ type: "evm-native";
332
+ platform: "ethereum";
333
+ isDefault?: boolean | undefined;
334
+ name?: string | undefined;
335
+ logo?: string | undefined;
336
+ coingeckoId?: string | undefined;
337
+ noDiscovery?: boolean | undefined;
338
+ mirrorOf?: string | undefined;
339
+ } | {
340
+ id: string;
341
+ networkId: string;
342
+ decimals: number;
343
+ symbol: string;
344
+ type: "evm-erc20";
345
+ platform: "ethereum";
346
+ contractAddress: `0x${string}`;
347
+ isDefault?: boolean | undefined;
348
+ name?: string | undefined;
349
+ logo?: string | undefined;
350
+ coingeckoId?: string | undefined;
351
+ noDiscovery?: boolean | undefined;
352
+ mirrorOf?: string | undefined;
353
+ } | {
354
+ id: string;
355
+ networkId: string;
356
+ decimals: number;
357
+ symbol: string;
358
+ type: "evm-uniswapv2";
359
+ platform: "ethereum";
360
+ contractAddress: `0x${string}`;
361
+ symbol0: string;
362
+ symbol1: string;
363
+ decimals0: number;
364
+ decimals1: number;
365
+ tokenAddress0: `0x${string}`;
366
+ tokenAddress1: `0x${string}`;
367
+ isDefault?: boolean | undefined;
368
+ name?: string | undefined;
369
+ logo?: string | undefined;
370
+ coingeckoId?: string | undefined;
371
+ noDiscovery?: boolean | undefined;
372
+ mirrorOf?: string | undefined;
373
+ isCustom?: boolean | undefined;
374
+ coingeckoId0?: string | undefined;
375
+ coingeckoId1?: string | undefined;
376
+ } | {
377
+ id: string;
378
+ networkId: string;
379
+ decimals: number;
380
+ symbol: string;
381
+ type: "substrate-assets";
382
+ platform: "polkadot";
383
+ assetId: string;
384
+ isSufficient: boolean;
385
+ existentialDeposit: string;
386
+ isDefault?: boolean | undefined;
387
+ name?: string | undefined;
388
+ logo?: string | undefined;
389
+ coingeckoId?: string | undefined;
390
+ noDiscovery?: boolean | undefined;
391
+ mirrorOf?: string | undefined;
392
+ isFrozen?: boolean | undefined;
393
+ } | {
394
+ id: string;
395
+ networkId: string;
396
+ decimals: number;
397
+ symbol: string;
398
+ type: "substrate-dtao";
399
+ platform: "polkadot";
400
+ netuid: number;
401
+ isTransferable: boolean;
402
+ isDefault?: boolean | undefined;
403
+ name?: string | undefined;
404
+ logo?: string | undefined;
405
+ coingeckoId?: string | undefined;
406
+ noDiscovery?: boolean | undefined;
407
+ mirrorOf?: string | undefined;
408
+ subnetName?: string | undefined;
409
+ hotkey?: string | undefined;
410
+ } | {
411
+ id: string;
412
+ networkId: string;
413
+ decimals: number;
414
+ symbol: string;
415
+ type: "substrate-foreignassets";
416
+ platform: "polkadot";
417
+ onChainId: string;
418
+ isSufficient: boolean;
419
+ existentialDeposit: string;
420
+ isDefault?: boolean | undefined;
421
+ name?: string | undefined;
422
+ logo?: string | undefined;
423
+ coingeckoId?: string | undefined;
424
+ noDiscovery?: boolean | undefined;
425
+ mirrorOf?: string | undefined;
426
+ isFrozen?: boolean | undefined;
427
+ } | {
428
+ id: string;
429
+ networkId: string;
430
+ decimals: number;
431
+ symbol: string;
432
+ type: "substrate-native";
433
+ platform: "polkadot";
434
+ existentialDeposit: string;
435
+ isDefault?: boolean | undefined;
436
+ name?: string | undefined;
437
+ logo?: string | undefined;
438
+ coingeckoId?: string | undefined;
439
+ noDiscovery?: boolean | undefined;
440
+ mirrorOf?: string | undefined;
441
+ } | {
442
+ id: string;
443
+ networkId: string;
444
+ decimals: number;
445
+ symbol: string;
446
+ type: "substrate-psp22";
447
+ platform: "polkadot";
448
+ contractAddress: string;
449
+ isDefault?: boolean | undefined;
450
+ name?: string | undefined;
451
+ logo?: string | undefined;
452
+ coingeckoId?: string | undefined;
453
+ noDiscovery?: boolean | undefined;
454
+ mirrorOf?: string | undefined;
455
+ } | {
456
+ id: string;
457
+ networkId: string;
458
+ decimals: number;
459
+ symbol: string;
460
+ type: "substrate-tokens";
461
+ platform: "polkadot";
462
+ onChainId: string | number;
463
+ existentialDeposit: string;
464
+ isDefault?: boolean | undefined;
465
+ name?: string | undefined;
466
+ logo?: string | undefined;
467
+ coingeckoId?: string | undefined;
468
+ noDiscovery?: boolean | undefined;
469
+ mirrorOf?: string | undefined;
470
+ } | {
471
+ id: string;
472
+ networkId: string;
473
+ decimals: number;
474
+ symbol: string;
475
+ type: "substrate-hydration";
476
+ platform: "polkadot";
477
+ onChainId: number;
478
+ assetType: "Token" | "Erc20" | "External";
479
+ isSufficient: boolean;
480
+ existentialDeposit: string;
481
+ isDefault?: boolean | undefined;
482
+ name?: string | undefined;
483
+ logo?: string | undefined;
484
+ coingeckoId?: string | undefined;
485
+ noDiscovery?: boolean | undefined;
486
+ mirrorOf?: string | undefined;
487
+ } | {
488
+ id: string;
489
+ networkId: string;
490
+ decimals: number;
491
+ symbol: string;
492
+ type: "sol-native";
493
+ platform: "solana";
494
+ isDefault?: boolean | undefined;
495
+ name?: string | undefined;
496
+ logo?: string | undefined;
497
+ coingeckoId?: string | undefined;
498
+ noDiscovery?: boolean | undefined;
499
+ mirrorOf?: string | undefined;
500
+ } | {
501
+ id: string;
502
+ networkId: string;
503
+ decimals: number;
504
+ symbol: string;
505
+ type: "sol-spl";
506
+ platform: "solana";
507
+ mintAddress: string;
508
+ isDefault?: boolean | undefined;
509
+ name?: string | undefined;
510
+ logo?: string | undefined;
511
+ coingeckoId?: string | undefined;
512
+ noDiscovery?: boolean | undefined;
513
+ mirrorOf?: string | undefined;
514
+ } | null;
515
+ get decimals(): number | null;
516
+ get rates(): TokenRates | null;
517
+ /**
518
+ * A general method to get formatted values matching a certain type from this balance.
519
+ * @param valueType - The type of value to get.
520
+ * @returns An array of the values matching the type with formatted amounts.
521
+ */
522
+ private getValue;
523
+ /**
524
+ * A general method to get values matching a certain type from this balance.
525
+ * @param valueType - The type of value to get.
526
+ * @returns An array of the values matching the type.
527
+ */
528
+ private getRawValue;
529
+ /**
530
+ * A general method to add a value to the array of values for this balance.
531
+ * @param valueType - The type of value to add.
532
+ * @returns A function which can be used to add a value to the array of values for this balance.
533
+ */
534
+ private addValue;
535
+ /**
536
+ * The total balance of this token.
537
+ * Includes the free and the reserved amount.
538
+ * The balance will be reaped if this goes below the existential deposit.
539
+ */
540
+ get total(): BalanceFormatter;
541
+ /** The non-reserved balance of this token. Includes the frozen amount. Is included in the total. */
542
+ get free(): BalanceFormatter;
543
+ /** The reserved balance of this token. Is included in the total. */
544
+ get reserved(): BalanceFormatter;
545
+ get reserves(): FormattedAmount<AmountWithLabel<string>, string>[];
546
+ /** The frozen balance of this token. Is included in the free amount. */
547
+ get locked(): BalanceFormatter;
548
+ get locks(): FormattedAmount<AmountWithLabel<string>, string>[];
549
+ get nompools(): FormattedAmount<AmountWithLabel<string>, string>[];
550
+ /** The extra balance of this token */
551
+ get extra(): ExtraAmount<string>[] | undefined;
552
+ /** @deprecated Use balance.locked */
553
+ get frozen(): BalanceFormatter;
554
+ /** The transferable balance of this token. Is generally the free amount - the miscFrozen amount. */
555
+ get transferable(): BalanceFormatter;
556
+ /**
557
+ * The unavailable balance of this token.
558
+ * Prior to the Fungible trait, this was the locked amount + the reserved amount, i.e. `locked + reserved`.
559
+ * Now, it is the bigger of the locked amount and the reserved amounts, i.e. `max(locked, reserved)`.
560
+ */
561
+ get unavailable(): BalanceFormatter;
562
+ /** The feePayable balance of this token. Is generally the free amount - the feeFrozen amount. */
563
+ get feePayable(): BalanceFormatter;
564
+ }
565
+ declare class BalanceValueGetter {
566
+ #private;
567
+ constructor(storage: BalanceJson);
568
+ get(valueType: BalanceStatusTypes): AmountWithLabel<string>[];
569
+ add(valueType: BalanceStatusTypes, amount: Omit<AmountWithLabel<string>, "type">): void;
570
+ }
571
+ declare class BalanceFormatter {
572
+ #private;
573
+ constructor(planck: string | bigint | undefined, decimals?: number | undefined, fiatRatios?: TokenRates | null);
574
+ toJSON: () => string;
575
+ get planck(): bigint;
576
+ get tokens(): string;
577
+ fiat(currency: TokenRateCurrency): number | null;
578
+ }
579
+ declare class PlanckSumBalancesFormatter {
580
+ #private;
581
+ constructor(balances: Balances);
582
+ /**
583
+ * The total balance of these tokens. Includes the free and the reserved amount.
584
+ */
585
+ get total(): bigint;
586
+ /** The non-reserved balance of these tokens. Includes the frozen amount. Is included in the total. */
587
+ get free(): bigint;
588
+ /** The reserved balance of these tokens. Is included in the total. */
589
+ get reserved(): bigint;
590
+ /** The frozen balance of these tokens. Is included in the free amount. */
591
+ get locked(): bigint;
592
+ /** @deprecated Use balances.locked */
593
+ get frozen(): bigint;
594
+ /** The transferable balance of these tokens. Is generally the free amount - the miscFrozen amount. */
595
+ get transferable(): bigint;
596
+ /** The unavailable balance of these tokens. */
597
+ get unavailable(): bigint;
598
+ /** The feePayable balance of these tokens. Is generally the free amount - the feeFrozen amount. */
599
+ get feePayable(): bigint;
600
+ }
601
+ declare class FiatSumBalancesFormatter {
602
+ #private;
603
+ constructor(balances: Balances, currency: TokenRateCurrency);
604
+ /**
605
+ * The total balance of these tokens. Includes the free and the reserved amount.
606
+ */
607
+ get total(): number;
608
+ /** The non-reserved balance of these tokens. Includes the frozen amount. Is included in the total. */
609
+ get free(): number;
610
+ /** The reserved balance of these tokens. Is included in the total. */
611
+ get reserved(): number;
612
+ /** The frozen balance of these tokens. Is included in the free amount. */
613
+ get locked(): number;
614
+ /** @deprecated Use balances.locked */
615
+ get frozen(): number;
616
+ /** The transferable balance of these tokens. Is generally the free amount - the miscFrozen amount. */
617
+ get transferable(): number;
618
+ /** The unavailable balance of these tokens. */
619
+ get unavailable(): number;
620
+ /** The feePayable balance of these tokens. Is generally the free amount - the feeFrozen amount. */
621
+ get feePayable(): number;
622
+ }
623
+ declare class SumBalancesFormatter {
624
+ #private;
625
+ constructor(balances: Balances);
626
+ get planck(): PlanckSumBalancesFormatter;
627
+ fiat(currency: TokenRateCurrency): FiatSumBalancesFormatter;
628
+ change24h(currency: TokenRateCurrency): Change24hCurrencyFormatter;
629
+ }
630
+ declare class Change24hCurrencyFormatter {
631
+ #private;
632
+ constructor(balances: Balances, currency: TokenRateCurrency);
633
+ get total(): {
634
+ diff: number;
635
+ ratio: number;
636
+ } | null;
637
+ get free(): {
638
+ diff: number;
639
+ ratio: number;
640
+ } | null;
641
+ get reserved(): {
642
+ diff: number;
643
+ ratio: number;
644
+ } | null;
645
+ get locked(): {
646
+ diff: number;
647
+ ratio: number;
648
+ } | null;
649
+ get frozen(): {
650
+ diff: number;
651
+ ratio: number;
652
+ } | null;
653
+ get transferable(): {
654
+ diff: number;
655
+ ratio: number;
656
+ } | null;
657
+ get unavailable(): {
658
+ diff: number;
659
+ ratio: number;
660
+ } | null;
661
+ get feePayable(): {
662
+ diff: number;
663
+ ratio: number;
664
+ } | null;
665
+ }
666
+ declare const filterMirrorTokens: (balance: Balance, _i: number, balances: Balance[]) => boolean;
667
+
668
+ type ChainConnectors = {
669
+ substrate?: IChainConnectorDot;
670
+ evm?: IChainConnectorEth;
671
+ solana?: IChainConnectorSol;
672
+ };
673
+
674
+ type TokenPlatform<T extends TokenType> = TokenOfType<T>["platform"];
675
+ type PlatformConnector<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? IChainConnectorEth : P extends "polkadot" ? IChainConnectorDot : P extends "solana" ? IChainConnectorSol : never;
676
+ type DotTransferCallData = {
677
+ address: string;
678
+ method: `0x${string}`;
679
+ };
680
+ type EthTransferCallData = {
681
+ from: string;
682
+ to: string;
683
+ data: `0x${string}`;
684
+ value?: string;
685
+ };
686
+ type SolTransferCallData = TransactionInstruction[];
687
+ type BalanceTransferType = "keep-alive" | "all" | "allow-death";
688
+ type CallDataOf<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? EthTransferCallData : P extends "polkadot" ? DotTransferCallData : P extends "solana" ? SolTransferCallData : never;
689
+ type TokensWithAddresses = Array<[Token, Address[]]>;
690
+ type FetchBalanceErrors = Array<{
691
+ tokenId: TokenId;
692
+ address: Address;
693
+ error: Error;
694
+ }>;
695
+ type FetchBalanceResults = {
696
+ success: IBalance[];
697
+ errors: FetchBalanceErrors;
698
+ /**
699
+ * tokens identified at runtime while fetching balances, that were not part of the original request
700
+ */
701
+ dynamicTokens?: Token[];
702
+ };
703
+ interface IBalanceModule<Type extends TokenType, TokenConfig = unknown, ModuleConfig = unknown, MiniMetadataExtra = unknown> {
704
+ type: Type;
705
+ platform: TokenPlatform<Type>;
706
+ getMiniMetadata: (arg: TokenPlatform<Type> extends "polkadot" ? {
707
+ networkId: string;
708
+ specVersion: number;
709
+ metadataRpc: `0x${string}`;
710
+ config?: ModuleConfig;
711
+ } : never) => TokenPlatform<Type> extends "polkadot" ? MiniMetadata<MiniMetadataExtra> : never;
712
+ fetchTokens: (arg: TokenPlatform<Type> extends "polkadot" ? {
713
+ networkId: DotNetworkId;
714
+ tokens: TokenConfig[];
715
+ connector: PlatformConnector<TokenPlatform<Type>>;
716
+ miniMetadata: MiniMetadata<MiniMetadataExtra>;
717
+ cache: Record<TokenId, unknown>;
718
+ } : {
719
+ networkId: SolNetworkId;
720
+ tokens: TokenConfig[];
721
+ connector: PlatformConnector<TokenPlatform<Type>>;
722
+ cache: Record<TokenId, unknown>;
723
+ }) => Promise<TokenOfType<Type>[]>;
724
+ fetchBalances: (arg: TokenPlatform<Type> extends "polkadot" ? {
725
+ networkId: DotNetworkId;
726
+ tokensWithAddresses: TokensWithAddresses;
727
+ connector: PlatformConnector<TokenPlatform<Type>>;
728
+ miniMetadata: MiniMetadata<MiniMetadataExtra>;
729
+ } : {
730
+ networkId: EthNetworkId;
731
+ tokensWithAddresses: TokensWithAddresses;
732
+ connector: PlatformConnector<TokenPlatform<Type>>;
733
+ }) => Promise<FetchBalanceResults>;
734
+ subscribeBalances: (arg: TokenPlatform<Type> extends "polkadot" ? {
735
+ networkId: DotNetworkId;
736
+ tokensWithAddresses: TokensWithAddresses;
737
+ connector: PlatformConnector<TokenPlatform<Type>>;
738
+ miniMetadata: MiniMetadata<MiniMetadataExtra>;
739
+ } : {
740
+ networkId: EthNetworkId;
741
+ tokensWithAddresses: TokensWithAddresses;
742
+ connector: PlatformConnector<TokenPlatform<Type>>;
743
+ }) => Observable<FetchBalanceResults>;
744
+ getTransferCallData: (arg: TokenPlatform<Type> extends "polkadot" ? {
745
+ from: string;
746
+ to: string;
747
+ value: string;
748
+ token: Token;
749
+ metadataRpc: `0x${string}`;
750
+ type: BalanceTransferType;
751
+ connector: PlatformConnector<TokenPlatform<Type>>;
752
+ config?: ModuleConfig;
753
+ } : TokenPlatform<Type> extends "ethereum" ? {
754
+ from: string;
755
+ to: string;
756
+ value: string;
757
+ token: Token;
758
+ } : TokenPlatform<Type> extends "solana" ? {
759
+ from: string;
760
+ to: string;
761
+ value: string;
762
+ token: Token;
763
+ connector: PlatformConnector<TokenPlatform<Type>>;
764
+ } : never) => CallDataOf<TokenPlatform<Type>> | Promise<CallDataOf<TokenPlatform<Type>>>;
765
+ }
766
+
767
+ /** For fast db access, you can calculate the primary key for a miniMetadata using this method */
768
+ declare const deriveMiniMetadataId: ({ source, chainId, specVersion, }: Pick<AnyMiniMetadata, "source" | "chainId" | "specVersion">) => string;
769
+ type MiniMetadata<Extra = unknown> = Omit<AnyMiniMetadata, "extra"> & {
770
+ extra: Extra;
771
+ };
772
+
773
+ /**
774
+ * A callback with either an error or a result.
775
+ */
776
+ interface SubscriptionCallback<Result> {
777
+ (error: null, result: Result): void;
778
+ (error: any, result?: never): void;
779
+ }
780
+ /**
781
+ * A function which cancels a subscription when called.
782
+ */
783
+ type UnsubscribeFn = () => void;
784
+
785
+ type BalancesStatus = "initialising" | "live";
786
+ type BalancesResult = {
787
+ status: BalancesStatus;
788
+ balances: IBalance[];
789
+ failedBalanceIds: string[];
790
+ };
791
+ type BalancesStorage = {
792
+ balances: IBalance[];
793
+ miniMetadatas: MiniMetadata[];
794
+ };
795
+ declare class BalancesProvider {
796
+ #private;
797
+ constructor(chaindataProvider: ChaindataProvider, chainConnectors: ChainConnectors, storage?: BalancesStorage);
798
+ get storage$(): Observable<BalancesStorage>;
799
+ private get storedMiniMetadataMapById$();
800
+ getBalances$(addressesByTokenId: Record<TokenId, Address[]>): Observable<BalancesResult>;
801
+ fetchBalances(addressesByTokenId: Record<TokenId, Address[]>): Promise<IBalance[]>;
802
+ getDetectedTokensId$(address: string): Observable<TokenId[]>;
803
+ private getNetworkBalances$;
804
+ private getPolkadotNetworkModuleBalances$;
805
+ private getEthereumNetworkModuleBalances$;
806
+ private getSolanaNetworkModuleBalances$;
807
+ private updateStorage$;
808
+ private getNetworkMiniMetadatas$;
809
+ private getNetworkSpecVersion$;
810
+ private getMiniMetadatas$;
811
+ private getStoredMiniMetadatas$;
812
+ private getDefaultMiniMetadatas$;
813
+ private getStoredBalances;
814
+ private cleanupAddressesByTokenId$;
815
+ }
816
+
817
+ declare const erc20BalancesAggregatorAbi: readonly [{
818
+ readonly name: "balances";
819
+ readonly type: "function";
820
+ readonly stateMutability: "view";
821
+ readonly inputs: readonly [{
822
+ readonly type: "tuple[]";
823
+ readonly components: readonly [{
824
+ readonly type: "address";
825
+ readonly name: "account";
826
+ }, {
827
+ readonly type: "address";
828
+ readonly name: "token";
829
+ }];
830
+ readonly name: "accountTokens";
831
+ }];
832
+ readonly outputs: readonly [{
833
+ readonly type: "uint256[]";
834
+ }];
835
+ }];
836
+
837
+ declare const abiMulticall: readonly [{
838
+ readonly name: "aggregate";
839
+ readonly type: "function";
840
+ readonly stateMutability: "payable";
841
+ readonly inputs: readonly [{
842
+ readonly type: "tuple[]";
843
+ readonly components: readonly [{
844
+ readonly type: "address";
845
+ readonly name: "target";
846
+ }, {
847
+ readonly type: "bytes";
848
+ readonly name: "callData";
849
+ }];
850
+ readonly name: "calls";
851
+ }];
852
+ readonly outputs: readonly [{
853
+ readonly type: "uint256";
854
+ readonly name: "blockNumber";
855
+ }, {
856
+ readonly type: "bytes[]";
857
+ readonly name: "returnData";
858
+ }];
859
+ }, {
860
+ readonly name: "aggregate3";
861
+ readonly type: "function";
862
+ readonly stateMutability: "payable";
863
+ readonly inputs: readonly [{
864
+ readonly type: "tuple[]";
865
+ readonly components: readonly [{
866
+ readonly type: "address";
867
+ readonly name: "target";
868
+ }, {
869
+ readonly type: "bool";
870
+ readonly name: "allowFailure";
871
+ }, {
872
+ readonly type: "bytes";
873
+ readonly name: "callData";
874
+ }];
875
+ readonly name: "calls";
876
+ }];
877
+ readonly outputs: readonly [{
878
+ readonly type: "tuple[]";
879
+ readonly components: readonly [{
880
+ readonly type: "bool";
881
+ readonly name: "success";
882
+ }, {
883
+ readonly type: "bytes";
884
+ readonly name: "returnData";
885
+ }];
886
+ readonly name: "returnData";
887
+ }];
888
+ }, {
889
+ readonly name: "aggregate3Value";
890
+ readonly type: "function";
891
+ readonly stateMutability: "payable";
892
+ readonly inputs: readonly [{
893
+ readonly type: "tuple[]";
894
+ readonly components: readonly [{
895
+ readonly type: "address";
896
+ readonly name: "target";
897
+ }, {
898
+ readonly type: "bool";
899
+ readonly name: "allowFailure";
900
+ }, {
901
+ readonly type: "uint256";
902
+ readonly name: "value";
903
+ }, {
904
+ readonly type: "bytes";
905
+ readonly name: "callData";
906
+ }];
907
+ readonly name: "calls";
908
+ }];
909
+ readonly outputs: readonly [{
910
+ readonly type: "tuple[]";
911
+ readonly components: readonly [{
912
+ readonly type: "bool";
913
+ readonly name: "success";
914
+ }, {
915
+ readonly type: "bytes";
916
+ readonly name: "returnData";
917
+ }];
918
+ readonly name: "returnData";
919
+ }];
920
+ }, {
921
+ readonly name: "blockAndAggregate";
922
+ readonly type: "function";
923
+ readonly stateMutability: "payable";
924
+ readonly inputs: readonly [{
925
+ readonly type: "tuple[]";
926
+ readonly components: readonly [{
927
+ readonly type: "address";
928
+ readonly name: "target";
929
+ }, {
930
+ readonly type: "bytes";
931
+ readonly name: "callData";
932
+ }];
933
+ readonly name: "calls";
934
+ }];
935
+ readonly outputs: readonly [{
936
+ readonly type: "uint256";
937
+ readonly name: "blockNumber";
938
+ }, {
939
+ readonly type: "bytes32";
940
+ readonly name: "blockHash";
941
+ }, {
942
+ readonly type: "tuple[]";
943
+ readonly components: readonly [{
944
+ readonly type: "bool";
945
+ readonly name: "success";
946
+ }, {
947
+ readonly type: "bytes";
948
+ readonly name: "returnData";
949
+ }];
950
+ readonly name: "returnData";
951
+ }];
952
+ }, {
953
+ readonly name: "getBasefee";
954
+ readonly type: "function";
955
+ readonly stateMutability: "view";
956
+ readonly inputs: readonly [];
957
+ readonly outputs: readonly [{
958
+ readonly type: "uint256";
959
+ readonly name: "basefee";
960
+ }];
961
+ }, {
962
+ readonly name: "getBlockHash";
963
+ readonly type: "function";
964
+ readonly stateMutability: "view";
965
+ readonly inputs: readonly [{
966
+ readonly type: "uint256";
967
+ readonly name: "blockNumber";
968
+ }];
969
+ readonly outputs: readonly [{
970
+ readonly type: "bytes32";
971
+ readonly name: "blockHash";
972
+ }];
973
+ }, {
974
+ readonly name: "getBlockNumber";
975
+ readonly type: "function";
976
+ readonly stateMutability: "view";
977
+ readonly inputs: readonly [];
978
+ readonly outputs: readonly [{
979
+ readonly type: "uint256";
980
+ readonly name: "blockNumber";
981
+ }];
982
+ }, {
983
+ readonly name: "getChainId";
984
+ readonly type: "function";
985
+ readonly stateMutability: "view";
986
+ readonly inputs: readonly [];
987
+ readonly outputs: readonly [{
988
+ readonly type: "uint256";
989
+ readonly name: "chainid";
990
+ }];
991
+ }, {
992
+ readonly name: "getCurrentBlockCoinbase";
993
+ readonly type: "function";
994
+ readonly stateMutability: "view";
995
+ readonly inputs: readonly [];
996
+ readonly outputs: readonly [{
997
+ readonly type: "address";
998
+ readonly name: "coinbase";
999
+ }];
1000
+ }, {
1001
+ readonly name: "getCurrentBlockDifficulty";
1002
+ readonly type: "function";
1003
+ readonly stateMutability: "view";
1004
+ readonly inputs: readonly [];
1005
+ readonly outputs: readonly [{
1006
+ readonly type: "uint256";
1007
+ readonly name: "difficulty";
1008
+ }];
1009
+ }, {
1010
+ readonly name: "getCurrentBlockGasLimit";
1011
+ readonly type: "function";
1012
+ readonly stateMutability: "view";
1013
+ readonly inputs: readonly [];
1014
+ readonly outputs: readonly [{
1015
+ readonly type: "uint256";
1016
+ readonly name: "gaslimit";
1017
+ }];
1018
+ }, {
1019
+ readonly name: "getCurrentBlockTimestamp";
1020
+ readonly type: "function";
1021
+ readonly stateMutability: "view";
1022
+ readonly inputs: readonly [];
1023
+ readonly outputs: readonly [{
1024
+ readonly type: "uint256";
1025
+ readonly name: "timestamp";
1026
+ }];
1027
+ }, {
1028
+ readonly name: "getEthBalance";
1029
+ readonly type: "function";
1030
+ readonly stateMutability: "view";
1031
+ readonly inputs: readonly [{
1032
+ readonly type: "address";
1033
+ readonly name: "addr";
1034
+ }];
1035
+ readonly outputs: readonly [{
1036
+ readonly type: "uint256";
1037
+ readonly name: "balance";
1038
+ }];
1039
+ }, {
1040
+ readonly name: "getLastBlockHash";
1041
+ readonly type: "function";
1042
+ readonly stateMutability: "view";
1043
+ readonly inputs: readonly [];
1044
+ readonly outputs: readonly [{
1045
+ readonly type: "bytes32";
1046
+ readonly name: "blockHash";
1047
+ }];
1048
+ }, {
1049
+ readonly name: "tryAggregate";
1050
+ readonly type: "function";
1051
+ readonly stateMutability: "payable";
1052
+ readonly inputs: readonly [{
1053
+ readonly type: "bool";
1054
+ readonly name: "requireSuccess";
1055
+ }, {
1056
+ readonly type: "tuple[]";
1057
+ readonly components: readonly [{
1058
+ readonly type: "address";
1059
+ readonly name: "target";
1060
+ }, {
1061
+ readonly type: "bytes";
1062
+ readonly name: "callData";
1063
+ }];
1064
+ readonly name: "calls";
1065
+ }];
1066
+ readonly outputs: readonly [{
1067
+ readonly type: "tuple[]";
1068
+ readonly components: readonly [{
1069
+ readonly type: "bool";
1070
+ readonly name: "success";
1071
+ }, {
1072
+ readonly type: "bytes";
1073
+ readonly name: "returnData";
1074
+ }];
1075
+ readonly name: "returnData";
1076
+ }];
1077
+ }, {
1078
+ readonly name: "tryBlockAndAggregate";
1079
+ readonly type: "function";
1080
+ readonly stateMutability: "payable";
1081
+ readonly inputs: readonly [{
1082
+ readonly type: "bool";
1083
+ readonly name: "requireSuccess";
1084
+ }, {
1085
+ readonly type: "tuple[]";
1086
+ readonly components: readonly [{
1087
+ readonly type: "address";
1088
+ readonly name: "target";
1089
+ }, {
1090
+ readonly type: "bytes";
1091
+ readonly name: "callData";
1092
+ }];
1093
+ readonly name: "calls";
1094
+ }];
1095
+ readonly outputs: readonly [{
1096
+ readonly type: "uint256";
1097
+ readonly name: "blockNumber";
1098
+ }, {
1099
+ readonly type: "bytes32";
1100
+ readonly name: "blockHash";
1101
+ }, {
1102
+ readonly type: "tuple[]";
1103
+ readonly components: readonly [{
1104
+ readonly type: "bool";
1105
+ readonly name: "success";
1106
+ }, {
1107
+ readonly type: "bytes";
1108
+ readonly name: "returnData";
1109
+ }];
1110
+ readonly name: "returnData";
1111
+ }];
1112
+ }];
1113
+
1114
+ declare const uniswapV2PairAbi: readonly [{
1115
+ readonly anonymous: false;
1116
+ readonly inputs: readonly [{
1117
+ readonly indexed: true;
1118
+ readonly internalType: "address";
1119
+ readonly name: "owner";
1120
+ readonly type: "address";
1121
+ }, {
1122
+ readonly indexed: true;
1123
+ readonly internalType: "address";
1124
+ readonly name: "spender";
1125
+ readonly type: "address";
1126
+ }, {
1127
+ readonly indexed: false;
1128
+ readonly internalType: "uint256";
1129
+ readonly name: "value";
1130
+ readonly type: "uint256";
1131
+ }];
1132
+ readonly name: "Approval";
1133
+ readonly type: "event";
1134
+ }, {
1135
+ readonly anonymous: false;
1136
+ readonly inputs: readonly [{
1137
+ readonly indexed: true;
1138
+ readonly internalType: "address";
1139
+ readonly name: "sender";
1140
+ readonly type: "address";
1141
+ }, {
1142
+ readonly indexed: false;
1143
+ readonly internalType: "uint256";
1144
+ readonly name: "amount0";
1145
+ readonly type: "uint256";
1146
+ }, {
1147
+ readonly indexed: false;
1148
+ readonly internalType: "uint256";
1149
+ readonly name: "amount1";
1150
+ readonly type: "uint256";
1151
+ }, {
1152
+ readonly indexed: true;
1153
+ readonly internalType: "address";
1154
+ readonly name: "to";
1155
+ readonly type: "address";
1156
+ }];
1157
+ readonly name: "Burn";
1158
+ readonly type: "event";
1159
+ }, {
1160
+ readonly anonymous: false;
1161
+ readonly inputs: readonly [{
1162
+ readonly indexed: true;
1163
+ readonly internalType: "address";
1164
+ readonly name: "sender";
1165
+ readonly type: "address";
1166
+ }, {
1167
+ readonly indexed: false;
1168
+ readonly internalType: "uint256";
1169
+ readonly name: "amount0";
1170
+ readonly type: "uint256";
1171
+ }, {
1172
+ readonly indexed: false;
1173
+ readonly internalType: "uint256";
1174
+ readonly name: "amount1";
1175
+ readonly type: "uint256";
1176
+ }];
1177
+ readonly name: "Mint";
1178
+ readonly type: "event";
1179
+ }, {
1180
+ readonly anonymous: false;
1181
+ readonly inputs: readonly [{
1182
+ readonly indexed: true;
1183
+ readonly internalType: "address";
1184
+ readonly name: "sender";
1185
+ readonly type: "address";
1186
+ }, {
1187
+ readonly indexed: false;
1188
+ readonly internalType: "uint256";
1189
+ readonly name: "amount0In";
1190
+ readonly type: "uint256";
1191
+ }, {
1192
+ readonly indexed: false;
1193
+ readonly internalType: "uint256";
1194
+ readonly name: "amount1In";
1195
+ readonly type: "uint256";
1196
+ }, {
1197
+ readonly indexed: false;
1198
+ readonly internalType: "uint256";
1199
+ readonly name: "amount0Out";
1200
+ readonly type: "uint256";
1201
+ }, {
1202
+ readonly indexed: false;
1203
+ readonly internalType: "uint256";
1204
+ readonly name: "amount1Out";
1205
+ readonly type: "uint256";
1206
+ }, {
1207
+ readonly indexed: true;
1208
+ readonly internalType: "address";
1209
+ readonly name: "to";
1210
+ readonly type: "address";
1211
+ }];
1212
+ readonly name: "Swap";
1213
+ readonly type: "event";
1214
+ }, {
1215
+ readonly anonymous: false;
1216
+ readonly inputs: readonly [{
1217
+ readonly indexed: false;
1218
+ readonly internalType: "uint112";
1219
+ readonly name: "reserve0";
1220
+ readonly type: "uint112";
1221
+ }, {
1222
+ readonly indexed: false;
1223
+ readonly internalType: "uint112";
1224
+ readonly name: "reserve1";
1225
+ readonly type: "uint112";
1226
+ }];
1227
+ readonly name: "Sync";
1228
+ readonly type: "event";
1229
+ }, {
1230
+ readonly anonymous: false;
1231
+ readonly inputs: readonly [{
1232
+ readonly indexed: true;
1233
+ readonly internalType: "address";
1234
+ readonly name: "from";
1235
+ readonly type: "address";
1236
+ }, {
1237
+ readonly indexed: true;
1238
+ readonly internalType: "address";
1239
+ readonly name: "to";
1240
+ readonly type: "address";
1241
+ }, {
1242
+ readonly indexed: false;
1243
+ readonly internalType: "uint256";
1244
+ readonly name: "value";
1245
+ readonly type: "uint256";
1246
+ }];
1247
+ readonly name: "Transfer";
1248
+ readonly type: "event";
1249
+ }, {
1250
+ readonly constant: true;
1251
+ readonly inputs: readonly [];
1252
+ readonly name: "DOMAIN_SEPARATOR";
1253
+ readonly outputs: readonly [{
1254
+ readonly internalType: "bytes32";
1255
+ readonly name: "";
1256
+ readonly type: "bytes32";
1257
+ }];
1258
+ readonly payable: false;
1259
+ readonly stateMutability: "view";
1260
+ readonly type: "function";
1261
+ }, {
1262
+ readonly constant: true;
1263
+ readonly inputs: readonly [];
1264
+ readonly name: "MINIMUM_LIQUIDITY";
1265
+ readonly outputs: readonly [{
1266
+ readonly internalType: "uint256";
1267
+ readonly name: "";
1268
+ readonly type: "uint256";
1269
+ }];
1270
+ readonly payable: false;
1271
+ readonly stateMutability: "pure";
1272
+ readonly type: "function";
1273
+ }, {
1274
+ readonly constant: true;
1275
+ readonly inputs: readonly [];
1276
+ readonly name: "PERMIT_TYPEHASH";
1277
+ readonly outputs: readonly [{
1278
+ readonly internalType: "bytes32";
1279
+ readonly name: "";
1280
+ readonly type: "bytes32";
1281
+ }];
1282
+ readonly payable: false;
1283
+ readonly stateMutability: "pure";
1284
+ readonly type: "function";
1285
+ }, {
1286
+ readonly constant: true;
1287
+ readonly inputs: readonly [{
1288
+ readonly internalType: "address";
1289
+ readonly name: "owner";
1290
+ readonly type: "address";
1291
+ }, {
1292
+ readonly internalType: "address";
1293
+ readonly name: "spender";
1294
+ readonly type: "address";
1295
+ }];
1296
+ readonly name: "allowance";
1297
+ readonly outputs: readonly [{
1298
+ readonly internalType: "uint256";
1299
+ readonly name: "";
1300
+ readonly type: "uint256";
1301
+ }];
1302
+ readonly payable: false;
1303
+ readonly stateMutability: "view";
1304
+ readonly type: "function";
1305
+ }, {
1306
+ readonly constant: false;
1307
+ readonly inputs: readonly [{
1308
+ readonly internalType: "address";
1309
+ readonly name: "spender";
1310
+ readonly type: "address";
1311
+ }, {
1312
+ readonly internalType: "uint256";
1313
+ readonly name: "value";
1314
+ readonly type: "uint256";
1315
+ }];
1316
+ readonly name: "approve";
1317
+ readonly outputs: readonly [{
1318
+ readonly internalType: "bool";
1319
+ readonly name: "";
1320
+ readonly type: "bool";
1321
+ }];
1322
+ readonly payable: false;
1323
+ readonly stateMutability: "nonpayable";
1324
+ readonly type: "function";
1325
+ }, {
1326
+ readonly constant: true;
1327
+ readonly inputs: readonly [{
1328
+ readonly internalType: "address";
1329
+ readonly name: "owner";
1330
+ readonly type: "address";
1331
+ }];
1332
+ readonly name: "balanceOf";
1333
+ readonly outputs: readonly [{
1334
+ readonly internalType: "uint256";
1335
+ readonly name: "";
1336
+ readonly type: "uint256";
1337
+ }];
1338
+ readonly payable: false;
1339
+ readonly stateMutability: "view";
1340
+ readonly type: "function";
1341
+ }, {
1342
+ readonly constant: false;
1343
+ readonly inputs: readonly [{
1344
+ readonly internalType: "address";
1345
+ readonly name: "to";
1346
+ readonly type: "address";
1347
+ }];
1348
+ readonly name: "burn";
1349
+ readonly outputs: readonly [{
1350
+ readonly internalType: "uint256";
1351
+ readonly name: "amount0";
1352
+ readonly type: "uint256";
1353
+ }, {
1354
+ readonly internalType: "uint256";
1355
+ readonly name: "amount1";
1356
+ readonly type: "uint256";
1357
+ }];
1358
+ readonly payable: false;
1359
+ readonly stateMutability: "nonpayable";
1360
+ readonly type: "function";
1361
+ }, {
1362
+ readonly constant: true;
1363
+ readonly inputs: readonly [];
1364
+ readonly name: "decimals";
1365
+ readonly outputs: readonly [{
1366
+ readonly internalType: "uint8";
1367
+ readonly name: "";
1368
+ readonly type: "uint8";
1369
+ }];
1370
+ readonly payable: false;
1371
+ readonly stateMutability: "pure";
1372
+ readonly type: "function";
1373
+ }, {
1374
+ readonly constant: true;
1375
+ readonly inputs: readonly [];
1376
+ readonly name: "factory";
1377
+ readonly outputs: readonly [{
1378
+ readonly internalType: "address";
1379
+ readonly name: "";
1380
+ readonly type: "address";
1381
+ }];
1382
+ readonly payable: false;
1383
+ readonly stateMutability: "view";
1384
+ readonly type: "function";
1385
+ }, {
1386
+ readonly constant: true;
1387
+ readonly inputs: readonly [];
1388
+ readonly name: "getReserves";
1389
+ readonly outputs: readonly [{
1390
+ readonly internalType: "uint112";
1391
+ readonly name: "reserve0";
1392
+ readonly type: "uint112";
1393
+ }, {
1394
+ readonly internalType: "uint112";
1395
+ readonly name: "reserve1";
1396
+ readonly type: "uint112";
1397
+ }, {
1398
+ readonly internalType: "uint32";
1399
+ readonly name: "blockTimestampLast";
1400
+ readonly type: "uint32";
1401
+ }];
1402
+ readonly payable: false;
1403
+ readonly stateMutability: "view";
1404
+ readonly type: "function";
1405
+ }, {
1406
+ readonly constant: false;
1407
+ readonly inputs: readonly [{
1408
+ readonly internalType: "address";
1409
+ readonly name: "";
1410
+ readonly type: "address";
1411
+ }, {
1412
+ readonly internalType: "address";
1413
+ readonly name: "";
1414
+ readonly type: "address";
1415
+ }];
1416
+ readonly name: "initialize";
1417
+ readonly outputs: readonly [];
1418
+ readonly payable: false;
1419
+ readonly stateMutability: "nonpayable";
1420
+ readonly type: "function";
1421
+ }, {
1422
+ readonly constant: true;
1423
+ readonly inputs: readonly [];
1424
+ readonly name: "kLast";
1425
+ readonly outputs: readonly [{
1426
+ readonly internalType: "uint256";
1427
+ readonly name: "";
1428
+ readonly type: "uint256";
1429
+ }];
1430
+ readonly payable: false;
1431
+ readonly stateMutability: "view";
1432
+ readonly type: "function";
1433
+ }, {
1434
+ readonly constant: false;
1435
+ readonly inputs: readonly [{
1436
+ readonly internalType: "address";
1437
+ readonly name: "to";
1438
+ readonly type: "address";
1439
+ }];
1440
+ readonly name: "mint";
1441
+ readonly outputs: readonly [{
1442
+ readonly internalType: "uint256";
1443
+ readonly name: "liquidity";
1444
+ readonly type: "uint256";
1445
+ }];
1446
+ readonly payable: false;
1447
+ readonly stateMutability: "nonpayable";
1448
+ readonly type: "function";
1449
+ }, {
1450
+ readonly constant: true;
1451
+ readonly inputs: readonly [];
1452
+ readonly name: "name";
1453
+ readonly outputs: readonly [{
1454
+ readonly internalType: "string";
1455
+ readonly name: "";
1456
+ readonly type: "string";
1457
+ }];
1458
+ readonly payable: false;
1459
+ readonly stateMutability: "pure";
1460
+ readonly type: "function";
1461
+ }, {
1462
+ readonly constant: true;
1463
+ readonly inputs: readonly [{
1464
+ readonly internalType: "address";
1465
+ readonly name: "owner";
1466
+ readonly type: "address";
1467
+ }];
1468
+ readonly name: "nonces";
1469
+ readonly outputs: readonly [{
1470
+ readonly internalType: "uint256";
1471
+ readonly name: "";
1472
+ readonly type: "uint256";
1473
+ }];
1474
+ readonly payable: false;
1475
+ readonly stateMutability: "view";
1476
+ readonly type: "function";
1477
+ }, {
1478
+ readonly constant: false;
1479
+ readonly inputs: readonly [{
1480
+ readonly internalType: "address";
1481
+ readonly name: "owner";
1482
+ readonly type: "address";
1483
+ }, {
1484
+ readonly internalType: "address";
1485
+ readonly name: "spender";
1486
+ readonly type: "address";
1487
+ }, {
1488
+ readonly internalType: "uint256";
1489
+ readonly name: "value";
1490
+ readonly type: "uint256";
1491
+ }, {
1492
+ readonly internalType: "uint256";
1493
+ readonly name: "deadline";
1494
+ readonly type: "uint256";
1495
+ }, {
1496
+ readonly internalType: "uint8";
1497
+ readonly name: "v";
1498
+ readonly type: "uint8";
1499
+ }, {
1500
+ readonly internalType: "bytes32";
1501
+ readonly name: "r";
1502
+ readonly type: "bytes32";
1503
+ }, {
1504
+ readonly internalType: "bytes32";
1505
+ readonly name: "s";
1506
+ readonly type: "bytes32";
1507
+ }];
1508
+ readonly name: "permit";
1509
+ readonly outputs: readonly [];
1510
+ readonly payable: false;
1511
+ readonly stateMutability: "nonpayable";
1512
+ readonly type: "function";
1513
+ }, {
1514
+ readonly constant: true;
1515
+ readonly inputs: readonly [];
1516
+ readonly name: "price0CumulativeLast";
1517
+ readonly outputs: readonly [{
1518
+ readonly internalType: "uint256";
1519
+ readonly name: "";
1520
+ readonly type: "uint256";
1521
+ }];
1522
+ readonly payable: false;
1523
+ readonly stateMutability: "view";
1524
+ readonly type: "function";
1525
+ }, {
1526
+ readonly constant: true;
1527
+ readonly inputs: readonly [];
1528
+ readonly name: "price1CumulativeLast";
1529
+ readonly outputs: readonly [{
1530
+ readonly internalType: "uint256";
1531
+ readonly name: "";
1532
+ readonly type: "uint256";
1533
+ }];
1534
+ readonly payable: false;
1535
+ readonly stateMutability: "view";
1536
+ readonly type: "function";
1537
+ }, {
1538
+ readonly constant: false;
1539
+ readonly inputs: readonly [{
1540
+ readonly internalType: "address";
1541
+ readonly name: "to";
1542
+ readonly type: "address";
1543
+ }];
1544
+ readonly name: "skim";
1545
+ readonly outputs: readonly [];
1546
+ readonly payable: false;
1547
+ readonly stateMutability: "nonpayable";
1548
+ readonly type: "function";
1549
+ }, {
1550
+ readonly constant: false;
1551
+ readonly inputs: readonly [{
1552
+ readonly internalType: "uint256";
1553
+ readonly name: "amount0Out";
1554
+ readonly type: "uint256";
1555
+ }, {
1556
+ readonly internalType: "uint256";
1557
+ readonly name: "amount1Out";
1558
+ readonly type: "uint256";
1559
+ }, {
1560
+ readonly internalType: "address";
1561
+ readonly name: "to";
1562
+ readonly type: "address";
1563
+ }, {
1564
+ readonly internalType: "bytes";
1565
+ readonly name: "data";
1566
+ readonly type: "bytes";
1567
+ }];
1568
+ readonly name: "swap";
1569
+ readonly outputs: readonly [];
1570
+ readonly payable: false;
1571
+ readonly stateMutability: "nonpayable";
1572
+ readonly type: "function";
1573
+ }, {
1574
+ readonly constant: true;
1575
+ readonly inputs: readonly [];
1576
+ readonly name: "symbol";
1577
+ readonly outputs: readonly [{
1578
+ readonly internalType: "string";
1579
+ readonly name: "";
1580
+ readonly type: "string";
1581
+ }];
1582
+ readonly payable: false;
1583
+ readonly stateMutability: "pure";
1584
+ readonly type: "function";
1585
+ }, {
1586
+ readonly constant: false;
1587
+ readonly inputs: readonly [];
1588
+ readonly name: "sync";
1589
+ readonly outputs: readonly [];
1590
+ readonly payable: false;
1591
+ readonly stateMutability: "nonpayable";
1592
+ readonly type: "function";
1593
+ }, {
1594
+ readonly constant: true;
1595
+ readonly inputs: readonly [];
1596
+ readonly name: "token0";
1597
+ readonly outputs: readonly [{
1598
+ readonly internalType: "address";
1599
+ readonly name: "";
1600
+ readonly type: "address";
1601
+ }];
1602
+ readonly payable: false;
1603
+ readonly stateMutability: "view";
1604
+ readonly type: "function";
1605
+ }, {
1606
+ readonly constant: true;
1607
+ readonly inputs: readonly [];
1608
+ readonly name: "token1";
1609
+ readonly outputs: readonly [{
1610
+ readonly internalType: "address";
1611
+ readonly name: "";
1612
+ readonly type: "address";
1613
+ }];
1614
+ readonly payable: false;
1615
+ readonly stateMutability: "view";
1616
+ readonly type: "function";
1617
+ }, {
1618
+ readonly constant: true;
1619
+ readonly inputs: readonly [];
1620
+ readonly name: "totalSupply";
1621
+ readonly outputs: readonly [{
1622
+ readonly internalType: "uint256";
1623
+ readonly name: "";
1624
+ readonly type: "uint256";
1625
+ }];
1626
+ readonly payable: false;
1627
+ readonly stateMutability: "view";
1628
+ readonly type: "function";
1629
+ }, {
1630
+ readonly constant: false;
1631
+ readonly inputs: readonly [{
1632
+ readonly internalType: "address";
1633
+ readonly name: "to";
1634
+ readonly type: "address";
1635
+ }, {
1636
+ readonly internalType: "uint256";
1637
+ readonly name: "value";
1638
+ readonly type: "uint256";
1639
+ }];
1640
+ readonly name: "transfer";
1641
+ readonly outputs: readonly [{
1642
+ readonly internalType: "bool";
1643
+ readonly name: "";
1644
+ readonly type: "bool";
1645
+ }];
1646
+ readonly payable: false;
1647
+ readonly stateMutability: "nonpayable";
1648
+ readonly type: "function";
1649
+ }, {
1650
+ readonly constant: false;
1651
+ readonly inputs: readonly [{
1652
+ readonly internalType: "address";
1653
+ readonly name: "from";
1654
+ readonly type: "address";
1655
+ }, {
1656
+ readonly internalType: "address";
1657
+ readonly name: "to";
1658
+ readonly type: "address";
1659
+ }, {
1660
+ readonly internalType: "uint256";
1661
+ readonly name: "value";
1662
+ readonly type: "uint256";
1663
+ }];
1664
+ readonly name: "transferFrom";
1665
+ readonly outputs: readonly [{
1666
+ readonly internalType: "bool";
1667
+ readonly name: "";
1668
+ readonly type: "bool";
1669
+ }];
1670
+ readonly payable: false;
1671
+ readonly stateMutability: "nonpayable";
1672
+ readonly type: "function";
1673
+ }];
1674
+
1675
+ declare const EvmErc20TokenConfigSchema: z.ZodObject<{
1676
+ symbol: z.ZodOptional<z.ZodString>;
1677
+ networkId: z.ZodOptional<z.ZodString>;
1678
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1679
+ decimals: z.ZodOptional<z.ZodInt>;
1680
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1681
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1682
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1683
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1684
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1685
+ contractAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1686
+ }, z.core.$strict>;
1687
+ type EvmErc20TokenConfig = z.infer<typeof EvmErc20TokenConfigSchema>;
1688
+
1689
+ declare const MODULE_TYPE$b: "evm-erc20";
1690
+
1691
+ declare const EvmErc20BalanceModule: IBalanceModule<typeof MODULE_TYPE$b, EvmErc20TokenConfig>;
1692
+
1693
+ declare const EvmNativeTokenConfigSchema: z.ZodObject<{
1694
+ symbol: z.ZodOptional<z.ZodString>;
1695
+ networkId: z.ZodOptional<z.ZodString>;
1696
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1697
+ decimals: z.ZodOptional<z.ZodInt>;
1698
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1699
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1700
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1701
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1702
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1703
+ }, z.core.$strict>;
1704
+ type EvmNativeTokenConfig = z.infer<typeof EvmNativeTokenConfigSchema>;
1705
+
1706
+ declare const MODULE_TYPE$a: "evm-native";
1707
+
1708
+ declare const EvmNativeBalanceModule: IBalanceModule<typeof MODULE_TYPE$a, EvmNativeTokenConfig>;
1709
+
1710
+ declare const EvmUniswapV2TokenConfigSchema: z.ZodObject<{
1711
+ symbol: z.ZodOptional<z.ZodString>;
1712
+ networkId: z.ZodOptional<z.ZodString>;
1713
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1714
+ decimals: z.ZodOptional<z.ZodInt>;
1715
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1716
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1717
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1718
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1719
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1720
+ contractAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1721
+ }, z.core.$strict>;
1722
+ type EvmUniswapV2TokenConfig = z.infer<typeof EvmUniswapV2TokenConfigSchema>;
1723
+
1724
+ declare const MODULE_TYPE$9: "evm-uniswapv2";
1725
+
1726
+ declare const EvmUniswapV2BalanceModule: IBalanceModule<typeof MODULE_TYPE$9, EvmUniswapV2TokenConfig>;
1727
+
1728
+ declare const SolNativeTokenConfigSchema: z.ZodObject<{
1729
+ symbol: z.ZodOptional<z.ZodString>;
1730
+ networkId: z.ZodOptional<z.ZodString>;
1731
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1732
+ decimals: z.ZodOptional<z.ZodInt>;
1733
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1734
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1735
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1736
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1737
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1738
+ }, z.core.$strict>;
1739
+ type SolNativeTokenConfig = z.infer<typeof SolNativeTokenConfigSchema>;
1740
+
1741
+ declare const MODULE_TYPE$8: "sol-native";
1742
+
1743
+ declare const SolNativeBalanceModule: IBalanceModule<typeof MODULE_TYPE$8, SolNativeTokenConfig>;
1744
+
1745
+ declare const SolSplTokenConfigSchema: z.ZodObject<{
1746
+ symbol: z.ZodOptional<z.ZodString>;
1747
+ networkId: z.ZodOptional<z.ZodString>;
1748
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1749
+ decimals: z.ZodOptional<z.ZodInt>;
1750
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1751
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1752
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1753
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1754
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1755
+ mintAddress: z.ZodString;
1756
+ }, z.core.$strict>;
1757
+ type SolSplTokenConfig = z.infer<typeof SolSplTokenConfigSchema>;
1758
+
1759
+ declare const MODULE_TYPE$7: "sol-spl";
1760
+
1761
+ declare const SolSplBalanceModule: IBalanceModule<typeof MODULE_TYPE$7, SolSplTokenConfig>;
1762
+
1763
+ declare const SubAssetsTokenConfigSchema: z.ZodObject<{
1764
+ symbol: z.ZodOptional<z.ZodString>;
1765
+ networkId: z.ZodOptional<z.ZodString>;
1766
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1767
+ decimals: z.ZodOptional<z.ZodInt>;
1768
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1769
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1770
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1771
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1772
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1773
+ assetId: z.ZodPipe<z.ZodUnion<readonly [z.ZodUInt32, z.ZodString]>, z.ZodTransform<string, string | number>>;
1774
+ }, z.core.$strict>;
1775
+ type SubAssetsTokenConfig = z.infer<typeof SubAssetsTokenConfigSchema>;
1776
+
1777
+ declare const MODULE_TYPE$6: "substrate-assets";
1778
+ type TokenConfig$1 = z.infer<typeof SubAssetsTokenConfigSchema>;
1779
+
1780
+ declare const SubAssetsBalanceModule: IBalanceModule<typeof MODULE_TYPE$6, TokenConfig$1>;
1781
+
1782
+ declare const TAO_DECIMALS = 9n;
1783
+ declare const ALPHA_PRICE_SCALE: bigint;
1784
+ declare const getScaledAlphaPrice: (alphaIn: bigint, taoIn: bigint) => bigint;
1785
+ declare const alphaToTao: (alpha: bigint, scaledAlphaPrice: bigint) => bigint;
1786
+ declare const taoToAlpha: (tao: bigint, scaledAlphaPrice: bigint) => bigint;
1787
+
1788
+ /**
1789
+ * To be used for tokens that don't have a coingecko id
1790
+ *
1791
+ * @param token
1792
+ * @param tokenRates
1793
+ * @param scaledAlphaPrice
1794
+ * @returns
1795
+ */
1796
+ declare const getDTaoTokenRates: (token: SubDTaoToken, tokenRates: TokenRatesList, scaledAlphaPrice: string | bigint) => _talismn_token_rates.TokenRates | null;
1797
+
1798
+ declare const SubDTaoTokenConfigSchema: z.ZodObject<{
1799
+ symbol: z.ZodOptional<z.ZodString>;
1800
+ networkId: z.ZodOptional<z.ZodString>;
1801
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1802
+ decimals: z.ZodOptional<z.ZodInt>;
1803
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1804
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1805
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1806
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1807
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1808
+ netuid: z.ZodNumber;
1809
+ }, z.core.$strict>;
1810
+ type SubDTaoTokenConfig = z.infer<typeof SubDTaoTokenConfigSchema>;
1811
+ type SubDTaoBalanceMeta = {
1812
+ scaledAlphaPrice: string;
1813
+ };
1814
+ type SubDTaoBalance = {
1815
+ address: string;
1816
+ tokenId: string;
1817
+ baseTokenId: string;
1818
+ stake: bigint;
1819
+ pendingRootClaim?: bigint;
1820
+ hotkey: string;
1821
+ netuid: number;
1822
+ scaledAlphaPrice: bigint;
1823
+ };
1824
+ type GetDynamicInfosResult = (typeof bittensor)["descriptors"]["apis"]["SubnetInfoRuntimeApi"]["get_all_dynamic_info"][1];
1825
+ type GetStakeInfosResult = (typeof bittensor)["descriptors"]["apis"]["StakeInfoRuntimeApi"]["get_stake_info_for_coldkeys"][1];
1826
+
1827
+ declare const MODULE_TYPE$5: "substrate-dtao";
1828
+ type TokenConfig = z.infer<typeof SubDTaoTokenConfigSchema>;
1829
+
1830
+ declare const SubDTaoBalanceModule: IBalanceModule<typeof MODULE_TYPE$5, TokenConfig>;
1831
+
1832
+ declare const SubForeignAssetsTokenConfigSchema: z.ZodObject<{
1833
+ symbol: z.ZodOptional<z.ZodString>;
1834
+ networkId: z.ZodOptional<z.ZodString>;
1835
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1836
+ decimals: z.ZodOptional<z.ZodInt>;
1837
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1838
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1839
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1840
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1841
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1842
+ onChainId: z.ZodString;
1843
+ }, z.core.$strict>;
1844
+ type SubForeignAssetsTokenConfig = z.infer<typeof SubForeignAssetsTokenConfigSchema>;
1845
+
1846
+ declare const MODULE_TYPE$4: "substrate-foreignassets";
1847
+
1848
+ declare const SubForeignAssetsBalanceModule: IBalanceModule<typeof MODULE_TYPE$4, SubForeignAssetsTokenConfig>;
1849
+
1850
+ declare const SubHydrationTokenConfigSchema: z.ZodObject<{
1851
+ symbol: z.ZodOptional<z.ZodString>;
1852
+ networkId: z.ZodOptional<z.ZodString>;
1853
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1854
+ decimals: z.ZodOptional<z.ZodInt>;
1855
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1856
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1857
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1858
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1859
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1860
+ onChainId: z.ZodUInt32;
1861
+ }, z.core.$strict>;
1862
+ type SubHydrationTokenConfig = z.infer<typeof SubHydrationTokenConfigSchema>;
1863
+
1864
+ declare const MODULE_TYPE$3: "substrate-hydration";
1865
+
1866
+ declare const SubHydrationBalanceModule: IBalanceModule<typeof MODULE_TYPE$3, SubHydrationTokenConfig>;
1867
+
1868
+ declare const SubNativeTokenConfigSchema: z.ZodObject<{
1869
+ symbol: z.ZodOptional<z.ZodString>;
1870
+ networkId: z.ZodOptional<z.ZodString>;
1871
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1872
+ decimals: z.ZodOptional<z.ZodInt>;
1873
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1874
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1875
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1876
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1877
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1878
+ }, z.core.$strict>;
1879
+ type SubNativeTokenConfig = z.infer<typeof SubNativeTokenConfigSchema>;
1880
+ declare const SubNativeModuleConfigSchema: z.ZodObject<{
1881
+ disable: z.ZodOptional<z.ZodBoolean>;
1882
+ }, z.core.$strict>;
1883
+ type SubNativeModuleConfig = z.infer<typeof SubNativeModuleConfigSchema>;
1884
+ declare const SubNativeMiniMetadataExtraSchema: z.ZodObject<{
1885
+ disable: z.ZodOptional<z.ZodBoolean>;
1886
+ useLegacyTransferableCalculation: z.ZodOptional<z.ZodBoolean>;
1887
+ existentialDeposit: z.ZodOptional<z.ZodString>;
1888
+ nominationPoolsPalletId: z.ZodOptional<z.ZodString>;
1889
+ }, z.core.$strict>;
1890
+ type SubNativeMiniMetadataExtra = z.infer<typeof SubNativeMiniMetadataExtraSchema>;
1891
+
1892
+ declare const MODULE_TYPE$2: "substrate-native";
1893
+
1894
+ declare const SubNativeBalanceModule: IBalanceModule<typeof MODULE_TYPE$2, SubNativeTokenConfig, SubNativeModuleConfig, SubNativeMiniMetadataExtra>;
1895
+
1896
+ type BalanceLockType = "reserved" | "democracy" | "crowdloan" | "staking" | "nompools-staking" | "nompools-unbonding" | "subtensor-staking" | "vesting" | "dapp-staking" | `other-${string}` | "other";
1897
+ /**
1898
+ * For converting the value of `lock?.id?.toUtf8?.()` which is retrieved from
1899
+ * the Balances.Locks storage key into a useful classification for our UI
1900
+ */
1901
+ declare const getLockedType: (input?: string) => BalanceLockType;
1902
+ declare const filterBaseLocks: (locks: Array<Omit<LockedAmount<string>, "amount"> & {
1903
+ amount: BalanceFormatter;
1904
+ }>) => (Omit<LockedAmount<string>, "amount"> & {
1905
+ amount: BalanceFormatter;
1906
+ })[];
1907
+ declare const getLockTitle: (lock: Pick<LockedAmount<string>, "label" | "meta">, { balance }?: {
1908
+ balance?: Balance;
1909
+ }) => string;
1910
+
1911
+ declare const SubPsp22TokenConfigSchema: z.ZodObject<{
1912
+ symbol: z.ZodOptional<z.ZodString>;
1913
+ networkId: z.ZodOptional<z.ZodString>;
1914
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1915
+ decimals: z.ZodOptional<z.ZodInt>;
1916
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1917
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1918
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1919
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1920
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1921
+ contractAddress: z.ZodString;
1922
+ }, z.core.$strict>;
1923
+ type SubPsp22TokenConfig = z.infer<typeof SubPsp22TokenConfigSchema>;
1924
+
1925
+ declare const MODULE_TYPE$1: "substrate-psp22";
1926
+
1927
+ declare const SubPsp22BalanceModule: IBalanceModule<typeof MODULE_TYPE$1, SubPsp22TokenConfig>;
1928
+
1929
+ declare const SubTokensTokenConfigSchema: z.ZodObject<{
1930
+ symbol: z.ZodString;
1931
+ decimals: z.ZodNumber;
1932
+ existentialDeposit: z.ZodString;
1933
+ networkId: z.ZodOptional<z.ZodString>;
1934
+ isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1935
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1936
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1937
+ coingeckoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1938
+ noDiscovery: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1939
+ mirrorOf: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1940
+ onChainId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1941
+ }, z.core.$strict>;
1942
+ type SubTokensTokenConfig = z.infer<typeof SubTokensTokenConfigSchema>;
1943
+ declare const SubTokensModuleConfigSchema: z.ZodObject<{
1944
+ palletId: z.ZodOptional<z.ZodString>;
1945
+ }, z.core.$strict>;
1946
+ type SubTokensModuleConfig = z.infer<typeof SubTokensModuleConfigSchema>;
1947
+ declare const SubTokensMiniMetadataExtraSchema: z.ZodObject<{
1948
+ palletId: z.ZodString;
1949
+ }, z.core.$strict>;
1950
+ type SubTokensMiniMetadataExtra = z.infer<typeof SubTokensMiniMetadataExtraSchema>;
1951
+
1952
+ declare const MODULE_TYPE: "substrate-tokens";
1953
+
1954
+ declare const SubTokensBalanceModule: IBalanceModule<typeof MODULE_TYPE, SubTokensTokenConfig, SubTokensModuleConfig, SubTokensMiniMetadataExtra>;
1955
+
1956
+ declare const BALANCE_MODULES: (IBalanceModule<"substrate-dtao", {
1957
+ netuid: number;
1958
+ symbol?: string | undefined;
1959
+ networkId?: string | undefined;
1960
+ isDefault?: boolean | undefined;
1961
+ decimals?: number | undefined;
1962
+ name?: string | undefined;
1963
+ logo?: string | undefined;
1964
+ coingeckoId?: string | undefined;
1965
+ noDiscovery?: boolean | undefined;
1966
+ mirrorOf?: string | undefined;
1967
+ }, unknown, unknown> | IBalanceModule<"evm-erc20", {
1968
+ contractAddress: `0x${string}`;
1969
+ symbol?: string | undefined;
1970
+ networkId?: string | undefined;
1971
+ isDefault?: boolean | undefined;
1972
+ decimals?: number | undefined;
1973
+ name?: string | undefined;
1974
+ logo?: string | undefined;
1975
+ coingeckoId?: string | undefined;
1976
+ noDiscovery?: boolean | undefined;
1977
+ mirrorOf?: string | undefined;
1978
+ }, unknown, unknown> | IBalanceModule<"evm-native", {
1979
+ symbol?: string | undefined;
1980
+ networkId?: string | undefined;
1981
+ isDefault?: boolean | undefined;
1982
+ decimals?: number | undefined;
1983
+ name?: string | undefined;
1984
+ logo?: string | undefined;
1985
+ coingeckoId?: string | undefined;
1986
+ noDiscovery?: boolean | undefined;
1987
+ mirrorOf?: string | undefined;
1988
+ }, unknown, unknown> | IBalanceModule<"evm-uniswapv2", {
1989
+ contractAddress: `0x${string}`;
1990
+ symbol?: string | undefined;
1991
+ networkId?: string | undefined;
1992
+ isDefault?: boolean | undefined;
1993
+ decimals?: number | undefined;
1994
+ name?: string | undefined;
1995
+ logo?: string | undefined;
1996
+ coingeckoId?: string | undefined;
1997
+ noDiscovery?: boolean | undefined;
1998
+ mirrorOf?: string | undefined;
1999
+ }, unknown, unknown> | IBalanceModule<"sol-native", {
2000
+ symbol?: string | undefined;
2001
+ networkId?: string | undefined;
2002
+ isDefault?: boolean | undefined;
2003
+ decimals?: number | undefined;
2004
+ name?: string | undefined;
2005
+ logo?: string | undefined;
2006
+ coingeckoId?: string | undefined;
2007
+ noDiscovery?: boolean | undefined;
2008
+ mirrorOf?: string | undefined;
2009
+ }, unknown, unknown> | IBalanceModule<"sol-spl", {
2010
+ mintAddress: string;
2011
+ symbol?: string | undefined;
2012
+ networkId?: string | undefined;
2013
+ isDefault?: boolean | undefined;
2014
+ decimals?: number | undefined;
2015
+ name?: string | undefined;
2016
+ logo?: string | undefined;
2017
+ coingeckoId?: string | undefined;
2018
+ noDiscovery?: boolean | undefined;
2019
+ mirrorOf?: string | undefined;
2020
+ }, unknown, unknown> | IBalanceModule<"substrate-assets", {
2021
+ assetId: string;
2022
+ symbol?: string | undefined;
2023
+ networkId?: string | undefined;
2024
+ isDefault?: boolean | undefined;
2025
+ decimals?: number | undefined;
2026
+ name?: string | undefined;
2027
+ logo?: string | undefined;
2028
+ coingeckoId?: string | undefined;
2029
+ noDiscovery?: boolean | undefined;
2030
+ mirrorOf?: string | undefined;
2031
+ }, unknown, unknown> | IBalanceModule<"substrate-foreignassets", {
2032
+ onChainId: string;
2033
+ symbol?: string | undefined;
2034
+ networkId?: string | undefined;
2035
+ isDefault?: boolean | undefined;
2036
+ decimals?: number | undefined;
2037
+ name?: string | undefined;
2038
+ logo?: string | undefined;
2039
+ coingeckoId?: string | undefined;
2040
+ noDiscovery?: boolean | undefined;
2041
+ mirrorOf?: string | undefined;
2042
+ }, unknown, unknown> | IBalanceModule<"substrate-hydration", {
2043
+ onChainId: number;
2044
+ symbol?: string | undefined;
2045
+ networkId?: string | undefined;
2046
+ isDefault?: boolean | undefined;
2047
+ decimals?: number | undefined;
2048
+ name?: string | undefined;
2049
+ logo?: string | undefined;
2050
+ coingeckoId?: string | undefined;
2051
+ noDiscovery?: boolean | undefined;
2052
+ mirrorOf?: string | undefined;
2053
+ }, unknown, unknown> | IBalanceModule<"substrate-native", {
2054
+ symbol?: string | undefined;
2055
+ networkId?: string | undefined;
2056
+ isDefault?: boolean | undefined;
2057
+ decimals?: number | undefined;
2058
+ name?: string | undefined;
2059
+ logo?: string | undefined;
2060
+ coingeckoId?: string | undefined;
2061
+ noDiscovery?: boolean | undefined;
2062
+ mirrorOf?: string | undefined;
2063
+ }, {
2064
+ disable?: boolean | undefined;
2065
+ }, {
2066
+ disable?: boolean | undefined;
2067
+ useLegacyTransferableCalculation?: boolean | undefined;
2068
+ existentialDeposit?: string | undefined;
2069
+ nominationPoolsPalletId?: string | undefined;
2070
+ }> | IBalanceModule<"substrate-psp22", {
2071
+ contractAddress: string;
2072
+ symbol?: string | undefined;
2073
+ networkId?: string | undefined;
2074
+ isDefault?: boolean | undefined;
2075
+ decimals?: number | undefined;
2076
+ name?: string | undefined;
2077
+ logo?: string | undefined;
2078
+ coingeckoId?: string | undefined;
2079
+ noDiscovery?: boolean | undefined;
2080
+ mirrorOf?: string | undefined;
2081
+ }, unknown, unknown> | IBalanceModule<"substrate-tokens", {
2082
+ symbol: string;
2083
+ decimals: number;
2084
+ existentialDeposit: string;
2085
+ onChainId: string | number;
2086
+ networkId?: string | undefined;
2087
+ isDefault?: boolean | undefined;
2088
+ name?: string | undefined;
2089
+ logo?: string | undefined;
2090
+ coingeckoId?: string | undefined;
2091
+ noDiscovery?: boolean | undefined;
2092
+ mirrorOf?: string | undefined;
2093
+ }, {
2094
+ palletId?: string | undefined;
2095
+ }, {
2096
+ palletId: string;
2097
+ }>)[];
2098
+ type AnyBalanceModule = (typeof BALANCE_MODULES)[number];
2099
+
2100
+ export { ALPHA_PRICE_SCALE, type Address, type Amount, type AmountWithLabel, type AnyBalanceModule, BALANCE_MODULES, Balance, BalanceFormatter, type BalanceJson, type BalanceJsonList, type BalanceLockType, type BalanceSearchQuery, type BalanceSource, type BalanceStatus, type BalanceStatusTypes, type BalanceTransferType, BalanceValueGetter, Balances, BalancesProvider, type BalancesResult, type BalancesStorage, type ChainConnectors, Change24hCurrencyFormatter, EvmErc20BalanceModule, type EvmErc20TokenConfig, EvmErc20TokenConfigSchema, EvmNativeBalanceModule, type EvmNativeTokenConfig, EvmNativeTokenConfigSchema, EvmUniswapV2BalanceModule, type EvmUniswapV2TokenConfig, EvmUniswapV2TokenConfigSchema, type ExtraAmount, type FetchBalanceErrors, type FetchBalanceResults, FiatSumBalancesFormatter, type GetDynamicInfosResult, type GetStakeInfosResult, type HydrateDb, type IBalance, type IBalanceModule, type LockedAmount, type MiniMetadata, type NarrowBalanceType, PlanckSumBalancesFormatter, type PlatformConnector, SolNativeBalanceModule, type SolNativeTokenConfig, SolNativeTokenConfigSchema, SolSplBalanceModule, type SolSplTokenConfig, SolSplTokenConfigSchema, SubAssetsBalanceModule, type SubAssetsTokenConfig, SubAssetsTokenConfigSchema, type SubDTaoBalance, type SubDTaoBalanceMeta, SubDTaoBalanceModule, type SubDTaoTokenConfig, SubDTaoTokenConfigSchema, SubForeignAssetsBalanceModule, type SubForeignAssetsTokenConfig, SubForeignAssetsTokenConfigSchema, SubHydrationBalanceModule, type SubHydrationTokenConfig, SubHydrationTokenConfigSchema, SubNativeBalanceModule, type SubNativeMiniMetadataExtra, SubNativeMiniMetadataExtraSchema, type SubNativeModuleConfig, SubNativeModuleConfigSchema, type SubNativeTokenConfig, SubNativeTokenConfigSchema, SubPsp22BalanceModule, type SubPsp22TokenConfig, SubPsp22TokenConfigSchema, SubTokensBalanceModule, type SubTokensMiniMetadataExtra, SubTokensMiniMetadataExtraSchema, type SubTokensModuleConfig, SubTokensModuleConfigSchema, type SubTokensTokenConfig, SubTokensTokenConfigSchema, type SubscriptionCallback, SumBalancesFormatter, TAO_DECIMALS, type TokenPlatform, type TokensWithAddresses, type UnsubscribeFn, abiMulticall, alphaToTao, deriveMiniMetadataId, erc20BalancesAggregatorAbi, excludeFromFeePayableLocks, excludeFromTransferableAmount, filterBaseLocks, filterMirrorTokens, getBalanceId, getDTaoTokenRates, getLockTitle, getLockedType, getScaledAlphaPrice, getValueId, includeInTotalExtraAmount, taoToAlpha, uniswapV2PairAbi };