Skip to content

Latest commit

 

History

History
2474 lines (1803 loc) · 99.4 KB

api.md

File metadata and controls

2474 lines (1803 loc) · 99.4 KB

Modules

azimuth

Azimuth API

check

Contract checks, assertions, and verifications

claims

Claims API

contracts

Contracts API

delegatedSending

Delegated Sending

ecliptic

Ecliptic API

index

azimuth-js

polls

Polls API

txn

Transaction handling

utils

Utilities

Members

getCommitmentPromise.<Object>

Return the details of a commitment.

getRemainingStarsPromise.<Array.<Number>>

Return the list of stars that have been deposited into, but not yet withdrawn from a commitment.

getBatchesPromise.<Array.<Number>>

Return the configured sizes of the batches for the commitment.

verifyBalancePromise.<Bool>

Return whether the amount of stars deposited into the commitment checks out.

getStartTimePromise.<Number>

Return the timestamp at which the release was started.

getWithdrawnPromise.<Array.<Number>>

Return the amount of stars a participant has already withdrawn from each of their batches at the current time

getWithdrawLimitPromise.<Number>

Return the amount of stars a participant is allowed to withdraw from one of their batches at the current time.

getApprovedTransferPromise.<String>

Return the address this commitment can be transferred to.

getForfeitedPromise.<Array.<Bool>>

Return whether or not each of the batches have been forfeited at the current time.

approveCommitmentTransferPromise.<Object>

Approve the transfer of a commitment to another address.

transferCommitmentObject

Make an approved transfer of the specified commitment to the caller's address.

withdrawObject

Withdraw one star from a batch to the caller's address.

withdrawToObject

Withdraw one star from a batch to the specified address.

forfeitObject

Forfeit stars contained in a batch with missed deadline, and all after it.

analyzeConditionObject

Analyze a condition for satisfaction.

getBatchPromise.<Object>

Return the details of a batch.

getRemainingStarsPromise.<Array.<Number>>

Return the list of stars that have been deposited into, but not yet withdrawn from a batch.

verifyBalancePromise.<Bool>

Return whether the amount of stars deposited into the batch checks out.

getStartTimePromise.<Number>

Return the timestamp at which the release was started.

getWithdrawLimitPromise.<Number>

Return the amount of stars a participant is allowed to withdraw from their batch at the current time.

getApprovedTransferPromise.<String>

Return the address this batch can be transferred to.

approveBatchTransferObject

Approve the transfer of a batch to another address.

transferBatchObject

Make an approved transfer of the specified batch to the caller's address.

withdrawObject

Withdraw one star to the caller's address.

withdrawToObject

Withdraw one star to the specified address.

Functions

getConditionsState(contracts)Promise.<Object>

Return conditions configuration and state data.

azimuth

Azimuth API

azimuth~mainnet

The Azimuth contract's address on the Ethereum mainnet.

Unlike that of the Ecliptic, Polls, etc. contracts, the Azimuth contract's address never changes. It is also registered as 'azimuth.eth' on ENS.

Kind: inner constant of azimuth

azimuth~getSponsoring ⇒ Promise.<Array.<String>>

Get an array of all points the target point is sponsoring.

Kind: inner constant of azimuth
Returns: Promise.<Array.<String>> - The points being sponsored.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getSponsoringCount ⇒ Promise.<Number>

Get the number of points the target point is sponsoring.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The amount of points being sponsored.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getEscapeRequests ⇒ Promise.<Array.<Number>>

Get a list of points that are requesting escape to a sponsor.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - An array of points requesting escape

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getEscapeRequestsCount ⇒ Promise.<Number>

Get the number of points that are requesting escape to a sponsor.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The number of points requesting escape

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~owner ⇒ Promise.<String>

Get the azimuth contract owner.

Kind: inner constant of azimuth
Returns: Promise.<String> - The contract owner's address.

Param Type Description
contracts Object An Urbit contracts object.

azimuth~getOwnedPoints ⇒ Promise.<Array.<Number>>

Get the points that an address owns.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - An array of owned azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getOwnedPointCount ⇒ Promise.<Number>

Get a count of points owned by an address.

Kind: inner constant of azimuth
Returns: Promise.<Number> - Owned point count for the address.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getOwnedPointAtIndex ⇒ Promise.<Number>

