squarefi-bff-api-module 1.31.5 → 1.32.0
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/package.json +10 -3
- package/src/api/types/autogen/apiV2.types.ts +117 -2
- package/src/utils/apiClientFactory.ts +0 -1
- package/tsconfig.json +2 -2
- package/dist/api/auth.d.ts +0 -29
- package/dist/api/auth.js +0 -76
- package/dist/api/bank-data.d.ts +0 -4
- package/dist/api/bank-data.js +0 -9
- package/dist/api/counterparties.d.ts +0 -14
- package/dist/api/counterparties.js +0 -48
- package/dist/api/developer.d.ts +0 -12
- package/dist/api/developer.js +0 -15
- package/dist/api/exchange.d.ts +0 -14
- package/dist/api/exchange.js +0 -23
- package/dist/api/frontend.d.ts +0 -11
- package/dist/api/frontend.js +0 -14
- package/dist/api/index.d.ts +0 -38
- package/dist/api/index.js +0 -39
- package/dist/api/issuing.d.ts +0 -64
- package/dist/api/issuing.js +0 -157
- package/dist/api/kyc.d.ts +0 -21
- package/dist/api/kyc.js +0 -24
- package/dist/api/list.d.ts +0 -16
- package/dist/api/list.js +0 -19
- package/dist/api/orders.d.ts +0 -49
- package/dist/api/orders.js +0 -107
- package/dist/api/persona.d.ts +0 -7
- package/dist/api/persona.js +0 -10
- package/dist/api/storage.d.ts +0 -8
- package/dist/api/storage.js +0 -19
- package/dist/api/tenants.d.ts +0 -6
- package/dist/api/tenants.js +0 -9
- package/dist/api/totp.d.ts +0 -17
- package/dist/api/totp.js +0 -48
- package/dist/api/types/autogen/apiV2.types.d.ts +0 -4729
- package/dist/api/types/autogen/apiV2.types.js +0 -6
- package/dist/api/types/types.d.ts +0 -2258
- package/dist/api/types/types.js +0 -2
- package/dist/api/user.d.ts +0 -18
- package/dist/api/user.js +0 -21
- package/dist/api/virtual-accounts.d.ts +0 -9
- package/dist/api/virtual-accounts.js +0 -26
- package/dist/api/wallets.d.ts +0 -24
- package/dist/api/wallets.js +0 -56
- package/dist/constants.d.ts +0 -303
- package/dist/constants.js +0 -335
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.js +0 -19
- package/dist/hooks/useCalc.d.ts +0 -25
- package/dist/hooks/useCalc.js +0 -129
- package/dist/hooks/useFileUpload.d.ts +0 -49
- package/dist/hooks/useFileUpload.js +0 -113
- package/dist/hooks/useSupabaseSubscription/config.d.ts +0 -2
- package/dist/hooks/useSupabaseSubscription/config.js +0 -9
- package/dist/hooks/useSupabaseSubscription/index.d.ts +0 -3
- package/dist/hooks/useSupabaseSubscription/index.js +0 -7
- package/dist/hooks/useSupabaseSubscription/specialized.d.ts +0 -5
- package/dist/hooks/useSupabaseSubscription/specialized.js +0 -21
- package/dist/hooks/useSupabaseSubscription/types.d.ts +0 -16
- package/dist/hooks/useSupabaseSubscription/types.js +0 -2
- package/dist/hooks/useSupabaseSubscription/useSupabaseSubscription.d.ts +0 -5
- package/dist/hooks/useSupabaseSubscription/useSupabaseSubscription.js +0 -36
- package/dist/hooks/useUserFiles.d.ts +0 -49
- package/dist/hooks/useUserFiles.js +0 -118
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -26
- package/dist/utils/apiClientFactory.d.ts +0 -31
- package/dist/utils/apiClientFactory.js +0 -155
- package/dist/utils/converters.d.ts +0 -1
- package/dist/utils/converters.js +0 -5
- package/dist/utils/encrypt.d.ts +0 -10
- package/dist/utils/encrypt.js +0 -95
- package/dist/utils/fileStorage.d.ts +0 -113
- package/dist/utils/fileStorage.js +0 -344
- package/dist/utils/storage.d.ts +0 -3
- package/dist/utils/storage.js +0 -30
- package/dist/utils/supabase.d.ts +0 -1
- package/dist/utils/supabase.js +0 -15
- package/dist/utils/tokensFactory.d.ts +0 -12
- package/dist/utils/tokensFactory.js +0 -60
package/dist/constants.js
DELETED
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardTransactionStatus = exports.CounterpartyDestinationType = exports.CounterpartyType = exports.SortingDirection = exports.APIKeyRole = exports.CurrencyType = exports.SubAccountType = exports.SubAccountStatus = exports.IssuingProgramStatus = exports.CardStatus = exports.OrderStatuses = exports.KYCStatuses = exports.CalcType = exports.defaultPaginationParams = exports.walletType = exports.WalletTypeValues = exports.ResponseStatus = exports.RequestLoadingType = exports.RequestStatus = exports.WalletTransactionRecordType = exports.OrderType = exports.OrderPaymentMethod = exports.WalletTransactionStatus = exports.WalletTransactionMethod = exports.WalletTransactionType = exports.CardTransactionType = exports.CardType = exports.CardFormFactor = exports.AppEnviroment = exports.falsyValues = void 0;
|
|
4
|
-
exports.falsyValues = ['false', '0', '', 'FALSE', false, null, undefined, NaN, 0];
|
|
5
|
-
var AppEnviroment;
|
|
6
|
-
(function (AppEnviroment) {
|
|
7
|
-
AppEnviroment["WEB"] = "web";
|
|
8
|
-
AppEnviroment["TELEGRAM"] = "telegram";
|
|
9
|
-
})(AppEnviroment || (exports.AppEnviroment = AppEnviroment = {}));
|
|
10
|
-
var CardFormFactor;
|
|
11
|
-
(function (CardFormFactor) {
|
|
12
|
-
CardFormFactor["VIRTUAL"] = "VIRTUAL";
|
|
13
|
-
CardFormFactor["PHYSICAL"] = "PHYSICAL";
|
|
14
|
-
})(CardFormFactor || (exports.CardFormFactor = CardFormFactor = {}));
|
|
15
|
-
var CardType;
|
|
16
|
-
(function (CardType) {
|
|
17
|
-
CardType["CREDIT"] = "CREDIT";
|
|
18
|
-
CardType["DEBIT"] = "DEBIT";
|
|
19
|
-
})(CardType || (exports.CardType = CardType = {}));
|
|
20
|
-
var CardTransactionType;
|
|
21
|
-
(function (CardTransactionType) {
|
|
22
|
-
CardTransactionType["AUTHORIZATION"] = "AUTHORIZATION";
|
|
23
|
-
CardTransactionType["CLEARING"] = "CLEARING";
|
|
24
|
-
CardTransactionType["REFUND"] = "REFUND";
|
|
25
|
-
CardTransactionType["REVERSAL"] = "REVERSAL";
|
|
26
|
-
CardTransactionType["ORIGINAL_CREDIT"] = "ORIGINAL_CREDIT";
|
|
27
|
-
CardTransactionType["FEE"] = "FEE";
|
|
28
|
-
CardTransactionType["DEPOSIT"] = "DEPOSIT";
|
|
29
|
-
CardTransactionType["WITHDRAWAL"] = "WITHDRAWAL";
|
|
30
|
-
CardTransactionType["PAYMENT"] = "PAYMENT";
|
|
31
|
-
CardTransactionType["PURCHASE"] = "PURCHASE";
|
|
32
|
-
})(CardTransactionType || (exports.CardTransactionType = CardTransactionType = {}));
|
|
33
|
-
var WalletTransactionType;
|
|
34
|
-
(function (WalletTransactionType) {
|
|
35
|
-
WalletTransactionType["DEPOSIT"] = "deposit";
|
|
36
|
-
WalletTransactionType["WITHDRAWAL"] = "withdrawal";
|
|
37
|
-
})(WalletTransactionType || (exports.WalletTransactionType = WalletTransactionType = {}));
|
|
38
|
-
var WalletTransactionMethod;
|
|
39
|
-
(function (WalletTransactionMethod) {
|
|
40
|
-
WalletTransactionMethod["P2P"] = "p2p";
|
|
41
|
-
WalletTransactionMethod["CRYPTO"] = "crypto";
|
|
42
|
-
WalletTransactionMethod["BANK_TRANSFER"] = "bank_transfer";
|
|
43
|
-
WalletTransactionMethod["EXCHANGE"] = "exchange";
|
|
44
|
-
WalletTransactionMethod["SBP"] = "sbp";
|
|
45
|
-
})(WalletTransactionMethod || (exports.WalletTransactionMethod = WalletTransactionMethod = {}));
|
|
46
|
-
var WalletTransactionStatus;
|
|
47
|
-
(function (WalletTransactionStatus) {
|
|
48
|
-
WalletTransactionStatus["COMPLETE"] = "complete";
|
|
49
|
-
WalletTransactionStatus["PENDING"] = "pending";
|
|
50
|
-
WalletTransactionStatus["CANCELED"] = "canceled";
|
|
51
|
-
WalletTransactionStatus["FAILED"] = "failed";
|
|
52
|
-
WalletTransactionStatus["PROCESSING"] = "processing";
|
|
53
|
-
WalletTransactionStatus["NEW"] = "new";
|
|
54
|
-
})(WalletTransactionStatus || (exports.WalletTransactionStatus = WalletTransactionStatus = {}));
|
|
55
|
-
var OrderPaymentMethod;
|
|
56
|
-
(function (OrderPaymentMethod) {
|
|
57
|
-
OrderPaymentMethod["ACH"] = "ACH";
|
|
58
|
-
OrderPaymentMethod["SEPA"] = "SEPA";
|
|
59
|
-
OrderPaymentMethod["SWIFT"] = "SWIFT";
|
|
60
|
-
OrderPaymentMethod["DOMESTIC_WIRE"] = "DOMESTIC_WIRE";
|
|
61
|
-
OrderPaymentMethod["CRYPTO_EXTERNAL"] = "CRYPTO_EXTERNAL";
|
|
62
|
-
OrderPaymentMethod["CRYPTO_INTERNAL"] = "CRYPTO_INTERNAL";
|
|
63
|
-
OrderPaymentMethod["CHAPS"] = "CHAPS";
|
|
64
|
-
OrderPaymentMethod["FPS"] = "FPS";
|
|
65
|
-
})(OrderPaymentMethod || (exports.OrderPaymentMethod = OrderPaymentMethod = {}));
|
|
66
|
-
var OrderType;
|
|
67
|
-
(function (OrderType) {
|
|
68
|
-
// when extend do not forget to add new order type to the enum WalletTransactionRecordType
|
|
69
|
-
OrderType["DEPOSIT_ISSUING_SA_CRYPTO_EXT"] = "DEPOSIT_ISSUING_SA_CRYPTO_EXT";
|
|
70
|
-
OrderType["DEPOSIT_ISSUING_SA_SEPA_EXT"] = "DEPOSIT_ISSUING_SA_SEPA_EXT";
|
|
71
|
-
OrderType["DEPOSIT_CRYPTO"] = "DEPOSIT_CRYPTO";
|
|
72
|
-
OrderType["DEPOSIT_FIAT_SEPA"] = "DEPOSIT_FIAT_SEPA";
|
|
73
|
-
OrderType["DEPOSIT_FIAT_SWIFT"] = "DEPOSIT_FIAT_SWIFT";
|
|
74
|
-
OrderType["EXCHANGE_CRYPTO_INTERNAL"] = "EXCHANGE_CRYPTO_INTERNAL";
|
|
75
|
-
OrderType["EXCHANGE_OMNI"] = "EXCHANGE_OMNI";
|
|
76
|
-
OrderType["TRANSFER_CARD_PREPAID"] = "TRANSFER_CARD_PREPAID";
|
|
77
|
-
OrderType["CARD_ISSUING_FEE"] = "CARD_ISSUING_FEE";
|
|
78
|
-
OrderType["TRANSFER_CARD_SUBACCOUNT"] = "TRANSFER_CARD_SUBACCOUNT";
|
|
79
|
-
OrderType["TRANSFER_CARD_WHOLESALE"] = "TRANSFER_CARD_WHOLESALE";
|
|
80
|
-
OrderType["TRANSFER_INTERNAL"] = "TRANSFER_INTERNAL";
|
|
81
|
-
OrderType["WITHDRAWAL_CRYPTO"] = "WITHDRAWAL_CRYPTO";
|
|
82
|
-
OrderType["WITHDRAWAL_FIAT_SEPA"] = "WITHDRAWAL_FIAT_SEPA";
|
|
83
|
-
OrderType["HIFI_WIRE_ONRAMP"] = "HIFI_WIRE_ONRAMP";
|
|
84
|
-
OrderType["HIFI_WIRE_OFFRAMP"] = "HIFI_WIRE_OFFRAMP";
|
|
85
|
-
OrderType["HIFI_WIRE_DEPOSIT"] = "HIFI_WIRE_DEPOSIT";
|
|
86
|
-
OrderType["HIFI_WIRE_WITHDRAWAL"] = "HIFI_WIRE_WITHDRAWAL";
|
|
87
|
-
OrderType["HIFI_ACH_ONRAMP"] = "HIFI_ACH_ONRAMP";
|
|
88
|
-
OrderType["HIFI_ACH_OFFRAMP"] = "HIFI_ACH_OFFRAMP";
|
|
89
|
-
OrderType["HIFI_ACH_DEPOSIT"] = "HIFI_ACH_DEPOSIT";
|
|
90
|
-
OrderType["HIFI_ACH_WITHDRAWAL"] = "HIFI_ACH_WITHDRAWAL";
|
|
91
|
-
OrderType["HIFI_SEPA_ONRAMP"] = "HIFI_SEPA_ONRAMP";
|
|
92
|
-
OrderType["HIFI_SEPA_OFFRAMP"] = "HIFI_SEPA_OFFRAMP";
|
|
93
|
-
OrderType["HIFI_SEPA_DEPOSIT"] = "HIFI_SEPA_DEPOSIT";
|
|
94
|
-
OrderType["HIFI_SEPA_WITHDRAWAL"] = "HIFI_SEPA_WITHDRAWAL";
|
|
95
|
-
OrderType["HIFI_CRYPTO_TRANSFER"] = "HIFI_CRYPTO_TRANSFER";
|
|
96
|
-
OrderType["HIFI_CRYPTO_WITHDRAWAL"] = "HIFI_CRYPTO_WITHDRAWAL";
|
|
97
|
-
OrderType["HIFI_CRYPTO_DEPOSIT"] = "HIFI_CRYPTO_DEPOSIT";
|
|
98
|
-
OrderType["OMNIBUS_CRYPTO_TRANSFER"] = "OMNIBUS_CRYPTO_TRANSFER";
|
|
99
|
-
OrderType["RN_CARDS_OFFRAMP"] = "RN_CARDS_OFFRAMP";
|
|
100
|
-
OrderType["TBD_SWIFT_WITHDRAWAL"] = "TBD_SWIFT_WITHDRAWAL";
|
|
101
|
-
OrderType["SEGREGATED_CRYPTO_TRANSFER"] = "SEGREGATED_CRYPTO_TRANSFER";
|
|
102
|
-
OrderType["L2F_ACH_ONRAMP"] = "L2F_ACH_ONRAMP";
|
|
103
|
-
OrderType["L2F_ACH_OFFRAMP"] = "L2F_ACH_OFFRAMP";
|
|
104
|
-
OrderType["L2F_ACH_DEPOSIT"] = "L2F_ACH_DEPOSIT";
|
|
105
|
-
OrderType["L2F_ACH_WITHDRAWAL"] = "L2F_ACH_WITHDRAWAL";
|
|
106
|
-
OrderType["L2F_WIRE_ONRAMP"] = "L2F_WIRE_ONRAMP";
|
|
107
|
-
OrderType["L2F_WIRE_OFFRAMP"] = "L2F_WIRE_OFFRAMP";
|
|
108
|
-
OrderType["L2F_WIRE_DEPOSIT"] = "L2F_WIRE_DEPOSIT";
|
|
109
|
-
OrderType["L2F_WIRE_WITHDRAWAL"] = "L2F_WIRE_WITHDRAWAL";
|
|
110
|
-
OrderType["L2F_SWIFT_ONRAMP"] = "L2F_SWIFT_ONRAMP";
|
|
111
|
-
OrderType["L2F_SWIFT_OFFRAMP"] = "L2F_SWIFT_OFFRAMP";
|
|
112
|
-
OrderType["L2F_SWIFT_DEPOSIT"] = "L2F_SWIFT_DEPOSIT";
|
|
113
|
-
OrderType["L2F_SWIFT_WITHDRAWAL"] = "L2F_SWIFT_WITHDRAWAL";
|
|
114
|
-
OrderType["L2F_SEPA_ONRAMP"] = "L2F_SEPA_ONRAMP";
|
|
115
|
-
OrderType["L2F_SEPA_OFFRAMP"] = "L2F_SEPA_OFFRAMP";
|
|
116
|
-
OrderType["L2F_SEPA_DEPOSIT"] = "L2F_SEPA_DEPOSIT";
|
|
117
|
-
OrderType["L2F_SEPA_WITHDRAWAL"] = "L2F_SEPA_WITHDRAWAL";
|
|
118
|
-
OrderType["L2F_CRYPTO_WITHDRAWAL"] = "L2F_CRYPTO_WITHDRAWAL";
|
|
119
|
-
OrderType["L2F_CRYPTO_DEPOSIT"] = "L2F_CRYPTO_DEPOSIT";
|
|
120
|
-
OrderType["OMNIBUS_CRYPTO_WITHDRAWAL"] = "OMNIBUS_CRYPTO_WITHDRAWAL";
|
|
121
|
-
OrderType["WITHDRAW_CARD_PREPAID"] = "WITHDRAW_CARD_PREPAID";
|
|
122
|
-
OrderType["WITHDRAW_CARD_SUBACCOUNT"] = "WITHDRAW_CARD_SUBACCOUNT";
|
|
123
|
-
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
124
|
-
var WalletTransactionRecordType;
|
|
125
|
-
(function (WalletTransactionRecordType) {
|
|
126
|
-
WalletTransactionRecordType["CARD_PROVIDER_DEPOSIT"] = "CARD_PROVIDER_DEPOSIT";
|
|
127
|
-
WalletTransactionRecordType["CARD_PROVIDER_REFUND"] = "CARD_PROVIDER_REFUND";
|
|
128
|
-
WalletTransactionRecordType["DEPOSIT"] = "DEPOSIT";
|
|
129
|
-
WalletTransactionRecordType["DEPOSIT_CRYPTO_EXTERNAL"] = "DEPOSIT_CRYPTO_EXTERNAL";
|
|
130
|
-
WalletTransactionRecordType["DEPOSIT_CRYPTO_INTERNAL"] = "DEPOSIT_CRYPTO_INTERNAL";
|
|
131
|
-
WalletTransactionRecordType["DEPOSIT_INTERNAL"] = "DEPOSIT_INTERNAL";
|
|
132
|
-
WalletTransactionRecordType["DEPOSIT_MANUAL"] = "DEPOSIT_MANUAL";
|
|
133
|
-
WalletTransactionRecordType["EXCHANGE_CRYPTO_INTERNAL"] = "EXCHANGE_CRYPTO_INTERNAL";
|
|
134
|
-
WalletTransactionRecordType["EXCHANGE_OMNI"] = "EXCHANGE_OMNI";
|
|
135
|
-
WalletTransactionRecordType["EXT_EXCHANGE"] = "EXT_EXCHANGE";
|
|
136
|
-
WalletTransactionRecordType["FEE"] = "FEE";
|
|
137
|
-
WalletTransactionRecordType["NETWORK_FEE"] = "NETWORK_FEE";
|
|
138
|
-
WalletTransactionRecordType["OFFRAMP_ACHWIRE"] = "OFFRAMP_ACHWIRE";
|
|
139
|
-
WalletTransactionRecordType["OFFRAMP_SEPA"] = "OFFRAMP_SEPA";
|
|
140
|
-
WalletTransactionRecordType["OMNIBUS_CRYPTO_TRANSFER"] = "OMNIBUS_CRYPTO_TRANSFER";
|
|
141
|
-
WalletTransactionRecordType["ONRAMP_ACHWIRE"] = "ONRAMP_ACHWIRE";
|
|
142
|
-
WalletTransactionRecordType["ONRAMP_SEPA"] = "ONRAMP_SEPA";
|
|
143
|
-
WalletTransactionRecordType["REFUND"] = "REFUND";
|
|
144
|
-
WalletTransactionRecordType["RN_CARDS_OFFRAMP"] = "RN_CARDS_OFFRAMP";
|
|
145
|
-
WalletTransactionRecordType["TRANSFER_CARD_PREPAID"] = "TRANSFER_CARD_PREPAID";
|
|
146
|
-
WalletTransactionRecordType["TRANSFER_CARD_SUBACCOUNT"] = "TRANSFER_CARD_SUBACCOUNT";
|
|
147
|
-
WalletTransactionRecordType["TRANSFER_CARD_WHOLESALE"] = "TRANSFER_CARD_WHOLESALE";
|
|
148
|
-
WalletTransactionRecordType["TRANSFER_INTERNAL"] = "TRANSFER_INTERNAL";
|
|
149
|
-
WalletTransactionRecordType["SEGREGATED_CRYPTO_TRANSFER"] = "SEGREGATED_CRYPTO_TRANSFER";
|
|
150
|
-
WalletTransactionRecordType["WHOLESALE_CARD_DEPOSIT"] = "WHOLESALE_CARD_DEPOSIT";
|
|
151
|
-
WalletTransactionRecordType["WITHDRAWAL"] = "WITHDRAWAL";
|
|
152
|
-
WalletTransactionRecordType["WITHDRAWAL_CRYPTO_EXTERNAL"] = "WITHDRAWAL_CRYPTO_EXTERNAL";
|
|
153
|
-
WalletTransactionRecordType["WITHDRAWAL_CRYPTO_INTERNAL"] = "WITHDRAWAL_CRYPTO_INTERNAL";
|
|
154
|
-
WalletTransactionRecordType["WITHDRAWAL_INTERNAL"] = "WITHDRAWAL_INTERNAL";
|
|
155
|
-
WalletTransactionRecordType["WITHDRAW_CARD_PREPAID"] = "WITHDRAW_CARD_PREPAID";
|
|
156
|
-
WalletTransactionRecordType["WITHDRAW_CARD_SUBACCOUNT"] = "WITHDRAW_CARD_SUBACCOUNT";
|
|
157
|
-
WalletTransactionRecordType["L2F_ACH_ONRAMP"] = "L2F_ACH_ONRAMP";
|
|
158
|
-
WalletTransactionRecordType["L2F_ACH_OFFRAMP"] = "L2F_ACH_OFFRAMP";
|
|
159
|
-
WalletTransactionRecordType["L2F_ACH_DEPOSIT"] = "L2F_ACH_DEPOSIT";
|
|
160
|
-
WalletTransactionRecordType["L2F_ACH_WITHDRAWAL"] = "L2F_ACH_WITHDRAWAL";
|
|
161
|
-
WalletTransactionRecordType["L2F_WIRE_ONRAMP"] = "L2F_WIRE_ONRAMP";
|
|
162
|
-
WalletTransactionRecordType["L2F_WIRE_OFFRAMP"] = "L2F_WIRE_OFFRAMP";
|
|
163
|
-
WalletTransactionRecordType["L2F_WIRE_DEPOSIT"] = "L2F_WIRE_DEPOSIT";
|
|
164
|
-
WalletTransactionRecordType["L2F_WIRE_WITHDRAWAL"] = "L2F_WIRE_WITHDRAWAL";
|
|
165
|
-
WalletTransactionRecordType["L2F_SWIFT_ONRAMP"] = "L2F_SWIFT_ONRAMP";
|
|
166
|
-
WalletTransactionRecordType["L2F_SWIFT_OFFRAMP"] = "L2F_SWIFT_OFFRAMP";
|
|
167
|
-
WalletTransactionRecordType["L2F_SWIFT_DEPOSIT"] = "L2F_SWIFT_DEPOSIT";
|
|
168
|
-
WalletTransactionRecordType["L2F_SWIFT_WITHDRAWAL"] = "L2F_SWIFT_WITHDRAWAL";
|
|
169
|
-
WalletTransactionRecordType["L2F_SEPA_ONRAMP"] = "L2F_SEPA_ONRAMP";
|
|
170
|
-
WalletTransactionRecordType["L2F_SEPA_OFFRAMP"] = "L2F_SEPA_OFFRAMP";
|
|
171
|
-
WalletTransactionRecordType["L2F_SEPA_DEPOSIT"] = "L2F_SEPA_DEPOSIT";
|
|
172
|
-
WalletTransactionRecordType["L2F_SEPA_WITHDRAWAL"] = "L2F_SEPA_WITHDRAWAL";
|
|
173
|
-
WalletTransactionRecordType["L2F_CRYPTO_WITHDRAWAL"] = "L2F_CRYPTO_WITHDRAWAL";
|
|
174
|
-
WalletTransactionRecordType["L2F_CRYPTO_DEPOSIT"] = "L2F_CRYPTO_DEPOSIT";
|
|
175
|
-
WalletTransactionRecordType["HIFI_WIRE_ONRAMP"] = "HIFI_WIRE_ONRAMP";
|
|
176
|
-
WalletTransactionRecordType["HIFI_WIRE_OFFRAMP"] = "HIFI_WIRE_OFFRAMP";
|
|
177
|
-
WalletTransactionRecordType["HIFI_WIRE_DEPOSIT"] = "HIFI_WIRE_DEPOSIT";
|
|
178
|
-
WalletTransactionRecordType["HIFI_WIRE_WITHDRAWAL"] = "HIFI_WIRE_WITHDRAWAL";
|
|
179
|
-
WalletTransactionRecordType["HIFI_ACH_ONRAMP"] = "HIFI_ACH_ONRAMP";
|
|
180
|
-
WalletTransactionRecordType["HIFI_ACH_OFFRAMP"] = "HIFI_ACH_OFFRAMP";
|
|
181
|
-
WalletTransactionRecordType["HIFI_ACH_DEPOSIT"] = "HIFI_ACH_DEPOSIT";
|
|
182
|
-
WalletTransactionRecordType["HIFI_ACH_WITHDRAWAL"] = "HIFI_ACH_WITHDRAWAL";
|
|
183
|
-
WalletTransactionRecordType["HIFI_SEPA_ONRAMP"] = "HIFI_SEPA_ONRAMP";
|
|
184
|
-
WalletTransactionRecordType["HIFI_SEPA_OFFRAMP"] = "HIFI_SEPA_OFFRAMP";
|
|
185
|
-
WalletTransactionRecordType["HIFI_SEPA_DEPOSIT"] = "HIFI_SEPA_DEPOSIT";
|
|
186
|
-
WalletTransactionRecordType["HIFI_SEPA_WITHDRAWAL"] = "HIFI_SEPA_WITHDRAWAL";
|
|
187
|
-
WalletTransactionRecordType["HIFI_CRYPTO_TRANSFER"] = "HIFI_CRYPTO_TRANSFER";
|
|
188
|
-
WalletTransactionRecordType["HIFI_CRYPTO_WITHDRAWAL"] = "HIFI_CRYPTO_WITHDRAWAL";
|
|
189
|
-
WalletTransactionRecordType["HIFI_CRYPTO_DEPOSIT"] = "HIFI_CRYPTO_DEPOSIT";
|
|
190
|
-
})(WalletTransactionRecordType || (exports.WalletTransactionRecordType = WalletTransactionRecordType = {}));
|
|
191
|
-
var RequestStatus;
|
|
192
|
-
(function (RequestStatus) {
|
|
193
|
-
RequestStatus["NONE"] = "none";
|
|
194
|
-
RequestStatus["PENDING"] = "pending";
|
|
195
|
-
RequestStatus["FULLFILLED"] = "fulfilled";
|
|
196
|
-
RequestStatus["REJECTED"] = "rejected";
|
|
197
|
-
})(RequestStatus || (exports.RequestStatus = RequestStatus = {}));
|
|
198
|
-
var RequestLoadingType;
|
|
199
|
-
(function (RequestLoadingType) {
|
|
200
|
-
RequestLoadingType["NORMAL"] = "normal";
|
|
201
|
-
RequestLoadingType["TRANSPARENT"] = "transparent";
|
|
202
|
-
})(RequestLoadingType || (exports.RequestLoadingType = RequestLoadingType = {}));
|
|
203
|
-
var ResponseStatus;
|
|
204
|
-
(function (ResponseStatus) {
|
|
205
|
-
ResponseStatus[ResponseStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
206
|
-
ResponseStatus[ResponseStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
207
|
-
ResponseStatus[ResponseStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
208
|
-
ResponseStatus[ResponseStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
209
|
-
ResponseStatus[ResponseStatus["VERIFICATION_EXPIRED"] = 419] = "VERIFICATION_EXPIRED";
|
|
210
|
-
ResponseStatus[ResponseStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
211
|
-
ResponseStatus[ResponseStatus["USER_BLOCKED"] = 423] = "USER_BLOCKED";
|
|
212
|
-
ResponseStatus[ResponseStatus["SERVER_ERROR"] = 500] = "SERVER_ERROR";
|
|
213
|
-
})(ResponseStatus || (exports.ResponseStatus = ResponseStatus = {}));
|
|
214
|
-
var WalletTypeValues;
|
|
215
|
-
(function (WalletTypeValues) {
|
|
216
|
-
WalletTypeValues["BUSINESS"] = "business";
|
|
217
|
-
WalletTypeValues["PERSONAL"] = "personal";
|
|
218
|
-
WalletTypeValues["P2P"] = "trading";
|
|
219
|
-
WalletTypeValues["ESCROW"] = "escrow";
|
|
220
|
-
WalletTypeValues["MERCHANT"] = "merchant";
|
|
221
|
-
WalletTypeValues["EXCHANGE"] = "exchange";
|
|
222
|
-
WalletTypeValues["STAKING"] = "staking";
|
|
223
|
-
WalletTypeValues["VAULT"] = "vault";
|
|
224
|
-
})(WalletTypeValues || (exports.WalletTypeValues = WalletTypeValues = {}));
|
|
225
|
-
exports.walletType = {
|
|
226
|
-
personal: { value: WalletTypeValues.PERSONAL, label: 'Personal' },
|
|
227
|
-
p2p: { value: 'p2p', label: 'P2P' },
|
|
228
|
-
escrow: { value: WalletTypeValues.ESCROW, label: 'Escrow' },
|
|
229
|
-
merchant: { value: WalletTypeValues.MERCHANT, label: 'Merchant' },
|
|
230
|
-
exchange: { value: WalletTypeValues.EXCHANGE, label: 'Exchange' },
|
|
231
|
-
staking: { value: WalletTypeValues.STAKING, label: 'Staking' },
|
|
232
|
-
vault: { value: WalletTypeValues.VAULT, label: 'Vault' },
|
|
233
|
-
};
|
|
234
|
-
exports.defaultPaginationParams = {
|
|
235
|
-
limit: 10,
|
|
236
|
-
offset: 0,
|
|
237
|
-
isLastPage: true,
|
|
238
|
-
};
|
|
239
|
-
var CalcType;
|
|
240
|
-
(function (CalcType) {
|
|
241
|
-
CalcType["ONRAMP"] = "onramp";
|
|
242
|
-
CalcType["OFFRAMP"] = "offramp";
|
|
243
|
-
CalcType["WITHDRAWAL"] = "withdrawal";
|
|
244
|
-
})(CalcType || (exports.CalcType = CalcType = {}));
|
|
245
|
-
var KYCStatuses;
|
|
246
|
-
(function (KYCStatuses) {
|
|
247
|
-
KYCStatuses["APPROVED"] = "APPROVED";
|
|
248
|
-
KYCStatuses["DECLINED"] = "DECLINED";
|
|
249
|
-
KYCStatuses["PENDING"] = "PENDING";
|
|
250
|
-
KYCStatuses["HOLD"] = "HOLD";
|
|
251
|
-
KYCStatuses["DOUBLE"] = "DOUBLE";
|
|
252
|
-
KYCStatuses["SOFT_REJECT"] = "SOFT_REJECT";
|
|
253
|
-
KYCStatuses["REJECT"] = "REJECT";
|
|
254
|
-
KYCStatuses["UNVERIFIED"] = "UNVERIFIED";
|
|
255
|
-
})(KYCStatuses || (exports.KYCStatuses = KYCStatuses = {}));
|
|
256
|
-
var OrderStatuses;
|
|
257
|
-
(function (OrderStatuses) {
|
|
258
|
-
OrderStatuses["NEW"] = "NEW";
|
|
259
|
-
OrderStatuses["PENDING"] = "PENDING";
|
|
260
|
-
OrderStatuses["PROCESSING"] = "PROCESSING";
|
|
261
|
-
OrderStatuses["CANCELED"] = "CANCELED";
|
|
262
|
-
OrderStatuses["COMPLETE"] = "COMPLETE";
|
|
263
|
-
OrderStatuses["ERROR"] = "ERROR";
|
|
264
|
-
OrderStatuses["FAILED"] = "FAILED";
|
|
265
|
-
})(OrderStatuses || (exports.OrderStatuses = OrderStatuses = {}));
|
|
266
|
-
var CardStatus;
|
|
267
|
-
(function (CardStatus) {
|
|
268
|
-
CardStatus["ACTIVE"] = "ACTIVE";
|
|
269
|
-
CardStatus["FROZEN"] = "FROZEN";
|
|
270
|
-
CardStatus["BLOCKED"] = "BLOCKED";
|
|
271
|
-
CardStatus["INACTIVE"] = "INACTIVE";
|
|
272
|
-
CardStatus["CANCELED"] = "CANCELED";
|
|
273
|
-
CardStatus["CLOSED"] = "CLOSED";
|
|
274
|
-
})(CardStatus || (exports.CardStatus = CardStatus = {}));
|
|
275
|
-
var IssuingProgramStatus;
|
|
276
|
-
(function (IssuingProgramStatus) {
|
|
277
|
-
IssuingProgramStatus["ACTIVE"] = "ACTIVE";
|
|
278
|
-
IssuingProgramStatus["ARCHIVED"] = "ARCHIVED";
|
|
279
|
-
})(IssuingProgramStatus || (exports.IssuingProgramStatus = IssuingProgramStatus = {}));
|
|
280
|
-
var SubAccountStatus;
|
|
281
|
-
(function (SubAccountStatus) {
|
|
282
|
-
SubAccountStatus["ACTIVE"] = "ACTIVE";
|
|
283
|
-
SubAccountStatus["BLOCKED"] = "BLOCKED";
|
|
284
|
-
SubAccountStatus["INACTIVE"] = "INACTIVE";
|
|
285
|
-
SubAccountStatus["CANCELED"] = "CANCELED";
|
|
286
|
-
})(SubAccountStatus || (exports.SubAccountStatus = SubAccountStatus = {}));
|
|
287
|
-
var SubAccountType;
|
|
288
|
-
(function (SubAccountType) {
|
|
289
|
-
SubAccountType["PREPAID"] = "prepaid";
|
|
290
|
-
SubAccountType["BALANCE"] = "balance";
|
|
291
|
-
})(SubAccountType || (exports.SubAccountType = SubAccountType = {}));
|
|
292
|
-
var CurrencyType;
|
|
293
|
-
(function (CurrencyType) {
|
|
294
|
-
CurrencyType["TOKEN"] = "token";
|
|
295
|
-
CurrencyType["NATIVE"] = "native";
|
|
296
|
-
CurrencyType["FIAT"] = "fiat";
|
|
297
|
-
})(CurrencyType || (exports.CurrencyType = CurrencyType = {}));
|
|
298
|
-
var APIKeyRole;
|
|
299
|
-
(function (APIKeyRole) {
|
|
300
|
-
APIKeyRole["READ_ONLY"] = "READ_ONLY";
|
|
301
|
-
APIKeyRole["DEVELOPER"] = "DEVELOPER";
|
|
302
|
-
APIKeyRole["PRODUCTION"] = "PRODUCTION";
|
|
303
|
-
})(APIKeyRole || (exports.APIKeyRole = APIKeyRole = {}));
|
|
304
|
-
var SortingDirection;
|
|
305
|
-
(function (SortingDirection) {
|
|
306
|
-
SortingDirection["ASC"] = "ASC";
|
|
307
|
-
SortingDirection["DESC"] = "DESC";
|
|
308
|
-
})(SortingDirection || (exports.SortingDirection = SortingDirection = {}));
|
|
309
|
-
var CounterpartyType;
|
|
310
|
-
(function (CounterpartyType) {
|
|
311
|
-
CounterpartyType["INDIVIDUAL"] = "INDIVIDUAL";
|
|
312
|
-
CounterpartyType["BUSINESS"] = "BUSINESS";
|
|
313
|
-
})(CounterpartyType || (exports.CounterpartyType = CounterpartyType = {}));
|
|
314
|
-
var CounterpartyDestinationType;
|
|
315
|
-
(function (CounterpartyDestinationType) {
|
|
316
|
-
CounterpartyDestinationType["DOMESTIC_WIRE"] = "DOMESTIC_WIRE";
|
|
317
|
-
CounterpartyDestinationType["ACH"] = "ACH";
|
|
318
|
-
CounterpartyDestinationType["SWIFT"] = "SWIFT";
|
|
319
|
-
CounterpartyDestinationType["SEPA"] = "SEPA";
|
|
320
|
-
CounterpartyDestinationType["CRYPTO_EXTERNAL"] = "CRYPTO_EXTERNAL";
|
|
321
|
-
CounterpartyDestinationType["CRYPTO_INTERNAL"] = "CRYPTO_INTERNAL";
|
|
322
|
-
})(CounterpartyDestinationType || (exports.CounterpartyDestinationType = CounterpartyDestinationType = {}));
|
|
323
|
-
var CardTransactionStatus;
|
|
324
|
-
(function (CardTransactionStatus) {
|
|
325
|
-
CardTransactionStatus["APPROVED"] = "APPROVED";
|
|
326
|
-
CardTransactionStatus["CLEARED"] = "CLEARED";
|
|
327
|
-
CardTransactionStatus["COMPLETED"] = "COMPLETED";
|
|
328
|
-
CardTransactionStatus["EXPIRED"] = "EXPIRED";
|
|
329
|
-
CardTransactionStatus["FAILED"] = "FAILED";
|
|
330
|
-
CardTransactionStatus["CANCELLED"] = "CANCELLED";
|
|
331
|
-
CardTransactionStatus["CANCELED"] = "CANCELED";
|
|
332
|
-
CardTransactionStatus["PENDING"] = "PENDING";
|
|
333
|
-
CardTransactionStatus["REVERSED"] = "REVERSED";
|
|
334
|
-
CardTransactionStatus["DECLINED"] = "DECLINED";
|
|
335
|
-
})(CardTransactionStatus || (exports.CardTransactionStatus = CardTransactionStatus = {}));
|
package/dist/hooks/index.d.ts
DELETED
package/dist/hooks/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useCalc"), exports);
|
|
18
|
-
__exportStar(require("./useSupabaseSubscription"), exports);
|
|
19
|
-
__exportStar(require("./useFileUpload"), exports);
|
package/dist/hooks/useCalc.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { API } from '../api/types/types';
|
|
2
|
-
type CalcData = API.Orders.V2.Calc.Response & {
|
|
3
|
-
is_subtract: boolean;
|
|
4
|
-
is_reverse: boolean;
|
|
5
|
-
};
|
|
6
|
-
export type OrderCalcHandlerProps = Omit<API.Orders.V2.Calc.Request, 'order_type'>;
|
|
7
|
-
export type UseOrderCalcProps = {
|
|
8
|
-
from_currency_id: string | null | undefined;
|
|
9
|
-
to_currency_id: string | null | undefined;
|
|
10
|
-
calcHandler: (props: OrderCalcHandlerProps) => Promise<API.Orders.V2.Calc.Response>;
|
|
11
|
-
disableCalculation?: boolean;
|
|
12
|
-
to_address?: string;
|
|
13
|
-
};
|
|
14
|
-
export type UseOrderCalcData = {
|
|
15
|
-
calcData: CalcData | null;
|
|
16
|
-
sellingAmount: number;
|
|
17
|
-
setSellingAmount: (value: number) => void;
|
|
18
|
-
buyingAmount: number;
|
|
19
|
-
setBuyingAmount: (value: number) => void;
|
|
20
|
-
isSellingValuePending: boolean;
|
|
21
|
-
isBuyingValuePending: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type UseOrderCalc = (props: UseOrderCalcProps) => UseOrderCalcData;
|
|
24
|
-
export declare const useOrderCalc: UseOrderCalc;
|
|
25
|
-
export {};
|
package/dist/hooks/useCalc.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.useOrderCalc = void 0;
|
|
16
|
-
const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
|
|
17
|
-
const react_1 = require("react");
|
|
18
|
-
const useOrderCalc = (props) => {
|
|
19
|
-
var _a, _b, _c;
|
|
20
|
-
const { from_currency_id, to_currency_id, calcHandler, disableCalculation, to_address } = props;
|
|
21
|
-
const [sellingAmount, setSellingAmount] = (0, react_1.useState)(0);
|
|
22
|
-
const [buyingAmount, setBuyingAmount] = (0, react_1.useState)(0);
|
|
23
|
-
const [calcData, setCalcData] = (0, react_1.useState)(null);
|
|
24
|
-
const [isSellingValuePending, setIsSellingValuePending] = (0, react_1.useState)(false);
|
|
25
|
-
const [isBuyingValuePending, setIsBuyingValuePending] = (0, react_1.useState)(false);
|
|
26
|
-
const abortControllerRef = (0, react_1.useRef)(null);
|
|
27
|
-
const resetOrderCalc = () => {
|
|
28
|
-
setCalcData(null);
|
|
29
|
-
setIsSellingValuePending(false);
|
|
30
|
-
setIsBuyingValuePending(false);
|
|
31
|
-
setSellingAmount(0);
|
|
32
|
-
setBuyingAmount(0);
|
|
33
|
-
};
|
|
34
|
-
const abortCurrentCalculation = () => {
|
|
35
|
-
if (abortControllerRef.current) {
|
|
36
|
-
abortControllerRef.current.abort();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const updateCalculations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ is_reverse, is_subtract }) {
|
|
40
|
-
if (disableCalculation) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
abortControllerRef.current = new AbortController();
|
|
44
|
-
if (!from_currency_id || !to_currency_id) {
|
|
45
|
-
throw new Error('From currency or to currency is not defined');
|
|
46
|
-
}
|
|
47
|
-
if (sellingAmount === 0 && buyingAmount === 0 && !calcData) {
|
|
48
|
-
resetOrderCalc();
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const calcParams = {
|
|
52
|
-
from_currency_id,
|
|
53
|
-
to_currency_id,
|
|
54
|
-
amount: is_reverse ? buyingAmount : sellingAmount,
|
|
55
|
-
is_reverse,
|
|
56
|
-
is_subtract,
|
|
57
|
-
to_address,
|
|
58
|
-
signal: abortControllerRef.current.signal,
|
|
59
|
-
};
|
|
60
|
-
if (!calcParams.amount) {
|
|
61
|
-
resetOrderCalc();
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
is_reverse ? setIsSellingValuePending(true) : setIsBuyingValuePending(true);
|
|
66
|
-
const data = yield calcHandler(calcParams);
|
|
67
|
-
setCalcData(Object.assign(Object.assign({}, data), { is_reverse,
|
|
68
|
-
is_subtract }));
|
|
69
|
-
setSellingAmount(data.from_amount);
|
|
70
|
-
setBuyingAmount(data.result_amount);
|
|
71
|
-
abortControllerRef.current = null;
|
|
72
|
-
is_reverse ? setIsSellingValuePending(false) : setIsBuyingValuePending(false);
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
if (error.code === 'ERR_CANCELED') {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
is_reverse ? setIsSellingValuePending(false) : setIsBuyingValuePending(false);
|
|
79
|
-
if (error.status === 404) {
|
|
80
|
-
// eslint-disable-next-line no-console
|
|
81
|
-
console.error('Rate not found');
|
|
82
|
-
resetOrderCalc();
|
|
83
|
-
}
|
|
84
|
-
throw error;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
const onSellingValueUpdate = (0, lodash_debounce_1.default)((value) => {
|
|
88
|
-
if (value !== (calcData === null || calcData === void 0 ? void 0 : calcData.from_amount) || isBuyingValuePending) {
|
|
89
|
-
updateCalculations({ is_reverse: false, is_subtract: true });
|
|
90
|
-
}
|
|
91
|
-
}, ((_a = abortControllerRef.current) === null || _a === void 0 ? void 0 : _a.signal) ? undefined : 1000);
|
|
92
|
-
const onBuyingValueUpdate = (0, lodash_debounce_1.default)((value) => {
|
|
93
|
-
if (value !== (calcData === null || calcData === void 0 ? void 0 : calcData.result_amount) || isSellingValuePending) {
|
|
94
|
-
updateCalculations({ is_reverse: true, is_subtract: false });
|
|
95
|
-
}
|
|
96
|
-
}, ((_b = abortControllerRef.current) === null || _b === void 0 ? void 0 : _b.signal) ? undefined : 1000);
|
|
97
|
-
const onToAddressUpdate = (0, lodash_debounce_1.default)(() => {
|
|
98
|
-
updateCalculations({ is_reverse: false, is_subtract: true });
|
|
99
|
-
}, ((_c = abortControllerRef.current) === null || _c === void 0 ? void 0 : _c.signal) ? undefined : 1000);
|
|
100
|
-
(0, react_1.useEffect)(() => {
|
|
101
|
-
abortCurrentCalculation();
|
|
102
|
-
updateCalculations({ is_reverse: false, is_subtract: true });
|
|
103
|
-
}, [from_currency_id, to_currency_id]);
|
|
104
|
-
(0, react_1.useEffect)(() => {
|
|
105
|
-
abortCurrentCalculation();
|
|
106
|
-
onSellingValueUpdate(sellingAmount);
|
|
107
|
-
return onSellingValueUpdate.cancel;
|
|
108
|
-
}, [sellingAmount]);
|
|
109
|
-
(0, react_1.useEffect)(() => {
|
|
110
|
-
abortCurrentCalculation();
|
|
111
|
-
onBuyingValueUpdate(buyingAmount);
|
|
112
|
-
return onBuyingValueUpdate.cancel;
|
|
113
|
-
}, [buyingAmount]);
|
|
114
|
-
(0, react_1.useEffect)(() => {
|
|
115
|
-
abortCurrentCalculation();
|
|
116
|
-
onToAddressUpdate();
|
|
117
|
-
return onToAddressUpdate.cancel;
|
|
118
|
-
}, [to_address]);
|
|
119
|
-
return {
|
|
120
|
-
sellingAmount,
|
|
121
|
-
setSellingAmount,
|
|
122
|
-
buyingAmount,
|
|
123
|
-
setBuyingAmount,
|
|
124
|
-
calcData,
|
|
125
|
-
isSellingValuePending,
|
|
126
|
-
isBuyingValuePending,
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
exports.useOrderCalc = useOrderCalc;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { UploadFileResult } from '../utils/fileStorage';
|
|
2
|
-
interface UseFileUploadOptions {
|
|
3
|
-
bucket: string;
|
|
4
|
-
folder?: string;
|
|
5
|
-
authToken?: string;
|
|
6
|
-
onSuccess?: (result: UploadFileResult) => void;
|
|
7
|
-
onError?: (error: string) => void;
|
|
8
|
-
}
|
|
9
|
-
interface UseFileUploadReturn {
|
|
10
|
-
upload: (file: File, fileName?: string) => Promise<UploadFileResult>;
|
|
11
|
-
uploading: boolean;
|
|
12
|
-
progress: number;
|
|
13
|
-
error: string | null;
|
|
14
|
-
result: UploadFileResult | null;
|
|
15
|
-
reset: () => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* React хук для загрузки файлов в Supabase Storage
|
|
19
|
-
*
|
|
20
|
-
* Папки создаются автоматически при загрузке файла, если их не существует.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* // Загрузка в корень бакета
|
|
25
|
-
* const { upload, uploading, error, result } = useFileUpload({
|
|
26
|
-
* bucket: 'user-files',
|
|
27
|
-
* onSuccess: (result) => console.log('Загружено:', result.path),
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* // Загрузка в конкретную папку (папка создастся автоматически)
|
|
31
|
-
* const { upload } = useFileUpload({
|
|
32
|
-
* bucket: 'documents',
|
|
33
|
-
* folder: 'invoices', // файл будет загружен в invoices/
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* // Загрузка во вложенную папку (все папки создадутся автоматически)
|
|
37
|
-
* const { upload } = useFileUpload({
|
|
38
|
-
* bucket: 'images',
|
|
39
|
-
* folder: 'avatars/2024', // файл будет загружен в avatars/2024/
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* const handleFileChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
43
|
-
* const file = e.target.files?.[0];
|
|
44
|
-
* if (file) await upload(file);
|
|
45
|
-
* };
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export declare const useFileUpload: (options: UseFileUploadOptions) => UseFileUploadReturn;
|
|
49
|
-
export {};
|