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: { bitcoinDetectionProvider: IBitcoinDetectionProvider ; currencies: CurrencyInput[] ; dataAccess: IDataAccess ; decryptionProvider: IDecryptionProvider ; signatureProvider: ISignatureProvider }): RequestNetwork

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

Parameters:#

NameType
__namedParameters{ bitcoinDetectionProvider: IBitcoinDetectionProvider ; currencies: CurrencyInput[] ; dataAccess: IDataAccess ; decryptionProvider: IDecryptionProvider ; signatureProvider: ISignatureProvider }

Returns: RequestNetwork

Properties#

advancedLogic#

Private advancedLogic: IAdvancedLogic

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


bitcoinDetectionProvider#

Optional bitcoinDetectionProvider: IBitcoinDetectionProvider

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


contentData#

Private contentData: ContentDataExtension

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


currencyManager#

Private currencyManager: ICurrencyManager

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


requestLogic#

Private requestLogic: IRequestLogic

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


supportedIdentities#

supportedIdentities: TYPE[] = Utils.identity.supportedIdentities

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


transaction#

Private transaction: ITransactionManager

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

Methods#

_createEncryptedRequest#

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

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

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:155

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:76

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:222

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:241

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:326

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 ; explorerApiKeys?: Record<string, string> }): Promise<Request>

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

Create a Request instance from an existing Request's ID

Parameters:#

NameTypeDescription
requestIdRequestLogicTypes.RequestIdThe ID of the Request
options?{ disableEvents?: boolean ; disablePaymentDetection?: boolean ; explorerApiKeys?: Record<string, string> }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:265

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:383

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:399

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:475

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