Get the point at the given index of the array containing an owner's azimuth.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The point at the provided index.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.
index Number The index of the array.

azimuth~canManage ⇒ Promise.<Bool>

Check if an address can manage a point.

Kind: inner constant of azimuth
Returns: Promise.<Bool> - True if the address can manage the point, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String The manager's address.

azimuth~getManagerForCount ⇒ Promise.<Number>

Get a count of the points an address is managing.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The count of points being managed.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getManagerFor ⇒ Promise.<Array.<Number>>

Get the points an account is managing.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - The points being managed.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~isVotingProxy ⇒ Promise.<Bool>

Check if an address is a voting proxy for an owner.

Kind: inner constant of azimuth
Returns: Promise.<Bool> - True is voting proxy, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
address String The owner's address.
address String The voting proxy's address.

azimuth~canVoteAs ⇒ Promise.<Bool>

Check if an address can vote for a point.

Kind: inner constant of azimuth
Returns: Promise.<Bool> - True is the address can vote for the point, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String The target address.

azimuth~getVotingForCount ⇒ Promise.<Number>

Get a count of the points an address can vote for.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The count of points that can be voted for.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getVotingFor ⇒ Promise.<Array.<Number>>

Get the points an account is voting for.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - The points being voted for.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getSpawningForCount ⇒ Promise.<Number>

Get a count of the points an address is a spawn proxy for.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The count of azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getSpawningFor ⇒ Promise.<Array.<Number>>

Get the points an account is a spawn proxy for.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - The azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getTransferringForCount ⇒ Promise.<Number>

Get a count of the points an address is a transfer proxy for.

Kind: inner constant of azimuth
Returns: Promise.<Number> - The count of azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~getTransferringFor ⇒ Promise.<Array.<Number>>

Get the points an account is a transfer proxy for.

Kind: inner constant of azimuth
Returns: Promise.<Array.<Number>> - The azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String The target address.

azimuth~isOperator ⇒ Promise.<Bool>

Check if an address is an operator for another.

Kind: inner constant of azimuth
Returns: Promise.<Bool> - True is operator, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
address String The owner's address.
address String The operator's address.

azimuth~isOwner(contracts, point, address) ⇒ Promise.<Bool>

Check if an address is the owner of a point.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if owner of the point, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
address Number Owner's address.

azimuth~getOwner(contracts, point) ⇒ Promise.<Address>

Get the owner of a point.

Kind: inner method of azimuth
Returns: Promise.<Address> - The point's owner.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~isActive(contracts, point) ⇒ Promise.<Bool>

Check if a point is active.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if the point is active, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getKeys(contracts, point) ⇒ Promise.<Object>

Get the key configuration for a point.

Kind: inner method of azimuth
Returns: Promise.<Object> - The point's key configuration.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getKeyRevisionNumber(contracts, point) ⇒ Promise.<Number>

Get the key revision number of a point.

Kind: inner method of azimuth
Returns: Promise.<Number> - The point's key revision number.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~hasBeenLinked(contracts, point) ⇒ Promise.<Bool>

Check if a point has been booted.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if it has been booted, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~isLive(contracts, point) ⇒ Promise.<Bool>

Check if a point is live.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if the point is live, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getContinuityNumber(contracts, point) ⇒ Promise.<Number>

Get a point's continuity number.

Kind: inner method of azimuth
Returns: Promise.<Number> - The point's continuity number.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getSpawnCount(contracts, point) ⇒ Promise.<Number>

Get a point's spawn count.

Kind: inner method of azimuth
Returns: Promise.<Number> - The point's spawn count.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getSpawned(contracts, point) ⇒ Promise.<Array.<Number>>

Get an array of all child points the target point has spawned.

Kind: inner method of azimuth
Returns: Promise.<Array.<Number>> - The spawned points.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getSponsor(contracts, point) ⇒ Promise.<Number>

Get a point's sponsor.

Kind: inner method of azimuth
Returns: Promise.<Number> - The point's sponsor.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~hasSponsor(contracts, point) ⇒ Promise.<Bool>

Check if a point has a sponsor.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if the point has a sponsor, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~isSponsor(contracts, point, sponsor) ⇒ Promise.<Bool>

Check if a point is the sponsor of another.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if a sponsor, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
sponsor Number The sponsor's point number.

azimuth~isEscaping(contracts, point) ⇒ Promise.<Bool>

