@talismn/balances 1.3.1 → 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.
- package/dist/index.d.mts +2100 -0
- package/dist/index.d.ts +2100 -0
- package/dist/index.js +7960 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +7961 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +30 -38
- package/dist/declarations/src/BalancesProvider.d.ts +0 -36
- package/dist/declarations/src/getMiniMetadatas/getMetadataRpc.d.ts +0 -3
- package/dist/declarations/src/getMiniMetadatas/getSpecVersion.d.ts +0 -6
- package/dist/declarations/src/getMiniMetadatas/index.d.ts +0 -5
- package/dist/declarations/src/index.d.ts +0 -4
- package/dist/declarations/src/log.d.ts +0 -2
- package/dist/declarations/src/modules/abis/erc20BalancesAggregator.d.ts +0 -19
- package/dist/declarations/src/modules/abis/index.d.ts +0 -3
- package/dist/declarations/src/modules/abis/multicall.d.ts +0 -276
- package/dist/declarations/src/modules/abis/uniswapV2Pair.d.ts +0 -560
- package/dist/declarations/src/modules/evm-erc20/config.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/index.d.ts +0 -2
- package/dist/declarations/src/modules/evm-erc20/module.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-erc20/types.d.ts +0 -14
- package/dist/declarations/src/modules/evm-erc20/utils.d.ts +0 -6
- package/dist/declarations/src/modules/evm-native/config.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/index.d.ts +0 -2
- package/dist/declarations/src/modules/evm-native/module.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-native/types.d.ts +0 -13
- package/dist/declarations/src/modules/evm-uniswapv2/config.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/index.d.ts +0 -2
- package/dist/declarations/src/modules/evm-uniswapv2/module.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/evm-uniswapv2/types.d.ts +0 -14
- package/dist/declarations/src/modules/evm-uniswapv2/utils.d.ts +0 -12
- package/dist/declarations/src/modules/index.d.ts +0 -157
- package/dist/declarations/src/modules/shared/buildNetworkStorageCoders.d.ts +0 -13
- package/dist/declarations/src/modules/shared/detectedTokens.d.ts +0 -3
- package/dist/declarations/src/modules/shared/errors.d.ts +0 -11
- package/dist/declarations/src/modules/shared/fetchRuntimeCallResult.d.ts +0 -2
- package/dist/declarations/src/modules/shared/index.d.ts +0 -6
- package/dist/declarations/src/modules/shared/rpcQueryPack.d.ts +0 -10
- package/dist/declarations/src/modules/shared/types.d.ts +0 -12
- package/dist/declarations/src/modules/shared/utils.d.ts +0 -6
- package/dist/declarations/src/modules/sol-native/config.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/index.d.ts +0 -2
- package/dist/declarations/src/modules/sol-native/module.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/sol-native/types.d.ts +0 -13
- package/dist/declarations/src/modules/sol-spl/config.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/index.d.ts +0 -2
- package/dist/declarations/src/modules/sol-spl/module.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/sol-spl/types.d.ts +0 -14
- package/dist/declarations/src/modules/substrate-assets/buildQueries.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-assets/config.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-assets/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/index.d.ts +0 -2
- package/dist/declarations/src/modules/substrate-assets/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-assets/types.d.ts +0 -14
- package/dist/declarations/src/modules/substrate-dtao/alphaPrice.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-dtao/calculatePendingRootClaimable.d.ts +0 -12
- package/dist/declarations/src/modules/substrate-dtao/config.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-dtao/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/getDtaoTokenRates.d.ts +0 -11
- package/dist/declarations/src/modules/substrate-dtao/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/index.d.ts +0 -4
- package/dist/declarations/src/modules/substrate-dtao/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-dtao/types.d.ts +0 -30
- package/dist/declarations/src/modules/substrate-foreignassets/buildQueries.d.ts +0 -6
- package/dist/declarations/src/modules/substrate-foreignassets/config.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/index.d.ts +0 -2
- package/dist/declarations/src/modules/substrate-foreignassets/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-foreignassets/types.d.ts +0 -14
- package/dist/declarations/src/modules/substrate-hydration/config.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/index.d.ts +0 -2
- package/dist/declarations/src/modules/substrate-hydration/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-hydration/types.d.ts +0 -14
- package/dist/declarations/src/modules/substrate-native/config.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/fetchTokens.d.ts +0 -8
- package/dist/declarations/src/modules/substrate-native/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/index.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/queries/buildBaseQueries.d.ts +0 -17
- package/dist/declarations/src/modules/substrate-native/queries/buildNomPoolQueries.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-native/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-native/types.d.ts +0 -24
- package/dist/declarations/src/modules/substrate-native/util/lockTypes.d.ts +0 -15
- package/dist/declarations/src/modules/substrate-native/util/nompoolAccountId.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-psp22/config.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/index.d.ts +0 -2
- package/dist/declarations/src/modules/substrate-psp22/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-psp22/types.d.ts +0 -14
- package/dist/declarations/src/modules/substrate-psp22/util.d.ts +0 -10
- package/dist/declarations/src/modules/substrate-tokens/buildQueries.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-tokens/config.d.ts +0 -5
- package/dist/declarations/src/modules/substrate-tokens/fetchBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/fetchTokens.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/getMiniMetadata.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/getTransferCallData.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/index.d.ts +0 -2
- package/dist/declarations/src/modules/substrate-tokens/module.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/subscribeBalances.d.ts +0 -3
- package/dist/declarations/src/modules/substrate-tokens/types.d.ts +0 -23
- package/dist/declarations/src/types/IBalanceModule.d.ts +0 -98
- package/dist/declarations/src/types/addresses.d.ts +0 -1
- package/dist/declarations/src/types/balances.d.ts +0 -589
- package/dist/declarations/src/types/balancetypes.d.ts +0 -71
- package/dist/declarations/src/types/chainConnectors.d.ts +0 -6
- package/dist/declarations/src/types/index.d.ts +0 -7
- package/dist/declarations/src/types/minimetadatas.d.ts +0 -6
- package/dist/declarations/src/types/subscriptions.d.ts +0 -11
- package/dist/declarations/src/types/tokens.d.ts +0 -11
- package/dist/declarations/src/version.d.ts +0 -1
- package/dist/talismn-balances.cjs.d.ts +0 -1
- package/dist/talismn-balances.cjs.dev.js +0 -7707
- package/dist/talismn-balances.cjs.js +0 -7
- package/dist/talismn-balances.cjs.prod.js +0 -7707
- package/dist/talismn-balances.esm.js +0 -7638
|
@@ -1,589 +0,0 @@
|
|
|
1
|
-
import { NetworkList, TokenList } from "@talismn/chaindata-provider";
|
|
2
|
-
import { TokenRateCurrency, TokenRates, TokenRatesList } from "@talismn/token-rates";
|
|
3
|
-
import { NonFunctionProperties } from "@talismn/util";
|
|
4
|
-
import { Amount, AmountWithLabel, BalanceJson, BalanceJsonList, BalanceStatusTypes, ExtraAmount, IBalance, LockedAmount } from "./balancetypes";
|
|
5
|
-
type FormattedAmount<GenericAmount extends AmountWithLabel<TLabel>, TLabel extends string> = Omit<GenericAmount, "amount"> & {
|
|
6
|
-
amount: BalanceFormatter;
|
|
7
|
-
};
|
|
8
|
-
export declare function excludeFromTransferableAmount(locks: Amount | FormattedAmount<LockedAmount<string>, string> | Array<FormattedAmount<LockedAmount<string>, string>>): bigint;
|
|
9
|
-
export declare function excludeFromFeePayableLocks(locks: Amount | LockedAmount<string> | Array<LockedAmount<string>>): Array<LockedAmount<string>>;
|
|
10
|
-
export declare function includeInTotalExtraAmount(extra?: FormattedAmount<ExtraAmount<string>, string> | Array<FormattedAmount<ExtraAmount<string>, string>>): bigint;
|
|
11
|
-
/** A utility type used to extract the underlying `BalanceType` of a specific source from a generalised `BalanceJson` */
|
|
12
|
-
export type NarrowBalanceType<S extends IBalance, P> = S extends {
|
|
13
|
-
source: P;
|
|
14
|
-
} ? S : never;
|
|
15
|
-
export type BalanceSource = BalanceJson["source"];
|
|
16
|
-
/** TODO: Remove this in favour of a frontend-friendly `ChaindataProvider` */
|
|
17
|
-
export type HydrateDb = Partial<{
|
|
18
|
-
networks: NetworkList;
|
|
19
|
-
tokens: TokenList;
|
|
20
|
-
tokenRates: TokenRatesList;
|
|
21
|
-
}>;
|
|
22
|
-
export type BalanceSearchQuery = Partial<NonFunctionProperties<Balance>> | ((balance: Balance) => boolean);
|
|
23
|
-
/**
|
|
24
|
-
* A collection of balances.
|
|
25
|
-
*/
|
|
26
|
-
export declare class Balances {
|
|
27
|
-
#private;
|
|
28
|
-
constructor(balances: Balances | BalanceJsonList | Balance[] | IBalance[] | BalanceJson[] | Balance, hydrate?: HydrateDb);
|
|
29
|
-
/**
|
|
30
|
-
* Calling toJSON on a collection of balances will return the underlying BalanceJsonList.
|
|
31
|
-
*/
|
|
32
|
-
toJSON: () => BalanceJsonList;
|
|
33
|
-
/**
|
|
34
|
-
* Allows the collection to be iterated over.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* [...balances].forEach(balance => { // do something // })
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* for (const balance of balances) {
|
|
41
|
-
* // do something
|
|
42
|
-
* }
|
|
43
|
-
*/
|
|
44
|
-
[Symbol.iterator]: () => ArrayIterator<Balance>;
|
|
45
|
-
/**
|
|
46
|
-
* Hydrates all balances in this collection.
|
|
47
|
-
*
|
|
48
|
-
* @param sources - The sources to hydrate from.
|
|
49
|
-
*/
|
|
50
|
-
hydrate: (sources: HydrateDb) => void;
|
|
51
|
-
/**
|
|
52
|
-
* Retrieve a balance from this collection by id.
|
|
53
|
-
*
|
|
54
|
-
* @param id - The id of the balance to fetch.
|
|
55
|
-
* @returns The balance if one exists, or none.
|
|
56
|
-
*/
|
|
57
|
-
get: (id: string) => Balance | null;
|
|
58
|
-
/**
|
|
59
|
-
* Retrieve balances from this collection by search query.
|
|
60
|
-
*
|
|
61
|
-
* @param query - The search query.
|
|
62
|
-
* @returns All balances which match the query.
|
|
63
|
-
*/
|
|
64
|
-
find: (query: BalanceSearchQuery | BalanceSearchQuery[]) => Balances;
|
|
65
|
-
/**
|
|
66
|
-
* Filters this collection to exclude token balances where the token has a `mirrorOf` field
|
|
67
|
-
* and another balance exists in this collection for the token specified by the `mirrorOf` field.
|
|
68
|
-
*/
|
|
69
|
-
filterMirrorTokens: () => Balances;
|
|
70
|
-
/**
|
|
71
|
-
* Filters this collection to only include balances which are not zero AND have a fiat conversion rate.
|
|
72
|
-
*/
|
|
73
|
-
filterNonZeroFiat: (type: "total" | "free" | "reserved" | "locked" | "frozen" | "transferable" | "unavailable" | "feePayable", currency: TokenRateCurrency) => Balances;
|
|
74
|
-
/**
|
|
75
|
-
* Add some balances to this collection.
|
|
76
|
-
* Added balances take priority over existing balances.
|
|
77
|
-
* The aggregation of the two collections is returned.
|
|
78
|
-
* The original collection is not mutated.
|
|
79
|
-
*
|
|
80
|
-
* @param balances - Either a balance or collection of balances to add.
|
|
81
|
-
* @returns The new collection of balances.
|
|
82
|
-
*/
|
|
83
|
-
add: (balances: Balances | Balance) => Balances;
|
|
84
|
-
/**
|
|
85
|
-
* Remove balances from this collection by id.
|
|
86
|
-
* A new collection without these balances is returned.
|
|
87
|
-
* The original collection is not mutated.
|
|
88
|
-
*
|
|
89
|
-
* @param ids - The id(s) of the balances to remove.
|
|
90
|
-
* @returns The new collection of balances.
|
|
91
|
-
*/
|
|
92
|
-
remove: (ids: string[] | string) => Balances;
|
|
93
|
-
get each(): Balance[];
|
|
94
|
-
/** @deprecated use each instead */
|
|
95
|
-
get sorted(): Balance[];
|
|
96
|
-
/**
|
|
97
|
-
* Get the number of balances in this collection.
|
|
98
|
-
*
|
|
99
|
-
* @returns The number of balances in this collection.
|
|
100
|
-
*/
|
|
101
|
-
get count(): number;
|
|
102
|
-
/**
|
|
103
|
-
* Get the summed value of balances in this collection.
|
|
104
|
-
* TODO: Sum up token amounts AND fiat amounts
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* // Get the sum of all transferable balances in usd.
|
|
108
|
-
* balances.sum.fiat('usd').transferable
|
|
109
|
-
*/
|
|
110
|
-
get sum(): SumBalancesFormatter;
|
|
111
|
-
}
|
|
112
|
-
export declare const getBalanceId: (balance: Pick<IBalance, "address" | "tokenId">) => string;
|
|
113
|
-
/**
|
|
114
|
-
* An individual balance.
|
|
115
|
-
*/
|
|
116
|
-
export declare class Balance {
|
|
117
|
-
#private;
|
|
118
|
-
constructor(storage: BalanceJson | IBalance, hydrate?: HydrateDb);
|
|
119
|
-
toJSON: () => BalanceJson;
|
|
120
|
-
isSource: (source: BalanceSource) => boolean;
|
|
121
|
-
hydrate: (hydrate?: HydrateDb) => void;
|
|
122
|
-
get id(): string;
|
|
123
|
-
get source(): string;
|
|
124
|
-
get status(): import("./balancetypes").BalanceStatus;
|
|
125
|
-
get address(): string;
|
|
126
|
-
get networkId(): string;
|
|
127
|
-
get network(): {
|
|
128
|
-
id: string;
|
|
129
|
-
name: string;
|
|
130
|
-
nativeTokenId: string;
|
|
131
|
-
nativeCurrency: {
|
|
132
|
-
decimals: number;
|
|
133
|
-
symbol: string;
|
|
134
|
-
name: string;
|
|
135
|
-
coingeckoId?: string | undefined;
|
|
136
|
-
mirrorOf?: string | undefined;
|
|
137
|
-
logo?: string | undefined;
|
|
138
|
-
};
|
|
139
|
-
blockExplorerUrls: string[];
|
|
140
|
-
genesisHash: `0x${string}`;
|
|
141
|
-
platform: "polkadot";
|
|
142
|
-
chainName: string;
|
|
143
|
-
specName: string;
|
|
144
|
-
specVersion: number;
|
|
145
|
-
account: "secp256k1" | "*25519";
|
|
146
|
-
prefix: number;
|
|
147
|
-
rpcs: string[];
|
|
148
|
-
topology: {
|
|
149
|
-
type: "standalone";
|
|
150
|
-
} | {
|
|
151
|
-
type: "relay";
|
|
152
|
-
} | {
|
|
153
|
-
type: "parachain";
|
|
154
|
-
relayId: string;
|
|
155
|
-
paraId: number;
|
|
156
|
-
};
|
|
157
|
-
isTestnet?: boolean | undefined;
|
|
158
|
-
isDefault?: boolean | undefined;
|
|
159
|
-
forceScan?: boolean | undefined;
|
|
160
|
-
logo?: string | undefined;
|
|
161
|
-
themeColor?: string | undefined;
|
|
162
|
-
chainspecQrUrl?: string | undefined;
|
|
163
|
-
latestMetadataQrUrl?: string | undefined;
|
|
164
|
-
oldPrefix?: number | undefined;
|
|
165
|
-
registryTypes?: any;
|
|
166
|
-
signedExtensions?: any;
|
|
167
|
-
hasCheckMetadataHash?: boolean | undefined;
|
|
168
|
-
hasExtrinsicSignatureTypePrefix?: boolean | undefined;
|
|
169
|
-
isUnknownFeeToken?: boolean | undefined;
|
|
170
|
-
balancesConfig?: {
|
|
171
|
-
"substrate-native"?: {
|
|
172
|
-
disable?: boolean | undefined;
|
|
173
|
-
} | undefined;
|
|
174
|
-
"substrate-assets"?: Record<string, never> | undefined;
|
|
175
|
-
"substrate-psp22"?: Record<string, never> | undefined;
|
|
176
|
-
"substrate-tokens"?: {
|
|
177
|
-
palletId?: string | undefined;
|
|
178
|
-
} | undefined;
|
|
179
|
-
"substrate-foreignassets"?: Record<string, never> | undefined;
|
|
180
|
-
"substrate-hydration"?: Record<string, never> | undefined;
|
|
181
|
-
"substrate-dtao"?: Record<string, never> | undefined;
|
|
182
|
-
} | undefined;
|
|
183
|
-
} | {
|
|
184
|
-
id: string;
|
|
185
|
-
name: string;
|
|
186
|
-
nativeTokenId: string;
|
|
187
|
-
nativeCurrency: {
|
|
188
|
-
decimals: number;
|
|
189
|
-
symbol: string;
|
|
190
|
-
name: string;
|
|
191
|
-
coingeckoId?: string | undefined;
|
|
192
|
-
mirrorOf?: string | undefined;
|
|
193
|
-
logo?: string | undefined;
|
|
194
|
-
};
|
|
195
|
-
blockExplorerUrls: string[];
|
|
196
|
-
platform: "ethereum";
|
|
197
|
-
rpcs: string[];
|
|
198
|
-
isTestnet?: boolean | undefined;
|
|
199
|
-
isDefault?: boolean | undefined;
|
|
200
|
-
forceScan?: boolean | undefined;
|
|
201
|
-
logo?: string | undefined;
|
|
202
|
-
themeColor?: string | undefined;
|
|
203
|
-
substrateChainId?: string | undefined;
|
|
204
|
-
preserveGasEstimate?: boolean | undefined;
|
|
205
|
-
feeType?: "legacy" | "eip-1559" | undefined;
|
|
206
|
-
l2FeeType?: {
|
|
207
|
-
type: "op-stack";
|
|
208
|
-
} | {
|
|
209
|
-
type: "scroll";
|
|
210
|
-
l1GasPriceOracle: `0x${string}`;
|
|
211
|
-
} | undefined;
|
|
212
|
-
contracts?: {
|
|
213
|
-
Erc20Aggregator?: `0x${string}` | undefined;
|
|
214
|
-
Multicall3?: `0x${string}` | undefined;
|
|
215
|
-
} | undefined;
|
|
216
|
-
balancesConfig?: {
|
|
217
|
-
"evm-native"?: Record<string, never> | undefined;
|
|
218
|
-
"evm-erc20"?: Record<string, never> | undefined;
|
|
219
|
-
"evm-uniswapv2"?: Record<string, never> | undefined;
|
|
220
|
-
} | undefined;
|
|
221
|
-
} | {
|
|
222
|
-
id: string;
|
|
223
|
-
name: string;
|
|
224
|
-
nativeTokenId: string;
|
|
225
|
-
nativeCurrency: {
|
|
226
|
-
decimals: number;
|
|
227
|
-
symbol: string;
|
|
228
|
-
name: string;
|
|
229
|
-
coingeckoId?: string | undefined;
|
|
230
|
-
mirrorOf?: string | undefined;
|
|
231
|
-
logo?: string | undefined;
|
|
232
|
-
};
|
|
233
|
-
blockExplorerUrls: string[];
|
|
234
|
-
platform: "solana";
|
|
235
|
-
genesisHash: string;
|
|
236
|
-
rpcs: string[];
|
|
237
|
-
isTestnet?: boolean | undefined;
|
|
238
|
-
isDefault?: boolean | undefined;
|
|
239
|
-
forceScan?: boolean | undefined;
|
|
240
|
-
logo?: string | undefined;
|
|
241
|
-
themeColor?: string | undefined;
|
|
242
|
-
balancesConfig?: {
|
|
243
|
-
"sol-native"?: Record<string, never> | undefined;
|
|
244
|
-
"sol-spl"?: Record<string, never> | undefined;
|
|
245
|
-
} | undefined;
|
|
246
|
-
} | null;
|
|
247
|
-
get tokenId(): string;
|
|
248
|
-
get token(): {
|
|
249
|
-
id: string;
|
|
250
|
-
networkId: string;
|
|
251
|
-
decimals: number;
|
|
252
|
-
symbol: string;
|
|
253
|
-
type: "evm-erc20";
|
|
254
|
-
platform: "ethereum";
|
|
255
|
-
contractAddress: `0x${string}`;
|
|
256
|
-
isDefault?: boolean | undefined;
|
|
257
|
-
name?: string | undefined;
|
|
258
|
-
logo?: string | undefined;
|
|
259
|
-
coingeckoId?: string | undefined;
|
|
260
|
-
noDiscovery?: boolean | undefined;
|
|
261
|
-
mirrorOf?: string | undefined;
|
|
262
|
-
} | {
|
|
263
|
-
id: string;
|
|
264
|
-
networkId: string;
|
|
265
|
-
decimals: number;
|
|
266
|
-
symbol: string;
|
|
267
|
-
type: "evm-native";
|
|
268
|
-
platform: "ethereum";
|
|
269
|
-
isDefault?: boolean | undefined;
|
|
270
|
-
name?: string | undefined;
|
|
271
|
-
logo?: string | undefined;
|
|
272
|
-
coingeckoId?: string | undefined;
|
|
273
|
-
noDiscovery?: boolean | undefined;
|
|
274
|
-
mirrorOf?: string | undefined;
|
|
275
|
-
} | {
|
|
276
|
-
id: string;
|
|
277
|
-
networkId: string;
|
|
278
|
-
decimals: number;
|
|
279
|
-
symbol: string;
|
|
280
|
-
type: "evm-uniswapv2";
|
|
281
|
-
platform: "ethereum";
|
|
282
|
-
contractAddress: `0x${string}`;
|
|
283
|
-
symbol0: string;
|
|
284
|
-
symbol1: string;
|
|
285
|
-
decimals0: number;
|
|
286
|
-
decimals1: number;
|
|
287
|
-
tokenAddress0: `0x${string}`;
|
|
288
|
-
tokenAddress1: `0x${string}`;
|
|
289
|
-
isDefault?: boolean | undefined;
|
|
290
|
-
name?: string | undefined;
|
|
291
|
-
logo?: string | undefined;
|
|
292
|
-
coingeckoId?: string | undefined;
|
|
293
|
-
noDiscovery?: boolean | undefined;
|
|
294
|
-
mirrorOf?: string | undefined;
|
|
295
|
-
isCustom?: boolean | undefined;
|
|
296
|
-
coingeckoId0?: string | undefined;
|
|
297
|
-
coingeckoId1?: string | undefined;
|
|
298
|
-
} | {
|
|
299
|
-
id: string;
|
|
300
|
-
networkId: string;
|
|
301
|
-
decimals: number;
|
|
302
|
-
symbol: string;
|
|
303
|
-
type: "substrate-assets";
|
|
304
|
-
platform: "polkadot";
|
|
305
|
-
assetId: string;
|
|
306
|
-
isSufficient: boolean;
|
|
307
|
-
existentialDeposit: string;
|
|
308
|
-
isDefault?: boolean | undefined;
|
|
309
|
-
name?: string | undefined;
|
|
310
|
-
logo?: string | undefined;
|
|
311
|
-
coingeckoId?: string | undefined;
|
|
312
|
-
noDiscovery?: boolean | undefined;
|
|
313
|
-
mirrorOf?: string | undefined;
|
|
314
|
-
isFrozen?: boolean | undefined;
|
|
315
|
-
} | {
|
|
316
|
-
id: string;
|
|
317
|
-
networkId: string;
|
|
318
|
-
decimals: number;
|
|
319
|
-
symbol: string;
|
|
320
|
-
type: "substrate-dtao";
|
|
321
|
-
platform: "polkadot";
|
|
322
|
-
netuid: number;
|
|
323
|
-
isTransferable: boolean;
|
|
324
|
-
isDefault?: boolean | undefined;
|
|
325
|
-
name?: string | undefined;
|
|
326
|
-
logo?: string | undefined;
|
|
327
|
-
coingeckoId?: string | undefined;
|
|
328
|
-
noDiscovery?: boolean | undefined;
|
|
329
|
-
mirrorOf?: string | undefined;
|
|
330
|
-
subnetName?: string | undefined;
|
|
331
|
-
hotkey?: string | undefined;
|
|
332
|
-
} | {
|
|
333
|
-
id: string;
|
|
334
|
-
networkId: string;
|
|
335
|
-
decimals: number;
|
|
336
|
-
symbol: string;
|
|
337
|
-
type: "substrate-foreignassets";
|
|
338
|
-
platform: "polkadot";
|
|
339
|
-
onChainId: string;
|
|
340
|
-
isSufficient: boolean;
|
|
341
|
-
existentialDeposit: string;
|
|
342
|
-
isDefault?: boolean | undefined;
|
|
343
|
-
name?: string | undefined;
|
|
344
|
-
logo?: string | undefined;
|
|
345
|
-
coingeckoId?: string | undefined;
|
|
346
|
-
noDiscovery?: boolean | undefined;
|
|
347
|
-
mirrorOf?: string | undefined;
|
|
348
|
-
isFrozen?: boolean | undefined;
|
|
349
|
-
} | {
|
|
350
|
-
id: string;
|
|
351
|
-
networkId: string;
|
|
352
|
-
decimals: number;
|
|
353
|
-
symbol: string;
|
|
354
|
-
type: "substrate-native";
|
|
355
|
-
platform: "polkadot";
|
|
356
|
-
existentialDeposit: string;
|
|
357
|
-
isDefault?: boolean | undefined;
|
|
358
|
-
name?: string | undefined;
|
|
359
|
-
logo?: string | undefined;
|
|
360
|
-
coingeckoId?: string | undefined;
|
|
361
|
-
noDiscovery?: boolean | undefined;
|
|
362
|
-
mirrorOf?: string | undefined;
|
|
363
|
-
} | {
|
|
364
|
-
id: string;
|
|
365
|
-
networkId: string;
|
|
366
|
-
decimals: number;
|
|
367
|
-
symbol: string;
|
|
368
|
-
type: "substrate-psp22";
|
|
369
|
-
platform: "polkadot";
|
|
370
|
-
contractAddress: string;
|
|
371
|
-
isDefault?: boolean | undefined;
|
|
372
|
-
name?: string | undefined;
|
|
373
|
-
logo?: string | undefined;
|
|
374
|
-
coingeckoId?: string | undefined;
|
|
375
|
-
noDiscovery?: boolean | undefined;
|
|
376
|
-
mirrorOf?: string | undefined;
|
|
377
|
-
} | {
|
|
378
|
-
id: string;
|
|
379
|
-
networkId: string;
|
|
380
|
-
decimals: number;
|
|
381
|
-
symbol: string;
|
|
382
|
-
type: "substrate-tokens";
|
|
383
|
-
platform: "polkadot";
|
|
384
|
-
onChainId: string | number;
|
|
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
|
-
} | {
|
|
393
|
-
id: string;
|
|
394
|
-
networkId: string;
|
|
395
|
-
decimals: number;
|
|
396
|
-
symbol: string;
|
|
397
|
-
type: "substrate-hydration";
|
|
398
|
-
platform: "polkadot";
|
|
399
|
-
onChainId: number;
|
|
400
|
-
assetType: "Token" | "Erc20" | "External";
|
|
401
|
-
isSufficient: boolean;
|
|
402
|
-
existentialDeposit: string;
|
|
403
|
-
isDefault?: boolean | undefined;
|
|
404
|
-
name?: string | undefined;
|
|
405
|
-
logo?: string | undefined;
|
|
406
|
-
coingeckoId?: string | undefined;
|
|
407
|
-
noDiscovery?: boolean | undefined;
|
|
408
|
-
mirrorOf?: string | undefined;
|
|
409
|
-
} | {
|
|
410
|
-
id: string;
|
|
411
|
-
networkId: string;
|
|
412
|
-
decimals: number;
|
|
413
|
-
symbol: string;
|
|
414
|
-
type: "sol-native";
|
|
415
|
-
platform: "solana";
|
|
416
|
-
isDefault?: boolean | undefined;
|
|
417
|
-
name?: string | undefined;
|
|
418
|
-
logo?: string | undefined;
|
|
419
|
-
coingeckoId?: string | undefined;
|
|
420
|
-
noDiscovery?: boolean | undefined;
|
|
421
|
-
mirrorOf?: string | undefined;
|
|
422
|
-
} | {
|
|
423
|
-
id: string;
|
|
424
|
-
networkId: string;
|
|
425
|
-
decimals: number;
|
|
426
|
-
symbol: string;
|
|
427
|
-
type: "sol-spl";
|
|
428
|
-
platform: "solana";
|
|
429
|
-
mintAddress: string;
|
|
430
|
-
isDefault?: boolean | undefined;
|
|
431
|
-
name?: string | undefined;
|
|
432
|
-
logo?: string | undefined;
|
|
433
|
-
coingeckoId?: string | undefined;
|
|
434
|
-
noDiscovery?: boolean | undefined;
|
|
435
|
-
mirrorOf?: string | undefined;
|
|
436
|
-
} | null;
|
|
437
|
-
get decimals(): number | null;
|
|
438
|
-
get rates(): TokenRates | null;
|
|
439
|
-
/**
|
|
440
|
-
* A general method to get formatted values matching a certain type from this balance.
|
|
441
|
-
* @param valueType - The type of value to get.
|
|
442
|
-
* @returns An array of the values matching the type with formatted amounts.
|
|
443
|
-
*/
|
|
444
|
-
private getValue;
|
|
445
|
-
/**
|
|
446
|
-
* A general method to get values matching a certain type from this balance.
|
|
447
|
-
* @param valueType - The type of value to get.
|
|
448
|
-
* @returns An array of the values matching the type.
|
|
449
|
-
*/
|
|
450
|
-
private getRawValue;
|
|
451
|
-
/**
|
|
452
|
-
* A general method to add a value to the array of values for this balance.
|
|
453
|
-
* @param valueType - The type of value to add.
|
|
454
|
-
* @returns A function which can be used to add a value to the array of values for this balance.
|
|
455
|
-
*/
|
|
456
|
-
private addValue;
|
|
457
|
-
/**
|
|
458
|
-
* The total balance of this token.
|
|
459
|
-
* Includes the free and the reserved amount.
|
|
460
|
-
* The balance will be reaped if this goes below the existential deposit.
|
|
461
|
-
*/
|
|
462
|
-
get total(): BalanceFormatter;
|
|
463
|
-
/** The non-reserved balance of this token. Includes the frozen amount. Is included in the total. */
|
|
464
|
-
get free(): BalanceFormatter;
|
|
465
|
-
/** The reserved balance of this token. Is included in the total. */
|
|
466
|
-
get reserved(): BalanceFormatter;
|
|
467
|
-
get reserves(): FormattedAmount<AmountWithLabel<string>, string>[];
|
|
468
|
-
/** The frozen balance of this token. Is included in the free amount. */
|
|
469
|
-
get locked(): BalanceFormatter;
|
|
470
|
-
get locks(): FormattedAmount<AmountWithLabel<string>, string>[];
|
|
471
|
-
get nompools(): FormattedAmount<AmountWithLabel<string>, string>[];
|
|
472
|
-
/** The extra balance of this token */
|
|
473
|
-
get extra(): ExtraAmount<string>[] | undefined;
|
|
474
|
-
/** @deprecated Use balance.locked */
|
|
475
|
-
get frozen(): BalanceFormatter;
|
|
476
|
-
/** The transferable balance of this token. Is generally the free amount - the miscFrozen amount. */
|
|
477
|
-
get transferable(): BalanceFormatter;
|
|
478
|
-
/**
|
|
479
|
-
* The unavailable balance of this token.
|
|
480
|
-
* Prior to the Fungible trait, this was the locked amount + the reserved amount, i.e. `locked + reserved`.
|
|
481
|
-
* Now, it is the bigger of the locked amount and the reserved amounts, i.e. `max(locked, reserved)`.
|
|
482
|
-
*/
|
|
483
|
-
get unavailable(): BalanceFormatter;
|
|
484
|
-
/** The feePayable balance of this token. Is generally the free amount - the feeFrozen amount. */
|
|
485
|
-
get feePayable(): BalanceFormatter;
|
|
486
|
-
}
|
|
487
|
-
export declare class BalanceValueGetter {
|
|
488
|
-
#private;
|
|
489
|
-
constructor(storage: BalanceJson);
|
|
490
|
-
get(valueType: BalanceStatusTypes): AmountWithLabel<string>[];
|
|
491
|
-
add(valueType: BalanceStatusTypes, amount: Omit<AmountWithLabel<string>, "type">): void;
|
|
492
|
-
}
|
|
493
|
-
export declare class BalanceFormatter {
|
|
494
|
-
#private;
|
|
495
|
-
constructor(planck: string | bigint | undefined, decimals?: number | undefined, fiatRatios?: TokenRates | null);
|
|
496
|
-
toJSON: () => string;
|
|
497
|
-
get planck(): bigint;
|
|
498
|
-
get tokens(): string;
|
|
499
|
-
fiat(currency: TokenRateCurrency): number | null;
|
|
500
|
-
}
|
|
501
|
-
export declare class PlanckSumBalancesFormatter {
|
|
502
|
-
#private;
|
|
503
|
-
constructor(balances: Balances);
|
|
504
|
-
/**
|
|
505
|
-
* The total balance of these tokens. Includes the free and the reserved amount.
|
|
506
|
-
*/
|
|
507
|
-
get total(): bigint;
|
|
508
|
-
/** The non-reserved balance of these tokens. Includes the frozen amount. Is included in the total. */
|
|
509
|
-
get free(): bigint;
|
|
510
|
-
/** The reserved balance of these tokens. Is included in the total. */
|
|
511
|
-
get reserved(): bigint;
|
|
512
|
-
/** The frozen balance of these tokens. Is included in the free amount. */
|
|
513
|
-
get locked(): bigint;
|
|
514
|
-
/** @deprecated Use balances.locked */
|
|
515
|
-
get frozen(): bigint;
|
|
516
|
-
/** The transferable balance of these tokens. Is generally the free amount - the miscFrozen amount. */
|
|
517
|
-
get transferable(): bigint;
|
|
518
|
-
/** The unavailable balance of these tokens. */
|
|
519
|
-
get unavailable(): bigint;
|
|
520
|
-
/** The feePayable balance of these tokens. Is generally the free amount - the feeFrozen amount. */
|
|
521
|
-
get feePayable(): bigint;
|
|
522
|
-
}
|
|
523
|
-
export declare class FiatSumBalancesFormatter {
|
|
524
|
-
#private;
|
|
525
|
-
constructor(balances: Balances, currency: TokenRateCurrency);
|
|
526
|
-
/**
|
|
527
|
-
* The total balance of these tokens. Includes the free and the reserved amount.
|
|
528
|
-
*/
|
|
529
|
-
get total(): number;
|
|
530
|
-
/** The non-reserved balance of these tokens. Includes the frozen amount. Is included in the total. */
|
|
531
|
-
get free(): number;
|
|
532
|
-
/** The reserved balance of these tokens. Is included in the total. */
|
|
533
|
-
get reserved(): number;
|
|
534
|
-
/** The frozen balance of these tokens. Is included in the free amount. */
|
|
535
|
-
get locked(): number;
|
|
536
|
-
/** @deprecated Use balances.locked */
|
|
537
|
-
get frozen(): number;
|
|
538
|
-
/** The transferable balance of these tokens. Is generally the free amount - the miscFrozen amount. */
|
|
539
|
-
get transferable(): number;
|
|
540
|
-
/** The unavailable balance of these tokens. */
|
|
541
|
-
get unavailable(): number;
|
|
542
|
-
/** The feePayable balance of these tokens. Is generally the free amount - the feeFrozen amount. */
|
|
543
|
-
get feePayable(): number;
|
|
544
|
-
}
|
|
545
|
-
export declare class SumBalancesFormatter {
|
|
546
|
-
#private;
|
|
547
|
-
constructor(balances: Balances);
|
|
548
|
-
get planck(): PlanckSumBalancesFormatter;
|
|
549
|
-
fiat(currency: TokenRateCurrency): FiatSumBalancesFormatter;
|
|
550
|
-
change24h(currency: TokenRateCurrency): Change24hCurrencyFormatter;
|
|
551
|
-
}
|
|
552
|
-
export declare class Change24hCurrencyFormatter {
|
|
553
|
-
#private;
|
|
554
|
-
constructor(balances: Balances, currency: TokenRateCurrency);
|
|
555
|
-
get total(): {
|
|
556
|
-
diff: number;
|
|
557
|
-
ratio: number;
|
|
558
|
-
} | null;
|
|
559
|
-
get free(): {
|
|
560
|
-
diff: number;
|
|
561
|
-
ratio: number;
|
|
562
|
-
} | null;
|
|
563
|
-
get reserved(): {
|
|
564
|
-
diff: number;
|
|
565
|
-
ratio: number;
|
|
566
|
-
} | null;
|
|
567
|
-
get locked(): {
|
|
568
|
-
diff: number;
|
|
569
|
-
ratio: number;
|
|
570
|
-
} | null;
|
|
571
|
-
get frozen(): {
|
|
572
|
-
diff: number;
|
|
573
|
-
ratio: number;
|
|
574
|
-
} | null;
|
|
575
|
-
get transferable(): {
|
|
576
|
-
diff: number;
|
|
577
|
-
ratio: number;
|
|
578
|
-
} | null;
|
|
579
|
-
get unavailable(): {
|
|
580
|
-
diff: number;
|
|
581
|
-
ratio: number;
|
|
582
|
-
} | null;
|
|
583
|
-
get feePayable(): {
|
|
584
|
-
diff: number;
|
|
585
|
-
ratio: number;
|
|
586
|
-
} | null;
|
|
587
|
-
}
|
|
588
|
-
export declare const filterMirrorTokens: (balance: Balance, i: number, balances: Balance[]) => boolean;
|
|
589
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { NetworkId, TokenId } from "@talismn/chaindata-provider";
|
|
2
|
-
import { Address } from "./addresses";
|
|
3
|
-
export type BalanceStatus = "live" | "cache" | "stale";
|
|
4
|
-
type IBalanceBase = {
|
|
5
|
-
/** The module that this balance was retrieved by */
|
|
6
|
-
source: string;
|
|
7
|
-
useLegacyTransferableCalculation?: boolean;
|
|
8
|
-
/** Has this balance never been fetched, or is it from a cache, or is it up to date? */
|
|
9
|
-
status: BalanceStatus;
|
|
10
|
-
/** The address of the account which owns this balance */
|
|
11
|
-
address: Address;
|
|
12
|
-
/** The token this balance is for */
|
|
13
|
-
tokenId: TokenId;
|
|
14
|
-
networkId: NetworkId;
|
|
15
|
-
};
|
|
16
|
-
type IBalanceSimpleValues = {
|
|
17
|
-
/** For balance types with a simple value, this is the value of the balance (eg, evm native token balance) */
|
|
18
|
-
value: Amount;
|
|
19
|
-
values?: Array<AmountWithLabel<string>>;
|
|
20
|
-
};
|
|
21
|
-
type IBalanceComplexValues = {
|
|
22
|
-
/** For balance types with multple possible states, these are the values of the balance (eg, substrate native token balance) */
|
|
23
|
-
values: Array<AmountWithLabel<string>>;
|
|
24
|
-
value?: undefined;
|
|
25
|
-
};
|
|
26
|
-
/** `IBalance` is a common interface which all balance types must implement. */
|
|
27
|
-
export type IBalance = IBalanceBase & (IBalanceSimpleValues | IBalanceComplexValues);
|
|
28
|
-
export type BalanceJson = IBalance;
|
|
29
|
-
/** A collection of `BalanceJson` objects */
|
|
30
|
-
export type BalanceJsonList = Record<string, BalanceJson>;
|
|
31
|
-
/** An unlabelled amount of a balance */
|
|
32
|
-
export type Amount = string;
|
|
33
|
-
export type BalanceStatusTypes = "free" | "reserved" | "locked" | "extra" | "nompool";
|
|
34
|
-
/** A labelled amount of a balance */
|
|
35
|
-
type BaseAmountWithLabel<TLabel extends string> = {
|
|
36
|
-
type: BalanceStatusTypes;
|
|
37
|
-
/**
|
|
38
|
-
* For modules which fetch balances via module sources, the source is equivalent to previous 'subSource' field
|
|
39
|
-
* on the parent balance object
|
|
40
|
-
* e.g. `staking`
|
|
41
|
-
**/
|
|
42
|
-
source?: string;
|
|
43
|
-
label: TLabel;
|
|
44
|
-
amount: Amount;
|
|
45
|
-
meta?: unknown;
|
|
46
|
-
};
|
|
47
|
-
export declare const getValueId: (amount: AmountWithLabel<string>) => string;
|
|
48
|
-
/** A labelled locked amount of a balance */
|
|
49
|
-
export type LockedAmount<TLabel extends string> = BaseAmountWithLabel<TLabel> & {
|
|
50
|
-
/**
|
|
51
|
-
* By default, the largest locked amount is subtrated from the transferable amount of this balance.
|
|
52
|
-
* If this property is set to true, this particular lock will be skipped when making this calculation.
|
|
53
|
-
* As such, this locked amount will be included in the calculated transferable amount.
|
|
54
|
-
*/
|
|
55
|
-
includeInTransferable?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* By default, tx fees can be deducted from locked amounts of balance.
|
|
58
|
-
* As such, locked amounts are ignored when calculating if the user has enough funds to pay tx fees.
|
|
59
|
-
* If this property is set to true, this particular lock will be subtracted from the available funds when making this calculation.
|
|
60
|
-
* As such, this locked amount will not be included in the calculated available funds.
|
|
61
|
-
*/
|
|
62
|
-
excludeFromFeePayable?: boolean;
|
|
63
|
-
};
|
|
64
|
-
export type AmountWithLabel<TLabel extends string> = BaseAmountWithLabel<TLabel> | LockedAmount<TLabel> | ExtraAmount<TLabel>;
|
|
65
|
-
/** A labelled extra amount of a balance */
|
|
66
|
-
export type ExtraAmount<TLabel extends string> = BaseAmountWithLabel<TLabel> & {
|
|
67
|
-
type: "extra";
|
|
68
|
-
/** If set to true, this extra amount will be included in the calculation of the total amount of this balance. */
|
|
69
|
-
includeInTotal?: boolean;
|
|
70
|
-
};
|
|
71
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AnyMiniMetadata } from "@talismn/chaindata-provider";
|
|
2
|
-
/** For fast db access, you can calculate the primary key for a miniMetadata using this method */
|
|
3
|
-
export declare const deriveMiniMetadataId: ({ source, chainId, specVersion, }: Pick<AnyMiniMetadata, "source" | "chainId" | "specVersion">) => string;
|
|
4
|
-
export type MiniMetadata<Extra = unknown> = Omit<AnyMiniMetadata, "extra"> & {
|
|
5
|
-
extra: Extra;
|
|
6
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A callback with either an error or a result.
|
|
3
|
-
*/
|
|
4
|
-
export interface SubscriptionCallback<Result> {
|
|
5
|
-
(error: null, result: Result): void;
|
|
6
|
-
(error: any, result?: never): void;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A function which cancels a subscription when called.
|
|
10
|
-
*/
|
|
11
|
-
export type UnsubscribeFn = () => void;
|