@global-torque/domain-types 0.2.2

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,49 @@
1
+ import type {
2
+ IInvestment,
3
+ IInvestmentDocuments,
4
+ } from './investmentTypes.ts';
5
+
6
+ export interface IDistributionsData {
7
+ id: number;
8
+ amount: number;
9
+ total_amount: number;
10
+ status: string;
11
+ investment_id: number;
12
+ profile_id: number;
13
+ updated_at: string;
14
+ investment: IInvestment;
15
+ documents?: IInvestmentDocuments[];
16
+ created_at: string;
17
+ }
18
+
19
+ export interface IDistributionsMeta {
20
+ geografic_data: number[];
21
+ geografic_labels: string[];
22
+ performance_data: number[];
23
+ performance_labels: number[] | string[];
24
+ }
25
+
26
+ export interface IDistributionFormatted extends IDistributionsData {
27
+ amountFormatted: string;
28
+ amountFormattedZero: string;
29
+ totalAmountFormatted: string;
30
+ totalAmountFormattedZero: string;
31
+ createdAtFormatted: string;
32
+ createdAtTime: string;
33
+ updatedAtFormatted: string;
34
+ updatedAtTime: string;
35
+ statusFormatted: {
36
+ text: string;
37
+ tooltip?: string;
38
+ color: string;
39
+ };
40
+ isActive: boolean;
41
+ isCompleted: boolean;
42
+ isPending: boolean;
43
+ }
44
+
45
+ export interface IDistributions {
46
+ meta: IDistributionsMeta;
47
+ count: number;
48
+ data: IDistributionFormatted[];
49
+ }
@@ -0,0 +1,11 @@
1
+ export interface ISignature {
2
+ [key: string | number]: string;
3
+ }
4
+
5
+ export interface IInvestDocumentSign {
6
+ sign_url?: string;
7
+ expires_at?: number;
8
+ signing_redirect_url?: string;
9
+ test_mode?: boolean;
10
+ entity_id?: string;
11
+ }
@@ -0,0 +1,525 @@
1
+ export const EvmWalletStatusTypes = {
2
+ created: 'created',
3
+ verified: 'verified',
4
+ error: 'error',
5
+ error_retry: 'error_retry',
6
+ error_document: 'error_document',
7
+ error_pending: 'error_pending',
8
+ error_suspended: 'error_suspended',
9
+ } as const;
10
+
11
+ export type EvmWalletStatusTypes = typeof EvmWalletStatusTypes[keyof typeof EvmWalletStatusTypes];
12
+
13
+ export const EvmTransactionStatusTypes = {
14
+ created: 'created',
15
+ submitted: 'submitted',
16
+ confirmed: 'confirmed',
17
+ processed: 'processed',
18
+ pending: 'pending',
19
+ failed: 'failed',
20
+ cancelled: 'cancelled',
21
+ wait: 'wait',
22
+ } as const;
23
+
24
+ export type EvmTransactionStatusTypes =
25
+ typeof EvmTransactionStatusTypes[keyof typeof EvmTransactionStatusTypes];
26
+
27
+ export const EvmTransactionTypes = {
28
+ withdrawal: 'withdrawal',
29
+ deposit: 'deposit',
30
+ investment: 'investment',
31
+ contract_call: 'contract_call',
32
+ exchange: 'exchange',
33
+ } as const;
34
+
35
+ export type EvmTransactionTypes = typeof EvmTransactionTypes[keyof typeof EvmTransactionTypes];
36
+
37
+ export const EvmWalletTransactionRowKinds = {
38
+ effect: 'effect',
39
+ pending_parent: 'pending_parent',
40
+ finalized_parent: 'finalized_parent',
41
+ } as const;
42
+
43
+ export type EvmWalletTransactionRowKind =
44
+ typeof EvmWalletTransactionRowKinds[keyof typeof EvmWalletTransactionRowKinds];
45
+
46
+ export const EvmWalletEffectKinds = {
47
+ native: 'native',
48
+ erc20_transfer: 'erc20_transfer',
49
+ contract_event: 'contract_event',
50
+ } as const;
51
+
52
+ export type EvmWalletEffectKind =
53
+ typeof EvmWalletEffectKinds[keyof typeof EvmWalletEffectKinds];
54
+
55
+ export type EvmViewedWalletDirection = 'deposit' | 'withdrawal';
56
+
57
+ export type EvmWalletLogicalAction =
58
+ | 'approve'
59
+ | 'transfer'
60
+ | 'request_deposit'
61
+ | 'request_redeem'
62
+ | 'fulfill_deposit'
63
+ | 'fulfill_redeem'
64
+ | 'claim_deposit'
65
+ | 'claim_redeem'
66
+ | 'drawdown_strategy_assets'
67
+ | 'return_strategy_assets'
68
+ | 'report_strategy_assets';
69
+
70
+ export type IEvmWalletBalancesMap = Record<string, {
71
+ id?: number | string;
72
+ offer_id?: number;
73
+ address: string;
74
+ amount: number | string;
75
+ balance?: number | string;
76
+ symbol: string;
77
+ asset?: string;
78
+ name?: string;
79
+ icon?: string;
80
+ price_per_usd?: number | string;
81
+ price_per_usd_raw?: string;
82
+ amount_usd?: number | string;
83
+ chain?: string;
84
+ token_decimals?: number;
85
+ token_standard?: string;
86
+ is_native?: boolean;
87
+ balance_type?: 'rwa_asset' | 'tradable_crypto';
88
+ exchange_eligible?: boolean;
89
+ exchange_ineligible_reason?: string;
90
+ }>;
91
+
92
+ export type IEvmWalletBalancesInput = IEvmWalletBalancesMap | IEvmWalletBalances[];
93
+
94
+ export type IEvmWalletDataForFormatter = Omit<IEvmWalletDataResponse, 'balances'> & {
95
+ balances?: IEvmWalletBalancesInput;
96
+ };
97
+
98
+ export interface IEvmWalletBalances {
99
+ id?: number;
100
+ asset?: string;
101
+ address: string;
102
+ amount: number;
103
+ symbol: string;
104
+ name?: string;
105
+ icon?: string;
106
+ price_per_usd?: number | string;
107
+ price_per_usd_raw?: string;
108
+ amount_usd?: number;
109
+ chain?: string;
110
+ token_decimals?: number;
111
+ token_standard?: string;
112
+ is_native?: boolean;
113
+ balance_type?: 'rwa_asset' | 'tradable_crypto';
114
+ exchange_eligible?: boolean;
115
+ exchange_ineligible_reason?: string;
116
+ offer_id?: number;
117
+ vault_contract_id?: number;
118
+ tokenValue?: string;
119
+ }
120
+
121
+ export interface IEvmWalletChainAccount {
122
+ chain: string;
123
+ wallet_address: string;
124
+ chain_account_status?: string;
125
+ exchange_payout_token_address?: string;
126
+ exchange_payout_token_symbol?: string;
127
+ }
128
+
129
+ export interface IEvmWalletDepositInstructions {
130
+ chain?: string;
131
+ address?: string;
132
+ }
133
+
134
+ export interface IEvmWalletBalanceSummaryResponse {
135
+ amount_usd?: number | string;
136
+ token_count?: number | string;
137
+ }
138
+
139
+ export interface IEvmWalletDataResponse {
140
+ id: number;
141
+ status: EvmWalletStatusTypes;
142
+ provider_name?: string;
143
+ turnkey_org_id?: string;
144
+ turnkey_sub_org_id?: string;
145
+ turnkey_user_id?: string;
146
+ turnkey_wallet_id?: string;
147
+ turnkey_account_id?: string;
148
+ balance: string;
149
+ inc_balance: number;
150
+ out_balance: number;
151
+ address: string;
152
+ chain?: string;
153
+ exchange_payout_token_address?: string;
154
+ exchange_payout_token_symbol?: string;
155
+ deposit_instructions?: IEvmWalletDepositInstructions;
156
+ chains?: IEvmWalletChainAccount[];
157
+ balances: IEvmWalletBalancesMap;
158
+ tradable_crypto_balance?: IEvmWalletBalanceSummaryResponse;
159
+ rwa_asset_balance?: IEvmWalletBalanceSummaryResponse;
160
+ transactions: IEvmTransactionDataResponse[];
161
+ created_at: string;
162
+ updated_at: string;
163
+ }
164
+
165
+ export interface IEvmWalletDataFormatted extends Omit<IEvmWalletDataResponse, 'balances'> {
166
+ balances: IEvmWalletBalances[];
167
+ isStatusCreated: boolean;
168
+ isStatusVerified: boolean;
169
+ isStatusError: boolean;
170
+ isStatusErrorRetry: boolean;
171
+ isStatusErrorDocument: boolean;
172
+ isStatusErrorPending: boolean;
173
+ isStatusErrorSuspended: boolean;
174
+ isStatusAnyError: boolean;
175
+ currentBalance: number;
176
+ totalBalance: number;
177
+ fundingBalance: number;
178
+ rwaValue: number;
179
+ pendingIncomingBalance: number;
180
+ pendingOutcomingBalance: number;
181
+ cryptoChangeFormatted?: string;
182
+ rwaChangeFormatted?: string;
183
+ formattedTransactions: IEvmTransactionDataFormatted[];
184
+ }
185
+
186
+ export interface IEvmWalletAmount {
187
+ value: string;
188
+ currency: string;
189
+ }
190
+
191
+ export interface IEvmTransactionDataResponse {
192
+ id: number;
193
+ effect_id?: string;
194
+ effect_kind?: EvmWalletEffectKind;
195
+ effect_index?: number;
196
+ row_kind?: EvmWalletTransactionRowKind;
197
+ user_id: number;
198
+ dest_wallet_id: number | null;
199
+ source_wallet_id: number | null;
200
+ investment_id: number | null;
201
+ investment_redemption_id?: number | null;
202
+ type: EvmTransactionTypes;
203
+ amount_raw?: string;
204
+ amount: string;
205
+ ticker?: string;
206
+ symbol?: string;
207
+ name?: string;
208
+ icon?: string;
209
+ image_link_id?: number | string;
210
+ network: string;
211
+ status: EvmTransactionStatusTypes;
212
+ submission_status?: string;
213
+ source?: string;
214
+ transaction_tx: string;
215
+ scan_tx_url?: string;
216
+ created_at: string;
217
+ updated_at: string;
218
+ address?: string;
219
+ destination_address?: string;
220
+ direction?: EvmViewedWalletDirection | null;
221
+ contract_function_selector?: string;
222
+ logical_action?: EvmWalletLogicalAction;
223
+ token_address?: string;
224
+ token_decimals?: number;
225
+ block_number?: number;
226
+ block_timestamp?: string;
227
+ confirmation_count?: number;
228
+ confirmation_target?: number;
229
+ failure_code?: string;
230
+ type_display?: string;
231
+ description?: string;
232
+ }
233
+
234
+ export interface IEvmWalletTransactionsApiItem {
235
+ id?: number | string;
236
+ operation_id?: number | string | null;
237
+ effect_id?: number | string | null;
238
+ effect_kind?: string | null;
239
+ effect_index?: number | string | null;
240
+ row_kind?: string | null;
241
+ user_id?: number | string | null;
242
+ dest_wallet_id?: number | string | null;
243
+ source_wallet_id?: number | string | null;
244
+ investment_id?: number | string | null;
245
+ investment_redemption_id?: number | string | null;
246
+ type?: string | null;
247
+ operation_type?: string | null;
248
+ amount_raw?: string | null;
249
+ amount?: number | string | null;
250
+ ticker?: string | null;
251
+ symbol?: string | null;
252
+ token_ticker?: string | null;
253
+ token_symbol?: string | null;
254
+ token_name?: string | null;
255
+ token_logo?: string | null;
256
+ token_address?: string | null;
257
+ name?: string | null;
258
+ icon?: string | null;
259
+ image_link_id?: number | string | null;
260
+ network?: string | null;
261
+ chain?: string | null;
262
+ status?: string | null;
263
+ operation_status?: string | null;
264
+ submission_status?: string | null;
265
+ source?: string | null;
266
+ transaction_tx?: string | null;
267
+ tx_hash?: string | null;
268
+ hash?: string | null;
269
+ scan_tx_url?: string | null;
270
+ created_at?: string | null;
271
+ updated_at?: string | null;
272
+ address?: string | null;
273
+ wallet_address?: string | null;
274
+ counterparty_address?: string | null;
275
+ direction?: string | null;
276
+ contract_function_selector?: string | null;
277
+ logical_action?: string | null;
278
+ token_decimals?: number | string | null;
279
+ block_number?: number | string | null;
280
+ block_timestamp?: string | null;
281
+ confirmation_count?: number | string | null;
282
+ confirmation_target?: number | string | null;
283
+ failure_code?: string | null;
284
+ type_display?: string | null;
285
+ description?: string | null;
286
+ }
287
+
288
+ export type IEvmWalletTransactionsApiResponse =
289
+ | IEvmWalletTransactionsApiItem[]
290
+ | {
291
+ items?: IEvmWalletTransactionsApiItem[] | null;
292
+ transactions?: IEvmWalletTransactionsApiItem[] | null;
293
+ data?: IEvmWalletTransactionsApiItem[] | null;
294
+ };
295
+
296
+ export interface IEvmTransactionDataFormatted extends IEvmTransactionDataResponse {
297
+ isStatusCreated: boolean;
298
+ isStatusSubmitted: boolean;
299
+ isStatusConfirmed: boolean;
300
+ isStatusPending: boolean;
301
+ isStatusProcessed: boolean;
302
+ isStatusFailed: boolean;
303
+ isStatusCancelled: boolean;
304
+ isStatusWait: boolean;
305
+ submitted_at_date: string;
306
+ submitted_at_time: string;
307
+ updated_at_date: string;
308
+ updated_at_time: string;
309
+ statusColor?: string;
310
+ statusText?: string;
311
+ isTypeWithdrawal: boolean;
312
+ isTypeDeposit: boolean;
313
+ isTypeInvestment: boolean;
314
+ isTypeContractCall: boolean;
315
+ isTypeExchange: boolean;
316
+ typeFormatted: string;
317
+ amountFormatted: string;
318
+ networkFormatted: string;
319
+ tagColor?: string;
320
+ txShort: string;
321
+ typeDisplay: string;
322
+ description: string;
323
+ scanTxUrl: string;
324
+ }
325
+
326
+ export interface IEvmWithdrawRequestBody {
327
+ investment_id?: number;
328
+ chain: string;
329
+ asset_address: string;
330
+ amount: string;
331
+ destination_address: string;
332
+ idempotency_key: string;
333
+ authorization_session_id?: string;
334
+ }
335
+
336
+ export type IEvmWalletAuthorizationOperationType = 'withdrawal' | 'exchange' | 'delegation';
337
+
338
+ export type IEvmWalletAuthorizationOptionId =
339
+ | 'withdrawal_transfer'
340
+ | 'exchange_transfer'
341
+ | 'delegation_contract_functions'
342
+ | 'delegation_root';
343
+
344
+ export interface IEvmWalletAuthorizeWithdrawalStartRequestBody {
345
+ authorization_option_id: 'withdrawal_transfer';
346
+ operation_type: 'withdrawal';
347
+ chain: string;
348
+ asset_address: string;
349
+ destination_address: string;
350
+ max_amount: string;
351
+ nonce: string;
352
+ }
353
+
354
+ export interface IEvmWalletAuthorizeExchangeStartRequestBody {
355
+ authorization_option_id: 'exchange_transfer';
356
+ operation_type: 'exchange';
357
+ chain: string;
358
+ asset_address: string;
359
+ to_asset_address: string;
360
+ max_amount: string;
361
+ quote_price_usd: string;
362
+ minimum_payout_amount: string;
363
+ nonce: string;
364
+ }
365
+
366
+ export interface IEvmWalletAuthorizeDelegationStartRequestBody {
367
+ authorization_option_id: 'delegation_contract_functions' | 'delegation_root';
368
+ operation_type: 'delegation';
369
+ chain: string;
370
+ delegation_type: 'contract_functions' | 'root';
371
+ delegation_params: Record<string, unknown>;
372
+ nonce: string;
373
+ }
374
+
375
+ export type IEvmWalletAuthorizeStartRequestBody =
376
+ | IEvmWalletAuthorizeWithdrawalStartRequestBody
377
+ | IEvmWalletAuthorizeExchangeStartRequestBody
378
+ | IEvmWalletAuthorizeDelegationStartRequestBody;
379
+
380
+ export interface IEvmWalletAuthorizeSignatureRequest {
381
+ type: string;
382
+ data: unknown;
383
+ }
384
+
385
+ export interface IEvmWalletAuthorizeTurnkeySmartContractInterface {
386
+ address: string;
387
+ interface: string;
388
+ type: string;
389
+ label: string;
390
+ notes?: string;
391
+ }
392
+
393
+ export interface IEvmWalletAuthorizeStartResponse {
394
+ profile_id: number;
395
+ authorization_option_id?: string;
396
+ operation_type?: IEvmWalletAuthorizationOperationType;
397
+ provider_name?: string;
398
+ wallet_address: string;
399
+ turnkey_org_id?: string;
400
+ turnkey_sub_org_id?: string;
401
+ turnkey_user_id?: string;
402
+ turnkey_wallet_id?: string;
403
+ turnkey_account_id?: string;
404
+ turnkey_delegated_user_id?: string;
405
+ turnkey_policy_name?: string;
406
+ turnkey_policy_id?: string;
407
+ turnkey_policy_effect?: string;
408
+ turnkey_policy_condition?: string;
409
+ turnkey_policy_consensus?: string;
410
+ turnkey_policy_notes?: string;
411
+ turnkey_smart_contract_interfaces?: IEvmWalletAuthorizeTurnkeySmartContractInterface[];
412
+ session_id: string;
413
+ chain: string;
414
+ token_symbol?: string;
415
+ token_address?: string;
416
+ asset?: string;
417
+ asset_address?: string;
418
+ to_asset?: string;
419
+ to_asset_address?: string;
420
+ destination_address?: string;
421
+ delegation_type?: string;
422
+ delegation_params?: Record<string, unknown>;
423
+ max_amount?: string;
424
+ remaining_amount?: string;
425
+ quote_id?: string;
426
+ quote_price_usd?: string;
427
+ minimum_payout_amount?: string;
428
+ issued_at: string;
429
+ expires_at: string;
430
+ signature_request: IEvmWalletAuthorizeSignatureRequest;
431
+ authorization_status: string;
432
+ }
433
+
434
+ export interface IEvmWalletAuthorizeSession {
435
+ profile_id: number;
436
+ authorization_option_id?: string;
437
+ operation_type?: IEvmWalletAuthorizationOperationType;
438
+ provider_name?: string;
439
+ turnkey_policy_id?: string;
440
+ wallet_address: string;
441
+ turnkey_org_id?: string;
442
+ turnkey_sub_org_id?: string;
443
+ turnkey_user_id?: string;
444
+ turnkey_wallet_id?: string;
445
+ turnkey_account_id?: string;
446
+ session_id: string;
447
+ chain: string;
448
+ token_symbol?: string;
449
+ token_address?: string;
450
+ asset?: string;
451
+ asset_address?: string;
452
+ to_asset?: string;
453
+ to_asset_address?: string;
454
+ destination_address?: string;
455
+ delegation_type?: string;
456
+ delegation_params?: Record<string, unknown>;
457
+ max_amount?: string;
458
+ remaining_amount?: string;
459
+ quote_id?: string;
460
+ quote_price_usd?: string;
461
+ minimum_payout_amount?: string;
462
+ issued_at: string;
463
+ expires_at: string;
464
+ signature_request?: IEvmWalletAuthorizeSignatureRequest;
465
+ authorization_status: string;
466
+ }
467
+
468
+ export type IEvmWalletAuthorizeSessionsResponse =
469
+ | IEvmWalletAuthorizeSession[]
470
+ | {
471
+ items?: IEvmWalletAuthorizeSession[] | null;
472
+ sessions?: IEvmWalletAuthorizeSession[] | null;
473
+ data?: IEvmWalletAuthorizeSession[] | null;
474
+ };
475
+
476
+ export interface IEvmWalletAuthorizeConfirmRequestBody {
477
+ session_id: string;
478
+ owner_signature: string;
479
+ turnkey_policy_id?: string;
480
+ turnkey_policy_name?: string;
481
+ turnkey_policy_activity_id?: string;
482
+ }
483
+
484
+ export interface IEvmWalletAuthorizeConfirmResponse {
485
+ profile_id: number;
486
+ session_id: string;
487
+ authorization_status: string;
488
+ turnkey_sub_org_id?: string;
489
+ turnkey_policy_id?: string;
490
+ quote_id?: string;
491
+ quote_price_usd?: string;
492
+ minimum_payout_amount?: string;
493
+ }
494
+
495
+ export interface IEvmWithdrawResponse {
496
+ id: number;
497
+ status: string;
498
+ tx_hash?: string;
499
+ external_id?: string;
500
+ }
501
+
502
+ export interface IEvmExchangeRequestBody {
503
+ wallet_id: number;
504
+ amount: string;
505
+ from: string;
506
+ to: string;
507
+ idempotency_key: string;
508
+ authorization_session_id: string;
509
+ quote_id: string;
510
+ quote_price_usd: string;
511
+ minimum_payout_amount: string;
512
+ }
513
+
514
+ export interface IEvmExchangeResponse {
515
+ id: number;
516
+ transaction_id: string;
517
+ }
518
+
519
+ export interface IEvmEarnPositionOverlay {
520
+ profileId: string | number;
521
+ symbol?: string;
522
+ name?: string;
523
+ stakedAmountUsd?: number;
524
+ transactions?: Array<{ id: number; type: string; amountUsd: number; status: string; txId: string }>;
525
+ }
@@ -0,0 +1,60 @@
1
+ export type FilerId = number | string;
2
+
3
+ export type FilerAccess = 'private' | 'public';
4
+
5
+ export interface IFilerItemMetaData {
6
+ big?: string;
7
+ small?: string;
8
+ medium?: string;
9
+ size?: number | string;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ export interface IFilerItem {
14
+ filename?: string;
15
+ original_filename?: string;
16
+ id?: FilerId;
17
+ meta_data?: IFilerItemMetaData;
18
+ mime?: string;
19
+ name?: string;
20
+ 'object-data'?: string;
21
+ 'object-id'?: FilerId;
22
+ 'object-name'?: string;
23
+ 'object-type'?: string;
24
+ bucket_path?: string;
25
+ created_at?: string;
26
+ updated_at?: string;
27
+ url?: string;
28
+ user_id?: FilerId;
29
+ type?: string;
30
+ entities?: Record<string, IFilerItem>;
31
+ [key: string]: unknown;
32
+ }
33
+
34
+ export interface FilerObjectTree {
35
+ entities: Record<string, IFilerItem>;
36
+ }
37
+
38
+ export interface FilerObjectPath {
39
+ objectId: FilerId;
40
+ objectName: string;
41
+ }
42
+
43
+ export interface IPostSignurlResponse {
44
+ url?: string;
45
+ file_id?: FilerId;
46
+ meta?: {
47
+ id?: FilerId;
48
+ };
49
+ }
50
+
51
+ export interface FilerUploadResult {
52
+ fileId: number;
53
+ }
54
+
55
+ export interface FilerNotificationFields {
56
+ type?: string;
57
+ object_id?: FilerId;
58
+ source_file_id?: FilerId;
59
+ [key: string]: unknown;
60
+ }
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './profileTypes.ts';
2
+ export * from './vaultTypes.ts';
3
+ export * from './onboardingTypes.ts';
4
+ export * from './analyticsTypes.ts';
5
+ export * from './dashboardTypes.ts';