@use-glyph/sdk-react 2.0.15 → 2.0.16-rc.3
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/assets/sdk-react.css +1 -1
- package/dist/glyph-widget.umd.js +58 -58
- package/dist/glyph-widget.umd.js.map +1 -1
- package/dist/index.js +7760 -7568
- package/dist/index.js.map +1 -1
- package/dist/types/components/widget/internal/WalletSwapTopUpGas.d.ts +2 -1
- package/dist/types/lib/relay.d.ts +2 -1
- package/dist/types/lib/relayNativeMaxAmount.d.ts +33 -0
- package/package.json +1 -1
|
@@ -5,7 +5,8 @@ type WalletSwapTopUpGasProps = {
|
|
|
5
5
|
topUpGas: boolean;
|
|
6
6
|
setTopUpGas: (value: boolean) => void;
|
|
7
7
|
topUpDetails: TopUpDetails;
|
|
8
|
+
tokenAddress: string;
|
|
8
9
|
quoteReady?: boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare const WalletSwapTopUpGas: ({ destinationChainId, topUpGas, setTopUpGas, topUpDetails, quoteReady }: WalletSwapTopUpGasProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare const WalletSwapTopUpGas: ({ destinationChainId, topUpGas, setTopUpGas, topUpDetails, quoteReady, tokenAddress }: WalletSwapTopUpGasProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RelayChain } from '@relayprotocol/relay-sdk';
|
|
1
|
+
import { paths, RelayChain } from '@relayprotocol/relay-sdk';
|
|
2
2
|
export declare const SOLANA_RELAY_ID = 792703809;
|
|
3
3
|
export declare const relayClient: import('@relayprotocol/relay-sdk').RelayClient;
|
|
4
4
|
export declare const configureRelayChains: (chains: RelayChain[]) => void;
|
|
5
|
+
export declare function fetchRelayRequests(queryOptions: Record<string, string>): Promise<paths["/requests/v2"]["get"]["responses"]["200"]["content"]["application/json"]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PublicClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the gas buffer needed for a native EVM token transfer.
|
|
4
|
+
* This buffer is estimated based on gas price and a standard limit,
|
|
5
|
+
* then multiplied by a safety factor.
|
|
6
|
+
*
|
|
7
|
+
* @param publicClient - A VIEM PublicClient connected to the EVM chain.
|
|
8
|
+
* @param balance - The total native balance of the user (used for early exit).
|
|
9
|
+
* @param gasLimit - Optional: The gas limit to use for estimation (defaults to 400000n).
|
|
10
|
+
* @returns The calculated gas buffer amount as a bigint, or 0n if estimation fails or balance is zero.
|
|
11
|
+
*/
|
|
12
|
+
export declare const calculateEvmNativeGasBuffer: (publicClient: PublicClient, balance: bigint, gasLimit?: bigint) => Promise<bigint>;
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the fee buffer needed for a native SVM (e.g., Solana) or Eclipse transaction.
|
|
15
|
+
* Uses specific multipliers and default fees for each type.
|
|
16
|
+
* Falls back to a default fee if API data is unavailable or invalid.
|
|
17
|
+
*
|
|
18
|
+
* @param chainId - The chain ID of the SVM or Eclipse network.
|
|
19
|
+
* @returns The calculated fee buffer amount (in lamports for Solana, Wei for Eclipse) as a bigint, or a fallback buffer if estimation fails.
|
|
20
|
+
*/
|
|
21
|
+
export declare const calculateSvmNativeFeeBuffer: (chainId: number) => Promise<bigint>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the fee buffer amount for a given chain and VM type.
|
|
24
|
+
* Uses QueryClient for caching and deduplication of requests.
|
|
25
|
+
*
|
|
26
|
+
* @param vmType - The virtual machine type ('evm' or 'svm').
|
|
27
|
+
* @param chainId - The chain ID.
|
|
28
|
+
* @param balance - The current balance (required for EVM calculation).
|
|
29
|
+
* @param publicClient - VIEM PublicClient (required for EVM calculation).
|
|
30
|
+
* @param queryClient - Optional QueryClient instance. If not provided, a default one will be created.
|
|
31
|
+
* @returns A promise that resolves to the fee buffer amount as a bigint.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getFeeBufferAmount: (chainId: number, balance: bigint) => Promise<bigint>;
|