Check if a point is requesting escape.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if requesting escape, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getEscapeRequest(contracts, point) ⇒ Promise.<Number>

Get the sponsor that another point is requesting escape to.

Kind: inner method of azimuth
Returns: Promise.<Number> - The sponsor point number.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~isRequestingEscapeTo(contracts, point, sponsor) ⇒ Promise.<Bool>

Check if a point is requesting escape to another point.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if escape to sponsor requested, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
sponsor Number Sponsor's point number.

azimuth~isSpawnProxy(contracts, point, address) ⇒ Promise.<Bool>

Check if an address is a spawn proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if address is spawn proxy, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
address String Target address.

azimuth~getSpawnProxy(contracts, point) ⇒ Promise.<String>

Get the spawn proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<String> - The spawn proxy's address.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~isTransferProxy(contracts, point, address) ⇒ Promise.<Bool>

Check if an address is a transfer proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if the address is a transfer proxy, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
address String Target address.

azimuth~getTransferProxy(contracts, point) ⇒ Promise.<String>

Get the transfer proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<String> - The transfer proxy's address.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

azimuth~getPrefix(point) ⇒ Number

Calculate the prefix of a point.

Kind: inner method of azimuth
Returns: Number - The point's prefix.

Param Type Description
point Number Point number.

azimuth~getPointSize(point) ⇒ Number

Calculate the size of a point.

Kind: inner method of azimuth
Returns: Number - The point's size.

Param Type Description
point Number Point number.

azimuth~getPoint(contracts, point, what) ⇒ Promise.<Object>

Get a point object, given its point id.

Kind: inner method of azimuth
Returns: Promise.<Object> - A point object with the requested data.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
what string 'state', 'rights', defaults to 'both'

azimuth~getUnspawnedChildren(contracts, point) ⇒ Promise.<Array.<Number>>

Get a list of unspawned/spawnable points

Kind: inner method of azimuth
Returns: Promise.<Array.<Number>> - - Unspawned children of point

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

azimuth~getActivationBlock(contracts, point, minBlock, maxBlock) ⇒ Promise.<Number>

Get the block at which the point was activated. Returns zero if it hasn't been activated yet.

Kind: inner method of azimuth
Returns: Promise.<Number> - - Block of activation.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
minBlock Number (optional) Block to start search at. (Default 0.)
maxBlock Number (optional) Block to end search at. (Default latest.)

azimuth~isManagementProxy(contracts, point, address) ⇒ Promise.<Bool>

Check if an address is a management proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<Bool> - True if address is management proxy, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.
address String Target address.

azimuth~getManagementProxy(contracts, point) ⇒ Promise.<String>

Get the management proxy for a point.

Kind: inner method of azimuth
Returns: Promise.<String> - The management proxy's address.

Param Type Description
contracts Object An Urbit contracts object.
point Number | Object Point number or point object.

check

Contract checks, assertions, and verifications

check~isPoint(point) ⇒ Bool

Check if something is a point.

Kind: inner method of check
Returns: Bool - True if a point, false otherwise.

Param Type Description
point Number Point number.

check~isGalaxy(point) ⇒ Bool

Check if something is a galaxy.

Kind: inner method of check
Returns: Bool - True if a galaxy, false otherwise.

Param Type Description
point Number Point number.

check~isStar(point) ⇒ Bool

Check if something is a star.

Kind: inner method of check
Returns: Bool - True if a star, false otherwise.

Param Type Description
point Number Point number.

check~isPlanet(point) ⇒ Bool

Check if something is a planet.

Kind: inner method of check
Returns: Bool - True if a planet, false otherwise.

Param Type Description
point Number Point number.

check~isPrefix(point) ⇒ Bool

Check if a point is a prefix of another point.

Kind: inner method of check
Returns: Bool - True if a prefix, false otherwise.

Param Type Description
point Number Point number.

check~isChild(point) ⇒ Bool

Check if a point is a child of another point.

Kind: inner method of check
Returns: Bool - True if a child, false otherwise.

Param Type Description
point Number Point number.

check~pollIsActive(poll) ⇒ Bool

Check if a poll is active.

Kind: inner method of check
Returns: Bool - True if active, false otherwise.

Param Type Description
poll Object A poll object.

check~canStartPoll(poll) ⇒ Bool

Check if a poll can be started.

