@celo/governance"proposals"ProposalBuilder

Class: ProposalBuilder

Builder class to construct proposals from JSON or transaction objects.

Hierarchy

  • ProposalBuilder

Index

Constructors

Properties

Methods

Constructors

constructor

+ new ProposalBuilder(kit: ContractKit, builders: Array‹function›, registryAdditions: RegistryAdditions): ProposalBuilder

Defined in proposals.ts:212

Parameters:

Name Type Default
kit ContractKit -
builders Array‹function› []
registryAdditions RegistryAdditions {}

Returns: ProposalBuilder

Properties

Readonly registryAdditions

registryAdditions: RegistryAdditions

Defined in proposals.ts:216

Methods

addJsonTx

addJsonTx(tx: ProposalTransactionJSON): number

Defined in proposals.ts:339

Parameters:

Name Type
tx ProposalTransactionJSON

Returns: number


addProxyRepointingTx

addProxyRepointingTx(contract: CeloContract, newImplementationAddress: string): void

Defined in proposals.ts:247

Adds a transaction to set the implementation on a proxy to the given address.

Parameters:

Name Type Description
contract CeloContract Celo contract name of the proxy which should have its implementation set.
newImplementationAddress string Address of the new contract implementation.

Returns: void


addTx

addTx(tx: CeloTransactionObject‹any›, params: Partial‹ProposalTxParams›): void

Defined in proposals.ts:273

Adds a Celo transaction to the list for proposal construction.

Parameters:

Name Type Default Description
tx CeloTransactionObject‹any› - A Celo transaction object to add to the proposal.
params Partial‹ProposalTxParams› {} Optional parameters for how the transaction should be executed.

Returns: void


addWeb3Tx

addWeb3Tx(tx: CeloTxObject‹any›, params: ProposalTxParams): number

Defined in proposals.ts:265

Adds a Web3 transaction to the list for proposal construction.

Parameters:

Name Type Description
tx CeloTxObject‹any› A Web3 transaction object to add to the proposal.
params ProposalTxParams Parameters for how the transaction should be executed.

Returns: number


build

build(): Promise‹ProposalTransaction[]›

Defined in proposals.ts:223

Build calls all of the added build steps and returns the final proposal.

Returns: Promise‹ProposalTransaction[]›

A constructed Proposal object (i.e. a list of ProposalTransaction)


fromJsonTx

fromJsonTx(tx: ProposalTransactionJSON): Promise‹ProposalTransaction›

Defined in proposals.ts:293

Parameters:

Name Type
tx ProposalTransactionJSON

Returns: Promise‹ProposalTransaction›


fromWeb3tx

fromWeb3tx(tx: CeloTxObject‹any›, params: ProposalTxParams): ProposalTransaction

Defined in proposals.ts:236

Converts a Web3 transaction into a proposal transaction object.

Parameters:

Name Type Description
tx CeloTxObject‹any› A Web3 transaction object to convert.
params ProposalTxParams Parameters for how the transaction should be executed.

Returns: ProposalTransaction


getRegistryAddition

getRegistryAddition(contract: CeloContract): string | undefined

Defined in proposals.ts:286

Parameters:

Name Type
contract CeloContract

Returns: string | undefined


isRegistered

isRegistered(contract: CeloContract): boolean

Defined in proposals.ts:289

Parameters:

Name Type
contract CeloContract

Returns: boolean


setRegistryAddition

setRegistryAddition(contract: CeloContract, address: string): string

Defined in proposals.ts:283

Parameters:

Name Type
contract CeloContract
address string

Returns: string