@fiddupay/fiddupay-node 2.4.5 → 2.4.6

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 (94) hide show
  1. package/README.md +33 -2
  2. package/dist/src/client.d.ts +19 -0
  3. package/dist/src/client.d.ts.map +1 -0
  4. package/dist/src/client.js +148 -0
  5. package/dist/src/client.js.map +1 -0
  6. package/dist/src/errors/index.d.ts +28 -0
  7. package/dist/src/errors/index.d.ts.map +1 -0
  8. package/dist/src/errors/index.js +59 -0
  9. package/dist/src/errors/index.js.map +1 -0
  10. package/dist/src/index.d.ts +41 -0
  11. package/dist/src/index.d.ts.map +1 -0
  12. package/dist/src/index.js +98 -0
  13. package/dist/src/index.js.map +1 -0
  14. package/dist/src/resources/analytics.d.ts +23 -0
  15. package/dist/src/resources/analytics.d.ts.map +1 -0
  16. package/dist/src/resources/analytics.js +36 -0
  17. package/dist/src/resources/analytics.js.map +1 -0
  18. package/dist/src/resources/balances.d.ts +23 -0
  19. package/dist/src/resources/balances.d.ts.map +1 -0
  20. package/dist/src/resources/balances.js +54 -0
  21. package/dist/src/resources/balances.js.map +1 -0
  22. package/dist/src/resources/contact.d.ts +19 -0
  23. package/dist/src/resources/contact.d.ts.map +1 -0
  24. package/dist/src/resources/contact.js +17 -0
  25. package/dist/src/resources/contact.js.map +1 -0
  26. package/dist/src/resources/customers.d.ts +104 -0
  27. package/dist/src/resources/customers.d.ts.map +1 -0
  28. package/dist/src/resources/customers.js +106 -0
  29. package/dist/src/resources/customers.js.map +1 -0
  30. package/dist/src/resources/invoices.d.ts +14 -0
  31. package/dist/src/resources/invoices.d.ts.map +1 -0
  32. package/dist/src/resources/invoices.js +19 -0
  33. package/dist/src/resources/invoices.js.map +1 -0
  34. package/dist/src/resources/merchants.d.ts +102 -0
  35. package/dist/src/resources/merchants.d.ts.map +1 -0
  36. package/dist/src/resources/merchants.js +104 -0
  37. package/dist/src/resources/merchants.js.map +1 -0
  38. package/dist/src/resources/payments.d.ts +71 -0
  39. package/dist/src/resources/payments.d.ts.map +1 -0
  40. package/dist/src/resources/payments.js +206 -0
  41. package/dist/src/resources/payments.js.map +1 -0
  42. package/dist/src/resources/refunds.d.ts +31 -0
  43. package/dist/src/resources/refunds.d.ts.map +1 -0
  44. package/dist/src/resources/refunds.js +66 -0
  45. package/dist/src/resources/refunds.js.map +1 -0
  46. package/dist/src/resources/sandbox.d.ts +11 -0
  47. package/dist/src/resources/sandbox.d.ts.map +1 -0
  48. package/dist/src/resources/sandbox.js +16 -0
  49. package/dist/src/resources/sandbox.js.map +1 -0
  50. package/dist/src/resources/security.d.ts +56 -0
  51. package/dist/src/resources/security.d.ts.map +1 -0
  52. package/dist/src/resources/security.js +70 -0
  53. package/dist/src/resources/security.js.map +1 -0
  54. package/dist/src/resources/transactions.d.ts +25 -0
  55. package/dist/src/resources/transactions.d.ts.map +1 -0
  56. package/dist/src/resources/transactions.js +21 -0
  57. package/dist/src/resources/transactions.js.map +1 -0
  58. package/dist/src/resources/wallets.d.ts +64 -0
  59. package/dist/src/resources/wallets.d.ts.map +1 -0
  60. package/dist/src/resources/wallets.js +78 -0
  61. package/dist/src/resources/wallets.js.map +1 -0
  62. package/dist/src/resources/webhooks.d.ts +17 -0
  63. package/dist/src/resources/webhooks.d.ts.map +1 -0
  64. package/dist/src/resources/webhooks.js +130 -0
  65. package/dist/src/resources/webhooks.js.map +1 -0
  66. package/dist/src/resources/withdrawals.d.ts +39 -0
  67. package/dist/src/resources/withdrawals.d.ts.map +1 -0
  68. package/dist/src/resources/withdrawals.js +69 -0
  69. package/dist/src/resources/withdrawals.js.map +1 -0
  70. package/dist/src/types/index.d.ts +531 -0
  71. package/dist/src/types/index.d.ts.map +1 -0
  72. package/dist/src/types/index.js +8 -0
  73. package/dist/src/types/index.js.map +1 -0
  74. package/dist/tests/error-handling.test.d.ts +2 -0
  75. package/dist/tests/error-handling.test.d.ts.map +1 -0
  76. package/dist/tests/error-handling.test.js +168 -0
  77. package/dist/tests/error-handling.test.js.map +1 -0
  78. package/dist/tests/fiddupay.test.d.ts +2 -0
  79. package/dist/tests/fiddupay.test.d.ts.map +1 -0
  80. package/dist/tests/fiddupay.test.js +336 -0
  81. package/dist/tests/fiddupay.test.js.map +1 -0
  82. package/dist/tests/sdk-integration.test.d.ts +2 -0
  83. package/dist/tests/sdk-integration.test.d.ts.map +1 -0
  84. package/dist/tests/sdk-integration.test.js +229 -0
  85. package/dist/tests/sdk-integration.test.js.map +1 -0
  86. package/dist/tests/setup.d.ts +2 -0
  87. package/dist/tests/setup.d.ts.map +1 -0
  88. package/dist/tests/setup.js +22 -0
  89. package/dist/tests/setup.js.map +1 -0
  90. package/dist/tests/webhooks.test.d.ts +2 -0
  91. package/dist/tests/webhooks.test.d.ts.map +1 -0
  92. package/dist/tests/webhooks.test.js +63 -0
  93. package/dist/tests/webhooks.test.js.map +1 -0
  94. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balances.js","sourceRoot":"","sources":["../../../src/resources/balances.ts"],"names":[],"mappings":";;;AAUA,MAAa,QAAQ;IACnB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,GAAG;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,KAAK,EAAE,2BAA2B,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,MAAiC;QAChD,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAE1C,IAAI,MAAM,EAAE,KAAK;YAAE,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,IAAI,MAA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,CAAC;QACxG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8B,KAAK,EAAE,GAAG,CAAC,CAAC;IACtE,CAAC;CACF;AAlBD,8BAkBC"}
