@r2wa-org/eden 0.0.57 → 0.0.59

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,143 @@
1
+ import { InternalPortfolioService } from "../internal/service";
2
+ import type { PortfolioAccountTypeOverviewParamsType, PortfolioAssetOverviewParamsType, PortfolioAssetOverviewQueryType, PortfolioLedgerAccountOverviewParamsType, PortfolioLedgerAccountOverviewQueryType, PortfolioOverviewQueryType } from "./dto.schemas";
3
+ export declare abstract class UserPortfolioService extends InternalPortfolioService {
4
+ private static normalizeQuoteAsset;
5
+ static getPortfolioOverview(userId: string, query?: PortfolioOverviewQueryType): Promise<{
6
+ quoteAsset: string;
7
+ overview: {
8
+ totalValuation: string;
9
+ };
10
+ walletView: {
11
+ id: string;
12
+ name: string;
13
+ walletTypeId: string;
14
+ isPrimary: boolean;
15
+ isActive: boolean;
16
+ }[];
17
+ accountTypeView: {
18
+ id: string;
19
+ key: string;
20
+ name: string;
21
+ accountCount: number;
22
+ totalValuation: string;
23
+ }[];
24
+ assetView: {
25
+ id: string;
26
+ code: string;
27
+ name: string;
28
+ iconUrl: string;
29
+ quantity: string;
30
+ totalValuation: string;
31
+ }[];
32
+ }>;
33
+ static getAccountTypeOverview(userId: string, params: PortfolioAccountTypeOverviewParamsType, query?: PortfolioOverviewQueryType): Promise<{
34
+ quoteAsset: string;
35
+ overview: {
36
+ totalValuation: string;
37
+ };
38
+ accountType: {
39
+ id: string;
40
+ key: string;
41
+ name: string;
42
+ };
43
+ accounts: {
44
+ id: string;
45
+ userId: string;
46
+ assetId: string;
47
+ ledgerAccountTypeId: string;
48
+ available: string;
49
+ locked: string;
50
+ status: "active" | "frozen" | "disabled";
51
+ asset: {
52
+ id: string;
53
+ code: string;
54
+ name: string;
55
+ iconUrl: string;
56
+ };
57
+ accountType: {
58
+ id: string;
59
+ key: string;
60
+ name: string;
61
+ };
62
+ quantity: string;
63
+ totalValuation: string;
64
+ }[];
65
+ }>;
66
+ static getAssetOverview(userId: string, params: PortfolioAssetOverviewParamsType, query?: PortfolioAssetOverviewQueryType): Promise<{
67
+ quoteAsset: string;
68
+ asset: {
69
+ id: string;
70
+ code: string;
71
+ name: string;
72
+ iconUrl: string;
73
+ symbol: string;
74
+ precision: number;
75
+ category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
76
+ isActive: boolean;
77
+ };
78
+ quantity: string;
79
+ totalValuation: string;
80
+ curve: {
81
+ at: Date;
82
+ value: string;
83
+ }[];
84
+ accountDistribution: {
85
+ ledgerAccountId: string;
86
+ ledgerAccountTypeId: string;
87
+ ledgerAccountTypeKey: string;
88
+ ledgerAccountTypeName: string;
89
+ quantity: string;
90
+ valuation: string;
91
+ proportion: string;
92
+ }[];
93
+ }>;
94
+ static getLedgerAccountOverview(userId: string, params: PortfolioLedgerAccountOverviewParamsType, query?: PortfolioLedgerAccountOverviewQueryType): Promise<{
95
+ quoteAsset: string;
96
+ overview: {
97
+ totalValuation: string;
98
+ };
99
+ ledgerAccount: {
100
+ id: string;
101
+ createdAt: Date;
102
+ updatedAt: Date;
103
+ userId: string;
104
+ status: "active" | "frozen" | "disabled";
105
+ assetId: string;
106
+ ledgerAccountTypeId: string;
107
+ available: string;
108
+ locked: string;
109
+ version: number;
110
+ ledgerAccountType: {
111
+ id: string;
112
+ name: string;
113
+ createdAt: Date;
114
+ updatedAt: Date;
115
+ description: string | null;
116
+ key: string;
117
+ isActive: boolean;
118
+ allowDeposit: boolean;
119
+ allowWithdraw: boolean;
120
+ minWithdrawAmount: string;
121
+ maxWithdrawAmount: string;
122
+ allowTransfer: boolean;
123
+ minTransferAmount: string;
124
+ maxTransferAmount: string;
125
+ allowInternalTransfer: boolean;
126
+ allowInternalReceiveTransfer: boolean;
127
+ minInternalTransferAmount: string;
128
+ maxInternalTransferAmount: string;
129
+ internalTransferRatio: string;
130
+ allowTransaction: boolean;
131
+ hasExpiry: boolean;
132
+ expiryDays: number | null;
133
+ sortOrder: number;
134
+ };
135
+ };
136
+ ledgerAccountType: {
137
+ id: string;
138
+ key: string;
139
+ name: string;
140
+ description: string | null;
141
+ };
142
+ }>;
143
+ }
@@ -314,27 +314,11 @@ export declare const walletListResponseSchema: import("@sinclair/typebox").TObje
314
314
  }>;
