@fiddupay/fiddupay-node 2.4.5 → 2.4.7
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 +50 -7
- package/dist/src/client.d.ts +19 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +148 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/errors/index.d.ts +28 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/errors/index.js +59 -0
- package/dist/src/errors/index.js.map +1 -0
- package/dist/src/index.d.ts +41 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +98 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/resources/analytics.d.ts +23 -0
- package/dist/src/resources/analytics.d.ts.map +1 -0
- package/dist/src/resources/analytics.js +36 -0
- package/dist/src/resources/analytics.js.map +1 -0
- package/dist/src/resources/balances.d.ts +23 -0
- package/dist/src/resources/balances.d.ts.map +1 -0
- package/dist/src/resources/balances.js +54 -0
- package/dist/src/resources/balances.js.map +1 -0
- package/dist/src/resources/contact.d.ts +19 -0
- package/dist/src/resources/contact.d.ts.map +1 -0
- package/dist/src/resources/contact.js +17 -0
- package/dist/src/resources/contact.js.map +1 -0
- package/dist/src/resources/customers.d.ts +104 -0
- package/dist/src/resources/customers.d.ts.map +1 -0
- package/dist/src/resources/customers.js +106 -0
- package/dist/src/resources/customers.js.map +1 -0
- package/dist/src/resources/invoices.d.ts +14 -0
- package/dist/src/resources/invoices.d.ts.map +1 -0
- package/dist/src/resources/invoices.js +19 -0
- package/dist/src/resources/invoices.js.map +1 -0
- package/dist/src/resources/merchants.d.ts +102 -0
- package/dist/src/resources/merchants.d.ts.map +1 -0
- package/dist/src/resources/merchants.js +104 -0
- package/dist/src/resources/merchants.js.map +1 -0
- package/dist/src/resources/payments.d.ts +71 -0
- package/dist/src/resources/payments.d.ts.map +1 -0
- package/dist/src/resources/payments.js +206 -0
- package/dist/src/resources/payments.js.map +1 -0
- package/dist/src/resources/refunds.d.ts +31 -0
- package/dist/src/resources/refunds.d.ts.map +1 -0
- package/dist/src/resources/refunds.js +66 -0
- package/dist/src/resources/refunds.js.map +1 -0
- package/dist/src/resources/sandbox.d.ts +11 -0
- package/dist/src/resources/sandbox.d.ts.map +1 -0
- package/dist/src/resources/sandbox.js +16 -0
- package/dist/src/resources/sandbox.js.map +1 -0
- package/dist/src/resources/security.d.ts +56 -0
- package/dist/src/resources/security.d.ts.map +1 -0
- package/dist/src/resources/security.js +70 -0
- package/dist/src/resources/security.js.map +1 -0
- package/dist/src/resources/transactions.d.ts +25 -0
- package/dist/src/resources/transactions.d.ts.map +1 -0
- package/dist/src/resources/transactions.js +21 -0
- package/dist/src/resources/transactions.js.map +1 -0
- package/dist/src/resources/wallets.d.ts +64 -0
- package/dist/src/resources/wallets.d.ts.map +1 -0
- package/dist/src/resources/wallets.js +78 -0
- package/dist/src/resources/wallets.js.map +1 -0
- package/dist/src/resources/webhooks.d.ts +17 -0
- package/dist/src/resources/webhooks.d.ts.map +1 -0
- package/dist/src/resources/webhooks.js +130 -0
- package/dist/src/resources/webhooks.js.map +1 -0
- package/dist/src/resources/withdrawals.d.ts +39 -0
- package/dist/src/resources/withdrawals.d.ts.map +1 -0
- package/dist/src/resources/withdrawals.js +69 -0
- package/dist/src/resources/withdrawals.js.map +1 -0
- package/dist/src/types/index.d.ts +530 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +8 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/tests/error-handling.test.d.ts +2 -0
- package/dist/tests/error-handling.test.d.ts.map +1 -0
- package/dist/tests/error-handling.test.js +168 -0
- package/dist/tests/error-handling.test.js.map +1 -0
- package/dist/tests/fiddupay.test.d.ts +2 -0
- package/dist/tests/fiddupay.test.d.ts.map +1 -0
- package/dist/tests/fiddupay.test.js +336 -0
- package/dist/tests/fiddupay.test.js.map +1 -0
- package/dist/tests/sdk-integration.test.d.ts +2 -0
- package/dist/tests/sdk-integration.test.d.ts.map +1 -0
- package/dist/tests/sdk-integration.test.js +229 -0
- package/dist/tests/sdk-integration.test.js.map +1 -0
- package/dist/tests/setup.d.ts +2 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +22 -0
- package/dist/tests/setup.js.map +1 -0
- package/dist/tests/webhooks.test.d.ts +2 -0
- package/dist/tests/webhooks.test.d.ts.map +1 -0
- package/dist/tests/webhooks.test.js +63 -0
- package/dist/tests/webhooks.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -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,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9G;;OAEG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7E;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;QACpC,gBAAgB,EAAE,MAAM,CAAA;KACzB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAO1C;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC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: true });
|
|
3
|
+
exports.Payments = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
class Payments {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a new payment
|
|
11
|
+
*/
|
|
12
|
+
async create(data, options) {
|
|
13
|
+
this.validateCreatePayment(data);
|
|
14
|
+
return this.client.request('POST', '/api/v1/merchants/payments', data);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Finalize currency selection for a multi-currency payment
|
|
18
|
+
*/
|
|
19
|
+
async finalizeSelection(paymentId, data, options) {
|
|
20
|
+
if (!paymentId) {
|
|
21
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
22
|
+
}
|
|
23
|
+
if (!data.crypto_type) {
|
|
24
|
+
throw new errors_1.FidduPayValidationError('Crypto type is required', 'crypto_type');
|
|
25
|
+
}
|
|
26
|
+
return this.client.post(`/api/v1/merchants/payments/${paymentId}/select`, data, options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a payment by ID
|
|
30
|
+
*/
|
|
31
|
+
async retrieve(paymentId, options) {
|
|
32
|
+
if (!paymentId) {
|
|
33
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
34
|
+
}
|
|
35
|
+
return this.client.get(`/api/v1/merchants/payments/${paymentId}`, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Verify a payment with transaction hash
|
|
39
|
+
*/
|
|
40
|
+
async verify(paymentId, data, options) {
|
|
41
|
+
if (!paymentId) {
|
|
42
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
43
|
+
}
|
|
44
|
+
return this.client.request('POST', `/api/v1/merchants/payments/${paymentId}/verify`, data);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* List payments with optional filters
|
|
48
|
+
*/
|
|
49
|
+
async list(params, options) {
|
|
50
|
+
const queryParams = new URLSearchParams();
|
|
51
|
+
if (params?.limit)
|
|
52
|
+
queryParams.append('limit', params.limit.toString());
|
|
53
|
+
if (params?.offset)
|
|
54
|
+
queryParams.append('offset', params.offset.toString());
|
|
55
|
+
if (params?.status)
|
|
56
|
+
queryParams.append('status', params.status);
|
|
57
|
+
if (params?.crypto_type)
|
|
58
|
+
queryParams.append('crypto_type', params.crypto_type);
|
|
59
|
+
const query = queryParams.toString();
|
|
60
|
+
const path = query ? `/api/v1/merchants/payments?${query}` : '/api/v1/merchants/payments';
|
|
61
|
+
return this.client.request('GET', path);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Cancel a pending payment
|
|
65
|
+
*/
|
|
66
|
+
async cancel(paymentId, options) {
|
|
67
|
+
if (!paymentId) {
|
|
68
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
69
|
+
}
|
|
70
|
+
return this.client.post(`/api/v1/merchants/payments/${paymentId}/cancel`, {}, options);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create an address-only payment (WORK IN PROGRESS)
|
|
74
|
+
*/
|
|
75
|
+
async createAddressOnly(data, options) {
|
|
76
|
+
this.validateCreateAddressOnlyPayment(data);
|
|
77
|
+
return this.client.post('/api/v1/merchants/address-only/create', data, options);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Retrieve an address-only payment status by ID (WORK IN PROGRESS)
|
|
81
|
+
*/
|
|
82
|
+
async retrieveAddressOnly(paymentId, options) {
|
|
83
|
+
if (!paymentId) {
|
|
84
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
85
|
+
}
|
|
86
|
+
return this.client.get(`/api/v1/merchants/address-only/status?payment_id=${paymentId}`, options);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* List supported native currencies for address-only mode (EXPERIMENTAL)
|
|
90
|
+
*/
|
|
91
|
+
async listAddressOnlyCurrencies(options) {
|
|
92
|
+
return this.client.get('/api/v1/merchants/address-only/currencies', options);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get address-only mode statistics (EXPERIMENTAL)
|
|
96
|
+
*/
|
|
97
|
+
async getAddressOnlyStats(options) {
|
|
98
|
+
return this.client.get('/api/v1/merchants/address-only/stats', options);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get address-only mode health status (EXPERIMENTAL)
|
|
102
|
+
*/
|
|
103
|
+
async getAddressOnlyHealth(options) {
|
|
104
|
+
return this.client.get('/api/v1/merchants/address-only/health', options);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Update fee setting (customer pays fee vs merchant pays fee)
|
|
108
|
+
*/
|
|
109
|
+
async updateFeeSetting(data, options) {
|
|
110
|
+
if (typeof data.customer_pays_fee !== 'boolean') {
|
|
111
|
+
throw new errors_1.FidduPayValidationError('customer_pays_fee must be a boolean', 'customer_pays_fee');
|
|
112
|
+
}
|
|
113
|
+
return this.client.put('/api/v1/merchants/address-only/fee-setting', data, options);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get current fee setting
|
|
117
|
+
*/
|
|
118
|
+
async getFeeSetting(options) {
|
|
119
|
+
return this.client.get('/api/v1/merchants/address-only/fee-setting', options);
|
|
120
|
+
}
|
|
121
|
+
validateCreatePayment(data) {
|
|
122
|
+
// Validate that either amount or amount_usd is provided, but not both
|
|
123
|
+
if (data.amount && data.amount_usd) {
|
|
124
|
+
throw new errors_1.FidduPayValidationError('Provide either amount or amount_usd, not both', 'amount');
|
|
125
|
+
}
|
|
126
|
+
if (!data.amount && !data.amount_usd) {
|
|
127
|
+
throw new errors_1.FidduPayValidationError('Either amount or amount_usd must be provided', 'amount');
|
|
128
|
+
}
|
|
129
|
+
// Validate the provided amount (either amount or amount_usd)
|
|
130
|
+
const amountValue = data.amount || data.amount_usd;
|
|
131
|
+
const amount = parseFloat(amountValue);
|
|
132
|
+
if (isNaN(amount) || amount <= 0) {
|
|
133
|
+
throw new errors_1.FidduPayValidationError('Amount must be a positive number', data.amount ? 'amount' : 'amount_usd');
|
|
134
|
+
}
|
|
135
|
+
if (amount < 0.01) {
|
|
136
|
+
throw new errors_1.FidduPayValidationError('Minimum amount is $0.01', data.amount ? 'amount' : 'amount_usd');
|
|
137
|
+
}
|
|
138
|
+
// crypto_type is optional for multi-currency checkout
|
|
139
|
+
if (data.crypto_type) {
|
|
140
|
+
const validCryptoTypes = ['SOL', 'ETH', 'BNB', 'MATIC', 'ARB', 'USDT_ETH', 'USDT_BEP20', 'USDT_POLYGON', 'USDT_ARBITRUM', 'USDT_SPL', 'BTC'];
|
|
141
|
+
if (!validCryptoTypes.includes(data.crypto_type)) {
|
|
142
|
+
throw new errors_1.FidduPayValidationError(`Invalid crypto type. Must be one of: ${validCryptoTypes.join(', ')}`, 'crypto_type');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (data.expiration_minutes !== undefined) {
|
|
146
|
+
if (data.expiration_minutes < 5 || data.expiration_minutes > 1440) {
|
|
147
|
+
throw new errors_1.FidduPayValidationError('Expiration must be between 5 and 1440 minutes', 'expiration_minutes');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (data.description && data.description.length > 500) {
|
|
151
|
+
throw new errors_1.FidduPayValidationError('Description must be 500 characters or less', 'description');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
validateCreateAddressOnlyPayment(data) {
|
|
155
|
+
if (!data.requested_amount) {
|
|
156
|
+
throw new errors_1.FidduPayValidationError('Requested amount is required', 'requested_amount');
|
|
157
|
+
}
|
|
158
|
+
if (!data.crypto_type) {
|
|
159
|
+
throw new errors_1.FidduPayValidationError('Crypto type is required', 'crypto_type');
|
|
160
|
+
}
|
|
161
|
+
if (!data.merchant_address) {
|
|
162
|
+
throw new errors_1.FidduPayValidationError('Merchant address is required', 'merchant_address');
|
|
163
|
+
}
|
|
164
|
+
const amount = parseFloat(data.requested_amount);
|
|
165
|
+
if (isNaN(amount) || amount <= 0) {
|
|
166
|
+
throw new errors_1.FidduPayValidationError('Requested amount must be a positive number', 'requested_amount');
|
|
167
|
+
}
|
|
168
|
+
if (amount < 0.01) {
|
|
169
|
+
throw new errors_1.FidduPayValidationError('Minimum amount is $0.01', 'requested_amount');
|
|
170
|
+
}
|
|
171
|
+
// Note: No maximum amount limit - server enforces daily volume limits based on KYC status
|
|
172
|
+
const validCryptoTypes = ['SOL', 'ETH', 'BNB', 'MATIC', 'ARB', 'USDT_ETH', 'USDT_BEP20', 'USDT_POLYGON', 'USDT_ARBITRUM', 'USDT_SPL', 'BTC'];
|
|
173
|
+
if (!validCryptoTypes.includes(data.crypto_type)) {
|
|
174
|
+
throw new errors_1.FidduPayValidationError(`Invalid crypto type. Must be one of: ${validCryptoTypes.join(', ')}`, 'crypto_type');
|
|
175
|
+
}
|
|
176
|
+
if (data.expiration_minutes !== undefined) {
|
|
177
|
+
if (data.expiration_minutes < 5 || data.expiration_minutes > 1440) {
|
|
178
|
+
throw new errors_1.FidduPayValidationError('Expiration must be between 5 and 1440 minutes', 'expiration_minutes');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (data.description && data.description.length > 500) {
|
|
182
|
+
throw new errors_1.FidduPayValidationError('Description must be 500 characters or less', 'description');
|
|
183
|
+
}
|
|
184
|
+
// Basic address validation
|
|
185
|
+
if (data.merchant_address.length < 10) {
|
|
186
|
+
throw new errors_1.FidduPayValidationError('Invalid merchant address format', 'merchant_address');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get payment analytics and reporting
|
|
191
|
+
*/
|
|
192
|
+
async getAnalytics(params, options) {
|
|
193
|
+
const queryParams = new URLSearchParams();
|
|
194
|
+
if (params?.from_date)
|
|
195
|
+
queryParams.append('from_date', params.from_date);
|
|
196
|
+
if (params?.to_date)
|
|
197
|
+
queryParams.append('to_date', params.to_date);
|
|
198
|
+
if (params?.granularity)
|
|
199
|
+
queryParams.append('granularity', params.granularity);
|
|
200
|
+
const query = queryParams.toString();
|
|
201
|
+
const path = query ? `/api/v1/merchants/analytics?${query}` : '/api/v1/merchants/analytics';
|
|
202
|
+
return this.client.request('GET', path);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.Payments = Payments;
|
|
206
|
+
//# sourceMappingURL=payments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../../src/resources/payments.ts"],"names":[],"mappings":";;;AAgBA,sCAAoD;AAEpD,MAAa,QAAQ;IACnB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAA0B,EAAE,OAAwB;QAC/D,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,MAAM,EAAE,4BAA4B,EAAE,IAAI,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,SAAiB,EAAE,IAAsB,EAAE,OAAwB;QACzF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,gCAAuB,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,gCAAuB,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,8BAA8B,SAAS,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QACxD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,gCAAuB,CAAC,wBAAwB,EAA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D,MAAM,IAAI,gCAAuB,CAC/B,4CAA4C,EAC5C,aAAa,CACd,CAAC;QACJ,CAAC;QAED,2BAA2B;QAC3B,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YACtC,MAAM,IAAI,gCAAuB,CAC/B,iCAAiC,EACjC,kBAAkB,CACnB,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,MAIlB,EAAE,OAAwB;QACzB,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAC1C,IAAI,MAAM,EAAE,SAAS;YAAE,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACzE,IAAI,MAAM,EAAE,OAAO;YAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACnE,IAAI,MAAM,EAAE,WAAW;YAAE,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAE/E,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC;QAC5F,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF;AA5PD,4BA4PC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { CreateRefundRequest, Refund, RequestOptions } from '../types';
|
|
3
|
+
export declare class Refunds {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create a refund for a confirmed payment
|
|
8
|
+
*/
|
|
9
|
+
create(data: CreateRefundRequest, options?: RequestOptions): Promise<Refund>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve a refund by ID
|
|
12
|
+
*/
|
|
13
|
+
retrieve(refundId: string, options?: RequestOptions): Promise<Refund>;
|
|
14
|
+
/**
|
|
15
|
+
* Complete a refund
|
|
16
|
+
*/
|
|
17
|
+
complete(refundId: string, transactionHash: string, options?: RequestOptions): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* List refunds
|
|
20
|
+
*/
|
|
21
|
+
list(params?: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}, options?: RequestOptions): Promise<{
|
|
25
|
+
refunds: Refund[];
|
|
26
|
+
total: number;
|
|
27
|
+
has_more: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
private validateCreateRefund;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=refunds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refunds.d.ts","sourceRoot":"","sources":["../../../src/resources/refunds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvE,qBAAa,OAAO;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAKlF;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAO3E;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAUjG;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAC1F,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IAYF,OAAO,CAAC,oBAAoB;CAmB7B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Refunds = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
class Refunds {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a refund for a confirmed payment
|
|
11
|
+
*/
|
|
12
|
+
async create(data, options) {
|
|
13
|
+
this.validateCreateRefund(data);
|
|
14
|
+
return this.client.post('/api/v1/merchants/refunds', data, options);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a refund by ID
|
|
18
|
+
*/
|
|
19
|
+
async retrieve(refundId, options) {
|
|
20
|
+
if (!refundId) {
|
|
21
|
+
throw new errors_1.FidduPayValidationError('Refund ID is required', 'refund_id');
|
|
22
|
+
}
|
|
23
|
+
return this.client.get(`/api/v1/merchants/refunds/${refundId}`, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Complete a refund
|
|
27
|
+
*/
|
|
28
|
+
async complete(refundId, transactionHash, options) {
|
|
29
|
+
if (!refundId) {
|
|
30
|
+
throw new errors_1.FidduPayValidationError('Refund ID is required', 'refund_id');
|
|
31
|
+
}
|
|
32
|
+
if (!transactionHash) {
|
|
33
|
+
throw new errors_1.FidduPayValidationError('Transaction hash is required', 'transaction_hash');
|
|
34
|
+
}
|
|
35
|
+
return this.client.request('POST', `/api/v1/merchants/refunds/${refundId}/complete`, { transaction_hash: transactionHash });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* List refunds
|
|
39
|
+
*/
|
|
40
|
+
async list(params, options) {
|
|
41
|
+
const queryParams = new URLSearchParams();
|
|
42
|
+
if (params?.limit)
|
|
43
|
+
queryParams.append('limit', params.limit.toString());
|
|
44
|
+
if (params?.offset)
|
|
45
|
+
queryParams.append('offset', params.offset.toString());
|
|
46
|
+
const query = queryParams.toString();
|
|
47
|
+
const path = query ? `/api/v1/merchants/refunds?${query}` : '/api/v1/merchants/refunds';
|
|
48
|
+
return this.client.get(path, options);
|
|
49
|
+
}
|
|
50
|
+
validateCreateRefund(data) {
|
|
51
|
+
if (!data.payment_id) {
|
|
52
|
+
throw new errors_1.FidduPayValidationError('Payment ID is required', 'payment_id');
|
|
53
|
+
}
|
|
54
|
+
if (data.amount !== undefined) {
|
|
55
|
+
const amount = parseFloat(data.amount);
|
|
56
|
+
if (isNaN(amount) || amount <= 0) {
|
|
57
|
+
throw new errors_1.FidduPayValidationError('Refund amount must be a positive number', 'amount');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (data.reason && data.reason.length > 500) {
|
|
61
|
+
throw new errors_1.FidduPayValidationError('Refund reason must be 500 characters or less', 'reason');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Refunds = Refunds;
|
|
66
|
+
//# sourceMappingURL=refunds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refunds.js","sourceRoot":"","sources":["../../../src/resources/refunds.ts"],"names":[],"mappings":";;;AAEA,sCAAoD;AAEpD,MAAa,OAAO;IAClB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAAyB,EAAE,OAAwB;QAC9D,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,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AAG,KAAK,CAAC,CAAC,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC,CAAC,2BAA2B,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAEO,oBAAoB,CAAC,IAAyB;QACpD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,IAAI,gCAAuB,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;QAC5E,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,gCAAuB,CAAC,yCAAyC,EAAE,QAAQ,CAAC,CAAC;YACzF,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC5C,MAAM,IAAI,gCAAuB,CAC/B,8CAA8C,EAC9C,QAAQ,CACT,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAxED,0BAwEC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { SandboxPaymentSimulation, SimulatePaymentRequest } from '../types';
|
|
3
|
+
export declare class Sandbox {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Simulate payment status
|
|
8
|
+
*/
|
|
9
|
+
simulatePayment(paymentId: string, data: SimulatePaymentRequest): Promise<SandboxPaymentSimulation>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=sandbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/resources/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB,qBAAa,OAAO;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAGtC;;OAEG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAG1G"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sandbox = void 0;
|
|
4
|
+
class Sandbox {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Simulate payment status
|
|
10
|
+
*/
|
|
11
|
+
async simulatePayment(paymentId, data) {
|
|
12
|
+
return this.client.request('POST', `/api/v1/merchants/sandbox/payments/${paymentId}/simulate`, data);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Sandbox = Sandbox;
|
|
16
|
+
//# sourceMappingURL=sandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/resources/sandbox.ts"],"names":[],"mappings":";;;AAMA,MAAa,OAAO;IAClB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAG3C;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,SAAiB,EAAE,IAA4B;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2B,MAAM,EAAE,sCAAsC,SAAS,WAAW,EAAE,IAAI,CAAC,CAAC;IACjI,CAAC;CACF;AAVD,0BAUC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { RequestOptions } from '../types';
|
|
3
|
+
export declare class Security {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Get security events
|
|
8
|
+
*/
|
|
9
|
+
getEvents(options?: RequestOptions): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Get security alerts
|
|
12
|
+
*/
|
|
13
|
+
getAlerts(options?: RequestOptions): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Get security settings
|
|
16
|
+
*/
|
|
17
|
+
getSettings(options?: RequestOptions): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Update security settings
|
|
20
|
+
*/
|
|
21
|
+
updateSettings(data: {
|
|
22
|
+
max_daily_withdrawal?: number;
|
|
23
|
+
require_2fa_for_withdrawals?: boolean;
|
|
24
|
+
}, options?: RequestOptions): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Check gas balances
|
|
27
|
+
*/
|
|
28
|
+
checkGasBalances(options?: RequestOptions): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* Get balance alerts
|
|
31
|
+
*/
|
|
32
|
+
getBalanceAlerts(options?: RequestOptions): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Acknowledge security alert
|
|
35
|
+
*/
|
|
36
|
+
acknowledgeAlert(alertId: string, options?: RequestOptions): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve balance alert
|
|
39
|
+
*/
|
|
40
|
+
resolveBalanceAlert(alertId: string, options?: RequestOptions): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* Toggle master wallet withdrawal lock
|
|
43
|
+
*/
|
|
44
|
+
toggleWalletLock(locked: boolean, password: string, options?: RequestOptions): Promise<{
|
|
45
|
+
status: string;
|
|
46
|
+
locked: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Toggle customer designated wallet withdrawal lock
|
|
50
|
+
*/
|
|
51
|
+
toggleCustomerWalletLock(locked: boolean, password: string, options?: RequestOptions): Promise<{
|
|
52
|
+
status: string;
|
|
53
|
+
locked: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/resources/security.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,qBAAa,QAAQ;IACP,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAIvD;;OAEG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAIvD;;OAEG;IACG,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD;;OAEG;IACG,cAAc,CAAC,IAAI,EAAE;QACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,2BAA2B,CAAC,EAAE,OAAO,CAAC;KACvC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAI1C;;OAEG;IACG,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9D;;OAEG;IACG,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAI/E;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlF;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;IAIjI;;OAEG;IACG,wBAAwB,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;CAG1I"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Security = void 0;
|
|
4
|
+
class Security {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get security events
|
|
10
|
+
*/
|
|
11
|
+
async getEvents(options) {
|
|
12
|
+
return this.client.request('GET', '/api/v1/merchants/security/events');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get security alerts
|
|
16
|
+
*/
|
|
17
|
+
async getAlerts(options) {
|
|
18
|
+
return this.client.request('GET', '/api/v1/merchants/security/alerts');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get security settings
|
|
22
|
+
*/
|
|
23
|
+
async getSettings(options) {
|
|
24
|
+
return this.client.request('GET', '/api/v1/merchants/security/settings');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Update security settings
|
|
28
|
+
*/
|
|
29
|
+
async updateSettings(data, options) {
|
|
30
|
+
return this.client.request('PUT', '/api/v1/merchants/security/settings', data);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check gas balances
|
|
34
|
+
*/
|
|
35
|
+
async checkGasBalances(options) {
|
|
36
|
+
return this.client.request('GET', '/api/v1/merchants/security/gas-check');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get balance alerts
|
|
40
|
+
*/
|
|
41
|
+
async getBalanceAlerts(options) {
|
|
42
|
+
return this.client.request('GET', '/api/v1/merchants/security/balance-alerts');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Acknowledge security alert
|
|
46
|
+
*/
|
|
47
|
+
async acknowledgeAlert(alertId, options) {
|
|
48
|
+
return this.client.request('POST', `/api/v1/merchants/security/alerts/${alertId}/acknowledge`);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Resolve balance alert
|
|
52
|
+
*/
|
|
53
|
+
async resolveBalanceAlert(alertId, options) {
|
|
54
|
+
return this.client.request('POST', `/api/v1/merchants/security/balance-alerts/${alertId}/resolve`);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Toggle master wallet withdrawal lock
|
|
58
|
+
*/
|
|
59
|
+
async toggleWalletLock(locked, password, options) {
|
|
60
|
+
return this.client.post('/api/v1/merchants/security/wallets/lock', { locked, password }, options);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Toggle customer designated wallet withdrawal lock
|
|
64
|
+
*/
|
|
65
|
+
async toggleCustomerWalletLock(locked, password, options) {
|
|
66
|
+
return this.client.post('/api/v1/merchants/security/customers/wallets/lock', { locked, password }, options);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.Security = Security;
|
|
70
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../../src/resources/security.ts"],"names":[],"mappings":";;;AAGA,MAAa,QAAQ;IACnB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,OAAwB;QACtC,OAAO,IAAI,CAAC,MA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I,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,wBAAwB,CAAC,MAAe,EAAE,QAAgB,EAAE,OAAwB;QACxF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mDAAmD,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;CACF;AA3ED,4BA2EC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { RequestOptions } from '../types';
|
|
3
|
+
export interface UnifiedTransaction {
|
|
4
|
+
type: 'payment' | 'refund' | 'withdrawal';
|
|
5
|
+
id: string;
|
|
6
|
+
crypto_amount: string;
|
|
7
|
+
usd_amount: string;
|
|
8
|
+
crypto_type: string;
|
|
9
|
+
status: string;
|
|
10
|
+
transaction_hash?: string;
|
|
11
|
+
created_at: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class Transactions {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: HttpClient);
|
|
16
|
+
/**
|
|
17
|
+
* List unified transactions (payments, refunds, withdrawals)
|
|
18
|
+
*/
|
|
19
|
+
list(params?: {
|
|
20
|
+
limit?: number;
|
|
21
|
+
}, options?: RequestOptions): Promise<{
|
|
22
|
+
transactions: UnifiedTransaction[];
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/resources/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,YAAY;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,kBAAkB,EAAE,CAAA;KAAE,CAAC;CAQrH"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Transactions = void 0;
|
|
4
|
+
class Transactions {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List unified transactions (payments, refunds, withdrawals)
|
|
10
|
+
*/
|
|
11
|
+
async list(params, options) {
|
|
12
|
+
const queryParams = new URLSearchParams();
|
|
13
|
+
if (params?.limit)
|
|
14
|
+
queryParams.append('limit', params.limit.toString());
|
|
15
|
+
const query = queryParams.toString();
|
|
16
|
+
const path = query ? `/api/v1/merchants/transactions?${query}` : '/api/v1/merchants/transactions';
|
|
17
|
+
return this.client.request('GET', path);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Transactions = Transactions;
|
|
21
|
+
//# sourceMappingURL=transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/resources/transactions.ts"],"names":[],"mappings":";;;AAcA,MAAa,YAAY;IACrB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE3C;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA2B,EAAE,OAAwB;QAC5D,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAC1C,IAAI,MAAM,EAAE,KAAK;YAAE,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAExE,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC,CAAC,gCAAgC,CAAC;QAClG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;CACJ;AAdD,oCAcC"}
|