squarefi-bff-api-module 1.26.11 → 1.26.13
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/auth.d.ts +0 -0
- package/dist/api/auth.js +0 -0
- package/dist/api/counterparties.d.ts +0 -0
- package/dist/api/counterparties.js +0 -0
- package/dist/api/developer.d.ts +0 -0
- package/dist/api/developer.js +0 -0
- package/dist/api/exchange.d.ts +0 -0
- package/dist/api/exchange.js +0 -0
- package/dist/api/frontend.d.ts +0 -0
- package/dist/api/frontend.js +0 -0
- package/dist/api/index.d.ts +0 -0
- package/dist/api/index.js +0 -0
- package/dist/api/issuing.d.ts +0 -0
- package/dist/api/issuing.js +0 -0
- package/dist/api/kyc.d.ts +0 -0
- package/dist/api/kyc.js +0 -0
- package/dist/api/list.d.ts +0 -0
- package/dist/api/list.js +0 -0
- package/dist/api/orders.d.ts +0 -0
- package/dist/api/orders.js +0 -0
- package/dist/api/persona.d.ts +0 -0
- package/dist/api/persona.js +0 -0
- package/dist/api/tenants.d.ts +0 -0
- package/dist/api/tenants.js +0 -0
- package/dist/api/totp.d.ts +0 -0
- package/dist/api/totp.js +0 -0
- package/dist/api/types/autogen/apiV2.types.d.ts +42 -70
- package/dist/api/types/autogen/apiV2.types.js +0 -0
- package/dist/api/types/types.d.ts +40 -30
- package/dist/api/types/types.js +0 -0
- package/dist/api/user.d.ts +0 -0
- package/dist/api/user.js +0 -0
- package/dist/api/virtual-accounts.d.ts +0 -0
- package/dist/api/virtual-accounts.js +0 -0
- package/dist/api/wallets.d.ts +0 -0
- package/dist/api/wallets.js +0 -0
- package/dist/constants.d.ts +0 -0
- package/dist/constants.js +0 -0
- package/dist/hooks/index.d.ts +0 -0
- package/dist/hooks/index.js +0 -0
- package/dist/hooks/useCalc.d.ts +0 -0
- package/dist/hooks/useCalc.js +0 -0
- package/dist/hooks/useSupabaseSubscription/config.d.ts +0 -0
- package/dist/hooks/useSupabaseSubscription/config.js +0 -0
- package/dist/hooks/useSupabaseSubscription/index.d.ts +0 -0
- package/dist/hooks/useSupabaseSubscription/index.js +0 -0
- package/dist/hooks/useSupabaseSubscription/specialized.d.ts +0 -0
- package/dist/hooks/useSupabaseSubscription/specialized.js +0 -0
- package/dist/hooks/useSupabaseSubscription/types.d.ts +0 -0
- package/dist/hooks/useSupabaseSubscription/types.js +0 -0
- package/dist/hooks/useSupabaseSubscription/useSupabaseSubscription.d.ts +0 -0
- package/dist/hooks/useSupabaseSubscription/useSupabaseSubscription.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/utils/apiClientFactory.d.ts +0 -0
- package/dist/utils/apiClientFactory.js +0 -0
- package/dist/utils/converters.d.ts +0 -0
- package/dist/utils/converters.js +0 -0
- package/dist/utils/encrypt.d.ts +0 -0
- package/dist/utils/encrypt.js +0 -0
- package/dist/utils/storage.d.ts +0 -0
- package/dist/utils/storage.js +0 -0
- package/dist/utils/supabase.d.ts +0 -0
- package/dist/utils/supabase.js +0 -0
- package/dist/utils/tokensFactory.d.ts +0 -0
- package/dist/utils/tokensFactory.js +0 -0
- package/package.json +1 -1
- package/src/api/types/autogen/apiV2.types.ts +42 -70
- package/src/api/types/types.ts +42 -31
- package/dist/api/config.d.ts +0 -37
- package/dist/api/config.js +0 -40
- package/dist/api/fetch_api.d.ts +0 -1
- package/dist/api/fetch_api.js +0 -122
- package/dist/api/fiat_accounts.d.ts +0 -32
- package/dist/api/fiat_accounts.js +0 -51
- package/dist/api/location.d.ts +0 -6
- package/dist/api/location.js +0 -9
- package/dist/api/types.d.ts +0 -1674
- package/dist/api/types.js +0 -2
- package/dist/utils/common.d.ts +0 -5
- package/dist/utils/common.js +0 -48
|
@@ -1043,8 +1043,8 @@ export interface paths {
|
|
|
1043
1043
|
path?: never;
|
|
1044
1044
|
cookie?: never;
|
|
1045
1045
|
};
|
|
1046
|
-
/** Returns bank data by
|
|
1047
|
-
get: operations["
|
|
1046
|
+
/** Returns bank data by code */
|
|
1047
|
+
get: operations["BankDataController_getBankDataByCode"];
|
|
1048
1048
|
put?: never;
|
|
1049
1049
|
post?: never;
|
|
1050
1050
|
delete?: never;
|
|
@@ -1239,6 +1239,8 @@ export interface components {
|
|
|
1239
1239
|
total: number;
|
|
1240
1240
|
/** @description Data */
|
|
1241
1241
|
data: Record<string, never>[];
|
|
1242
|
+
/** @description Has more data flag */
|
|
1243
|
+
readonly has_more: boolean;
|
|
1242
1244
|
};
|
|
1243
1245
|
WalletDto: {
|
|
1244
1246
|
uuid: string;
|
|
@@ -1360,6 +1362,7 @@ export interface components {
|
|
|
1360
1362
|
AllChainsResponseDto: {
|
|
1361
1363
|
total: number;
|
|
1362
1364
|
data: components["schemas"]["ChainDto"][];
|
|
1365
|
+
readonly has_more: boolean;
|
|
1363
1366
|
};
|
|
1364
1367
|
CryptoCurrencyMetaDto: {
|
|
1365
1368
|
icon: string;
|
|
@@ -1959,6 +1962,8 @@ export interface components {
|
|
|
1959
1962
|
total: number;
|
|
1960
1963
|
/** @description Data */
|
|
1961
1964
|
data: components["schemas"]["WalletKycRailTypeDto"][];
|
|
1965
|
+
/** @description Has more data flag */
|
|
1966
|
+
readonly has_more: boolean;
|
|
1962
1967
|
};
|
|
1963
1968
|
CountryDto: {
|
|
1964
1969
|
id: number;
|
|
@@ -2011,12 +2016,16 @@ export interface components {
|
|
|
2011
2016
|
/** @enum {string} */
|
|
2012
2017
|
type: "INDIVIDUAL" | "BUSINESS";
|
|
2013
2018
|
created_at: string;
|
|
2019
|
+
/** @default false */
|
|
2020
|
+
is_pinned: boolean;
|
|
2014
2021
|
};
|
|
2015
2022
|
FindAllCounterpartyAccountsResponseDto: {
|
|
2016
2023
|
/** @example 20 */
|
|
2017
2024
|
total: number;
|
|
2018
2025
|
/** @description Data */
|
|
2019
2026
|
data: components["schemas"]["CounterpartyAccountDto"][];
|
|
2027
|
+
/** @description Has more data flag */
|
|
2028
|
+
readonly has_more: boolean;
|
|
2020
2029
|
};
|
|
2021
2030
|
CreateCounterpartyAccountDto: {
|
|
2022
2031
|
email: string;
|
|
@@ -2026,6 +2035,8 @@ export interface components {
|
|
|
2026
2035
|
nickname?: string | null;
|
|
2027
2036
|
/** @enum {string} */
|
|
2028
2037
|
type: "INDIVIDUAL" | "BUSINESS";
|
|
2038
|
+
/** @default false */
|
|
2039
|
+
is_pinned: boolean;
|
|
2029
2040
|
};
|
|
2030
2041
|
UpdateCounterpartyAccountDto: {
|
|
2031
2042
|
email?: string;
|
|
@@ -2115,6 +2126,8 @@ export interface components {
|
|
|
2115
2126
|
total: number;
|
|
2116
2127
|
/** @description Data */
|
|
2117
2128
|
data: components["schemas"]["CounterpartyDestinationDto"][];
|
|
2129
|
+
/** @description Has more data flag */
|
|
2130
|
+
readonly has_more: boolean;
|
|
2118
2131
|
};
|
|
2119
2132
|
CreateCounterpartyExternalBankingDataAddressDto: {
|
|
2120
2133
|
city?: string | null;
|
|
@@ -2163,6 +2176,7 @@ export interface components {
|
|
|
2163
2176
|
SystemChainsResponseDto: {
|
|
2164
2177
|
total: number;
|
|
2165
2178
|
data: components["schemas"]["ChainDto"][];
|
|
2179
|
+
readonly has_more: boolean;
|
|
2166
2180
|
};
|
|
2167
2181
|
SystemCurrenciesResponseDto: {
|
|
2168
2182
|
total: number;
|
|
@@ -2216,6 +2230,8 @@ export interface components {
|
|
|
2216
2230
|
total: number;
|
|
2217
2231
|
/** @description Data */
|
|
2218
2232
|
data: components["schemas"]["IntegrationPersonaTemplateEntityDto"][];
|
|
2233
|
+
/** @description Has more data flag */
|
|
2234
|
+
readonly has_more: boolean;
|
|
2219
2235
|
};
|
|
2220
2236
|
SyncDataFromHifibridgeDto: {
|
|
2221
2237
|
/** @description Wallet to load data from Hifibridge */
|
|
@@ -2223,70 +2239,20 @@ export interface components {
|
|
|
2223
2239
|
/** @description Hifibridge ID to load data to wallet */
|
|
2224
2240
|
hifibridge_id: string;
|
|
2225
2241
|
};
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
country_id
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
country_id: string;
|
|
2234
|
-
code: string;
|
|
2235
|
-
name: string;
|
|
2236
|
-
};
|
|
2237
|
-
SwiftDto: {
|
|
2238
|
-
id: string;
|
|
2239
|
-
address: string;
|
|
2240
|
-
postcode: string;
|
|
2241
|
-
branch_name: string;
|
|
2242
|
-
branch_code: string;
|
|
2243
|
-
country: components["schemas"]["CountryDto"];
|
|
2244
|
-
city: components["schemas"]["CityDto"];
|
|
2245
|
-
bank: components["schemas"]["BankDto"];
|
|
2246
|
-
};
|
|
2247
|
-
IbanDataDto: {
|
|
2248
|
-
id: string;
|
|
2249
|
-
account_number: string;
|
|
2250
|
-
national_bank_code: string;
|
|
2251
|
-
national_branch_code: string;
|
|
2252
|
-
swift: components["schemas"]["SwiftDto"];
|
|
2253
|
-
country: components["schemas"]["CountryDto"];
|
|
2254
|
-
};
|
|
2255
|
-
WireDto: {
|
|
2256
|
-
telegraphic_name: string;
|
|
2257
|
-
is_funds_transfer_allowed: boolean;
|
|
2258
|
-
is_settlement_only: boolean;
|
|
2259
|
-
is_securities_transfer_allowed: boolean;
|
|
2260
|
-
change_date: Record<string, never> | null;
|
|
2261
|
-
bank: components["schemas"]["BankDto"];
|
|
2262
|
-
city: components["schemas"]["CityDto"];
|
|
2263
|
-
};
|
|
2264
|
-
AchDto: {
|
|
2265
|
-
new_id: Record<string, never> | null;
|
|
2266
|
-
servicing_frb_id: string;
|
|
2267
|
-
address: string;
|
|
2268
|
-
postcode: string;
|
|
2269
|
-
phone: string;
|
|
2270
|
-
record_type_code: number;
|
|
2271
|
-
is_main_office: boolean;
|
|
2272
|
-
change_date: Record<string, never> | null;
|
|
2273
|
-
bank: components["schemas"]["BankDto"];
|
|
2274
|
-
city: components["schemas"]["CityDto"];
|
|
2275
|
-
};
|
|
2276
|
-
RtnDataDto: {
|
|
2277
|
-
id: string;
|
|
2278
|
-
wire: components["schemas"]["WireDto"];
|
|
2279
|
-
ach: components["schemas"]["AchDto"];
|
|
2242
|
+
BankDataAddressDto: {
|
|
2243
|
+
city?: string | null;
|
|
2244
|
+
country_id?: number | null;
|
|
2245
|
+
postcode?: string | null;
|
|
2246
|
+
street1?: string | null;
|
|
2247
|
+
street2?: string | null;
|
|
2248
|
+
state_id?: number | null;
|
|
2280
2249
|
};
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
address:
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
country: components["schemas"]["CountryDto"];
|
|
2288
|
-
city: components["schemas"]["CityDto"];
|
|
2289
|
-
bank: components["schemas"]["BankDto"];
|
|
2250
|
+
GetBankDataByCodeResponseDto: {
|
|
2251
|
+
bank_name: string;
|
|
2252
|
+
address: components["schemas"]["BankDataAddressDto"];
|
|
2253
|
+
routing_number?: string;
|
|
2254
|
+
iban?: string;
|
|
2255
|
+
swift_bic?: string;
|
|
2290
2256
|
};
|
|
2291
2257
|
};
|
|
2292
2258
|
responses: never;
|
|
@@ -4806,11 +4772,11 @@ export interface operations {
|
|
|
4806
4772
|
};
|
|
4807
4773
|
};
|
|
4808
4774
|
};
|
|
4809
|
-
|
|
4775
|
+
BankDataController_getBankDataByCode: {
|
|
4810
4776
|
parameters: {
|
|
4811
4777
|
query: {
|
|
4812
|
-
/** @description
|
|
4813
|
-
|
|
4778
|
+
/** @description Bank code string must be a valid IBAN, RTN or SWIFT */
|
|
4779
|
+
code: string;
|
|
4814
4780
|
};
|
|
4815
4781
|
header?: never;
|
|
4816
4782
|
path?: never;
|
|
@@ -4818,15 +4784,21 @@ export interface operations {
|
|
|
4818
4784
|
};
|
|
4819
4785
|
requestBody?: never;
|
|
4820
4786
|
responses: {
|
|
4821
|
-
/** @description Bank data */
|
|
4822
4787
|
200: {
|
|
4823
4788
|
headers: {
|
|
4824
4789
|
[name: string]: unknown;
|
|
4825
4790
|
};
|
|
4826
4791
|
content: {
|
|
4827
|
-
"application/json": components["schemas"]["
|
|
4792
|
+
"application/json": components["schemas"]["GetBankDataByCodeResponseDto"];
|
|
4828
4793
|
};
|
|
4829
4794
|
};
|
|
4795
|
+
/** @description No data by code */
|
|
4796
|
+
400: {
|
|
4797
|
+
headers: {
|
|
4798
|
+
[name: string]: unknown;
|
|
4799
|
+
};
|
|
4800
|
+
content?: never;
|
|
4801
|
+
};
|
|
4830
4802
|
/** @description Unauthorized */
|
|
4831
4803
|
401: {
|
|
4832
4804
|
headers: {
|
package/src/api/types/types.ts
CHANGED
|
@@ -119,9 +119,9 @@ export namespace API {
|
|
|
119
119
|
export namespace BankData {
|
|
120
120
|
export namespace GetBankDataByAccountNumber {
|
|
121
121
|
export type Request =
|
|
122
|
-
operations["
|
|
122
|
+
operations["BankDataController_getBankDataByCode"]["parameters"]["query"];
|
|
123
123
|
export type Response =
|
|
124
|
-
operations["
|
|
124
|
+
operations["BankDataController_getBankDataByCode"]["responses"]["200"]["content"]["application/json"];
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -2605,37 +2605,49 @@ export namespace API {
|
|
|
2605
2605
|
walletAddress: string;
|
|
2606
2606
|
}
|
|
2607
2607
|
|
|
2608
|
-
export
|
|
2609
|
-
|
|
2610
|
-
count: number;
|
|
2611
|
-
}
|
|
2608
|
+
export namespace DepositInstruction {
|
|
2609
|
+
export type InstructionType = "ACH" | "FEDWIRE" | "SWIFT";
|
|
2612
2610
|
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
export interface AccountInfo {
|
|
2622
|
-
id: string;
|
|
2623
|
-
source: API.VirtualAccounts.VirtualAccount.PaymentRail;
|
|
2624
|
-
status: string;
|
|
2625
|
-
userId: string;
|
|
2626
|
-
destination: API.VirtualAccounts.VirtualAccount.Destination;
|
|
2627
|
-
microDeposits: API.VirtualAccounts.VirtualAccount.MicroDeposits;
|
|
2628
|
-
depositInstructions: API.VirtualAccounts.VirtualAccount.DepositInstructions;
|
|
2629
|
-
}
|
|
2611
|
+
export interface Address {
|
|
2612
|
+
city: string;
|
|
2613
|
+
state: string;
|
|
2614
|
+
postal_code: string;
|
|
2615
|
+
country_code: string;
|
|
2616
|
+
address_line1: string;
|
|
2617
|
+
address_line2: string;
|
|
2618
|
+
}
|
|
2630
2619
|
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2620
|
+
export interface Common {
|
|
2621
|
+
memo: string;
|
|
2622
|
+
asset_type_id: string;
|
|
2623
|
+
account_number: string;
|
|
2624
|
+
institution_name: string;
|
|
2625
|
+
instruction_type: InstructionType;
|
|
2626
|
+
account_holder_address?: Address;
|
|
2627
|
+
institution_address?: Address;
|
|
2628
|
+
account_holder_name?: string;
|
|
2629
|
+
account_routing_number?: string;
|
|
2630
|
+
swift_bic?: string;
|
|
2631
|
+
}
|
|
2632
|
+
export interface ACH extends Common {
|
|
2633
|
+
instruction_type: "ACH";
|
|
2635
2634
|
}
|
|
2636
|
-
export interface
|
|
2637
|
-
|
|
2635
|
+
export interface FEDWIRE extends Common {
|
|
2636
|
+
instruction_type: "FEDWIRE";
|
|
2637
|
+
account_holder_name: string;
|
|
2638
|
+
account_routing_number: string;
|
|
2639
|
+
institution_address: Address;
|
|
2640
|
+
account_holder_address: Address;
|
|
2638
2641
|
}
|
|
2642
|
+
|
|
2643
|
+
export interface SWIFT extends Common {
|
|
2644
|
+
instruction_type: "SWIFT";
|
|
2645
|
+
swift_bic: string;
|
|
2646
|
+
institution_address: Address;
|
|
2647
|
+
account_holder_address: Address;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
export type DepositInstruction = ACH | FEDWIRE | SWIFT | Common;
|
|
2639
2651
|
}
|
|
2640
2652
|
|
|
2641
2653
|
export interface OrderType {
|
|
@@ -2653,9 +2665,9 @@ export namespace API {
|
|
|
2653
2665
|
destination_address: string;
|
|
2654
2666
|
integration_vendor_id: string;
|
|
2655
2667
|
vendor_account_id: string;
|
|
2656
|
-
meta: API.VirtualAccounts.VirtualAccount.Meta.Meta;
|
|
2657
2668
|
account_details: API.VirtualAccounts.VirtualAccount.AccountDetails;
|
|
2658
2669
|
virtual_accounts_program: API.VirtualAccounts.Programs.Program;
|
|
2670
|
+
deposit_instructions: API.VirtualAccounts.VirtualAccount.DepositInstruction.DepositInstruction[];
|
|
2659
2671
|
}
|
|
2660
2672
|
export interface VirtualAccountDetailItem {
|
|
2661
2673
|
account_currency: string;
|
|
@@ -2673,7 +2685,6 @@ export namespace API {
|
|
|
2673
2685
|
destination_currency_details: API.Currencies.Currency;
|
|
2674
2686
|
id: string;
|
|
2675
2687
|
integration_vendor_id: string;
|
|
2676
|
-
meta: API.VirtualAccounts.VirtualAccount.Meta.Meta;
|
|
2677
2688
|
order_types: string[];
|
|
2678
2689
|
status: string;
|
|
2679
2690
|
total_balance: number;
|
package/dist/api/config.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare const baseURL: string;
|
|
2
|
-
export declare const tenantId: string | undefined;
|
|
3
|
-
export declare const pathnames: {
|
|
4
|
-
readonly auth: {
|
|
5
|
-
readonly me: "/auth/me";
|
|
6
|
-
readonly otp: {
|
|
7
|
-
readonly request: {
|
|
8
|
-
readonly email: "/auth/signin/email/otp";
|
|
9
|
-
readonly phone: "/auth/signin/phone/otp";
|
|
10
|
-
};
|
|
11
|
-
readonly verify: {
|
|
12
|
-
readonly email: "/auth/verify/email/otp";
|
|
13
|
-
readonly phone: "/auth/verify/phone/otp";
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
readonly signin: {
|
|
17
|
-
readonly password: {
|
|
18
|
-
readonly email: "/auth/signin/password/email";
|
|
19
|
-
readonly phone: "/auth/signin/password/phone";
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
readonly signup: {
|
|
23
|
-
readonly email: "/auth/signup/email";
|
|
24
|
-
readonly password: {
|
|
25
|
-
readonly email: "/auth/signup/password/email";
|
|
26
|
-
readonly phone: "/auth/signup/password/phone";
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
readonly refresh: {
|
|
30
|
-
readonly refresh_token: "/auth/refresh/refresh_token";
|
|
31
|
-
};
|
|
32
|
-
readonly user_data: {
|
|
33
|
-
readonly get: "/auth/user_data";
|
|
34
|
-
readonly update: "/auth/user_data";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
package/dist/api/config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pathnames = exports.tenantId = exports.baseURL = void 0;
|
|
4
|
-
exports.baseURL = process.env.API_URL || '/api/';
|
|
5
|
-
exports.tenantId = process.env.TENANT_ID;
|
|
6
|
-
exports.pathnames = {
|
|
7
|
-
auth: {
|
|
8
|
-
me: '/auth/me',
|
|
9
|
-
otp: {
|
|
10
|
-
request: {
|
|
11
|
-
email: '/auth/signin/email/otp',
|
|
12
|
-
phone: '/auth/signin/phone/otp',
|
|
13
|
-
},
|
|
14
|
-
verify: {
|
|
15
|
-
email: '/auth/verify/email/otp',
|
|
16
|
-
phone: '/auth/verify/phone/otp',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
signin: {
|
|
20
|
-
password: {
|
|
21
|
-
email: '/auth/signin/password/email',
|
|
22
|
-
phone: '/auth/signin/password/phone',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
signup: {
|
|
26
|
-
email: '/auth/signup/email',
|
|
27
|
-
password: {
|
|
28
|
-
email: '/auth/signup/password/email',
|
|
29
|
-
phone: '/auth/signup/password/phone',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
refresh: {
|
|
33
|
-
refresh_token: '/auth/refresh/refresh_token',
|
|
34
|
-
},
|
|
35
|
-
user_data: {
|
|
36
|
-
get: '/auth/user_data',
|
|
37
|
-
update: '/auth/user_data',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
};
|
package/dist/api/fetch_api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const test = 123;
|
package/dist/api/fetch_api.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// // import { toast } from 'react-toastify';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.test = void 0;
|
|
5
|
-
// import { auth } from './auth';
|
|
6
|
-
// import { baseURL, pathnames, tenantId } from './config';
|
|
7
|
-
// import { RequestConfig, RequestMethods, RequestOptions, RequestQueueItem } from './types';
|
|
8
|
-
// import { getAuthCookie } from '@/actions/auth.action';
|
|
9
|
-
// import { handleLogout } from '@/actions/redirect.action';
|
|
10
|
-
// import { ResponseStatus } from '@/constants';
|
|
11
|
-
// import { deleteTokens, refreshTokens, setTokens } from '@/helpers/serverTokensFactory';
|
|
12
|
-
// const logLevel = 'debug';
|
|
13
|
-
// let isTokenRefreshing = false;
|
|
14
|
-
// let requestQueue: RequestQueueItem[] = [];
|
|
15
|
-
// const createRequestHandler = (method: RequestMethods) => {
|
|
16
|
-
// const requestHandler = async <T>(url: string, requestConfig?: RequestConfig): Promise<T> => {
|
|
17
|
-
// const { headers, data } = requestConfig || {};
|
|
18
|
-
// const { access_token, refresh_token } = await getAuthCookie();
|
|
19
|
-
// const options: RequestOptions = {
|
|
20
|
-
// method,
|
|
21
|
-
// headers: {
|
|
22
|
-
// 'Content-Type': 'application/json',
|
|
23
|
-
// 'X-Tenant-Id': tenantId,
|
|
24
|
-
// ...headers,
|
|
25
|
-
// },
|
|
26
|
-
// body: data ? JSON.stringify(data) : undefined,
|
|
27
|
-
// };
|
|
28
|
-
// if (access_token) {
|
|
29
|
-
// options.headers = {
|
|
30
|
-
// ...options.headers,
|
|
31
|
-
// Authorization: access_token,
|
|
32
|
-
// };
|
|
33
|
-
// }
|
|
34
|
-
// const urlSearchParams = new URLSearchParams(requestConfig?.params);
|
|
35
|
-
// const requestUrl = new URL(`${baseURL}${url}?${urlSearchParams}`);
|
|
36
|
-
// if (logLevel === 'debug') {
|
|
37
|
-
// const requestLog = `[fetch][request] ${requestUrl}`;
|
|
38
|
-
// // eslint-disable-next-line no-console
|
|
39
|
-
// console.debug(requestLog);
|
|
40
|
-
// }
|
|
41
|
-
// const response = await fetch(requestUrl, options);
|
|
42
|
-
// const isError = !response.ok;
|
|
43
|
-
// const { status: responseStatus } = response;
|
|
44
|
-
// const currentTime = new Date().getMilliseconds();
|
|
45
|
-
// const requestSendTime = new Date(response.headers.get('date') || currentTime).getMilliseconds();
|
|
46
|
-
// const requestTime = (currentTime - requestSendTime) / 1000;
|
|
47
|
-
// const responseLog = `[fetch][${
|
|
48
|
-
// isError ? 'error' : 'response'
|
|
49
|
-
// }] ${method} ${responseStatus} ${requestUrl} +${requestTime}s`;
|
|
50
|
-
// if (logLevel === 'debug') {
|
|
51
|
-
// // eslint-disable-next-line no-console
|
|
52
|
-
// console.debug(responseLog);
|
|
53
|
-
// }
|
|
54
|
-
// if (isError) {
|
|
55
|
-
// if (response?.status === ResponseStatus.UNAUTHORIZED && access_token && typeof window !== 'undefined') {
|
|
56
|
-
// const isRefreshTokenRequest = url === pathnames.auth.refresh.refresh_token;
|
|
57
|
-
// const isRefreshAvailable = !isTokenRefreshing && refresh_token;
|
|
58
|
-
// const isLogoutNeccesary = !isRefreshAvailable || isRefreshTokenRequest;
|
|
59
|
-
// if (isLogoutNeccesary) {
|
|
60
|
-
// await deleteTokens();
|
|
61
|
-
// requestQueue.forEach((request) => request.reject());
|
|
62
|
-
// requestQueue = [];
|
|
63
|
-
// handleLogout();
|
|
64
|
-
// return Promise.reject(response);
|
|
65
|
-
// }
|
|
66
|
-
// if (isRefreshAvailable) {
|
|
67
|
-
// refreshTokens(refresh_token).then((tokens) => {
|
|
68
|
-
// setTokens(tokens); // todo set clients/server cookies
|
|
69
|
-
// requestQueue.forEach((request) => request.resolve());
|
|
70
|
-
// requestQueue = [];
|
|
71
|
-
// isTokenRefreshing = false;
|
|
72
|
-
// });
|
|
73
|
-
// }
|
|
74
|
-
// return new Promise((res, rej) => {
|
|
75
|
-
// requestQueue.push({
|
|
76
|
-
// resolve: () => res(requestHandler(url, requestConfig)),
|
|
77
|
-
// reject: () => rej(requestHandler(url, requestConfig)),
|
|
78
|
-
// });
|
|
79
|
-
// });
|
|
80
|
-
// }
|
|
81
|
-
// try {
|
|
82
|
-
// const errorData = await response.text();
|
|
83
|
-
// let parsedError;
|
|
84
|
-
// try {
|
|
85
|
-
// parsedError = JSON.parse(errorData);
|
|
86
|
-
// } catch {
|
|
87
|
-
// // Extract error message from HTML if it contains <!DOCTYPE html>
|
|
88
|
-
// if (errorData.includes('<!DOCTYPE html>')) {
|
|
89
|
-
// const messageMatch = errorData.match(/<pre>([^<]+)<\/pre>/);
|
|
90
|
-
// const extractedMessage = messageMatch ? messageMatch[1] : null;
|
|
91
|
-
// parsedError = {
|
|
92
|
-
// status: response.status,
|
|
93
|
-
// message: extractedMessage || response.statusText || 'Unknown error occurred',
|
|
94
|
-
// };
|
|
95
|
-
// } else {
|
|
96
|
-
// // If not HTML, use raw text as message
|
|
97
|
-
// parsedError = {
|
|
98
|
-
// status: response.status,
|
|
99
|
-
// message: errorData || response.statusText || 'Unknown error occurred',
|
|
100
|
-
// };
|
|
101
|
-
// }
|
|
102
|
-
// }
|
|
103
|
-
// return Promise.reject(parsedError);
|
|
104
|
-
// } catch (error) {
|
|
105
|
-
// // If we can't even read the response text, return a basic error
|
|
106
|
-
// const basicError = new Error('Failed to read error response');
|
|
107
|
-
// basicError.cause = response.status;
|
|
108
|
-
// basicError.message = response.statusText || 'Failed to read error response';
|
|
109
|
-
// return Promise.reject(basicError);
|
|
110
|
-
// }
|
|
111
|
-
// }
|
|
112
|
-
// const responseData = await response.json();
|
|
113
|
-
// return responseData;
|
|
114
|
-
// };
|
|
115
|
-
// return requestHandler;
|
|
116
|
-
// };
|
|
117
|
-
// export const getRequest = createRequestHandler('GET');
|
|
118
|
-
// export const deleteRequest = createRequestHandler('DELETE');
|
|
119
|
-
// export const patchRequest = createRequestHandler('PATCH');
|
|
120
|
-
// export const postRequest = createRequestHandler('POST');
|
|
121
|
-
// export { auth };
|
|
122
|
-
exports.test = 123;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { API } from './types';
|
|
2
|
-
export declare const fiat_accounts_v2: {
|
|
3
|
-
list: {
|
|
4
|
-
withCards: {
|
|
5
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.FiatAccountsV2.FiatAccountsListWithCards>;
|
|
6
|
-
};
|
|
7
|
-
withoutCards: {
|
|
8
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.FiatAccountsV2.FiatAccountsListWithoutCards>;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
getByUuid: ({ wallet_uuid, fiat_account_id }: API.FiatAccountsV2.ExtendedFiatAccount.Request) => Promise<API.FiatAccountsV2.ExtendedFiatAccount.ExtendedFiatAccount>;
|
|
12
|
-
create: ({ wallet_id, program_id }: API.FiatAccountsV2.CreateFiatAccount.Request) => Promise<API.FiatAccountsV2.CreateFiatAccount.Response>;
|
|
13
|
-
transactions: {
|
|
14
|
-
get: ({ fiat_account_id, wallet_uuid, limit, offset }: API.FiatAccountsV2.Transactions.TransactionList.Request) => Promise<API.FiatAccountsV2.Transactions.TransactionList.Response>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const fiat_accounts: {
|
|
18
|
-
list: {
|
|
19
|
-
withCards: {
|
|
20
|
-
getSinglecards: (wallet_uuid: string, limit: number, offset: number) => Promise<API.FiatAccounts.FiatAccountWithCards[]>;
|
|
21
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.FiatAccounts.FiatAccountWithCards[]>;
|
|
22
|
-
};
|
|
23
|
-
withoutCards: {
|
|
24
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.FiatAccounts.FiatAccount[]>;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
getByUuid: (uuid: string) => Promise<API.FiatAccounts.FiatAccount>;
|
|
28
|
-
create: (wallet_id: string, program_id: string) => Promise<API.FiatAccounts.FiatAccount>;
|
|
29
|
-
transactions: {
|
|
30
|
-
get: (fiat_account_id: string, limit?: number, offset?: number) => Promise<API.FiatAccounts.TransactionList>;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fiat_accounts = exports.fiat_accounts_v2 = void 0;
|
|
4
|
-
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
5
|
-
exports.fiat_accounts_v2 = {
|
|
6
|
-
list: {
|
|
7
|
-
withCards: {
|
|
8
|
-
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV2.getRequest(`/fiat-accounts/${wallet_uuid}`, {
|
|
9
|
-
params: { limit, offset, show_cards: true },
|
|
10
|
-
}),
|
|
11
|
-
},
|
|
12
|
-
withoutCards: {
|
|
13
|
-
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV2.getRequest(`/fiat-accounts/${wallet_uuid}`, {
|
|
14
|
-
params: { limit, offset },
|
|
15
|
-
}),
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
getByUuid: ({ wallet_uuid, fiat_account_id }) => apiClientFactory_1.apiClientV2.getRequest(`/fiat-accounts/${wallet_uuid}/${fiat_account_id}`),
|
|
19
|
-
create: ({ wallet_id, program_id }) => apiClientFactory_1.apiClientV2.postRequest(`/fiat-accounts/${wallet_id}`, {
|
|
20
|
-
data: { program_id },
|
|
21
|
-
}),
|
|
22
|
-
transactions: {
|
|
23
|
-
get: ({ fiat_account_id, wallet_uuid, limit, offset }) => apiClientFactory_1.apiClientV2.getRequest(`/fiat-accounts/${wallet_uuid}/${fiat_account_id}/transactions`, {
|
|
24
|
-
params: { limit, offset },
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
exports.fiat_accounts = {
|
|
29
|
-
list: {
|
|
30
|
-
withCards: {
|
|
31
|
-
getSinglecards: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
32
|
-
params: { limit, offset, lt_cards_limit: 2, gt_cards_limit: 0, show_cards: true },
|
|
33
|
-
}),
|
|
34
|
-
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
35
|
-
params: { limit, offset, show_cards: true },
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
withoutCards: {
|
|
39
|
-
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
40
|
-
params: { limit, offset },
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
getByUuid: (uuid) => apiClientFactory_1.apiClientV1.getRequest(`/fiat_accounts/${uuid}`),
|
|
45
|
-
create: (wallet_id, program_id) => apiClientFactory_1.apiClientV1.postRequest(`/fiat_accounts`, { data: { wallet_id, program_id } }),
|
|
46
|
-
transactions: {
|
|
47
|
-
get: (fiat_account_id, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/fiat_accounts/${fiat_account_id}/transactions`, {
|
|
48
|
-
params: { limit, offset },
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
};
|
package/dist/api/location.d.ts
DELETED
package/dist/api/location.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.location = void 0;
|
|
4
|
-
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
5
|
-
exports.location = {
|
|
6
|
-
countries: {
|
|
7
|
-
list: () => apiClientFactory_1.apiClientV2.getRequest('/location/countries'),
|
|
8
|
-
},
|
|
9
|
-
};
|