ggez-banking-sdk 0.1.41 → 0.1.43

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.
@@ -11,5 +11,5 @@ export declare enum BlockchainRequestType {
11
11
  Send = 1,
12
12
  Multi_Send = 2,
13
13
  Delegate = 3,
14
- UnDelegate = 4
14
+ Undelegate = 4
15
15
  }
@@ -17,5 +17,5 @@ var BlockchainRequestType;
17
17
  BlockchainRequestType[BlockchainRequestType["Send"] = 1] = "Send";
18
18
  BlockchainRequestType[BlockchainRequestType["Multi_Send"] = 2] = "Multi_Send";
19
19
  BlockchainRequestType[BlockchainRequestType["Delegate"] = 3] = "Delegate";
20
- BlockchainRequestType[BlockchainRequestType["UnDelegate"] = 4] = "UnDelegate";
20
+ BlockchainRequestType[BlockchainRequestType["Undelegate"] = 4] = "Undelegate";
21
21
  })(BlockchainRequestType || (exports.BlockchainRequestType = BlockchainRequestType = {}));
@@ -5,7 +5,7 @@ import { DoTransactionInterface, GetTransactionInterface } from "../interfaces/a
5
5
  import { CreateAddressInterface, DeleteUserAddressInterface, MakeAddressPrimaryInterface, UpdateAddressInterface, CreateUserEmailInterface, DeleteUserEmailInterface, UpdateUserEmailInterface, ConfirmLimitedEmailInterface, MakePrimaryUserEmailInterface, VerifyLimitedEmailInterface, ConfirmLimitedPhoneInterface, CreateUserPhoneInterface, DeleteUserPhoneInterface, MakeUserPhonePrimaryInterface, UpdateUserPhoneInterface, VerifyLimitedPhoneInterface, CreateBankAccountInterFace, UpdateBankAccountInterFace, DeleteBankAccountInterFace, MakeBankAccountPrimaryInterFace, CreateIdentificationInterface, DeleteIdentificationInterface, UpdateIdentificationInterface, UpdatePersonalInfoInterface, UpdateProfilePictureInterface, ChangeUserSecurityCodeInterface, ResetPasswordInterface, ResetSecurityQuestionsInterface, UpdateUserPreferencesInterface, ValidateSecurityCodeInterface, ActivateGoogleAuthInterface, ValidateLimitedPhoneInterface, IsEmailPresentAndValidInterface, IsPhonePresentAndValidInterface, SendOTPPhoneInterface, SendOTPEmailInterface, CreateDocumentInterface, ForgetPasswordConfirmInterface, ForgetPasswordValidateInterface, DeleteGoogleAuthInterface, CreateTicketInterface } from "../interfaces/bankingSystemInterface";
6
6
  import { IOrderInterface } from "../interfaces/transactionInterface";
7
7
  import { CreateDocumentOrganizationInterface, CreateOrganizationInterface, UpdateOrganizationInterface } from "../interfaces/organizationInterface";
8
- import { IBlockchainData, IDelegateData, IMultiSendData, ISendData, IUndelegateData } from "../interfaces/blockchain";
8
+ import { IBlockchainDelegateRequest, IBlockchainMultiSendRequest, IBlockchainSendRequest, IBlockchainUndelegateRequest } from "../interfaces/blockchain";
9
9
  import { BlockchainRequestType } from "../constants";
10
10
  declare const Data: () => {
11
11
  dataSignUpApi: (values: SignUpInterface) => {
@@ -3267,6 +3267,6 @@ declare const Data: () => {
3267
3267
  time_zone_name: string;
3268
3268
  };
3269
3269
  };
3270
- GetBlockchainRequestData: (values: ISendData | IMultiSendData | IDelegateData | IUndelegateData, blockchainRequestType: BlockchainRequestType) => IBlockchainData;
3270
+ GetBlockchainRequestData: (values: IBlockchainSendRequest | IBlockchainMultiSendRequest | IBlockchainDelegateRequest | IBlockchainUndelegateRequest, blockchainRequestType: BlockchainRequestType) => IBlockchainSendRequest | IBlockchainMultiSendRequest | IBlockchainDelegateRequest | IBlockchainUndelegateRequest;
3271
3271
  };
