@talismn/balances-react 0.0.0-pr593-20230303151944 → 0.0.0-pr595-20230305120713
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/CHANGELOG.md +8 -7
- package/dist/declarations/src/hooks/index.d.ts +0 -18
- package/dist/declarations/src/hooks/useBalances.d.ts +6 -3
- package/dist/declarations/src/hooks/useChaindata.d.ts +23 -6
- package/dist/declarations/src/hooks/useTokenRates.d.ts +3 -3
- package/dist/declarations/src/index.d.ts +0 -1
- package/dist/talismn-balances-react.cjs.dev.js +244 -477
- package/dist/talismn-balances-react.cjs.prod.js +244 -477
- package/dist/talismn-balances-react.esm.js +246 -461
- package/package.json +8 -9
- package/dist/declarations/src/hooks/useAllAddresses.d.ts +0 -4
- package/dist/declarations/src/hooks/useBalanceModules.d.ts +0 -8
- package/dist/declarations/src/hooks/useBalancesHydrate.d.ts +0 -2
- package/dist/declarations/src/hooks/useChainConnectors.d.ts +0 -12
- package/dist/declarations/src/hooks/useChains.d.ts +0 -3
- package/dist/declarations/src/hooks/useDbCache.d.ts +0 -27
- package/dist/declarations/src/hooks/useDbCacheSubscription.d.ts +0 -9
- package/dist/declarations/src/hooks/useEvmNetworks.d.ts +0 -3
- package/dist/declarations/src/hooks/useTokens.d.ts +0 -3
- package/dist/declarations/src/util/index.d.ts +0 -2
- package/dist/declarations/src/util/provideContext.d.ts +0 -9
- package/dist/declarations/src/util/useMulticastSubscription.d.ts +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/balances-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-pr595-20230305120713",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -26,17 +26,16 @@
|
|
|
26
26
|
"clean": "rm -rf dist && rm -rf .turbo rm -rf node_modules"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@talismn/balances": "^0.0.0-
|
|
30
|
-
"@talismn/chain-connector": "^0.
|
|
31
|
-
"@talismn/chain-connector-evm": "^0.
|
|
32
|
-
"@talismn/chaindata-provider": "^0.
|
|
33
|
-
"@talismn/chaindata-provider-extension": "^0.
|
|
34
|
-
"@talismn/token-rates": "^0.0.0-
|
|
29
|
+
"@talismn/balances": "^0.0.0-pr595-20230305120713",
|
|
30
|
+
"@talismn/chain-connector": "^0.0.0-pr595-20230305120713",
|
|
31
|
+
"@talismn/chain-connector-evm": "^0.0.0-pr595-20230305120713",
|
|
32
|
+
"@talismn/chaindata-provider": "^0.0.0-pr595-20230305120713",
|
|
33
|
+
"@talismn/chaindata-provider-extension": "^0.0.0-pr595-20230305120713",
|
|
34
|
+
"@talismn/token-rates": "^0.0.0-pr595-20230305120713",
|
|
35
35
|
"anylogger": "^1.0.11",
|
|
36
36
|
"dexie": "^3.2.3",
|
|
37
37
|
"dexie-react-hooks": "^1.1.1",
|
|
38
|
-
"react-use": "^17.4.0"
|
|
39
|
-
"rxjs": "^7.8.0"
|
|
38
|
+
"react-use": "^17.4.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@talismn/eslint-config": "^0.0.1",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BalanceModule } from "@talismn/balances";
|
|
3
|
-
export type BalanceModulesProviderOptions = {
|
|
4
|
-
balanceModules: Array<BalanceModule<any, any, any, any, any>>;
|
|
5
|
-
};
|
|
6
|
-
export declare const BalanceModulesProvider: import("react").FC<BalanceModulesProviderOptions & {
|
|
7
|
-
children?: import("react").ReactNode;
|
|
8
|
-
}>, useBalanceModules: () => BalanceModule<any, any, any, any, any>[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ChainConnector } from "@talismn/chain-connector";
|
|
3
|
-
import { ChainConnectorEvm } from "@talismn/chain-connector-evm";
|
|
4
|
-
export type ChainConnectorsProviderOptions = {
|
|
5
|
-
onfinalityApiKey?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const ChainConnectorsProvider: import("react").FC<ChainConnectorsProviderOptions & {
|
|
8
|
-
children?: import("react").ReactNode;
|
|
9
|
-
}>, useChainConnectors: () => {
|
|
10
|
-
substrate: ChainConnector | undefined;
|
|
11
|
-
evm: ChainConnectorEvm | undefined;
|
|
12
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ChainId } from "@talismn/chaindata-provider";
|
|
2
|
-
export declare function useChains(withTestnets?: boolean): Record<string, import("@talismn/chaindata-provider").Chain | import("@talismn/chaindata-provider").CustomChain>;
|
|
3
|
-
export declare function useChain(chainId?: ChainId, withTestnets?: boolean): import("@talismn/chaindata-provider").Chain | undefined;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BalanceJson } from "@talismn/balances";
|
|
3
|
-
import { Chain, ChainId, CustomChain, CustomEvmNetwork, EvmNetwork, EvmNetworkId, Token, TokenId } from "@talismn/chaindata-provider";
|
|
4
|
-
import { TokenRates } from "@talismn/token-rates";
|
|
5
|
-
type DbCache = {
|
|
6
|
-
chainsWithTestnets: (Chain | CustomChain)[];
|
|
7
|
-
chainsWithoutTestnets: (Chain | CustomChain)[];
|
|
8
|
-
evmNetworksWithTestnets: (EvmNetwork | CustomEvmNetwork)[];
|
|
9
|
-
evmNetworksWithoutTestnets: (EvmNetwork | CustomEvmNetwork)[];
|
|
10
|
-
tokensWithTestnets: Token[];
|
|
11
|
-
tokensWithoutTestnets: Token[];
|
|
12
|
-
chainsWithTestnetsMap: Record<ChainId, Chain | CustomChain>;
|
|
13
|
-
chainsWithoutTestnetsMap: Record<ChainId, Chain | CustomChain>;
|
|
14
|
-
evmNetworksWithTestnetsMap: Record<EvmNetworkId, EvmNetwork | CustomEvmNetwork>;
|
|
15
|
-
evmNetworksWithoutTestnetsMap: Record<EvmNetworkId, EvmNetwork | CustomEvmNetwork>;
|
|
16
|
-
tokensWithTestnetsMap: Record<TokenId, Token>;
|
|
17
|
-
tokensWithoutTestnetsMap: Record<TokenId, Token>;
|
|
18
|
-
tokenRatesMap: Record<TokenId, TokenRates>;
|
|
19
|
-
balances: BalanceJson[];
|
|
20
|
-
};
|
|
21
|
-
type DbCacheProviderProps = {
|
|
22
|
-
useTestnets?: boolean;
|
|
23
|
-
};
|
|
24
|
-
export declare const DbCacheProvider: import("react").FC<DbCacheProviderProps & {
|
|
25
|
-
children?: import("react").ReactNode;
|
|
26
|
-
}>, useDbCache: () => DbCache;
|
|
27
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type DbEntityType = "chains" | "evmNetworks" | "tokens" | "tokenRates" | "balances";
|
|
3
|
-
export declare const SubscriptionsProvider: import("react").FC<{
|
|
4
|
-
children?: import("react").ReactNode;
|
|
5
|
-
}>, useSubscriptions: () => ((callback?: ((val: unknown) => void) | undefined) => import("../util").Unsubscribe)[];
|
|
6
|
-
/**
|
|
7
|
-
* This hook is responsible for fetching the data used for balances and inserting it into the db.
|
|
8
|
-
*/
|
|
9
|
-
export declare const useDbCacheSubscription: (subscribeTo: DbEntityType) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { EvmNetworkId } from "@talismn/chaindata-provider";
|
|
2
|
-
export declare function useEvmNetworks(withTestnets?: boolean): Record<string, import("@talismn/chaindata-provider").EvmNetwork | import("@talismn/chaindata-provider").CustomEvmNetwork>;
|
|
3
|
-
export declare function useEvmNetwork(evmNetworkId?: EvmNetworkId, withTestnets?: boolean): import("@talismn/chaindata-provider").EvmNetwork | undefined;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TokenId } from "@talismn/chaindata-provider";
|
|
2
|
-
export declare function useTokens(withTestnets?: boolean): Record<string, import("@talismn/chaindata-provider").IToken>;
|
|
3
|
-
export declare function useToken(tokenId?: TokenId, withTestnets?: boolean): import("@talismn/chaindata-provider").IToken | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* This utility generates a context provider from a react hook passed as argument
|
|
4
|
-
*
|
|
5
|
-
* @returns an array containing the provider and the consumer hook
|
|
6
|
-
*/
|
|
7
|
-
export declare const provideContext: <P, T>(useProviderContext: (props: P) => T) => [FC<P & {
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
}>, () => T];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type Unsubscribe = () => void;
|
|
2
|
-
/**
|
|
3
|
-
* Creates a subscription function that can be used to subscribe to a multicast observable created from an upstream source.
|
|
4
|
-
*
|
|
5
|
-
* An example of when this is useful is when we want to subscribe to some data from multiple components, but we only want
|
|
6
|
-
* to actively keep that data hydrated when at least one component is subscribed to it.
|
|
7
|
-
*
|
|
8
|
-
* When the first component subscribes, the `upstream` function will be called. It should then set up a subscription and return a teardown function.
|
|
9
|
-
* When subsequent components subscribe, they will be added to the existing subscription.
|
|
10
|
-
* When the last component unsubscribes, the teardown function returned from the `upstream` function will be called.
|
|
11
|
-
*
|
|
12
|
-
* @param upstream A function that takes a "next" callback function as an argument, and returns either an unsubscribe function or void.
|
|
13
|
-
* @returns A subscription function that can be used to subscribe to the multicast observable.
|
|
14
|
-
*/
|
|
15
|
-
export declare const useMulticastSubscription: <T>(upstream: (next: (val: T) => void) => Unsubscribe | void) => (callback?: ((val: T) => void) | undefined) => Unsubscribe;
|
|
16
|
-
export declare const createMulticastSubscription: <T>(upstream: (next: (val: T) => void) => Unsubscribe | void) => (callback?: ((val: T) => void) | undefined) => Unsubscribe;
|