@talismn/balances 0.0.0-pr2068-20250630052217 → 0.0.0-pr2075-20250707031602
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/src/BalanceModule.d.ts +23 -12
- package/dist/declarations/src/NewBalanceModules.d.ts +99 -0
- package/dist/declarations/src/getMiniMetadata/getMetadataRpc.d.ts +3 -0
- package/dist/declarations/src/getMiniMetadata/getMiniMetadatas.d.ts +4 -0
- package/dist/declarations/src/getMiniMetadata/getSpecVersion.d.ts +6 -0
- package/dist/declarations/src/getMiniMetadata/getUpdatedMiniMetadatas.d.ts +4 -0
- package/dist/declarations/src/getMiniMetadata/index.d.ts +5 -0
- package/dist/declarations/src/index.d.ts +2 -3
- package/dist/declarations/src/modules/EvmErc20Module.d.ts +21 -24
- package/dist/declarations/src/modules/EvmNativeModule.d.ts +19 -18
- package/dist/declarations/src/modules/EvmUniswapV2Module.d.ts +28 -30
- package/dist/declarations/src/modules/IBalanceModule.d.ts +100 -0
- package/dist/declarations/src/modules/SubstrateAssetsModule.d.ts +20 -18
- package/dist/declarations/src/modules/SubstrateForeignAssetsModule.d.ts +20 -18
- package/dist/declarations/src/modules/SubstrateNativeModule/index.d.ts +17 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeNompoolStaking.d.ts +3 -3
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeSubtensorStaking.d.ts +3 -3
- package/dist/declarations/src/modules/SubstrateNativeModule/types.d.ts +6 -23
- package/dist/declarations/src/modules/SubstrateNativeModule/util/QueryCache.d.ts +6 -6
- package/dist/declarations/src/modules/SubstrateNativeModule/util/buildQueries.d.ts +5 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/util/sortChains.d.ts +1 -1
- package/dist/declarations/src/modules/SubstrateNativeModule/util/systemProperties.d.ts +5 -0
- package/dist/declarations/src/modules/SubstratePsp22Module.d.ts +20 -19
- package/dist/declarations/src/modules/SubstrateTokensModule.d.ts +22 -22
- package/dist/declarations/src/modules/abis/index.d.ts +2 -0
- package/dist/declarations/src/modules/evm-erc20/config.d.ts +16 -0
- package/dist/declarations/src/modules/evm-erc20/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/index.d.ts +1 -0
- package/dist/declarations/src/modules/evm-erc20/module.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-erc20/utils.d.ts +6 -0
- package/dist/declarations/src/modules/evm-native/config.d.ts +15 -0
- package/dist/declarations/src/modules/evm-native/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-native/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/evm-native/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/evm-native/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/evm-native/index.d.ts +1 -0
- package/dist/declarations/src/modules/evm-native/module.d.ts +3 -0
- package/dist/declarations/src/modules/evm-native/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/config.d.ts +16 -0
- package/dist/declarations/src/modules/evm-uniswapv2/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/index.d.ts +1 -0
- package/dist/declarations/src/modules/evm-uniswapv2/module.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/evm-uniswapv2/utils.d.ts +12 -0
- package/dist/declarations/src/modules/index.d.ts +214 -38
- package/dist/declarations/src/modules/shared/errors.d.ts +11 -0
- package/dist/declarations/src/modules/shared/fetchRuntimeCallResult.d.ts +2 -0
- package/dist/declarations/src/modules/shared/getContantValue.d.ts +1 -0
- package/dist/declarations/src/modules/shared/hasConstantValue.d.ts +427 -0
- package/dist/declarations/src/modules/shared/index.d.ts +7 -0
- package/dist/declarations/src/modules/shared/tryGetConstantValue.d.ts +1 -0
- package/dist/declarations/src/modules/shared/types.d.ts +10 -0
- package/dist/declarations/src/modules/shared/utils.d.ts +4 -0
- package/dist/declarations/src/modules/substrate-assets/config.d.ts +16 -0
- package/dist/declarations/src/modules/substrate-assets/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-assets/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-assets/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-assets/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-assets/index.d.ts +1 -0
- package/dist/declarations/src/modules/substrate-assets/module.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-assets/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/config.d.ts +16 -0
- package/dist/declarations/src/modules/substrate-foreignassets/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/index.d.ts +1 -0
- package/dist/declarations/src/modules/substrate-foreignassets/module.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-foreignassets/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-hydration/config.d.ts +2 -0
- package/dist/declarations/src/modules/substrate-hydration/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-hydration/fetchTokens.d.ts +4 -0
- package/dist/declarations/src/modules/substrate-hydration/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-hydration/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-hydration/index.d.ts +2 -0
- package/dist/declarations/src/modules/substrate-hydration/module.d.ts +4 -0
- package/dist/declarations/src/modules/substrate-hydration/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-hydration/types.d.ts +14 -0
- package/dist/declarations/src/modules/substrate-native/bittensor/getSubtensorStakingBalances.d.ts +9 -0
- package/dist/declarations/src/modules/substrate-native/bittensor/subtensor.d.ts +20 -0
- package/dist/declarations/src/modules/substrate-native/config.d.ts +25 -0
- package/dist/declarations/src/modules/substrate-native/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-native/fetchTokens.d.ts +8 -0
- package/dist/declarations/src/modules/substrate-native/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-native/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-native/index.d.ts +1 -0
- package/dist/declarations/src/modules/substrate-native/module.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-native/queries/buildBaseQueries.d.ts +20 -0
- package/dist/declarations/src/modules/substrate-native/queries/buildNomPoolQueries.d.ts +8 -0
- package/dist/declarations/src/modules/substrate-native/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-native/util/lockTypes.d.ts +15 -0
- package/dist/declarations/src/modules/substrate-native/util/nompoolAccountId.d.ts +5 -0
- package/dist/declarations/src/modules/substrate-psp22/config.d.ts +16 -0
- package/dist/declarations/src/modules/substrate-psp22/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-psp22/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-psp22/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-psp22/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-psp22/index.d.ts +1 -0
- package/dist/declarations/src/modules/substrate-psp22/module.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-psp22/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/config.d.ts +23 -0
- package/dist/declarations/src/modules/substrate-tokens/fetchBalances.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/fetchTokens.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/getMiniMetadata.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/getTransferCallData.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/index.d.ts +1 -0
- package/dist/declarations/src/modules/substrate-tokens/module.d.ts +3 -0
- package/dist/declarations/src/modules/substrate-tokens/subscribeBalances.d.ts +3 -0
- package/dist/declarations/src/modules/util/InferBalanceModuleTypes.d.ts +5 -3
- package/dist/declarations/src/modules/util/RpcStateQueriesHelper.d.ts +12 -0
- package/dist/declarations/src/modules/util/buildStorageCoders.d.ts +17 -8
- package/dist/declarations/src/modules/util/getAddresssesByTokenByNetwork.d.ts +3 -0
- package/dist/declarations/src/modules/util/getUniqueChainIds.d.ts +2 -2
- package/dist/declarations/src/modules/util/index.d.ts +0 -1
- package/dist/declarations/src/types/balances.d.ts +221 -72
- package/dist/declarations/src/types/balancetypes.d.ts +8 -18
- package/dist/declarations/src/types/minimetadatas.d.ts +6 -24
- package/dist/declarations/src/types/tokens.d.ts +11 -0
- package/dist/declarations/src/version.d.ts +1 -0
- package/dist/talismn-balances.cjs.dev.js +5321 -2426
- package/dist/talismn-balances.cjs.prod.js +5321 -2426
- package/dist/talismn-balances.esm.js +5302 -2407
- package/package.json +12 -11
- package/dist/declarations/src/EvmTokenFetcher.d.ts +0 -11
- package/dist/declarations/src/MiniMetadataUpdater.d.ts +0 -43
- package/dist/declarations/src/modules/SubstrateEquilibriumModule.d.ts +0 -39
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeCrowdloans.d.ts +0 -5
- package/dist/declarations/src/modules/SubstrateNativeModule/util/crowdloanFundContributionsChildKey.d.ts +0 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/util/detectMiniMetadataChanges.d.ts +0 -2
- package/dist/declarations/src/modules/abis/erc20.d.ts +0 -227
- package/dist/declarations/src/modules/util/findChainMeta.d.ts +0 -8
- package/dist/declarations/src/util/hydrateChaindata.d.ts +0 -8
- package/dist/declarations/src/util/index.d.ts +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { NetworkList, TokenList } from "@talismn/chaindata-provider";
|
2
2
|
import { TokenRateCurrency, TokenRates, TokenRatesList } from "@talismn/token-rates";
|
3
3
|
import { NonFunctionProperties } from "@talismn/util";
|
4
4
|
import { Amount, AmountWithLabel, BalanceJson, BalanceJsonList, BalanceStatusTypes, ExtraAmount, IBalance, LockedAmount } from "./balancetypes";
|
@@ -19,8 +19,7 @@ export type NarrowBalanceType<S extends IBalance, P> = S extends {
|
|
19
19
|
export type BalanceSource = BalanceJson["source"];
|
20
20
|
/** TODO: Remove this in favour of a frontend-friendly `ChaindataProvider` */
|
21
21
|
export type HydrateDb = Partial<{
|
22
|
-
|
23
|
-
evmNetworks: SimpleEvmNetworkList;
|
22
|
+
networks: NetworkList;
|
24
23
|
tokens: TokenList;
|
25
24
|
tokenRates: TokenRatesList;
|
26
25
|
}>;
|
@@ -125,95 +124,246 @@ export declare class Balance {
|
|
125
124
|
isSource: (source: BalanceSource) => boolean;
|
126
125
|
hydrate: (hydrate?: HydrateDb) => void;
|
127
126
|
get id(): string;
|
128
|
-
get source(): "evm-erc20" | "evm-native" | "evm-uniswapv2" | "substrate-assets" | "substrate-
|
127
|
+
get source(): "evm-erc20" | "evm-native" | "evm-uniswapv2" | "substrate-assets" | "substrate-foreignassets" | "substrate-native" | "substrate-psp22" | "substrate-tokens";
|
129
128
|
get status(): import("./balancetypes").BalanceStatus;
|
130
129
|
get address(): string;
|
131
|
-
get
|
132
|
-
get
|
133
|
-
|
134
|
-
|
130
|
+
get networkId(): string;
|
131
|
+
get network(): {
|
132
|
+
id: string;
|
133
|
+
name: string;
|
134
|
+
nativeTokenId: string;
|
135
|
+
nativeCurrency: {
|
136
|
+
decimals: number;
|
137
|
+
symbol: string;
|
138
|
+
name: string;
|
139
|
+
coingeckoId?: string | undefined;
|
140
|
+
mirrorOf?: string | undefined;
|
141
|
+
logo?: string | undefined;
|
142
|
+
};
|
143
|
+
blockExplorerUrls: string[];
|
144
|
+
genesisHash: `0x${string}`;
|
145
|
+
platform: "polkadot";
|
146
|
+
chainName: string;
|
147
|
+
specName: string;
|
148
|
+
specVersion: number;
|
149
|
+
account: "secp256k1" | "*25519";
|
150
|
+
prefix: number;
|
151
|
+
rpcs: string[];
|
152
|
+
topology: {
|
153
|
+
type: "standalone";
|
154
|
+
} | {
|
155
|
+
type: "relay";
|
156
|
+
} | {
|
157
|
+
type: "parachain";
|
158
|
+
relayId: string;
|
159
|
+
paraId: number;
|
160
|
+
};
|
161
|
+
isTestnet?: boolean | undefined;
|
162
|
+
isDefault?: boolean | undefined;
|
163
|
+
forceScan?: boolean | undefined;
|
164
|
+
logo?: string | undefined;
|
165
|
+
themeColor?: string | undefined;
|
166
|
+
chainspecQrUrl?: string | undefined;
|
167
|
+
latestMetadataQrUrl?: string | undefined;
|
168
|
+
oldPrefix?: number | undefined;
|
169
|
+
registryTypes?: any;
|
170
|
+
signedExtensions?: any;
|
171
|
+
hasCheckMetadataHash?: boolean | undefined;
|
172
|
+
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
173
|
+
isUnknownFeeToken?: boolean | undefined;
|
174
|
+
balancesConfig?: {
|
175
|
+
"substrate-native"?: {
|
176
|
+
disable?: boolean | undefined;
|
177
|
+
} | undefined;
|
178
|
+
"substrate-assets"?: undefined;
|
179
|
+
"substrate-psp22"?: undefined;
|
180
|
+
"substrate-tokens"?: {
|
181
|
+
palletId?: string | undefined;
|
182
|
+
} | undefined;
|
183
|
+
"substrate-foreignassets"?: undefined;
|
184
|
+
} | undefined;
|
185
|
+
} | {
|
186
|
+
id: string;
|
187
|
+
name: string;
|
188
|
+
nativeTokenId: string;
|
189
|
+
nativeCurrency: {
|
190
|
+
decimals: number;
|
191
|
+
symbol: string;
|
192
|
+
name: string;
|
193
|
+
coingeckoId?: string | undefined;
|
194
|
+
mirrorOf?: string | undefined;
|
195
|
+
logo?: string | undefined;
|
196
|
+
};
|
197
|
+
blockExplorerUrls: string[];
|
198
|
+
platform: "ethereum";
|
199
|
+
rpcs: string[];
|
200
|
+
isTestnet?: boolean | undefined;
|
201
|
+
isDefault?: boolean | undefined;
|
202
|
+
forceScan?: boolean | undefined;
|
203
|
+
logo?: string | undefined;
|
204
|
+
themeColor?: string | undefined;
|
205
|
+
substrateChainId?: string | undefined;
|
206
|
+
preserveGasEstimate?: boolean | undefined;
|
207
|
+
feeType?: "legacy" | "eip-1559" | undefined;
|
208
|
+
l2FeeType?: {
|
209
|
+
type: "op-stack";
|
210
|
+
} | {
|
211
|
+
type: "scroll";
|
212
|
+
l1GasPriceOracle: `0x${string}`;
|
213
|
+
} | undefined;
|
214
|
+
contracts?: Partial<Record<"Erc20Aggregator" | "Multicall3", `0x${string}`>> | undefined;
|
215
|
+
balancesConfig?: {
|
216
|
+
"evm-native"?: undefined;
|
217
|
+
"evm-erc20"?: undefined;
|
218
|
+
"evm-uniswapv2"?: undefined;
|
219
|
+
} | undefined;
|
220
|
+
} | null;
|
135
221
|
get tokenId(): string;
|
136
|
-
get token():
|
222
|
+
get token(): {
|
223
|
+
id: string;
|
224
|
+
networkId: string;
|
225
|
+
decimals: number;
|
226
|
+
symbol: string;
|
137
227
|
type: "evm-erc20";
|
138
|
-
|
139
|
-
contractAddress: string
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
228
|
+
platform: "ethereum";
|
229
|
+
contractAddress: `0x${string}`;
|
230
|
+
isDefault?: boolean | undefined;
|
231
|
+
name?: string | undefined;
|
232
|
+
logo?: string | undefined;
|
233
|
+
coingeckoId?: string | undefined;
|
234
|
+
noDiscovery?: boolean | undefined;
|
235
|
+
mirrorOf?: string | undefined;
|
236
|
+
} | {
|
237
|
+
id: string;
|
238
|
+
networkId: string;
|
239
|
+
decimals: number;
|
240
|
+
symbol: string;
|
146
241
|
type: "evm-native";
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
242
|
+
platform: "ethereum";
|
243
|
+
isDefault?: boolean | undefined;
|
244
|
+
name?: string | undefined;
|
245
|
+
logo?: string | undefined;
|
246
|
+
coingeckoId?: string | undefined;
|
247
|
+
noDiscovery?: boolean | undefined;
|
248
|
+
mirrorOf?: string | undefined;
|
249
|
+
} | {
|
250
|
+
id: string;
|
251
|
+
networkId: string;
|
252
|
+
decimals: number;
|
253
|
+
symbol: string;
|
153
254
|
type: "evm-uniswapv2";
|
154
|
-
|
155
|
-
contractAddress: string
|
255
|
+
platform: "ethereum";
|
256
|
+
contractAddress: `0x${string}`;
|
156
257
|
symbol0: string;
|
157
258
|
symbol1: string;
|
158
259
|
decimals0: number;
|
159
260
|
decimals1: number;
|
160
|
-
tokenAddress0: string
|
161
|
-
tokenAddress1: string
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
261
|
+
tokenAddress0: `0x${string}`;
|
262
|
+
tokenAddress1: `0x${string}`;
|
263
|
+
isDefault?: boolean | undefined;
|
264
|
+
name?: string | undefined;
|
265
|
+
logo?: string | undefined;
|
266
|
+
coingeckoId?: string | undefined;
|
267
|
+
noDiscovery?: boolean | undefined;
|
268
|
+
mirrorOf?: string | undefined;
|
269
|
+
isCustom?: boolean | undefined;
|
270
|
+
coingeckoId0?: string | undefined;
|
271
|
+
coingeckoId1?: string | undefined;
|
272
|
+
} | {
|
273
|
+
id: string;
|
274
|
+
networkId: string;
|
275
|
+
decimals: number;
|
276
|
+
symbol: string;
|
168
277
|
type: "substrate-assets";
|
169
|
-
|
170
|
-
existentialDeposit: string;
|
278
|
+
platform: "polkadot";
|
171
279
|
assetId: string;
|
172
|
-
|
173
|
-
chain: {
|
174
|
-
id: import("@talismn/chaindata-provider").ChainId;
|
175
|
-
};
|
176
|
-
}) | (import("@talismn/chaindata-provider/dist/declarations/src/types/Token/types").TokenBase & {
|
177
|
-
type: "substrate-equilibrium";
|
178
|
-
} & {
|
280
|
+
isSufficient: boolean;
|
179
281
|
existentialDeposit: string;
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
282
|
+
isDefault?: boolean | undefined;
|
283
|
+
name?: string | undefined;
|
284
|
+
logo?: string | undefined;
|
285
|
+
coingeckoId?: string | undefined;
|
286
|
+
noDiscovery?: boolean | undefined;
|
287
|
+
mirrorOf?: string | undefined;
|
288
|
+
isFrozen?: boolean | undefined;
|
289
|
+
} | {
|
290
|
+
id: string;
|
291
|
+
networkId: string;
|
292
|
+
decimals: number;
|
293
|
+
symbol: string;
|
185
294
|
type: "substrate-foreignassets";
|
186
|
-
|
187
|
-
existentialDeposit: string;
|
295
|
+
platform: "polkadot";
|
188
296
|
onChainId: string;
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
297
|
+
isSufficient: boolean;
|
298
|
+
existentialDeposit: string;
|
299
|
+
isDefault?: boolean | undefined;
|
300
|
+
name?: string | undefined;
|
301
|
+
logo?: string | undefined;
|
302
|
+
coingeckoId?: string | undefined;
|
303
|
+
noDiscovery?: boolean | undefined;
|
304
|
+
mirrorOf?: string | undefined;
|
305
|
+
isFrozen?: boolean | undefined;
|
306
|
+
} | {
|
307
|
+
id: string;
|
308
|
+
networkId: string;
|
309
|
+
decimals: number;
|
310
|
+
symbol: string;
|
194
311
|
type: "substrate-native";
|
195
|
-
|
312
|
+
platform: "polkadot";
|
196
313
|
existentialDeposit: string;
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
314
|
+
isDefault?: boolean | undefined;
|
315
|
+
name?: string | undefined;
|
316
|
+
logo?: string | undefined;
|
317
|
+
coingeckoId?: string | undefined;
|
318
|
+
noDiscovery?: boolean | undefined;
|
319
|
+
mirrorOf?: string | undefined;
|
320
|
+
} | {
|
321
|
+
id: string;
|
322
|
+
networkId: string;
|
323
|
+
decimals: number;
|
324
|
+
symbol: string;
|
201
325
|
type: "substrate-psp22";
|
202
|
-
|
203
|
-
existentialDeposit: string;
|
326
|
+
platform: "polkadot";
|
204
327
|
contractAddress: string;
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
328
|
+
isDefault?: boolean | undefined;
|
329
|
+
name?: string | undefined;
|
330
|
+
logo?: string | undefined;
|
331
|
+
coingeckoId?: string | undefined;
|
332
|
+
noDiscovery?: boolean | undefined;
|
333
|
+
mirrorOf?: string | undefined;
|
334
|
+
} | {
|
335
|
+
id: string;
|
336
|
+
networkId: string;
|
337
|
+
decimals: number;
|
338
|
+
symbol: string;
|
209
339
|
type: "substrate-tokens";
|
210
|
-
|
211
|
-
existentialDeposit: string;
|
340
|
+
platform: "polkadot";
|
212
341
|
onChainId: string | number;
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
342
|
+
existentialDeposit: string;
|
343
|
+
isDefault?: boolean | undefined;
|
344
|
+
name?: string | undefined;
|
345
|
+
logo?: string | undefined;
|
346
|
+
coingeckoId?: string | undefined;
|
347
|
+
noDiscovery?: boolean | undefined;
|
348
|
+
mirrorOf?: string | undefined;
|
349
|
+
} | {
|
350
|
+
id: string;
|
351
|
+
networkId: string;
|
352
|
+
decimals: number;
|
353
|
+
symbol: string;
|
354
|
+
type: "substrate-hydration";
|
355
|
+
platform: "polkadot";
|
356
|
+
onChainId: number;
|
357
|
+
assetType: "Token" | "Erc20";
|
358
|
+
isSufficient: boolean;
|
359
|
+
existentialDeposit: string;
|
360
|
+
isDefault?: boolean | undefined;
|
361
|
+
name?: string | undefined;
|
362
|
+
logo?: string | undefined;
|
363
|
+
coingeckoId?: string | undefined;
|
364
|
+
noDiscovery?: boolean | undefined;
|
365
|
+
mirrorOf?: string | undefined;
|
366
|
+
} | null;
|
217
367
|
get decimals(): number | null;
|
218
368
|
get rates(): TokenRates | null;
|
219
369
|
/**
|
@@ -248,7 +398,6 @@ export declare class Balance {
|
|
248
398
|
/** The frozen balance of this token. Is included in the free amount. */
|
249
399
|
get locked(): BalanceFormatter;
|
250
400
|
get locks(): FormattedAmount<AmountWithLabel<string>, string>[];
|
251
|
-
get crowdloans(): FormattedAmount<AmountWithLabel<string>, string>[];
|
252
401
|
get nompools(): FormattedAmount<AmountWithLabel<string>, string>[];
|
253
402
|
get subtensor(): FormattedAmount<AmountWithLabel<string>, string>[];
|
254
403
|
/** The extra balance of this token */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PluginBalanceTypes } from "@talismn/balances/plugins";
|
2
|
-
import {
|
2
|
+
import { NetworkId, TokenId } from "@talismn/chaindata-provider";
|
3
3
|
import { Address } from "./addresses";
|
4
4
|
/**
|
5
5
|
* `BalanceTypes` is an automatically determined sub-selection of `PluginBalanceTypes`.
|
@@ -34,17 +34,7 @@ type IBalanceBase = {
|
|
34
34
|
address: Address;
|
35
35
|
/** The token this balance is for */
|
36
36
|
tokenId: TokenId;
|
37
|
-
|
38
|
-
type IBalanceBaseEvm = {
|
39
|
-
/** WIP, use `chainId` or `evmNetworkId` for now */
|
40
|
-
multiChainId: EvmChainId;
|
41
|
-
/** The evm chain this balance is on */
|
42
|
-
evmNetworkId: EvmNetworkId;
|
43
|
-
};
|
44
|
-
type IBalanceBaseSubstrate = {
|
45
|
-
multiChainId: SubChainId;
|
46
|
-
/** The substrate chain this balance is on */
|
47
|
-
chainId: ChainId;
|
37
|
+
networkId: NetworkId;
|
48
38
|
};
|
49
39
|
type IBalanceSimpleValues = {
|
50
40
|
/** For balance types with a simple value, this is the value of the balance (eg, evm native token balance) */
|
@@ -57,19 +47,19 @@ type IBalanceComplexValues = {
|
|
57
47
|
value?: undefined;
|
58
48
|
};
|
59
49
|
/** `IBalance` is a common interface which all balance types must implement. */
|
60
|
-
export type IBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues)
|
61
|
-
export type EvmBalance = IBalanceBase &
|
62
|
-
export type SubstrateBalance = IBalanceBase &
|
50
|
+
export type IBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues);
|
51
|
+
export type EvmBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues);
|
52
|
+
export type SubstrateBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues);
|
63
53
|
/** An unlabelled amount of a balance */
|
64
54
|
export type Amount = string;
|
65
|
-
export type BalanceStatusTypes = "free" | "reserved" | "locked" | "extra" | "
|
55
|
+
export type BalanceStatusTypes = "free" | "reserved" | "locked" | "extra" | "nompool" | "subtensor";
|
66
56
|
/** A labelled amount of a balance */
|
67
57
|
type BaseAmountWithLabel<TLabel extends string> = {
|
68
58
|
type: BalanceStatusTypes;
|
69
59
|
/**
|
70
60
|
* For modules which fetch balances via module sources, the source is equivalent to previous 'subSource' field
|
71
61
|
* on the parent balance object
|
72
|
-
* e.g. `staking`
|
62
|
+
* e.g. `staking`
|
73
63
|
**/
|
74
64
|
source?: string;
|
75
65
|
label: TLabel;
|
@@ -101,7 +91,7 @@ export type ExtraAmount<TLabel extends string> = BaseAmountWithLabel<TLabel> & {
|
|
101
91
|
includeInTotal?: boolean;
|
102
92
|
};
|
103
93
|
/** Used by plugins to help define their custom `BalanceType` */
|
104
|
-
export type NewBalanceType<TModuleType extends string, TBalanceValueType extends "simple" | "complex"
|
94
|
+
export type NewBalanceType<TModuleType extends string, TBalanceValueType extends "simple" | "complex"> = IBalanceBase & (TBalanceValueType extends "simple" ? IBalanceSimpleValues : IBalanceComplexValues) & {
|
105
95
|
source: TModuleType;
|
106
96
|
};
|
107
97
|
export {};
|
@@ -1,6 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { AnyMiniMetadataSchema } from "@talismn/chaindata-provider";
|
2
|
+
import z from "zod/v4";
|
3
|
+
import { AnyNewBalanceModule, InferChainMeta } from "../modules";
|
2
4
|
/** For fast db access, you can calculate the primary key for a miniMetadata using this method */
|
3
|
-
export declare const deriveMiniMetadataId: ({ source, chainId,
|
5
|
+
export declare const deriveMiniMetadataId: ({ source, chainId, specVersion, }: Pick<MiniMetadata, "source" | "chainId" | "specVersion">) => string;
|
4
6
|
export type MiniMetadataStatus =
|
5
7
|
/** Metadata is up to date */
|
6
8
|
"good"
|
@@ -8,26 +10,6 @@ export type MiniMetadataStatus =
|
|
8
10
|
| "outdated"
|
9
11
|
/** Metadata doesn't exist */
|
10
12
|
| "none";
|
11
|
-
export type MiniMetadata = {
|
12
|
-
|
13
|
-
id: string;
|
14
|
-
/** The balance module which created this miniMetadata */
|
15
|
-
source: string;
|
16
|
-
/** The chain this miniMetadata came from */
|
17
|
-
chainId: ChainId;
|
18
|
-
/** The chain specName which this miniMetadata is valid for */
|
19
|
-
specName: string;
|
20
|
-
/** The chain specVersion which this miniMetadata is valid for */
|
21
|
-
specVersion: string;
|
22
|
-
/** The JSON-encoded chain balancesConfig which this miniMetadata is valid for */
|
23
|
-
balancesConfig: string;
|
24
|
-
/** The version of the metadata format e.g. 13, 14, 15, etc */
|
25
|
-
version: number;
|
26
|
-
/** The miniMetadata encoded as a hex string */
|
27
|
-
data: `0x${string}` | null;
|
28
|
-
/**
|
29
|
-
* Some balance modules need a little bit of extra data in addition to the miniMetadata.
|
30
|
-
* They can store that data as a JSON-encoded string here.
|
31
|
-
*/
|
32
|
-
extra: string;
|
13
|
+
export type MiniMetadata<M extends AnyNewBalanceModule = AnyNewBalanceModule> = Omit<z.infer<typeof AnyMiniMetadataSchema>, "extra"> & {
|
14
|
+
extra: InferChainMeta<M>["extra"];
|
33
15
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare const TokenConfigBaseSchema: import("zod/v4").ZodObject<{
|
2
|
+
symbol: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
3
|
+
networkId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
4
|
+
isDefault: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodBoolean>>;
|
5
|
+
decimals: import("zod/v4").ZodOptional<import("zod/v4").ZodInt>;
|
6
|
+
name: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodString>>;
|
7
|
+
logo: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodString>>;
|
8
|
+
coingeckoId: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodString>>;
|
9
|
+
noDiscovery: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodBoolean>>;
|
10
|
+
mirrorOf: import("zod/v4").ZodOptional<import("zod/v4").ZodOptional<import("zod/v4").ZodString>>;
|
11
|
+
}, import("zod/v4/core").$strict>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { MINIMETADATA_VERSION } from "@talismn/chaindata-provider";
|