@talismn/balances 0.0.0-pr2091-20250715125148 → 0.0.0-pr2092-20250715131755
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/BalancesProvider.d.ts +0 -1
- package/dist/declarations/src/modules/index.d.ts +0 -11
- package/dist/declarations/src/modules/shared/errors.d.ts +1 -1
- package/dist/declarations/src/types/IBalanceModule.d.ts +12 -19
- package/dist/declarations/src/types/balances.d.ts +0 -37
- package/dist/declarations/src/types/chainConnectors.d.ts +0 -2
- package/dist/talismn-balances.cjs.dev.js +81 -318
- package/dist/talismn-balances.cjs.prod.js +81 -318
- package/dist/talismn-balances.esm.js +73 -308
- package/package.json +8 -11
- 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
@@ -21,7 +21,6 @@ export declare class BalancesProvider {
|
|
21
21
|
private getNetworkBalances$;
|
22
22
|
private getPolkadotNetworkModuleBalances$;
|
23
23
|
private getEthereumNetworkModuleBalances$;
|
24
|
-
private getSolanaNetworkModuleBalances$;
|
25
24
|
private updateStorage$;
|
26
25
|
private getNetworkMiniMetadatas$;
|
27
26
|
private getNetworkSpecVersion$;
|
@@ -108,16 +108,6 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
|
|
108
108
|
coingeckoId?: string | undefined;
|
109
109
|
noDiscovery?: boolean | undefined;
|
110
110
|
mirrorOf?: string | undefined;
|
111
|
-
}, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"sol-native", {
|
112
|
-
symbol?: string | undefined;
|
113
|
-
networkId?: string | undefined;
|
114
|
-
isDefault?: boolean | undefined;
|
115
|
-
decimals?: number | undefined;
|
116
|
-
name?: string | undefined;
|
117
|
-
logo?: string | undefined;
|
118
|
-
coingeckoId?: string | undefined;
|
119
|
-
noDiscovery?: boolean | undefined;
|
120
|
-
mirrorOf?: string | undefined;
|
121
111
|
}, unknown, unknown>)[];
|
122
112
|
export type AnyBalanceModule = (typeof BALANCE_MODULES)[number];
|
123
113
|
export * from "./evm-native";
|
@@ -129,6 +119,5 @@ export * from "./substrate-foreignassets";
|
|
129
119
|
export * from "./substrate-hydration";
|
130
120
|
export * from "./substrate-psp22";
|
131
121
|
export * from "./substrate-tokens";
|
132
|
-
export * from "./sol-native";
|
133
122
|
export * from "./abis";
|
134
123
|
export * from "../types/IBalanceModule";
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import type { ChainConnector } from "@talismn/chain-connector";
|
2
2
|
import type { ChainConnectorEvm } from "@talismn/chain-connector-evm";
|
3
|
-
import { IChainConnectorSol } from "@talismn/chain-connector-sol/src/IChainConnectorSol";
|
4
3
|
import { DotNetworkId, EthNetworkId, Token, TokenId, TokenOfType, TokenType } from "@talismn/chaindata-provider";
|
5
|
-
import { SolNetworkId } from "@talismn/chaindata-provider/src/chaindata/networks/SolNetwork";
|
6
4
|
import { Observable } from "rxjs";
|
7
5
|
import type { Address, IBalance, MiniMetadata } from ".";
|
8
6
|
export type TokenPlatform<T extends TokenType> = TokenOfType<T>["platform"];
|
9
|
-
export type PlatformConnector<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? ChainConnectorEvm : P extends "polkadot" ? ChainConnector :
|
7
|
+
export type PlatformConnector<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? ChainConnectorEvm : P extends "polkadot" ? ChainConnector : never;
|
10
8
|
type DotTransferCallData = {
|
11
9
|
address: string;
|
12
10
|
method: `0x${string}`;
|
@@ -18,7 +16,7 @@ type EthTransferCallData = {
|
|
18
16
|
value?: string;
|
19
17
|
};
|
20
18
|
export type BalanceTransferType = "keep-alive" | "all" | "allow-death";
|
21
|
-
type CallDataOf<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? EthTransferCallData : P extends "polkadot" ? DotTransferCallData :
|
19
|
+
type CallDataOf<P extends TokenPlatform<TokenType>> = P extends "ethereum" ? EthTransferCallData : P extends "polkadot" ? DotTransferCallData : never;
|
22
20
|
export type TokensWithAddresses = Array<[Token, Address[]]>;
|
23
21
|
export type FetchBalanceErrors = Array<{
|
24
22
|
tokenId: TokenId;
|
@@ -44,32 +42,32 @@ export interface IBalanceModule<Type extends TokenType, TokenConfig = unknown, M
|
|
44
42
|
connector: ChainConnector;
|
45
43
|
miniMetadata: MiniMetadata<MiniMetadataExtra>;
|
46
44
|
cache: Record<TokenId, unknown>;
|
47
|
-
} : {
|
48
|
-
networkId:
|
45
|
+
} : TokenPlatform<Type> extends "ethereum" ? {
|
46
|
+
networkId: EthNetworkId;
|
49
47
|
tokens: TokenConfig[];
|
50
|
-
connector:
|
48
|
+
connector: ChainConnectorEvm;
|
51
49
|
cache: Record<TokenId, unknown>;
|
52
|
-
}) => Promise<TokenOfType<Type>[]>;
|
50
|
+
} : never) => Promise<TokenOfType<Type>[]>;
|
53
51
|
fetchBalances: (arg: TokenPlatform<Type> extends "polkadot" ? {
|
54
52
|
networkId: DotNetworkId;
|
55
53
|
tokensWithAddresses: TokensWithAddresses;
|
56
54
|
connector: ChainConnector;
|
57
55
|
miniMetadata: MiniMetadata<MiniMetadataExtra>;
|
58
|
-
} : {
|
56
|
+
} : TokenPlatform<Type> extends "ethereum" ? {
|
59
57
|
networkId: EthNetworkId;
|
60
58
|
tokensWithAddresses: TokensWithAddresses;
|
61
|
-
connector:
|
62
|
-
}) => Promise<FetchBalanceResults>;
|
59
|
+
connector: ChainConnectorEvm;
|
60
|
+
} : never) => Promise<FetchBalanceResults>;
|
63
61
|
subscribeBalances: (arg: TokenPlatform<Type> extends "polkadot" ? {
|
64
62
|
networkId: DotNetworkId;
|
65
63
|
tokensWithAddresses: TokensWithAddresses;
|
66
64
|
connector: ChainConnector;
|
67
65
|
miniMetadata: MiniMetadata<MiniMetadataExtra>;
|
68
|
-
} : {
|
66
|
+
} : TokenPlatform<Type> extends "ethereum" ? {
|
69
67
|
networkId: EthNetworkId;
|
70
68
|
tokensWithAddresses: TokensWithAddresses;
|
71
|
-
connector:
|
72
|
-
}) => Observable<FetchBalanceResults>;
|
69
|
+
connector: ChainConnectorEvm;
|
70
|
+
} : never) => Observable<FetchBalanceResults>;
|
73
71
|
getTransferCallData: (arg: TokenPlatform<Type> extends "polkadot" ? {
|
74
72
|
from: string;
|
75
73
|
to: string;
|
@@ -84,11 +82,6 @@ export interface IBalanceModule<Type extends TokenType, TokenConfig = unknown, M
|
|
84
82
|
to: string;
|
85
83
|
value: string;
|
86
84
|
token: Token;
|
87
|
-
} : TokenPlatform<Type> extends "solana" ? {
|
88
|
-
from: string;
|
89
|
-
to: string;
|
90
|
-
value: string;
|
91
|
-
token: Token;
|
92
85
|
} : never) => CallDataOf<TokenPlatform<Type>> | Promise<CallDataOf<TokenPlatform<Type>>>;
|
93
86
|
}
|
94
87
|
export {};
|
@@ -218,30 +218,6 @@ export declare class Balance {
|
|
218
218
|
"evm-erc20"?: undefined;
|
219
219
|
"evm-uniswapv2"?: undefined;
|
220
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
|
-
rpcs: string[];
|
236
|
-
isTestnet?: boolean | undefined;
|
237
|
-
isDefault?: boolean | undefined;
|
238
|
-
forceScan?: boolean | undefined;
|
239
|
-
logo?: string | undefined;
|
240
|
-
themeColor?: string | undefined;
|
241
|
-
genesisHash?: string | undefined;
|
242
|
-
balancesConfig?: {
|
243
|
-
"sol-native"?: undefined;
|
244
|
-
} | undefined;
|
245
221
|
} | null;
|
246
222
|
get tokenId(): string;
|
247
223
|
get token(): {
|
@@ -388,19 +364,6 @@ export declare class Balance {
|
|
388
364
|
coingeckoId?: string | undefined;
|
389
365
|
noDiscovery?: boolean | undefined;
|
390
366
|
mirrorOf?: string | undefined;
|
391
|
-
} | {
|
392
|
-
id: string;
|
393
|
-
networkId: string;
|
394
|
-
decimals: number;
|
395
|
-
symbol: string;
|
396
|
-
type: "sol-native";
|
397
|
-
platform: "solana";
|
398
|
-
isDefault?: boolean | undefined;
|
399
|
-
name?: string | undefined;
|
400
|
-
logo?: string | undefined;
|
401
|
-
coingeckoId?: string | undefined;
|
402
|
-
noDiscovery?: boolean | undefined;
|
403
|
-
mirrorOf?: string | undefined;
|
404
367
|
} | null;
|
405
368
|
get decimals(): number | null;
|
406
369
|
get rates(): TokenRates | null;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { ChainConnector } from "@talismn/chain-connector";
|
2
2
|
import { ChainConnectorEvm } from "@talismn/chain-connector-evm";
|
3
|
-
import { ChainConnectorSol } from "@talismn/chain-connector-sol";
|
4
3
|
export type ChainConnectors = {
|
5
4
|
substrate?: ChainConnector;
|
6
5
|
evm?: ChainConnectorEvm;
|
7
|
-
solana?: ChainConnectorSol;
|
8
6
|
};
|