Options
All
  • Public
  • Public/Protected
  • All
Menu

Controls interaction and data fetching from the Untitled StableCoin System.

Hierarchy

  • StableCoinClient

Index

Constructors

constructor

  • new StableCoinClient(nodeUrl: string, network: Network, ovenRegistryAddress: string, minterAddress: string, ovenFactoryAddress: string, indexerURL?: string): StableCoinClient
  • Create a new StableCoinClient.

    TODO(keefertaylor): Consider fetching references to contracts in this constructor to avoid duplicate network requests later.

    Parameters

    • nodeUrl: string

      The URL of the node to connect to.

    • network: Network

      The Network the Node is connected to.

    • ovenRegistryAddress: string

      The address of the OvenRegistry

    • minterAddress: string

      The address of the Minter.

    • ovenFactoryAddress: string

      The address of the OvenFactory.

    • Optional indexerURL: string

      An indexer url to use for querying all ovens. Must be BCD compatible

    Returns StableCoinClient

Properties

Private Readonly tezos

tezos: TezosToolkit

A TezosToolkit

Methods

deployOven

  • deployOven(wallet: InMemorySigner | TempleWallet): Promise<TransactionWalletOperation | TransactionOperation>
  • Deploy a new Oven.

    Parameters

    • wallet: InMemorySigner | TempleWallet

      The wallet which will deploy the Oven.

    Returns Promise<TransactionWalletOperation | TransactionOperation>

    The result of deploying a new Oven.

getAllOvens

  • getAllOvens(): Promise<Oven[]>

getInterestData

  • getInterestData(time?: Date): Promise<InterestData>
  • Retrieve information about the interest rates in the system.

    Parameters

    • time: Date = ...

      The time to calculate the values at. Defaults to the current time.

    Returns Promise<InterestData>

    Interest rate data for the system.

getNetwork

  • getNetwork(): string

getOvenCount

  • getOvenCount(): Promise<number>
  • Retrieve the number of ovens in the system.

    Returns Promise<number>

    The number of ovens in the system.

getRequiredCollateralizationRatio

  • getRequiredCollateralizationRatio(): Promise<BigNumber>
  • Retrieve the collateralization rate.

    Returns Promise<BigNumber>

    A number representing the required collateralization fee with 18 digits of precision.

getSimpleStabilityFee

  • getSimpleStabilityFee(): Promise<BigNumber>
  • Retrieve the simple stability fee.

    This interest rate is the interest rate applied per period, NOT the APY. Please use getStabilityFeeApy instead.

    Returns Promise<BigNumber>

    A number representing the stability fee per period.

getStabilityFeeApy

  • getStabilityFeeApy(): Promise<Decimal>
  • Retrieve the stability fee.

    This returns the stability fee as an APY. Note that internally, linear approximation is used, so this number is not always accurate. See stablecoin documentation.

    Returns Promise<Decimal>

    A number representing a percentage fee with 18 decimals of precision.

ovensOwnedByAddress

  • ovensOwnedByAddress(address: string): Promise<string[]>
  • Retrieve an array of ovens owned by an address.

    Parameters

    • address: string

      The address to find Ovens owned by.

    Returns Promise<string[]>

    A list of Addresses of owned ovens.

Generated using TypeDoc