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
- Host: GitHub
- URL: https://github.com/useverto/flex
- Owner: useverto
- License: mit
- Created: 2022-08-02T23:09:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-11T16:26:13.000Z (about 2 years ago)
- Last Synced: 2024-05-21T06:40:25.113Z (8 months ago)
- Language: JavaScript
- Homepage: https://npmjs.com/@verto/flex
- Size: 235 KB
- Stars: 20
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-arweave - Verto Exchange - The first decentralized exchange on the permaweb. (Apps 🕯️)
README
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);
```