export type MonitoringSupportedRuntimes = 'evm' | 'sui' | 'solana' | 'stellar' | 'hedera' | 'bitcoin' | 'hyperliquid' | 'polymarket' | 'aster' | 'lighter' | 'tron'; export type MonitoringSupportedChains = 'abstract' | 'apechain' | 'arbitrum' | 'avalanche' | 'avalanche-fuji' | 'base' | 'berachain' | 'bitcoin' | 'blast' | 'bsc' | 'degen' | 'ethereum' | 'ethereum-sepolia' | 'gnosis' | 'hedera' | 'hyperevm' | 'hyperliquid' | 'aster' | 'lighter' | 'ink' | 'kaia' | 'katana' | 'kite-ai' | 'linea' | 'monad' | 'optimism' | 'plume' | 'polymarket' | 'polygon' | 'ronin' | 'scroll' | 'sei' | 'solana' | 'soneium' | 'soneium-minato' | 'stellar' | 'sui' | 'unichain' | 'zksync' | 'mainnet' | 'kaia' | 'tron' | 'robinhood' | 'arc' | 'flare' | 'xlayer' | 'tempo'; export type ABIParameter = {name: string, type: string, internalType?: string | undefined, components?: Array | undefined}; export type ABIFunction = {type: 'function', name: string, inputs?: Array | undefined, outputs?: Array | undefined, stateMutability: 'pure' | 'view' | 'nonpayable' | 'payable', constant?: boolean | undefined, payable?: boolean | undefined}; export type ABIConstructor = {type: 'constructor', inputs?: Array | undefined, stateMutability?: ('nonpayable' | 'payable') | undefined}; export type ABIFallback = {type: 'fallback', stateMutability?: ('nonpayable' | 'payable') | undefined}; export type ABIReceive = {type: 'receive', stateMutability: 'payable'}; export type ABIEvent = {type: 'event', name: string, inputs?: Array | undefined, anonymous?: boolean | undefined}; export type ABIError = {type: 'error', name: string, inputs?: Array | undefined}; export type ContractInterface = {address: string, abi_json: Array}; export type AddressRequest = {identifier_type?: 'address' | undefined, identifier: string, tags?: Array | undefined, alias?: string | undefined, runtime?: MonitoringSupportedRuntimes | undefined, chain_name: MonitoringSupportedChains, contract_interface?: Array | undefined, class?: string | undefined}; export type DomainRequest = {identifier_type?: 'domain' | undefined, identifier: string, tags?: Array | undefined, alias?: string | undefined, class?: string | undefined}; export type PerpRequest = {identifier_type?: 'perp' | undefined, identifier: string, chain_name: 'hyperliquid' | 'aster' | 'lighter', tags?: Array | undefined, alias?: string | undefined, class?: string | undefined}; export type MarketRequest = {identifier_type?: 'market' | undefined, identifier: string, chain_name: 'polymarket', tags?: Array | undefined, alias?: string | undefined, class?: string | undefined}; export type CreateApiV0PlatformAssetsArgs = {body: AddressRequest | DomainRequest | PerpRequest | MarketRequest}; export type CreateApiV0PlatformAssetsOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Asset * * POST /v0/platform/assets/ * * Also accepts auth: ClientID, JWT */ export const createApiV0PlatformAssets = async (args: CreateApiV0PlatformAssetsArgs, options?: CreateApiV0PlatformAssetsOptions) => { const {baseUrl = "https://api.blockaid.io", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIKey !== undefined) headers.set("X-API-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/v0/platform/assets/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };