- BaseContract
- ZapArbiter
- getArtifacts
- ZapBondage
- Curve
- ZapDispatch
- ZapProvider
- ZapRegistry
- Subscriber
- ZapToken
Parent Class to Dispatch, Bondage, Arbiter, Token, Registry class Provide access to contract instance and web3 provider instance
artifactsDir
(string | null)artifactName
stringnetworkId
(number | null)networkProvider
(any | null) : Ethereum network provider
Get Contract owner address
Returns Promise<string> owner's address of this contract instance
Returns Promise<string> owner's address of this contract instance
Extends BaseContract
Provides interface to Arbiter contract for managing subscriptions activities
Start subscription with a provider's endpoint
_a
provider
addressendpoint
stringendpoint_params
Array<string>blocks
number that subscription will lastprovider
number 's public keyfrom
address : subscribergas
number (optional)
Returns Promise<txid> txid of init transaction
_a
provider
addresssubscriber
addressendpoint
string
Returns Promise<string> Subscription Information
Returns Promise<txid> unsubscribe txid
Returns Promise<txid>
filters
Filter objectcallback
Function
filters
Filtercallback
Function
filter
Filtercallback
Function
Get Artifacts in this package
Returns any Artifacts
Extends BaseContract
Manage bondage activities
artifactsDir
anyartifactName
anynetworkId
anynetworkProvider
any
Bond number of Zap Token from a subscriber to a provider's endpoint, this requires approved Zap Token from subscriber to Bondage contract
_a
provider
addressendpoint
stringzapNum
number : number of Zap Token to bondfrom
address : subscribergas
number
Returns Promise<txid>
Unbond number of dots from a subscriber to a provider's endpoint
Returns Promise<txid>
Get number of dots that are bounded to a provider's endpoint for a subscriber
_a
subscriber
addressprovider
addressendpoint
string
Returns Promise<number> : number of bound dots
Calculate Zap required to bond number of dots to a provider's endpoint
Returns Promise<number> : number of Zap required to bond to use inquired dots
Calculate Bond's rate for a provider's endpoint
Returns Promise<number> : number of dots that can be used with inquired Zap Tokens
Get Zap Token cost of next inquired dots
Returns Promise<number> : Price of inquired dots
Get the amount of dots that have been issued for a provider's endpoint
_a
provider
addressendpoint
string
Returns Promise<number> : number of issued dots
Get amount of Zap tokens that are bound to a provider's endpoint
_a
provider
addressendpoint
string
Returns Promise<number> number of bound Zap tokens
Listen to all Bondage contract's events with optional filters
filters
Filter?callback
Function
Listen to Bonding events
filters
Filter?callback
Function
Listen to Unbonding events
filters
Filtercallback
Function
Listen to Escrow events
filters
Filtercallback
Function
Listen to Release Bound Zap Tokens events
filters
Filtercallback
Function
Turn constants, parts, dividers into curve's coef, power, fn, pieces
Get the price of a dot at a given totalBound
total
number bound dots
Returns number
Convert this curve constants, parts, dividers into Array of Bignumbers
Returns Array<Array<BigNumber>>
Extends BaseContract
Provides interface to Dispatch contract
Subscriber query data to a provider's endpoint
_a
provider
addressquery
stringendpoint
stringendpointParams
Array<string>onchainProvider
booleanonchainSubscriber
booleanfrom
addressgas
BigNumber
Returns Promise<txid> txid of query transaction
Provider responds to a query it received
_a
queryId
stringresponseParams
Array<string>dynamic
boolean number of responses stringfrom
address : providergas
BigNumber
Returns Promise<txid> txid of respond method
Listen for all events with filters
filters
Filtercallback
Function
Listen to Query Incoming events with filters
Listen to FUlFill Query when providers respond
Listen to Offchain responses from providers
Call ZapRegistry to create a new provider in Registry contract
Returns Promise<txid>
Initiate Curve for an endpoint
Returns Promise<txid>
Get title of this provider from Registry contract
Get public key of this provider from Registry contract
Get Curve of an owned endpoint
endpoint
string
Returns Promise<CurveType>
Get amount Zap bound to an owned endpoint
endpoint
string
Returns Promise<number> number of Zap Token bound
_a
endpoint
dots
Calculate number of dots that subscriber can use for inquired number of Zap Tokens
Returns Promise<number> number of dots subscriber can get
listen to new subscription events to this provider, managed by Arbiter contract
Returns Promise<void>
Listen to unsubscription events to this provider, managed by Arbiter contract
_a
subscriber
stringterminator
string : address that call unsubscribe, this can be subscriber or providerfromBlock
number
Returns Promise<void>
Listen to Queries events, managed by Dispatch contract
Returns Promise<void>
Respond to a query
Returns Promise<any>
Extends BaseContract
Manage Providers and Curves registration
artifactsDir
anynetworkId
anynetworkProvider
any
Add a brand new provider in Registry contract, distinguished by provider's address
_a
provider
string 's public_keyprovider
string 's titleendpoint
stringendpoint_params
Array<string>from
address : provider's addressgas
BigNumber
Returns Promise<txid>
Set Curve for a provider's endpoint Curve can only be set once per endpoint
_a
endpoint
stringcurve
CurveTypefrom
address : providergas
BigNumber
Returns Promise<txid>
Provider can set endpoint params for owned endpoint
Returns Promise<txid>
Get a provider's public key from Registry contract
provider
address
Get a provider's title from Registry contract
provider
address
Get a provider's endpoint's curve from Registry contract
Returns Promise<CurveType>
Get provider in index +1 in Registry contract
index
of next provider
Returns Promise<any>
Get endpoint params at index of a provider's endpoint
Returns Promise<string> endpoint's param at index
Listen to all Registry contract events with filters
filters
Filtercallback
Function
Returns Promise<void>
Listen to Registry contracts events for new providers
filters
Filtercallback
Promise<void>
Listen to Registry contract's events for new providers' curve
provider
addresscallback
Promise<void>
Returns Promise<any>
Returns Promise<any>
Returns Promise<any>
zapRequired
number
Extends BaseContract
ERC20 Tokens methods for Zap Tokens
Get Zap Token balance of address
address
address
Returns Promise<number> Zap balance
Transfer Zap Token
Returns Promise<txid>
Allocate Zap Token from Zap contract owner to an address
Returns Promise<txid>
Approve Zap Token to an address
Returns Promise<txid>