@soltech/fluid-common 0.4.38 → 0.4.40
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/.editorconfig +21 -0
- package/.eslintignore +2 -0
- package/.eslintrc +11 -0
- package/.husky/pre-commit +4 -0
- package/package.json +33 -19
- package/src/index.ts +54 -54
package/.editorconfig
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
+
|
|
3
|
+
# top-most EditorConfig file
|
|
4
|
+
root = true
|
|
5
|
+
|
|
6
|
+
# Unix-style newlines with a newline ending every file
|
|
7
|
+
[*]
|
|
8
|
+
charset = utf-8
|
|
9
|
+
indent_style = tab
|
|
10
|
+
indent_size = 4
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
max_line_length = 140
|
|
13
|
+
insert_final_newline = true
|
|
14
|
+
trim_trailing_whitespace = true
|
|
15
|
+
|
|
16
|
+
[*.md]
|
|
17
|
+
trim_trailing_whitespace = false
|
|
18
|
+
max_line_length = off
|
|
19
|
+
|
|
20
|
+
[{package.json,package-lock.json}]
|
|
21
|
+
max_line_length = off
|
package/.eslintignore
ADDED
package/.eslintrc
ADDED
package/package.json
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"name": "@soltech/fluid-common",
|
|
3
|
+
"version": "0.4.40",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Fluid frontend and API commons",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types:": "lib/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"pub": "npm run build && npm publish && git push",
|
|
11
|
+
"lint": "npx eslint .",
|
|
12
|
+
"lint:fix": "npx eslint . --fix",
|
|
13
|
+
"prepare": "husky install"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/soltechno/cashin-common.git"
|
|
18
|
+
},
|
|
19
|
+
"author": "Sol Technologies",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@soltech/eslint-config": "^0.1.0",
|
|
23
|
+
"@stylistic/eslint-plugin": "^1.5.1",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
25
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
26
|
+
"eslint": ">=8.50",
|
|
27
|
+
"eslint-plugin-smarter-tabs": "^1.2.0",
|
|
28
|
+
"husky": "^8.0.0",
|
|
29
|
+
"lint-staged": "^15.2.0",
|
|
30
|
+
"typescript": "^5.0.4"
|
|
31
|
+
},
|
|
32
|
+
"lint-staged": {
|
|
33
|
+
"*.{ts}": "eslint --fix"
|
|
34
|
+
}
|
|
21
35
|
}
|
package/src/index.ts
CHANGED
|
@@ -17,10 +17,10 @@ export enum TraitType {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export enum PaymentType {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
BANK_TRANSFER = 'BankTransfer',
|
|
21
|
+
CREDIT_CARD = 'CreditCard',
|
|
22
|
+
CRYPTO = 'Crypto',
|
|
23
|
+
EWALLET = 'EWallet'
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface WalletRequestBody {
|
|
@@ -40,7 +40,7 @@ export interface WalletConfig {
|
|
|
40
40
|
defaultDepositAmount: number;
|
|
41
41
|
integration: Integration;
|
|
42
42
|
logo: string;
|
|
43
|
-
|
|
43
|
+
suggestedDepositAmounts: number[];
|
|
44
44
|
theme: Record<string, string>;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -69,32 +69,32 @@ export interface PaymentMethod {
|
|
|
69
69
|
minAmount: number;
|
|
70
70
|
maxAmount: number;
|
|
71
71
|
info: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
paymentType: PaymentType;
|
|
73
|
+
providerType: string;
|
|
74
|
+
inputFields?: InputField[];
|
|
75
|
+
bonusCodes?: string[];
|
|
76
76
|
instructions?: string;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface PaymentMethodLogo {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
height: number;
|
|
81
|
+
url: string;
|
|
82
|
+
width: number;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export interface InputField {
|
|
86
86
|
paramName: string;
|
|
87
87
|
format: string;
|
|
88
88
|
text: string;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
placeholderText: string;
|
|
90
|
+
errorText: string;
|
|
91
|
+
options: InputFieldOption[];
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface InputFieldOption {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
label: string;
|
|
96
|
+
code: string;
|
|
97
|
+
logo?: PaymentMethodLogo;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export interface RecentMethod extends PaymentMethod {
|
|
@@ -119,38 +119,38 @@ export interface CreditcardTransactionParams extends TransactionParams {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export interface BankTransferTransactionParams extends TransactionParams {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
122
|
+
accountName?: string;
|
|
123
|
+
accountNumber?: string;
|
|
124
|
+
accountType?: string;
|
|
125
|
+
bankCode?: string;
|
|
126
|
+
bankName?: string;
|
|
127
|
+
beneficiaryCity?: string;
|
|
128
|
+
beneficiaryCountry?: string;
|
|
129
|
+
beneficiaryName?: string;
|
|
130
|
+
beneficiaryState?: string;
|
|
131
|
+
beneficiaryStreet?: string;
|
|
132
|
+
beneficiaryZip?: string;
|
|
133
|
+
bic?: string;
|
|
134
|
+
branchAddress?: string;
|
|
135
|
+
branchCode?: string;
|
|
136
|
+
branchName?: string;
|
|
137
|
+
clearingNumber?: string;
|
|
138
|
+
countryCode?: string;
|
|
139
|
+
iban?: string;
|
|
140
|
+
nationalId?: string;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
export interface CryptoTransactionParams extends TransactionParams {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
cryptoCurrency?: string;
|
|
145
|
+
destinationTag?: string;
|
|
146
|
+
walletAddress?: string;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export interface EWalletTransactionParams extends TransactionParams {
|
|
150
|
-
|
|
150
|
+
customerNumber?: string;
|
|
151
151
|
email?: string;
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
mobile?: string;
|
|
153
|
+
phoneNumber?: string;
|
|
154
154
|
service?: string;
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -160,7 +160,7 @@ export interface TransactionOptions {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export interface TransactionResult {
|
|
163
|
-
|
|
163
|
+
error?: ProviderTransactionError;
|
|
164
164
|
redirectOutput?: RedirectOutput;
|
|
165
165
|
state: TransactionState;
|
|
166
166
|
statusCode: string;
|
|
@@ -178,16 +178,16 @@ export interface RedirectOutput {
|
|
|
178
178
|
export enum TransactionState {
|
|
179
179
|
SUCCESS = 'SUCCESS',
|
|
180
180
|
FAIL = 'FAIL',
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
PROCESSING = 'PROCESSING',
|
|
182
|
+
WAITING_APPROVAL = 'WAITING_APPROVAL',
|
|
183
183
|
WAITING_INPUT = 'WAITING_INPUT'
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
export interface ProviderTransactionError {
|
|
187
|
-
|
|
187
|
+
code: string;
|
|
188
188
|
textTitle: string;
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
text: string;
|
|
190
|
+
action: Action;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
export enum Action {
|
|
@@ -195,20 +195,20 @@ export enum Action {
|
|
|
195
195
|
RESTART_CLEARING_DETAILS = 'RESTART_CLEARING_DETAILS',
|
|
196
196
|
SHOW_DETAILS_STEP_PRESERVING_DETAILS = 'SHOW_DETAILS_STEP_PRESERVING_DETAILS',
|
|
197
197
|
SHOW_DETAILS_STEP_CLEARING_DETAILS = 'SHOW_DETAILS_STEP_CLEARING_DETAILS',
|
|
198
|
-
SHOW_CVC_EDIT = 'SHOW_CVC_EDIT'
|
|
198
|
+
SHOW_CVC_EDIT = 'SHOW_CVC_EDIT'
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
export interface PendingWithdrawal {
|
|
202
202
|
amount: string;
|
|
203
|
-
|
|
203
|
+
creationDate: string;
|
|
204
204
|
providerType: string;
|
|
205
205
|
state: WithdrawalState;
|
|
206
206
|
transactionId: string;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export enum WithdrawalState {
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
REQUESTED = 'REQUESTED',
|
|
211
|
+
PROCESSING = 'PROCESSING'
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export interface AvailableBonusWithPaymentMethods {
|
|
@@ -226,5 +226,5 @@ export interface BonusPaymentMethod {
|
|
|
226
226
|
|
|
227
227
|
export interface TrackingEvent {
|
|
228
228
|
eventId: string;
|
|
229
|
-
data: object;
|
|
229
|
+
data: object;
|
|
230
230
|
}
|