Hierarchy

  • default
    • Governance

Constructors

Properties

abi: any[]
address: string
bytecode: undefined | string
provider: Provider

Methods

  • Get the contract balance

    Returns Promise<bigint>

    the balance of the contract in satoshi

  • Get the Budget contract address

    Returns Promise<string>

    the EVM style address of the Budget contract

  • Perform calltocontract

    Parameters

    • method: string

      The contract method to call

    • args: any[]

      The arguments

    Returns Promise<undefined | Result>

    see Result

  • Get the current reward winner

    Returns Promise<string>

    the EVM style address of the reward winner

  • Get the DGP contract address

    Returns Promise<string>

    the EVM style address of the DGP contract

  • Enroll as a governor

    Parameters

    • amount: undefined | string = '7500000'
    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get receipts from a transaction

    Returns Promise<EventLogs>

    an EventLogs object

  • Get the current reward winner

    Returns Promise<string[]>

    the EVM style address of the reward winner

  • Get the current governor count

    Returns Promise<bigint>

    the count of governors currently

  • Get the governor from the mapping

    Parameters

    • governorAddress: string

      the EVM style address of the governor

    Returns Promise<Governor>

    the governor

  • Ping to stay enrolled

    Parameters

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Remove the next 2 inactive governors

    Parameters

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Perform sendtocontract

    Parameters

    • method: string

      The contract method to send to

    • args: any[]

      The arguments to use

    • Optionalvalue: string

      The amount to send to the contract

    • OptionalgasLimit: number

      The amount of gas units allowed

    • OptionalgasPrice: number

      The satoshi price per gas

    Returns Promise<{
        hash160: string;
        sender: string;
        txid: string;
    }>

    see Result

  • Unenroll from being governor

    Parameters

    • force: boolean
    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects