OrderBook Blueprint

Install

npm install aoffp
# or
yarn add aoffp

Get FFP Settlement Process ID

import { getSettleProcessId } from 'aoffp'

const settleProcessId = getSettleProcessId()
console.log('settleProcessId', settleProcessId)

Create OrderBook Agent

If the OrderBook Agent Process has not been created, it needs to be created first. The creation operation is as follows:

import { createOrderbookProcess } from 'aoffp'
import { createDataItemSigner } from '@permaweb/aoconnect'

const address = 'your-arweave-address'
const signer = createDataItemSigner(arJWK)
const settleProcessId = getSettleProcessId()
const orderbookAgent = await createOrderbookProcess(signer)
const orderbookProcessId = orderbookAgent.agentId
console.log('orderbookProcessId', orderbookProcessId)

To create a new agent instance, use the following command:

Agent Operations

Deposit Funds

To deposit funds into the agent, use the following operation:

Withdraw Funds

To withdraw funds from the agent, use the following operation:

Get All Orders in FFP

Place an Order

To place a limit order, use the following operation:

Cancel an Order

To cancel an existing order, use the following operation:

Take an Order

To take an order (eat the order), use the following operation:

Last updated

Was this helpful?