Skip to content

Latest commit

 

History

History
47 lines (26 loc) · 5.99 KB

File metadata and controls

47 lines (26 loc) · 5.99 KB

IRequestDataWithEvents

Description

The request contents. Returned by waitForConfirmation(), getData() and many other methods.

Instance Methods

NameDescription
on()Event subscriber
emit()Event emitter

Inherited Properties

graph TD
  IRequest --> IRequestData
  IRequestData --> IRequestDataWithEvents
Loading

IRequestData

NameTypeRequired?Description
currencystringtrueThe currency in which the request is denominated.
metaIReturnMetafalseMetadata from the layer below (transaction manager), including ignored actions, if any.
balanceIBalanceWithEventsfalseThe balance object
contentDataobjectfalseArbitrary content data. Consider using rnf_invoice v0.0.3 from @requestnetwork/data-format package.
currencyInfoICurrencytrueAdditional info about the currency in which the request is denominated: type, value, and network
pendingIPendingRequestfalseShows recently submitted request contents that have not yet been persisted and indexed. Call waitForConfirmation().

IRequest

NameTypeRequired?Description
versionstringtrueThe Request Network protocol version
requestIdstringtrueThe ID of the request
creatorIIdentitytrueIdentity of the request creator
stateTypes.RequestLogic.STATEtrueThe state of the request
expectedAmountnumber | stringtrueThe requested amount
payeeIIdentityfalseIdentity of the payee. Not necessarily payment recipient address.
payerIIdentityfalseIdentity of the payer. Not necessarily payment sender address.
extensionsIExtensionStatestrueThe state of the extensions
extensionsDataany[]trueExtensions raw data
eventsIEvent[]trueHistorical list of actions that have occurred on the request (create, accept, cancel, etc.)
timestampnumber (Unix timestamp)trueTimestamp when request is created. User provided, so this is an agreement between payee and payer.
noncenumberfalseOptional nonce to differentiate identical requests.

Types and Interfaces

Types.RequestLogic.STATE

NameValue
PENDING'pending'
CREATED'created'
ACCEPTED'accepted'
CANCELED'canceled'

IBalanceWithEvents

NameTypeRequired?Description
balancestringfalseThe sum of all payments and refunds related to this request. If this is >= expectedAmount, then the request is paid in full.
eventsIPaymentNetworkEvent[]falseArray of payment events
errorIBalanceErrorfalseError occured while retrieiving payment events and calculating the balance
escrowEventsEscrowNetworkEvent[]falseArray of escrow events

IPaymentNetworkEvent

NameTypeRequired?Description
amountstringtrueThe amount of the detected payment
parametersTEventParametersfalseDepends on the Payment Network ID

ICurrency

NameTypeRequired?Description
typeTypes.RequestLogic.CURRENCYtrueCurrency type
valuestringtrue

Depends on type.

  • ERC20 contract address '0x123'
  • Fiat symbol 'USD'
  • Native symbol 'ETH'
networkChainNamefalseThe chain on which the currency exists

Types.RequestLogic.CURRENCY

NameValue
ETH'ETH'Native (ETH, XDAI, etc.)
BTC'BTC'Bitcoin
ISO4217'ISO4217'Fiat (USD, EUR, etc.)
ERC20'ERC20'Non-native fungible currency (USDC, REQ, etc.)
ERC777'ERC777'Streamable fungible currency (USDCx, REQx, etc.)