SkipAPI class provides a range of methods to interact with the Skip API. It includes functionalities such as retrieving supported chains and assets, fetching routing information for token transfers, submitting transactions, and tracking their status. This class acts as an interface for applications to interact with the Skip API.

Constructors

Methods

  • Returns string

  • Fetches the IBC origin assets based on provided asset details.

    Parameters

    • args: {
          chainId: string;
          denom: string;
      }[]

      Array of objects containing denom and chainId. See the argument structure in SupportedAsset.

    Returns Promise<{
        error: string;
        success: false;
    } | {
        data: (null | SupportedAsset)[];
        success: true;
    }>

    A promise that resolves to an object containing either the origin assets SupportedAsset or an error message.

  • Retrieves the necessary messages for transaction creation.

    Parameters

    Returns Promise<{
        data: MsgResponse;
        msgs: SkipMsg[];
        success: true;
    } | {
        error: string;
        success: false;
    }>

    A promise that resolves to an object containing transaction messages or an error message.

  • Fetches recommended chains for a given asset.

    Parameters

    • args: RecommendedAssetRequest

      The request arguments including source asset denom and chain ID, and an optional flag for multi-tx. See RecommendedChainRequest.

    Returns Promise<{
        error: string;
        success: false;
    } | {
        recommendations: RecommendedAssetResponse[];
        success: true;
    }>

    A promise that resolves to an array containing recommended chains RecommendedAssetResponse or an error message.

  • Fetches recommended chains for a given asset.

    Parameters

    • args: RecommendedChainRequest

      The request arguments including source asset denom and chain ID, and an optional flag for multi-tx.

    Returns Promise<{
        error: string;
        success: false;
    } | {
        chains: RecommendedChainResponse;
        success: true;
    }>

    A promise that resolves to an object containing recommended chains or an error message.

  • Calculates the route for token transfer between two assets.

    Parameters

    • args: RouteRequest

      The arguments required to calculate the route, including source and destination asset details. See RouteRequest.

    Returns Promise<{
        error: string;
        success: false;
    } | {
        route: RouteResponse;
        success: true;
    }>

    A promise that resolves to an object containing the route details RouteResponse or an error message.

  • Retrieves the supported assets for a specified chain.

    Parameters

    Returns Promise<{
        error: string;
        success: false;
    } | {
        assets: SupportedAsset[];
        success: true;
    }>

    A promise that resolves to an object containing the supported assets for the given chain, or an error message if unsuccessful. See SupportedAsset.

  • Retrieves the list of supported chains from the Skip API.

    Parameters

    • Optional options: {
          cached?: boolean;
          includeEVM?: boolean;
          includeSVM?: boolean;
          includeTestnets?: boolean;
      }
      • Optional cached?: boolean
      • Optional includeEVM?: boolean
      • Optional includeSVM?: boolean
      • Optional includeTestnets?: boolean

    Returns Promise<{
        error: string;
        success: false;
    } | {
        chains: SupportedChain[];
        success: true;
    }>

    A Promise that resolves to an object containing either a list of supported chains on success, or an error message on failure. See SupportedChains.

  • Parameters

    Returns void

  • Returns boolean

  • Parameters

    • clientID: string

    Returns void

  • Submits a transaction to the blockchain.

    Parameters

    Returns Promise<{
        response: TransactionResponse;
        success: true;
    } | {
        error: string;
        success: false;
    }>

    A promise that resolves to an object indicating the success of the transaction submission along with the transaction response TransactionResponse or an error message.

  • Parameters

    Returns Promise<{
        response: TransactionResponse;
        success: true;
    } | {
        error: string;
        success: false;
    }>