@reservoir0x/relay-kit-ui
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
132 lines • 5.91 kB
TypeScript
import type { Execute, paths, RelayChain } from '@reservoir0x/relay-sdk';
import type { BridgeFee } from '../types/index.js';
import type { QuoteResponse, useQuote } from '@reservoir0x/relay-kit-hooks';
import type { ComponentPropsWithoutRef } from 'react';
import type Text from '../components/primitives/Text.js';
export declare const parseFees: (selectedTo: RelayChain, selectedFrom: RelayChain, quote?: ReturnType<typeof useQuote>['data']) => {
breakdown: BridgeFee[];
totalFees: {
usd?: string;
priceImpactPercentage?: string;
priceImpact?: string;
priceImpactColor?: ComponentPropsWithoutRef<typeof Text>['color'];
swapImpact?: {
value: number;
formatted: string;
};
};
};
export declare const calculateRelayerFeeProportionUsd: (quote?: QuoteResponse) => bigint;
export declare const calculateRelayerFeeProportion: (totalAmount: {
rawExcludingOriginGas: bigint;
}, feeBreakdown: BridgeFee[]) => bigint;
export declare const isHighRelayerServiceFeeUsd: (quote?: QuoteResponse) => boolean;
export declare const extractQuoteId: (steps?: Execute['steps'] | QuoteResponse['steps']) => string | undefined;
export declare const extractDepositAddress: (steps?: Execute['steps']) => string | undefined;
export declare const calculatePriceTimeEstimate: (details?: QuoteResponse['details']) => {
time: number;
formattedTime: string;
};
export declare const appendMetadataToRequest: (baseUrl?: string, requestId?: string, additionalMetadata?: paths['/requests/metadata']['post']['requestBody']['content']['application/json']['additionalMetadata'], referrer?: string) => Promise<import("axios").AxiosResponse<any, any>> | undefined;
export declare const getCurrentStep: (steps?: Execute['steps'] | null) => {
step: null;
stepItem: null;
} | {
step: {
error?: string | undefined;
errorData?: any;
action: string;
description: string;
kind: "transaction" | "signature";
id: "send" | "approve" | "swap" | "deposit" | "authorize" | "authorize1" | "authorize2";
requestId?: string | undefined;
depositAddress?: string | undefined;
items: {
status: "complete" | "incomplete";
receipt?: import("viem").TransactionReceipt | import("@reservoir0x/relay-sdk").SvmReceipt | import("@reservoir0x/relay-sdk").SuiReceipt | undefined;
checkStatus?: "success" | "pending" | "unknown" | "refund" | "delayed" | "waiting" | "failure" | "submitted" | undefined;
progressState?: "signing" | "complete" | "confirming" | "validating" | "validating_delayed" | "posting" | undefined;
data?: any;
check?: {
endpoint?: string | undefined;
method?: string | undefined;
} | undefined;
orderIndexes?: number[] | undefined;
orderIds?: string[] | undefined;
error?: string | undefined;
txHashes?: {
txHash: string;
chainId: number;
isBatchTx?: boolean | undefined;
}[] | undefined;
internalTxHashes?: {
txHash: string;
chainId: number;
isBatchTx?: boolean | undefined;
}[] | undefined;
errorData?: any;
orderData?: {
crossPostingOrderId?: string | undefined;
orderId: string;
orderIndex: string;
}[] | undefined;
isValidatingSignature?: boolean | undefined;
}[];
} | undefined;
stepItem: {
status: "complete" | "incomplete";
receipt?: import("viem").TransactionReceipt | import("@reservoir0x/relay-sdk").SvmReceipt | import("@reservoir0x/relay-sdk").SuiReceipt | undefined;
checkStatus?: "success" | "pending" | "unknown" | "refund" | "delayed" | "waiting" | "failure" | "submitted" | undefined;
progressState?: "signing" | "complete" | "confirming" | "validating" | "validating_delayed" | "posting" | undefined;
data?: any;
check?: {
endpoint?: string | undefined;
method?: string | undefined;
} | undefined;
orderIndexes?: number[] | undefined;
orderIds?: string[] | undefined;
error?: string | undefined;
txHashes?: {
txHash: string;
chainId: number;
isBatchTx?: boolean | undefined;
}[] | undefined;
internalTxHashes?: {
txHash: string;
chainId: number;
isBatchTx?: boolean | undefined;
}[] | undefined;
errorData?: any;
orderData?: {
crossPostingOrderId?: string | undefined;
orderId: string;
orderIndex: string;
}[] | undefined;
isValidatingSignature?: boolean | undefined;
} | undefined;
};
export declare const getSwapEventData: (details: Execute['details'], steps: Execute['steps'] | null, connector?: string, quoteParameters?: Parameters<typeof useQuote>['2']) => {
wallet_connector: string | undefined;
quote_request_id: string;
quote_id: string | undefined;
amount_in: string | undefined;
currency_in: string | undefined;
chain_id_in: number | undefined;
amount_out: string | undefined;
currency_out: string | undefined;
chain_id_out: number | undefined;
currency_in_usd: string | undefined;
currency_out_usd: string | undefined;
deposit_address: string | undefined;
txHashes: {
chainId: number;
txHash: string;
}[] | undefined;
operation: string | undefined;
checkStatuses: {
stepId: string;
checkStatus: string;
}[] | undefined;
};
export declare const calculateUsdValue: (price?: number, amountString?: string) => number | undefined;
//# sourceMappingURL=quote.d.ts.map