Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/useverto/flex

An embeddable, programmable order book framework
https://github.com/useverto/flex

Last synced: 2 months ago
JSON representation

An embeddable, programmable order book framework

Lists

README

        


Verto logo (light version)

Verto Flex


An embeddable, programmable order book framework

## Installation

```sh
npm install @verto/flex
```

or

```sh
yarn add @verto/flex
```

## Prerequisites

Your SmartWeave contract state MUST contain the following variables in order for the Verto Components to function properly:

```js
{
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

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

### Add a pair

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