@fiddupay/fiddupay-node 2.5.0 → 2.5.2
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.
- package/README.md +7 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -6
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -16
- package/dist/index.js.map +1 -1
- package/dist/resources/address_only.d.ts +42 -0
- package/dist/resources/address_only.d.ts.map +1 -0
- package/dist/resources/address_only.js +52 -0
- package/dist/resources/address_only.js.map +1 -0
- package/dist/resources/balances.d.ts +3 -3
- package/dist/resources/balances.d.ts.map +1 -1
- package/dist/resources/balances.js +14 -16
- package/dist/resources/balances.js.map +1 -1
- package/dist/resources/customers.d.ts +66 -10
- package/dist/resources/customers.d.ts.map +1 -1
- package/dist/resources/customers.js +63 -6
- package/dist/resources/customers.js.map +1 -1
- package/dist/resources/invoices.d.ts +16 -8
- package/dist/resources/invoices.d.ts.map +1 -1
- package/dist/resources/invoices.js +23 -4
- package/dist/resources/invoices.js.map +1 -1
- package/dist/resources/merchants.d.ts +48 -49
- package/dist/resources/merchants.d.ts.map +1 -1
- package/dist/resources/merchants.js +64 -31
- package/dist/resources/merchants.js.map +1 -1
- package/dist/resources/payments.d.ts +15 -6
- package/dist/resources/payments.d.ts.map +1 -1
- package/dist/resources/payments.js +33 -19
- package/dist/resources/payments.js.map +1 -1
- package/dist/resources/public.d.ts +22 -0
- package/dist/resources/public.d.ts.map +1 -0
- package/dist/resources/public.js +33 -0
- package/dist/resources/public.js.map +1 -0
- package/dist/resources/refunds.d.ts +2 -1
- package/dist/resources/refunds.d.ts.map +1 -1
- package/dist/resources/refunds.js +12 -6
- package/dist/resources/refunds.js.map +1 -1
- package/dist/resources/sandbox.d.ts +0 -6
- package/dist/resources/sandbox.d.ts.map +1 -1
- package/dist/resources/sandbox.js +0 -6
- package/dist/resources/sandbox.js.map +1 -1
- package/dist/resources/security.d.ts +14 -0
- package/dist/resources/security.d.ts.map +1 -1
- package/dist/resources/security.js +12 -0
- package/dist/resources/security.js.map +1 -1
- package/dist/resources/transactions.d.ts +4 -1
- package/dist/resources/transactions.d.ts.map +1 -1
- package/dist/resources/transactions.js +12 -2
- package/dist/resources/transactions.js.map +1 -1
- package/dist/resources/wallets.d.ts +12 -25
- package/dist/resources/wallets.d.ts.map +1 -1
- package/dist/resources/wallets.js +12 -28
- package/dist/resources/wallets.js.map +1 -1
- package/dist/resources/webhooks.d.ts.map +1 -1
- package/dist/resources/webhooks.js +1 -3
- package/dist/resources/webhooks.js.map +1 -1
- package/dist/resources/withdrawals.d.ts +16 -4
- package/dist/resources/withdrawals.d.ts.map +1 -1
- package/dist/resources/withdrawals.js +28 -11
- package/dist/resources/withdrawals.js.map +1 -1
- package/dist/types/index.d.ts +300 -65
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +7 -6
- package/dist/src/client.d.ts +0 -19
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -146
- package/dist/src/client.js.map +0 -1
- package/dist/src/errors/index.d.ts +0 -28
- package/dist/src/errors/index.d.ts.map +0 -1
- package/dist/src/errors/index.js +0 -59
- package/dist/src/errors/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -41
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -84
- package/dist/src/index.js.map +0 -1
- package/dist/src/resources/analytics.d.ts +0 -23
- package/dist/src/resources/analytics.d.ts.map +0 -1
- package/dist/src/resources/analytics.js +0 -36
- package/dist/src/resources/analytics.js.map +0 -1
- package/dist/src/resources/balances.d.ts +0 -23
- package/dist/src/resources/balances.d.ts.map +0 -1
- package/dist/src/resources/balances.js +0 -54
- package/dist/src/resources/balances.js.map +0 -1
- package/dist/src/resources/contact.d.ts +0 -19
- package/dist/src/resources/contact.d.ts.map +0 -1
- package/dist/src/resources/contact.js +0 -17
- package/dist/src/resources/contact.js.map +0 -1
- package/dist/src/resources/customers.d.ts +0 -113
- package/dist/src/resources/customers.d.ts.map +0 -1
- package/dist/src/resources/customers.js +0 -113
- package/dist/src/resources/customers.js.map +0 -1
- package/dist/src/resources/invoices.d.ts +0 -21
- package/dist/src/resources/invoices.d.ts.map +0 -1
- package/dist/src/resources/invoices.js +0 -33
- package/dist/src/resources/invoices.js.map +0 -1
- package/dist/src/resources/merchants.d.ts +0 -120
- package/dist/src/resources/merchants.d.ts.map +0 -1
- package/dist/src/resources/merchants.js +0 -139
- package/dist/src/resources/merchants.js.map +0 -1
- package/dist/src/resources/payments.d.ts +0 -60
- package/dist/src/resources/payments.d.ts.map +0 -1
- package/dist/src/resources/payments.js +0 -188
- package/dist/src/resources/payments.js.map +0 -1
- package/dist/src/resources/refunds.d.ts +0 -31
- package/dist/src/resources/refunds.d.ts.map +0 -1
- package/dist/src/resources/refunds.js +0 -66
- package/dist/src/resources/refunds.js.map +0 -1
- package/dist/src/resources/sandbox.d.ts +0 -11
- package/dist/src/resources/sandbox.d.ts.map +0 -1
- package/dist/src/resources/sandbox.js +0 -16
- package/dist/src/resources/sandbox.js.map +0 -1
- package/dist/src/resources/security.d.ts +0 -56
- package/dist/src/resources/security.d.ts.map +0 -1
- package/dist/src/resources/security.js +0 -70
- package/dist/src/resources/security.js.map +0 -1
- package/dist/src/resources/transactions.d.ts +0 -25
- package/dist/src/resources/transactions.d.ts.map +0 -1
- package/dist/src/resources/transactions.js +0 -21
- package/dist/src/resources/transactions.js.map +0 -1
- package/dist/src/resources/wallets.d.ts +0 -61
- package/dist/src/resources/wallets.d.ts.map +0 -1
- package/dist/src/resources/wallets.js +0 -69
- package/dist/src/resources/wallets.js.map +0 -1
- package/dist/src/resources/webhooks.d.ts +0 -17
- package/dist/src/resources/webhooks.d.ts.map +0 -1
- package/dist/src/resources/webhooks.js +0 -128
- package/dist/src/resources/webhooks.js.map +0 -1
- package/dist/src/resources/withdrawals.d.ts +0 -39
- package/dist/src/resources/withdrawals.d.ts.map +0 -1
- package/dist/src/resources/withdrawals.js +0 -68
- package/dist/src/resources/withdrawals.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -581
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -8
- package/dist/src/types/index.js.map +0 -1
- package/dist/tests/error-handling.test.d.ts +0 -2
- package/dist/tests/error-handling.test.d.ts.map +0 -1
- package/dist/tests/error-handling.test.js +0 -145
- package/dist/tests/error-handling.test.js.map +0 -1
- package/dist/tests/fiddupay.test.d.ts +0 -2
- package/dist/tests/fiddupay.test.d.ts.map +0 -1
- package/dist/tests/fiddupay.test.js +0 -440
- package/dist/tests/fiddupay.test.js.map +0 -1
- package/dist/tests/sdk-integration.test.d.ts +0 -2
- package/dist/tests/sdk-integration.test.d.ts.map +0 -1
- package/dist/tests/sdk-integration.test.js +0 -352
- package/dist/tests/sdk-integration.test.js.map +0 -1
- package/dist/tests/setup.d.ts +0 -2
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/setup.js +0 -22
- package/dist/tests/setup.js.map +0 -1
- package/dist/tests/webhooks.test.d.ts +0 -2
- package/dist/tests/webhooks.test.d.ts.map +0 -1
- package/dist/tests/webhooks.test.js +0 -63
- package/dist/tests/webhooks.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# FidduPay Node.js SDK v2.5.
|
|
1
|
+
# FidduPay Node.js SDK v2.5.2
|
|
2
2
|
|
|
3
|
-
[](https://github.com/fiddupay/fiddupay-node)
|
|
4
4
|
[](https://www.npmjs.com/package/@fiddupay/fiddupay-node)
|
|
5
5
|
[](https://github.com/fiddupay/fiddupay-node/actions)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
Official Node.js SDK for the FidduPay cryptocurrency payment gateway platform with **
|
|
8
|
+
Official Node.js SDK for the FidduPay cryptocurrency payment gateway platform with **2-Mode Wallet System**.
|
|
9
9
|
|
|
10
10
|
## Daily Volume Limits
|
|
11
11
|
|
|
@@ -115,7 +115,8 @@ const payment = await client.payments.retrieve('pay_123');
|
|
|
115
115
|
|
|
116
116
|
```typescript
|
|
117
117
|
const payments = await client.payments.list({
|
|
118
|
-
|
|
118
|
+
page: 1,
|
|
119
|
+
page_size: 10,
|
|
119
120
|
status: 'completed'
|
|
120
121
|
});
|
|
121
122
|
```
|
|
@@ -394,7 +395,8 @@ Grouped by `client.*` resource modules for reference:
|
|
|
394
395
|
| Module | Methods |
|
|
395
396
|
| :--- | :--- |
|
|
396
397
|
| **`merchants`** | `register()`, `retrieve()`, `getStatus()`, `switchEnvironment()`, `generateApiKey()`, `rotateApiKey()`, `getFeeSetting()`, `updateSettings()`, `getSettings()`, `sendTestWebhook()`, `getIpWhitelist()`, `getBalance()`, `getAuditLogs()`, `getBalanceHistory()` |
|
|
397
|
-
| **`payments`** | `create()`, `retrieve()`, `list()`, `cancel()`, `verify()`, `finalizeSelection()`, `
|
|
398
|
+
| **`payments`** | `create()`, `retrieve()`, `list()`, `cancel()`, `verify()`, `finalizeSelection()`, `getAnalytics()`, `updateFeeSetting()`, `getFeeSetting()` |
|
|
399
|
+
| **`addressOnly`** | `create()`, `retrieve()`, `listCurrencies()`, `getStats()`, `getHealth()`, `getFeeSetting()`, `setFeeSetting()` |
|
|
398
400
|
| **`wallets`** | `setup()`, `getConfigurations()`, `getBalances()`, `getGasEstimates()`, `checkGasRequirements()`, `gasCheck()`, `checkWithdrawalCapability()`, `revoke()` |
|
|
399
401
|
| **`balances`** | `get()`, `getHistory()` |
|
|
400
402
|
| **`auditLogs`** | `list()` |
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQzD,qBAAa,UAAU;IACrB,OAAO,C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,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;CAG/E"}
|
package/dist/client.js
CHANGED
|
@@ -10,7 +10,7 @@ class HttpClient {
|
|
|
10
10
|
constructor(config) {
|
|
11
11
|
this.apiKey = config.apiKey;
|
|
12
12
|
this.maxRetries = config.maxRetries || 3;
|
|
13
|
-
const baseURL = config.baseURL || this.getBaseURL(
|
|
13
|
+
const baseURL = config.baseURL || this.getBaseURL();
|
|
14
14
|
this.client = axios_1.default.create({
|
|
15
15
|
baseURL,
|
|
16
16
|
timeout: config.timeout || 30000,
|
|
@@ -24,10 +24,8 @@ class HttpClient {
|
|
|
24
24
|
});
|
|
25
25
|
this.setupInterceptors();
|
|
26
26
|
}
|
|
27
|
-
getBaseURL(
|
|
28
|
-
return
|
|
29
|
-
? 'https://api.fiddupay.com/v1'
|
|
30
|
-
: 'https://api-sandbox.fiddupay.com/v1';
|
|
27
|
+
getBaseURL() {
|
|
28
|
+
return 'https://api.fiddupay.com';
|
|
31
29
|
}
|
|
32
30
|
setupInterceptors() {
|
|
33
31
|
// Request interceptor
|
|
@@ -80,7 +78,7 @@ class HttpClient {
|
|
|
80
78
|
config.data = data;
|
|
81
79
|
}
|
|
82
80
|
// Don't add Authorization header for registration endpoint or registration key
|
|
83
|
-
if (path !== '/api/v1/
|
|
81
|
+
if (path !== '/api/v1/merchants/register' && path !== '/api/v1/merchants/login' && this.apiKey !== 'registration_key') {
|
|
84
82
|
config.headers = {
|
|
85
83
|
'Authorization': `Bearer ${this.apiKey}`
|
|
86
84
|
};
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAgF;AAEhF,qCAKkB;AAElB,MAAa,UAAU;IAKrB,YAAY,MAAsB;Q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K,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;gBAC5C,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,SAAU,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAI,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,IAAY,EAAE,IAAU,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,IAAU,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAI,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CAAI,IAAY,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,KAAK,CAAI,IAAY,EAAE,IAAU,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAI,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AA7KD,gCA6KC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { Customers } from './resources/customers';
|
|
|
13
13
|
import { Sandbox } from './resources/sandbox';
|
|
14
14
|
import { Contact } from './resources/contact';
|
|
15
15
|
import { Transactions } from './resources/transactions';
|
|
16
|
+
import { Public } from './resources/public';
|
|
17
|
+
import { AddressOnly } from './resources/address_only';
|
|
16
18
|
export declare class FidduPayClient {
|
|
17
19
|
private client;
|
|
18
20
|
readonly payments: Payments;
|
|
@@ -30,12 +32,15 @@ export declare class FidduPayClient {
|
|
|
30
32
|
readonly sandbox: Sandbox;
|
|
31
33
|
readonly contact: Contact;
|
|
32
34
|
readonly transactions: Transactions;
|
|
35
|
+
readonly public: Public;
|
|
36
|
+
readonly addressOnly: AddressOnly;
|
|
33
37
|
constructor(config: FidduPayConfig);
|
|
34
38
|
private validateConfig;
|
|
35
39
|
}
|
|
36
40
|
export * from './types';
|
|
37
41
|
export * from './errors';
|
|
38
42
|
export { Webhooks } from './resources/webhooks';
|
|
43
|
+
export { Public } from './resources/public';
|
|
39
44
|
export { FidduPayClient as FidduPay };
|
|
40
45
|
export default FidduPayClient;
|
|
41
46
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EA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Q,CAAC;IACnC,SAAgB,SAAS,EAAE,SAAS,CAAC;IACrC,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,SAAS,EAAE,iBAAiB,CAAC;IAC7C,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;IAC3C,SAAgB,QAAQ,kBAAY;IACpC,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,WAAW,EAAE,WAAW,CAAC;IACzC,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IACnC,SAAgB,SAAS,EAAE,SAAS,CAAC;IACrC,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IACnC,SAAgB,SAAS,EAAE,SAAS,CAAC;IACrC,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,WAAW,EAAE,WAAW,CAAC;gBAE7B,MAAM,EAAE,cAAc;IAwBlC,OAAO,CAAC,cAAc;CAuBvB;AAGD,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,CAAC;AAGtC,eAAe,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.FidduPay = exports.Webhooks = exports.FidduPayClient = void 0;
|
|
17
|
+
exports.FidduPay = exports.Public = exports.Webhooks = exports.FidduPayClient = void 0;
|
|
18
18
|
const client_1 = require("./client");
|
|
19
19
|
const errors_1 = require("./errors");
|
|
20
20
|
const payments_1 = require("./resources/payments");
|
|
@@ -31,6 +31,8 @@ const customers_1 = require("./resources/customers");
|
|
|
31
31
|
const sandbox_1 = require("./resources/sandbox");
|
|
32
32
|
const contact_1 = require("./resources/contact");
|
|
33
33
|
const transactions_1 = require("./resources/transactions");
|
|
34
|
+
const public_1 = require("./resources/public");
|
|
35
|
+
const address_only_1 = require("./resources/address_only");
|
|
34
36
|
class FidduPayClient {
|
|
35
37
|
constructor(config) {
|
|
36
38
|
this.webhooks = webhooks_1.Webhooks;
|
|
@@ -51,6 +53,8 @@ class FidduPayClient {
|
|
|
51
53
|
this.sandbox = new sandbox_1.Sandbox(this.client);
|
|
52
54
|
this.contact = new contact_1.Contact(this.client);
|
|
53
55
|
this.transactions = new transactions_1.Transactions(this.client);
|
|
56
|
+
this.public = new public_1.Public(this.client);
|
|
57
|
+
this.addressOnly = new address_only_1.AddressOnly(this.client);
|
|
54
58
|
}
|
|
55
59
|
validateConfig(config) {
|
|
56
60
|
if (!config.apiKey) {
|
|
@@ -60,24 +64,10 @@ class FidduPayClient {
|
|
|
60
64
|
if (config.apiKey === 'registration_key') {
|
|
61
65
|
return; // Skip validation for registration
|
|
62
66
|
}
|
|
63
|
-
//
|
|
67
|
+
// Validate API key format
|
|
64
68
|
if (!config.apiKey.startsWith('sk_') && !config.apiKey.startsWith('live_')) {
|
|
65
69
|
throw new errors_1.FidduPayValidationError('Invalid API key format. API key must start with "sk_" (sandbox) or "live_" (production)');
|
|
66
70
|
}
|
|
67
|
-
// Auto-detect environment from API key if not specified
|
|
68
|
-
if (!config.environment) {
|
|
69
|
-
config.environment = config.apiKey.startsWith('sk_') ? 'sandbox' : 'production';
|
|
70
|
-
}
|
|
71
|
-
if (config.environment && !['sandbox', 'production'].includes(config.environment)) {
|
|
72
|
-
throw new errors_1.FidduPayValidationError('Environment must be either "sandbox" or "production"');
|
|
73
|
-
}
|
|
74
|
-
// Validate API key matches environment
|
|
75
|
-
if (config.environment === 'sandbox' && !config.apiKey.startsWith('sk_')) {
|
|
76
|
-
throw new errors_1.FidduPayValidationError('Sandbox environment requires API key starting with "sk_"');
|
|
77
|
-
}
|
|
78
|
-
if (config.environment === 'production' && !config.apiKey.startsWith('live_')) {
|
|
79
|
-
throw new errors_1.FidduPayValidationError('Production environment requires API key starting with "live_"');
|
|
80
|
-
}
|
|
81
71
|
if (config.timeout && (config.timeout < 1000 || config.timeout > 60000)) {
|
|
82
72
|
throw new errors_1.FidduPayValidationError('Timeout must be between 1000ms and 60000ms');
|
|
83
73
|
}
|
|
@@ -93,6 +83,8 @@ __exportStar(require("./types"), exports);
|
|
|
93
83
|
__exportStar(require("./errors"), exports);
|
|
94
84
|
var webhooks_2 = require("./resources/webhooks");
|
|
95
85
|
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_2.Webhooks; } });
|
|
86
|
+
var public_2 = require("./resources/public");
|
|
87
|
+
Object.defineProperty(exports, "Public", { enumerable: true, get: function () { return public_2.Public; } });
|
|
96
88
|
// Default export
|
|
97
89
|
exports.default = FidduPayClient;
|
|
98
90
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAsC;AAEtC,qCAAmD;AACnD,mDAAgD;AAChD,qDAAkD;AAClD,iDAA8C;AAC9C,qDAA0D;AAC1D,mDAAwD;AACxD,mDAAgD;AAChD,iDAA8C;AAC9C,yDAAsD;AACtD,mDAAgD;AAChD,mDAA2D;AAC3D,qDAAkD;AAClD,iDAA8C;AAC9C,iDAA8C;AAC9C,2DAAwD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAsC;AAEtC,qCAAmD;A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,GAAG,CAAC,IAAI,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC;YAC3E,MAAM,IAAI,gCAAuB,CAAC,sCAAsC,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF;AApED,wCAoEC;AAS0B,kCAAQ;AAPnC,oBAAoB;AACpB,0CAAwB;AACxB,2CAAyB;AACzB,iDAAgD;AAAvC,oGAAA,QAAQ,OAAA;AACjB,6CAA4C;AAAnC,gGAAA,MAAM,OAAA;AAKf,iBAAiB;AACjB,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { CreateAddressOnlyPaymentRequest, AddressOnlyPaymentResponse, AddressOnlyPayment, AddressOnlyStats, RequestOptions } from '../types';
|
|
3
|
+
export declare class AddressOnly {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create an address-only payment request
|
|
8
|
+
*/
|
|
9
|
+
createPayment(data: CreateAddressOnlyPaymentRequest, options?: RequestOptions): Promise<AddressOnlyPaymentResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Get address-only payment status
|
|
12
|
+
*/
|
|
13
|
+
getStatus(paymentId: string, options?: RequestOptions): Promise<AddressOnlyPayment>;
|
|
14
|
+
/**
|
|
15
|
+
* Get supported native currencies
|
|
16
|
+
*/
|
|
17
|
+
getCurrencies(options?: RequestOptions): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Get address-only mode statistics
|
|
20
|
+
*/
|
|
21
|
+
getStats(options?: RequestOptions): Promise<AddressOnlyStats>;
|
|
22
|
+
/**
|
|
23
|
+
* Get address-only mode health status
|
|
24
|
+
*/
|
|
25
|
+
getHealth(options?: RequestOptions): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Update merchant fee payment setting
|
|
28
|
+
*/
|
|
29
|
+
updateFeeSetting(customerPaysFee: boolean, options?: RequestOptions): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
message: string;
|
|
32
|
+
customer_pays_fee: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Get merchant fee setting
|
|
36
|
+
*/
|
|
37
|
+
getFeeSetting(options?: RequestOptions): Promise<{
|
|
38
|
+
customer_pays_fee: boolean;
|
|
39
|
+
description: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=address_only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address_only.d.ts","sourceRoot":"","sources":["../../src/resources/address_only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7I,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,aAAa,CAAC,IAAI,EAAE,+BAA+B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIzH;;OAEG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIzF;;OAEG;IACG,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhE;;OAEG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAInE;;OAEG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAIvD;;OAEG;IACG,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,OAAO,CAAA;KAAE,CAAC;IAItJ;;OAEG;IACG,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,iBAAiB,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAG5G"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressOnly = void 0;
|
|
4
|
+
class AddressOnly {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Create an address-only payment request
|
|
10
|
+
*/
|
|
11
|
+
async createPayment(data, options) {
|
|
12
|
+
return this.client.request('POST', '/api/v1/merchants/address-only/create', data);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get address-only payment status
|
|
16
|
+
*/
|
|
17
|
+
async getStatus(paymentId, options) {
|
|
18
|
+
return this.client.request('GET', `/api/v1/merchants/address-only/status?payment_id=${paymentId}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get supported native currencies
|
|
22
|
+
*/
|
|
23
|
+
async getCurrencies(options) {
|
|
24
|
+
return this.client.request('GET', '/api/v1/merchants/address-only/currencies');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get address-only mode statistics
|
|
28
|
+
*/
|
|
29
|
+
async getStats(options) {
|
|
30
|
+
return this.client.request('GET', '/api/v1/merchants/address-only/stats');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get address-only mode health status
|
|
34
|
+
*/
|
|
35
|
+
async getHealth(options) {
|
|
36
|
+
return this.client.request('GET', '/api/v1/merchants/address-only/health');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Update merchant fee payment setting
|
|
40
|
+
*/
|
|
41
|
+
async updateFeeSetting(customerPaysFee, options) {
|
|
42
|
+
return this.client.request('PUT', '/api/v1/merchants/address-only/fee-setting', { customer_pays_fee: customerPaysFee });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get merchant fee setting
|
|
46
|
+
*/
|
|
47
|
+
async getFeeSetting(options) {
|
|
48
|
+
return this.client.request('GET', '/api/v1/merchants/address-only/fee-setting');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.AddressOnly = AddressOnly;
|
|
52
|
+
//# sourceMappingURL=address_only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address_only.js","sourceRoot":"","sources":["../../src/resources/address_only.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;IACtB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,IAAqC,EAAE,OAAwB;QACjF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,uCAAuC,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,SAAiB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,oDAAoD,SAAS,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,2CAA2C,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,OAAwB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,uCAAuC,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,eAAwB,EAAE,OAAwB;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,4CAA4C,EAAE,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC,CAAC;IAC1H,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAC;IAClF,CAAC;CACF;AAnDD,kCAmDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '../client';
|
|
2
|
-
import { Balance, BalanceHistory, AuditLog, ListAuditLogsParams, ListBalanceHistoryParams
|
|
2
|
+
import { Balance, BalanceHistory, AuditLog, ListAuditLogsParams, ListBalanceHistoryParams } from '../types';
|
|
3
3
|
export declare class Balances {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: HttpClient);
|
|
@@ -10,7 +10,7 @@ export declare class Balances {
|
|
|
10
10
|
/**
|
|
11
11
|
* Get balance history
|
|
12
12
|
*/
|
|
13
|
-
getHistory(params?: ListBalanceHistoryParams): Promise<
|
|
13
|
+
getHistory(params?: ListBalanceHistoryParams): Promise<BalanceHistory>;
|
|
14
14
|
}
|
|
15
15
|
export declare class AuditLogs {
|
|
16
16
|
private client;
|
|
@@ -18,6 +18,6 @@ export declare class AuditLogs {
|
|
|
18
18
|
/**
|
|
19
19
|
* Get audit logs
|
|
20
20
|
*/
|
|
21
|
-
list(params?: ListAuditLogsParams): Promise<
|
|
21
|
+
list(params?: ListAuditLogsParams): Promise<AuditLog[]>;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=balances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../src/resources/balances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,OAAO,EACP,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../src/resources/balances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,OAAO,EACP,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,wBAAwB,EAEzB,MAAM,UAAU,CAAC;AAElB,qBAAa,QAAQ;IACP,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7B;;OAEG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC;CAc7E;AAED,qBAAa,SAAS;IACR,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAc9D"}
|
|
@@ -16,12 +16,13 @@ class Balances {
|
|
|
16
16
|
*/
|
|
17
17
|
async getHistory(params) {
|
|
18
18
|
const queryParams = new URLSearchParams();
|
|
19
|
-
if (params
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
if (params) {
|
|
20
|
+
for (const [key, value] of Object.entries(params)) {
|
|
21
|
+
if (value !== undefined && value !== null) {
|
|
22
|
+
queryParams.append(key, value.toString());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
25
26
|
const url = `/api/v1/merchants/balance/history${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
|
|
26
27
|
return this.client.request('GET', url);
|
|
27
28
|
}
|
|
@@ -36,16 +37,13 @@ class AuditLogs {
|
|
|
36
37
|
*/
|
|
37
38
|
async list(params) {
|
|
38
39
|
const queryParams = new URLSearchParams();
|
|
39
|
-
if (params
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
queryParams.append('start_date', params.start_date);
|
|
47
|
-
if (params?.end_date)
|
|
48
|
-
queryParams.append('end_date', params.end_date);
|
|
40
|
+
if (params) {
|
|
41
|
+
for (const [key, value] of Object.entries(params)) {
|
|
42
|
+
if (value !== undefined && value !== null) {
|
|
43
|
+
queryParams.append(key, value.toString());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
49
47
|
const url = `/api/v1/merchants/audit-logs${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
|
|
50
48
|
return this.client.request('GET', url);
|
|
51
49
|
}
|
|
@@ -1 +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,
|
|
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,MAA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CAAC;QAED,MAAM,GAAG,GAAG,+BAA+B,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACxG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAa,KAAK,EAAE,GAAG,CAAC,CAAC;IACrD,CAAC;CACF;AApBD,8BAoBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '../client';
|
|
2
|
-
import { MerchantCustomer, CreateCustomerRequest, ProvisionWalletRequest, CustomerBalanceResponse, CustomerWithdrawalRequest, CustomerSweepRequest, ListCustomersParams,
|
|
2
|
+
import { MerchantCustomer, CreateCustomerRequest, ProvisionWalletRequest, CustomerBalanceResponse, CustomerWithdrawalRequest, CustomerSweepRequest, ListCustomersParams, RequestOptions, CustomerTransaction, CustomerStatusRequest, CustomerPermissionsRequest, CustomerWalletsResponse, CustomerWallet } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Customers Resource
|
|
5
5
|
*
|
|
@@ -15,22 +15,20 @@ export declare class Customers {
|
|
|
15
15
|
*/
|
|
16
16
|
register(data: CreateCustomerRequest, options?: RequestOptions): Promise<{
|
|
17
17
|
customer: MerchantCustomer;
|
|
18
|
+
wallets: CustomerWallet[];
|
|
18
19
|
message: string;
|
|
19
20
|
}>;
|
|
20
21
|
/**
|
|
21
22
|
* Provision designated wallets for a customer.
|
|
22
23
|
* You can request "evm" (covers ETH, BSC, Polygon, Arb) and/or "solana".
|
|
23
24
|
*/
|
|
24
|
-
createWallets(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
|
-
}>;
|
|
25
|
+
createWallets(externalId: string, data: ProvisionWalletRequest, options?: RequestOptions): Promise<CustomerWalletsResponse & {
|
|
32
26
|
message: string;
|
|
33
27
|
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve the provisioned designated wallets for a customer.
|
|
30
|
+
*/
|
|
31
|
+
getWallets(externalId: string, options?: RequestOptions): Promise<CustomerWalletsResponse>;
|
|
34
32
|
/**
|
|
35
33
|
* Retrieve the current balances for a customer across all their designated wallets.
|
|
36
34
|
*/
|
|
@@ -38,7 +36,13 @@ export declare class Customers {
|
|
|
38
36
|
/**
|
|
39
37
|
* List all registered customers for the merchant with pagination.
|
|
40
38
|
*/
|
|
41
|
-
list(params?: ListCustomersParams, options?: RequestOptions): Promise<
|
|
39
|
+
list(params?: ListCustomersParams, options?: RequestOptions): Promise<{
|
|
40
|
+
customers: MerchantCustomer[];
|
|
41
|
+
total: number;
|
|
42
|
+
has_more: boolean;
|
|
43
|
+
limit: number;
|
|
44
|
+
offset: number;
|
|
45
|
+
}>;
|
|
42
46
|
/**
|
|
43
47
|
* Withdraw funds directly from a customer's designated wallet balance.
|
|
44
48
|
*/
|
|
@@ -54,5 +58,57 @@ export declare class Customers {
|
|
|
54
58
|
swept_amount: string;
|
|
55
59
|
message: string;
|
|
56
60
|
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Deactivate a customer.
|
|
63
|
+
* This preserves their history but prevents further activity.
|
|
64
|
+
*/
|
|
65
|
+
deactivate(externalId: string, options?: RequestOptions): Promise<{
|
|
66
|
+
message: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Get transaction history for a specific customer.
|
|
70
|
+
*/
|
|
71
|
+
getTransactions(externalId: string, params?: {
|
|
72
|
+
limit?: number;
|
|
73
|
+
offset?: number;
|
|
74
|
+
}, options?: RequestOptions): Promise<{
|
|
75
|
+
transactions: CustomerTransaction[];
|
|
76
|
+
total: number;
|
|
77
|
+
limit: number;
|
|
78
|
+
offset: number;
|
|
79
|
+
external_id: string;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Update customer status (active, suspended, inactive).
|
|
83
|
+
*/
|
|
84
|
+
updateStatus(externalId: string, data: CustomerStatusRequest, options?: RequestOptions): Promise<{
|
|
85
|
+
message: string;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Update customer-specific permissions and limits.
|
|
89
|
+
*/
|
|
90
|
+
updatePermissions(externalId: string, data: CustomerPermissionsRequest, options?: RequestOptions): Promise<{
|
|
91
|
+
message: string;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Get the specific deposit address for a customer for a given cryptocurrency.
|
|
95
|
+
*/
|
|
96
|
+
getDepositAddress(externalId: string, cryptoType: string, options?: RequestOptions): Promise<{
|
|
97
|
+
address: string;
|
|
98
|
+
crypto_type: string;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Initiate an internal payment from a customer's designated wallet balance to the merchant's master balance.
|
|
102
|
+
* This is useful for charging users for services on your platform.
|
|
103
|
+
*/
|
|
104
|
+
payMerchant(externalId: string, data: {
|
|
105
|
+
crypto_type: string;
|
|
106
|
+
amount: string;
|
|
107
|
+
reference_id?: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
}, options?: RequestOptions): Promise<{
|
|
110
|
+
transaction: any;
|
|
111
|
+
message: string;
|
|
112
|
+
}>;
|
|
57
113
|
}
|
|
58
114
|
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/resources/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA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;OAEG;IACG,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAK5I;;;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"}
|
|
@@ -22,8 +22,14 @@ class Customers {
|
|
|
22
22
|
* Provision designated wallets for a customer.
|
|
23
23
|
* You can request "evm" (covers ETH, BSC, Polygon, Arb) and/or "solana".
|
|
24
24
|
*/
|
|
25
|
-
async createWallets(data, options) {
|
|
26
|
-
return this.client.post(
|
|
25
|
+
async createWallets(externalId, data, options) {
|
|
26
|
+
return this.client.post(`/api/v1/merchants/customers/${externalId}/wallets`, data, options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve the provisioned designated wallets for a customer.
|
|
30
|
+
*/
|
|
31
|
+
async getWallets(externalId, options) {
|
|
32
|
+
return this.client.get(`/api/v1/merchants/customers/${externalId}/wallets`, options);
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
35
|
* Retrieve the current balances for a customer across all their designated wallets.
|
|
@@ -36,10 +42,13 @@ class Customers {
|
|
|
36
42
|
*/
|
|
37
43
|
async list(params, options) {
|
|
38
44
|
const queryParams = new URLSearchParams();
|
|
39
|
-
if (params
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
if (params) {
|
|
46
|
+
for (const [key, value] of Object.entries(params)) {
|
|
47
|
+
if (value !== undefined && value !== null) {
|
|
48
|
+
queryParams.append(key, value.toString());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
43
52
|
const query = queryParams.toString();
|
|
44
53
|
const path = query ? `/api/v1/merchants/customers?${query}` : '/api/v1/merchants/customers';
|
|
45
54
|
return this.client.get(path, options);
|
|
@@ -57,6 +66,54 @@ class Customers {
|
|
|
57
66
|
async sweep(externalId, data, options) {
|
|
58
67
|
return this.client.post(`/api/v1/merchants/customers/${externalId}/sweep`, data, options);
|
|
59
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Deactivate a customer.
|
|
71
|
+
* This preserves their history but prevents further activity.
|
|
72
|
+
*/
|
|
73
|
+
async deactivate(externalId, options) {
|
|
74
|
+
return this.client.post(`/api/v1/merchants/customers/${externalId}/deactivate`, {}, options);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get transaction history for a specific customer.
|
|
78
|
+
*/
|
|
79
|
+
async getTransactions(externalId, params, options) {
|
|
80
|
+
const queryParams = new URLSearchParams();
|
|
81
|
+
if (params) {
|
|
82
|
+
for (const [key, value] of Object.entries(params)) {
|
|
83
|
+
if (value !== undefined && value !== null) {
|
|
84
|
+
queryParams.append(key, value.toString());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const path = `/api/v1/merchants/customers/${externalId}/transactions${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
|
|
89
|
+
return this.client.get(path, options);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update customer status (active, suspended, inactive).
|
|
93
|
+
*/
|
|
94
|
+
async updateStatus(externalId, data, options) {
|
|
95
|
+
return this.client.patch(`/api/v1/merchants/customers/${externalId}/status`, data, options);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Update customer-specific permissions and limits.
|
|
99
|
+
*/
|
|
100
|
+
async updatePermissions(externalId, data, options) {
|
|
101
|
+
return this.client.patch(`/api/v1/merchants/customers/${externalId}/permissions`, data, options);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get the specific deposit address for a customer for a given cryptocurrency.
|
|
105
|
+
*/
|
|
106
|
+
async getDepositAddress(externalId, cryptoType, options) {
|
|
107
|
+
const response = await this.client.get(`/api/v1/merchants/customers/${externalId}/deposit-address/${cryptoType}`, options);
|
|
108
|
+
return { address: response.deposit_address, crypto_type: response.crypto_type };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Initiate an internal payment from a customer's designated wallet balance to the merchant's master balance.
|
|
112
|
+
* This is useful for charging users for services on your platform.
|
|
113
|
+
*/
|
|
114
|
+
async payMerchant(externalId, data, options) {
|
|
115
|
+
return this.client.post(`/api/v1/merchants/customers/${externalId}/pay-merchant`, data, options);
|
|
116
|
+
}
|
|
60
117
|
}
|
|
61
118
|
exports.Customers = Customers;
|
|
62
119
|
//# sourceMappingURL=customers.js.map
|