@0xsquid/react-hooks 8.5.1-beta-named-config-and-ssr.0 → 8.6.0
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/queries/queries-keys.d.ts +5 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/stellar.d.ts +52 -0
- package/dist/core/types/tokens.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/stellar/useStellarTrustLine.d.ts +13 -0
- package/dist/{index-B9HoEAkw.js → index-BvAot66c.js} +371 -41
- package/dist/index-BvAot66c.js.map +1 -0
- package/dist/{index-DerYFnJy.js → index-Ck3Byj7H.js} +362 -43
- package/dist/index-Ck3Byj7H.js.map +1 -0
- package/dist/{index.es-6saiqdxO.js → index.es-83oSJcJe.js} +2 -2
- package/dist/{index.es-6saiqdxO.js.map → index.es-83oSJcJe.js.map} +1 -1
- package/dist/{index.es-D5XAyXYj.js → index.es-C_BgGjLx.js} +2 -2
- package/dist/{index.es-D5XAyXYj.js.map → index.es-C_BgGjLx.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/{secretService-MoYDj-tj.js → secretService-Cj_HK_on.js} +2 -2
- package/dist/{secretService-MoYDj-tj.js.map → secretService-Cj_HK_on.js.map} +1 -1
- package/dist/{secretService-CMKzgy2w.js → secretService-zFFQM-jC.js} +2 -2
- package/dist/{secretService-CMKzgy2w.js.map → secretService-zFFQM-jC.js.map} +1 -1
- package/dist/services/external/rpcService.d.ts +1 -1
- package/dist/services/external/stellarApiClient.d.ts +4 -0
- package/dist/services/external/stellarRpcClient.d.ts +2 -2
- package/dist/services/external/xrplRpcClient.d.ts +2 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/internal/stellarService.d.ts +9 -0
- package/dist/services/internal/xrplService.d.ts +2 -0
- package/dist/{stellarService.client-DaNc2W3z.js → stellarService.client-CBzr6pLs.js} +2 -2
- package/dist/{stellarService.client-DaNc2W3z.js.map → stellarService.client-CBzr6pLs.js.map} +1 -1
- package/dist/{stellarService.client-BlRR1b_S.js → stellarService.client-CI86BfjV.js} +2 -2
- package/dist/{stellarService.client-BlRR1b_S.js.map → stellarService.client-CI86BfjV.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-B9HoEAkw.js.map +0 -1
- package/dist/index-DerYFnJy.js.map +0 -1
|
@@ -34,6 +34,8 @@ export declare enum QueryKeys {
|
|
|
34
34
|
XrplAccountActivatedInfo = "xrplAccountActivatedInfo",
|
|
35
35
|
FiatToCryptoPaymentMethods = "fiatToCryptoPaymentMethods",
|
|
36
36
|
Stellar = "stellar",
|
|
37
|
+
StellarTrustLine = "stellarTrustLine",
|
|
38
|
+
IsStellarTrustLineApproved = "isStellarTrustLineApproved",
|
|
37
39
|
StellarAccountActivatedInfo = "stellarAccountActivatedInfo",
|
|
38
40
|
Hedera = "hedera",
|
|
39
41
|
IsHederaTokenAssociated = "isHederaTokenAssociated"
|
|
@@ -59,7 +61,7 @@ export declare const keys: () => {
|
|
|
59
61
|
fiatToCryptoStatus: (transactionId?: string) => (string | undefined)[];
|
|
60
62
|
sendTransactionStatus: (txHash: string | undefined, chainId: string | undefined) => (string | undefined)[];
|
|
61
63
|
allTransactionsStatus: (transactions: HistoryTransaction[] | undefined) => string[];
|
|
62
|
-
routeApproved: (routeData: RouteResponse["route"] | undefined, allowanceInWei: bigint | undefined) => (string | undefined)[];
|
|
64
|
+
routeApproved: (routeData: RouteResponse["route"] | undefined, allowanceInWei: bigint | undefined, isAllowanceQueryEnabled: boolean | undefined, hasAllowance: boolean | undefined) => (string | boolean | undefined)[];
|
|
63
65
|
sendTransactionGas: (chainId: string | undefined, tokenAddress: string | undefined, from: string | undefined) => (string | undefined)[];
|
|
64
66
|
ensData: (address?: string) => (string | undefined)[];
|
|
65
67
|
ensSearch: (query?: string) => (string | undefined)[];
|
|
@@ -71,6 +73,8 @@ export declare const keys: () => {
|
|
|
71
73
|
xrplTrustLine: (tokenAddress: string | undefined, chainId: string | undefined, address: string | undefined) => (string | undefined)[];
|
|
72
74
|
isXrplTrustLineApproved: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined, trustLineLimit: string | undefined, amountToApprove: bigint | undefined) => (string | undefined)[];
|
|
73
75
|
xrplAccountActivatedInfo: (destinationAddress: string | undefined, toChainId: string | undefined, toChainType: ChainType | undefined) => (string | undefined)[];
|
|
76
|
+
stellarTrustLine: (tokenAddress: string | undefined, chainId: string | undefined, address: string | undefined) => (string | undefined)[];
|
|
77
|
+
isStellarTrustLineApproved: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined, trustLineLimit: string | undefined, amountToApprove: bigint | undefined) => (string | undefined)[];
|
|
74
78
|
stellarAccountActivatedInfo: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined) => (string | undefined)[];
|
|
75
79
|
isHederaTokenAssociated: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined) => (string | undefined)[];
|
|
76
80
|
};
|
|
@@ -4,7 +4,7 @@ export type { QrCodeData } from "./event";
|
|
|
4
4
|
export * from "./history";
|
|
5
5
|
export type * from "./onramps/";
|
|
6
6
|
export type { SwapParams } from "./swap";
|
|
7
|
-
export type { Chain, Token } from "./tokens";
|
|
7
|
+
export type { Chain, Token, TrustLineAsset } from "./tokens";
|
|
8
8
|
export { AxelarStatusResponseType, SendTransactionStatus, TransactionStatus, type PatchedRouteActionResponse, type TransactionParams, } from "./transaction";
|
|
9
9
|
export type { AddressWithEns, BitcoinWallet, ConnectorID, CosmosWallet, EnsData, EnsSearchResult, FullAddressData, NetworkConfig, SolanaWallet, SupportedChain, Wallet, } from "./wallet";
|
|
10
10
|
export { XamanXrplNetwork } from "./xrpl";
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
import { BaseChain } from "@0xsquid/squid-types";
|
|
1
2
|
import type { ModuleInterface } from "@creit.tech/stellar-wallets-kit";
|
|
3
|
+
import { Token } from "./tokens";
|
|
2
4
|
export interface StellarConnector extends ModuleInterface {
|
|
3
5
|
}
|
|
6
|
+
export declare enum StellarHorizonAssetType {
|
|
7
|
+
/**
|
|
8
|
+
* XLM native token
|
|
9
|
+
*/
|
|
10
|
+
NATIVE = "native",
|
|
11
|
+
/**
|
|
12
|
+
* 1-4 char asset code (e.g. USDC)
|
|
13
|
+
*/
|
|
14
|
+
ALPHANUM4 = "credit_alphanum4",
|
|
15
|
+
/**
|
|
16
|
+
* 5-12 char asset code (e.g. wstETH)
|
|
17
|
+
*/
|
|
18
|
+
ALPHANUM12 = "credit_alphanum12"
|
|
19
|
+
}
|
|
20
|
+
export interface StellarHorizonNativeAsset {
|
|
21
|
+
balance: string;
|
|
22
|
+
asset_type: StellarHorizonAssetType.NATIVE;
|
|
23
|
+
}
|
|
24
|
+
export interface StellarHorizonIssuedAsset {
|
|
25
|
+
balance: string;
|
|
26
|
+
asset_type: Exclude<StellarHorizonAssetType, StellarHorizonAssetType.NATIVE>;
|
|
27
|
+
asset_code: string;
|
|
28
|
+
asset_issuer: string;
|
|
29
|
+
limit: string;
|
|
30
|
+
}
|
|
31
|
+
export type StellarTrustLine = StellarHorizonIssuedAsset;
|
|
32
|
+
export declare enum StellarTokenType {
|
|
33
|
+
NATIVE_TOKEN = "nativeToken",
|
|
34
|
+
ISSUER_TOKEN = "issuerToken",
|
|
35
|
+
CONTRACT_TOKEN = "contractToken"
|
|
36
|
+
}
|
|
37
|
+
export interface StellarToken extends Token {
|
|
38
|
+
chainAssetConfig: {
|
|
39
|
+
stellar: {
|
|
40
|
+
assetType: StellarTokenType;
|
|
41
|
+
contractAddress: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface StellarIssuedToken extends StellarToken {
|
|
46
|
+
chainAssetConfig: {
|
|
47
|
+
stellar: {
|
|
48
|
+
assetType: StellarTokenType.ISSUER_TOKEN;
|
|
49
|
+
contractAddress: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface StellarChain extends BaseChain {
|
|
54
|
+
horizonRpcList: string[];
|
|
55
|
+
}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./onramp/useFiatToCrypto";
|
|
|
9
9
|
export { useSquidQueryClient } from "./query/useSquidQueryClient";
|
|
10
10
|
export { useSquid } from "./squid/useSquid";
|
|
11
11
|
export { useStellarAccountActivation } from "./stellar/useStellarAccountActivation";
|
|
12
|
+
export { useStellarTrustLine } from "./stellar/useStellarTrustLine";
|
|
12
13
|
export { useAddressBookStore } from "./store/useAddressBookStore";
|
|
13
14
|
export { useAssetsColorsStore } from "./store/useAssetsColorsStore";
|
|
14
15
|
export { useFavoriteTokensStore, type FavoriteToken, } from "./store/useFavoriteTokensStore";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChainData, Token } from "@0xsquid/squid-types";
|
|
2
|
+
interface Params {
|
|
3
|
+
address: string | undefined;
|
|
4
|
+
token: Token | undefined;
|
|
5
|
+
chain: ChainData | undefined;
|
|
6
|
+
amount: bigint | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function useStellarTrustLine({ address, chain, token, amount }: Params): {
|
|
9
|
+
createTrustLine: import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
|
|
10
|
+
trustLineQuery: import("@tanstack/react-query").UseQueryResult<import("../../core/types/stellar").StellarHorizonIssuedAsset | null, unknown>;
|
|
11
|
+
isTrustLineApproved: import("@tanstack/react-query").UseQueryResult<boolean, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|