ggez-banking-sdk 0.3.25 → 0.3.27
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/api/clients/account.d.ts +12 -2
- package/dist/api/clients/account.js +10 -10
- package/dist/api/clients/auth.d.ts +24 -9
- package/dist/api/clients/auth.js +26 -26
- package/dist/api/clients/blockchain.d.ts +28 -8
- package/dist/api/clients/blockchain.js +22 -22
- package/dist/api/clients/ipAddressAndLocation.d.ts +2 -2
- package/dist/api/clients/ipAddressAndLocation.js +4 -4
- package/dist/api/clients/limited.d.ts +63 -18
- package/dist/api/clients/limited.js +47 -47
- package/dist/api/clients/order.d.ts +7 -2
- package/dist/api/clients/order.js +7 -7
- package/dist/api/clients/organization.d.ts +35 -10
- package/dist/api/clients/organization.js +26 -26
- package/dist/api/clients/program.d.ts +18 -3
- package/dist/api/clients/program.js +15 -15
- package/dist/api/clients/promotion.d.ts +8 -8
- package/dist/api/clients/promotion.js +6 -3
- package/dist/api/clients/transaction.d.ts +28 -8
- package/dist/api/clients/transaction.js +22 -22
- package/dist/api/clients/user.d.ts +469 -89
- package/dist/api/clients/user.js +356 -356
- package/dist/api/data/account.d.ts +2 -2
- package/dist/api/data/account.js +2 -2
- package/dist/api/data/auth.d.ts +6 -6
- package/dist/api/data/auth.js +9 -9
- package/dist/api/data/blockchain.d.ts +6 -6
- package/dist/api/data/blockchain.js +14 -18
- package/dist/api/data/limited.d.ts +4 -4
- package/dist/api/data/limited.js +4 -4
- package/dist/api/data/order.d.ts +3 -3
- package/dist/api/data/order.js +3 -3
- package/dist/api/data/organization.d.ts +5 -5
- package/dist/api/data/organization.js +9 -9
- package/dist/api/data/program.d.ts +2 -2
- package/dist/api/data/program.js +2 -2
- package/dist/api/data/result.d.ts +4 -6
- package/dist/api/data/result.js +5 -14
- package/dist/api/data/transaction.d.ts +7 -7
- package/dist/api/data/transaction.js +9 -9
- package/dist/api/data/user/activity.js +1 -0
- package/dist/api/data/user/address.d.ts +5 -5
- package/dist/api/data/user/address.js +10 -10
- package/dist/api/data/user/auth.d.ts +5 -5
- package/dist/api/data/user/auth.js +10 -10
- package/dist/api/data/user/bankAccount.d.ts +5 -5
- package/dist/api/data/user/bankAccount.js +10 -10
- package/dist/api/data/user/confirmUserSecurity.d.ts +2 -2
- package/dist/api/data/user/confirmUserSecurity.js +2 -2
- package/dist/api/data/user/device.d.ts +7 -7
- package/dist/api/data/user/device.js +12 -12
- package/dist/api/data/user/document.d.ts +4 -4
- package/dist/api/data/user/document.js +4 -4
- package/dist/api/data/user/email.d.ts +9 -9
- package/dist/api/data/user/email.js +14 -14
- package/dist/api/data/user/forgetSecurityData.d.ts +2 -2
- package/dist/api/data/user/forgetSecurityData.js +2 -2
- package/dist/api/data/user/identification.d.ts +4 -4
- package/dist/api/data/user/identification.js +8 -8
- package/dist/api/data/user/personalInfo.d.ts +2 -2
- package/dist/api/data/user/personalInfo.js +4 -4
- package/dist/api/data/user/phone.d.ts +9 -9
- package/dist/api/data/user/phone.js +14 -14
- package/dist/api/data/user/preferences.d.ts +2 -2
- package/dist/api/data/user/preferences.js +4 -4
- package/dist/api/data/user/resetUserSecurity.d.ts +2 -2
- package/dist/api/data/user/resetUserSecurity.js +2 -2
- package/dist/api/data/user/security.d.ts +5 -5
- package/dist/api/data/user/security.js +5 -5
- package/dist/api/data/user/ticket.d.ts +2 -2
- package/dist/api/data/user/ticket.js +4 -4
- package/dist/api/data/user/type.d.ts +2 -2
- package/dist/api/data/user/type.js +4 -4
- package/dist/api/data/user/user.d.ts +4 -4
- package/dist/api/data/user/user.js +8 -8
- package/dist/api/data/user/userDefaults.d.ts +2 -2
- package/dist/api/data/user/userDefaults.js +2 -2
- package/dist/api/data/user/validateLimitedSecurity.d.ts +2 -2
- package/dist/api/data/user/validateLimitedSecurity.js +2 -2
- package/dist/api/data/user/validateSecurityData.d.ts +2 -2
- package/dist/api/data/user/validateSecurityData.js +2 -2
- package/dist/api/data/user/verifyUserSecurity.d.ts +2 -2
- package/dist/api/data/user/verifyUserSecurity.js +2 -2
- package/dist/api/services/account.js +2 -2
- package/dist/api/services/base.js +3 -3
- package/dist/api/services/limited.js +1 -1
- package/dist/api/services/order.js +2 -2
- package/dist/api/services/organization.js +2 -2
- package/dist/api/services/transaction.js +2 -2
- package/dist/api/services/user.js +2 -2
- package/dist/content/countries.d.ts +7 -2
- package/dist/helper/api/axiosHelper.d.ts +7 -7
- package/dist/helper/api/axiosHelper.js +15 -15
- package/dist/helper/api/responseHelper.d.ts +3 -3
- package/dist/helper/api/responseHelper.js +3 -3
- package/dist/helper/api/resultHelper.d.ts +2 -2
- package/dist/helper/api/resultHelper.js +2 -2
- package/dist/helper/cipherHelper.d.ts +11 -11
- package/dist/helper/cipherHelper.js +17 -17
- package/dist/helper/clientHelper.d.ts +3 -3
- package/dist/helper/dateTimeHelper.d.ts +4 -4
- package/dist/helper/dateTimeHelper.js +4 -4
- package/dist/helper/deviceHelper.d.ts +2 -2
- package/dist/helper/deviceHelper.js +7 -6
- package/dist/helper/geoHelper.d.ts +3 -3
- package/dist/helper/geoHelper.js +3 -3
- package/dist/helper/storage/cookiesHelper.d.ts +21 -26
- package/dist/helper/storage/cookiesHelper.js +93 -102
- package/dist/helper/storage/localStorageHelper.d.ts +6 -6
- package/dist/helper/storage/localStorageHelper.js +14 -14
- package/dist/helper/storage/storageHelper.d.ts +2 -2
- package/dist/helper/storage/storageHelper.js +2 -2
- package/dist/helper/userHelper.d.ts +14 -14
- package/dist/helper/userHelper.js +36 -35
- package/dist/types/banking/entities/identification.d.ts +1 -1
- package/dist/utils/data/generation.d.ts +5 -5
- package/dist/utils/data/generation.js +5 -5
- package/dist/utils/data/manipulation.d.ts +1 -1
- package/package.json +3 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -8,13 +8,23 @@ declare class AccountClient extends BaseClient {
|
|
|
8
8
|
data: import("../..").AccountData;
|
|
9
9
|
success: boolean;
|
|
10
10
|
message: string;
|
|
11
|
-
error:
|
|
11
|
+
error: null;
|
|
12
|
+
} | {
|
|
13
|
+
data: import("../..").AccountData;
|
|
14
|
+
success: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
error: string;
|
|
12
17
|
}>;
|
|
13
18
|
getLimits: (accountId: number, options?: RequestOptions) => Promise<{
|
|
14
19
|
data: import("../..").AccountData;
|
|
15
20
|
success: boolean;
|
|
16
21
|
message: string;
|
|
17
|
-
error:
|
|
22
|
+
error: null;
|
|
23
|
+
} | {
|
|
24
|
+
data: import("../..").AccountData;
|
|
25
|
+
success: boolean;
|
|
26
|
+
message: string;
|
|
27
|
+
error: string;
|
|
18
28
|
}>;
|
|
19
29
|
}
|
|
20
30
|
export { AccountClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper/api/axiosHelper";
|
|
2
|
-
import {
|
|
2
|
+
import { createDefaultAccountData, fillResultByError } from "../data";
|
|
3
3
|
import { AccountService } from "../services";
|
|
4
4
|
import { BaseClient } from "./base";
|
|
5
5
|
class AccountClient extends BaseClient {
|
|
@@ -7,30 +7,30 @@ class AccountClient extends BaseClient {
|
|
|
7
7
|
constructor(clientData, errorHandler) {
|
|
8
8
|
super(clientData, errorHandler);
|
|
9
9
|
const { token, baseUrl, lang, installationId, userId } = this.clientData;
|
|
10
|
-
const config = AxiosHelper.
|
|
10
|
+
const config = AxiosHelper.getAxiosConfig(token, baseUrl, lang, installationId);
|
|
11
11
|
this.accountService = new AccountService({ config, userId });
|
|
12
12
|
}
|
|
13
13
|
// #region "GET"
|
|
14
14
|
get = async (accountId, options) => {
|
|
15
15
|
try {
|
|
16
16
|
const response = await this.accountService.get(accountId, options);
|
|
17
|
-
return this.responseHelper.
|
|
17
|
+
return this.responseHelper.getResponse(response.data);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
|
-
const result =
|
|
21
|
-
const accountData =
|
|
22
|
-
return this.responseHelper.
|
|
20
|
+
const result = fillResultByError(error);
|
|
21
|
+
const accountData = createDefaultAccountData({ result });
|
|
22
|
+
return this.responseHelper.getErrorResponse(accountData, "get");
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
getLimits = async (accountId, options) => {
|
|
26
26
|
try {
|
|
27
27
|
const response = await this.accountService.getLimits(accountId, options);
|
|
28
|
-
return this.responseHelper.
|
|
28
|
+
return this.responseHelper.getResponse(response.data);
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
|
-
const result =
|
|
32
|
-
const accountData =
|
|
33
|
-
return this.responseHelper.
|
|
31
|
+
const result = fillResultByError(error);
|
|
32
|
+
const accountData = createDefaultAccountData({ result });
|
|
33
|
+
return this.responseHelper.getErrorResponse(accountData, "getLimits");
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -5,33 +5,48 @@ declare class AuthClient extends BaseClient {
|
|
|
5
5
|
private authService;
|
|
6
6
|
constructor(clientData: AuthClientData, errorHandler: ErrorHandler);
|
|
7
7
|
loginUserCredentials: (data: ILoginUserCredentialsData, options?: RequestOptions) => Promise<{
|
|
8
|
-
data: import("
|
|
8
|
+
data: import("../..").TokenData;
|
|
9
9
|
success: boolean;
|
|
10
10
|
message: string;
|
|
11
|
-
error:
|
|
11
|
+
error: null;
|
|
12
|
+
} | {
|
|
13
|
+
data: import("../..").TokenData;
|
|
14
|
+
success: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
error: string;
|
|
12
17
|
}>;
|
|
13
18
|
loginDeviceCredentials: (data: ILoginDeviceCredentialsData, options?: RequestOptions) => Promise<{
|
|
14
|
-
data: import("
|
|
19
|
+
data: import("../..").TokenData;
|
|
20
|
+
success: boolean;
|
|
21
|
+
message: string;
|
|
22
|
+
error: null;
|
|
23
|
+
} | {
|
|
24
|
+
data: import("../..").TokenData;
|
|
15
25
|
success: boolean;
|
|
16
26
|
message: string;
|
|
17
|
-
error:
|
|
27
|
+
error: string;
|
|
18
28
|
}>;
|
|
19
29
|
loginGoogleCredentials: (data: ILoginGoogleCredentialsData, options?: RequestOptions) => Promise<{
|
|
20
|
-
data: import("
|
|
30
|
+
data: import("../..").TokenData;
|
|
31
|
+
success: boolean;
|
|
32
|
+
message: string;
|
|
33
|
+
error: null;
|
|
34
|
+
} | {
|
|
35
|
+
data: import("../..").TokenData;
|
|
21
36
|
success: boolean;
|
|
22
37
|
message: string;
|
|
23
|
-
error:
|
|
38
|
+
error: string;
|
|
24
39
|
}>;
|
|
25
40
|
generateLimitedToken: (data: IGenerateLimitedTokenData, options?: RequestOptions) => Promise<{
|
|
26
|
-
data: import("
|
|
41
|
+
data: import("../..").TokenData;
|
|
27
42
|
success: boolean;
|
|
28
43
|
message: string;
|
|
29
44
|
error: string;
|
|
30
45
|
} | {
|
|
31
|
-
data: import("
|
|
46
|
+
data: import("../..").NodeTokenData;
|
|
32
47
|
success: boolean;
|
|
33
48
|
message: string;
|
|
34
|
-
error:
|
|
49
|
+
error: null;
|
|
35
50
|
}>;
|
|
36
51
|
}
|
|
37
52
|
export { AuthClient };
|
package/dist/api/clients/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper/api/axiosHelper";
|
|
2
|
-
import {
|
|
2
|
+
import { fillGenerateLimitedTokenData, fillLoginDeviceCredentialsData, fillLoginGoogleCredentialsData, fillLoginUserCredentialsData, fillResult, fillResultByError, createDefaultTokenData, } from "../data";
|
|
3
3
|
import { AuthService } from "../services";
|
|
4
4
|
import { BaseClient } from "./base";
|
|
5
5
|
class AuthClient extends BaseClient {
|
|
@@ -8,61 +8,61 @@ class AuthClient extends BaseClient {
|
|
|
8
8
|
constructor(clientData, errorHandler) {
|
|
9
9
|
super(clientData, errorHandler);
|
|
10
10
|
const { baseUrl, nodeUrl, lang, programId, userId } = this.clientData;
|
|
11
|
-
const config = AxiosHelper.
|
|
11
|
+
const config = AxiosHelper.getAuthAxiosConfig(baseUrl, lang, "");
|
|
12
12
|
this.authService = new AuthService({ config, nodeUrl, userId });
|
|
13
13
|
this.programId = programId;
|
|
14
14
|
}
|
|
15
15
|
// #region "POST"
|
|
16
16
|
loginUserCredentials = async (data, options) => {
|
|
17
17
|
try {
|
|
18
|
-
const credentialsData =
|
|
18
|
+
const credentialsData = fillLoginUserCredentialsData(this.programId, data);
|
|
19
19
|
const response = await this.authService.login(credentialsData, options);
|
|
20
|
-
response.data.result =
|
|
21
|
-
return this.responseHelper.
|
|
20
|
+
response.data.result = fillResult(response.data);
|
|
21
|
+
return this.responseHelper.getResponse(response.data);
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
const result =
|
|
25
|
-
const tokenData =
|
|
26
|
-
return this.responseHelper.
|
|
24
|
+
const result = fillResultByError(error);
|
|
25
|
+
const tokenData = createDefaultTokenData({ result });
|
|
26
|
+
return this.responseHelper.getErrorResponse(tokenData, "loginUserCredentials");
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
loginDeviceCredentials = async (data, options) => {
|
|
30
30
|
try {
|
|
31
|
-
const credentialsData =
|
|
31
|
+
const credentialsData = fillLoginDeviceCredentialsData(this.programId, data);
|
|
32
32
|
const response = await this.authService.login(credentialsData, options);
|
|
33
|
-
response.data.result =
|
|
34
|
-
return this.responseHelper.
|
|
33
|
+
response.data.result = fillResult(response.data);
|
|
34
|
+
return this.responseHelper.getResponse(response.data);
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
|
-
const result =
|
|
38
|
-
const tokenData =
|
|
39
|
-
return this.responseHelper.
|
|
37
|
+
const result = fillResultByError(error);
|
|
38
|
+
const tokenData = createDefaultTokenData({ result });
|
|
39
|
+
return this.responseHelper.getErrorResponse(tokenData, "loginDeviceCredentials");
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
loginGoogleCredentials = async (data, options) => {
|
|
43
43
|
try {
|
|
44
|
-
const credentialsData =
|
|
44
|
+
const credentialsData = fillLoginGoogleCredentialsData(this.programId, data);
|
|
45
45
|
const response = await this.authService.login(credentialsData, options);
|
|
46
|
-
response.data.result =
|
|
47
|
-
return this.responseHelper.
|
|
46
|
+
response.data.result = fillResult(response.data);
|
|
47
|
+
return this.responseHelper.getResponse(response.data);
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
|
-
const result =
|
|
51
|
-
const tokenData =
|
|
52
|
-
return this.responseHelper.
|
|
50
|
+
const result = fillResultByError(error);
|
|
51
|
+
const tokenData = createDefaultTokenData({ result });
|
|
52
|
+
return this.responseHelper.getErrorResponse(tokenData, "loginGoogleCredentials");
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
generateLimitedToken = async (data, options) => {
|
|
56
56
|
try {
|
|
57
|
-
const tokenData =
|
|
57
|
+
const tokenData = fillGenerateLimitedTokenData(data);
|
|
58
58
|
const response = await this.authService.generateLimitedToken(tokenData, options);
|
|
59
|
-
response.data.result =
|
|
60
|
-
return this.responseHelper.
|
|
59
|
+
response.data.result = fillResult(response.data);
|
|
60
|
+
return this.responseHelper.getResponse(response.data);
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
63
|
-
const result =
|
|
64
|
-
const tokenData =
|
|
65
|
-
return this.responseHelper.
|
|
63
|
+
const result = fillResultByError(error);
|
|
64
|
+
const tokenData = createDefaultTokenData({ result });
|
|
65
|
+
return this.responseHelper.getErrorResponse(tokenData, "generateLimitedToken");
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -4,28 +4,48 @@ declare class BlockchainClient extends BaseClient {
|
|
|
4
4
|
private blockchainService;
|
|
5
5
|
constructor(clientData: BlockchainClientData, errorHandler: ErrorHandler);
|
|
6
6
|
send: (data: IBlockchainSendRequestData, options?: RequestOptions) => Promise<{
|
|
7
|
-
data: import("
|
|
7
|
+
data: import("../..").BlockchainData;
|
|
8
8
|
success: boolean;
|
|
9
9
|
message: string;
|
|
10
|
-
error:
|
|
10
|
+
error: null;
|
|
11
|
+
} | {
|
|
12
|
+
data: import("../..").BlockchainData;
|
|
13
|
+
success: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
error: string;
|
|
11
16
|
}>;
|
|
12
17
|
multiSend: (data: IBlockchainMultiSendRequestData, options?: RequestOptions) => Promise<{
|
|
13
|
-
data: import("
|
|
18
|
+
data: import("../..").BlockchainData;
|
|
19
|
+
success: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
error: null;
|
|
22
|
+
} | {
|
|
23
|
+
data: import("../..").BlockchainData;
|
|
14
24
|
success: boolean;
|
|
15
25
|
message: string;
|
|
16
|
-
error:
|
|
26
|
+
error: string;
|
|
17
27
|
}>;
|
|
18
28
|
delegate: (data: IBlockchainDelegateRequestData, options?: RequestOptions) => Promise<{
|
|
19
|
-
data: import("
|
|
29
|
+
data: import("../..").BlockchainData;
|
|
20
30
|
success: boolean;
|
|
21
31
|
message: string;
|
|
22
|
-
error:
|
|
32
|
+
error: null;
|
|
33
|
+
} | {
|
|
34
|
+
data: import("../..").BlockchainData;
|
|
35
|
+
success: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
error: string;
|
|
23
38
|
}>;
|
|
24
39
|
undelegate: (data: IBlockchainUndelegateRequestData, options?: RequestOptions) => Promise<{
|
|
25
|
-
data: import("
|
|
40
|
+
data: import("../..").BlockchainData;
|
|
41
|
+
success: boolean;
|
|
42
|
+
message: string;
|
|
43
|
+
error: null;
|
|
44
|
+
} | {
|
|
45
|
+
data: import("../..").BlockchainData;
|
|
26
46
|
success: boolean;
|
|
27
47
|
message: string;
|
|
28
|
-
error:
|
|
48
|
+
error: string;
|
|
29
49
|
}>;
|
|
30
50
|
}
|
|
31
51
|
export { BlockchainClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper/api/axiosHelper";
|
|
2
|
-
import {
|
|
2
|
+
import { createDefaultBlockchainData, fillBlockchainDelegateData, fillBlockchainMultiSendData, fillBlockchainSendData, fillBlockchainUndelegateData, fillResultByError, } from "../data";
|
|
3
3
|
import { BlockchainService } from "../services";
|
|
4
4
|
import { BaseClient } from "./base";
|
|
5
5
|
class BlockchainClient extends BaseClient {
|
|
@@ -7,56 +7,56 @@ class BlockchainClient extends BaseClient {
|
|
|
7
7
|
constructor(clientData, errorHandler) {
|
|
8
8
|
super(clientData, errorHandler);
|
|
9
9
|
const { token, baseUrl, lang, installationId, userId } = clientData;
|
|
10
|
-
const config = AxiosHelper.
|
|
10
|
+
const config = AxiosHelper.getAxiosConfig(token, baseUrl, lang, installationId);
|
|
11
11
|
this.blockchainService = new BlockchainService({ config, userId });
|
|
12
12
|
}
|
|
13
13
|
// #region "POST"
|
|
14
14
|
send = async (data, options) => {
|
|
15
15
|
try {
|
|
16
|
-
const blockchainSendData =
|
|
16
|
+
const blockchainSendData = fillBlockchainSendData(data);
|
|
17
17
|
const response = await this.blockchainService.send(blockchainSendData, options);
|
|
18
|
-
return this.responseHelper.
|
|
18
|
+
return this.responseHelper.getResponse(response.data);
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
|
-
const result =
|
|
22
|
-
const blockchainData =
|
|
23
|
-
return this.responseHelper.
|
|
21
|
+
const result = fillResultByError(error);
|
|
22
|
+
const blockchainData = createDefaultBlockchainData({ result });
|
|
23
|
+
return this.responseHelper.getErrorResponse(blockchainData, "send");
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
multiSend = async (data, options) => {
|
|
27
27
|
try {
|
|
28
|
-
const blockchainMultiSendData =
|
|
28
|
+
const blockchainMultiSendData = fillBlockchainMultiSendData(data);
|
|
29
29
|
const response = await this.blockchainService.multiSend(blockchainMultiSendData, options);
|
|
30
|
-
return this.responseHelper.
|
|
30
|
+
return this.responseHelper.getResponse(response.data);
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
|
-
const result =
|
|
34
|
-
const blockchainData =
|
|
35
|
-
return this.responseHelper.
|
|
33
|
+
const result = fillResultByError(error);
|
|
34
|
+
const blockchainData = createDefaultBlockchainData({ result });
|
|
35
|
+
return this.responseHelper.getErrorResponse(blockchainData, "multiSend");
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
delegate = async (data, options) => {
|
|
39
39
|
try {
|
|
40
|
-
const blockchainDelegateData =
|
|
40
|
+
const blockchainDelegateData = fillBlockchainDelegateData(data);
|
|
41
41
|
const response = await this.blockchainService.delegate(blockchainDelegateData, options);
|
|
42
|
-
return this.responseHelper.
|
|
42
|
+
return this.responseHelper.getResponse(response.data);
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
|
-
const result =
|
|
46
|
-
const blockchainData =
|
|
47
|
-
return this.responseHelper.
|
|
45
|
+
const result = fillResultByError(error);
|
|
46
|
+
const blockchainData = createDefaultBlockchainData({ result });
|
|
47
|
+
return this.responseHelper.getErrorResponse(blockchainData, "delegate");
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
undelegate = async (data, options) => {
|
|
51
51
|
try {
|
|
52
|
-
const blockchainUndelegateData =
|
|
52
|
+
const blockchainUndelegateData = fillBlockchainUndelegateData(data);
|
|
53
53
|
const response = await this.blockchainService.undelegate(blockchainUndelegateData, options);
|
|
54
|
-
return this.responseHelper.
|
|
54
|
+
return this.responseHelper.getResponse(response.data);
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
|
-
const result =
|
|
58
|
-
const blockchainData =
|
|
59
|
-
return this.responseHelper.
|
|
57
|
+
const result = fillResultByError(error);
|
|
58
|
+
const blockchainData = createDefaultBlockchainData({ result });
|
|
59
|
+
return this.responseHelper.getErrorResponse(blockchainData, "undelegate");
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
@@ -3,14 +3,14 @@ import { BaseClient } from "./base";
|
|
|
3
3
|
declare class IPAddressAndLocationClient extends BaseClient {
|
|
4
4
|
private ipAddressAndLocationService;
|
|
5
5
|
constructor(clientData: IPAddressAndLocationClientData, errorHandler: ErrorHandler);
|
|
6
|
-
getGeoCoordinates: () => Promise<import("
|
|
6
|
+
getGeoCoordinates: () => Promise<import("../..").GeoCoordinates> | {
|
|
7
7
|
latitude: number;
|
|
8
8
|
longitude: number;
|
|
9
9
|
position_description: string;
|
|
10
10
|
};
|
|
11
11
|
getIPAddress: () => Promise<string> | "";
|
|
12
12
|
getGeoCoordinatesAndIPAddress: () => Promise<{
|
|
13
|
-
geo_coordinates: import("
|
|
13
|
+
geo_coordinates: import("../..").GeoCoordinates;
|
|
14
14
|
ip_address: string;
|
|
15
15
|
}> | {
|
|
16
16
|
geo_coordinates: {
|
|
@@ -7,7 +7,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
7
7
|
constructor(clientData, errorHandler) {
|
|
8
8
|
super(clientData, errorHandler);
|
|
9
9
|
const { token, baseUrl, lang, installationId, userId } = clientData;
|
|
10
|
-
const config = AxiosHelper.
|
|
10
|
+
const config = AxiosHelper.getAxiosConfig(token, baseUrl, lang, installationId);
|
|
11
11
|
this.ipAddressAndLocationService = new IPAddressAndLocationService({
|
|
12
12
|
config,
|
|
13
13
|
userId,
|
|
@@ -16,7 +16,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
16
16
|
// #region "GET"
|
|
17
17
|
getGeoCoordinates = () => {
|
|
18
18
|
try {
|
|
19
|
-
return GeoHelper.
|
|
19
|
+
return GeoHelper.getGeoCoordinates(this.ipAddressAndLocationService);
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
22
|
return { latitude: 0, longitude: 0, position_description: "N/A, N/A" };
|
|
@@ -24,7 +24,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
24
24
|
};
|
|
25
25
|
getIPAddress = () => {
|
|
26
26
|
try {
|
|
27
|
-
return GeoHelper.
|
|
27
|
+
return GeoHelper.getIPAddress(this.ipAddressAndLocationService);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
return "";
|
|
@@ -32,7 +32,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
32
32
|
};
|
|
33
33
|
getGeoCoordinatesAndIPAddress = () => {
|
|
34
34
|
try {
|
|
35
|
-
return GeoHelper.
|
|
35
|
+
return GeoHelper.getGeoCoordinatesAndIPAddress(this.ipAddressAndLocationService);
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
return { geo_coordinates: { latitude: 0, longitude: 0 }, ip_address: "" };
|
|
@@ -4,58 +4,103 @@ declare class LimitedClient extends BaseClient {
|
|
|
4
4
|
private limitedService;
|
|
5
5
|
constructor(clientData: LimitedClientData, errorHandler: ErrorHandler);
|
|
6
6
|
checkForgetPassword: (data: ICheckForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
7
|
-
data: import("
|
|
7
|
+
data: import("../..").ForgetSecurityData;
|
|
8
8
|
success: boolean;
|
|
9
9
|
message: string;
|
|
10
|
-
error:
|
|
10
|
+
error: null;
|
|
11
|
+
} | {
|
|
12
|
+
data: import("../..").ForgetSecurityData;
|
|
13
|
+
success: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
error: string;
|
|
11
16
|
}>;
|
|
12
17
|
validateForgetPassword: (data: IValidateForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
13
|
-
data: import("
|
|
18
|
+
data: import("../..").ForgetSecurityData;
|
|
14
19
|
success: boolean;
|
|
15
20
|
message: string;
|
|
16
|
-
error:
|
|
21
|
+
error: null;
|
|
22
|
+
} | {
|
|
23
|
+
data: import("../..").ForgetSecurityData;
|
|
24
|
+
success: boolean;
|
|
25
|
+
message: string;
|
|
26
|
+
error: string;
|
|
17
27
|
}>;
|
|
18
28
|
confirmForgetPassword: (data: IConfirmForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
19
|
-
data: import("
|
|
29
|
+
data: import("../..").ForgetSecurityData;
|
|
20
30
|
success: boolean;
|
|
21
31
|
message: string;
|
|
22
|
-
error:
|
|
32
|
+
error: null;
|
|
33
|
+
} | {
|
|
34
|
+
data: import("../..").ForgetSecurityData;
|
|
35
|
+
success: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
error: string;
|
|
23
38
|
}>;
|
|
24
39
|
validateEmail: (data: IValidateEmailData, options?: RequestOptions) => Promise<{
|
|
25
|
-
data: import("
|
|
40
|
+
data: import("../..").ValidateLimitedSecurity;
|
|
41
|
+
success: boolean;
|
|
42
|
+
message: string;
|
|
43
|
+
error: null;
|
|
44
|
+
} | {
|
|
45
|
+
data: import("../..").ValidateLimitedSecurity;
|
|
26
46
|
success: boolean;
|
|
27
47
|
message: string;
|
|
28
|
-
error:
|
|
48
|
+
error: string;
|
|
29
49
|
}>;
|
|
30
50
|
validatePhone: (data: IValidatePhoneData, options?: RequestOptions) => Promise<{
|
|
31
|
-
data: import("
|
|
51
|
+
data: import("../..").ValidateLimitedSecurity;
|
|
52
|
+
success: boolean;
|
|
53
|
+
message: string;
|
|
54
|
+
error: null;
|
|
55
|
+
} | {
|
|
56
|
+
data: import("../..").ValidateLimitedSecurity;
|
|
32
57
|
success: boolean;
|
|
33
58
|
message: string;
|
|
34
|
-
error:
|
|
59
|
+
error: string;
|
|
35
60
|
}>;
|
|
36
61
|
verifyEmail: (data: IVerifyEmailData, options?: RequestOptions) => Promise<{
|
|
37
|
-
data: import("
|
|
62
|
+
data: import("../..").VerifyUserSecurity;
|
|
63
|
+
success: boolean;
|
|
64
|
+
message: string;
|
|
65
|
+
error: null;
|
|
66
|
+
} | {
|
|
67
|
+
data: import("../..").VerifyUserSecurity;
|
|
38
68
|
success: boolean;
|
|
39
69
|
message: string;
|
|
40
|
-
error:
|
|
70
|
+
error: string;
|
|
41
71
|
}>;
|
|
42
72
|
verifyPhone: (data: IVerifyPhoneData, options?: RequestOptions) => Promise<{
|
|
43
|
-
data: import("
|
|
73
|
+
data: import("../..").VerifyUserSecurity;
|
|
74
|
+
success: boolean;
|
|
75
|
+
message: string;
|
|
76
|
+
error: null;
|
|
77
|
+
} | {
|
|
78
|
+
data: import("../..").VerifyUserSecurity;
|
|
44
79
|
success: boolean;
|
|
45
80
|
message: string;
|
|
46
|
-
error:
|
|
81
|
+
error: string;
|
|
47
82
|
}>;
|
|
48
83
|
confirmEmail: (data: IConfirmEmailData, options?: RequestOptions) => Promise<{
|
|
49
|
-
data: import("
|
|
84
|
+
data: import("../..").ConfirmUserSecurity;
|
|
50
85
|
success: boolean;
|
|
51
86
|
message: string;
|
|
52
|
-
error:
|
|
87
|
+
error: null;
|
|
88
|
+
} | {
|
|
89
|
+
data: import("../..").ConfirmUserSecurity;
|
|
90
|
+
success: boolean;
|
|
91
|
+
message: string;
|
|
92
|
+
error: string;
|
|
53
93
|
}>;
|
|
54
94
|
confirmPhone: (data: IConfirmPhoneData, options?: RequestOptions) => Promise<{
|
|
55
|
-
data: import("
|
|
95
|
+
data: import("../..").ConfirmUserSecurity;
|
|
96
|
+
success: boolean;
|
|
97
|
+
message: string;
|
|
98
|
+
error: null;
|
|
99
|
+
} | {
|
|
100
|
+
data: import("../..").ConfirmUserSecurity;
|
|
56
101
|
success: boolean;
|
|
57
102
|
message: string;
|
|
58
|
-
error:
|
|
103
|
+
error: string;
|
|
59
104
|
}>;
|
|
60
105
|
}
|
|
61
106
|
export { LimitedClient };
|