Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EarnParameters

interface

EarnParameters

description

This interface defines the requirements for objects passed as inputs to Earn instances.

Use this interface whenever you are using the Earn contract.

Following inputs apply to the Earn contract class:

Input Type Required? Description
dappIdentifier string Required The dApp identifier, e.g. "elevate".
date string Required The date of the operation being rewarded, e.g. "20220829".
asset string Optional The identifier of the asset attached to this operation, e.g. "4ADBC6CEF9393B90".
amount number Optional The amount of asset(s) attached to this operation, e.g. 1.



example

Using the EarnParameters class

// creating earn contract inputs
const inputs = {
dappIdentifier: "my-cool-dapp",
date: "20220829",
} as EarnParameters;

// creating earn contract inputs with optionals
const inputs = {
dappIdentifier: "my-cool-dapp",
date: "20220829",
asset: "4ADBC6CEF9393B90", ("FIT")
amount: 1234,
} as EarnParameters;



Other links

Earn | Contract | Factory

since

v0.3.0

Hierarchy

Index

Properties

amount?: number

Contains the amount of asset(s) attached to this operations, i.e. this corresponds to the mosaic amount as presented in the resulting transfer transaction's mosaics field.

For the purpose of backwards compatibility, the amount input may be empty because previous versions of this contract (v0) did not include an amount of rewarded assets.

access

public

example

1

var

{number}

asset?: string

Contains the identifier of the asset attached to this operations, i.e. this corresponds to the mosaic identifier as presented in the resulting transfer transaction's mosaics field.

For the purpose of backwards compatibility, the asset input may be empty because previous versions of this contract (v0) did not include an amount of rewarded assets.

access

public

example

"4ADBC6CEF9393B90"

var

{string}

dappIdentifier: string

A human-readable dApp identifier, e.g. "ELEVATE".

Note that this field will be slugified using the Contract.dApp method before it is attached to the transfer transaction message.

access

public

example

"My Cool dApp"

var

{string}

date: string

Contains the date of the operation that is being rewarded, i.e. this corresponds to the the date as presented in the operation details and can also be different than the transaction inclusion date.

Note that in a previous version of our dApps framework, this field used a date-format of YYYYMMDD. We permit the usage of such date values but we recommend that you use more detailed date values.

For the purpose of backwards compatibility, the date input may contain a date-format as listed below:

  • YYYYMMDD: e.g. "20220829"
  • YYYY-MM-DD: e.g. "2022-08-29"
access

public

example

"20220829"

var

{string}

Generated using TypeDoc