315
315
  }>;
316
316
  export type WalletListResponseType = typeof walletListResponseSchema.static;
317
- export declare const financeOverviewQuerySchema: import("@sinclair/typebox").TObject<{
317
+ export declare const walletOverviewQuerySchema: import("@sinclair/typebox").TObject<{
318
318
  quoteAsset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
319
319
  }>;
320
- export type FinanceOverviewQueryType = typeof financeOverviewQuerySchema.static;
321
- export declare const financeOverviewBaseAssetValueSchema: import("@sinclair/typebox").TObject<{
322
- quantity: import("@sinclair/typebox").TString;
323
- valuation: import("@sinclair/typebox").TString;
324
- }>;
325
- export type FinanceOverviewBaseAssetValueType = typeof financeOverviewBaseAssetValueSchema.static;
326
- export declare const financeOverviewWalletItemSchema: import("@sinclair/typebox").TObject<{
327
- walletId: import("@sinclair/typebox").TString;
328
- walletName: import("@sinclair/typebox").TString;
329
- walletTypeId: import("@sinclair/typebox").TString;
330
- walletTypeKey: import("@sinclair/typebox").TString;
331
- walletTypeName: import("@sinclair/typebox").TString;
332
- isPrimary: import("@sinclair/typebox").TBoolean;
333
- isActive: import("@sinclair/typebox").TBoolean;
334
- totalValuation: import("@sinclair/typebox").TString;
335
- }>;
336
- export type FinanceOverviewWalletItemType = typeof financeOverviewWalletItemSchema.static;
337
- export declare const financeOverviewAccountItemSchema: import("@sinclair/typebox").TObject<{
320
+ export type WalletOverviewQueryType = typeof walletOverviewQuerySchema.static;
321
+ export declare const walletOverviewAccountItemSchema: import("@sinclair/typebox").TObject<{
338
322
  ledgerAccountId: import("@sinclair/typebox").TString;
339
323
  assetId: import("@sinclair/typebox").TString;
340
324
  assetCode: import("@sinclair/typebox").TString;
@@ -346,53 +330,7 @@ export declare const financeOverviewAccountItemSchema: import("@sinclair/typebox
346
330
  quantity: import("@sinclair/typebox").TString;
347
331
  totalValuation: import("@sinclair/typebox").TString;
348
332
  }>;
349
- export type FinanceOverviewAccountItemType = typeof financeOverviewAccountItemSchema.static;
350
- export declare const financeOverviewAssetItemSchema: import("@sinclair/typebox").TObject<{
351
- assetId: import("@sinclair/typebox").TString;
352
- assetCode: import("@sinclair/typebox").TString;
353
- assetName: import("@sinclair/typebox").TString;
354
- iconUrl: import("@sinclair/typebox").TString;
355
- quantity: import("@sinclair/typebox").TString;
356
- totalValuation: import("@sinclair/typebox").TString;
357
- }>;
358
- export type FinanceOverviewAssetItemType = typeof financeOverviewAssetItemSchema.static;
359
- export declare const financeOverviewResponseSchema: import("@sinclair/typebox").TObject<{
360
- quoteAsset: import("@sinclair/typebox").TString;
361
- overview: import("@sinclair/typebox").TObject<{
362
- totalValuation: import("@sinclair/typebox").TString;
363
- }>;
364
- walletView: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
365
- walletId: import("@sinclair/typebox").TString;
366
- walletName: import("@sinclair/typebox").TString;
367
- walletTypeId: import("@sinclair/typebox").TString;
368
- walletTypeKey: import("@sinclair/typebox").TString;
369
- walletTypeName: import("@sinclair/typebox").TString;
370
- isPrimary: import("@sinclair/typebox").TBoolean;
371
- isActive: import("@sinclair/typebox").TBoolean;
372
- totalValuation: import("@sinclair/typebox").TString;
373
- }>>;
374
- accountView: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
375
- ledgerAccountId: import("@sinclair/typebox").TString;
376
- assetId: import("@sinclair/typebox").TString;
377
- assetCode: import("@sinclair/typebox").TString;
378
- assetName: import("@sinclair/typebox").TString;
379
- ledgerAccountTypeId: import("@sinclair/typebox").TString;
380
- ledgerAccountTypeKey: import("@sinclair/typebox").TString;
381
- ledgerAccountTypeName: import("@sinclair/typebox").TString;
382
- status: import("@sinclair/typebox").TString;
383
- quantity: import("@sinclair/typebox").TString;
384
- totalValuation: import("@sinclair/typebox").TString;
385
- }>>;
386
- assetView: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
387
- assetId: import("@sinclair/typebox").TString;
388
- assetCode: import("@sinclair/typebox").TString;
389
- assetName: import("@sinclair/typebox").TString;
390
- iconUrl: import("@sinclair/typebox").TString;
391
- quantity: import("@sinclair/typebox").TString;
392
- totalValuation: import("@sinclair/typebox").TString;
393
- }>>;
394
- }>;
395
- export type FinanceOverviewResponseType = typeof financeOverviewResponseSchema.static;
333
+ export type WalletOverviewAccountItemType = typeof walletOverviewAccountItemSchema.static;
396
334
  export declare const walletDetailParamsSchema: import("@sinclair/typebox").TObject<{
397
335
  walletId: import("@sinclair/typebox").TString;
398
336
  }>;
