@0xsquid/react-hooks 8.4.1-beta-tempo.0 → 8.5.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/constants.d.ts +0 -3
- package/dist/core/queries/queries-keys.d.ts +1 -1
- package/dist/core/types/config.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +2 -6
- package/dist/hooks/transaction/useAllTransactionsStatus.d.ts +1 -0
- package/dist/hooks/transaction/useEstimate.d.ts +11 -5
- package/dist/hooks/user/useUserParams.d.ts +4 -0
- package/dist/{index-CaI-xWCW.js → index-5cyMUZhY.js} +1205 -1349
- package/dist/index-5cyMUZhY.js.map +1 -0
- package/dist/{index-B4aeecpP.js → index-BGVXRZI6.js} +1208 -1351
- package/dist/index-BGVXRZI6.js.map +1 -0
- package/dist/{index.es-BXf9jwuI.js → index.es-BfdAGErV.js} +3 -3
- package/dist/{index.es-BXf9jwuI.js.map → index.es-BfdAGErV.js.map} +1 -1
- package/dist/{index.es-DAfqL2H0.js → index.es-CeHwkxPw.js} +3 -3
- package/dist/{index.es-DAfqL2H0.js.map → index.es-CeHwkxPw.js.map} +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/{secretService-CIYxEkTN.js → secretService-BMYOBXhv.js} +3 -3
- package/dist/{secretService-CIYxEkTN.js.map → secretService-BMYOBXhv.js.map} +1 -1
- package/dist/{secretService-Cld4gYfG.js → secretService-D_d3CFdp.js} +3 -3
- package/dist/{secretService-Cld4gYfG.js.map → secretService-D_d3CFdp.js.map} +1 -1
- package/dist/services/internal/assetsService.d.ts +2 -2
- package/dist/services/internal/estimateService.d.ts +27 -13
- package/dist/services/internal/transactionService.d.ts +0 -7
- package/dist/{stellarService.client-COeQeah_.js → stellarService.client-CIkvwxPo.js} +3 -3
- package/dist/{stellarService.client-COeQeah_.js.map → stellarService.client-CIkvwxPo.js.map} +1 -1
- package/dist/{stellarService.client-ocLzRIB4.js → stellarService.client-DOrCdvCd.js} +3 -3
- package/dist/{stellarService.client-ocLzRIB4.js.map → stellarService.client-DOrCdvCd.js.map} +1 -1
- package/package.json +3 -3
- package/dist/hooks/tokens/useSourceChainGasToken.d.ts +0 -11
- package/dist/hooks/transaction/useTempoFeeCheck.d.ts +0 -11
- package/dist/index-B4aeecpP.js.map +0 -1
- package/dist/index-CaI-xWCW.js.map +0 -1
- package/dist/services/internal/tempoService.d.ts +0 -82
- package/dist/tests/networkGasToken.test.d.ts +0 -1
- package/dist/tests/tempoService.test.d.ts +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ChainData } from "@0xsquid/squid-types";
|
|
2
|
-
import { Token } from "../../core/types";
|
|
3
|
-
export declare const TEMPO_FEE_MANAGER_ADDRESS: "0xfeec000000000000000000000000000000000000";
|
|
4
|
-
export declare const feeManagerAbi: readonly [{
|
|
5
|
-
readonly name: "userTokens";
|
|
6
|
-
readonly type: "function";
|
|
7
|
-
readonly stateMutability: "view";
|
|
8
|
-
readonly inputs: readonly [{
|
|
9
|
-
readonly type: "address";
|
|
10
|
-
readonly name: "user";
|
|
11
|
-
}];
|
|
12
|
-
readonly outputs: readonly [{
|
|
13
|
-
readonly type: "address";
|
|
14
|
-
}];
|
|
15
|
-
}];
|
|
16
|
-
export declare const isTempoChain: (chainId: string | undefined) => boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Convert a fee amount from virtual USD (18 decimals, attodollars)
|
|
19
|
-
* to 6-decimal TIP-20 stablecoin units (microdollars).
|
|
20
|
-
* All TIP-20 tokens on Tempo have 6 decimals.
|
|
21
|
-
*/
|
|
22
|
-
export declare const convertTempoFeeToStablecoinUnits: (feeIn18Dec: bigint) => bigint;
|
|
23
|
-
export type TempoFeeData = {
|
|
24
|
-
gasTokenBalance: bigint;
|
|
25
|
-
/**
|
|
26
|
-
* True when the gas token is the same as the fromToken (i.e. no account
|
|
27
|
-
* preference is set). In that case the balance must cover both the swap
|
|
28
|
-
* amount and the gas fee.
|
|
29
|
-
*/
|
|
30
|
-
gasTokenIsFromToken: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The address of the resolved gas token.
|
|
33
|
-
* Either the account-preferred token address or the fromToken address.
|
|
34
|
-
*/
|
|
35
|
-
gasTokenAddress: string;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Pure function that derives TempoFeeData from on-chain query results.
|
|
39
|
-
* Extracted from useTempoFeeCheck so the branching logic is unit-testable
|
|
40
|
-
* without mocking React hooks.
|
|
41
|
-
*/
|
|
42
|
-
export declare function resolveTempoFeeData({ hasAccountFeePreference, accountGasTokenAddress, accountGasTokenBalance, fromTokenAddress, fromTokenBalance, }: {
|
|
43
|
-
hasAccountFeePreference: boolean;
|
|
44
|
-
accountGasTokenAddress: string | undefined;
|
|
45
|
-
accountGasTokenBalance: bigint | undefined;
|
|
46
|
-
fromTokenAddress: string | undefined;
|
|
47
|
-
fromTokenBalance: bigint | undefined;
|
|
48
|
-
}): TempoFeeData | null;
|
|
49
|
-
/**
|
|
50
|
-
* Resolves the token that pays network gas fees for a given chain and transaction context.
|
|
51
|
-
* For Tempo chains, this is the dynamically resolved gas token (from tempoFeeData).
|
|
52
|
-
* For all other chains, this is the static native gas token.
|
|
53
|
-
*/
|
|
54
|
-
export declare function resolveGasToken({ nativeToken, chain, tempoFeeData, evmTokens, }: {
|
|
55
|
-
nativeToken: Token | undefined;
|
|
56
|
-
chain: ChainData | undefined;
|
|
57
|
-
tempoFeeData: TempoFeeData | null | undefined;
|
|
58
|
-
evmTokens: Token[];
|
|
59
|
-
}): Token | undefined;
|
|
60
|
-
export type ChainFeeParams = {
|
|
61
|
-
fromTokenPaysNetworkFee: boolean;
|
|
62
|
-
gasTokenBalanceWei: bigint;
|
|
63
|
-
/**
|
|
64
|
-
* Converts a raw fee (from route estimator or gas estimator) into the
|
|
65
|
-
* correct unit for the resolved gas token.
|
|
66
|
-
* Identity for chains with a native gas token; 18-dec→6-dec for Tempo.
|
|
67
|
-
*/
|
|
68
|
-
normalizeFee: (rawFee: bigint) => bigint;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Resolves chain-agnostic fee parameters from chain-specific inputs.
|
|
72
|
-
* This is the single place that knows about Tempo vs. native-token fee semantics.
|
|
73
|
-
*
|
|
74
|
-
* Safe defaults when tempoFeeData is missing on a Tempo chain: balance=0 and
|
|
75
|
-
* fromTokenPaysNetworkFee=false, so the UI blocks rather than misleads.
|
|
76
|
-
*/
|
|
77
|
-
export declare function resolveChainFeeParams({ fromChainId, tempoFeeData, isFromTokenNative, nativeBalanceWei, }: {
|
|
78
|
-
fromChainId: string | undefined;
|
|
79
|
-
tempoFeeData: TempoFeeData | undefined | null;
|
|
80
|
-
isFromTokenNative: boolean;
|
|
81
|
-
nativeBalanceWei: bigint;
|
|
82
|
-
}): ChainFeeParams | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|