import Mpc from '../../../mpc' import { ScreenAddressApiResponse, ScanEVMRequest, ScanEVMResponse, ScanEip712Request, ScanEip712Response, ScanSolanaRequest, ScanSolanaResponse, ScanNftsRequest, ScanNftsResponse, ScanTokensRequest, ScanTokensResponse, ScanUrlRequest, ScanUrlResponse, ScreenAddressRequestOptions, } from '../../../../hypernative' export default class Hypernative { private mpc: Mpc constructor({ mpc }: { mpc: Mpc }) { this.mpc = mpc } /** * Scans an EIP-155 transaction for security risks. * @param data - The parameters for the EIP-155 transaction scan request. * @returns A `ScanEVMResponse` promise. * @throws An error if the operation fails. */ public async scanEVMTx( data: ScanEVMRequest, ): Promise { return this.mpc?.scanEVMTx(data) } /** * Scans an EIP-712 typed message for security risks. * @param data - The parameters for the EIP-712 message scan request. * @returns A `ScanEip712Response` promise. * @throws An error if the operation fails. */ public async scanEip712Tx( data: ScanEip712Request, ): Promise { return this.mpc?.scanEip712Tx(data) } /** * Scans a Solana transaction for security risks. * @param data - The parameters for the Solana transaction scan request. * @returns A `ScanSolanaResponse` promise. * @throws An error if the operation fails. */ public async scanSolanaTx( data: ScanSolanaRequest, ): Promise { return this.mpc?.scanSolanaTx(data) } /** * Scans addresses for security risks and flags. * @param data - The parameters for the address scan request. * @returns A `ScreenAddressApiResponse` promise. * @throws An error if the operation fails. */ public async scanAddresses( addresses: string[], options?: ScreenAddressRequestOptions, ): Promise { return this.mpc?.scanAddresses({ addresses, ...options }) } /** * Scans NFTs for security risks. * @param data - The parameters for the NFT scan request. * @returns A `ScanNftResponse` promise. * @throws An error if the operation fails. */ public async scanNFTs(nfts: ScanNftsRequest): Promise { return this.mpc?.scanNFTs(nfts) } /** * Scans tokens for security risks. * @param data - The parameters for the token scan request. * @returns A `ScanTokenResponse` promise. * @throws An error if the operation fails. */ public async scanTokens( tokens: ScanTokensRequest, ): Promise { return this.mpc?.scanTokens(tokens) } /** * Scans a URL for malicious content. * @param data - The parameters for the URL scan request. * @returns A `ScanUrlResponse` promise. * @throws An error if the operation fails. */ public async scanURL(url: ScanUrlRequest): Promise { return this.mpc?.scanUrl(url) } }