Skip to content

useverto/flex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bf2c947 · Jan 11, 2023

History

40 Commits
Oct 21, 2022
Oct 24, 2022
Aug 2, 2022
Aug 2, 2022
Aug 2, 2022
Aug 5, 2022
Aug 3, 2022
Oct 21, 2022
Aug 4, 2022
Aug 2, 2022
Aug 2, 2022
Oct 24, 2022
Oct 21, 2022

Repository files navigation

Verto logo (light version)

Verto Flex

An embeddable, programmable order book framework

Installation

npm install @verto/flex

or

yarn add @verto/flex

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 framework includes the core functions necessary to give SmartWeave contracts the ability to embed and manage a central limit order book.

Import

To use the library, you'll need to import its functions

import {
  AddPair,
  CancelOrder,
  CreateOrder,
  Halt,
  ReadOutbox,
} from "@verto/flex";

Add a pair

const { newState, result } = await AddPair(state, action);