squarefi-bff-api-module 1.34.23 → 1.35.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.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export {};
@@ -2035,6 +2035,8 @@ export interface components {
2035
2035
  id: string;
2036
2036
  code: string | null;
2037
2037
  name: string;
2038
+ /** @description When false, submitting to this rail is disabled. The rail is still returned in lists; only the submit action is blocked. */
2039
+ is_submit_available: boolean;
2038
2040
  wallet_rail: components["schemas"]["WalletKycRailDto"] | null;
2039
2041
  terms_and_conditions: components["schemas"]["WalletKycRailTermsAndConditionsDto"][];
2040
2042
  };
@@ -1,5 +1,6 @@
1
- import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CurrencyType, IssuingProgramStatus, OrderType, SortingDirection, SubAccountType, WalletTransactionMethod, WalletTransactionRecordType, WalletTransactionStatus, WalletTransactionType } from '../../constants';
1
+ import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CurrencyType, IssuingProgramStatus, OrderType, SortingDirection, SubAccountType } from '../../constants';
2
2
  import { components, operations, paths } from './autogen/apiV2.types';
3
+ import { components as componentsV1Frontend, paths as pathsV1Frontend } from './autogen/apiV1Frontend.types';
3
4
  export declare namespace API {
4
5
  namespace Auth {
5
6
  namespace RefreshToken {
@@ -1326,6 +1327,13 @@ export declare namespace API {
1326
1327
  virtual_account_id: string;
1327
1328
  };
1328
1329
  }
1330
+ interface BraleResponse extends BaseOrderResponse {
1331
+ order_type: 'BRL_WIRE_OFFRAMP' | 'BRL_ACH_OFFRAMP';
1332
+ meta: {
1333
+ request_id: string;
1334
+ virtual_account_id: string;
1335
+ };
1336
+ }
1329
1337
  }
1330
1338
  }
1331
1339
  namespace ByOrderType {
@@ -1432,6 +1440,22 @@ export declare namespace API {
1432
1440
  order_type: 'L2F_FPS_OFFRAMP';
1433
1441
  };
1434
1442
  }
1443
+ namespace BRL_WIRE_OFFRAMP {
1444
+ type Request = Common.Request.OrderWithCounterpartyParams & {
1445
+ virtual_account_id?: string;
1446
+ };
1447
+ type Response = Common.Response.BraleResponse & {
1448
+ order_type: 'BRL_WIRE_OFFRAMP';
1449
+ };
1450
+ }
1451
+ namespace BRL_ACH_OFFRAMP {
1452
+ type Request = Common.Request.OrderWithCounterpartyParams & {
1453
+ virtual_account_id?: string;
1454
+ };
1455
+ type Response = Common.Response.BraleResponse & {
1456
+ order_type: 'BRL_ACH_OFFRAMP';
1457
+ };
1458
+ }
1435
1459
  }
1436
1460
  }
1437
1461
  namespace OrderTypes {
@@ -2080,181 +2104,154 @@ export declare namespace API {
2080
2104
  }
2081
2105
  }
