Verto Component
Build Verto functionality into your own SmartWeave contract
Installation
npm install @verto/component
or
yarn add @verto/component
Prerequisites
Your SmartWeave contract state MUST contain the following variables in order for the Verto Components to function properly:
{
emergencyHaltWallet: "",
halted: false,
pairs: [],
usedTransfers: [],
invocations: [],
foreignCalls: []
}
Usage
This library implements the core functions necessary to give SmartWeave contracts the ability to manage a central limit order book.
Import
To use the library, you'll need to import its functions
import * as verto from "@verto/component";
OR
import {
AddPair,
CancelOrder,
CreateOrder,
Halt,
ReadOutbox,
} from "@verto/component";
Add a pair
const newState = await AddPair(state, action);