Kind: inner method of check
Returns: Bool - True if so, false otherwise.

Param Type Description
poll Object A poll object.

check~hasOwner(contracts, pointId) ⇒ Promise.<Bool>

Check if a point has an owner.

Kind: inner method of check
Returns: Promise.<Bool> - True if so, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.

check~isEclipticOwner(contracts, address) ⇒ Promise.<Bool>

Check if an address is the ecliptic owner.

Kind: inner method of check
Returns: Promise.<Bool> - True if so, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
address String Owner's address.

check~canCreateGalaxy(contracts, pointId, address) ⇒ Promise.<Object>

Check if an address can create the specified galaxy.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.
address String Target address.

check~canSpawn(contracts, pointId, address) ⇒ Promise.<Object>

Check if an address can spawn the given point.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.
address String Target address.

check~canSetSpawnProxy(contracts, pointId, address) ⇒ Promise.<Object>

Check if an address can set a spawn proxy for the given point.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.
address String Target address.

check~canTransferPoint(contracts, pointId, sender, target) ⇒ Promise.<Object>

Check if the sender address can send the provided point to the target address.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.
sender String Sender's address.
target String Target address.

check~canSetTransferProxy(contracts, pointId, address) ⇒ Promise.<Object>

Check if the address can set a transfer proxy for the point.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.
address String Target address.

check~canEscape(contracts, point, sponsor, address) ⇒ Promise.<Object>

Check if the target address can make a point escape to the given sponsor.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
sponsor Number Point number.
address String Target address.

check~checkActivePointOwner(contracts, point, address) ⇒ Promise.<Object>

Check if a point is active and the target address is its owner.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String Target address.

check~checkActivePointManager(contracts, point, address) ⇒ Promise.<Object>

Check if a point is active and the target address can manage it.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String Target address.

check~canConfigureKeys(contracts, point, address) ⇒ Promise.<Object>

Check if an address can configure public keys for a point.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String Target address.

check~canAdopt(contracts, escapee, address) ⇒ Promise.<Object>

Check if the target address can adopt the escapee as its new sponsor.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
escapee Number Escapee's point number.
address String Target address.

check~canReject(contracts, escapee, address) ⇒ Promise.<Object>

Check if the target address can reject the escapee's request to the given sponsor.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
escapee Number Escapee's point number.
address String Target address.

check~canDetach(contracts, point, address) ⇒ Promise.<Object>

Check if the target address can detach a point from its sponsor.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String Target address.

check~checkActivePointVoter(contracts, point, voter) ⇒ Promise.<Object>

Check if a point is active and an address can vote for it.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
voter String Target address.

check~canStartUpgradePoll(web3, contracts, galaxy, proposal, address) ⇒ Promise.<Object>

Check if a target address and point can initiate a upgrade poll at the given address.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
web3 Object A web3 object.
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal address.
address String Target address.

check~canStartDocumentPoll(contracts, galaxy, proposal, address) ⇒ Promise.<Object>

Check if a target address and point can initiate the given proposal.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal address.
address String Target address.

check~canCastUpgradeVote(contracts, galaxy, proposal, address) ⇒ Promise.<Object>

Check if a target address and point can vote on the proposal at the target address.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal address.
address String Target address.

check~canCastDocumentVote(contracts, galaxy, proposal, address) ⇒ Promise.<Object>

Check if a target address and point can vote on the proposal at the given address.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal address.
address String Target address.

check~canSetDnsDomains(contracts, address) ⇒ Promise.<Bool>

Check if the target address can set the DNS domains for the ecliptic.

Kind: inner method of check
Returns: Promise.<Bool> - True if so, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
address String Target address.

check~lsrCanWithdraw(contracts, address) ⇒ Promise.<Object>

Check if the address can withdraw a star from their batch at this moment.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

check~lsrCanTransferBatch(contracts, from, to) ⇒ Promise.<Object>

Check if the address can withdraw a star from their batch at this moment.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
from String The participant/registered address for the batch.
to String The intended new address of the participant.

check~csrCanWithdraw(contracts, address) ⇒ Promise.<Object>

Check if the address can withdraw a star from their commitment at this moment.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

check~csrCanTransferBatch(contracts, from, to) ⇒ Promise.<Object>

Check if the address can withdraw a star from their commitment at this moment.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
from String The participant/registered address for the commitment.
to String The intended new address of the participant.