2082
2106
  namespace Wallets {
2083
- interface SimplifiedWallet {
2107
+ export interface SimplifiedWallet {
2084
2108
  uuid: string;
2085
2109
  user_id: string;
2086
2110
  tenant_id: string;
2087
2111
  }
2088
- interface WallletBalanceDetails {
2089
- uuid: string;
2090
- amount: number;
2091
- fiat_amount: number;
2092
- currency: API.Currencies.Currency;
2112
+ type WalletsRoot = pathsV1Frontend['/frontend/wallets'];
2113
+ type WalletByIdRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}'];
2114
+ type WalletBalanceRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/balance'];
2115
+ type WalletDashboardRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/dashboard'];
2116
+ type WalletAddressesRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/addresses'];
2117
+ type WalletAddressByChainRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/addresses/{chain}'];
2118
+ type WalletTransactionsRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/transactions'];
2119
+ type WalletTransactionByIdRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/transactions/{transaction_id}'];
2120
+ type WalletTransactionsCsvRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/transactions/csv'];
2121
+ type WalletInvitesRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/invites'];
2122
+ type WalletInviteByIdRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/invites/{invite_id}'];
2123
+ type AcceptInviteRoot = pathsV1Frontend['/frontend/wallets/accept-invite'];
2124
+ type DeclineInviteRoot = pathsV1Frontend['/frontend/wallets/decline-invite'];
2125
+ type InviteInfoRoot = pathsV1Frontend['/frontend/wallets/invite-info'];
2126
+ type UsersLookupRoot = pathsV1Frontend['/frontend/wallets/users/lookup'];
2127
+ type WalletUsersRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/users'];
2128
+ type WalletUserByIdRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/users/{user_data_uuid}'];
2129
+ type WalletUserActivateRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/users/{user_data_uuid}/activate'];
2130
+ type WalletUserDeactivateRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/users/{user_data_uuid}/deactivate'];
2131
+ export namespace WalletsList {
2132
+ type Request = NonNullable<WalletsRoot['get']['parameters']['query']>;
2133
+ type Response = WalletsRoot['get']['responses']['200']['content']['application/json'];
2134
+ type WalletsListItem = NonNullable<Response['data']>[number];
2135
+ }
2136
+ export namespace Wallet {
2137
+ namespace Create {
2138
+ type Request = NonNullable<WalletsRoot['post']['requestBody']>['content']['application/json'];
2139
+ type Response = WalletsRoot['post']['responses']['201']['content']['application/json'];
2140
+ }
2141
+ namespace GetByUuid {
2142
+ type Request = WalletByIdRoot['get']['parameters']['path'] & NonNullable<WalletByIdRoot['get']['parameters']['query']>;
2143
+ type Response = WalletByIdRoot['get']['responses']['200']['content']['application/json'];
2144
+ }
2145
+ namespace Update {
2146
+ type Request = WalletByIdRoot['patch']['parameters']['path'] & WalletByIdRoot['patch']['requestBody']['content']['application/json'];
2147
+ type Response = WalletByIdRoot['patch']['responses']['200']['content']['application/json'];
2148
+ }
2093
2149
  }
2094
- interface WalletBalanceItem {
2095
- symbol: string;
2096
- icon: string;
2097
- name: string;
2098
- is_crypto: boolean;
2099
- decimal?: number | null;
2100
- amount: number;
2101
- fiat_amount: number;
2102
- details: WallletBalanceDetails[];
2150
+ export namespace Balance {
2151
+ type Request = WalletBalanceRoot['get']['parameters']['path'] & NonNullable<WalletBalanceRoot['get']['parameters']['query']>;
2152
+ type Response = WalletBalanceRoot['get']['responses']['200']['content']['application/json'];
2103
2153
  }
2104
- type WalletBalance = WalletBalanceItem[];
2105
- namespace WalletChain {
2106
- interface WalletChain {
2107
- uuid: string;
2108
- created_ad: string;
2109
- address: string;
2110
- wallet_uuid: string;
2111
- chain: number;
2154
+ export namespace Dashboard {
2155
+ type Request = WalletDashboardRoot['get']['parameters']['path'] & NonNullable<WalletDashboardRoot['get']['parameters']['query']>;
2156
+ type Response = WalletDashboardRoot['get']['responses']['200']['content']['application/json'];
2157
+ }
2158
+ export namespace WalletChain {
2159
+ namespace GetAll {
2160
+ type Request = WalletAddressesRoot['get']['parameters']['path'] & NonNullable<WalletAddressesRoot['get']['parameters']['query']>;
2161
+ type Response = WalletAddressesRoot['get']['responses']['200']['content']['application/json'];
2112
2162
  }
2113
2163
  namespace Create {
2114
- interface Request {
2115
- wallet_uuid: string;
2116
- chain: number;
2117
- label: string;
2164
+ type Request = WalletAddressByChainRoot['post']['parameters']['path'] & NonNullable<NonNullable<WalletAddressByChainRoot['post']['requestBody']>['content']['application/json']>;
2165
+ type Response = WalletAddressByChainRoot['post']['responses']['201']['content']['application/json'];
2166
+ }
2167
+ }
2168
+ export namespace WalletTransactions {
2169
+ namespace TransactionList {
2170
+ type Request = WalletTransactionsRoot['get']['parameters']['path'] & NonNullable<WalletTransactionsRoot['get']['parameters']['query']>;
2171
+ type Response = WalletTransactionsRoot['get']['responses']['200']['content']['application/json'];
2172
+ namespace ExportCsv {
2173
+ type Request = WalletTransactionsCsvRoot['get']['parameters']['path'] & NonNullable<WalletTransactionsCsvRoot['get']['parameters']['query']>;
2174
+ type Response = WalletTransactionsCsvRoot['get']['responses']['200']['content']['text/csv'];
2118
2175
  }
2119
- type Response = WalletChain;
2176
+ }
2177
+ namespace GetById {
2178
+ type Request = WalletTransactionByIdRoot['get']['parameters']['path'];
2179
+ type Response = WalletTransactionByIdRoot['get']['responses']['200']['content']['application/json'];
2120
2180
  }
2121
2181
  }
2122
- namespace Wallet {
2123
- type WalletKYCInfo = components['schemas']['WalletKycInfoDto'];
2124
- type WalletRole = components['schemas']['WalletDto']['role'];
2125
- interface Wallet {
2126
- uuid: string;
2127
- logo_url: string | null;
2128
- name: string | null;
2129
- created_at: string;
2130
- fiat_total: number;
2131
- crypto_total: number;
2132
- total_amount: number;
2133
- pending_balance: number;
2134
- balance: WalletBalance;
2135
- kyc_info: WalletKYCInfo;
2136
- role: WalletRole;
2182
+ export namespace Users {
2183
+ namespace Lookup {
2184
+ type Request = UsersLookupRoot['get']['parameters']['query'];
2185
+ type Response = UsersLookupRoot['get']['responses']['200']['content']['application/json'];
2137
2186
  }
2138
- namespace Create {
2139
- type Request = operations['WalletsController_create']['requestBody']['content']['application/json'];
2140
- type Response = operations['WalletsController_create']['responses']['200']['content']['application/json'];
2187
+ namespace GetAll {
2188
+ type Request = WalletUsersRoot['get']['parameters']['path'] & NonNullable<WalletUsersRoot['get']['parameters']['query']>;
2189
+ type Response = WalletUsersRoot['get']['responses']['200']['content']['application/json'];
2141
2190
  }
2142
- namespace GetByUuid {
2143
- type Request = operations['WalletsController_view']['parameters']['path'];
2144
- type Response = API.Wallets.Wallet.Wallet;
2191
+ namespace Add {
2192
+ type Request = WalletUsersRoot['post']['parameters']['path'] & WalletUsersRoot['post']['requestBody']['content']['application/json'];
2193
+ type Response = WalletUsersRoot['post']['responses']['201']['content']['application/json'];
2145
2194
  }
2146
- }
2147
- namespace WalletsList {
2148
- interface WalletsListItem {
2149
- logo_url: string | null;
2150
- uuid: string;
2151
- name: string | null;
2152
- created_at: string;
2153
- role: API.Wallets.Wallet.WalletRole;
2154
- kyc_info: API.Wallets.Wallet.WalletKYCInfo;
2195
+ namespace UpdateRole {
2196
+ type Request = WalletUserByIdRoot['patch']['parameters']['path'] & WalletUserByIdRoot['patch']['requestBody']['content']['application/json'];
2197
+ type Response = WalletUserByIdRoot['patch']['responses']['200']['content']['application/json'];
2198
+ }
2199
+ namespace Remove {
2200
+ type Request = WalletUserByIdRoot['delete']['parameters']['path'];
2201
+ type Response = WalletUserByIdRoot['delete']['responses']['200']['content']['application/json'];
2202
+ }
2203
+ namespace Activate {
2204
+ type Request = WalletUserActivateRoot['post']['parameters']['path'];
2205
+ type Response = WalletUserActivateRoot['post']['responses']['200']['content']['application/json'];
2206
+ }
2207
+ namespace Deactivate {
2208
+ type Request = WalletUserDeactivateRoot['post']['parameters']['path'];
2209
+ type Response = WalletUserDeactivateRoot['post']['responses']['200']['content']['application/json'];
2155
2210
  }
2156
- type Request = operations['WalletsController_all']['parameters']['query'];
2157
- type Response = {
2158
- total: number;
2159
- data: WalletsListItem[];
2160
- has_more: boolean;
2161
- };
2162
2211
  }
2163
- namespace WalletTransactions {
2164
- interface WalletTransactionMeta {
2165
- transaction_hash?: string;
2166
- fee?: number;
2167
- order_id?: string;
2168
- from_address?: string;
2169
- to_address?: string;
2170
- network_fee?: number;
2171
- network_fee_currency?: string;
2172
- fee_currency?: string;
2173
- billing_amount?: number;
2174
- utila_transaction?: string;
2175
- transcation_amount?: number;
2176
- transaction_amount?: number;
2177
- billing_amount_currency?: string;
2178
- transcation_amount_currency?: string;
2179
- transaction_amount_currency?: string;
2180
- exchange_rate?: number;
2181
- fiat_account_id?: string;
2182
- txid?: string;
2183
- chain_id?: number;
2184
- from_user_data?: number;
2185
- to_user_data?: number;
2186
- to_card_id?: string;
2187
- to_card_last4?: string;
2188
- to_fiat_account_id?: string;
2189
- to_vendor_id?: string;
2190
- }
2191
- interface Transaction {
2192
- id: number;
2193
- created_at: string;
2194
- type: WalletTransactionType | string;
2195
- method: WalletTransactionMethod | string;
2196
- status: WalletTransactionStatus | string;
2197
- amount: number;
2198
- from: string | null;
2199
- to: string | null;
2200
- wallet_id: string;
2201
- txid: string;
2202
- info: string;
2203
- currency: API.Currencies.Currency;
2204
- record_type: WalletTransactionRecordType | string;
2205
- meta?: WalletTransactionMeta;
2212
+ export namespace Invites {
2213
+ type WalletInvite = componentsV1Frontend['schemas']['WalletInvite'];
2214
+ namespace Info {
2215
+ type Request = InviteInfoRoot['get']['parameters']['query'];
2216
+ type Response = InviteInfoRoot['get']['responses']['200']['content']['application/json'];
2206
2217
  }
2207
- interface DetailedTransaction {
2208
- id: number;
2209
- amount: number;
2210
- created_at: string;
2211
- from: string;
2212
- info: string;
2213
- status: WalletTransactionStatus | string;
2214
- to: string;
2215
- txid: string;
2216
- type: WalletTransactionType | string;
2217
- wallet_id: string;
2218
- method: WalletTransactionMethod | string;
2219
- meta: WalletTransactionMeta;
2220
- record_type: WalletTransactionRecordType | string;
2221
- currency: API.Currencies.Currency;
2218
+ namespace Accept {
2219
+ type Request = AcceptInviteRoot['post']['requestBody']['content']['application/json'];
2220
+ type Response = AcceptInviteRoot['post']['responses']['200']['content']['application/json'];
2222
2221
  }
2223
- namespace GetByUuid {
2224
- type Request = {
2225
- wallet_uuid: string;
2226
- uuid: string;
2227
- };
2222
+ namespace Decline {
2223
+ type Request = DeclineInviteRoot['post']['requestBody']['content']['application/json'];
2224
+ type Response = DeclineInviteRoot['post']['responses']['200']['content']['application/json'];
2228
2225
  }
2229
- namespace TransactionList {
2230
- type Request = {
2231
- wallet_uuid: string;
2232
- limit: number;
2233
- offset: number;
2234
- filter?: Partial<components['schemas']['TransactionsFilter']>;
2235
- };
2236
- type Response = {
2237
- total: number;
2238
- data: Transaction[];
2239
- };
2240
- namespace ExportCsv {
2241
- type Request = {
2242
- wallet_uuid: string;
2243
- filter?: Partial<components['schemas']['TransactionsFilter']>;
2244
- };
2245
- type Response = string;
2246
- }
2226
+ namespace GetAll {
2227
+ type Request = WalletInvitesRoot['get']['parameters']['path'] & NonNullable<WalletInvitesRoot['get']['parameters']['query']>;
2228
+ type Response = WalletInvitesRoot['get']['responses']['200']['content']['application/json'];
2247
2229
  }
2248
- namespace StatementPdf {
2249
- type Request = {
2250
- wallet_uuid: string;
2251
- from_date?: string;
2252
- to_date?: string;
2253
- crypto_id?: string;
2254
- logo?: string;
2255
- };
2256
- type Response = string;
2230
+ namespace Create {
2231
+ type Request = WalletInvitesRoot['post']['parameters']['path'] & WalletInvitesRoot['post']['requestBody']['content']['application/json'];
2232
+ type Response = WalletInvitesRoot['post']['responses']['201']['content']['application/json'];
2233
+ }
2234
+ namespace GetById {
2235
+ type Request = WalletInviteByIdRoot['get']['parameters']['path'];
2236
+ type Response = WalletInviteByIdRoot['get']['responses']['200']['content']['application/json'];
2257
2237
  }
2238
+ namespace Delete {
2239
+ type Request = WalletInviteByIdRoot['delete']['parameters']['path'];
2240
+ type Response = WalletInviteByIdRoot['delete']['responses']['200']['content']['application/json'];
2241
+ }
2242
+ }
2243
+ export {};
2244
+ }
2245
+ namespace Statements {
2246
+ namespace Pdf {
2247
+ type Request = {
2248
+ wallet_uuid: string;
2249
+ from_date?: string;
2250
+ to_date?: string;
2251
+ crypto_id?: string;
2252
+ logo?: string;
2253
+ };
2254
+ type Response = Blob;
2258
2255
  }
2259
2256
  }
2260
2257
  namespace Storage {
@@ -1,26 +1,36 @@
1
1
  import { API } from './types/types';
2
2
  export declare const wallets: {
3
- create: (data: API.Wallets.Wallet.Create.Request) => Promise<API.Wallets.Wallet.Create.Response>;
3
+ create: (data?: API.Wallets.Wallet.Create.Request) => Promise<API.Wallets.Wallet.Create.Response>;
4
4
  getAll: (params?: API.Wallets.WalletsList.Request) => Promise<API.Wallets.WalletsList.Response>;
5
- getByUuid: ({ wallet_id }: API.Wallets.Wallet.GetByUuid.Request) => Promise<API.Wallets.Wallet.GetByUuid.Response>;
5
+ getByUuid: ({ wallet_id, ...params }: API.Wallets.Wallet.GetByUuid.Request) => Promise<API.Wallets.Wallet.GetByUuid.Response>;
6
+ update: ({ wallet_id, ...data }: API.Wallets.Wallet.Update.Request) => Promise<API.Wallets.Wallet.Update.Response>;
7
+ getBalance: ({ wallet_id, ...params }: API.Wallets.Balance.Request) => Promise<API.Wallets.Balance.Response>;
8
+ getDashboard: ({ wallet_id, ...params }: API.Wallets.Dashboard.Request) => Promise<API.Wallets.Dashboard.Response>;
6
9
  addresses: {
7
- create: (data: API.Wallets.WalletChain.Create.Request) => Promise<API.Wallets.WalletChain.Create.Response>;
8
- get: {
9
- byWalletUuid: {
10
- byChainId: (wallet_uuid: string, chain_id: number) => Promise<API.Wallets.WalletChain.WalletChain>;
11
- };
12
- };
10
+ getAll: ({ wallet_id, ...params }: API.Wallets.WalletChain.GetAll.Request) => Promise<API.Wallets.WalletChain.GetAll.Response>;
11
+ create: ({ wallet_id, chain, ...data }: API.Wallets.WalletChain.Create.Request) => Promise<API.Wallets.WalletChain.Create.Response>;
13
12
  };
14
13
  transactions: {
15
- byWalletUuid: {
16
- getAll: (data: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
17
- getByUuid: ({ wallet_uuid, uuid, }: API.Wallets.WalletTransactions.GetByUuid.Request) => Promise<API.Wallets.WalletTransactions.DetailedTransaction>;
18
- };
19
- csv: {
20
- getByWalletUuid: ({ wallet_uuid, ...params }: API.Wallets.WalletTransactions.TransactionList.ExportCsv.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.ExportCsv.Response>;
21
- };
14
+ getAll: ({ wallet_id, limit, offset, ...params }: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
15
+ getById: ({ wallet_id, transaction_id, }: API.Wallets.WalletTransactions.GetById.Request) => Promise<API.Wallets.WalletTransactions.GetById.Response>;
16
+ csv: ({ wallet_id, ...params }: API.Wallets.WalletTransactions.TransactionList.ExportCsv.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.ExportCsv.Response>;
22
17
  };
23
- statementPdf: {
24
- getByWalletUuid: ({ wallet_uuid, ...params }: API.Wallets.WalletTransactions.StatementPdf.Request) => Promise<API.Wallets.WalletTransactions.StatementPdf.Response>;
18
+ users: {
19
+ lookup: (params: API.Wallets.Users.Lookup.Request) => Promise<API.Wallets.Users.Lookup.Response>;
20
+ getAll: ({ wallet_id, ...params }: API.Wallets.Users.GetAll.Request) => Promise<API.Wallets.Users.GetAll.Response>;
21
+ add: ({ wallet_id, ...data }: API.Wallets.Users.Add.Request) => Promise<API.Wallets.Users.Add.Response>;
22
+ updateRole: ({ wallet_id, user_data_uuid, ...data }: API.Wallets.Users.UpdateRole.Request) => Promise<API.Wallets.Users.UpdateRole.Response>;
23
+ remove: ({ wallet_id, user_data_uuid, }: API.Wallets.Users.Remove.Request) => Promise<API.Wallets.Users.Remove.Response>;
24
+ activate: ({ wallet_id, user_data_uuid, }: API.Wallets.Users.Activate.Request) => Promise<API.Wallets.Users.Activate.Response>;
25
+ deactivate: ({ wallet_id, user_data_uuid, }: API.Wallets.Users.Deactivate.Request) => Promise<API.Wallets.Users.Deactivate.Response>;
26
+ };
27
+ invites: {
28
+ info: (params: API.Wallets.Invites.Info.Request) => Promise<API.Wallets.Invites.Info.Response>;
29
+ accept: (data: API.Wallets.Invites.Accept.Request) => Promise<API.Wallets.Invites.Accept.Response>;
30
+ decline: (data: API.Wallets.Invites.Decline.Request) => Promise<API.Wallets.Invites.Decline.Response>;
31
+ getAll: ({ wallet_id, ...params }: API.Wallets.Invites.GetAll.Request) => Promise<API.Wallets.Invites.GetAll.Response>;
32
+ create: ({ wallet_id, ...data }: API.Wallets.Invites.Create.Request) => Promise<API.Wallets.Invites.Create.Response>;
33
+ getById: ({ wallet_id, invite_id, }: API.Wallets.Invites.GetById.Request) => Promise<API.Wallets.Invites.GetById.Response>;
34
+ delete: ({ wallet_id, invite_id, }: API.Wallets.Invites.Delete.Request) => Promise<API.Wallets.Invites.Delete.Response>;
25
35
  };
26
36
  };
@@ -1,33 +1,47 @@
1
- import { apiClientV1Native, apiClientV2 } from '../utils/apiClientFactory';
1
+ import { apiClientV1Frontend } from '../utils/apiClientFactory';
2
2
  import { defaultPaginationParams } from '../constants';
3
3
  export const wallets = {
4
- create: (data) => apiClientV2.postRequest('/wallets', { data }),
5
- getAll: (params) => apiClientV2.getRequest('/wallets', { params }),
6
- getByUuid: ({ wallet_id }) => apiClientV2.getRequest(`/wallets/${wallet_id}`),
4
+ create: (data) => apiClientV1Frontend.postRequest('/frontend/wallets', { data }),
5
+ getAll: (params) => apiClientV1Frontend.getRequest('/frontend/wallets', { params }),
6
+ getByUuid: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}`, {
7
+ params,
8
+ }),
9
+ update: ({ wallet_id, ...data }) => apiClientV1Frontend.patchRequest(`/frontend/wallets/${wallet_id}`, {
10
+ data,
11
+ }),
12
+ getBalance: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/balance`, { params }),
13
+ getDashboard: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/dashboard`, { params }),
7
14
  addresses: {
8
- create: (data) => {
9
- const { wallet_uuid, chain, label } = data;
10
- return apiClientV2.postRequest(`/wallets/${wallet_uuid}/addresses/${chain}`, { data: { label } });
11
- },
12
- get: {
13
- byWalletUuid: {
14
- byChainId: (wallet_uuid, chain_id) => apiClientV2.getRequest(`/wallets/${wallet_uuid}/addresses/${chain_id}`),
15
- },
16
- },
15
+ getAll: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/addresses`, { params }),
16
+ create: ({ wallet_id, chain, ...data }) => apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/addresses/${chain}`, { data }),
17
17
  },
18
18
  transactions: {
19
- byWalletUuid: {
20
- getAll: async (data) => {
21
- const { wallet_uuid, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, ...params } = data;
22
- return apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions`, { params: { limit, offset, ...params } });
23
- },
24
- getByUuid: ({ wallet_uuid, uuid, }) => apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/${uuid}`),
25
- },
26
- csv: {
27
- getByWalletUuid: ({ wallet_uuid, ...params }) => apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/export/csv`, { params }),
28
- },
19
+ getAll: ({ wallet_id, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/transactions`, { params: { limit, offset, ...params } }),
20
+ getById: ({ wallet_id, transaction_id, }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/transactions/${transaction_id}`),
21
+ csv: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/transactions/csv`, { params }),
29
22
  },
30
- statementPdf: {
31
- getByWalletUuid: ({ wallet_uuid, ...params }) => apiClientV1Native.getRequest(`/wallets/transactions/${wallet_uuid}/statement-pdf`, { params, responseType: 'blob' }),
23
+ users: {
24
+ lookup: (params) => apiClientV1Frontend.getRequest('/frontend/wallets/users/lookup', {
25
+ params,
26
+ }),
27
+ getAll: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/users`, { params }),
28
+ add: ({ wallet_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/users`, { data }),
29
+ updateRole: ({ wallet_id, user_data_uuid, ...data }) => apiClientV1Frontend.patchRequest(`/frontend/wallets/${wallet_id}/users/${user_data_uuid}`, { data }),
30
+ remove: ({ wallet_id, user_data_uuid, }) => apiClientV1Frontend.deleteRequest(`/frontend/wallets/${wallet_id}/users/${user_data_uuid}`),
31
+ activate: ({ wallet_id, user_data_uuid, }) => apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/users/${user_data_uuid}/activate`),
32
+ deactivate: ({ wallet_id, user_data_uuid, }) => apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/users/${user_data_uuid}/deactivate`),
33
+ },
34
+ invites: {
35
+ info: (params) => apiClientV1Frontend.getRequest('/frontend/wallets/invite-info', {
36
+ params,
37
+ }),
38
+ accept: (data) => apiClientV1Frontend.postRequest('/frontend/wallets/accept-invite', {
39
+ data,
40
+ }),
41
+ decline: (data) => apiClientV1Frontend.postRequest('/frontend/wallets/decline-invite', { data }),
42
+ getAll: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/invites`, { params }),
43
+ create: ({ wallet_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/invites`, { data }),
44
+ getById: ({ wallet_id, invite_id, }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/invites/${invite_id}`),
45
+ delete: ({ wallet_id, invite_id, }) => apiClientV1Frontend.deleteRequest(`/frontend/wallets/${wallet_id}/invites/${invite_id}`),
32
46
  },
33
47
  };
@@ -124,7 +124,11 @@ export declare enum OrderType {
124
124
  L2F_FPS_OFFRAMP = "L2F_FPS_OFFRAMP",
125
125
  L2F_FPS_ONRAMP = "L2F_FPS_ONRAMP",
126
126
  L2F_CHAPS_OFFRAMP = "L2F_CHAPS_OFFRAMP",
127
- L2F_CHAPS_ONRAMP = "L2F_CHAPS_ONRAMP"
127
+ L2F_CHAPS_ONRAMP = "L2F_CHAPS_ONRAMP",
128
+ BRL_ACH_OFFRAMP = "BRL_ACH_OFFRAMP",
129
+ BRL_ACH_ONRAMP = "BRL_ACH_ONRAMP",
130
+ BRL_WIRE_OFFRAMP = "BRL_WIRE_OFFRAMP",
131
+ BRL_WIRE_ONRAMP = "BRL_WIRE_ONRAMP"
128
132
  }
129
133
  export declare enum WalletTransactionRecordType {
130
134
  CARD_PROVIDER_DEPOSIT = "CARD_PROVIDER_DEPOSIT",
@@ -207,7 +211,11 @@ export declare enum WalletTransactionRecordType {
207
211
  L2F_FPS_OFFRAMP = "L2F_FPS_OFFRAMP",
208
212
  L2F_FPS_ONRAMP = "L2F_FPS_ONRAMP",
209
213
  L2F_CHAPS_OFFRAMP = "L2F_CHAPS_OFFRAMP",
210
- L2F_CHAPS_ONRAMP = "L2F_CHAPS_ONRAMP"
214
+ L2F_CHAPS_ONRAMP = "L2F_CHAPS_ONRAMP",
215
+ BRL_ACH_OFFRAMP = "BRL_ACH_OFFRAMP",
216
+ BRL_ACH_ONRAMP = "BRL_ACH_ONRAMP",
217
+ BRL_WIRE_OFFRAMP = "BRL_WIRE_OFFRAMP",
218
+ BRL_WIRE_ONRAMP = "BRL_WIRE_ONRAMP"
211
219
  }
212
220
  export type OrderTypeMissingInWalletTransactionRecordType = Exclude<EnumValues<OrderType>, EnumValues<WalletTransactionRecordType>>;
213
221
  export declare const orderTypeIncludedInWalletTransactionRecordTypeCheck: IsUnionSubset<EnumValues<OrderType>, EnumValues<WalletTransactionRecordType>>;
package/dist/constants.js CHANGED
@@ -126,6 +126,10 @@ export var OrderType;
126
126
  OrderType["L2F_FPS_ONRAMP"] = "L2F_FPS_ONRAMP";
127
127
  OrderType["L2F_CHAPS_OFFRAMP"] = "L2F_CHAPS_OFFRAMP";
128
128
  OrderType["L2F_CHAPS_ONRAMP"] = "L2F_CHAPS_ONRAMP";
129
+ OrderType["BRL_ACH_OFFRAMP"] = "BRL_ACH_OFFRAMP";
130
+ OrderType["BRL_ACH_ONRAMP"] = "BRL_ACH_ONRAMP";
131
+ OrderType["BRL_WIRE_OFFRAMP"] = "BRL_WIRE_OFFRAMP";
132
+ OrderType["BRL_WIRE_ONRAMP"] = "BRL_WIRE_ONRAMP";
129
133
  // when extend do not forget to add new order type to the enum WalletTransactionRecordType
130
134
  })(OrderType || (OrderType = {}));
131
135
  export var WalletTransactionRecordType;
@@ -211,6 +215,10 @@ export var WalletTransactionRecordType;
211
215
  WalletTransactionRecordType["L2F_FPS_ONRAMP"] = "L2F_FPS_ONRAMP";
212
216
  WalletTransactionRecordType["L2F_CHAPS_OFFRAMP"] = "L2F_CHAPS_OFFRAMP";
213
217
  WalletTransactionRecordType["L2F_CHAPS_ONRAMP"] = "L2F_CHAPS_ONRAMP";
218
+ WalletTransactionRecordType["BRL_ACH_OFFRAMP"] = "BRL_ACH_OFFRAMP";
219
+ WalletTransactionRecordType["BRL_ACH_ONRAMP"] = "BRL_ACH_ONRAMP";
220
+ WalletTransactionRecordType["BRL_WIRE_OFFRAMP"] = "BRL_WIRE_OFFRAMP";
221
+ WalletTransactionRecordType["BRL_WIRE_ONRAMP"] = "BRL_WIRE_ONRAMP";
214
222
  })(WalletTransactionRecordType || (WalletTransactionRecordType = {}));
215
223
  export const orderTypeIncludedInWalletTransactionRecordTypeCheck = true;
216
224
  export var RequestStatus;
@@ -45,6 +45,12 @@ export declare const apiClientV2: {
45
45
  deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
46
46
  getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
47
47
  };
48
+ export declare const apiClientV1Frontend: {
49
+ patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
50
+ postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
51
+ deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
52
+ getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
53
+ };
48
54
  export declare const apiClientTOTP: {
49
55
  patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
50
56
  postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
@@ -227,6 +227,11 @@ export const apiClientV2 = createApiClient({
227
227
  isBearerToken: true,
228
228
  tenantId: envTenantId,
229
229
  });
230
+ export const apiClientV1Frontend = createApiClient({
231
+ baseURL: apiV1BaseURL,
232
+ isBearerToken: true,
233
+ tenantId: envTenantId,
234
+ });
230
235
  export const apiClientTOTP = createApiClient({
231
236
  baseURL: apiTOTPBaseURL,
232
237
  isBearerToken: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.34.23",
3
+ "version": "1.35.0",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",