0.10.5 • Published 3 years ago

@verto/lib v0.10.5

Weekly downloads
261
License
MIT
Repository
-
Last release
3 years ago

About

This repository contains all of the utilities to integrate Verto into your applications.

Important Notice: Verto is in its Alpha stage. If you have a suggestion, idea, or find a bug, please report it! The Verto team will not be held accountable for any funds lost.

Getting Started

Installation

NPM:

npm install @verto/lib

or

yarn add @verto/lib

OpenBits:

openbits install @verto/lib@0.1.0-alpha

Arweave:

npm install https://arweave.net/sQCMItLeUCMSqkLGz12tbc7NDaNxhdQTrN1pi30ybXs

or

yarn add https://arweave.net/sQCMItLeUCMSqkLGz12tbc7NDaNxhdQTrN1pi30ybXs

Initialization

import Verto from "@verto/lib";
import Arweave from "arweave";

const arweave = Arweave.init();
const client = new Verto(arweave);

You can alternatively initialize without a preconfigured Arweave Client.

import Verto from "@verto/lib";

const client = new Verto();

If you are using the trade functions, you will need to intialise with a valid Arweave keyfile:

import Verto from "@verto/lib";
import keyfile from "./arweave.json";

const client = new Verto(keyfile);

Usage

getAssets(address)

Returns a list of profit sharing token balances, which are supported by the Verto Exchange Network, for a given wallet address.

getConfig(tradingPostAddress)

Returns the configuration, from the latest genesis transaction, for a specific trading post.

getExchanges(address)

Returns a list of the latest five exchanges sent through the Verto Exchange Network, for a given wallet address.

paginateExchanges(address, cursor?)

Returns a list of exchanges (and the last cursor) sent through the Verto Exchange Network, for a given wallet address and optional cursor.

getOrderBook(tradingPostAddress)

Returns the order book of a trading post.

getPostStake(tradingPostAddress)

Returns the stake of a specific trading post.

getReputation(tradingPostAddress)

Returns the reputation of a specific trading post.

getTokens()

Returns a list of tokens supported by the Verto Exchange Network.

getTPTokens(tradingPostAddress)

Returns a list of tokens supported by a specific trading post.

getTradingPosts()

Returns a list of trading post wallet addresses on the Verto Exchange Network.

getTransactions(address)

Returns a list of the latest five transactions for a given wallet address.

recommendPost()

Returns a recommended trading post address to trade with. Note: Uses a weighted random on reputations.

price(contractID)

Returns a JSON object of prices and dates corresponding to each of those prices. Note: You must pass in a valid PST contract ID.

latestPrice(contractID)

Related to price(), returns the price for the current day. Note: You must pass in a valid PST contract ID.

volume(contractID)

Returns a JSON object of volumes and dates corresponding to each of those volumes. Note: You must pass in a valid PST contract ID.

latestVolume(contractID)

Related to volume(), returns the volume for the current day. Note: You must pass in a valid PST contract ID.

createOrder(orderType, amount, pstContractID, tradingPost, rate?)

Returns a list of transactions & AR/PST prices for initiating the trades.

It also validates to ensure the wallet associated with the keyfile, has enough AR/PST amounts to make the trade.

  • orderType
    • "buy" or "sell"
    • Type: string
  • amount
    • The amount of currency you are inputting. Note: If you are selling, the amount must be an integer.
    • Type: number
  • pstContractID
    • The PST you are looking to buy, or the PST you are selling.
    • Type: string
  • tradingPost
    • The wallet address of the trading post you are using.
    • Type: string
  • rate?
    • The rate (in units of AR/PST) that you wish to sell at. Note: This field is only necessary if you are selling.
    • Type: number

sendOrder(txs)

Accepts an array of Arweave transactions and subsequently signs & sends each using the configured keyfile.

Special Thanks

License

The code contained within this repository is licensed under the MIT license. See ./LICENSE for more information.

0.10.5

3 years ago

0.10.2

3 years ago

0.10.3

3 years ago

0.10.4

3 years ago

0.10.1

3 years ago

0.9.12

3 years ago

0.9.11

3 years ago

0.10.0

3 years ago

0.9.10

3 years ago

0.9.8

3 years ago

0.9.9

3 years ago

0.9.7

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.5.0-beta

4 years ago

0.5.0-alpha

4 years ago

0.4.0-alpha.9

4 years ago

0.4.0-alpha.8

4 years ago

0.4.0-alpha.7

4 years ago

0.4.0-alpha.6

4 years ago

0.4.0-alpha.5

4 years ago

0.4.0-alpha.4

4 years ago

0.4.0-alpha.3

4 years ago

0.4.0-alpha.2

4 years ago

0.4.0-alpha.1

4 years ago

0.4.0-alpha

4 years ago

0.3.0-alpha.6

4 years ago

0.3.0-alpha.4

4 years ago

0.3.0-alpha.5

4 years ago

0.3.0-alpha.3

4 years ago

0.3.0-alpha.2

4 years ago

0.3.0-alpha

4 years ago

0.3.0-alpha.1

4 years ago

0.2.0-alpha.1

4 years ago

0.2.0-alpha

4 years ago

0.1.0-alpha.9

4 years ago

0.1.0-alpha.8

4 years ago

0.1.0-alpha.7

4 years ago

0.1.0-alpha.5

4 years ago

0.1.0-alpha.6

4 years ago

0.1.0-alpha.4

4 years ago

0.1.0-alpha.3

4 years ago

0.1.0-alpha.2

4 years ago

0.1.0-alpha.1

4 years ago

0.1.0-alpha

4 years ago

0.0.1-alpha.1

4 years ago

0.0.1-alpha

4 years ago

0.0.0-alpha.1

4 years ago