@talismn/balances 0.0.0-pr2043-20250619072437 → 0.0.0-pr2043-20250619151012
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 +7 -3
- package/dist/declarations/src/getMiniMetadata/index.d.ts +2 -1
- package/dist/declarations/src/modules/SubstrateAssetsModule.d.ts +2 -4
- package/dist/declarations/src/modules/SubstrateForeignAssetsModule.d.ts +2 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeCrowdloans.d.ts +1 -1
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeNompoolStaking.d.ts +1 -1
- package/dist/declarations/src/modules/SubstrateNativeModule/subscribeSubtensorStaking.d.ts +1 -1
- package/dist/declarations/src/modules/SubstrateNativeModule/types.d.ts +3 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/util/QueryCache.d.ts +4 -4
- package/dist/declarations/src/modules/SubstrateNativeModule/util/buildQueries.d.ts +3 -2
- package/dist/declarations/src/modules/SubstrateTokensModule.d.ts +3 -4
- package/dist/declarations/src/modules/index.d.ts +5 -17
- package/dist/declarations/src/modules/util/buildStorageCoders.d.ts +3 -4
- package/dist/declarations/src/modules/util/getAddresssesByTokenByNetwork.d.ts +3 -0
- package/dist/declarations/src/modules/util/index.d.ts +0 -1
- package/dist/declarations/src/types/balances.d.ts +0 -11
- package/dist/declarations/src/types/minimetadatas.d.ts +13 -8
- package/dist/talismn-balances.cjs.dev.js +178 -209
- package/dist/talismn-balances.cjs.prod.js +178 -209
- package/dist/talismn-balances.esm.js +175 -206
- package/package.json +6 -6
- package/dist/declarations/src/modules/SubstrateNativeModule/util/detectMiniMetadataChanges.d.ts +0 -2
- package/dist/declarations/src/modules/util/findChainMeta.d.ts +0 -8
@@ -2,13 +2,17 @@ import { ChainConnector } from "@talismn/chain-connector";
|
|
2
2
|
import { ChainConnectorEvm } from "@talismn/chain-connector-evm";
|
3
3
|
import { ChaindataProvider, ChainId, Token } from "@talismn/chaindata-provider";
|
4
4
|
import { AddressesByToken, BalanceJson, Balances, SubscriptionCallback, UnsubscribeFn } from "./types";
|
5
|
+
export type ChainMeta<Extra extends Record<string, unknown> | null> = {
|
6
|
+
miniMetadata: `0x${string}` | null;
|
7
|
+
extra: Extra;
|
8
|
+
};
|
5
9
|
export type BalancesCommonTransferMethods = "transfer_keep_alive" | "transfer_all";
|
6
10
|
export type BalancesTransferMethods = "transfer_allow_death" | BalancesCommonTransferMethods;
|
7
11
|
export type BalancesLegacyTransferMethods = "transfer" | BalancesCommonTransferMethods;
|
8
12
|
export type BalancesAllTransferMethods = BalancesLegacyTransferMethods | BalancesTransferMethods;
|
9
13
|
export type SelectableTokenType = Token;
|
10
|
-
export type ExtendableChainMeta = Record<string, unknown> |
|
11
|
-
export type DefaultChainMeta =
|
14
|
+
export type ExtendableChainMeta = ChainMeta<Record<string, unknown> | null>;
|
15
|
+
export type DefaultChainMeta = ChainMeta<null>;
|
12
16
|
export type ExtendableModuleConfig = Record<string, unknown> | undefined;
|
13
17
|
export type DefaultModuleConfig = undefined;
|
14
18
|
export type BaseTransferParams = {
|
@@ -34,7 +38,7 @@ export type Hydrate = {
|
|
34
38
|
chainConnectors: ChainConnectors;
|
35
39
|
chaindataProvider: ChaindataProvider;
|
36
40
|
};
|
37
|
-
export type NewBalanceModule<TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta
|
41
|
+
export type NewBalanceModule<TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta, TModuleConfig extends ExtendableModuleConfig = DefaultModuleConfig, TTransferParams extends ExtendableTransferParams = DefaultTransferParams> = (hydrate: Hydrate) => BalanceModule<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams>;
|
38
42
|
export interface BalanceModule<TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta = DefaultChainMeta, TModuleConfig extends ExtendableModuleConfig = DefaultModuleConfig, TTransferParams extends ExtendableTransferParams = DefaultTransferParams> extends BalanceModuleSubstrate<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams>, BalanceModuleEvm<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams> {
|
39
43
|
}
|
40
44
|
export declare const DefaultBalanceModule: <TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta = DefaultChainMeta, TModuleConfig extends ExtendableModuleConfig = DefaultModuleConfig, TTransferParams extends ExtendableTransferParams = DefaultTransferParams>(type: TModuleType) => BalanceModule<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ChainConnector } from "@talismn/chain-connector";
|
2
2
|
import { ChaindataProvider, NetworkId as DotNetworkId } from "@talismn/chaindata-provider";
|
3
|
+
import { AnyNewBalanceModule } from "../modules";
|
3
4
|
import { MiniMetadata } from "../types";
|
4
|
-
export declare const getMiniMetadata: (chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, chainId: DotNetworkId, source: string, signal?: AbortSignal) => Promise<MiniMetadata
|
5
|
+
export declare const getMiniMetadata: <T extends AnyNewBalanceModule>(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, chainId: DotNetworkId, source: string, signal?: AbortSignal) => Promise<MiniMetadata<T>>;
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import { TypeRegistry } from "@polkadot/types";
|
2
2
|
import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
|
3
3
|
import { BalancesConfigTokenParams, SubAssetsToken } from "@talismn/chaindata-provider";
|
4
|
-
import { NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
4
|
+
import { ChainMeta, NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
5
5
|
import { NewBalanceType } from "../types";
|
6
6
|
type ModuleType = "substrate-assets";
|
7
|
-
export type SubAssetsChainMeta =
|
8
|
-
miniMetadata?: string;
|
9
|
-
};
|
7
|
+
export type SubAssetsChainMeta = ChainMeta<null>;
|
10
8
|
export type SubAssetsModuleConfig = {
|
11
9
|
tokens?: Array<{
|
12
10
|
assetId: number | string;
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import { TypeRegistry } from "@polkadot/types";
|
2
2
|
import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
|
3
3
|
import { BalancesConfigTokenParams, SubForeignAssetsToken } from "@talismn/chaindata-provider";
|
4
|
-
import { NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
4
|
+
import { DefaultChainMeta, NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
5
5
|
import { NewBalanceType } from "../types";
|
6
6
|
type ModuleType = "substrate-foreignassets";
|
7
|
-
export type SubForeignAssetsChainMeta =
|
8
|
-
miniMetadata?: string;
|
9
|
-
};
|
7
|
+
export type SubForeignAssetsChainMeta = DefaultChainMeta;
|
10
8
|
export type SubForeignAssetsModuleConfig = {
|
11
9
|
tokens?: Array<{
|
12
10
|
onChainId: string;
|
@@ -2,4 +2,4 @@ import { ChainConnector } from "@talismn/chain-connector";
|
|
2
2
|
import { ChaindataProvider, CustomSubNativeToken, SubNativeToken } from "@talismn/chaindata-provider";
|
3
3
|
import { AddressesByToken, SubscriptionCallback } from "../../types";
|
4
4
|
import { SubNativeBalance } from "./types";
|
5
|
-
export declare function subscribeCrowdloans(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken | CustomSubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]
|
5
|
+
export declare function subscribeCrowdloans(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken | CustomSubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]>, signal?: AbortSignal): Promise<() => void>;
|
@@ -2,4 +2,4 @@ import { ChainConnector } from "@talismn/chain-connector";
|
|
2
2
|
import { ChaindataProvider, SubNativeToken } from "@talismn/chaindata-provider";
|
3
3
|
import { AddressesByToken, SubscriptionCallback } from "../../types";
|
4
4
|
import { SubNativeBalance } from "./types";
|
5
|
-
export declare function subscribeNompoolStaking(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]
|
5
|
+
export declare function subscribeNompoolStaking(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]>, signal?: AbortSignal): Promise<() => void>;
|
@@ -2,4 +2,4 @@ import { ChainConnector } from "@talismn/chain-connector";
|
|
2
2
|
import { ChaindataProvider, SubNativeToken } from "@talismn/chaindata-provider";
|
3
3
|
import { AddressesByToken, SubscriptionCallback } from "../../types";
|
4
4
|
import { SubNativeBalance } from "./types";
|
5
|
-
export declare function subscribeSubtensorStaking(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]
|
5
|
+
export declare function subscribeSubtensorStaking(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector, addressesByToken: AddressesByToken<SubNativeToken>, callback: SubscriptionCallback<SubNativeBalance[]>, signal?: AbortSignal): Promise<() => void>;
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import { TypeRegistry } from "@polkadot/types";
|
2
2
|
import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
|
3
3
|
import { BalancesConfigTokenParams } from "@talismn/chaindata-provider";
|
4
|
-
import { NewTransferParamsType } from "../../BalanceModule";
|
4
|
+
import { ChainMeta, NewTransferParamsType } from "../../BalanceModule";
|
5
5
|
import { NewBalanceType } from "../../types";
|
6
6
|
export { filterBaseLocks, getLockTitle } from "./util/balanceLockTypes";
|
7
7
|
export type { BalanceLockType } from "./util/balanceLockTypes";
|
8
8
|
export type ModuleType = "substrate-native";
|
9
9
|
export declare const moduleType: ModuleType;
|
10
|
-
export type SubNativeChainMeta = {
|
10
|
+
export type SubNativeChainMeta = ChainMeta<{
|
11
11
|
useLegacyTransferableCalculation?: boolean;
|
12
12
|
existentialDeposit?: string;
|
13
13
|
nominationPoolsPalletId?: string;
|
14
14
|
crowdloanPalletId?: string;
|
15
15
|
hasSubtensorPallet?: boolean;
|
16
|
-
|
17
|
-
};
|
16
|
+
} | null>;
|
18
17
|
export type SubNativeModuleConfig = {
|
19
18
|
disable?: boolean;
|
20
19
|
} & BalancesConfigTokenParams;
|
@@ -1,13 +1,13 @@
|
|
1
|
+
import { ChainConnector } from "@talismn/chain-connector";
|
1
2
|
import { ChaindataProvider, SubNativeToken } from "@talismn/chaindata-provider";
|
2
3
|
import { AddressesByToken } from "../../../types";
|
3
4
|
import { RpcStateQuery } from "../../util";
|
4
5
|
import { SubNativeBalance } from "../types";
|
5
6
|
export declare class QueryCache {
|
7
|
+
#private;
|
6
8
|
private chaindataProvider;
|
9
|
+
private miniMetadatas;
|
7
10
|
private balanceQueryCache;
|
8
|
-
|
9
|
-
constructor(chaindataProvider: ChaindataProvider);
|
10
|
-
ensureSetup(): void;
|
11
|
-
destroy(): void;
|
11
|
+
constructor(chaindataProvider: ChaindataProvider, chainConnector: ChainConnector);
|
12
12
|
getQueries(addressesByToken: AddressesByToken<SubNativeToken>): Promise<RpcStateQuery<SubNativeBalance>[]>;
|
13
13
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { DotNetwork, SubNativeToken, Token } from "@talismn/chaindata-provider";
|
1
|
+
import { DotNetwork, DotNetworkId, SubNativeToken, Token } from "@talismn/chaindata-provider";
|
2
|
+
import { SubNativeModule } from "..";
|
2
3
|
import { AddressesByToken, MiniMetadata } from "../../../types";
|
3
4
|
import { RpcStateQuery, StorageCoders } from "../../util";
|
4
5
|
import { SubNativeBalance } from "../types";
|
@@ -10,4 +11,4 @@ export declare function buildQueries(chains: Record<string, DotNetwork>, tokens:
|
|
10
11
|
holds: ["Balances", "Holds"];
|
11
12
|
locks: ["Balances", "Locks"];
|
12
13
|
freezes: ["Balances", "Freezes"];
|
13
|
-
}>, miniMetadatas: Map<
|
14
|
+
}>, miniMetadatas: Map<DotNetworkId, MiniMetadata<typeof SubNativeModule>>, addressesByToken: AddressesByToken<SubNativeToken>): Promise<Record<QueryKey, Array<RpcStateQuery<SubNativeBalance>>>>;
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import { TypeRegistry } from "@polkadot/types";
|
2
2
|
import { ExtDef } from "@polkadot/types/extrinsic/signedExtensions/types";
|
3
3
|
import { BalancesConfigTokenParams, SubTokensToken } from "@talismn/chaindata-provider";
|
4
|
-
import { NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
4
|
+
import { ChainMeta, NewBalanceModule, NewTransferParamsType } from "../BalanceModule";
|
5
5
|
import { NewBalanceType } from "../types";
|
6
6
|
type ModuleType = "substrate-tokens";
|
7
|
-
export type SubTokensChainMeta = {
|
7
|
+
export type SubTokensChainMeta = ChainMeta<{
|
8
8
|
palletId?: string;
|
9
|
-
|
10
|
-
};
|
9
|
+
}>;
|
11
10
|
export type SubTokensModuleConfig = {
|
12
11
|
palletId?: string;
|
13
12
|
tokens?: Array<{
|
@@ -7,7 +7,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
7
7
|
type: "evm-erc20";
|
8
8
|
platform: "ethereum";
|
9
9
|
contractAddress: `0x${string}`;
|
10
|
-
isTestnet?: boolean | undefined;
|
11
10
|
isDefault?: boolean | undefined;
|
12
11
|
logo?: string | undefined;
|
13
12
|
coingeckoId?: string | undefined;
|
@@ -24,13 +23,12 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
24
23
|
platform: "ethereum";
|
25
24
|
contractAddress: `0x${string}`;
|
26
25
|
isCustom: true;
|
27
|
-
isTestnet?: boolean | undefined;
|
28
26
|
isDefault?: boolean | undefined;
|
29
27
|
logo?: string | undefined;
|
30
28
|
coingeckoId?: string | undefined;
|
31
29
|
noDiscovery?: boolean | undefined;
|
32
30
|
mirrorOf?: string | undefined;
|
33
|
-
},
|
31
|
+
}, import("..").DefaultChainMeta, import("./EvmErc20Module").EvmErc20ModuleConfig> | import("..").NewBalanceModule<"evm-native", {
|
34
32
|
id: string;
|
35
33
|
decimals: number;
|
36
34
|
symbol: string;
|
@@ -38,7 +36,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
38
36
|
networkId: string;
|
39
37
|
type: "evm-native";
|
40
38
|
platform: "ethereum";
|
41
|
-
isTestnet?: boolean | undefined;
|
42
39
|
isDefault?: boolean | undefined;
|
43
40
|
logo?: string | undefined;
|
44
41
|
coingeckoId?: string | undefined;
|
@@ -53,13 +50,12 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
53
50
|
type: "evm-native";
|
54
51
|
platform: "ethereum";
|
55
52
|
isCustom: true;
|
56
|
-
isTestnet?: boolean | undefined;
|
57
53
|
isDefault?: boolean | undefined;
|
58
54
|
logo?: string | undefined;
|
59
55
|
coingeckoId?: string | undefined;
|
60
56
|
noDiscovery?: boolean | undefined;
|
61
57
|
mirrorOf?: string | undefined;
|
62
|
-
},
|
58
|
+
}, import("..").DefaultChainMeta, import("@talismn/chaindata-provider").BalancesConfigTokenParams> | import("..").NewBalanceModule<"evm-uniswapv2", {
|
63
59
|
id: string;
|
64
60
|
decimals: number;
|
65
61
|
symbol: string;
|
@@ -74,7 +70,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
74
70
|
decimals1: number;
|
75
71
|
tokenAddress0: `0x${string}`;
|
76
72
|
tokenAddress1: `0x${string}`;
|
77
|
-
isTestnet?: boolean | undefined;
|
78
73
|
isDefault?: boolean | undefined;
|
79
74
|
logo?: string | undefined;
|
80
75
|
coingeckoId?: string | undefined;
|
@@ -99,7 +94,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
99
94
|
tokenAddress0: `0x${string}`;
|
100
95
|
tokenAddress1: `0x${string}`;
|
101
96
|
isCustom: true;
|
102
|
-
isTestnet?: boolean | undefined;
|
103
97
|
isDefault?: boolean | undefined;
|
104
98
|
logo?: string | undefined;
|
105
99
|
coingeckoId?: string | undefined;
|
@@ -107,7 +101,7 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
107
101
|
mirrorOf?: string | undefined;
|
108
102
|
coingeckoId0?: string | undefined;
|
109
103
|
coingeckoId1?: string | undefined;
|
110
|
-
},
|
104
|
+
}, import("..").DefaultChainMeta, import("./EvmUniswapV2Module").EvmUniswapV2ModuleConfig> | import("..").NewBalanceModule<"substrate-assets", {
|
111
105
|
id: string;
|
112
106
|
decimals: number;
|
113
107
|
symbol: string;
|
@@ -117,7 +111,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
117
111
|
platform: "polkadot";
|
118
112
|
assetId: string;
|
119
113
|
existentialDeposit: string;
|
120
|
-
isTestnet?: boolean | undefined;
|
121
114
|
isDefault?: boolean | undefined;
|
122
115
|
logo?: string | undefined;
|
123
116
|
coingeckoId?: string | undefined;
|
@@ -134,14 +127,13 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
134
127
|
platform: "polkadot";
|
135
128
|
onChainId: string;
|
136
129
|
existentialDeposit: string;
|
137
|
-
isTestnet?: boolean | undefined;
|
138
130
|
isDefault?: boolean | undefined;
|
139
131
|
logo?: string | undefined;
|
140
132
|
coingeckoId?: string | undefined;
|
141
133
|
noDiscovery?: boolean | undefined;
|
142
134
|
mirrorOf?: string | undefined;
|
143
135
|
isFrozen?: boolean | undefined;
|
144
|
-
}, import("
|
136
|
+
}, import("..").DefaultChainMeta, import("./SubstrateForeignAssetsModule").SubForeignAssetsModuleConfig, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", {
|
145
137
|
id: string;
|
146
138
|
decimals: number;
|
147
139
|
symbol: string;
|
@@ -150,7 +142,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
150
142
|
type: "substrate-native";
|
151
143
|
platform: "polkadot";
|
152
144
|
existentialDeposit: string;
|
153
|
-
isTestnet?: boolean | undefined;
|
154
145
|
isDefault?: boolean | undefined;
|
155
146
|
logo?: string | undefined;
|
156
147
|
coingeckoId?: string | undefined;
|
@@ -166,7 +157,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
166
157
|
platform: "polkadot";
|
167
158
|
existentialDeposit: string;
|
168
159
|
isCustom: true;
|
169
|
-
isTestnet?: boolean | undefined;
|
170
160
|
isDefault?: boolean | undefined;
|
171
161
|
logo?: string | undefined;
|
172
162
|
coingeckoId?: string | undefined;
|
@@ -182,13 +172,12 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
182
172
|
platform: "polkadot";
|
183
173
|
existentialDeposit: string;
|
184
174
|
contractAddress: string;
|
185
|
-
isTestnet?: boolean | undefined;
|
186
175
|
isDefault?: boolean | undefined;
|
187
176
|
logo?: string | undefined;
|
188
177
|
coingeckoId?: string | undefined;
|
189
178
|
noDiscovery?: boolean | undefined;
|
190
179
|
mirrorOf?: string | undefined;
|
191
|
-
},
|
180
|
+
}, import("..").DefaultChainMeta, import("./SubstratePsp22Module").SubPsp22ModuleConfig, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", {
|
192
181
|
id: string;
|
193
182
|
decimals: number;
|
194
183
|
symbol: string;
|
@@ -198,7 +187,6 @@ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-
|
|
198
187
|
platform: "polkadot";
|
199
188
|
onChainId: string | number;
|
200
189
|
existentialDeposit: string;
|
201
|
-
isTestnet?: boolean | undefined;
|
202
190
|
isDefault?: boolean | undefined;
|
203
191
|
logo?: string | undefined;
|
204
192
|
coingeckoId?: string | undefined;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { DotNetwork, DotNetworkId, NetworkId } from "@talismn/chaindata-provider";
|
2
2
|
import { getDynamicBuilder } from "@talismn/scale";
|
3
3
|
import { MiniMetadata } from "../../types";
|
4
|
-
import { AnyNewBalanceModule
|
4
|
+
import { AnyNewBalanceModule } from "./InferBalanceModuleTypes";
|
5
5
|
export type StorageCoders<TCoders extends {
|
6
6
|
[key: string]: [string, string];
|
7
7
|
}> = Map<string, {
|
@@ -11,11 +11,10 @@ export declare const buildStorageCoders: <TBalanceModule extends AnyNewBalanceMo
|
|
11
11
|
[key: string]: [string, string] | ((params: {
|
12
12
|
chainId: string;
|
13
13
|
}) => [string, string]);
|
14
|
-
}>({ chainIds, chains, miniMetadatas,
|
14
|
+
}>({ chainIds, chains, miniMetadatas, coders, }: {
|
15
15
|
chainIds: DotNetworkId[];
|
16
16
|
chains: Record<NetworkId, DotNetwork>;
|
17
|
-
miniMetadatas: Map<
|
18
|
-
moduleType: InferModuleType<TBalanceModule>;
|
17
|
+
miniMetadatas: Map<DotNetworkId, MiniMetadata<TBalanceModule>>;
|
19
18
|
coders: TCoders;
|
20
19
|
}) => Map<string, { [Property in keyof TCoders]: {
|
21
20
|
args: [import("scale-ts").Encoder<any[]>, import("scale-ts").Decoder<any[]>] & {
|
@@ -2,7 +2,6 @@ export * from "./balances";
|
|
2
2
|
export * from "./buildStorageCoders";
|
3
3
|
export * from "./decodeOutput";
|
4
4
|
export * from "./detectTransferMethod";
|
5
|
-
export * from "./findChainMeta";
|
6
5
|
export * from "./getUniqueChainIds";
|
7
6
|
export * from "./InferBalanceModuleTypes";
|
8
7
|
export * from "./makeContractCaller";
|
@@ -163,13 +163,10 @@ export declare class Balance {
|
|
163
163
|
forceScan?: boolean | undefined;
|
164
164
|
logo?: string | undefined;
|
165
165
|
themeColor?: string | undefined;
|
166
|
-
isRelay?: boolean | undefined;
|
167
166
|
chainspecQrUrl?: string | undefined;
|
168
167
|
latestMetadataQrUrl?: string | undefined;
|
169
168
|
overrideNativeTokenId?: string | undefined;
|
170
169
|
oldPrefix?: number | undefined;
|
171
|
-
relayId?: string | undefined;
|
172
|
-
paraId?: number | undefined;
|
173
170
|
registryTypes?: any;
|
174
171
|
signedExtensions?: any;
|
175
172
|
hasCheckMetadataHash?: boolean | undefined;
|
@@ -216,7 +213,6 @@ export declare class Balance {
|
|
216
213
|
type: "evm-erc20";
|
217
214
|
platform: "ethereum";
|
218
215
|
contractAddress: `0x${string}`;
|
219
|
-
isTestnet?: boolean | undefined;
|
220
216
|
isDefault?: boolean | undefined;
|
221
217
|
logo?: string | undefined;
|
222
218
|
coingeckoId?: string | undefined;
|
@@ -231,7 +227,6 @@ export declare class Balance {
|
|
231
227
|
networkId: string;
|
232
228
|
type: "evm-native";
|
233
229
|
platform: "ethereum";
|
234
|
-
isTestnet?: boolean | undefined;
|
235
230
|
isDefault?: boolean | undefined;
|
236
231
|
logo?: string | undefined;
|
237
232
|
coingeckoId?: string | undefined;
|
@@ -252,7 +247,6 @@ export declare class Balance {
|
|
252
247
|
decimals1: number;
|
253
248
|
tokenAddress0: `0x${string}`;
|
254
249
|
tokenAddress1: `0x${string}`;
|
255
|
-
isTestnet?: boolean | undefined;
|
256
250
|
isDefault?: boolean | undefined;
|
257
251
|
logo?: string | undefined;
|
258
252
|
coingeckoId?: string | undefined;
|
@@ -271,7 +265,6 @@ export declare class Balance {
|
|
271
265
|
platform: "polkadot";
|
272
266
|
assetId: string;
|
273
267
|
existentialDeposit: string;
|
274
|
-
isTestnet?: boolean | undefined;
|
275
268
|
isDefault?: boolean | undefined;
|
276
269
|
logo?: string | undefined;
|
277
270
|
coingeckoId?: string | undefined;
|
@@ -288,7 +281,6 @@ export declare class Balance {
|
|
288
281
|
platform: "polkadot";
|
289
282
|
onChainId: string;
|
290
283
|
existentialDeposit: string;
|
291
|
-
isTestnet?: boolean | undefined;
|
292
284
|
isDefault?: boolean | undefined;
|
293
285
|
logo?: string | undefined;
|
294
286
|
coingeckoId?: string | undefined;
|
@@ -304,7 +296,6 @@ export declare class Balance {
|
|
304
296
|
type: "substrate-native";
|
305
297
|
platform: "polkadot";
|
306
298
|
existentialDeposit: string;
|
307
|
-
isTestnet?: boolean | undefined;
|
308
299
|
isDefault?: boolean | undefined;
|
309
300
|
logo?: string | undefined;
|
310
301
|
coingeckoId?: string | undefined;
|
@@ -320,7 +311,6 @@ export declare class Balance {
|
|
320
311
|
platform: "polkadot";
|
321
312
|
existentialDeposit: string;
|
322
313
|
contractAddress: string;
|
323
|
-
isTestnet?: boolean | undefined;
|
324
314
|
isDefault?: boolean | undefined;
|
325
315
|
logo?: string | undefined;
|
326
316
|
coingeckoId?: string | undefined;
|
@@ -336,7 +326,6 @@ export declare class Balance {
|
|
336
326
|
platform: "polkadot";
|
337
327
|
onChainId: string | number;
|
338
328
|
existentialDeposit: string;
|
339
|
-
isTestnet?: boolean | undefined;
|
340
329
|
isDefault?: boolean | undefined;
|
341
330
|
logo?: string | undefined;
|
342
331
|
coingeckoId?: string | undefined;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import z from "zod/v4";
|
2
|
+
import { AnyNewBalanceModule, InferChainMeta } from "../modules";
|
2
3
|
/** For fast db access, you can calculate the primary key for a miniMetadata using this method */
|
3
4
|
export declare const deriveMiniMetadataId: ({ source, chainId, specVersion, libVersion, }: Pick<MiniMetadata, "source" | "chainId" | "specVersion" | "libVersion">) => string;
|
4
5
|
export type MiniMetadataStatus =
|
@@ -8,17 +9,21 @@ export type MiniMetadataStatus =
|
|
8
9
|
| "outdated"
|
9
10
|
/** Metadata doesn't exist */
|
10
11
|
| "none";
|
11
|
-
export
|
12
|
+
export declare const MiniMetadataBaseSchema: z.ZodObject<{
|
12
13
|
/** The DB id for this metadata */
|
13
|
-
id:
|
14
|
+
id: z.ZodString;
|
14
15
|
/** The balance module which created this miniMetadata */
|
15
|
-
source:
|
16
|
+
source: z.ZodString;
|
16
17
|
/** The chain this miniMetadata came from */
|
17
|
-
chainId:
|
18
|
+
chainId: z.ZodString;
|
18
19
|
/** The chain specVersion which this miniMetadata is valid for */
|
19
|
-
specVersion:
|
20
|
+
specVersion: z.ZodUInt32;
|
20
21
|
/** the version of the balances library used to craft the mini metadata */
|
21
|
-
libVersion:
|
22
|
+
libVersion: z.ZodString;
|
22
23
|
/** The miniMetadata encoded as a hex string */
|
23
|
-
data:
|
24
|
+
data: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
25
|
+
extra: z.ZodNullable<z.ZodAny>;
|
26
|
+
}, z.core.$strict>;
|
27
|
+
export type MiniMetadata<M extends AnyNewBalanceModule = AnyNewBalanceModule> = Omit<z.infer<typeof MiniMetadataBaseSchema>, "extra"> & {
|
28
|
+
extra: InferChainMeta<M>["extra"];
|
24
29
|
};
|