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
Prop | Type | Required | Description |
---|---|---|---|
client | Client | Yes | The viem client used to send the transaction. This client must have an account attached to it. |
inboxAddress | Address | Yes | The address of the inbox contract, retrieved using the getContracts function. |
order | Order | Yes | Order 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,
})
}