@swapnet-xyz/sdk
Version:
TypeScript SDK for SwapNet API.
23 lines (22 loc) • 878 B
TypeScript
import type { ISwapResponse, ITokenStaticInfo } from "./common/interfaces.js";
import type { ChainId } from "./common/unames.js";
export declare class SwapnetClient {
private readonly _apiKey;
private readonly _baseUrl;
private readonly _apiVersion;
constructor(_apiKey: string, _baseUrl?: string, _apiVersion?: string);
getSupportedTokensAsync(chainId: ChainId): Promise<{
succeeded: true;
tokens: ITokenStaticInfo[];
} | {
succeeded: false;
error: string;
}>;
swapAsync(chainId: ChainId, sellTokenAddress: string, buyTokenAddress: string, sellAmount: bigint | undefined, buyAmount: bigint | undefined, userAddress?: string | undefined, includeRfq?: boolean | undefined): Promise<{
succeeded: true;
swapResponse: ISwapResponse;
} | {
succeeded: false;
error: string;
}>;
}