1 | import http from 'http'
|
2 | import { KeyObject } from 'tls'
|
3 | declare namespace SDKStandardComponents {
|
4 |
|
5 |
|
6 |
|
7 | type TCurrency = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' |
|
8 | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' |
|
9 | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' |
|
10 | 'DJF' | 'DKK' | 'DOP' | 'DZD' |
|
11 | 'EGP' | 'ERN' | 'ETB' | 'EUR' |
|
12 | 'FJD' | 'FKP' |
|
13 | 'GBP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' |
|
14 | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' |
|
15 | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' |
|
16 | 'JEP' | 'JMD' | 'JOD' | 'JPY' |
|
17 | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' |
|
18 | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' |
|
19 | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' |
|
20 | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' |
|
21 | 'OMR' |
|
22 | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' |
|
23 | 'QAR' |
|
24 | 'RON' | 'RSD' | 'RUB' | 'RWF' |
|
25 | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SPL' | 'SRD' | 'STD' | 'SVC' | 'SYP' | 'SZL' |
|
26 | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TVD' | 'TWD' | 'TZS' |
|
27 | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' |
|
28 | 'VEF' | 'VND' | 'VUV' |
|
29 | 'WST' |
|
30 | 'XAF' | 'XCD' | 'XDR' | 'XOF' | 'XPF' |
|
31 | 'YER' |
|
32 | 'ZAR' | 'ZMW' | 'ZWD';
|
33 |
|
34 | type TAuthChannel = 'WEB' | 'OTP';
|
35 |
|
36 |
|
37 | type TParty = {
|
38 | partyIdInfo: {
|
39 | fspId: string;
|
40 | partyIdType: string;
|
41 | partyIdentifier: string;
|
42 | partySubIdentifier?: string;
|
43 | }
|
44 | merchantClassificationCode?: string;
|
45 | name?: string;
|
46 | personalInfo?: {
|
47 | complexName?: {
|
48 | firstName?: string;
|
49 | middleName?: string;
|
50 | lastName?: string;
|
51 | }
|
52 | dateOfBirth?: string
|
53 | };
|
54 | };
|
55 |
|
56 |
|
57 | type TMoney = {
|
58 | amount: string;
|
59 | currency: TCurrency;
|
60 | };
|
61 |
|
62 |
|
63 | type TGeoCode = {
|
64 | latitude: string;
|
65 | longitude: string;
|
66 | }
|
67 |
|
68 |
|
69 | type TExtensionList = {
|
70 | extension: Array<{
|
71 | key: string;
|
72 | value: string;
|
73 | }>
|
74 | }
|
75 |
|
76 |
|
77 | type TQuotesIDPutResponse = {
|
78 | transferAmount: TMoney;
|
79 | expiration: Date;
|
80 | ilpPacket: string;
|
81 | condition: string;
|
82 | payeeReceiveAmount?: TMoney;
|
83 | payeeFspFee?: TMoney;
|
84 | payeeFspCommission?: TMoney;
|
85 | geoCode?: TGeoCode;
|
86 | extensionList?: TExtensionList
|
87 | }
|
88 |
|
89 |
|
90 | type TErrorInformationObject = {
|
91 | errorInformation: TErrorInformation;
|
92 | }
|
93 |
|
94 |
|
95 | type TErrorInformation = {
|
96 | errorCode: string;
|
97 | errorDescription: string;
|
98 | extensionList?: TExtensionList;
|
99 | }
|
100 |
|
101 | type TCredential = {
|
102 | id: string | null;
|
103 | credentialType: 'FIDO';
|
104 | status: 'PENDING' | 'VERIFIED';
|
105 | challenge: {
|
106 | payload: string;
|
107 | signature: string | null;
|
108 | },
|
109 | payload: string | null;
|
110 | }
|
111 |
|
112 | type TCredentialScope = {
|
113 | actions: string[];
|
114 | accountId: string;
|
115 | }
|
116 |
|
117 |
|
118 | enum TAmountType {
|
119 | SEND = 'SEND',
|
120 | RECEIVE = 'RECEIVE',
|
121 | }
|
122 |
|
123 |
|
124 | type TResourceVersions = {
|
125 | [resource: string]: {
|
126 | contentVersion: string,
|
127 | acceptVersion: string
|
128 | }
|
129 | }
|
130 |
|
131 |
|
132 | type GenericRequestResponse = {
|
133 | statusCode: number;
|
134 | headers: any;
|
135 | data: Buffer;
|
136 | };
|
137 |
|
138 | type MojaloopRequestResponse = undefined;
|
139 | interface BaseRequestTLSConfig {
|
140 | mutualTLS: {
|
141 | enabled: boolean;
|
142 | };
|
143 | creds: {
|
144 | ca: string | Buffer | Array<string | Buffer>;
|
145 | cert: string | Buffer | Array<string | Buffer>;
|
146 | key?: string | Buffer | Array<Buffer | KeyObject>;
|
147 | }
|
148 | }
|
149 |
|
150 | type BaseRequestConfigType = {
|
151 | logger: Logger.Logger;
|
152 | tls: BaseRequestTLSConfig;
|
153 | dfspId: string;
|
154 | jwsSign: boolean;
|
155 | jwsSignPutParties?: boolean;
|
156 | jwsSigningKey?: Buffer;
|
157 | wso2Auth?: object;
|
158 | alsEndpoint?: string;
|
159 | peerEndpoint?: string;
|
160 | quotesEndpoint?: string;
|
161 | bulkQuotesEndpoint?: string;
|
162 | transfersEndpoint?: string;
|
163 | bulkTransfersEndpoint?: string;
|
164 | transactionRequestsEndpoint?: string;
|
165 | thirdpartyRequestsEndpoint?: string;
|
166 | resourceVersions?: TResourceVersions;
|
167 | }
|
168 |
|
169 |
|
170 | type PutConsentsRequest = {
|
171 | requestId: string;
|
172 | initiatorId: string;
|
173 | participantId: string;
|
174 | scopes: Array<{
|
175 | accountId: string;
|
176 | actions: Array<string>;
|
177 | }>;
|
178 | credential: TCredential;
|
179 | }
|
180 |
|
181 | type PostConsentsRequest = {
|
182 | id: string;
|
183 | requestId: string;
|
184 | initiatorId: string;
|
185 | participantId: string;
|
186 | scopes: TCredentialScope[];
|
187 | credential?: TCredential;
|
188 | }
|
189 |
|
190 | type PutConsentRequestsRequest = {
|
191 | initiatorId: string;
|
192 | authChannels: TAuthChannel[];
|
193 | scopes: TCredentialScope[];
|
194 | callbackUri: string;
|
195 | authUri: string | null;
|
196 | authToken: string;
|
197 | }
|
198 |
|
199 | type PostConsentRequestsRequest = {
|
200 | id: string;
|
201 | initiatorId: string;
|
202 | authChannels: TAuthChannel[];
|
203 | scopes: TCredentialScope[];
|
204 | callbackUri: string;
|
205 | }
|
206 |
|
207 | type PostAuthorizationsRequest = {
|
208 | transactionRequestId: string;
|
209 | authenticationType: 'U2F';
|
210 | retriesLeft: string;
|
211 | amount: TMoney;
|
212 | transactionId: string;
|
213 | quote: TQuotesIDPutResponse;
|
214 | }
|
215 |
|
216 | type AuthenticationType = 'OTP' | 'QRCODE' | 'U2F'
|
217 |
|
218 | type AuthenticationValue = {
|
219 | pinValue: string;
|
220 | counter: string;
|
221 | }
|
222 |
|
223 | type AuthenticationInfo = {
|
224 | authentication: AuthenticationType;
|
225 | authenticationValue: AuthenticationValue | string;
|
226 | }
|
227 |
|
228 | type AuthorizationResponse = 'ENTERED' | 'REJECTED' | 'RESEND';
|
229 |
|
230 | type PutAuthorizationRequest = {
|
231 | authenticationInfo: AuthenticationInfo;
|
232 | responseType: AuthorizationResponse;
|
233 | }
|
234 |
|
235 | type TransactionType = {
|
236 | scenario: string;
|
237 | initiator: string;
|
238 | initiatorType: string;
|
239 | }
|
240 | type PostThirdPartyRequestTransactionsRequest = {
|
241 | transactionRequestId: string;
|
242 | sourceAccountId: string;
|
243 | consentId: string;
|
244 | payee: TParty;
|
245 | payer: TParty;
|
246 | amountType: TAmountType;
|
247 | amount: TMoney;
|
248 | transactionType: TransactionType;
|
249 | expiration: string;
|
250 | }
|
251 |
|
252 | type PutThirdpartyRequestsTransactionsAuthorizationsRequest = {
|
253 | challenge: string;
|
254 | consentId: string;
|
255 | sourceAccountId: string;
|
256 | status: 'PENDING' | 'VERIFIED';
|
257 | value: string;
|
258 | }
|
259 |
|
260 | type PatchConsentsRequest = {
|
261 | status: 'REVOKED';
|
262 | revokedAt: string;
|
263 | }
|
264 |
|
265 | class BaseRequests {
|
266 | constructor(config: BaseRequestConfigType)
|
267 | }
|
268 |
|
269 | type PutThirdpartyRequestsTransactionsRequest = {
|
270 | transactionRequestId: string;
|
271 | transactionRequestState: 'RECEIVED' | 'PENDING' | 'ACCEPTED' | 'REJECTED';
|
272 | }
|
273 |
|
274 | type PostThirdpartyRequestsTransactionsAuthorizationsRequest = {
|
275 | challenge: string;
|
276 | consentId: string;
|
277 | sourceAccountId: string;
|
278 | status: 'PENDING' | 'VERIFIED';
|
279 | value: string;
|
280 | }
|
281 |
|
282 | type PostQuoteRequest = {
|
283 | quoteId: string;
|
284 | transactionId: string;
|
285 | transactionRequestId: string;
|
286 | payee: TParty;
|
287 | payer: TParty;
|
288 | amountType: TAmountType;
|
289 | amount: TMoney;
|
290 | transactionType: TransactionType;
|
291 | note: string;
|
292 | }
|
293 |
|
294 | |
295 |
|
296 |
|
297 |
|
298 |
|
299 | class ThirdpartyRequests extends BaseRequests {
|
300 | |
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 | patchConsents(
|
308 | consentId: string,
|
309 | consentBody: PatchConsentsRequest,
|
310 | destParticipantId: string
|
311 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
312 |
|
313 | |
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 | putConsents(
|
321 | consentId: string,
|
322 | consentBody: PutConsentsRequest,
|
323 | destParticipantId: string
|
324 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
325 |
|
326 | |
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 | putConsentsError(
|
334 | consentId: string,
|
335 | consentBody: TErrorInformationObject,
|
336 | destParticipantId: string
|
337 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
338 |
|
339 | |
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | postConsents(
|
346 | consentBody: PostConsentsRequest,
|
347 | destParticipantId: string
|
348 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
349 |
|
350 | |
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | putConsentRequests(
|
358 | consentRequestId: string,
|
359 | consentRequestBody: PutConsentRequestsRequest,
|
360 | destParticipantId: string
|
361 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
362 |
|
363 | |
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 | postConsentRequests(
|
370 | consentRequestBody: PostConsentRequestsRequest,
|
371 | destParticipantId: string
|
372 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
373 |
|
374 |
|
375 | |
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 | postAuthorizations(
|
384 | authorizationBody: PostAuthorizationsRequest,
|
385 | destParticipantId: string
|
386 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
387 |
|
388 | |
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 | getThirdpartyRequestsTransactions(
|
397 | transactionRequestId: string,
|
398 | destParticipantId: string
|
399 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
400 |
|
401 | |
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | postThirdpartyRequestsTransactions(
|
410 | thirdpartyRequestsTransactionsBody: PostThirdPartyRequestTransactionsRequest,
|
411 | destParticipantId: string
|
412 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
413 |
|
414 | |
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | putThirdpartyRequestsTransactions(
|
424 | thirdpartyRequestsTransactionsBody: PutThirdpartyRequestsTransactionsRequest,
|
425 | transactionRequestId: string,
|
426 | destParticipantId: string
|
427 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
428 |
|
429 | |
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | putThirdpartyRequestsTransactionsError(
|
439 | thirdpartyRequestsTransactionsBody: TErrorInformationObject,
|
440 | transactionRequestId: string,
|
441 | destParticipantId: string
|
442 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
443 |
|
444 | |
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 | postThirdpartyRequestsTransactionsAuthorizations(
|
454 | thirdpartyRequestsTransactionsBody: PostThirdpartyRequestsTransactionsAuthorizationsRequest,
|
455 | transactionRequestId: string,
|
456 | destParticipantId: string
|
457 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
458 |
|
459 | |
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 | putThirdpartyRequestsTransactionsAuthorizations(
|
469 | thirdpartyRequestsTransactionsBody: PutThirdpartyRequestsTransactionsAuthorizationsRequest,
|
470 | transactionRequestId: string,
|
471 | destParticipantId: string
|
472 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
473 |
|
474 | |
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | putThirdpartyRequestsTransactionsAuthorizationsError(
|
484 | thirdpartyRequestsTransactionsBody: TErrorInformationObject,
|
485 | transactionRequestId: string,
|
486 | destParticipantId: string
|
487 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
488 | }
|
489 |
|
490 | class MojaloopRequests extends BaseRequests {
|
491 | |
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 | getParties(
|
501 | idType: string,
|
502 | idValue: string,
|
503 | idSubValue?: string
|
504 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
505 |
|
506 | |
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 | putParties(
|
517 | idType: string,
|
518 | idValue: string,
|
519 | idSubValue: string | undefined,
|
520 | body: TParty,
|
521 | destFspId: string
|
522 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
523 |
|
524 | |
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 | putPartiesError(
|
535 | idType: string,
|
536 | idValue: string,
|
537 | idSubValue: string | undefined,
|
538 | error: TErrorInformationObject,
|
539 | destFspId: string
|
540 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
541 |
|
542 | |
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | postQuotes(
|
551 | quoteRequest: PostQuoteRequest,
|
552 | destParticipantId: string
|
553 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>;
|
554 |
|
555 | |
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | putAuthorizations(
|
564 | transactionRequestId: string,
|
565 | authorizationResponse: PutAuthorizationRequest,
|
566 | destFspId: string
|
567 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>
|
568 |
|
569 | |
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 | putAuthorizationsError(
|
578 | transactionRequestId: string,
|
579 | error: TErrorInformationObject,
|
580 | destFspId: string
|
581 | ): Promise<GenericRequestResponse | MojaloopRequestResponse>
|
582 |
|
583 | }
|
584 |
|
585 | interface WSO2AuthConfig {
|
586 | logger: Logger.Logger,
|
587 | tlsCreds?: {
|
588 | ca: string
|
589 | cert: string
|
590 | key: string
|
591 | },
|
592 | clientKey?: string
|
593 | clientSecret?: string
|
594 | tokenEndpoint?: string
|
595 | refreshSeconds?: number
|
596 | refreshRetrySeconds?: number
|
597 | staticToken?: string
|
598 | }
|
599 | |
600 |
|
601 |
|
602 |
|
603 | class WSO2Auth {
|
604 | constructor(config: WSO2AuthConfig)
|
605 |
|
606 | /**
|
607 | * @function getToken
|
608 | * @description returns the latest retrieved token
|
609 | * @returns {string} the latest token
|
610 | */
|
611 | getToken(): string
|
612 |
|
613 | |
614 |
|
615 |
|
616 |
|
617 |
|
618 | start(): void
|
619 |
|
620 | |
621 |
|
622 |
|
623 |
|
624 |
|
625 | stop(): void
|
626 | }
|
627 | namespace Logger {
|
628 | type Level = 'verbose' | 'debug' | 'warn' | 'error' | 'trace' | 'info' | 'fatal'
|
629 | type TimestampFormatter = (ts: Date) => string;
|
630 | type Stringify = (toBeStringified: unknown) => string;
|
631 | interface LoggerStringifyParams {
|
632 | ctx: unknown
|
633 | msg: unknown
|
634 | level: Level
|
635 | }
|
636 |
|
637 | type LoggerStringify = (params: LoggerStringifyParams) => string
|
638 |
|
639 |
|
640 | interface BuildStringifyParams {
|
641 | space?: number
|
642 | printTimestamp?: boolean
|
643 | timestampFmt?: TimestampFormatter
|
644 | stringify?: Stringify
|
645 | }
|
646 | type BuildStringify = (params: BuildStringifyParams) => LoggerStringify;
|
647 |
|
648 | function buildStringify(params: BuildStringifyParams): LoggerStringify
|
649 |
|
650 | interface LoggerOptions {
|
651 | allowContextOverwrite: boolean
|
652 | copy: (arg0: unknown) => unknown
|
653 | levels: Level[]
|
654 | }
|
655 |
|
656 | interface LoggerConstructorParams {
|
657 | ctx?: unknown
|
658 | stringify?: BuildStringify
|
659 | opts?: LoggerOptions
|
660 | }
|
661 |
|
662 | interface LoggerConfigureParams {
|
663 | stringify?: BuildStringify
|
664 | opts?: LoggerOptions
|
665 | }
|
666 |
|
667 | |
668 |
|
669 |
|
670 |
|
671 | class Logger {
|
672 | protected stringify: BuildStringify
|
673 | protected opts: LoggerOptions
|
674 |
|
675 | constructor(params?: LoggerConstructorParams)
|
676 |
|
677 | configure(params?: LoggerConfigureParams): void
|
678 |
|
679 | push(arg: unknown): Logger
|
680 | log(...args: unknown[]): void
|
681 |
|
682 | // default set of logging methods taken from default levels
|
683 | // if you want to use different log levels
|
684 | // this part of code will not work for you
|
685 | verbose(arg: unknown): void
|
686 | debug(arg: unknown): void
|
687 | warn(arg: unknown): void
|
688 | error(arg: unknown): void
|
689 | trace(arg: unknown): void
|
690 | info(arg: unknown): void
|
691 | fatal(arg: unknown): void
|
692 | }
|
693 | }
|
694 |
|
695 | enum RequestResponseType { ArrayBuffer, JSON, Text, Stream }
|
696 | type RequestMethod = 'GET' | 'PATCH' | 'POST' | 'PUT'
|
697 | export type RequestBody = string | Buffer | Uint8Array
|
698 | interface RequestOptions {
|
699 | method: RequestMethod
|
700 | uri: string
|
701 | agent: http.Agent
|
702 | qs?: string
|
703 | headers?: Record<string, string>
|
704 |
|
705 |
|
706 |
|
707 | body? : RequestBody
|
708 | responseType?: RequestResponseType
|
709 | }
|
710 | interface RequestResponse<Data = string | Buffer | Record<string, unknown>>{
|
711 | statusCode: number
|
712 | headers?: Record<string, string>
|
713 | data: Data
|
714 | }
|
715 |
|
716 | function request<Data>(opts: RequestOptions): Promise<RequestResponse<Data>>
|
717 |
|
718 | namespace request {
|
719 | let ResponseType: RequestResponseType
|
720 | }
|
721 |
|
722 | namespace requests {
|
723 | namespace common {
|
724 | function bodyStringifier(arg0: unknown): string | Buffer
|
725 | }
|
726 | }
|
727 |
|
728 | namespace Errors {
|
729 | interface MojaloopApiErrorCode {
|
730 | code: string
|
731 | message: string
|
732 | httpStatusCode?: number
|
733 | }
|
734 |
|
735 | interface MojaloopApiErrorObject {
|
736 | errorInformation: {
|
737 | errorCode: string
|
738 | errorDescription: string
|
739 | extensionList: unknown[]
|
740 | }
|
741 | }
|
742 | interface MojaloopApiErrorCodesEnum {
|
743 |
|
744 | COMMUNICATION_ERROR: MojaloopApiErrorCode
|
745 | DESTINATION_COMMUNICATION_ERROR: MojaloopApiErrorCode
|
746 |
|
747 |
|
748 | SERVER_ERROR: MojaloopApiErrorCode
|
749 | INTERNAL_SERVER_ERROR: MojaloopApiErrorCode
|
750 | NOT_IMPLEMENTED: MojaloopApiErrorCode
|
751 | SERVICE_CURRENTLY_UNAVAILABLE: MojaloopApiErrorCode
|
752 | SERVER_TIMED_OUT: MojaloopApiErrorCode
|
753 | SERVER_BUSY: MojaloopApiErrorCode
|
754 |
|
755 |
|
756 | METHOD_NOT_ALLOWED: MojaloopApiErrorCode
|
757 | CLIENT_ERROR: MojaloopApiErrorCode
|
758 | UNACCEPTABLE_VERSION: MojaloopApiErrorCode
|
759 | UNKNOWN_URI: MojaloopApiErrorCode
|
760 | ADD_PARTY_INFO_ERROR: MojaloopApiErrorCode
|
761 | DELETE_PARTY_INFO_ERROR: MojaloopApiErrorCode,
|
762 |
|
763 |
|
764 | VALIDATION_ERROR: MojaloopApiErrorCode
|
765 | MALFORMED_SYNTAX: MojaloopApiErrorCode
|
766 | MISSING_ELEMENT: MojaloopApiErrorCode
|
767 | TOO_MANY_ELEMENTS: MojaloopApiErrorCode
|
768 | TOO_LARGE_PAYLOAD: MojaloopApiErrorCode
|
769 | INVALID_SIGNATURE: MojaloopApiErrorCode
|
770 | MODIFIED_REQUEST: MojaloopApiErrorCode
|
771 | MISSING_MANDATORY_EXTENSION: MojaloopApiErrorCode
|
772 |
|
773 |
|
774 | ID_NOT_FOUND: MojaloopApiErrorCode
|
775 | DESTINATION_FSP_ERROR: MojaloopApiErrorCode
|
776 | PAYER_FSP_ID_NOT_FOUND: MojaloopApiErrorCode
|
777 | PAYEE_FSP_ID_NOT_FOUND: MojaloopApiErrorCode
|
778 | PARTY_NOT_FOUND: MojaloopApiErrorCode
|
779 | QUOTE_ID_NOT_FOUND: MojaloopApiErrorCode
|
780 | TXN_REQUEST_ID_NOT_FOUND: MojaloopApiErrorCode
|
781 | TXN_ID_NOT_FOUND: MojaloopApiErrorCode
|
782 | TRANSFER_ID_NOT_FOUND: MojaloopApiErrorCode
|
783 | BULK_QUOTE_ID_NOT_FOUND: MojaloopApiErrorCode
|
784 | BULK_TRANSFER_ID_NOT_FOUND: MojaloopApiErrorCode
|
785 |
|
786 |
|
787 | EXPIRED_ERROR: MojaloopApiErrorCode
|
788 | TXN_REQUEST_EXPIRED: MojaloopApiErrorCode
|
789 | QUOTE_EXPIRED: MojaloopApiErrorCode
|
790 | TRANSFER_EXPIRED: MojaloopApiErrorCode
|
791 |
|
792 |
|
793 | PAYER_ERROR: MojaloopApiErrorCode
|
794 | PAYER_FSP_INSUFFICIENT_LIQUIDITY: MojaloopApiErrorCode
|
795 | PAYER_REJECTION: MojaloopApiErrorCode
|
796 | PAYER_REJECTED_TXN_REQUEST: MojaloopApiErrorCode
|
797 | PAYER_FSP_UNSUPPORTED_TXN_TYPE: MojaloopApiErrorCode
|
798 | PAYER_UNSUPPORTED_CURRENCY: MojaloopApiErrorCode
|
799 | PAYER_LIMIT_ERROR: MojaloopApiErrorCode
|
800 | PAYER_PERMISSION_ERROR: MojaloopApiErrorCode
|
801 | PAYER_BLOCKED_ERROR: MojaloopApiErrorCode
|
802 |
|
803 |
|
804 | PAYEE_ERROR: MojaloopApiErrorCode
|
805 | PAYEE_FSP_INSUFFICIENT_LIQUIDITY: MojaloopApiErrorCode
|
806 | PAYEE_REJECTION: MojaloopApiErrorCode
|
807 | PAYEE_REJECTED_QUOTE: MojaloopApiErrorCode
|
808 | PAYEE_FSP_UNSUPPORTED_TXN_TYPE: MojaloopApiErrorCode
|
809 | PAYEE_FSP_REJECTED_QUOTE: MojaloopApiErrorCode
|
810 | PAYEE_REJECTED_TXN: MojaloopApiErrorCode
|
811 | PAYEE_FSP_REJECTED_TXN: MojaloopApiErrorCode
|
812 | PAYEE_UNSUPPORTED_CURRENCY: MojaloopApiErrorCode
|
813 | PAYEE_LIMIT_ERROR: MojaloopApiErrorCode
|
814 | PAYEE_PERMISSION_ERROR: MojaloopApiErrorCode
|
815 | GENERIC_PAYEE_BLOCKED_ERROR: MojaloopApiErrorCode
|
816 | }
|
817 |
|
818 | const MojaloopApiErrorCodes: MojaloopApiErrorCodesEnum
|
819 |
|
820 | function MojaloopApiErrorCodeFromCode(code: string): MojaloopApiErrorCode
|
821 |
|
822 | function MojaloopApiErrorObjectFromCode(code: MojaloopApiErrorCode): MojaloopApiErrorObject
|
823 |
|
824 | interface FullErrorObject {
|
825 | message: string
|
826 | replyTo: string
|
827 | apiErrorCode: MojaloopApiErrorCode
|
828 | extensions?: unknown
|
829 | cause?: string
|
830 | }
|
831 | class MojaloopFSPIOPError extends Error {
|
832 | public cause: Error | unknown
|
833 | public message: string
|
834 | public replyTo: string
|
835 | public apiErrorCode: MojaloopApiErrorCode
|
836 | public extensions: unknown
|
837 |
|
838 | constructor(
|
839 | cause: Error | unknown,
|
840 | message: string,
|
841 | replyTo: string,
|
842 | apiErrorCode: MojaloopApiErrorCode,
|
843 | extensions?: unknown
|
844 | )
|
845 |
|
846 | toApiErrorObject(): MojaloopApiErrorObject
|
847 | toFullErrorObject(): FullErrorObject
|
848 | toString(): string
|
849 | }
|
850 | }
|
851 | }
|
852 |
|
853 | export = SDKStandardComponents
|