check~csrCanForfeit(contracts, batch, address) ⇒ Promise.<Object>

Check if the address can forfeit their commitment starting at the batch.

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair.

Param Type Description
contracts Object An Urbit contracts object.
batch Number The batch they want to forfeit from.
address String The participant/registered address for the commitment.

check~canSetPoolSize(point, address) ⇒ Promise.<Object>

Check if the address can give invites to point

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair

Param Type Description
point Number Point number to give invites to
address String The caller address

check~canSendInvitePoint(as, point, to, address) ⇒ Promise.<Object>

Check if as can send point as an invite to to

Kind: inner method of check
Returns: Promise.<Object> - A result and reason pair

Param Type Description
as Number The point that would send the invite
point Number The point that would be sent as invite
to String The Ethereum address recipient of the invite
address String The caller address

claims

Claims API

contracts

Contracts API

contracts~initContracts(web3, addresses) ⇒ Object

Create a collection of Urbit contracts, given a web3 instance and their provided addresses.

Kind: inner method of contracts
Returns: Object - The initialised contracts.

Param Type Description
web3 Object A web3 instance.
addresses Object An addresses object. Must provide addresses for ecliptic, azimuth, and polls contracts, at those respective key names.

contracts~initContractsPartial(web3, azimuthAddress) ⇒ Object

Initialise as many Urbit contracts as possible, given a azimuth contract address.

Kind: inner method of contracts
Returns: Object - The initialised contracts.

Param Type Description
web3 Object A web3 instance.
azimuthAddress String An address to a azimuth contract.

delegatedSending

Delegated Sending

delegatedSending.pools ⇒ Promise.<Number>

Return the amount of invites left in the pool

Kind: static property of delegatedSending
Returns: Promise.<Number> - Number of invites remaining

Param Type Description
pool Number Pool number
prefix Number Invites from this prefix

delegatedSending.getInvited ⇒ Promise.<Array.<Number>>

Return the points invited by point

Kind: static property of delegatedSending
Returns: Promise.<Array.<Number>> - Points invited by point

Param Type Description
point Number Point number

delegatedSending.invitedBy ⇒ Promise.<Number>

Return the point that point was invited by

Kind: static property of delegatedSending
Returns: Promise.<Number> - The inviter point (0 if not invited)

Param Type Description
point Number Point number

delegatedSending.canSend ⇒ Promise.<Bool>

Returns true if as can send point, false otherwise

Kind: static property of delegatedSending
Returns: Promise.<Bool> - Whether as can send point

Param Type Description
as Number The inviter
point Number The point to send

delegatedSending.getPool ⇒ Promise.<Number>

Get the invite pool point belongs to

Kind: static property of delegatedSending
Returns: Promise.<Number> - Pool number

Param Type Description
point Number Point number

delegatedSending.getPoolStars ⇒ Promise.<Array.<Number>>

Get the stars that have put invites into the pool

Kind: static property of delegatedSending
Returns: Promise.<Array.<Number>> - Stars that touched the pool

Param Type Description
pool Number Pool number

delegatedSending.canReceive ⇒ Promise.<Bool>

Returns true if receipients is eligible to receive a point, false otherwise

Kind: static property of delegatedSending
Returns: Promise.<Bool> - Whether recipient can receive a point

Param Type Description
recipient String Ethereum address

delegatedSending.setPoolSize ⇒ Object

Give for (and their invite tree) access to size invites

Kind: static property of delegatedSending
Returns: Object - An unsigned transaction object

Param Type Description
as Number prefix to give invites as
for Number point to give invites to
size Number amount of invites to give

delegatedSending.sendPoint ⇒ Object

As as, send the point to to

Kind: static property of delegatedSending
Returns: Object - An unsigned transaction object

Param Type Description
as Number point to send the invite as
point Number the point to send as an invite
to String target Ethereum address

delegatedSending.getTotalUsableInvites(point) ⇒ Promise.<Number>

Returns the total amount of usable invites available to point. Invites are usable if the star they're associated with has its spawn proxy set to the Delegated Sending contract, and is still under its spawn limit.

Kind: static method of delegatedSending
Returns: Promise.<Number> - Total amount of invites

Param Type Description
point Number The point whose invites to count

delegatedSending.getPlanetsToSend(as, amount) ⇒ Promise.<Array.<Number>>