3272
3272
  export default Data;
@@ -75,7 +75,6 @@ const Data = () => {
75
75
  info: info,
76
76
  transaction_data: transaction_data,
77
77
  authentication: authentication,
78
- fee: null,
79
78
  };
80
79
  return data;
81
80
  };
@@ -85,7 +84,6 @@ const Data = () => {
85
84
  info: info,
86
85
  transaction_data: transaction_data,
87
86
  authentication: authentication,
88
- fee: null,
89
87
  };
90
88
  return data;
91
89
  };
@@ -93,9 +91,10 @@ const Data = () => {
93
91
  const { info, transaction_data, authentication } = values;
94
92
  const data = {
95
93
  info: info,
96
- transaction_data: transaction_data,
94
+ transaction_data: {
95
+ delegate: transaction_data.delegate,
96
+ },
97
97
  authentication: authentication,
98
- fee: null,
99
98
  };
100
99
  return data;
101
100
  };
@@ -103,9 +102,10 @@ const Data = () => {
103
102
  const { info, transaction_data, authentication } = values;
104
103
  const data = {
105
104
  info: info,
106
- transaction_data: transaction_data,
105
+ transaction_data: {
106
+ undelegate: transaction_data.undelegate,
107
+ },
107
108
  authentication: authentication,
108
- fee: null,
109
109
  };
110
110
  return data;
111
111
  };