@@ -0,0 +1,19 @@
1
+ import { HttpClient } from '../client';
2
+ export declare class Contact {
3
+ private client;
4
+ constructor(client: HttpClient);
5
+ /**
6
+ * Submit contact form (public endpoint - no auth required)
7
+ */
8
+ submit(data: {
9
+ name: string;
10
+ email: string;
11
+ subject: string;
12
+ message: string;
13
+ }): Promise<{
14
+ message: string;
15
+ status: string;
16
+ id?: number;
17
+ }>;
18
+ }
19
+ //# sourceMappingURL=contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../src/resources/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,OAAO;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;CAIH"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contact = void 0;
4
+ class Contact {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Submit contact form (public endpoint - no auth required)
10
+ */
11
+ async submit(data) {
12
+ // Note: This is a public endpoint but included in SDK for convenience
13
+ return this.client.request('POST', '/api/v1/contact', data);
14
+ }
15
+ }
16
+ exports.Contact = Contact;
17
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.js","sourceRoot":"","sources":["../../../src/resources/contact.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAClB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAKZ;QAKC,sEAAsE;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF;AAnBD,0BAmBC"}
@@ -0,0 +1,104 @@
1
+ import { HttpClient } from '../client';
2
+ import { MerchantCustomer, CreateCustomerRequest, ProvisionWalletRequest, CustomerBalanceResponse, CustomerWithdrawalRequest, CustomerSweepRequest, ListCustomersParams, PaginatedResponse, RequestOptions, CustomerTransaction, CustomerStatusRequest, CustomerPermissionsRequest } from '../types';
3
+ /**
4
+ * Customers Resource
5
+ *
6
+ * Allows merchants to manage their platform users and provision unique
7
+ * designated deposit wallets for them.
8
+ */
9
+ export declare class Customers {
10
+ private client;
11
+ constructor(client: HttpClient);
12
+ /**
13
+ * Register a new customer in the gateway.
14
+ * This is required before provisioning wallets.
15
+ */
16
+ register(data: CreateCustomerRequest, options?: RequestOptions): Promise<{
17
+ customer: MerchantCustomer;
18
+ message: string;
19
+ }>;
20
+ /**
21
+ * Provision designated wallets for a customer.
22
+ * You can request "evm" (covers ETH, BSC, Polygon, Arb) and/or "solana".
23
+ */
24
+ createWallets(externalId: string, data: ProvisionWalletRequest, options?: RequestOptions): Promise<{
25
+ external_id: string;
26
+ wallets: Array<{
27
+ crypto_type: string;
28
+ network: string;
29
+ address: string;
30
+ created_at: string;
31
+ }>;
32
+ message: string;
33
+ }>;
34
+ /**
35
+ * Retrieve the current balances for a customer across all their designated wallets.
36
+ */
37
+ getBalances(externalId: string, options?: RequestOptions): Promise<CustomerBalanceResponse>;
38
+ /**
39
+ * List all registered customers for the merchant with pagination.
40
+ */
41
+ list(params?: ListCustomersParams, options?: RequestOptions): Promise<PaginatedResponse<MerchantCustomer>>;
42
+ /**
43
+ * Withdraw funds directly from a customer's designated wallet balance.
44
+ */
45
+ withdraw(externalId: string, data: CustomerWithdrawalRequest, options?: RequestOptions): Promise<{
46
+ withdrawal: any;
47
+ message: string;
48
+ }>;
49
+ /**
50
+ * Sweep funds from a user's sub-account balance directly into the merchant's master balance.
51
+ * If amount is omitted, sweeps the entire available balance.
52
+ */
53
+ sweep(externalId: string, data: CustomerSweepRequest, options?: RequestOptions): Promise<{
54
+ swept_amount: string;
55
+ message: string;
56
+ }>;
57
+ /**
58
+ * Deactivate a customer.
59
+ * This preserves their history but prevents further activity.
60
+ */
61
+ deactivate(externalId: string, options?: RequestOptions): Promise<{
62
+ message: string;
63
+ }>;
64
+ /**
65
+ * Get transaction history for a specific customer.
66
+ */
67
+ getTransactions(externalId: string, params?: {
68
+ limit?: number;
69
+ offset?: number;
70
+ }, options?: RequestOptions): Promise<PaginatedResponse<CustomerTransaction>>;
71
+ /**
72
+ * Update customer status (active, suspended, inactive).
73
+ */
74
+ updateStatus(externalId: string, data: CustomerStatusRequest, options?: RequestOptions): Promise<{
75
+ message: string;
76
+ }>;
77
+ /**
78
+ * Update customer-specific permissions and limits.
79
+ */
80
+ updatePermissions(externalId: string, data: CustomerPermissionsRequest, options?: RequestOptions): Promise<{
81
+ message: string;
82
+ }>;
83
+ /**
84
+ * Get the specific deposit address for a customer for a given cryptocurrency.
85
+ */
86
+ getDepositAddress(externalId: string, cryptoType: string, options?: RequestOptions): Promise<{
87
+ address: string;
88
+ crypto_type: string;
89
+ }>;
90
+ /**
91
+ * Initiate an internal payment from a customer's designated wallet balance to the merchant's master balance.
92
+ * This is useful for charging users for services on your platform.
93
+ */
94
+ payMerchant(externalId: string, data: {
95
+ crypto_type: string;
96
+ amount: string;
97
+ reference_id?: string;
98
+ description?: string;
99
+ }, options?: RequestOptions): Promise<{
100
+ transaction: any;
101
+ message: string;
102
+ }>;
103
+ }
104
+ //# sourceMappingURL=customers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/resources/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC7B,MAAM,UAAU,CAAC;AAElB;;;;;GAKG;AACH,qBAAa,SAAS;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,gBAAgB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAI/H;;;OAGG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QACrG,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,KAAK,CAAC;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC9F,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;IAIF;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAIjG;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iB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AE,cAAc,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAI5I;;;OAGG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;QACxC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAG/E"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Customers = void 0;
4
+ /**
5
+ * Customers Resource
6
+ *
7
+ * Allows merchants to manage their platform users and provision unique
8
+ * designated deposit wallets for them.
9
+ */
10
+ class Customers {
11
+ constructor(client) {
12
+ this.client = client;
13
+ }
14
+ /**
15
+ * Register a new customer in the gateway.
16
+ * This is required before provisioning wallets.
17
+ */
18
+ async register(data, options) {
19
+ return this.client.post('/api/v1/merchants/customers', data, options);
20
+ }
21
+ /**
22
+ * Provision designated wallets for a customer.
23
+ * You can request "evm" (covers ETH, BSC, Polygon, Arb) and/or "solana".
24
+ */
25
+ async createWallets(externalId, data, options) {
26
+ return this.client.post(`/api/v1/merchants/customers/${externalId}/wallets`, data, options);
27
+ }
28
+ /**
29
+ * Retrieve the current balances for a customer across all their designated wallets.
30
+ */
31
+ async getBalances(externalId, options) {
32
+ return this.client.get(`/api/v1/merchants/customers/${externalId}/balances`, options);
33
+ }
34
+ /**
35
+ * List all registered customers for the merchant with pagination.
36
+ */
37
+ async list(params, options) {
38
+ const queryParams = new URLSearchParams();
39
+ if (params?.limit)
40
+ queryParams.append('limit', params.limit.toString());
41
+ if (params?.offset)
42
+ queryParams.append('offset', params.offset.toString());
43
+ const query = queryParams.toString();
44
+ const path = query ? `/api/v1/merchants/customers?${query}` : '/api/v1/merchants/customers';
45
+ return this.client.get(path, options);
46
+ }
47
+ /**
48
+ * Withdraw funds directly from a customer's designated wallet balance.
49
+ */
50
+ async withdraw(externalId, data, options) {
51
+ return this.client.post(`/api/v1/merchants/customers/${externalId}/withdraw`, data, options);
52
+ }
53
+ /**
54
+ * Sweep funds from a user's sub-account balance directly into the merchant's master balance.
55
+ * If amount is omitted, sweeps the entire available balance.
56
+ */
57
+ async sweep(externalId, data, options) {
58
+ return this.client.post(`/api/v1/merchants/customers/${externalId}/sweep`, data, options);
59
+ }
60
+ /**
61
+ * Deactivate a customer.
62
+ * This preserves their history but prevents further activity.
63
+ */
64
+ async deactivate(externalId, options) {
65
+ return this.client.post(`/api/v1/merchants/customers/${externalId}/deactivate`, {}, options);
66
+ }
67
+ /**
68
+ * Get transaction history for a specific customer.
69
+ */
70
+ async getTransactions(externalId, params, options) {
71
+ const queryParams = new URLSearchParams();
72
+ if (params?.limit)
73
+ queryParams.append('limit', params.limit.toString());
74
+ if (params?.offset)
75
+ queryParams.append('offset', params.offset.toString());
76
+ const path = `/api/v1/merchants/customers/${externalId}/transactions${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
77
+ return this.client.get(path, options);
78
+ }
79
+ /**
80
+ * Update customer status (active, suspended, inactive).
81
+ */
82
+ async updateStatus(externalId, data, options) {
83
+ return this.client.patch(`/api/v1/merchants/customers/${externalId}/status`, data, options);
84
+ }
85
+ /**
86
+ * Update customer-specific permissions and limits.
87
+ */
88
+ async updatePermissions(externalId, data, options) {
89
+ return this.client.patch(`/api/v1/merchants/customers/${externalId}/permissions`, data, options);
90
+ }
91
+ /**
92
+ * Get the specific deposit address for a customer for a given cryptocurrency.
93
+ */
94
+ async getDepositAddress(externalId, cryptoType, options) {
95
+ return this.client.get(`/api/v1/merchants/customers/${externalId}/deposit-address/${cryptoType}`, options);
96
+ }
97
+ /**
98
+ * Initiate an internal payment from a customer's designated wallet balance to the merchant's master balance.
99
+ * This is useful for charging users for services on your platform.
100
+ */
101
+ async payMerchant(externalId, data, options) {
102
+ return this.client.post(`/api/v1/merchants/customers/${externalId}/pay-merchant`, data, options);
103
+ }
104
+ }
105
+ exports.Customers = Customers;
106
+ //# sourceMappingURL=customers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../src/resources/customers.ts"],"names":[],"mappings":";;;AAgBA;;;;;GAKG;AACH,MAAa,SAAS;IAClB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,IAA2B,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,UAAkB,EAAE,IAA4B,EAAE,OAAwB;QAK1F,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,UAAU,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,UAAU,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA4B,EAAE,OAAwB;QAC7D,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAE1C,IAAI,MAAM,EAAE,KAAK;YAAE,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CA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3E,MAAM,IAAI,GAAG,+BAA+B,UAAU,gBAAgB,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACnI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,UAAkB,EAAE,IAA2B,EAAE,OAAwB;QACxF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,UAAU,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,UAAkB,EAAE,IAAgC,EAAE,OAAwB;QAClG,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,UAAU,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,UAAkB,EAAE,UAAkB,EAAE,OAAwB;QACpF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,UAAU,oBAAoB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,IAKrC,EAAE,OAAwB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,UAAU,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;CACJ;AAjHD,8BAiHC"}
@@ -0,0 +1,14 @@
1
+ import { HttpClient } from '../client';
2
+ export declare class InvoicesResource {
3
+ private client;
4
+ constructor(client: HttpClient);
5
+ create(data: {
6
+ amount_usd: string;
7
+ description: string;
8
+ due_date?: string;
9
+ customer_email?: string;
10
+ }): Promise<unknown>;
11
+ list(): Promise<unknown>;
12
+ retrieve(invoiceId: string): Promise<unknown>;
13
+ }
14
+ //# sourceMappingURL=invoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/resources/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,MAAM,CAAC,IAAI,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IAIK,IAAI;IAIJ,QAAQ,CAAC,SAAS,EAAE,MAAM;CAGjC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoicesResource = void 0;
4
+ class InvoicesResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ async create(data) {
9
+ return this.client.request('POST', '/api/v1/merchants/invoices', data);
10
+ }
11
+ async list() {
12
+ return this.client.request('GET', '/api/v1/merchants/invoices');
13
+ }
14
+ async retrieve(invoiceId) {
15
+ return this.client.request('GET', `/api/v1/merchants/invoices/${invoiceId}`);
16
+ }
17
+ }
18
+ exports.InvoicesResource = InvoicesResource;
19
+ //# sourceMappingURL=invoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/resources/invoices.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAC3B,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C,KAAK,CAAC,MAAM,CAAC,IAKZ;QACC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,4BAA4B,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAiB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,8BAA8B,SAAS,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAnBD,4CAmBC"}
@@ -0,0 +1,102 @@
1
+ import { HttpClient } from '../client';
2
+ import { MerchantProfile, RequestOptions, UnifiedSettingsRequest } from '../types';
3
+ export declare class Merchants {
4
+ private client;
5
+ constructor(client: HttpClient);
6
+ /**
7
+ * Register new merchant
8
+ */
9
+ register(data: {
10
+ email: string;
11
+ business_name: string;
12
+ password: string;
13
+ }): Promise<{
14
+ user: any;
15
+ api_key: string;
16
+ }>;
17
+ /**
18
+ * Get current merchant profile
19
+ */
20
+ retrieve(options?: RequestOptions): Promise<MerchantProfile>;
21
+ /**
22
+ * Get merchant readiness status
23
+ */
24
+ getStatus(options?: RequestOptions): Promise<any>;
25
+ switchEnvironment(data: {
26
+ environment: 'sandbox' | 'production';
27
+ }, options?: RequestOptions): Promise<{
28
+ message: string;
29
+ environment: string;
30
+ }>;
31
+ /**
32
+ * Generate new API key
33
+ */
34
+ generateApiKey(data?: {
35
+ environment?: 'sandbox' | 'production';
36
+ }, options?: RequestOptions): Promise<{
37
+ api_key: string;
38
+ environment: string;
39
+ }>;
40
+ /**
41
+ * Rotate existing API key
42
+ */
43
+ rotateApiKey(data?: {
44
+ environment?: 'sandbox' | 'production';
45
+ }, options?: RequestOptions): Promise<{
46
+ api_key: string;
47
+ }>;
48
+ /**
49
+ * Get current fee setting
50
+ */
51
+ getFeeSetting(options?: RequestOptions): Promise<{
52
+ fee_percentage: number;
53
+ customer_pays_fee: boolean;
54
+ }>;
55
+ /**
56
+ * Update global merchant settings (Unified)
57
+ */
58
+ updateSettings(data: UnifiedSettingsRequest, options?: RequestOptions): Promise<{
59
+ status: string;
60
+ message: string;
61
+ }>;
62
+ /**
63
+ * Get global merchant settings
64
+ */
65
+ getSettings(options?: RequestOptions): Promise<UnifiedSettingsRequest>;
66
+ /**
67
+ * Send a test webhook
68
+ */
69
+ sendTestWebhook(options?: RequestOptions): Promise<{
70
+ status: string;
71
+ message: string;
72
+ }>;
73
+ /**
74
+ * Get merchant balance
75
+ */
76
+ getBalance(options?: RequestOptions): Promise<{
77
+ balances: Record<string, {
78
+ available: string;
79
+ pending: string;
80
+ total: string;
81
+ }>;
82
+ total_usd: string;
83
+ }>;
84
+ /**
85
+ * Get audit logs for the merchant
86
+ */
87
+ getAuditLogs(params?: {
88
+ limit?: number;
89
+ action_type?: string;
90
+ from?: string;
91
+ to?: string;
92
+ }, options?: RequestOptions): Promise<any[]>;
93
+ /**
94
+ * Get balance history for the merchant
95
+ */
96
+ getBalanceHistory(params?: {
97
+ limit?: number;
98
+ }, options?: RequestOptions): Promise<{
99
+ points: any[];
100
+ }>;
101
+ }
102
+ //# sourceMappingURL=merchants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merchants.d.ts","sourceRoot":"","sources":["../../../src/resources/merchants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAY,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE7F,qBAAa,SAAS;IACR,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3C;;OAEG;IACG,QAAQ,CAAC,OAAO,C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AC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAI7F;;OAEG;IACG,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;YACvB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC,CAAC;QACH,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAIF;;OAEG;IACG,YAAY,CAAC,MAAM,CAAC,EAAE;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAY5C;;OAEG;IACG,iBAAiB,CAAC,MAAM,CAAC,EAAE;QAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;CAQzD"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Merchants = void 0;
4
+ class Merchants {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Register new merchant
10
+ */
11
+ async register(data) {
12
+ return this.client.request('POST', '/api/v1/merchants/register', data);
13
+ }
14
+ /**
15
+ * Get current merchant profile
16
+ */
17
+ async retrieve(options) {
18
+ return this.client.request('GET', '/api/v1/merchants/profile');
19
+ }
20
+ /**
21
+ * Get merchant readiness status
22
+ */
23
+ async getStatus(options) {
24
+ return this.client.request('GET', '/api/v1/merchants/status');
25
+ }
26
+ async switchEnvironment(data, options) {
27
+ const requestData = { to_live: data.environment === 'production' };
28
+ return this.client.request('POST', '/api/v1/merchants/environment/switch', requestData);
29
+ }
30
+ /**
31
+ * Generate new API key
32
+ */
33
+ async generateApiKey(data, options) {
34
+ const requestData = data ? { is_live: data.environment === 'production' } : { is_live: false };
35
+ return this.client.request('POST', '/api/v1/merchants/api-keys/generate', requestData);
36
+ }
37
+ /**
38
+ * Rotate existing API key
39
+ */
40
+ async rotateApiKey(data, options) {
41
+ const requestData = data ? { is_live: data.environment === 'production' } : { is_live: false };
42
+ return this.client.request('POST', '/api/v1/merchants/api-keys/rotate', requestData);
43
+ }
44
+ /**
45
+ * Get current fee setting
46
+ */
47
+ async getFeeSetting(options) {
48
+ return this.client.request('GET', '/api/v1/merchants/fee-setting');
49
+ }
50
+ /**
51
+ * Update global merchant settings (Unified)
52
+ */
53
+ async updateSettings(data, options) {
54
+ return this.client.request('PATCH', '/api/v1/merchants/settings', data);
55
+ }
56
+ /**
57
+ * Get global merchant settings
58
+ */
59
+ async getSettings(options) {
60
+ return this.client.request('GET', '/api/v1/merchants/settings');
61
+ }
62
+ /**
63
+ * Send a test webhook
64
+ */
65
+ async sendTestWebhook(options) {
66
+ return this.client.request('POST', '/api/v1/merchants/webhook/test');
67
+ }
68
+ /**
69
+ * Get merchant balance
70
+ */
71
+ async getBalance(options) {
72
+ return this.client.request('GET', '/api/v1/merchants/balance');
73
+ }
74
+ /**
75
+ * Get audit logs for the merchant
76
+ */
77
+ async getAuditLogs(params, options) {
78
+ const queryParams = new URLSearchParams();
79
+ if (params?.limit)
80
+ queryParams.append('limit', params.limit.toString());
81
+ if (params?.action_type)
82
+ queryParams.append('action_type', params.action_type);
83
+ if (params?.from)
84
+ queryParams.append('from', params.from);
85
+ if (params?.to)
86
+ queryParams.append('to', params.to);
87
+ const query = queryParams.toString();
88
+ const path = query ? `/api/v1/merchants/audit-logs?${query}` : '/api/v1/merchants/audit-logs';
89
+ return this.client.request('GET', path);
90
+ }
91
+ /**
92
+ * Get balance history for the merchant
93
+ */
94
+ async getBalanceHistory(params, options) {
95
+ const queryParams = new URLSearchParams();
96
+ if (params?.limit)
97
+ queryParams.append('limit', params.limit.toString());
98
+ const query = queryParams.toString();
99
+ const path = query ? `/api/v1/merchants/balance/history?${query}` : '/api/v1/merchants/balance/history';
100
+ return this.client.request('GET', path);
101
+ }
102
+ }
103
+ exports.Merchants = Merchants;
104
+ //# sourceMappingURL=merchants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merchants.js","sourceRoot":"","sources":["../../../src/resources/merchants.ts"],"names":[],"mappings":";;;AAGA,MAAa,SAAS;IACpB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,IAId;QACC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,4BAA4B,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAkB,KAAK,EAAE,2BAA2B,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,OAAwB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,IAEvB,EAAE,OAAwB;QACzB,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,KAAK,YAAY,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,sCAAsC,EAAE,WAAW,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,IAEpB,EAAE,OAAwB;QACzB,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,EAA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,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF;AAnID,8BAmIC"}
@@ -0,0 +1,71 @@
1
+ import { HttpClient } from '../client';
2
+ import { CreatePaymentRequest, CreateAddressOnlyPaymentRequest, Payment, AddressOnlyPayment, ListPaymentsRequest, ListPaymentsResponse, UpdateFeeSettingRequest, FeeSettingResponse, UpdateFeeSettingResponse, RequestOptions, SelectionRequest, AddressOnlyStats, AddressOnlyHealthStatus } from '../types';
3
+ export declare class Payments {
4
+ private client;
5
+ constructor(client: HttpClient);
6
+ /**
7
+ * Create a new payment
8
+ */
9
+ create(data: CreatePaymentRequest, options?: RequestOptions): Promise<Payment>;
10
+ /**
11
+ * Finalize currency selection for a multi-currency payment
12
+ */
13
+ finalizeSelection(paymentId: string, data: SelectionRequest, options?: RequestOptions): Promise<Payment>;
14
+ /**
15
+ * Retrieve a payment by ID
16
+ */
17
+ retrieve(paymentId: string, options?: RequestOptions): Promise<Payment>;
18
+ /**
19
+ * Verify a payment with transaction hash
20
+ */
21
+ verify(paymentId: string, data: {
22
+ transaction_hash: string;
23
+ }, options?: RequestOptions): Promise<any>;
24
+ /**
25
+ * List payments with optional filters
26
+ */
27
+ list(params?: ListPaymentsRequest, options?: RequestOptions): Promise<ListPaymentsResponse>;
28
+ /**
29
+ * Cancel a pending payment
30
+ */
31
+ cancel(paymentId: string, options?: RequestOptions): Promise<Payment>;
32
+ /**
33
+ * Create an address-only payment (WORK IN PROGRESS)
34
+ */
35
+ createAddressOnly(data: CreateAddressOnlyPaymentRequest, options?: RequestOptions): Promise<AddressOnlyPayment>;
36
+ /**
37
+ * Retrieve an address-only payment status by ID (WORK IN PROGRESS)
38
+ */
39
+ retrieveAddressOnly(paymentId: string, options?: RequestOptions): Promise<AddressOnlyPayment>;
40
+ /**
41
+ * List supported native currencies for address-only mode (EXPERIMENTAL)
42
+ */
43
+ listAddressOnlyCurrencies(options?: RequestOptions): Promise<string[]>;
44
+ /**
45
+ * Get address-only mode statistics (EXPERIMENTAL)
46
+ */
47
+ getAddressOnlyStats(options?: RequestOptions): Promise<AddressOnlyStats>;
48
+ /**
49
+ * Get address-only mode health status (EXPERIMENTAL)
50
+ */
51
+ getAddressOnlyHealth(options?: RequestOptions): Promise<AddressOnlyHealthStatus>;
52
+ /**
53
+ * Update fee setting (customer pays fee vs merchant pays fee)
54
+ */
55
+ updateFeeSetting(data: UpdateFeeSettingRequest, options?: RequestOptions): Promise<UpdateFeeSettingResponse>;
56
+ /**
57
+ * Get current fee setting
58
+ */
59
+ getFeeSetting(options?: RequestOptions): Promise<FeeSettingResponse>;
60
+ private validateCreatePayment;
61
+ private validateCreateAddressOnlyPayment;
62
+ /**
63
+ * Get payment analytics and reporting
64
+ */
65
+ getAnalytics(params?: {
66
+ from_date?: string;
67
+ to_date?: string;
68
+ granularity?: 'day' | 'week' | 'month';
69
+ }, options?: RequestOptions): Promise<any>;
70
+ }
71
+ //# sourceMappingURL=payments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../../src/resources/payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAGlB,qBAAa,QAAQ;IACP,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpF;;OAEG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EA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