Generate a list of planets for as to send as invites NOTE that the returned list isn't guaranteed to contain exactly amount items, it may return fewer in cases where not enough invites are available, usable, or spawn limits are being hit

Kind: static method of delegatedSending
Returns: Promise.<Array.<Number>> - Pseudo-random list of planets that as can send

Param Type Description
as Number point to send the planets with
amount Number amount of planets to generate

ecliptic

Ecliptic API

ecliptic.owner ⇒ Promise.<String>

Get ecliptic contract owner.

Kind: static property of ecliptic
Returns: Promise.<String> - The owner address.

Param Type Description
contracts Object An Urbit contracts object.

ecliptic.balanceOf ⇒ Promise.<Number>

Get the amount of points owned by an address.

Kind: static property of ecliptic
Returns: Promise.<Number> - Number of azimuth.

Param Type Description
contracts Object An Urbit contracts object.
address String Owner's address.

ecliptic.ownerOf ⇒ Promise.<String>

Get the current owner of a point.

Kind: static property of ecliptic
Returns: Promise.<String> - Owner's address.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.

ecliptic.exists ⇒ Promise.<Bool>

Check if a point is active.

Kind: static property of ecliptic
Returns: Promise.<Bool> - true if point is active, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.

ecliptic.getApproved ⇒ Promise.<String>

Get the transfer proxy for a point.

Kind: static property of ecliptic
Returns: Promise.<String> - The transfer proxy's address.

Param Type Description
contracts Object An Urbit contracts object.
pointId Number Point number.

ecliptic.isApprovedForAll ⇒ Promise.<Bool>

Check if an address is an operator for an owner.

Kind: static property of ecliptic
Returns: Promise.<Bool> - true if 'operator' is an operator for 'owner'.

Param Type Description
contracts Object An Urbit contracts object.
owner String The owner's address.
operator String The operator's address.

ecliptic.getSpawnLimit ⇒ Promise.<Number>

Return the total number of children a point is allowed to spawn at some time.

Kind: static property of ecliptic
Returns: Promise.<Number> - The spawn limit.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
time Number Time (uint256).

ecliptic.canEscapeTo ⇒ Promise.<Bool>

Check if a point can escape to a sponsor.

Kind: static property of ecliptic
Returns: Promise.<Bool> - True if point can escape, false otherwise.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
sponsor Number Sponsor's point number.

ecliptic.safeTransferFrom ⇒ Object

