Skip to main content

Class: RequestNetwork#

"api/request-network".RequestNetwork

Entry point of the request-client.js library. Create requests, get requests, manipulate requests.

Hierarchy#

Constructors#

constructor#

+ new RequestNetwork(__namedParameters: { currencyManager: ICurrencyManager<unknown> ; dataAccess: IDataAccess ; decryptionProvider: IDecryptionProvider ; paymentOptions: Partial<PaymentNetworkOptions> ; signatureProvider: ISignatureProvider }): RequestNetwork

Defined in request-client.js/src/api/request-network.ts:40

Parameters:#

NameType
__namedParameters{ currencyManager: ICurrencyManager<unknown> ; dataAccess: IDataAccess ; decryptionProvider: IDecryptionProvider ; paymentOptions: Partial<PaymentNetworkOptions> ; signatureProvider: ISignatureProvider }

Returns: RequestNetwork

Properties#

advancedLogic#

Private advancedLogic: IAdvancedLogic

Defined in request-client.js/src/api/request-network.ts:37


contentData#

Private contentData: ContentDataExtension

Defined in request-client.js/src/api/request-network.ts:39


currencyManager#

Private currencyManager: ICurrencyManager

Defined in request-client.js/src/api/request-network.ts:40


paymentNetworkFactory#

paymentNetworkFactory: PaymentNetworkFactory

Defined in request-client.js/src/api/request-network.ts:32


requestLogic#

Private requestLogic: IRequestLogic

Defined in request-client.js/src/api/request-network.ts:35


supportedIdentities#

supportedIdentities: TYPE[] = Utils.identity.supportedIdentities

Defined in request-client.js/src/api/request-network.ts:33


transaction#

Private transaction: ITransactionManager

Defined in request-client.js/src/api/request-network.ts:36

Methods#

_createEncryptedRequest#

_createEncryptedRequest(parameters: ICreateRequestParameters, encryptionParams: IEncryptionParameters[]): Promise<Request>

Defined in request-client.js/src/api/request-network.ts:117

Creates an encrypted request.

Parameters:#

NameTypeDescription
parametersICreateRequestParametersParameters to create a request
encryptionParamsIEncryptionParameters[]Request encryption parameters

Returns: Promise<Request>

The created encrypted request


computeRequestId#

computeRequestId(parameters: ICreateRequestParameters): Promise<RequestLogicTypes.RequestId>

Defined in request-client.js/src/api/request-network.ts:158

Gets the ID of a request without creating it.

Parameters:#

NameType
parametersICreateRequestParameters

Returns: Promise<RequestLogicTypes.RequestId>

The requestId


createRequest#

createRequest(parameters: ICreateRequestParameters): Promise<Request>

Defined in request-client.js/src/api/request-network.ts:79

Creates a request.

Parameters:#

NameType
parametersICreateRequestParameters

Returns: Promise<Request>

The created request


fromIdentity#

fromIdentity(identity: IIdentity, updatedBetween?: ITimestampBoundaries, options?: { disableEvents?: boolean ; disablePaymentDetection?: boolean }): Promise<Request[]>

Defined in request-client.js/src/api/request-network.ts:214

Create an array of request instances from an identity

Parameters:#

NameTypeDescription
identityIIdentity-
updatedBetween?ITimestampBoundariesfilter the requests with time boundaries
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean }options

Returns: Promise<Request[]>

the Requests


fromMultipleIdentities#

fromMultipleIdentities(identities: IIdentity[], updatedBetween?: ITimestampBoundaries, options?: { disableEvents?: boolean ; disablePaymentDetection?: boolean }): Promise<Request[]>

Defined in request-client.js/src/api/request-network.ts:232

Create an array of request instances from multiple identities

Parameters:#

NameTypeDescription
identitiesIIdentity[]-
updatedBetween?ITimestampBoundariesfilter the requests with time boundaries
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean }-

Returns: Promise<Request[]>

the requests


fromMultipleTopics#

fromMultipleTopics(topics: any[], updatedBetween?: ITimestampBoundaries, options?: { disableEvents?: boolean ; disablePaymentDetection?: boolean }): Promise<Request[]>

Defined in request-client.js/src/api/request-network.ts:307

Create an array of request instances from a multiple topics

Parameters:#

NameTypeDescription
topicsany[]-
updatedBetween?ITimestampBoundariesfilter the requests with time boundaries
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean }options

Returns: Promise<Request[]>

the Requests


fromRequestId#

fromRequestId(requestId: RequestLogicTypes.RequestId, options?: { disableEvents?: boolean ; disablePaymentDetection?: boolean }): Promise<Request>

Defined in request-client.js/src/api/request-network.ts:172

Create a Request instance from an existing Request's ID

Parameters:#

NameTypeDescription
requestIdRequestLogicTypes.RequestIdThe ID of the Request
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean }options

Returns: Promise<Request>

the Request


fromTopic#

fromTopic(topic: any, updatedBetween?: ITimestampBoundaries, options?: { disableEvents?: boolean ; disablePaymentDetection?: boolean }): Promise<Request[]>

Defined in request-client.js/src/api/request-network.ts:255

Create an array of request instances from a topic

Parameters:#

NameTypeDescription
topicany-
updatedBetween?ITimestampBoundariesfilter the requests with time boundaries
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean }options

Returns: Promise<Request[]>

the Requests


getCurrency#

PrivategetCurrency(input: string | ICurrency): ICurrency

Defined in request-client.js/src/api/request-network.ts:356

Parameters:#

NameType
inputstring | ICurrency

Returns: ICurrency


prepareRequestParameters#

PrivateprepareRequestParameters(parameters: ICreateRequestParameters): Promise<{ paymentNetwork: IPaymentNetwork | null ; requestParameters: ICreateParameters ; topics: any[] }>

Defined in request-client.js/src/api/request-network.ts:372

A helper to validate and prepare the parameters of a request.

Parameters:#

NameTypeDescription
parametersICreateRequestParametersParameters to create a request

Returns: Promise<{ paymentNetwork: IPaymentNetwork | null ; requestParameters: ICreateParameters ; topics: any[] }>

the parameters, ready for request creation, the topics, and the paymentNetwork


validERC20Address#

PrivatevalidERC20Address(address: string): boolean

Defined in request-client.js/src/api/request-network.ts:445

Returns true if the address is a valid checksum address

Parameters:#

NameTypeDescription
addressstringThe address to validate

Returns: boolean

If the address is valid or not