@0xsquid/react-hooks 8.0.6 → 8.0.7-hedera-beta.1
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/core/connectors/evm/hederaWalletConnect.d.ts +30 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/queries/queries-keys.d.ts +5 -1
- package/dist/core/types/hedera.d.ts +26 -0
- package/dist/core/wagmiConfig.d.ts +2 -1
- package/dist/hooks/hedera/useHederaTokenAssociations.d.ts +11 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/{index-C23cJ6Ws.js → index-B1UmFH6o.js} +714 -153
- package/dist/index-B1UmFH6o.js.map +1 -0
- package/dist/{index-Bbnh4iOc.js → index-Dhrvhjd5.js} +711 -157
- package/dist/index-Dhrvhjd5.js.map +1 -0
- package/dist/index.es-DdiQVjv_.js +43 -0
- package/dist/index.es-DdiQVjv_.js.map +1 -0
- package/dist/index.es-cLBJjjrp.js +50 -0
- package/dist/index.es-cLBJjjrp.js.map +1 -0
- package/dist/index.esm.js +2 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/{secretService-Bt57DxoX.js → secretService-BtCjIhQz.js} +3 -3
- package/dist/{secretService-Bt57DxoX.js.map → secretService-BtCjIhQz.js.map} +1 -1
- package/dist/{secretService-M8SCtgDG.js → secretService-DIqBnH3p.js} +3 -3
- package/dist/{secretService-M8SCtgDG.js.map → secretService-DIqBnH3p.js.map} +1 -1
- package/dist/services/external/hederaApiClient.d.ts +18 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/internal/hederaService.d.ts +46 -0
- package/dist/{stellarService.client-CNTH5mSh.js → stellarService.client-CM5m8Px4.js} +3 -3
- package/dist/{stellarService.client-CNTH5mSh.js.map → stellarService.client-CM5m8Px4.js.map} +1 -1
- package/dist/{stellarService.client-BHe6Jfr-.js → stellarService.client-DSH90-FO.js} +3 -3
- package/dist/{stellarService.client-BHe6Jfr-.js.map → stellarService.client-DSH90-FO.js.map} +1 -1
- package/package.json +2 -1
- package/dist/index-Bbnh4iOc.js.map +0 -1
- package/dist/index-C23cJ6Ws.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Address, type ProviderConnectInfo } from "viem";
|
|
2
|
+
import { WalletConnectParameters } from "wagmi/connectors";
|
|
3
|
+
import { HederaExtensionData } from "../../../services/internal/hederaService";
|
|
4
|
+
export type HederaWalletConnectParameters = WalletConnectParameters & {
|
|
5
|
+
extension: HederaExtensionData;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Wagmi connector to interact with the Hedera EVM network via the WalletConnect protocol.
|
|
9
|
+
*
|
|
10
|
+
* The connector removes the need for a WalletConnect modal, and instead
|
|
11
|
+
* communicates with the provided `extension` by opening the extension popup
|
|
12
|
+
* for user interaction upon request.
|
|
13
|
+
*/
|
|
14
|
+
export declare function hederaWalletConnect(parameters: HederaWalletConnectParameters): import("@wagmi/core").CreateConnectorFn<import("@walletconnect/ethereum-provider").default, {
|
|
15
|
+
connect(parameters?: {
|
|
16
|
+
chainId?: number;
|
|
17
|
+
pairingTopic?: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
accounts: readonly Address[];
|
|
20
|
+
chainId: number;
|
|
21
|
+
}>;
|
|
22
|
+
onConnect(connectInfo: ProviderConnectInfo): void;
|
|
23
|
+
onDisplayUri(uri: string): void;
|
|
24
|
+
onSessionDelete(data: {
|
|
25
|
+
topic: string;
|
|
26
|
+
}): void;
|
|
27
|
+
}, Record<string, unknown>>;
|
|
28
|
+
export declare namespace hederaWalletConnect {
|
|
29
|
+
var type: "hederaWalletConnect";
|
|
30
|
+
}
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -64,8 +64,10 @@ export declare const CHAIN_IDS: {
|
|
|
64
64
|
readonly GNOSIS: "100";
|
|
65
65
|
readonly SONIC: "146";
|
|
66
66
|
readonly HYPER_EVM: "999";
|
|
67
|
+
readonly DCHAIN: "2716446429837000";
|
|
67
68
|
readonly SONEIUM: "1868";
|
|
68
69
|
readonly PEAQ: "3338";
|
|
70
|
+
readonly HEDERA: "295";
|
|
69
71
|
readonly BITCOIN: "bitcoin";
|
|
70
72
|
readonly SOLANA: "solana-mainnet-beta";
|
|
71
73
|
readonly SUI: "sui-mainnet";
|
|
@@ -34,7 +34,9 @@ export declare enum QueryKeys {
|
|
|
34
34
|
XrplAccountActivatedInfo = "xrplAccountActivatedInfo",
|
|
35
35
|
FiatToCryptoPaymentMethods = "fiatToCryptoPaymentMethods",
|
|
36
36
|
Stellar = "stellar",
|
|
37
|
-
StellarAccountActivatedInfo = "stellarAccountActivatedInfo"
|
|
37
|
+
StellarAccountActivatedInfo = "stellarAccountActivatedInfo",
|
|
38
|
+
Hedera = "hedera",
|
|
39
|
+
IsHederaTokenAssociated = "isHederaTokenAssociated"
|
|
38
40
|
}
|
|
39
41
|
export declare const keys: () => {
|
|
40
42
|
all: QueryKeys;
|
|
@@ -45,6 +47,7 @@ export declare const keys: () => {
|
|
|
45
47
|
transactions: () => QueryKeys[];
|
|
46
48
|
xrpl: () => QueryKeys[];
|
|
47
49
|
stellar: () => QueryKeys[];
|
|
50
|
+
hedera: () => QueryKeys[];
|
|
48
51
|
coinGeckoPrices: (coingeckoIds?: string[]) => (string | undefined)[];
|
|
49
52
|
historicalData: (coingeckoId?: string, timeFrame?: Timeframe) => (string | undefined)[];
|
|
50
53
|
tokensData: (tokens?: TokenWithBalance[]) => (string | undefined)[];
|
|
@@ -69,5 +72,6 @@ export declare const keys: () => {
|
|
|
69
72
|
isXrplTrustLineApproved: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined, trustLineLimit: string | undefined, amountToApprove: bigint | undefined) => (string | undefined)[];
|
|
70
73
|
xrplAccountActivatedInfo: (destinationAddress: string | undefined, toChainId: string | undefined, toChainType: ChainType | undefined) => (string | undefined)[];
|
|
71
74
|
stellarAccountActivatedInfo: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined) => (string | undefined)[];
|
|
75
|
+
isHederaTokenAssociated: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined) => (string | undefined)[];
|
|
72
76
|
};
|
|
73
77
|
export declare const getPrefixKey: (key: QueryKeys) => QueryKeys[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account info from the Hedera Mirrornode API
|
|
3
|
+
*/
|
|
4
|
+
export interface AccountInfo {
|
|
5
|
+
balance: {
|
|
6
|
+
balance: number;
|
|
7
|
+
tokens: {
|
|
8
|
+
token_id: string;
|
|
9
|
+
balance: number;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
max_automatic_token_associations: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Account tokens info from the Hedera Mirrornode API
|
|
16
|
+
*/
|
|
17
|
+
export interface AccountTokens {
|
|
18
|
+
tokens: {
|
|
19
|
+
/**
|
|
20
|
+
* When true, indicates the token was automatically associated,
|
|
21
|
+
* using one of the account's available auto-association slots.
|
|
22
|
+
*/
|
|
23
|
+
automatic_association: boolean;
|
|
24
|
+
token_id: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
@@ -2,5 +2,6 @@ import { ChainData } from "@0xsquid/squid-types";
|
|
|
2
2
|
import { JsonRpcSigner } from "ethers";
|
|
3
3
|
import { type Account, type Chain, type Client, type Transport } from "viem";
|
|
4
4
|
import { Config } from "wagmi";
|
|
5
|
-
|
|
5
|
+
import { HederaExtensionData } from "../services/internal/hederaService";
|
|
6
|
+
export declare const createWagmiConfig: (squidChains: ChainData[], hederaExtensions: HederaExtensionData[]) => Config;
|
|
6
7
|
export declare function clientToSigner(client: Client<Transport, Chain, Account>): JsonRpcSigner | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChainData, Token } from "@0xsquid/squid-types";
|
|
2
|
+
interface Params {
|
|
3
|
+
address: string | undefined;
|
|
4
|
+
token: Token | undefined;
|
|
5
|
+
chain: ChainData | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function useHederaTokenAssociations({ address, chain, token }: Params): {
|
|
8
|
+
isTokenAssociated: import("@tanstack/react-query").UseQueryResult<boolean, unknown>;
|
|
9
|
+
associateToken: import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { useTrackSearchEmpty } from "./analytics/useTrackSearchEmpty";
|
|
|
2
2
|
export { useSquidChains } from "./chains/useSquidChains";
|
|
3
3
|
export { useClient } from "./client/useClient";
|
|
4
4
|
export { useCosmosForChain } from "./cosmos/useCosmosForChain";
|
|
5
|
+
export { useHederaTokenAssociations } from "./hedera/useHederaTokenAssociations";
|
|
5
6
|
export { useKeyboardNavigation } from "./navigation/useKeyboardNavigation";
|
|
6
7
|
export * from "./onramp/useFiatToCrypto";
|
|
7
8
|
export { useSquidQueryClient } from "./query/useSquidQueryClient";
|