Hierarchy

  • default
    • MRXtoUSDOracle

Constructors

Properties

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

Methods

  • Get this contract balance

    Returns Promise<bigint>

    the satoshi balance of this contract

  • Perform calltocontract

    Parameters

    • method: string

      The contract method to call

    • args: any[]

      The arguments

    Returns Promise<undefined | Result>

    see Result

  • Return whether an address is a controller of this contract

    Parameters

    • address: string

      the EVM address to check

    Returns Promise<boolean>

    whether the address is a controller

  • Get receipts from a transaction

    Returns Promise<EventLogs>

    an EventLogs object

  • Return the last time as seconds since the unix epoch that the price was updated

    Returns Promise<bigint>

    the price in MRX satoshi per USD

  • Get the contract owner

    Returns Promise<string>

    the EVM style address of the owner of this contract

  • Return the price in MRX satoshi to reserve the name

    Parameters

    • name: string

      the name to be reserved

    • expiry: bigint

      the current expiry of the name

    • duration: bigint

      the duration to reserve the name

    Returns Promise<bigint>

    the price in MRX satoshi of the name

  • Return a price history chunk (roughly 1 per hour)

    Parameters

    • startIndex: bigint

      the current expiry of the name

    • chunkSize: bigint

      the duration to reserve the name

    Returns Promise<[value: bigint, blockNumber: bigint, timestamp: bigint][]>

    an array tuples of the price data

  • Returns the index of the last price submitted to the mapping

    Returns Promise<bigint>

  • Return past 24 price history entries (roughly 1 per hour)

    Returns Promise<[value: bigint, blockNumber: bigint, timestamp: bigint][]>

    an array tuples of the price data

  • Renounce ownership of the contract

    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

  • Sets the new price based on the 7 hour average of the price. Only executable by a controller

    Parameters

    • price: bigint

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the controller of the contract

    Parameters

    • controller: string

      the controller

    • isController: boolean

      whether they can control

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Set the price of MRX per USD

    Parameters

    • price: bigint

      the price in MRX satoshi

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Transfer ownership of this contract

    Parameters

    • address: string

      the EVM adddress of the receiver

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Returns the last time as seconds since the unix epoch the price was update

    Returns Promise<bigint>