@wenex/sdk 1.0.21 → 1.0.23
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/common/interfaces/financial/common/pay.interface.d.ts +1 -1
- package/common/utils/financial/constants/transactions.constant.d.ts +4 -0
- package/common/utils/financial/constants/transactions.constant.js +6 -1
- package/common/utils/financial/constants/transactions.constant.js.map +1 -1
- package/package.json +1 -1
- package/services/financial/invoices.service.d.ts +4 -2
- package/services/financial/invoices.service.js +3 -0
- package/services/financial/invoices.service.js.map +1 -1
- package/services/financial/transactions.service.d.ts +6 -2
- package/services/financial/transactions.service.js +10 -0
- package/services/financial/transactions.service.js.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PayType } from '../../../enums/financial';
|
|
2
1
|
import { Core, Dto } from '../../../core/interfaces';
|
|
2
|
+
import { PayType } from '../../../enums/financial';
|
|
3
3
|
export interface Pay<Properties extends object = object> extends Core<Properties> {
|
|
4
4
|
type: PayType;
|
|
5
5
|
wallet: string;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export declare const MIN_TRANSACTION_TTL = 5;
|
|
2
2
|
export declare const MAX_TRANSACTION_TTL: number;
|
|
3
|
+
export declare const IRR_COIN_ID = "65d9eb750e788dbccedeba8d";
|
|
4
|
+
export declare const IRR_WALLET_ID = "6725bc8c4bb3f7d8bd4e45f8";
|
|
5
|
+
export declare const USD_COIN_ID = "6638d593d8ff6273c3c3cd12";
|
|
6
|
+
export declare const USD_WALLET_ID = "6638d59992e073f51b243f5f";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_TRANSACTION_TTL = exports.MIN_TRANSACTION_TTL = void 0;
|
|
3
|
+
exports.USD_WALLET_ID = exports.USD_COIN_ID = exports.IRR_WALLET_ID = exports.IRR_COIN_ID = exports.MAX_TRANSACTION_TTL = exports.MIN_TRANSACTION_TTL = void 0;
|
|
4
4
|
exports.MIN_TRANSACTION_TTL = 5; // 5 sec's
|
|
5
5
|
exports.MAX_TRANSACTION_TTL = 15 * 60; // 15 min's
|
|
6
|
+
// Real Money
|
|
7
|
+
exports.IRR_COIN_ID = '65d9eb750e788dbccedeba8d';
|
|
8
|
+
exports.IRR_WALLET_ID = '6725bc8c4bb3f7d8bd4e45f8';
|
|
9
|
+
exports.USD_COIN_ID = '6638d593d8ff6273c3c3cd12';
|
|
10
|
+
exports.USD_WALLET_ID = '6638d59992e073f51b243f5f';
|
|
6
11
|
//# sourceMappingURL=transactions.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.constant.js","sourceRoot":"","sources":["../../../../src/common/utils/financial/constants/transactions.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,CAAC,CAAC,UAAU;AACnC,QAAA,mBAAmB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW"}
|
|
1
|
+
{"version":3,"file":"transactions.constant.js","sourceRoot":"","sources":["../../../../src/common/utils/financial/constants/transactions.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,CAAC,CAAC,UAAU;AACnC,QAAA,mBAAmB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW;AAEvD,aAAa;AACA,QAAA,WAAW,GAAG,0BAA0B,CAAC;AACzC,QAAA,aAAa,GAAG,0BAA0B,CAAC;AAC3C,QAAA,WAAW,GAAG,0BAA0B,CAAC;AACzC,QAAA,aAAa,GAAG,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Serializer } from '../../common/core/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/core/classes';
|
|
4
|
+
import { Transaction, Invoice, InvoiceDto } from '../../common/interfaces/financial';
|
|
4
5
|
export declare class InvoicesService<Properties extends object = object> extends RestfulService<Invoice<Properties>, InvoiceDto<Properties>> {
|
|
5
6
|
protected axios: AxiosInstance;
|
|
6
7
|
constructor(axios: AxiosInstance);
|
|
8
|
+
payment<Path extends object = object>(id: string, config?: RequestConfig<Invoice<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
7
9
|
static build<Properties extends object = object>(axios: AxiosInstance): InvoicesService<Properties>;
|
|
8
10
|
}
|
|
@@ -7,6 +7,9 @@ class InvoicesService extends classes_1.RestfulService {
|
|
|
7
7
|
super('invoices', axios);
|
|
8
8
|
this.axios = axios;
|
|
9
9
|
}
|
|
10
|
+
async payment(id, config) {
|
|
11
|
+
return (await this.get(this.url(`${id}/payment`), config)).data;
|
|
12
|
+
}
|
|
10
13
|
static build(axios) {
|
|
11
14
|
return new InvoicesService(axios);
|
|
12
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.service.js","sourceRoot":"","sources":["../../src/services/financial/invoices.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invoices.service.js","sourceRoot":"","sources":["../../src/services/financial/invoices.service.ts"],"names":[],"mappings":";;;AAGA,uDAA0E;AAG1E,MAAa,eAAoD,SAAQ,wBAGxE;IACC,YAAsB,KAAoB;QACxC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QADL,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,KAAK,CAAC,OAAO,CACX,EAAU,EACV,MAA2C;QAE3C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACnH,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,eAAe,CAAa,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AAlBD,0CAkBC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Serializer } from '../../common/core/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/core/classes';
|
|
4
|
+
import { Transaction, TransactionDto, TransactionInitDto } from '../../common/interfaces/financial';
|
|
4
5
|
export declare class TransactionsService<Properties extends object = object> extends RestfulService<Transaction<Properties>, TransactionDto<Properties>> {
|
|
5
6
|
protected axios: AxiosInstance;
|
|
6
7
|
constructor(axios: AxiosInstance);
|
|
8
|
+
init(data: TransactionInitDto<Properties>, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>>>;
|
|
9
|
+
abort<Path extends object = object>(id: string, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
10
|
+
verify<Path extends object = object>(id: string, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
7
11
|
static build<Properties extends object = object>(axios: AxiosInstance): TransactionsService<Properties>;
|
|
8
12
|
}
|
|
@@ -7,6 +7,16 @@ class TransactionsService extends classes_1.RestfulService {
|
|
|
7
7
|
super('transactions', axios);
|
|
8
8
|
this.axios = axios;
|
|
9
9
|
}
|
|
10
|
+
async init(data, config) {
|
|
11
|
+
return (await this.post(this.url(), data, config))
|
|
12
|
+
.data;
|
|
13
|
+
}
|
|
14
|
+
async abort(id, config) {
|
|
15
|
+
return (await this.get(this.url(`${id}/abort`), config)).data;
|
|
16
|
+
}
|
|
17
|
+
async verify(id, config) {
|
|
18
|
+
return (await this.get(this.url(`${id}/verify`), config)).data;
|
|
19
|
+
}
|
|
10
20
|
static build(axios) {
|
|
11
21
|
return new TransactionsService(axios);
|
|
12
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.service.js","sourceRoot":"","sources":["../../src/services/financial/transactions.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"transactions.service.js","sourceRoot":"","sources":["../../src/services/financial/transactions.service.ts"],"names":[],"mappings":";;;AAGA,uDAA0E;AAG1E,MAAa,mBAAwD,SAAQ,wBAG5E;IACC,YAAsB,KAAoB;QACxC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QADT,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,KAAK,CAAC,IAAI,CACR,IAAoC,EACpC,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAA4E,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;aAC1H,IAAI,CAAC;IACV,CAAC;IAED,KAAK,CAAC,KAAK,CACT,EAAU,EACV,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjH,CAAC;IAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAClH,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,mBAAmB,CAAa,KAAK,CAAC,CAAC;IACpD,CAAC;CACF;AAjCD,kDAiCC"}
|