Skip to content

sendOrder

The sendOrder function sends a transaction to open an order on a SolverNet inbox contract.

Usage

import { sendOrder } from '@omni-network/core'

import { sendOrder } from '@omni-network/core'
 
const transactionHash = await sendOrder({
  // ... params
});

Parameters

PropTypeRequiredDescription
clientClientYesThe viem client used to send the transaction. This client must have an account attached to it.
inboxAddressAddressYesThe address of the inbox contract, retrieved using the getContracts function.
orderOrderYesOrder parameters

Return

sendOrder returns the Promise of the created transaction hash as a Hex string.

Example

import { getContracts, sendOrder, validateOrder } from '@omni-network/core'
 
const orderParams = {...}
 
const contracts = await getContracts()
const validation = await validateOrder(orderParams)
if (validation.accepted) {
  const txHash = await sendOrder({
    client: viemWalletClient,
    inboxAddress: contracts.inbox,
    order: orderParams,
  })
}