swapped-commerce-sdk 1.0.1 → 1.0.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/dist/index.js
CHANGED
|
@@ -166,12 +166,12 @@ async function request(config, method, path, options) {
|
|
|
166
166
|
|
|
167
167
|
// src/resources/orders.ts
|
|
168
168
|
async function listOrders(httpConfig, params) {
|
|
169
|
-
return request(httpConfig.config, "GET", "/v1/
|
|
169
|
+
return request(httpConfig.config, "GET", "/v1/orders", {
|
|
170
170
|
params
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
async function getOrder(httpConfig, orderId) {
|
|
174
|
-
return request(httpConfig.config, "GET", `/v1/
|
|
174
|
+
return request(httpConfig.config, "GET", `/v1/orders/${encodeURIComponent(orderId)}`);
|
|
175
175
|
}
|
|
176
176
|
async function refundOrder(httpConfig, orderId, params) {
|
|
177
177
|
return request(httpConfig.config, "POST", `/v1/merchants/orders/${encodeURIComponent(orderId)}/refund`, {
|
|
@@ -188,7 +188,7 @@ async function createPaymentLink(httpConfig, params) {
|
|
|
188
188
|
|
|
189
189
|
// src/resources/paymentRoutes.ts
|
|
190
190
|
async function createPaymentRoute(httpConfig, params) {
|
|
191
|
-
return request(httpConfig.config, "POST", "/v1/
|
|
191
|
+
return request(httpConfig.config, "POST", "/v1/payment-routes", {
|
|
192
192
|
body: params
|
|
193
193
|
});
|
|
194
194
|
}
|
|
@@ -200,42 +200,42 @@ async function getPayment(httpConfig, paymentId) {
|
|
|
200
200
|
|
|
201
201
|
// src/resources/balances.ts
|
|
202
202
|
async function listBalances(httpConfig, params) {
|
|
203
|
-
return request(httpConfig.config, "GET", "/v1/
|
|
203
|
+
return request(httpConfig.config, "GET", "/v1/balances", {
|
|
204
204
|
params
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
async function getBalance(httpConfig, currencyId) {
|
|
208
|
-
return request(httpConfig.config, "GET", `/v1/
|
|
208
|
+
return request(httpConfig.config, "GET", `/v1/balances/${encodeURIComponent(currencyId)}`);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// src/resources/quotes.ts
|
|
212
212
|
async function getQuote(httpConfig, params) {
|
|
213
|
-
return request(httpConfig.config, "POST", "/v1/
|
|
213
|
+
return request(httpConfig.config, "POST", "/v1/quotes", {
|
|
214
214
|
body: params
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
// src/resources/payouts.ts
|
|
219
219
|
async function createPayout(httpConfig, params) {
|
|
220
|
-
return request(httpConfig.config, "POST", "/v1/
|
|
220
|
+
return request(httpConfig.config, "POST", "/v1/payouts", {
|
|
221
221
|
body: params
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
async function listPayouts(httpConfig, params) {
|
|
225
|
-
return request(httpConfig.config, "GET", "/v1/
|
|
225
|
+
return request(httpConfig.config, "GET", "/v1/payouts", {
|
|
226
226
|
params
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
async function getPayout(httpConfig, payoutId) {
|
|
230
|
-
return request(httpConfig.config, "GET", `/v1/
|
|
230
|
+
return request(httpConfig.config, "GET", `/v1/payouts/${encodeURIComponent(payoutId)}`);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
// src/resources/kyc.ts
|
|
234
234
|
async function getKYCStatus(httpConfig, customerId) {
|
|
235
|
-
return request(httpConfig.config, "GET", `/v1/
|
|
235
|
+
return request(httpConfig.config, "GET", `/v1/kyc/${encodeURIComponent(customerId)}`);
|
|
236
236
|
}
|
|
237
237
|
async function submitKYC(httpConfig, params) {
|
|
238
|
-
return request(httpConfig.config, "POST", "/v1/
|
|
238
|
+
return request(httpConfig.config, "POST", "/v1/kyc", {
|
|
239
239
|
body: params
|
|
240
240
|
});
|
|
241
241
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export async function listBalances(
|
|
|
17
17
|
return request<BalancesResponse>(
|
|
18
18
|
httpConfig.config,
|
|
19
19
|
'GET',
|
|
20
|
-
'/v1/
|
|
20
|
+
'/v1/balances',
|
|
21
21
|
{
|
|
22
22
|
params,
|
|
23
23
|
}
|
|
@@ -34,6 +34,6 @@ export async function getBalance(
|
|
|
34
34
|
return request<Balance>(
|
|
35
35
|
httpConfig.config,
|
|
36
36
|
'GET',
|
|
37
|
-
`/v1/
|
|
37
|
+
`/v1/balances/${encodeURIComponent(currencyId)}`
|
|
38
38
|
)
|
|
39
39
|
}
|
package/src/resources/kyc.ts
CHANGED
|
@@ -17,7 +17,7 @@ export async function getKYCStatus(
|
|
|
17
17
|
return request<KYCStatusResponse>(
|
|
18
18
|
httpConfig.config,
|
|
19
19
|
'GET',
|
|
20
|
-
`/v1/
|
|
20
|
+
`/v1/kyc/${encodeURIComponent(customerId)}`
|
|
21
21
|
)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ export async function submitKYC(
|
|
|
31
31
|
return request<SubmitKYCResponse>(
|
|
32
32
|
httpConfig.config,
|
|
33
33
|
'POST',
|
|
34
|
-
'/v1/
|
|
34
|
+
'/v1/kyc',
|
|
35
35
|
{
|
|
36
36
|
body: params,
|
|
37
37
|
}
|
package/src/resources/orders.ts
CHANGED
|
@@ -16,7 +16,7 @@ export async function listOrders(
|
|
|
16
16
|
httpConfig: HttpConfig,
|
|
17
17
|
params?: Readonly<ListOrdersParams>
|
|
18
18
|
): Promise<ApiResponse<OrdersResponse>> {
|
|
19
|
-
return request<OrdersResponse>(httpConfig.config, 'GET', '/v1/
|
|
19
|
+
return request<OrdersResponse>(httpConfig.config, 'GET', '/v1/orders', {
|
|
20
20
|
params,
|
|
21
21
|
})
|
|
22
22
|
}
|
|
@@ -31,7 +31,7 @@ export async function getOrder(
|
|
|
31
31
|
return request<Order>(
|
|
32
32
|
httpConfig.config,
|
|
33
33
|
'GET',
|
|
34
|
-
`/v1/
|
|
34
|
+
`/v1/orders/${encodeURIComponent(orderId)}`
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
37
|
|
package/src/resources/payouts.ts
CHANGED
|
@@ -19,7 +19,7 @@ export async function createPayout(
|
|
|
19
19
|
return request<CreatePayoutResponse>(
|
|
20
20
|
httpConfig.config,
|
|
21
21
|
'POST',
|
|
22
|
-
'/v1/
|
|
22
|
+
'/v1/payouts',
|
|
23
23
|
{
|
|
24
24
|
body: params,
|
|
25
25
|
}
|
|
@@ -36,7 +36,7 @@ export async function listPayouts(
|
|
|
36
36
|
return request<PayoutsResponse>(
|
|
37
37
|
httpConfig.config,
|
|
38
38
|
'GET',
|
|
39
|
-
'/v1/
|
|
39
|
+
'/v1/payouts',
|
|
40
40
|
{
|
|
41
41
|
params,
|
|
42
42
|
}
|
|
@@ -53,6 +53,6 @@ export async function getPayout(
|
|
|
53
53
|
return request<Payout>(
|
|
54
54
|
httpConfig.config,
|
|
55
55
|
'GET',
|
|
56
|
-
`/v1/
|
|
56
|
+
`/v1/payouts/${encodeURIComponent(payoutId)}`
|
|
57
57
|
)
|
|
58
58
|
}
|