admin08077 commited on
Commit
1e89e30
·
verified ·
1 Parent(s): 952e08a

Upload 3 files

Browse files
Files changed (3) hide show
  1. types/index.ts +391 -0
  2. types/models.ts +488 -0
  3. types/models.tsx +254 -0
types/index.ts ADDED
@@ -0,0 +1,391 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ // --- Authentication & Identity ---
3
+ export interface UserSession {
4
+ id: string;
5
+ name: string;
6
+ role: string;
7
+ avatar?: string;
8
+ lastLogin: string;
9
+ }
10
+
11
+ export interface AuthResponse {
12
+ isAuthenticated: boolean;
13
+ user: UserSession | null;
14
+ }
15
+
16
+ export interface ClientRegisterRequest {
17
+ client_name: string;
18
+ redirect_uris: string[];
19
+ scope: string[];
20
+ appId?: string;
21
+ description?: string;
22
+ }
23
+
24
+ export interface ClientRegisterResponse extends ClientRegisterRequest {
25
+ client_id: string;
26
+ client_secret: string;
27
+ clientDisplayName?: string;
28
+ grant_types?: string[];
29
+ token_endpoint_auth_method?: string;
30
+ }
31
+
32
+ export interface Customer {
33
+ firstName: string;
34
+ lastName: string;
35
+ middleName?: string;
36
+ title?: string;
37
+ suffix?: string;
38
+ companyName?: string;
39
+ }
40
+
41
+ export interface CustomerAddress {
42
+ addressLine1: string;
43
+ city: string;
44
+ region: string;
45
+ postalCode: string;
46
+ country: string;
47
+ type: 'BUSINESS' | 'DELIVERY' | 'HOME' | 'MAILING';
48
+ }
49
+
50
+ export interface TelephoneNumber {
51
+ type: 'BUSINESS' | 'CELL' | 'FAX' | 'HOME';
52
+ country: string;
53
+ number: string;
54
+ }
55
+
56
+ export interface CustomerProfileResponse {
57
+ customer: Customer;
58
+ contacts: {
59
+ emails: string[];
60
+ addresses: CustomerAddress[];
61
+ phones: TelephoneNumber[];
62
+ };
63
+ }
64
+
65
+ // --- Banking & Treasury (Citi/FDX compliant) ---
66
+ export type AccountGroup = 'CHECKING' | 'SAVINGS' | 'CREDITCARD' | 'LOAN' | 'LINEOFCREDIT' | 'BROKERAGE' | 'RETIREMENT';
67
+
68
+ export interface GroupBalance {
69
+ localCurrencyCode: string;
70
+ localCurrencyBalanceAmount: number;
71
+ }
72
+
73
+ export interface InternalAccount {
74
+ id: string;
75
+ productName: string;
76
+ accountName?: string;
77
+ accountNickname?: string;
78
+ displayAccountNumber: string;
79
+ currency: string;
80
+ status: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
81
+ currentBalance: number;
82
+ availableBalance: number;
83
+ institutionName: string;
84
+ connectionId: string;
85
+ }
86
+
87
+ export interface CheckingAccountDetails {
88
+ productName: string;
89
+ accountNickname?: string;
90
+ accountDescription: string;
91
+ balanceType: 'ASSET' | 'LIABILITY';
92
+ displayAccountNumber: string;
93
+ accountId: string;
94
+ currencyCode: string;
95
+ accountStatus: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
96
+ currentBalance: number;
97
+ availableBalance: number;
98
+ }
99
+
100
+ export interface CreditCardAccountDetails {
101
+ productName: string;
102
+ accountDescription: string;
103
+ balanceType: 'ASSET' | 'LIABILITY';
104
+ displayAccountNumber: string;
105
+ accountId: string;
106
+ currencyCode: string;
107
+ accountStatus: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
108
+ availableCredit?: number;
109
+ creditLimit?: number;
110
+ currentBalance: number;
111
+ }
112
+
113
+ export interface AccountGroupDetails {
114
+ accountGroup: AccountGroup;
115
+ checkingAccountsDetails?: CheckingAccountDetails[];
116
+ savingsAccountsDetails?: CheckingAccountDetails[];
117
+ creditCardAccountsDetails?: CreditCardAccountDetails[];
118
+ totalCurrentBalance?: GroupBalance;
119
+ totalAvailableBalance?: GroupBalance;
120
+ }
121
+
122
+ export interface AccountsGroupDetailsList {
123
+ accountGroupDetails: AccountGroupDetails[];
124
+ customer?: { customerId: string };
125
+ }
126
+
127
+ export interface CitiTransaction {
128
+ accountId: string;
129
+ currencyCode: string;
130
+ transactionAmount: number;
131
+ transactionDate: string;
132
+ transactionDescription: string;
133
+ transactionId: string;
134
+ transactionStatus: string;
135
+ transactionType: string;
136
+ displayAccountNumber: string;
137
+ }
138
+
139
+ export interface GetAccountTransactionsResp {
140
+ checkingAccountTransactions?: CitiTransaction[];
141
+ savingsAccountTransactions?: CitiTransaction[];
142
+ creditCardAccountTransactions?: CitiTransaction[];
143
+ loanAccountTransactions?: CitiTransaction[];
144
+ lineOfCreditAccountTransactions?: CitiTransaction[];
145
+ brokerageAccountTransactions?: CitiTransaction[];
146
+ }
147
+
148
+ export interface VirtualAccount {
149
+ id: string;
150
+ object?: string;
151
+ live_mode?: boolean;
152
+ created_at: string;
153
+ updated_at?: string;
154
+ name: string;
155
+ description: string | null;
156
+ status: 'ACTIVE' | 'PENDING' | 'CLOSED';
157
+ internal_account_id: string;
158
+ counterparty_id?: string | null;
159
+ account_details?: any[];
160
+ routing_details?: any[];
161
+ }
162
+
163
+ export interface Counterparty {
164
+ id: string;
165
+ name: string;
166
+ email: string;
167
+ status: 'ACTIVE' | 'PENDING' | 'INACTIVE';
168
+ createdAt: string;
169
+ accounts?: Array<{
170
+ id: string;
171
+ accountType: string;
172
+ accountNumber: string;
173
+ }>;
174
+ }
175
+
176
+ export interface LineItem {
177
+ id: string;
178
+ amount: number;
179
+ currency: string;
180
+ description: string;
181
+ ledger_account_id: string;
182
+ itemizable_id?: string;
183
+ itemizable_type?: string;
184
+ createdAt: string;
185
+ }
186
+
187
+ export interface LineItemUpdateRequest {
188
+ description?: string;
189
+ metadata?: Record<string, any>;
190
+ }
191
+
192
+ // --- Intelligence & Oracle ---
193
+ export interface AIInsight {
194
+ id: string;
195
+ title?: string;
196
+ description?: string;
197
+ severity?: 'INFO' | 'CRITICAL';
198
+ type?: 'opportunity' | 'warning' | 'neutral' | 'alpha' | string;
199
+ message?: string;
200
+ confidence?: number;
201
+ timestamp?: string;
202
+ actionable?: boolean;
203
+ }
204
+
205
+ export interface SimulationResult {
206
+ outcomeNarrative: string;
207
+ projectedValue: number;
208
+ confidenceScore: number;
209
+ status: string;
210
+ simulationId: string;
211
+ keyRisks?: string[];
212
+ }
213
+
214
+ // --- Crypto & Decentralized Assets ---
215
+
216
+ /* fix: expanded CoinMarketData to include all properties used in cryptoService.ts */
217
+ export interface CoinMarketData {
218
+ id: string;
219
+ symbol: string;
220
+ name: string;
221
+ image: string;
222
+ current_price: number;
223
+ market_cap: number;
224
+ market_cap_rank: number;
225
+ fully_diluted_valuation: number | null;
226
+ total_volume: number;
227
+ high_24h: number;
228
+ low_24h: number;
229
+ price_change_24h: number;
230
+ price_change_percentage_24h: number;
231
+ market_cap_change_24h: number;
232
+ market_cap_change_percentage_24h: number;
233
+ circulating_supply: number;
234
+ total_supply: number | null;
235
+ max_supply: number | null;
236
+ ath: number;
237
+ ath_change_percentage: number;
238
+ ath_date: string;
239
+ atl: number;
240
+ atl_change_percentage: number;
241
+ atl_date: string;
242
+ roi: any | null;
243
+ last_updated: string;
244
+ sparkline_in_7d?: {
245
+ price: number[];
246
+ };
247
+ }
248
+
249
+ /* fix: added CoinDetail interface missing from types/index.ts but used in cryptoService.ts */
250
+ export interface CoinDetail extends CoinMarketData {
251
+ description: { [key: string]: string };
252
+ links: {
253
+ homepage: string[];
254
+ blockchain_site: string[];
255
+ official_forum_url: string[];
256
+ chat_url: string[];
257
+ announcement_url: string[];
258
+ twitter_screen_name: string;
259
+ facebook_username: string;
260
+ bitcointalk_thread_identifier: any;
261
+ telegram_channel_identifier: string;
262
+ subreddit_url: string;
263
+ repos_url: {
264
+ github: string[];
265
+ bitbucket: any[];
266
+ };
267
+ };
268
+ genesis_date: string | null;
269
+ sentiment_votes_up_percentage: number;
270
+ sentiment_votes_down_percentage: number;
271
+ }
272
+
273
+ /* fix: added TrendingCoin interface missing from types/index.ts but used in cryptoService.ts */
274
+ export interface TrendingCoin {
275
+ item: {
276
+ id: string;
277
+ coin_id: number;
278
+ name: string;
279
+ symbol: string;
280
+ market_cap_rank: number;
281
+ thumb: string;
282
+ small: string;
283
+ large: string;
284
+ slug: string;
285
+ price_btc: number;
286
+ score: number;
287
+ data: {
288
+ price: number;
289
+ price_btc: string;
290
+ price_change_percentage_24h: { [key: string]: number };
291
+ market_cap: string;
292
+ total_volume: string;
293
+ sparkline: string;
294
+ };
295
+ };
296
+ }
297
+
298
+ /* fix: added SearchResult interface missing from types/index.ts but used in cryptoService.ts */
299
+ export interface SearchResult {
300
+ coins: Array<{
301
+ id: string;
302
+ name: string;
303
+ api_symbol: string;
304
+ symbol: string;
305
+ market_cap_rank: number;
306
+ thumb: string;
307
+ large: string;
308
+ }>;
309
+ exchanges: any[];
310
+ nfts: any[];
311
+ categories: any[];
312
+ }
313
+
314
+ /* fix: expanded GlobalData to include all properties used in cryptoService.ts */
315
+ export interface GlobalData {
316
+ active_cryptocurrencies: number;
317
+ upcoming_icos: number;
318
+ ongoing_icos: number;
319
+ ended_icos: number;
320
+ markets: number;
321
+ total_market_cap: { [key: string]: number };
322
+ total_volume: { [key: string]: number };
323
+ market_cap_percentage: { [key: string]: number };
324
+ market_cap_change_percentage_24h_usd: number;
325
+ updated_at: number;
326
+ }
327
+
328
+ export interface AITradingBot {
329
+ id: string;
330
+ name: string;
331
+ strategy: string;
332
+ status: 'active' | 'paused' | 'error';
333
+ pnl: number;
334
+ uptime: string;
335
+ }
336
+
337
+ export interface GeneratedNFT {
338
+ name: string;
339
+ description: string;
340
+ imageUrl: string;
341
+ traits: Array<{ trait_type: string; value: string | number }>;
342
+ }
343
+
344
+ // --- System & Connectivity ---
345
+ export interface Connection {
346
+ id: string;
347
+ vendorCustomerId: string;
348
+ entity: string;
349
+ status: 'CONNECTED' | 'DISCONNECTED' | 'ERROR';
350
+ lastSyncedAt: string;
351
+ }
352
+
353
+ export interface Document {
354
+ id: string;
355
+ documentableId: string;
356
+ documentableType: string;
357
+ documentType: string;
358
+ fileName: string;
359
+ size: number;
360
+ createdAt: string;
361
+ format: string;
362
+ }
363
+
364
+ export interface AccountCollectionFlow {
365
+ id: string;
366
+ object: string;
367
+ live_mode: boolean;
368
+ created_at: string;
369
+ updated_at: string;
370
+ client_token: string;
371
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
372
+ counterparty_id: string;
373
+ external_account_id: string | null;
374
+ payment_types: string[];
375
+ }
376
+
377
+ export interface PaymentFlow {
378
+ id: string;
379
+ object: string;
380
+ live_mode: boolean;
381
+ created_at: string;
382
+ updated_at: string;
383
+ client_token: string;
384
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
385
+ amount: number;
386
+ currency: string;
387
+ direction: 'debit';
388
+ counterparty_id: string | null;
389
+ receiving_account_id: string | null;
390
+ originating_account_id: string | null;
391
+ }
types/models.ts ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ export interface CurrencyBasedValue {
3
+ alternateAmount?: number;
4
+ baseAmount?: number;
5
+ }
6
+
7
+ export interface CurrencyCurrentValue {
8
+ alternateAmountValue?: string[];
9
+ baseAmountValue?: string[];
10
+ }
11
+
12
+ export interface Balances {
13
+ marketValue?: { currencyBasedValue: CurrencyBasedValue };
14
+ currentValue?: { currencyCurrentValue: CurrencyCurrentValue };
15
+ availableBalance?: { currencyBasedValue: CurrencyBasedValue };
16
+ accruedInterest?: { currencyBasedValue: CurrencyBasedValue };
17
+ unrealisedGainLoss?: { currencyBasedValue: CurrencyBasedValue };
18
+ totalBasis?: { currencyBasedValue: CurrencyBasedValue };
19
+ yearToDateIncome?: { currencyBasedValue: CurrencyBasedValue };
20
+ ytdRealizedGainLoss?: { currencyBasedValue: CurrencyBasedValue };
21
+ estimatedAnnualIncome?: { currencyBasedValue: CurrencyBasedValue };
22
+ }
23
+
24
+ export interface BasicAccountDetails {
25
+ displayAccountNumber: string;
26
+ accountId: string;
27
+ accountOpenDate: string;
28
+ relationshipId: string;
29
+ accountType: string;
30
+ accountAlternateCurrencyCode: string;
31
+ accountBaseCurrencyCode: string;
32
+ productCode: string;
33
+ subProductCode: string;
34
+ accountName: string;
35
+ accountNickname: string;
36
+ accountDescription: string;
37
+ accountStatus: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
38
+ accountGroupId: string;
39
+ accountGroupTitle: string;
40
+ accountGroupStatus: string;
41
+ balances: Balances;
42
+ }
43
+
44
+ // --- Citi OpenAPI v2.0.0 Interfaces ---
45
+
46
+ export type AccountGroup = 'CHECKING' | 'SAVINGS' | 'CREDITCARD' | 'LOAN' | 'LINEOFCREDIT' | 'BROKERAGE' | 'RETIREMENT';
47
+
48
+ export interface GroupBalance {
49
+ localCurrencyCode: string;
50
+ localCurrencyBalanceAmount: number;
51
+ }
52
+
53
+ export interface CheckingAccountDetails {
54
+ productName: string;
55
+ accountNickname?: string;
56
+ accountDescription: string;
57
+ balanceType: 'ASSET' | 'LIABILITY';
58
+ displayAccountNumber: string;
59
+ accountId: string;
60
+ currencyCode: string;
61
+ accountStatus: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
62
+ currentBalance: number;
63
+ availableBalance: number;
64
+ }
65
+
66
+ export interface CreditCardAccountDetails {
67
+ productName: string;
68
+ accountDescription: string;
69
+ balanceType: 'ASSET' | 'LIABILITY';
70
+ displayAccountNumber: string;
71
+ accountId: string;
72
+ currencyCode: string;
73
+ accountStatus: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
74
+ availableCredit?: number;
75
+ creditLimit?: number;
76
+ currentBalance: number;
77
+ }
78
+
79
+ export interface AccountGroupDetails {
80
+ accountGroup: AccountGroup;
81
+ checkingAccountsDetails?: CheckingAccountDetails[];
82
+ savingsAccountsDetails?: CheckingAccountDetails[];
83
+ creditCardAccountsDetails?: CreditCardAccountDetails[];
84
+ totalCurrentBalance?: GroupBalance;
85
+ totalAvailableBalance?: GroupBalance;
86
+ }
87
+
88
+ export interface CitiCustomer {
89
+ customerId: string;
90
+ }
91
+
92
+ export interface AccountsGroupDetailsList {
93
+ accountGroupDetails: AccountGroupDetails[];
94
+ customer?: CitiCustomer;
95
+ }
96
+
97
+ export interface CitiTransaction {
98
+ accountId: string;
99
+ currencyCode: string;
100
+ transactionAmount: number;
101
+ transactionDate: string;
102
+ transactionDescription: string;
103
+ transactionId: string;
104
+ transactionStatus: string;
105
+ transactionType: string;
106
+ displayAccountNumber: string;
107
+ }
108
+
109
+ export interface GetAccountTransactionsResp {
110
+ checkingAccountTransactions?: CitiTransaction[];
111
+ savingsAccountTransactions?: CitiTransaction[];
112
+ creditCardAccountTransactions?: CitiTransaction[];
113
+ loanAccountTransactions?: CitiTransaction[];
114
+ lineOfCreditAccountTransactions?: CitiTransaction[];
115
+ brokerageAccountTransactions?: CitiTransaction[];
116
+ }
117
+
118
+ // --- End Citi Interfaces ---
119
+
120
+ export interface AccountSummary {
121
+ accountGroup: string;
122
+ checking?: BasicAccountDetails[];
123
+ savings?: BasicAccountDetails[];
124
+ deposits?: BasicAccountDetails[];
125
+ securitydeposits?: BasicAccountDetails[];
126
+ timedeposits?: BasicAccountDetails[];
127
+ investments?: BasicAccountDetails[];
128
+ trust?: BasicAccountDetails[];
129
+ custody?: BasicAccountDetails[];
130
+ creditcards?: BasicAccountDetails[];
131
+ loans?: BasicAccountDetails[];
132
+ escrow?: BasicAccountDetails[];
133
+ }
134
+
135
+ export interface TransactionList {
136
+ transactionDateTime: string;
137
+ transactionId: string;
138
+ transactionReferenceNumber: string;
139
+ transactionStatus: string;
140
+ transactionType: string;
141
+ transactionDescription: string;
142
+ alternateCurrencyTransactionAmount: number;
143
+ baseCurrencyTransactionAmount: number;
144
+ transactionQuantity: number;
145
+ alternateCurrencyCode: string;
146
+ baseCurrencyCode: string;
147
+ cusipNumber?: string;
148
+ tickerSymbol?: string;
149
+ assetClass?: string;
150
+ }
151
+
152
+ export interface RetrieveAccountSummaryResponse {
153
+ accountSummary: AccountSummary[];
154
+ }
155
+
156
+ export interface RetrieveTransactionDetailsResponse {
157
+ transactionlist: TransactionList[];
158
+ accountId: string;
159
+ accountName: string;
160
+ accountType: string;
161
+ displayAccountNumber: string;
162
+ }
163
+
164
+ export interface SimulationResult {
165
+ outcomeNarrative: string;
166
+ projectedValue: number;
167
+ confidenceScore: number;
168
+ status: string;
169
+ simulationId: string;
170
+ keyRisks?: string[];
171
+ }
172
+
173
+ export interface Connection {
174
+ id: string;
175
+ vendorCustomerId: string;
176
+ entity: string;
177
+ status: 'CONNECTED' | 'DISCONNECTED' | 'ERROR';
178
+ lastSyncedAt: string;
179
+ }
180
+
181
+ export interface CustomerProfileResponse {
182
+ customer: {
183
+ firstName: string;
184
+ lastName: string;
185
+ middleName?: string;
186
+ title?: string;
187
+ suffix?: string;
188
+ companyName?: string;
189
+ };
190
+ contacts: {
191
+ emails: string[];
192
+ addresses: Array<{
193
+ addressLine1: string;
194
+ city: string;
195
+ region: string;
196
+ postalCode: string;
197
+ country: string;
198
+ type: string;
199
+ }>;
200
+ phones: Array<{
201
+ type: string;
202
+ country: string;
203
+ number: string;
204
+ }>;
205
+ };
206
+ }
207
+
208
+ export interface ClientRegisterRequest {
209
+ client_name: string;
210
+ redirect_uris: string[];
211
+ scope: string[];
212
+ appId?: string;
213
+ description?: string;
214
+ }
215
+
216
+ export interface ClientRegisterResponse extends ClientRegisterRequest {
217
+ client_id: string;
218
+ client_secret: string;
219
+ clientDisplayName?: string;
220
+ grant_types?: string[];
221
+ token_endpoint_auth_method?: string;
222
+ }
223
+
224
+ export interface VirtualAccount {
225
+ id: string;
226
+ object: string;
227
+ live_mode: boolean;
228
+ created_at: string;
229
+ updated_at: string;
230
+ name: string;
231
+ description: string | null;
232
+ counterparty_id: string | null;
233
+ internal_account_id: string;
234
+ account_details: any[];
235
+ routing_details: any[];
236
+ status?: 'ACTIVE' | 'PENDING' | 'CLOSED';
237
+ }
238
+
239
+ export interface AccountCollectionFlow {
240
+ id: string;
241
+ object: string;
242
+ live_mode: boolean;
243
+ created_at: string;
244
+ updated_at: string;
245
+ client_token: string;
246
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
247
+ counterparty_id: string;
248
+ external_account_id: string | null;
249
+ payment_types: string[];
250
+ }
251
+
252
+ export interface PaymentFlow {
253
+ id: string;
254
+ object: string;
255
+ live_mode: boolean;
256
+ created_at: string;
257
+ updated_at: string;
258
+ client_token: string;
259
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
260
+ amount: number;
261
+ currency: string;
262
+ direction: 'debit';
263
+ counterparty_id: string | null;
264
+ receiving_account_id: string | null;
265
+ originating_account_id: string | null;
266
+ }
267
+
268
+ export interface AITradingBot {
269
+ id: string;
270
+ name: string;
271
+ strategy: string;
272
+ status: 'active' | 'paused' | 'error';
273
+ pnl: number;
274
+ uptime: string;
275
+ }
276
+
277
+ export interface AIInsight {
278
+ id: string;
279
+ type: string;
280
+ message: string;
281
+ confidence: number;
282
+ timestamp: string;
283
+ actionable: boolean;
284
+ }
285
+
286
+ export interface Payee {
287
+ payeeId: string;
288
+ displayName: string;
289
+ merchantName: string;
290
+ status: string;
291
+ address?: {
292
+ line1: string;
293
+ city: string;
294
+ region: string;
295
+ postalCode: string;
296
+ };
297
+ }
298
+
299
+ export interface Payment {
300
+ paymentId: string;
301
+ amount: number;
302
+ status: string;
303
+ dueDate: string;
304
+ toPayeeId: string;
305
+ fromAccountId: string;
306
+ }
307
+
308
+ export interface Document {
309
+ id: string;
310
+ documentableId: string;
311
+ documentableType: string;
312
+ documentType: string;
313
+ fileName: string;
314
+ size: number;
315
+ createdAt: string;
316
+ format: string;
317
+ }
318
+
319
+ export interface LineItem {
320
+ id: string;
321
+ amount: number;
322
+ currency: string;
323
+ description: string;
324
+ ledger_account_id: string;
325
+ itemizable_id?: string;
326
+ itemizable_type?: string;
327
+ createdAt: string;
328
+ }
329
+
330
+ export interface LineItemUpdateRequest {
331
+ description?: string;
332
+ metadata?: Record<string, any>;
333
+ }
334
+
335
+ export interface InternalAccount {
336
+ id: string;
337
+ productName: string;
338
+ accountName?: string;
339
+ accountNickname?: string;
340
+ displayAccountNumber: string;
341
+ currency: string;
342
+ status: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
343
+ currentBalance: number;
344
+ availableBalance: number;
345
+ institutionName: string;
346
+ connectionId: string;
347
+ }
348
+
349
+ export interface Counterparty {
350
+ id: string;
351
+ name: string;
352
+ email: string;
353
+ status: 'ACTIVE' | 'PENDING' | 'INACTIVE';
354
+ createdAt: string;
355
+ metadata?: Record<string, any>;
356
+ accounts?: Array<{
357
+ id: string;
358
+ accountType: string;
359
+ accountNumber: string;
360
+ }>;
361
+ }
362
+
363
+ export interface GlobalData {
364
+ active_cryptocurrencies: number;
365
+ upcoming_icos: number;
366
+ ongoing_icos: number;
367
+ ended_icos: number;
368
+ markets: number;
369
+ total_market_cap: { [key: string]: number };
370
+ total_volume: { [key: string]: number };
371
+ market_cap_percentage: { [key: string]: number };
372
+ market_cap_change_percentage_24h_usd: number;
373
+ updated_at: number;
374
+ }
375
+
376
+ export interface TrendingCoin {
377
+ item: {
378
+ id: string;
379
+ coin_id: number;
380
+ name: string;
381
+ symbol: string;
382
+ market_cap_rank: number;
383
+ thumb: string;
384
+ small: string;
385
+ large: string;
386
+ slug: string;
387
+ price_btc: number;
388
+ score: number;
389
+ data: {
390
+ price: number;
391
+ price_btc: string;
392
+ price_change_percentage_24h: { [key: string]: number };
393
+ market_cap: string;
394
+ total_volume: string;
395
+ sparkline: string;
396
+ };
397
+ };
398
+ }
399
+
400
+ export interface SearchResult {
401
+ coins: Array<{
402
+ id: string;
403
+ name: string;
404
+ api_symbol: string;
405
+ symbol: string;
406
+ market_cap_rank: number;
407
+ thumb: string;
408
+ large: string;
409
+ }>;
410
+ exchanges: any[];
411
+ nfts: any[];
412
+ categories: any[];
413
+ }
414
+
415
+ export interface CoinMarketData {
416
+ id: string;
417
+ symbol: string;
418
+ name: string;
419
+ image: string;
420
+ current_price: number;
421
+ market_cap: number;
422
+ market_cap_rank: number;
423
+ fully_diluted_valuation: number | null;
424
+ total_volume: number;
425
+ high_24h: number;
426
+ low_24h: number;
427
+ price_change_24h: number;
428
+ price_change_percentage_24h: number;
429
+ market_cap_change_24h: number;
430
+ market_cap_change_percentage_24h: number;
431
+ circulating_supply: number;
432
+ total_supply: number | null;
433
+ max_supply: number | null;
434
+ ath: number;
435
+ ath_change_percentage: number;
436
+ ath_date: string;
437
+ atl: number;
438
+ atl_change_percentage: number;
439
+ atl_date: string;
440
+ roi: any | null;
441
+ last_updated: string;
442
+ sparkline_in_7d?: {
443
+ price: number[];
444
+ };
445
+ }
446
+
447
+ export interface CoinDetail extends CoinMarketData {
448
+ description: { [key: string]: string };
449
+ links: {
450
+ homepage: string[];
451
+ blockchain_site: string[];
452
+ official_forum_url: string[];
453
+ chat_url: string[];
454
+ announcement_url: string[];
455
+ twitter_screen_name: string;
456
+ facebook_username: string;
457
+ bitcointalk_thread_identifier: any;
458
+ telegram_channel_identifier: string;
459
+ subreddit_url: string;
460
+ repos_url: {
461
+ github: string[];
462
+ bitbucket: any[];
463
+ };
464
+ };
465
+ genesis_date: string | null;
466
+ sentiment_votes_up_percentage: number;
467
+ sentiment_votes_down_percentage: number;
468
+ }
469
+
470
+ export interface HFTOrder {
471
+ id: string;
472
+ pair: string;
473
+ type: 'LIMIT' | 'MARKET';
474
+ side: 'BUY' | 'SELL';
475
+ price: number;
476
+ amount: number;
477
+ status: 'OPEN' | 'FILLED' | 'CANCELLED';
478
+ timestamp: string;
479
+ }
480
+
481
+ export interface GovernanceProposal {
482
+ id: string;
483
+ protocol: string;
484
+ protocolIcon: string;
485
+ title: string;
486
+ status: 'active' | 'passed' | 'failed';
487
+ userVote?: 'for' | 'against' | 'abstain';
488
+ }
types/models.tsx ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ export interface GlobalData {
3
+ active_cryptocurrencies: number;
4
+ upcoming_icos: number;
5
+ ongoing_icos: number;
6
+ ended_icos: number;
7
+ markets: number;
8
+ total_market_cap: { [key: string]: number };
9
+ total_volume: { [key: string]: number };
10
+ market_cap_percentage: { [key: string]: number };
11
+ market_cap_change_percentage_24h_usd: number;
12
+ updated_at: number;
13
+ }
14
+
15
+ export interface TrendingCoin {
16
+ item: {
17
+ id: string;
18
+ coin_id: number;
19
+ name: string;
20
+ symbol: string;
21
+ market_cap_rank: number;
22
+ thumb: string;
23
+ small: string;
24
+ large: string;
25
+ slug: string;
26
+ price_btc: number;
27
+ score: number;
28
+ data: {
29
+ price: number;
30
+ price_btc: string;
31
+ price_change_percentage_24h: { [key: string]: number };
32
+ market_cap: string;
33
+ total_volume: string;
34
+ sparkline: string;
35
+ };
36
+ };
37
+ }
38
+
39
+ export interface SearchResult {
40
+ coins: Array<{
41
+ id: string;
42
+ name: string;
43
+ api_symbol: string;
44
+ symbol: string;
45
+ market_cap_rank: number;
46
+ thumb: string;
47
+ large: string;
48
+ }>;
49
+ exchanges: any[];
50
+ nfts: any[];
51
+ categories: any[];
52
+ }
53
+
54
+ export interface CoinMarketData {
55
+ id: string;
56
+ symbol: string;
57
+ name: string;
58
+ image: string;
59
+ current_price: number;
60
+ market_cap: number;
61
+ market_cap_rank: number;
62
+ fully_diluted_valuation: number | null;
63
+ total_volume: number;
64
+ high_24h: number;
65
+ low_24h: number;
66
+ price_change_24h: number;
67
+ price_change_percentage_24h: number;
68
+ market_cap_change_24h: number;
69
+ market_cap_change_percentage_24h: number;
70
+ circulating_supply: number;
71
+ total_supply: number | null;
72
+ max_supply: number | null;
73
+ ath: number;
74
+ ath_change_percentage: number;
75
+ ath_date: string;
76
+ atl: number;
77
+ atl_change_percentage: number;
78
+ atl_date: string;
79
+ roi: any | null;
80
+ last_updated: string;
81
+ sparkline_in_7d?: {
82
+ price: number[];
83
+ };
84
+ }
85
+
86
+ export interface CoinDetail extends CoinMarketData {
87
+ description: { [key: string]: string };
88
+ links: {
89
+ homepage: string[];
90
+ blockchain_site: string[];
91
+ official_forum_url: string[];
92
+ chat_url: string[];
93
+ announcement_url: string[];
94
+ twitter_screen_name: string;
95
+ facebook_username: string;
96
+ bitcointalk_thread_identifier: any;
97
+ telegram_channel_identifier: string;
98
+ subreddit_url: string;
99
+ repos_url: {
100
+ github: string[];
101
+ bitbucket: any[];
102
+ };
103
+ };
104
+ genesis_date: string | null;
105
+ sentiment_votes_up_percentage: number;
106
+ sentiment_votes_down_percentage: number;
107
+ }
108
+
109
+ export interface InternalAccount {
110
+ id: string;
111
+ productName: string;
112
+ displayAccountNumber: string;
113
+ currency: string;
114
+ status: 'ACTIVE' | 'INACTIVE' | 'CLOSED';
115
+ currentBalance: number;
116
+ availableBalance: number;
117
+ institutionName: string;
118
+ connectionId: string;
119
+ }
120
+
121
+ export interface Counterparty {
122
+ id: string;
123
+ name: string;
124
+ email: string;
125
+ status: 'ACTIVE' | 'PENDING' | 'INACTIVE';
126
+ createdAt: string;
127
+ metadata?: Record<string, any>;
128
+ accounts?: Array<{
129
+ id: string;
130
+ accountType: string;
131
+ accountNumber: string;
132
+ }>;
133
+ }
134
+
135
+ export interface VirtualAccount {
136
+ id: string;
137
+ object: string;
138
+ live_mode: boolean;
139
+ created_at: string;
140
+ updated_at: string;
141
+ name: string;
142
+ description: string | null;
143
+ counterparty_id: string | null;
144
+ internal_account_id: string;
145
+ account_details: any[];
146
+ routing_details: any[];
147
+ status?: 'ACTIVE' | 'PENDING' | 'CLOSED';
148
+ }
149
+
150
+ export interface AccountCollectionFlow {
151
+ id: string;
152
+ object: string;
153
+ live_mode: boolean;
154
+ created_at: string;
155
+ updated_at: string;
156
+ client_token: string;
157
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
158
+ counterparty_id: string;
159
+ external_account_id: string | null;
160
+ payment_types: string[];
161
+ }
162
+
163
+ export interface PaymentFlow {
164
+ id: string;
165
+ object: string;
166
+ live_mode: boolean;
167
+ created_at: string;
168
+ updated_at: string;
169
+ client_token: string;
170
+ status: 'pending' | 'completed' | 'expired' | 'cancelled';
171
+ amount: number;
172
+ currency: string;
173
+ direction: 'debit';
174
+ counterparty_id: string | null;
175
+ receiving_account_id: string | null;
176
+ originating_account_id: string | null;
177
+ }
178
+
179
+ // --- FDX v6 Customer Profile Types ---
180
+ export interface CustomerAddress {
181
+ addressLine1: string;
182
+ addressLine2?: string;
183
+ addressLine3?: string;
184
+ city: string;
185
+ region: string;
186
+ postalCode: string;
187
+ country: string;
188
+ type: 'BUSINESS' | 'DELIVERY' | 'HOME' | 'MAILING';
189
+ }
190
+
191
+ export interface TelephoneNumber {
192
+ type: 'BUSINESS' | 'CELL' | 'FAX' | 'HOME';
193
+ country: string;
194
+ number: string;
195
+ }
196
+
197
+ export interface ContactsResponse {
198
+ emails: string[];
199
+ addresses: CustomerAddress[];
200
+ phones: TelephoneNumber[];
201
+ }
202
+
203
+ export interface Customer {
204
+ firstName: string;
205
+ lastName: string;
206
+ middleName?: string;
207
+ title?: string;
208
+ suffix?: string;
209
+ companyName?: string;
210
+ }
211
+
212
+ export interface CustomerProfileResponse {
213
+ customer: Customer;
214
+ contacts: ContactsResponse;
215
+ }
216
+
217
+ // --- Terminal Specific Types ---
218
+ export interface HFTOrder {
219
+ id: string;
220
+ pair: string;
221
+ type: 'LIMIT' | 'MARKET';
222
+ side: 'BUY' | 'SELL';
223
+ price: number;
224
+ amount: number;
225
+ status: 'OPEN' | 'FILLED' | 'CANCELLED';
226
+ timestamp: string;
227
+ }
228
+
229
+ export interface AITradingBot {
230
+ id: string;
231
+ name: string;
232
+ strategy: 'Arbitrage' | 'Momentum' | 'Mean Reversion';
233
+ status: 'active' | 'paused' | 'error';
234
+ pnl: number;
235
+ uptime: string;
236
+ }
237
+
238
+ export interface GovernanceProposal {
239
+ id: string;
240
+ protocol: string;
241
+ protocolIcon: string;
242
+ title: string;
243
+ status: 'active' | 'passed' | 'failed';
244
+ userVote?: 'for' | 'against' | 'abstain';
245
+ }
246
+
247
+ export interface AIInsight {
248
+ id: string;
249
+ type: 'opportunity' | 'warning' | 'neutral' | 'alpha';
250
+ message: string;
251
+ confidence: number;
252
+ timestamp: string;
253
+ actionable: boolean;
254
+ }