getOrderType
Action for fetching order type.
import
import { getOrderType } from '@arkproject/core'
Usage
import { getOrderType } from '@arkproject/core'
import { config } from './config'
const { orderType } = await getOrderType(config, {
orderHash: '...',
})
Parameters
import { type GetOrderTypeParameters } from "@arkproject/core"
orderHash
bigint
Orderhash to get order type for.
Function Description
getOrderType
starts by extracting the order hash from the provided parameters. It retrieves the ABI of the orderbook contract using the Starknet provider. If the ABI is not found, an error is thrown. The function creates a Contract
instance with the orderbook contract's ABI and address, and calls the get_order_type
method with the compiled order hash. It returns the type of the order as a CairoCustomEnum
.