Safely transfer a point between addresses (call recipient if it's a contract).

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
from String Sender's address.
to String Receiver's address.
pointId Number Point number.

ecliptic.transferFrom ⇒ Object

Transfer a point between addresses (without notifying recipient contract).

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
from String Sender's address.
to String Receiver's address.
pointId Number Point number.

ecliptic.approve ⇒ Object

Allow an address to transfer ownership of a point.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
approved String The approved address.
pointId Number Point number.

ecliptic.setApprovalForAll ⇒ Object

Allow or disallow an operator to transfer ownership of all points owned by the message sender.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
operator Address The operator's address.
approved Bool Whether the operator is approved or not.

ecliptic.setManagementProxy ⇒ Object

Configure the management address for a point owned by the message sender.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number The point to manage.
manager String The management address.

ecliptic.configureKeys ⇒ Object

Configure a point with Urbit public keys, incrementing the point's continuity number if needed.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
encryptionKey String The encryption key.
authenticationKey String The auth key.
cryptoSuiteVersion Number The crypto suite version.
discontinuous Bool True to increment the continuity number.

ecliptic.spawn ⇒ Object

Spawn a point, giving ownership of it to the target address.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number A point number.
target String The target address.

ecliptic.setSpawnProxy ⇒ Object

Give an address the right to spawn points with the given prefix.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
prefix Number A (prefix) point number.
address String The address to designate as a spawn proxy.

ecliptic.transferPoint ⇒ Object

Transfer a point to a target address, optionally clearing all permissions data and keys.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.
address String The target address.
reset Bool True to reset point's keys.

ecliptic.setTransferProxy ⇒ Object

Give an address the right to transfer the given point.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
prefix Number Point number.
address String The address to designate as a transfer proxy.

ecliptic.escape ⇒ Object

Request escape from 'point' to 'sponsor'.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number Escapee's point number.
sponsor Number Sponsor's point number.

ecliptic.cancelEscape ⇒ Object

Cancel the currently set escape for a point.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number Escapee's point number.

ecliptic.adopt ⇒ Object

As the sponsor, accept the escapee.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
escapee Number Escapee's point number.

ecliptic.reject ⇒ Object

As the sponsor, reject the escapee's escape request.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
escapee Number Escapee's point number.

ecliptic.detach ⇒ Object

As the sponsor, stop sponsoring the point.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

ecliptic.setVotingProxy ⇒ Object

Configure the voting proxy address for the galaxy.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number Point number.
proxy String The proxy's address.

ecliptic.startUpgradePoll ⇒ Object

As a galaxy, start a poll for the ecliptic upgrade proposal.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal Object The ecliptic upgrade proposal.

ecliptic.startDocumentPoll ⇒ Object

As a galaxy, start a poll for a proposal.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal document.

ecliptic.castUpgradeVote ⇒ Object

As a galaxy, cast a vote on the ecliptic upgrade proposal.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal Object The upgrade proposal.
vote Bool True if yes, false otherwise.

ecliptic.castDocumentVote ⇒ Object

As a galaxy, cast a vote on the proposal.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
proposal String The proposal document.
vote Bool True if yes, false otherwise.

ecliptic.updateUpgradePoll ⇒ Object

Check whether the proposal has achieved majority, upgrading to it if so.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
proposal Object The upgrade proposal.

ecliptic.updateDocumentPoll ⇒ Object

Check whether the proposal has achieved majority.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
proposal Object The proposal document.

ecliptic.createGalaxy ⇒ Object

Grant the target address ownership of the galaxy and register it for voting.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
galaxy Number A (galaxy) point number.
target String The target address.

ecliptic.setDnsDomains ⇒ Object

Set primary, secondary, adn tertiary DNS domains for the ecliptic.

Kind: static property of ecliptic
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
primary String Primary DNS address.
secondary String Secondary DNS address.
tertiary String Tertiary DNS address.

ecliptic.getSpawnsRemaining(contracts, point) ⇒ Promise.<Number>

Get the amount of children point can still spawn before hitting the limit.

Kind: static method of ecliptic
Returns: Promise.<Number> - The amount of children still spawnable from point.

Param Type Description
contracts Object An Urbit contracts object.
point Number Point number.

index

azimuth-js

polls

Polls API

txn

Transaction handling

txn~signTransaction(web3, tx, privateKey) ⇒ Promise.<Object>

Sign an unsigned transaction with the provided private key.

If tx.gas is undefined, it will be estimated. If tx.gasPrice is undefined, a default is used. If tx.nonce is undefined, Web3 will retrieve the next nonce. And if tx.chainId is undefined, Web3 fills it in.

Note that Web3 cannot fill in most of those blanks when not connected to a functioning node (i.e. "offline mode"), so those will have to be filled in by the UI or user prior to signing.

Kind: inner method of txn
Returns: Promise.<Object> - A signed transaction object with messageHash, v, r, s, and rawTransaction fields.

Param Type Description
web3 Web3 a web3 object.
tx Object an unsigned transaction.
privateKey Buffer a private key.

txn~sendSignedTransaction(web3, signedTx) ⇒ Promise

Forward a signed transaction to the blockchain.

Kind: inner method of txn

Param Type Description
web3 Web3 a web3 object.
signedTx Object a signed transaction.

utils

Utilities

utils~addressEquals(a1, a2) ⇒ Bool

Check if two addresses are equal.

Kind: inner method of utils
Returns: Bool - True if the addresses are equal, false otherwise.

Param Type Description
a1 String an Ethereum address.
a2 String an Ethereum address.

getCommitment ⇒ Promise.<Object>

Return the details of a commitment.

Kind: global variable
Returns: Promise.<Object> - A commitment object, with windup, rate, rateUnit, amount, withdrawn.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

getRemainingStars ⇒ Promise.<Array.<Number>>

Return the list of stars that have been deposited into, but not yet withdrawn from a commitment.

Kind: global variable
Returns: Promise.<Array.<Number>> - The stars left in the commitment.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

getBatches ⇒ Promise.<Array.<Number>>

Return the configured sizes of the batches for the commitment.

Kind: global variable
Returns: Promise.<Array.<Number>> - The batch sizes for the commitment.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

verifyBalance ⇒ Promise.<Bool>

Return whether the amount of stars deposited into the commitment checks out.

Kind: global variable
Returns: Promise.<Bool> - true if sufficient stars have been deposited.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

getStartTime ⇒ Promise.<Number>

Return the timestamp at which the release was started.

Kind: global variable
Returns: Promise.<Number> - A timestamp.

Param Type Description
contracts Object An Urbit contracts object.

getWithdrawn ⇒ Promise.<Array.<Number>>

Return the amount of stars a participant has already withdrawn from each of their batches at the current time

Kind: global variable
Returns: Promise.<Array.<Number>> - the number of stars already withdrawn for each batch.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

getWithdrawLimit ⇒ Promise.<Number>

Return the amount of stars a participant is allowed to withdraw from one of their batches at the current time.

Kind: global variable
Returns: Promise.<Number> - the withdraw limit.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.
batch Number The batch number to look up

getApprovedTransfer ⇒ Promise.<String>

Return the address this commitment can be transferred to.

Kind: global variable
Returns: Promise.<String> - The approved transfer address, 0x0 for none.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

getForfeited ⇒ Promise.<Array.<Bool>>

Return whether or not each of the batches have been forfeited at the current time.

Kind: global variable
Returns: Promise.<Array.<Bool>> - the number of stars already withdrawn for each batch.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the commitment.

approveCommitmentTransfer ⇒ Promise.<Object>

Approve the transfer of a commitment to another address.

Kind: global variable
Returns: Promise.<Object> - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
address String The address to transfer to.

transferCommitment ⇒ Object

Make an approved transfer of the specified commitment to the caller's address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
address String The address to transfer from.

withdraw ⇒ Object

Withdraw one star from a batch to the caller's address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
batch Number The batch number to withdraw from

withdrawTo ⇒ Object

Withdraw one star from a batch to the specified address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
batch Number The batch number
address String The address to withdraw to.

forfeit ⇒ Object

Forfeit stars contained in a batch with missed deadline, and all after it.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
batch Number The condition/batch to base forfeiture off.

analyzeCondition ⇒ Object

Analyze a condition for satisfaction.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
condition String The condition (index) to analyze.

getBatch ⇒ Promise.<Object>

Return the details of a batch.

Kind: global variable
Returns: Promise.<Object> - A batch object, with windup, rate, rateUnit, amount, withdrawn.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

getRemainingStars ⇒ Promise.<Array.<Number>>

Return the list of stars that have been deposited into, but not yet withdrawn from a batch.

Kind: global variable
Returns: Promise.<Array.<Number>> - The stars left in the batch.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

verifyBalance ⇒ Promise.<Bool>

Return whether the amount of stars deposited into the batch checks out.

Kind: global variable
Returns: Promise.<Bool> - true if sufficient stars have been deposited.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

getStartTime ⇒ Promise.<Number>

Return the timestamp at which the release was started.

Kind: global variable
Returns: Promise.<Number> - A timestamp.

Param Type Description
contracts Object An Urbit contracts object.

getWithdrawLimit ⇒ Promise.<Number>

Return the amount of stars a participant is allowed to withdraw from their batch at the current time.

Kind: global variable
Returns: Promise.<Number> - the withdraw limit.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

getApprovedTransfer ⇒ Promise.<String>

Return the address this batch can be transferred to.

Kind: global variable
Returns: Promise.<String> - The approved transfer address, 0x0 for none.

Param Type Description
contracts Object An Urbit contracts object.
address String The participant/registered address for the batch.

approveBatchTransfer ⇒ Object

Approve the transfer of a batch to another address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
address String The address to transfer to.

transferBatch ⇒ Object

Make an approved transfer of the specified batch to the caller's address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
address String The address to transfer from.

withdraw ⇒ Object

Withdraw one star to the caller's address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.

withdrawTo ⇒ Object

Withdraw one star to the specified address.

Kind: global variable
Returns: Object - An unsigned transaction object.

Param Type Description
contracts Object An Urbit contracts object.
address String The address to withdraw to.

getConditionsState(contracts) ⇒ Promise.<Object>

Return conditions configuration and state data.

Kind: global function
Returns: Promise.<Object> - An object containing conditions state, with { conditions, livelines, deadlines, timestamps } arrays.

Param Type Description
contracts Object An Urbit contracts object.