@@ -434,67 +434,6 @@ export declare const walletRouter: Elysia<"", {
434
434
  };
435
435
  };
436
436
  };
437
- } & {
438
- finance: {
439
- overview: {
440
- get: {
441
- body: {};
442
- params: {};
443
- query: {
444
- quoteAsset?: string | undefined;
445
- };
446
- headers: {};
447
- response: {
448
- 200: {
449
- quoteAsset: string;
450
- overview: {
451
- totalValuation: string;
452
- };
453
- walletView: {
454
- isActive: boolean;
455
- walletTypeId: string;
456
- isPrimary: boolean;
457
- totalValuation: string;
458
- walletId: string;
459
- walletTypeKey: string;
460
- walletName: string;
461
- walletTypeName: string;
462
- }[];
463
- accountView: {
464
- status: string;
465
- assetId: string;
466
- ledgerAccountTypeId: string;
467
- assetCode: string;
468
- ledgerAccountId: string;
469
- totalValuation: string;
470
- assetName: string;
471
- quantity: string;
472
- ledgerAccountTypeKey: string;
473
- ledgerAccountTypeName: string;
474
- }[];
475
- assetView: {
476
- iconUrl: string;
477
- assetId: string;
478
- assetCode: string;
479
- totalValuation: string;
480
- assetName: string;
481
- quantity: string;
482
- }[];
483
- };
484
- 422: {
485
- type: "validation";
486
- on: string;
487
- summary?: string;
488
- message?: string;
489
- found?: unknown;
490
- property?: string;
491
- expected?: string;
492
- };
493
- 401: "Unauthorized";
494
- };
495
- };
496
- };
497
- };
498
437
  } & {
499
438
  wallets: {
500
439
  ":walletId": {
@@ -537,10 +476,10 @@ export declare const walletRouter: Elysia<"", {
537
476
  assetCode: string;
538
477
  ledgerAccountId: string;
539
478
  totalValuation: string;
540
- assetName: string;
541
479
  quantity: string;
542
480
  ledgerAccountTypeKey: string;
543
481
  ledgerAccountTypeName: string;
482
+ assetName: string;
544
483
  }[];
545
484
  };
546
485
  422: {
@@ -1,5 +1,5 @@
1
1
  import { InternalWalletService } from "../internal/service";
2
- import type { FinanceOverviewQueryType, WalletDetailParamsType, WalletListQueryType } from "./dto.schemas";
2
+ import type { WalletDetailParamsType, WalletListQueryType, WalletOverviewQueryType } from "./dto.schemas";
3
3
  export declare abstract class UserWalletService extends InternalWalletService {
4
4
  static listWallets(userId: string, options?: Omit<WalletListQueryType, "userId">): Promise<{
5
5
  items: {
@@ -37,44 +37,8 @@ export declare abstract class UserWalletService extends InternalWalletService {
37
37
  private static toDecimal;
38
38
  private static getLatestPriceMapForAssets;
39
39
  private static getValuationPrice;
40
- private static getFinanceBaseData;
41
- static getFinanceSummary(userId: string, query?: FinanceOverviewQueryType): Promise<{
42
- quoteAsset: string;
43
- overview: {
44
- totalValuation: string;
45
- };
46
- walletView: {
47
- walletId: string;
48
- walletName: string;
49
- walletTypeId: string;
50
- walletTypeKey: string;
51
- walletTypeName: string;
52
- isPrimary: boolean;
53
- isActive: boolean;
54
- totalValuation: string;
55
- }[];
56
- accountView: {
57
- ledgerAccountId: string;
58
- assetId: string;
59
- assetCode: string;
60
- assetName: string;
61
- ledgerAccountTypeId: string;
62
- ledgerAccountTypeKey: string;
63
- ledgerAccountTypeName: string;
64
- status: string;
65
- quantity: string;
66
- totalValuation: string;
67
- }[];
68
- assetView: {
69
- assetId: string;
70
- assetCode: string;
71
- assetName: string;
72
- iconUrl: string;
73
- quantity: string;
74
- totalValuation: string;
75
- }[];
76
- }>;
77
- static getWalletOverview(userId: string, params: WalletDetailParamsType, query?: FinanceOverviewQueryType): Promise<{
40
+ private static getWalletOverviewBaseData;
41
+ static getWalletOverview(userId: string, params: WalletDetailParamsType, query?: WalletOverviewQueryType): Promise<{
78
42
  quoteAsset: string;
79
43
  overview: {
80
44
  totalValuation: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2wa-org/eden",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "description": "Elysia API type definitions for Eden Treaty",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "files": [