Home Reference Source

References

summary
public

F genRange3VoteData(votesArray: array): string

Prepares voteData for a Range3 ballot from an array of votes

public

F mkPacked(start: number, end: number, submissionBits: number): BN

Creates a packed copy of start and end times with submissionBits

public

F mkSignedBallotForProxy(ballotId: string, sequence: number, voteData: string, extra: string, privateKey: string, opts: object): object

Take the arguments and produce web3 data fitting the submitProxyVote method.

public

F mkSubmissionBits(toCombine: *): number

This combines flags into a finished submissionBits.

public

F verifySignedBallotForProxy(proxyVote: ProxyVote, opts: *): {verified: bool, address: EthAddress}

Verify a signed vote to be submitted via proxy as generated by mkSignedBallotForProxy

public

F getNetwork(networkId: *, chainId: *): *

public

F networkName(networkId: *): string

public

F ethSignHash(messageHash: *, privateKey: *): {messageHash: string, r: string, s: string, v: string}

Sign a message such that it can be verified with ecrecover.

public

F ethVerifySig(messageHash: string, v, r, s: string[]): {verified: bool, address: EthAddress}

Operates ecrecover over the provided signature

public

F hashMsgRaw(data: *): *

Like web3.eth.accounts.hashMessage without the envelope.

public

F checkBallotHashBSpec(ballotSpec: *, assertSpecHash: *): boolean

public

F checkBallotHashGBallot(ballotObject: *): *

public

F async checkIfAddressIsEditor(objectPattern: {"svNetwork": *}, objectPattern1: {"userAddress": *, "democHash": *}): *

public

F async getBackendAddress(objectPattern: {"index": *}): *

public

F async getBallotObjectFromIpfs(ballotSpecHash: *): *

public

F async getBallotObjectFromS3(archiveUrl: *, ballotSpecHash: *): *

public

F async getBallotSpec(archiveUrl: *, ballotSpecHash: *): *

public

F async getCommunityBallotPrice(objectPattern: {"payments": *}, democHash: *): *

public

F async getContractAddresses(objectPattern: {"svNetwork": *}): {"indexAddress": *, "backendAddress": *, "auxAddress": *, "lookupAddress": *, "resolverAddress": *, "communityAuctionAddress": *, "delegationAddress": *, "paymentsAddress": *}

Takes in the svNetwork object and returns all relevant addresses

public

F async getCurrentGasPrice(): {"safeLow": *, "average": *, "fast": *, "fastest": *}

public

F async getDemocBallots(objectPattern: {"svNetwork": *, "democHash": *}): *

public

F async getDemocInfo(objectPattern: {"backend": *, "democHash": *}): *

public

F async getDemocNthBallot(objectPattern: {"svNetwork": *}, democBallotInfo: *): *

public

F async initializeSvLight(svConfig: *): {"svConfig": *, "web3": *, "resolver": *, "index": *, "backend": *, "aux": *, "payments": *}

public

F async resolveEnsAddress(objectPattern: {"resolver": *}, ensName: *): *

public

F async weiToCents(objectPattern: {"payments": *}, wei: *): *

public

This will take an Ethereum hex string (or a normal hex string) and output a normal hex string (no '0x' header) or throw an error on a bad hex string.

public

F ethAddrEq(addr1: string, addr2: string): bool

This compares ethereum addresses (taking into account case, etc)

public

This will convert a hex string to Base32 in the bech32 format WITHOUT a checksum.

public

V flags: {"USE_ETH": *, "USE_SIGNED": *, "USE_NO_ENC": *, "USE_ENC": *, "IS_BINDING": *, "IS_OFFICIAL": *, "USE_TESTING": *}

This object tracks the flags used for SV ballot boxes.

public
public
public