SDK Methods

The { Mobula } class provides several methods to interact with the Mobula API.

Here’s a list of available methods:

  1. fetchCryptoDataByName(options: { name?: string; requestOptions?: RequestOptions; })

    Search for crypto data by name or symbol. Supports partial name/symbol matching.

  2. fetchWalletNFTs(options: { wallet?: string; force?: boolean; blockchains?: string; requestOptions?: RequestOptions; })

    Retrieve NFTs associated with a given wallet. Optional parameters to force on-chain data fetch and specify blockchains.

  3. fetchAllCryptoDetails(options: { fields?: string; requestOptions?: RequestOptions; })

    Get detailed information of all cryptocurrencies. Allows specifying additional fields to be included in the response.

  4. fetchAssetMarketData(options: { asset: string; blockchain?: string; symbol?: string; requestOptions?: RequestOptions; })

    Fetch market data for a specific asset. Blockchain parameter is optional but required if asset is specified as a smart contract.

  5. fetchPairMarketData(options: { address: string; blockchain?: string; asset?: unknown; requestOptions?: RequestOptions; })

    Obtain market data for a specific pair identified by the smart-contract address. Optional parameters include blockchain and target asset.

  6. fetchPairsMarketData(options: { asset: string; blockchain?: string; offset?: number; requestOptions?: RequestOptions; })

    Retrieve market data for multiple pairs based on asset. Supports pagination through the offset parameter.

  7. fetchAssetMarketHistory(options: { asset: string; blockchain?: string; from?: number; to?: number; requestOptions?: RequestOptions; })

    Get historical market data for an asset. Parameters allow specifying time range and blockchain.

  8. fetchAssetTradeHistory(options: { asset: string; maxResults?: number; requestOptions?: RequestOptions; })

    Access trade history for a given asset. Optional maxResults parameter to limit the number of results.

  9. fetchAssetMetadata(options: { asset?: string; requestOptions?: RequestOptions; })

    Retrieve metadata for a specific asset. Asset parameter is optional.

  10. fetchSwapQuote(options: { chain: string; fromToken: string; toToken: string; fromAddress: string; amount: bigint; slippage: number; receiver?: string; type?: TypeEnum; requestOptions?: RequestOptions; })

    Get a quote for a token swap. Includes parameters for specifying swap details like amount, slippage, and tokens involved.

  11. fetchWalletHistoryBalance(options: { wallet: string; from?: number; to?: number; blockchains?: string; requestOptions?: RequestOptions; })

    Retrieve historical balance information for a wallet. Allows filtering by time range and blockchain.

  12. fetchWalletHoldings(options: { wallet: string; blockchains?: string; cache?: boolean; stale?: number; requestOptions?: RequestOptions; })

    Get current holdings in a wallet. Includes options for caching and stale data handling.

  13. fetchWalletTransactions(options: { wallet: string; from?: number; to?: number; asset?: string; blockchain?: string; limit?: number; offset?: number; order?: OrderEnum; requestOptions?: RequestOptions; })

    Fetch transaction history for a wallet. Supports various filters like asset, blockchain, and time range.

  14. fetchWalletTransactions(options: { wallet: string; from?: number; to?: number; asset?: string; blockchain?: string; limit?: number; offset?: number; order?: OrderEnum; requestOptions?: RequestOptions; })

    Fetch transaction history for a specific wallet. Options include filtering by date range, asset, blockchain, and pagination controls.

  15. fetchMultipleAssetMarketData(options: { assets: string; blockchains?: symbol?: string; string; requestOptions?: RequestOptions; })

    Retrieve market data for multiple assets simultaneously. Supports specifying a list of assets and blockchains.

  16. fetchSwapQuote(options: { chain: string; fromToken: string; toToken: string; fromAddress: string; amount: bigint; slippage: number; receiver?: string; type?: TypeEnum; requestOptions?: RequestOptions; })

    Obtain a swap quote for token exchange, specifying details such as the tokens involved, amount, and slippage tolerance.

  17. fetchWalletHistoryBalance(options: { wallet: string; from?: number; to?: number; blockchains?: string; requestOptions?: RequestOptions; })

    Get historical balance data for a wallet over a specified time range, optionally filtered by blockchain.

  18. fetchWalletHoldings(options: { wallet: string; blockchains?: string; cache?: boolean; stale?: number; requestOptions?: RequestOptions; })

    Query current holdings in a specified wallet, with options for caching and stale data handling.

  19. fetchAssetMetadata(options: { asset?: string; blockchain?: string; requestOptions?: RequestOptions; })

    Access metadata for a specific asset, with an optional asset parameter for targeted queries.