Hierarchy

  • default
    • Budget

Constructors

  • Parameters

    • address: string
    • provider: Provider

    Returns Budget

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

  • Perform calltocontract

    Parameters

    • method: string

      The contract method to call

    • args: any[]

      The arguments

    Returns Promise<undefined | Result>

    see Result

  • Get the DGP contract address

    Returns Promise<string>

    the EVM style address of the DGP contract

  • Deposits MRX into the Budget contract

    Parameters

    • amount: undefined | string = '0'
    • 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 index of a specific proposal

    Parameters

    • proposalId: bigint

      the id of the proposal

    Returns Promise<bigint>

  • Get the Governance contract address

    Returns Promise<string>

    the EVM style address of the Governance contract

  • Get a proposal's vote status

    Parameters

    • proposalId: bigint

      the id of the proposal

    Returns Promise<Vote>

    the status of the vote

  • Get a specific proposal by id

    Parameters

    • proposalId: bigint

      the id of the proposal

    Returns Promise<Proposal>

    the propsal

  • 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

  • Settles the monthly budget

    Parameters

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

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Cast a vote for a proposal

    Parameters

    • proposalId: bigint

      the id of the proposal

    • vote: Vote

      the Vote to cast

    • gasLimit: undefined | number = 250000

    Returns Promise<Transaction>