1.2.1 • Published 4 years ago

metronome-sdk-status v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

metronome-sdk-status

Build Status Code Style Known Vulnerabilities

Auction and converter status functions for the Metronome SDK.

The status functions can be used as part of the Metronome SDK or standalone, providing the metronome-contracts to the constructor function.

Installation

Minimum requirement of node is v12

npm install metronome-sdk-status

Usage

As a standalone library

const Web3 = require('web3')
const MetronomeContracts = require('metronome-contracts')
const createMetronomeStatus = require('metronome-sdk-status')

const web3 = new Web3()
const metronomeContracts = new MetronomeContracts(web3)
const api = createMetronomeStatus(metronomeContracts)

api.getAuctionStatus().then(console.log)

API

createMetronomeStatus(contracts) ⇒ MetronomeStatusApi

Create functions to query the status of the Auctions and Autonomous Converter contracts.

Returns: MetronomeStatusApi - The status getters.

ParamTypeDescription
contractsPromise.<MetronomeContracts> | MetronomeContractsA promise or an instance of Metronome contracts.

createMetronomeStatus~getAuctionStatus(inMs) ⇒ Promise.<AuctionStatus>

Get the status of the Auctions contract.

Returns: Promise.<AuctionStatus> - The status.

ParamTypeDescription
inMsbooleanWhether or not to convert times from sec to ms.

createMetronomeStatus~getConverterStatus() ⇒ Promise.<AutonomousConverterStatus>

Get the status of the AutonomousConverter contract.

Returns: Promise.<AutonomousConverterStatus> - The status.

MetronomeContracts : Object

Properties

NameTypeDescription
AuctionsObjectThe Web3 instance of the contract.
AutonomousConverterObjectThe Web3 instance of the contract.

MetronomeStatusApi : Object

Properties

NameTypeDescription
getAuctionStatusfunctionGet the status of the Auctions contract.
getConverterStatusfunctionGet the status of the AutonomousConverter contract.

AuctionStatus : Object

An object representing the auction status.

Properties

NameTypeDescription
currAuctionstringThe auction number.
currentAuctionPricestringThe MET price.
currTickstringThe current tick.
dailyAuctionStartTimenumberThe daily auctions start time.
dailyMintablestringThe amount at the start of the auction.
genesisTimenumberThe ISA start time.
lastPurchasePricestringThe last purchase price.
lastPurchaseTimenumberThe last purchase time.
mintingstringThe coins available in the current auction.
nextAuctionTimenumberThe next auction start time.
totalMETstringThe total supply of MET.

AutonomousConverterStatus : Object

An object representing the autonomous converter status.

Properties

NameTypeDescription
currentConverterPricestringThe coins returned for 1 MET. The converter price returned is for informational purposes only as the conversion price will change depending on the amount sent and the contract's balance.
coinBalancestringThe contract's coins balance. I.e. ETH.
metBalancestringThe contract's MET balance.

License

MIT