@@ -116,7 +116,7 @@ const Data = () => {
116
116
  return GetMultiSendRequestData(values);
117
117
  case constants_1.BlockchainRequestType.Delegate:
118
118
  return GetDelegateRequestData(values);
119
- case constants_1.BlockchainRequestType.UnDelegate:
119
+ case constants_1.BlockchainRequestType.Undelegate:
120
120
  return GetUndelegateRequestData(values);
121
121
  default:
122
122
  return null;
@@ -7,24 +7,32 @@ interface IAuthentication {
7
7
  type: number;
8
8
  code: string;
9
9
  }
10
- interface IBase {
10
+ interface IBaseRequest {
11
11
  info: {
12
- user_id?: number;
13
12
  account_id: number;
14
- program_id?: number;
15
- chain_address?: string;
16
- validator_address?: string;
17
- memo?: string;
18
- type?: number;
19
13
  chain_type: ChainType;
20
- client_date?: string;
21
- server_date?: string;
22
- date_utc?: string;
23
- source_time_zone?: string;
24
- source_id?: string;
25
14
  };
26
15
  authentication: IAuthentication[];
27
16
  }
17
+ interface IBaseResponse {
18
+ info: {
19
+ user_id: number;
20
+ account_id: number;
21
+ program_id: number;
22
+ chain_address: string;
23
+ validator_address: string;
24
+ memo: string;
25
+ type: number;
26
+ chain_type: number;
27
+ client_date: string;
28
+ server_date: string;
29
+ date_utc: string;
30
+ source_time_zone: string;
31
+ source_id: string;
32
+ };
33
+ authentication: IAuthentication[];
34
+ fee: ICoin | null;
35
+ }
28
36
  export interface ISend {
29
37
  address: string;
30
38
  coins: ICoin[];
@@ -32,12 +40,12 @@ export interface ISend {
32
40
  export interface IMultiSend {
33
41
  recipients: ISend[];
34
42
  }
35
- export interface ISendData extends IBase {
43
+ export interface ISendData extends IBaseRequest {
36
44
  transaction_data: {
37
45
  send: ISend;
38
46
  };
39
47
  }
40
- export interface IMultiSendData extends IBase {
48
+ export interface IMultiSendData extends IBaseRequest {
41
49
  transaction_data: {
42
50
  multi_send: IMultiSend;
43
51
  };
@@ -46,23 +54,114 @@ export interface IDelegation {
46
54
  validator_address: string;
47
55
  coin: ICoin;
48
56
  }
49
- export interface IDelegateData extends IBase {
57
+ export interface IDelegateData extends IBaseRequest {
50
58
  transaction_data: {
51
59
  delegate: IDelegation;
52
60
  };
53
61
  }
54
- export interface IUndelegateData extends IBase {
62
+ export interface IUndelegateData extends IBaseRequest {
55
63
  transaction_data: {
56
64
  undelegate: IDelegation;
57
65
  };
58
66
  }
59
- export interface IBlockchainData extends IBase {
67
+ export interface ISendTransaction {
68
+ transaction_data: {
69
+ send: ISend;
70
+ multi_send?: undefined;
71
+ delegate?: undefined;
72
+ undelegate?: undefined;
73
+ };
74
+ }
75
+ export interface IMultiSendTransaction {
60
76
  transaction_data: {
61
- send?: ISend;
62
- multi_send?: IMultiSend;
63
- delegate?: IDelegation;
64
- undelegate?: IDelegation;
77
+ send?: undefined;
78
+ multi_send: IMultiSend;
79
+ delegate?: undefined;
80
+ undelegate?: undefined;
65
81
  };
66
- fee: ICoin | null;
67
82
  }
83
+ export interface IDelegateTransaction {
84
+ transaction_data: {
85
+ send?: undefined;
86
+ multi_send?: undefined;
87
+ delegate: IDelegation;
88
+ undelegate?: undefined;
89
+ };
90
+ }
91
+ export interface IUndelegateTransaction {
92
+ transaction_data: {
93
+ send?: undefined;
94
+ multi_send?: undefined;
95
+ delegate?: undefined;
96
+ undelegate: IDelegation;
97
+ };
98
+ }
99
+ export interface IBlockchainSendRequest extends IBaseRequest {
100
+ transaction_data: {
101
+ send: ISend;
102
+ multi_send?: undefined;
103
+ delegate?: undefined;
104
+ undelegate?: undefined;
105
+ };
106
+ }
107
+ export interface IBlockchainMultiSendRequest extends IBaseRequest {
108
+ transaction_data: {
109
+ send?: undefined;
110
+ multi_send: IMultiSend;
111
+ delegate?: undefined;
112
+ undelegate?: undefined;
113
+ };
114
+ }
115
+ export interface IBlockchainDelegateRequest extends IBaseRequest {
116
+ transaction_data: {
117
+ send?: undefined;
118
+ multi_send?: undefined;
119
+ delegate: IDelegation;
120
+ undelegate?: undefined;
121
+ };
122
+ }
123
+ export interface IBlockchainUndelegateRequest extends IBaseRequest {
124
+ transaction_data: {
125
+ send?: undefined;
126
+ multi_send?: undefined;
127
+ delegate?: undefined;
128
+ undelegate: IDelegation;
129
+ };
130
+ }
131
+ export interface IBlockchainSendResponse extends IBaseResponse {
132
+ transaction_data: {
133
+ send: ISend;
134
+ multi_send: null;
135
+ delegate: null;
136
+ undelegate: null;
137
+ };
138
+ }
139
+ export interface IBlockchainMultiSendResponse extends IBaseResponse {
140
+ transaction_data: {
141
+ send: null;
142
+ multi_send: IMultiSend;
143
+ delegate: null;
144
+ undelegate: null;
145
+ };
146
+ }
147
+ export interface IBlockchainDelegateResponse extends IBaseResponse {
148
+ transaction_data: {
149
+ send: null;
150
+ multi_send: null;
151
+ delegate: IDelegation;
152
+ undelegate: null;
153
+ };
154
+ }
155
+ export interface IBlockchainUndelegateResponse extends IBaseResponse {
156
+ transaction_data: {
157
+ send: null;
158
+ multi_send: null;
159
+ delegate: null;
160
+ undelegate: IDelegation;
161
+ };
162
+ }
163
+ export type IBlockchainRequestData = IBlockchainSendRequest | IBlockchainMultiSendRequest | IBlockchainDelegateRequest | IBlockchainUndelegateRequest;
164
+ export type IBlockchainResponseData = IBaseResponse & {
165
+ fee: ICoin | null;
166
+ };
68
167
  export {};
@@ -1,25 +1,25 @@
1
- import { ISendData, IMultiSendData, IDelegateData, IUndelegateData } from "./../interfaces/blockchain";
1
+ import { IBlockchainSendRequest, IBlockchainMultiSendRequest, IBlockchainDelegateRequest, IBlockchainUndelegateRequest } from "./../interfaces/blockchain";
2
2
  import { UserInfo } from "../interfaces/interface";
3
3
  export declare const useBlockchain: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, lang?: string) => {
4
- SendRequest: (values: ISendData) => Promise<{
4
+ SendRequest: (values: IBlockchainSendRequest) => Promise<{
5
5
  response: any;
6
6
  newUser: any;
7
7
  message: any;
8
8
  status: string;
9
9
  }>;
10
- MultiSendRequest: (values: IMultiSendData) => Promise<{
10
+ MultiSendRequest: (values: IBlockchainMultiSendRequest) => Promise<{
11
11
  response: any;
12
12
  newUser: any;
13
13
  message: any;
14
14
  status: string;
15
15
  }>;
16
- DelegateRequest: (values: IDelegateData) => Promise<{
16
+ DelegateRequest: (values: IBlockchainDelegateRequest) => Promise<{
17
17
  response: any;
18
18
  newUser: any;
19
19
  message: any;
20
20
  status: string;
21
21
  }>;
22
- UnDelegateRequest: (values: IUndelegateData) => Promise<{
22
+ UndelegateRequest: (values: IBlockchainUndelegateRequest) => Promise<{
23
23
  response: any;
24
24
  newUser: any;
25
25
  message: any;
@@ -86,10 +86,10 @@ const useBlockchain = (token, userInfo, userId, baseUrl, lang) => {
86
86
  };
87
87
  }
88
88
  };
89
- const UnDelegateRequest = async (values) => {
89
+ const UndelegateRequest = async (values) => {
90
90
  try {
91
- const data = GetBlockchainRequestData(values, constants_1.BlockchainRequestType.UnDelegate);
92
- return await RequestHandler(data, constants_1.BlockchainRequestType.UnDelegate);
91
+ const data = GetBlockchainRequestData(values, constants_1.BlockchainRequestType.Undelegate);
92
+ return await RequestHandler(data, constants_1.BlockchainRequestType.Undelegate);
93
93
  }
94
94
  catch (error) {
95
95
  return {
@@ -104,7 +104,7 @@ const useBlockchain = (token, userInfo, userId, baseUrl, lang) => {
104
104
  SendRequest,
105
105
  MultiSendRequest,
106
106
  DelegateRequest,
107
- UnDelegateRequest,
107
+ UndelegateRequest,
108
108
  };
109
109
  };
110
110
  exports.useBlockchain = useBlockchain;
@@ -10,8 +10,8 @@ const GetKeyAndFunctionNameByRequestType = (requestType) => {
10
10
  return { key: "multiSend", functionName: "MultiSendRequest" };
11
11
  case constants_1.BlockchainRequestType.Delegate:
12
12
  return { key: "delegate", functionName: "DelegateRequest" };
13
- case constants_1.BlockchainRequestType.UnDelegate:
14
- return { key: "unDelegate", functionName: "UnDelegateRequest" };
13
+ case constants_1.BlockchainRequestType.Undelegate:
14
+ return { key: "undelegate", functionName: "UndelegateRequest" };
15
15
  default:
16
16
  return { key: "", functionName: "" };
17
17
  }
@@ -29,7 +29,7 @@ const GetEndpointByRequestType = (requestType) => {
29
29
  case constants_1.BlockchainRequestType.Delegate:
30
30
  action = constants_1.BlockchainActions.Delegate;
31
31
  break;
32
- case constants_1.BlockchainRequestType.UnDelegate:
32
+ case constants_1.BlockchainRequestType.Undelegate:
33
33
  action = constants_1.BlockchainActions.Undelegate;
34
34
  break;
35
35
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",