@shogun-sdk/one-shot
Version:
Shogun SDK - One Shot: React Components and hooks for cross-chain swaps
71 lines • 1.86 kB
TypeScript
/** Response structure returned from the API */
interface ResponseData {
steps: Step[];
details: Details;
fees: Fees;
}
/** Transaction details including sender, recipient, and token info */
interface Details {
sender: string;
recipient: string;
tokenIn: TokenIn;
}
/** Represents a token, including metadata and amount */
interface TokenIn {
amountUsd: string;
chainId: number;
address: string;
symbol: string;
name: string;
decimals: number;
amount?: string;
}
/** Fee structure for transactions */
interface Fees {
gas: TokenIn;
}
/** Step object representing a blockchain transaction */
interface Step {
from: string;
to: string;
data: string;
value: string;
chainId: number;
gas: string;
maxFeePerGas: string;
maxPriorityFeePerGas: string;
}
/** Represents an NFT item with contract address and token ID */
interface NFTItem {
address: string;
tokenId: string;
}
/** Defines the token being used for the transaction */
interface Token {
address: string;
decimals: number;
chainId: number;
}
/** Input parameters required for `useLego` */
interface UseLegoProps {
items: NFTItem[];
token: Token;
userAddress: string;
}
/** Output structure of `useLego` */
interface UseLegoResult {
status: boolean;
error?: string | null;
data?: ResponseData | null;
isLoading: boolean;
refetch: () => void;
}
/**
* Hook to validate and prepare transaction data for purchasing NFTs.
*
* @param {UseLegoProps} props - The NFT items, token details, and user address.
* @returns {UseLegoResult} - Status, error message (if any), response data, loading state, and a refetch function.
*/
export declare const useLego: ({ items, token, userAddress }: UseLegoProps) => UseLegoResult;
export {};
//# sourceMappingURL=useLego.d.ts.map