@accret/bridge-sdk
Version:
45 lines • 2.14 kB
TypeScript
import type { AccretSupportedChain } from "../../types";
import type { Quote } from "@mayanfinance/swap-sdk";
import type { GetMayanTokenListResponse } from "../../types/mayan";
import type { executeMayanTxParams } from "../../types/mayan/buildTransaction";
export interface MayanQuoteParams {
fromChain: AccretSupportedChain;
fromToken: string;
toChain: AccretSupportedChain;
toToken: string;
amount: number;
slippageBps?: string | number;
referrer?: string;
referrerBps?: string | number;
referrerAddress?: string;
}
/**
* @description Fetches a quote for swapping tokens on the Mayan network
* @param params - The parameters for fetching a Mayan quote
* @param params.fromChain - The chain from which to swap
* @param params.fromToken - The token to swap from
* @param params.toChain - The chain to which to swap
* @param params.toToken - The token to swap to
* @param params.amount - The amount to swap
* @param params.slippageBps - The slippage in basis points (default is 50)
* @param params.referrer - The referrer for the swap (optional)
* @param params.referrerBps - The referrer basis points (optional)
* @param params.referrerAddress - The referrer address (optional)
* @returns A promise that resolves to the best quote for the swap
*/
export declare function getMayanQuote(params: MayanQuoteParams): Promise<Quote>;
/**
* @description Fetches the token list for a specific Mayan chain
* @param chain - The chain for which to fetch the token list
* @returns A promise that resolves to the token list response
*/
export declare function getMayanTokenList(chain: AccretSupportedChain): Promise<GetMayanTokenListResponse>;
/**
* @description Executes a swap on the Mayan network
* @param quote - The quote object containing swap details
* @param destAddr - The destination address for the swap
* @param privateKey - The private key of the wallet initiating the swap
* @returns The transaction hash of the executed swap
*/
export declare function executeMayanSwap({ quote, destAddr, privateKey, }: executeMayanTxParams): Promise<string>;
//# sourceMappingURL=index.d.ts.map