@nomba/node-sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +550 -2
  3. package/dist/index.d.ts +86 -0
  4. package/dist/index.js +53 -0
  5. package/dist/interfaces/http/IHttpClient.d.ts +17 -0
  6. package/dist/interfaces/http/IHttpClient.js +5 -0
  7. package/dist/interfaces/http/index.d.ts +1 -0
  8. package/dist/interfaces/http/index.js +1 -0
  9. package/dist/interfaces/v1/accounts/IAccountsService.d.ts +24 -0
  10. package/dist/interfaces/v1/accounts/IAccountsService.js +5 -0
  11. package/dist/interfaces/v1/accounts/index.d.ts +1 -0
  12. package/dist/interfaces/v1/accounts/index.js +1 -0
  13. package/dist/interfaces/v1/betting/IBettingService.d.ts +11 -0
  14. package/dist/interfaces/v1/betting/IBettingService.js +5 -0
  15. package/dist/interfaces/v1/betting/index.d.ts +1 -0
  16. package/dist/interfaces/v1/betting/index.js +1 -0
  17. package/dist/interfaces/v1/cable/ICableService.d.ts +11 -0
  18. package/dist/interfaces/v1/cable/ICableService.js +5 -0
  19. package/dist/interfaces/v1/cable/index.d.ts +1 -0
  20. package/dist/interfaces/v1/cable/index.js +1 -0
  21. package/dist/interfaces/v1/charge/IChargeService.d.ts +33 -0
  22. package/dist/interfaces/v1/charge/IChargeService.js +5 -0
  23. package/dist/interfaces/v1/charge/index.d.ts +1 -0
  24. package/dist/interfaces/v1/charge/index.js +1 -0
  25. package/dist/interfaces/v1/checkout/ICheckoutService.d.ts +30 -0
  26. package/dist/interfaces/v1/checkout/ICheckoutService.js +5 -0
  27. package/dist/interfaces/v1/checkout/index.d.ts +1 -0
  28. package/dist/interfaces/v1/checkout/index.js +1 -0
  29. package/dist/interfaces/v1/data/IDataService.d.ts +9 -0
  30. package/dist/interfaces/v1/data/IDataService.js +5 -0
  31. package/dist/interfaces/v1/data/index.d.ts +1 -0
  32. package/dist/interfaces/v1/data/index.js +1 -0
  33. package/dist/interfaces/v1/direct-debits/IDirectDebitsService.d.ts +31 -0
  34. package/dist/interfaces/v1/direct-debits/IDirectDebitsService.js +5 -0
  35. package/dist/interfaces/v1/direct-debits/index.d.ts +1 -0
  36. package/dist/interfaces/v1/direct-debits/index.js +1 -0
  37. package/dist/interfaces/v1/electricity/IElectricityService.d.ts +11 -0
  38. package/dist/interfaces/v1/electricity/IElectricityService.js +5 -0
  39. package/dist/interfaces/v1/electricity/index.d.ts +1 -0
  40. package/dist/interfaces/v1/electricity/index.js +1 -0
  41. package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.d.ts +14 -0
  42. package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.js +5 -0
  43. package/dist/interfaces/v1/globals/collections/index.d.ts +1 -0
  44. package/dist/interfaces/v1/globals/collections/index.js +1 -0
  45. package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.d.ts +30 -0
  46. package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.js +5 -0
  47. package/dist/interfaces/v1/globals/payouts/index.d.ts +1 -0
  48. package/dist/interfaces/v1/globals/payouts/index.js +1 -0
  49. package/dist/interfaces/v1/requery/IRequeryService.d.ts +17 -0
  50. package/dist/interfaces/v1/requery/IRequeryService.js +5 -0
  51. package/dist/interfaces/v1/requery/index.d.ts +1 -0
  52. package/dist/interfaces/v1/requery/index.js +1 -0
  53. package/dist/interfaces/v1/terminals/ITerminalsService.d.ts +18 -0
  54. package/dist/interfaces/v1/terminals/ITerminalsService.js +5 -0
  55. package/dist/interfaces/v1/terminals/index.d.ts +1 -0
  56. package/dist/interfaces/v1/terminals/index.js +1 -0
  57. package/dist/interfaces/v1/transactions/ITransactionsService.d.ts +34 -0
  58. package/dist/interfaces/v1/transactions/ITransactionsService.js +5 -0
  59. package/dist/interfaces/v1/transactions/index.d.ts +1 -0
  60. package/dist/interfaces/v1/transactions/index.js +1 -0
  61. package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.d.ts +27 -0
  62. package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.js +5 -0
  63. package/dist/interfaces/v1/virtual-accounts/index.d.ts +1 -0
  64. package/dist/interfaces/v1/virtual-accounts/index.js +1 -0
  65. package/dist/interfaces/v1/webhooks/IWebhooksService.d.ts +21 -0
  66. package/dist/interfaces/v1/webhooks/IWebhooksService.js +5 -0
  67. package/dist/interfaces/v1/webhooks/index.d.ts +1 -0
  68. package/dist/interfaces/v1/webhooks/index.js +1 -0
  69. package/dist/interfaces/v2/airtime/IAirtimeV2Service.d.ts +12 -0
  70. package/dist/interfaces/v2/airtime/IAirtimeV2Service.js +5 -0
  71. package/dist/interfaces/v2/airtime/index.d.ts +1 -0
  72. package/dist/interfaces/v2/airtime/index.js +1 -0
  73. package/dist/interfaces/v2/betting/IBettingV2Service.d.ts +12 -0
  74. package/dist/interfaces/v2/betting/IBettingV2Service.js +5 -0
  75. package/dist/interfaces/v2/betting/index.d.ts +1 -0
  76. package/dist/interfaces/v2/betting/index.js +1 -0
  77. package/dist/interfaces/v2/cable/ICableV2Service.d.ts +12 -0
  78. package/dist/interfaces/v2/cable/ICableV2Service.js +5 -0
  79. package/dist/interfaces/v2/cable/index.d.ts +1 -0
  80. package/dist/interfaces/v2/cable/index.js +1 -0
  81. package/dist/interfaces/v2/data/IDataV2Service.d.ts +12 -0
  82. package/dist/interfaces/v2/data/IDataV2Service.js +5 -0
  83. package/dist/interfaces/v2/data/index.d.ts +1 -0
  84. package/dist/interfaces/v2/data/index.js +1 -0
  85. package/dist/interfaces/v2/electricity/IElectricityV2Service.d.ts +12 -0
  86. package/dist/interfaces/v2/electricity/IElectricityV2Service.js +5 -0
  87. package/dist/interfaces/v2/electricity/index.d.ts +1 -0
  88. package/dist/interfaces/v2/electricity/index.js +1 -0
  89. package/dist/interfaces/v2/transfers/ITransfersService.d.ts +20 -0
  90. package/dist/interfaces/v2/transfers/ITransfersService.js +5 -0
  91. package/dist/interfaces/v2/transfers/index.d.ts +1 -0
  92. package/dist/interfaces/v2/transfers/index.js +1 -0
  93. package/dist/lib/errors.d.ts +62 -0
  94. package/dist/lib/errors.js +92 -0
  95. package/dist/lib/outcome.d.ts +18 -0
  96. package/dist/lib/outcome.js +107 -0
  97. package/dist/lib/paginate.d.ts +21 -0
  98. package/dist/lib/paginate.js +25 -0
  99. package/dist/lib/sdk-version.d.ts +5 -0
  100. package/dist/lib/sdk-version.generated.d.ts +1 -0
  101. package/dist/lib/sdk-version.generated.js +1 -0
  102. package/dist/lib/sdk-version.js +5 -0
  103. package/dist/lib/token-store.d.ts +49 -0
  104. package/dist/lib/token-store.js +26 -0
  105. package/dist/lib/util.d.ts +31 -0
  106. package/dist/lib/util.js +31 -0
  107. package/dist/lib/webhooks.d.ts +43 -0
  108. package/dist/lib/webhooks.js +64 -0
  109. package/dist/nomba.d.ts +63 -0
  110. package/dist/nomba.js +97 -0
  111. package/dist/services/http/http-client.service.d.ts +27 -0
  112. package/dist/services/http/http-client.service.js +317 -0
  113. package/dist/services/v1/accounts/accounts.service.d.ts +38 -0
  114. package/dist/services/v1/accounts/accounts.service.js +58 -0
  115. package/dist/services/v1/betting/betting.service.d.ts +16 -0
  116. package/dist/services/v1/betting/betting.service.js +21 -0
  117. package/dist/services/v1/cable/cable.service.d.ts +16 -0
  118. package/dist/services/v1/cable/cable.service.js +23 -0
  119. package/dist/services/v1/charge/charge.service.d.ts +52 -0
  120. package/dist/services/v1/charge/charge.service.js +99 -0
  121. package/dist/services/v1/checkout/checkout.service.d.ts +44 -0
  122. package/dist/services/v1/checkout/checkout.service.js +100 -0
  123. package/dist/services/v1/data/data.service.d.ts +14 -0
  124. package/dist/services/v1/data/data.service.js +16 -0
  125. package/dist/services/v1/direct-debits/direct-debits.service.d.ts +45 -0
  126. package/dist/services/v1/direct-debits/direct-debits.service.js +69 -0
  127. package/dist/services/v1/electricity/electricity.service.d.ts +16 -0
  128. package/dist/services/v1/electricity/electricity.service.js +21 -0
  129. package/dist/services/v1/globals/collections.service.d.ts +28 -0
  130. package/dist/services/v1/globals/collections.service.js +38 -0
  131. package/dist/services/v1/globals/payout.service.d.ts +45 -0
  132. package/dist/services/v1/globals/payout.service.js +95 -0
  133. package/dist/services/v1/requery/requery.service.d.ts +31 -0
  134. package/dist/services/v1/requery/requery.service.js +41 -0
  135. package/dist/services/v1/terminals/terminals.service.d.ts +38 -0
  136. package/dist/services/v1/terminals/terminals.service.js +69 -0
  137. package/dist/services/v1/transactions/transactions.service.d.ts +48 -0
  138. package/dist/services/v1/transactions/transactions.service.js +98 -0
  139. package/dist/services/v1/virtual-accounts/virtual-accounts.service.d.ts +41 -0
  140. package/dist/services/v1/virtual-accounts/virtual-accounts.service.js +56 -0
  141. package/dist/services/v1/webhooks/webhooks.service.d.ts +36 -0
  142. package/dist/services/v1/webhooks/webhooks.service.js +60 -0
  143. package/dist/services/v2/airtime/airtime.service.d.ts +18 -0
  144. package/dist/services/v2/airtime/airtime.service.js +35 -0
  145. package/dist/services/v2/betting/betting.service.d.ts +19 -0
  146. package/dist/services/v2/betting/betting.service.js +36 -0
  147. package/dist/services/v2/cable/cable.service.d.ts +19 -0
  148. package/dist/services/v2/cable/cable.service.js +36 -0
  149. package/dist/services/v2/data/data.service.d.ts +18 -0
  150. package/dist/services/v2/data/data.service.js +35 -0
  151. package/dist/services/v2/electricity/electricity.service.d.ts +19 -0
  152. package/dist/services/v2/electricity/electricity.service.js +36 -0
  153. package/dist/services/v2/transfers/transfers.service.d.ts +30 -0
  154. package/dist/services/v2/transfers/transfers.service.js +67 -0
  155. package/dist/types/common/common.types.d.ts +78 -0
  156. package/dist/types/common/common.types.js +5 -0
  157. package/dist/types/common/outcome.types.d.ts +53 -0
  158. package/dist/types/common/outcome.types.js +5 -0
  159. package/dist/types/v1/accounts/accounts.types.d.ts +37 -0
  160. package/dist/types/v1/accounts/accounts.types.js +8 -0
  161. package/dist/types/v1/betting/betting.types.d.ts +26 -0
  162. package/dist/types/v1/betting/betting.types.js +5 -0
  163. package/dist/types/v1/cable/cable.types.d.ts +24 -0
  164. package/dist/types/v1/cable/cable.types.js +5 -0
  165. package/dist/types/v1/charge/charge.types.d.ts +102 -0
  166. package/dist/types/v1/charge/charge.types.js +5 -0
  167. package/dist/types/v1/checkout/checkout.types.d.ts +139 -0
  168. package/dist/types/v1/checkout/checkout.types.js +5 -0
  169. package/dist/types/v1/data/data.types.d.ts +14 -0
  170. package/dist/types/v1/data/data.types.js +5 -0
  171. package/dist/types/v1/direct-debits/direct-debits.types.d.ts +104 -0
  172. package/dist/types/v1/direct-debits/direct-debits.types.js +5 -0
  173. package/dist/types/v1/electricity/electricity.types.d.ts +21 -0
  174. package/dist/types/v1/electricity/electricity.types.js +5 -0
  175. package/dist/types/v1/globals/collections.types.d.ts +49 -0
  176. package/dist/types/v1/globals/collections.types.js +5 -0
  177. package/dist/types/v1/globals/payout.types.d.ts +183 -0
  178. package/dist/types/v1/globals/payout.types.js +5 -0
  179. package/dist/types/v1/requery/requery.types.d.ts +49 -0
  180. package/dist/types/v1/requery/requery.types.js +5 -0
  181. package/dist/types/v1/terminals/terminals.types.d.ts +44 -0
  182. package/dist/types/v1/terminals/terminals.types.js +5 -0
  183. package/dist/types/v1/transactions/transactions.types.d.ts +87 -0
  184. package/dist/types/v1/transactions/transactions.types.js +5 -0
  185. package/dist/types/v1/virtual-accounts/virtual-accounts.types.d.ts +64 -0
  186. package/dist/types/v1/virtual-accounts/virtual-accounts.types.js +5 -0
  187. package/dist/types/v1/webhooks/webhooks.types.d.ts +54 -0
  188. package/dist/types/v1/webhooks/webhooks.types.js +5 -0
  189. package/dist/types/v2/airtime/airtime.types.d.ts +31 -0
  190. package/dist/types/v2/airtime/airtime.types.js +5 -0
  191. package/dist/types/v2/betting/betting.types.d.ts +33 -0
  192. package/dist/types/v2/betting/betting.types.js +5 -0
  193. package/dist/types/v2/cable/cable.types.d.ts +32 -0
  194. package/dist/types/v2/cable/cable.types.js +5 -0
  195. package/dist/types/v2/data/data.types.d.ts +32 -0
  196. package/dist/types/v2/data/data.types.js +5 -0
  197. package/dist/types/v2/electricity/electricity.types.d.ts +34 -0
  198. package/dist/types/v2/electricity/electricity.types.js +5 -0
  199. package/dist/types/v2/transfers/transfers.types.d.ts +99 -0
  200. package/dist/types/v2/transfers/transfers.types.js +5 -0
  201. package/package.json +42 -5
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @module nomba/services/v1/electricity
3
+ * @description Electricity (v1): GET /v1/bill/electricity/discos, GET /v1/bill/electricity/lookup
4
+ * @see https://developer.nomba.com/docs/api-reference/bills
5
+ */
6
+ export class ElectricityService {
7
+ http;
8
+ constructor(http) {
9
+ this.http = http;
10
+ }
11
+ /** GET /v1/bill/electricity/discos */
12
+ getElectricityProviders() {
13
+ return this.http.request("GET", "/v1/bill/electricity/discos");
14
+ }
15
+ /** GET /v1/bill/electricity/lookup */
16
+ lookupMeter(params) {
17
+ return this.http.request("GET", "/v1/bill/electricity/lookup", {
18
+ query: params,
19
+ });
20
+ }
21
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @module nomba/globals/collections
3
+ * @description Nomba SDK for Node.js
4
+ * @description Global Collections resource: DRC mobile money inflows
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/products/global-collections/introduction
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { IGlobalCollectionsService } from "../../../interfaces/v1/globals/collections/IGlobalCollectionsService.js";
17
+ import type { RequestOptions } from "../../../types/common/common.types.js";
18
+ import type { CollectionTransaction, InflowProvider, InflowResult, InitiateInflowParams } from "../../../types/v1/globals/collections.types.js";
19
+ export declare class GlobalCollectionsService implements IGlobalCollectionsService {
20
+ private readonly http;
21
+ constructor(http: IHttpClient);
22
+ /** GET /v1/global-collection/drc/inflow/providers */
23
+ inflowProviders(): Promise<InflowProvider[]>;
24
+ /** POST /v1/global-collection/inflow/initiate. Prompts the customer to approve the charge on their phone. */
25
+ initiateInflow(params: InitiateInflowParams, options?: RequestOptions): Promise<InflowResult>;
26
+ /** GET /v1/global-collection/transactions/{transactionId}, with the `transactionReference` from `initiateInflow`. */
27
+ getTransaction(transactionId: string): Promise<CollectionTransaction>;
28
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @module nomba/globals/collections
3
+ * @description Nomba SDK for Node.js
4
+ * @description Global Collections resource: DRC mobile money inflows
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/products/global-collections/introduction
14
+ */
15
+ import { randomUUID } from "node:crypto";
16
+ import { pathId } from "../../../lib/util.js";
17
+ export class GlobalCollectionsService {
18
+ http;
19
+ constructor(http) {
20
+ this.http = http;
21
+ }
22
+ /** GET /v1/global-collection/drc/inflow/providers */
23
+ inflowProviders() {
24
+ return this.http.request("GET", "/v1/global-collection/drc/inflow/providers");
25
+ }
26
+ /** POST /v1/global-collection/inflow/initiate. Prompts the customer to approve the charge on their phone. */
27
+ initiateInflow(params, options = {}) {
28
+ const idempotencyKey = params.idempotencyKey || options.idempotencyKey || randomUUID();
29
+ return this.http.request("POST", "/v1/global-collection/inflow/initiate", {
30
+ body: { ...params, idempotencyKey },
31
+ idempotencyKey,
32
+ });
33
+ }
34
+ /** GET /v1/global-collection/transactions/{transactionId}, with the `transactionReference` from `initiateInflow`. */
35
+ async getTransaction(transactionId) {
36
+ return this.http.request("GET", `/v1/global-collection/transactions/${pathId(transactionId)}`);
37
+ }
38
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @module nomba/globals/payouts
3
+ * @description Nomba SDK for Node.js
4
+ * @description Cross-border transfers and currency exchange resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/products/global-payout/introduction
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { IGlobalPayoutService } from "../../../interfaces/v1/globals/payouts/IGlobalPayoutService.js";
17
+ import type { CallOptions, RequestOptions } from "../../../types/common/common.types.js";
18
+ import type { AuthorizeExchangeParams, AuthorizeTransferParams, Conversion, ConvertMoneyParams, ExchangeRate, ExchangeRatesParams, InstitutionProvider, InstitutionProvidersParams, PaymentMethodInfo, PaymentMethodsParams, PayoutAccount, PayoutResult, PayoutTransaction } from "../../../types/v1/globals/payout.types.js";
19
+ export declare class GlobalPayoutService implements IGlobalPayoutService {
20
+ #private;
21
+ private readonly http;
22
+ constructor(http: IHttpClient);
23
+ /** GET /v1/global-payout/accounts. Every currency wallet with its balance. */
24
+ listAccounts(): Promise<PayoutAccount[]>;
25
+ /** GET /v1/global-payout/accounts/{accountId}. A 404 means the id is not one of your wallets. */
26
+ getAccount(accountId: string): Promise<PayoutAccount>;
27
+ /** GET /v1/sandbox/global-payout/accounts. Canned test data. */
28
+ listSandboxAccounts(): Promise<PayoutAccount[]>;
29
+ /** GET /v1/sandbox/global-payout/accounts/{accountId}. Canned test data; any id is echoed back. */
30
+ getSandboxAccount(accountId: string): Promise<PayoutAccount>;
31
+ /** GET /v1/global-payout/exchange-rates */
32
+ exchangeRates(params: ExchangeRatesParams): Promise<ExchangeRate[]>;
33
+ /** POST /v1/global-payout/money/convert. A calculation only; no money moves. */
34
+ convert(params: ConvertMoneyParams, options?: RequestOptions): Promise<Conversion>;
35
+ /** GET /v1/global-payout/bank/providers */
36
+ institutionProviders(params?: InstitutionProvidersParams): Promise<InstitutionProvider[]>;
37
+ /** GET /v1/global-payout/payment-methods */
38
+ paymentMethods(params?: PaymentMethodsParams): Promise<PaymentMethodInfo[]>;
39
+ /** POST /v1/global-payout/transfer/authorize. Sends money cross-border. */
40
+ authorizeTransfer<R = PayoutResult>(params: AuthorizeTransferParams, options?: CallOptions<PayoutResult, R>): Promise<PayoutResult | R>;
41
+ /** POST /v1/global-payout/exchange/authorize. Moves money between your own wallets in different currencies. */
42
+ authorizeExchange<R = PayoutResult>(params: AuthorizeExchangeParams, options?: CallOptions<PayoutResult, R>): Promise<PayoutResult | R>;
43
+ /** GET /v1/global-payout/transactions/{transactionId}, with a `wtTransactionId`. */
44
+ getTransaction(transactionId: string): Promise<PayoutTransaction>;
45
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * @module nomba/globals/payouts
3
+ * @description Nomba SDK for Node.js
4
+ * @description Cross-border transfers and currency exchange resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/products/global-payout/introduction
14
+ */
15
+ import { randomUUID } from "node:crypto";
16
+ import { REJECTED, settle } from "../../../lib/outcome.js";
17
+ import { pathId } from "../../../lib/util.js";
18
+ // authorize-transfer documents data.status PROCESSING, PENDING, COMPLETED and FAILED. The docs never say FAILED is
19
+ // final or safe to refund, so it stays pending until confirmed (see CORRECTIONS.md); only COMPLETED is success.
20
+ const TRANSFER_OUTCOMES = {
21
+ codes: { "00": "success", ...REJECTED },
22
+ statuses: {
23
+ COMPLETED: "success",
24
+ PROCESSING: "pending",
25
+ PENDING: "pending",
26
+ FAILED: "pending",
27
+ },
28
+ };
29
+ // authorize-exchange documents no status values (examples only), so it is classified by code alone.
30
+ const EXCHANGE_OUTCOMES = {
31
+ codes: { "00": "success", ...REJECTED },
32
+ };
33
+ export class GlobalPayoutService {
34
+ http;
35
+ constructor(http) {
36
+ this.http = http;
37
+ }
38
+ /** GET /v1/global-payout/accounts. Every currency wallet with its balance. */
39
+ listAccounts() {
40
+ return this.http.request("GET", "/v1/global-payout/accounts");
41
+ }
42
+ /** GET /v1/global-payout/accounts/{accountId}. A 404 means the id is not one of your wallets. */
43
+ async getAccount(accountId) {
44
+ return this.http.request("GET", `/v1/global-payout/accounts/${pathId(accountId)}`);
45
+ }
46
+ /** GET /v1/sandbox/global-payout/accounts. Canned test data. */
47
+ listSandboxAccounts() {
48
+ return this.http.request("GET", "/v1/sandbox/global-payout/accounts");
49
+ }
50
+ /** GET /v1/sandbox/global-payout/accounts/{accountId}. Canned test data; any id is echoed back. */
51
+ async getSandboxAccount(accountId) {
52
+ return this.http.request("GET", `/v1/sandbox/global-payout/accounts/${pathId(accountId)}`);
53
+ }
54
+ /** GET /v1/global-payout/exchange-rates */
55
+ async exchangeRates(params) {
56
+ const data = await this.http.request("GET", "/v1/global-payout/exchange-rates", { query: params });
57
+ return data.rates;
58
+ }
59
+ /** POST /v1/global-payout/money/convert. A calculation only; no money moves. */
60
+ convert(params, options = {}) {
61
+ return this.http.request("POST", "/v1/global-payout/money/convert", {
62
+ body: params,
63
+ ...options,
64
+ });
65
+ }
66
+ /** GET /v1/global-payout/bank/providers */
67
+ institutionProviders(params = {}) {
68
+ return this.http.request("GET", "/v1/global-payout/bank/providers", {
69
+ query: params,
70
+ });
71
+ }
72
+ /** GET /v1/global-payout/payment-methods */
73
+ paymentMethods(params = {}) {
74
+ return this.http.request("GET", "/v1/global-payout/payment-methods", {
75
+ query: params,
76
+ });
77
+ }
78
+ /** POST /v1/global-payout/transfer/authorize. Sends money cross-border. */
79
+ async authorizeTransfer(params, options = {}) {
80
+ return this.#authorize("/v1/global-payout/transfer/authorize", params, options, TRANSFER_OUTCOMES);
81
+ }
82
+ /** POST /v1/global-payout/exchange/authorize. Moves money between your own wallets in different currencies. */
83
+ async authorizeExchange(params, options = {}) {
84
+ return this.#authorize("/v1/global-payout/exchange/authorize", params, options, EXCHANGE_OUTCOMES);
85
+ }
86
+ /** GET /v1/global-payout/transactions/{transactionId}, with a `wtTransactionId`. */
87
+ async getTransaction(transactionId) {
88
+ return this.http.request("GET", `/v1/global-payout/transactions/${pathId(transactionId)}`);
89
+ }
90
+ // One key in the body (the one the API dedupes on) and the header, so OutcomeUnknownError reports it.
91
+ #authorize(path, params, options, table) {
92
+ const idempotencyKey = params.idempotencyKey || options.idempotencyKey || randomUUID();
93
+ return settle(this.http, "POST", path, { body: { ...params, idempotencyKey } }, table, { ...options, idempotencyKey });
94
+ }
95
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @module nomba/requery
3
+ * @description Nomba SDK for Node.js
4
+ * @description Requery resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/requery
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { IRequeryService } from "../../../interfaces/v1/requery/IRequeryService.js";
17
+ import type { Transaction, TransactionLookup } from "../../../types/v1/requery/requery.types.js";
18
+ export declare class RequeryService implements IRequeryService {
19
+ private readonly http;
20
+ constructor(http: IHttpClient);
21
+ /** GET /v1/transactions/accounts/single */
22
+ fetchParentTransaction(lookup: TransactionLookup): Promise<Transaction>;
23
+ /** GET /v1/transactions/accounts/{subAccountId}/single */
24
+ fetchSubAccountTransaction(subAccountId: string, lookup: TransactionLookup): Promise<Transaction>;
25
+ /**
26
+ * GET /v1/transactions/requery/{sessionId}. Use for transfers made through both parent and sub
27
+ * accounts. Nomba-to-Nomba wallet transfers return no sessionId; use fetchParentTransaction or
28
+ * fetchSubAccountTransaction for those instead.
29
+ */
30
+ requeryBySession(sessionId: string): Promise<Transaction>;
31
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @module nomba/requery
3
+ * @description Nomba SDK for Node.js
4
+ * @description Requery resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/requery
14
+ */
15
+ import { pathId } from "../../../lib/util.js";
16
+ export class RequeryService {
17
+ http;
18
+ constructor(http) {
19
+ this.http = http;
20
+ }
21
+ /** GET /v1/transactions/accounts/single */
22
+ fetchParentTransaction(lookup) {
23
+ return this.http.request("GET", "/v1/transactions/accounts/single", {
24
+ query: lookup,
25
+ });
26
+ }
27
+ /** GET /v1/transactions/accounts/{subAccountId}/single */
28
+ async fetchSubAccountTransaction(subAccountId, lookup) {
29
+ return this.http.request("GET", `/v1/transactions/accounts/${pathId(subAccountId)}/single`, {
30
+ query: lookup,
31
+ });
32
+ }
33
+ /**
34
+ * GET /v1/transactions/requery/{sessionId}. Use for transfers made through both parent and sub
35
+ * accounts. Nomba-to-Nomba wallet transfers return no sessionId; use fetchParentTransaction or
36
+ * fetchSubAccountTransaction for those instead.
37
+ */
38
+ async requeryBySession(sessionId) {
39
+ return this.http.request("GET", `/v1/transactions/requery/${pathId(sessionId)}`);
40
+ }
41
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @module nomba/terminals
3
+ * @description Nomba SDK for Node.js
4
+ * @description Terminals resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/terminals
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { ITerminalsService } from "../../../interfaces/v1/terminals/index.js";
17
+ import type { CallOptions, RequestOptions } from "../../../types/common/common.types.js";
18
+ import type { AssignTerminalParams, PushPaymentRequestParams, Terminal, TerminalPayment } from "../../../types/v1/terminals/terminals.types.js";
19
+ export declare class TerminalsService implements ITerminalsService {
20
+ private readonly http;
21
+ constructor(http: IHttpClient);
22
+ /** POST /v1/terminals/assign */
23
+ assignToParent(params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
24
+ /** POST /v1/terminals/assign/{subAccountId} */
25
+ assignToSubAccount(subAccountId: string, params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
26
+ /** POST /v1/terminals/unassign */
27
+ unassignFromParent(params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
28
+ /** POST /v1/terminals/unassign/{subAccountId} */
29
+ unassignFromSubAccount(subAccountId: string, params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
30
+ /**
31
+ * POST /v1/terminals/payment-request/{terminalId}. Triggers a payment prompt on the physical terminal.
32
+ * ponytail: the spec lists no accountId header for this endpoint, unlike every other one; sent anyway
33
+ * since every sibling endpoint requires it and an unused header is harmless. Drop it if a real call 4xxs.
34
+ * Defaults the idempotency key to `merchantTxRef`, same as transfers, so a retry after a timeout doesn't
35
+ * re-prompt the terminal.
36
+ */
37
+ pushPaymentRequest<R = TerminalPayment>(terminalId: string, params: PushPaymentRequestParams, options?: CallOptions<TerminalPayment, R>): Promise<TerminalPayment | R>;
38
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @module nomba/terminals
3
+ * @description Nomba SDK for Node.js
4
+ * @description Terminals resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/terminals
14
+ */
15
+ import { REJECTED, settle } from "../../../lib/outcome.js";
16
+ import { pathId } from "../../../lib/util.js";
17
+ // Documented: code "00"; data.status pending, completed or failed. As with Global Payout, the docs never say
18
+ // "failed" is final, so only "completed" is success.
19
+ const PAYMENT_REQUEST_OUTCOMES = {
20
+ codes: { "00": "success", ...REJECTED },
21
+ statuses: { completed: "success", pending: "pending", failed: "pending" },
22
+ };
23
+ export class TerminalsService {
24
+ http;
25
+ constructor(http) {
26
+ this.http = http;
27
+ }
28
+ /** POST /v1/terminals/assign */
29
+ assignToParent(params, options = {}) {
30
+ return this.http.request("POST", "/v1/terminals/assign", {
31
+ body: params,
32
+ ...options,
33
+ });
34
+ }
35
+ /** POST /v1/terminals/assign/{subAccountId} */
36
+ async assignToSubAccount(subAccountId, params, options = {}) {
37
+ return this.http.request("POST", `/v1/terminals/assign/${pathId(subAccountId)}`, {
38
+ body: params,
39
+ ...options,
40
+ });
41
+ }
42
+ /** POST /v1/terminals/unassign */
43
+ unassignFromParent(params, options = {}) {
44
+ return this.http.request("POST", "/v1/terminals/unassign", {
45
+ body: params,
46
+ ...options,
47
+ });
48
+ }
49
+ /** POST /v1/terminals/unassign/{subAccountId} */
50
+ async unassignFromSubAccount(subAccountId, params, options = {}) {
51
+ return this.http.request("POST", `/v1/terminals/unassign/${pathId(subAccountId)}`, {
52
+ body: params,
53
+ ...options,
54
+ });
55
+ }
56
+ /**
57
+ * POST /v1/terminals/payment-request/{terminalId}. Triggers a payment prompt on the physical terminal.
58
+ * ponytail: the spec lists no accountId header for this endpoint, unlike every other one; sent anyway
59
+ * since every sibling endpoint requires it and an unused header is harmless. Drop it if a real call 4xxs.
60
+ * Defaults the idempotency key to `merchantTxRef`, same as transfers, so a retry after a timeout doesn't
61
+ * re-prompt the terminal.
62
+ */
63
+ async pushPaymentRequest(terminalId, params, options = {}) {
64
+ return settle(this.http, "POST", `/v1/terminals/payment-request/${pathId(terminalId)}`, { body: params }, PAYMENT_REQUEST_OUTCOMES, {
65
+ ...options,
66
+ idempotencyKey: options.idempotencyKey ?? params.merchantTxRef,
67
+ });
68
+ }
69
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @module nomba/transactions
3
+ * @description Nomba SDK for Node.js
4
+ * @description Transactions resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/transactions
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { ITransactionsService } from "../../../interfaces/v1/transactions/ITransactionsService.js";
17
+ import type { Page } from "../../../lib/util.js";
18
+ import type { Transaction } from "../../../types/v1/requery/requery.types.js";
19
+ import type { BankTransaction, BankTransactionList, FilterTransactionsParams, TransactionList, TransactionListParams, VirtualAccountTransaction, VirtualAccountTransactionParams } from "../../../types/v1/transactions/transactions.types.js";
20
+ export declare class TransactionsService implements ITransactionsService {
21
+ private readonly http;
22
+ constructor(http: IHttpClient);
23
+ /** GET /v1/transactions/bank. Credit/debit transactions on the parent account. */
24
+ listBankTransactions(params?: TransactionListParams): Promise<BankTransactionList>;
25
+ /** Every credit/debit transaction, across all pages. Starts at `params.cursor` if given. */
26
+ iterateBankTransactions(params?: TransactionListParams): AsyncGenerator<BankTransaction>;
27
+ /**
28
+ * GET /v1/transactions/virtual. Documented in the guide only. The response carries a `cursor`, but the
29
+ * guide names no paging parameter, so only the first page is returned.
30
+ */
31
+ listVirtualAccountTransactions({ accountNumber, ...dates }: VirtualAccountTransactionParams): Promise<Page<VirtualAccountTransaction>>;
32
+ /** GET /v1/transactions/accounts */
33
+ listParentTransactions(params?: TransactionListParams): Promise<TransactionList>;
34
+ /** Every transaction on the parent account, across all pages. Starts at `params.cursor` if given. */
35
+ iterateParentTransactions(params?: TransactionListParams): AsyncGenerator<Transaction>;
36
+ /** GET /v1/transactions/accounts/{subAccountId} */
37
+ listSubAccountTransactions(subAccountId: string, params?: TransactionListParams): Promise<TransactionList>;
38
+ /** Every transaction on a sub account, across all pages. Starts at `params.cursor` if given. */
39
+ iterateSubAccountTransactions(subAccountId: string, params?: TransactionListParams): AsyncGenerator<Transaction>;
40
+ /** POST /v1/transactions/accounts */
41
+ filterParentTransactions(filter?: FilterTransactionsParams, page?: TransactionListParams): Promise<TransactionList>;
42
+ /** Every parent transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
43
+ iterateFilteredParentTransactions(filter?: FilterTransactionsParams, page?: TransactionListParams): AsyncGenerator<Transaction>;
44
+ /** POST /v1/transactions/accounts/{subAccountId} */
45
+ filterSubAccountTransactions(subAccountId: string, filter?: FilterTransactionsParams, page?: TransactionListParams): Promise<TransactionList>;
46
+ /** Every sub account transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
47
+ iterateFilteredSubAccountTransactions(subAccountId: string, filter?: FilterTransactionsParams, page?: TransactionListParams): AsyncGenerator<Transaction>;
48
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @module nomba/transactions
3
+ * @description Nomba SDK for Node.js
4
+ * @description Transactions resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/transactions
14
+ */
15
+ import { paginate } from "../../../lib/paginate.js";
16
+ import { pageQuery, pathId } from "../../../lib/util.js";
17
+ export class TransactionsService {
18
+ http;
19
+ constructor(http) {
20
+ this.http = http;
21
+ }
22
+ /** GET /v1/transactions/bank. Credit/debit transactions on the parent account. */
23
+ listBankTransactions(params = {}) {
24
+ return this.http.request("GET", "/v1/transactions/bank", {
25
+ query: pageQuery(params),
26
+ });
27
+ }
28
+ /** Every credit/debit transaction, across all pages. Starts at `params.cursor` if given. */
29
+ iterateBankTransactions(params = {}) {
30
+ return paginate(async (cursor) => {
31
+ const page = await this.listBankTransactions(cursor ? { ...params, cursor } : params);
32
+ return { results: page.results ?? [], cursor: page.cursor ?? "" };
33
+ });
34
+ }
35
+ /**
36
+ * GET /v1/transactions/virtual. Documented in the guide only. The response carries a `cursor`, but the
37
+ * guide names no paging parameter, so only the first page is returned.
38
+ */
39
+ listVirtualAccountTransactions({ accountNumber, ...dates }) {
40
+ return this.http.request("GET", "/v1/transactions/virtual", {
41
+ query: { virtual_account: accountNumber, ...dates },
42
+ });
43
+ }
44
+ /** GET /v1/transactions/accounts */
45
+ listParentTransactions(params = {}) {
46
+ return this.http.request("GET", "/v1/transactions/accounts", {
47
+ query: pageQuery(params),
48
+ });
49
+ }
50
+ /** Every transaction on the parent account, across all pages. Starts at `params.cursor` if given. */
51
+ iterateParentTransactions(params = {}) {
52
+ return paginate(async (cursor) => {
53
+ const page = await this.listParentTransactions(cursor ? { ...params, cursor } : params);
54
+ return { results: page.results ?? [], cursor: page.cursor ?? "" };
55
+ });
56
+ }
57
+ /** GET /v1/transactions/accounts/{subAccountId} */
58
+ async listSubAccountTransactions(subAccountId, params = {}) {
59
+ return this.http.request("GET", `/v1/transactions/accounts/${pathId(subAccountId)}`, {
60
+ query: pageQuery(params),
61
+ });
62
+ }
63
+ /** Every transaction on a sub account, across all pages. Starts at `params.cursor` if given. */
64
+ iterateSubAccountTransactions(subAccountId, params = {}) {
65
+ return paginate(async (cursor) => {
66
+ const page = await this.listSubAccountTransactions(subAccountId, cursor ? { ...params, cursor } : params);
67
+ return { results: page.results ?? [], cursor: page.cursor ?? "" };
68
+ });
69
+ }
70
+ /** POST /v1/transactions/accounts */
71
+ filterParentTransactions(filter = {}, page = {}) {
72
+ return this.http.request("POST", "/v1/transactions/accounts", {
73
+ body: filter,
74
+ query: pageQuery(page),
75
+ });
76
+ }
77
+ /** Every parent transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
78
+ iterateFilteredParentTransactions(filter = {}, page = {}) {
79
+ return paginate(async (cursor) => {
80
+ const p = await this.filterParentTransactions(filter, cursor ? { ...page, cursor } : page);
81
+ return { results: p.results ?? [], cursor: p.cursor ?? "" };
82
+ });
83
+ }
84
+ /** POST /v1/transactions/accounts/{subAccountId} */
85
+ async filterSubAccountTransactions(subAccountId, filter = {}, page = {}) {
86
+ return this.http.request("POST", `/v1/transactions/accounts/${pathId(subAccountId)}`, {
87
+ body: filter,
88
+ query: pageQuery(page),
89
+ });
90
+ }
91
+ /** Every sub account transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
92
+ iterateFilteredSubAccountTransactions(subAccountId, filter = {}, page = {}) {
93
+ return paginate(async (cursor) => {
94
+ const p = await this.filterSubAccountTransactions(subAccountId, filter, cursor ? { ...page, cursor } : page);
95
+ return { results: p.results ?? [], cursor: p.cursor ?? "" };
96
+ });
97
+ }
98
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @module nomba/virtual-accounts
3
+ * @description Nomba SDK for Node.js
4
+ * @description Virtual Accounts resource
5
+ * @author Nomba Financial Services
6
+ * @version 1.0.0
7
+ * @license MIT
8
+ * @copyright 2026 Nomba
9
+ * @homepage https://nomba.com
10
+ * @support https://nomba.com/support
11
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
12
+ * @docs https://developer.nomba.com
13
+ * @see https://developer.nomba.com/docs/api-reference/virtual-accounts
14
+ */
15
+ import type { IHttpClient } from "../../../interfaces/http/IHttpClient.js";
16
+ import type { IVirtualAccountsService } from "../../../interfaces/v1/virtual-accounts/IVirtualAccountsService.js";
17
+ import type { PageParams } from "../../../lib/util.js";
18
+ import type { RequestOptions } from "../../../types/common/common.types.js";
19
+ import type { CreatedVirtualAccount, CreateVirtualAccountParams, FilterVirtualAccountsParams, UpdateVirtualAccountParams, VirtualAccount, VirtualAccountList } from "../../../types/v1/virtual-accounts/virtual-accounts.types.js";
20
+ export declare class VirtualAccountsService implements IVirtualAccountsService {
21
+ private readonly http;
22
+ constructor(http: IHttpClient);
23
+ /** POST /v1/accounts/virtual */
24
+ create(params: CreateVirtualAccountParams, options?: RequestOptions): Promise<CreatedVirtualAccount>;
25
+ /** POST /v1/accounts/virtual/{subAccountId}. Funds are collected in that sub account. */
26
+ createForSubAccount(subAccountId: string, params: CreateVirtualAccountParams, options?: RequestOptions): Promise<CreatedVirtualAccount>;
27
+ /** GET /v1/accounts/virtual/{identifier}. `identifier` is the accountRef or the virtual account number. */
28
+ get(identifier: string): Promise<VirtualAccount>;
29
+ /** PUT /v1/accounts/virtual/{identifier}. `identifier` is the accountRef or the 10 digit account number. */
30
+ update(identifier: string, params: UpdateVirtualAccountParams, options?: RequestOptions): Promise<{
31
+ updated: boolean;
32
+ }>;
33
+ /** DELETE /v1/accounts/virtual/{identifier}. Stops the account accepting payments. */
34
+ expire(identifier: string, options?: RequestOptions): Promise<{
35
+ expired: boolean;
36
+ }>;
37
+ /** POST /v1/accounts/virtual/list */
38
+ list(filter?: FilterVirtualAccountsParams, page?: PageParams): Promise<VirtualAccountList>;
39
+ /** Every matching virtual account, across all pages. Starts at `page.cursor` if given. */
40
+ iterate(filter?: FilterVirtualAccountsParams, page?: PageParams): AsyncGenerator<VirtualAccount>;
41
+ }