@r2wa-org/eden 0.0.60 → 0.0.63

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.
@@ -1119,12 +1119,7 @@ export declare const adminRouter: Elysia<"/admin", {
1119
1119
  post: {
1120
1120
  body: {
1121
1121
  isActive?: boolean | undefined;
1122
- initialPrice?: {
1123
- quoteAsset?: string | undefined;
1124
- source?: string | undefined;
1125
- effectiveAt?: Date | undefined;
1126
- price: string;
1127
- } | undefined;
1122
+ initialCnyPrice?: string | undefined;
1128
1123
  symbol: string;
1129
1124
  name: string;
1130
1125
  code: string;
@@ -4092,13 +4087,20 @@ export declare const adminRouter: Elysia<"/admin", {
4092
4087
  body: {};
4093
4088
  params: {};
4094
4089
  query: {
4090
+ userId?: string | undefined;
4095
4091
  accountId?: string | undefined;
4096
4092
  assetId?: string | undefined;
4093
+ bizType?: "deposit_credit" | "withdraw_freeze" | "withdraw_release" | "withdraw_debit" | "transfer_out" | "transfer_in" | "internal_transfer_out" | "internal_transfer_in" | "manual_increase" | "manual_decrease" | "welfare_cycle_subscribe_transfer" | "welfare_cycle_daily_yield_payout" | "welfare_cycle_maturity_yield_payout" | "welfare_cycle_maturity_principal_return" | "asset_convert_order_pay_debit" | "asset_convert_order_target_credit" | "trade_market_buy_quote_transfer" | "trade_market_buy_base_transfer" | "trade_market_sell_base_transfer" | "trade_market_sell_quote_transfer" | undefined;
4094
+ referenceId?: string | undefined;
4095
+ referenceType?: "deposit_order" | "withdraw_order" | "transfer_order" | "internal_transfer_order" | "manual_adjustment" | "welfare_cycle_subscription" | "welfare_cycle_daily_payout" | "welfare_cycle_maturity_settlement" | "asset_convert_order" | "trade_market_order" | undefined;
4096
+ operatorId?: string | null | undefined;
4097
+ startDate?: Date | undefined;
4097
4098
  limit?: number | undefined;
4098
4099
  offset?: number | undefined;
4099
4100
  pageSize?: number | undefined;
4100
4101
  pageIndex?: number | undefined;
4101
- userId: string;
4102
+ endDate?: Date | undefined;
4103
+ changeDirection?: "increase" | "decrease" | undefined;
4102
4104
  };
4103
4105
  headers: {};
4104
4106
  response: {
@@ -122,12 +122,7 @@ export declare const assetAdminCreateSchema: import("@sinclair/typebox").TObject
122
122
  isActive: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
123
123
  typeId: import("@sinclair/typebox").TString;
124
124
  precision: import("@sinclair/typebox").TInteger;
125
- initialPrice: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
126
- price: import("@sinclair/typebox").TString;
127
- quoteAsset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
128
- source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
129
- effectiveAt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
130
- }>>;
125
+ initialCnyPrice: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
131
126
  }>;
132
127
  export type AssetAdminCreateInputType = typeof assetAdminCreateSchema.static;
133
128
  export declare const assetAdminUpdateSchema: import("@sinclair/typebox").TObject<{
@@ -493,12 +493,7 @@ export declare const assetAdminRouter: Elysia<"/assets", {
493
493
  post: {
494
494
  body: {
495
495
  isActive?: boolean | undefined;
496
- initialPrice?: {
497
- quoteAsset?: string | undefined;
498
- source?: string | undefined;
499
- effectiveAt?: Date | undefined;
500
- price: string;
501
- } | undefined;
496
+ initialCnyPrice?: string | undefined;
502
497
  symbol: string;
503
498
  name: string;
504
499
  code: string;
@@ -1442,12 +1442,7 @@ declare const app: Elysia<"/api", {
1442
1442
  post: {
1443
1443
  body: {
1444
1444
  isActive?: boolean | undefined;
1445
- initialPrice?: {
1446
- quoteAsset?: string | undefined;
1447
- source?: string | undefined;
1448
- effectiveAt?: Date | undefined;
1449
- price: string;
1450
- } | undefined;
1445
+ initialCnyPrice?: string | undefined;
1451
1446
  symbol: string;
1452
1447
  name: string;
1453
1448
  code: string;
@@ -4415,13 +4410,20 @@ declare const app: Elysia<"/api", {
4415
4410
  body: {};
4416
4411
  params: {};
4417
4412
  query: {
4413
+ userId?: string | undefined;
4418
4414
  accountId?: string | undefined;
4419
4415
  assetId?: string | undefined;
4416
+ bizType?: "deposit_credit" | "withdraw_freeze" | "withdraw_release" | "withdraw_debit" | "transfer_out" | "transfer_in" | "internal_transfer_out" | "internal_transfer_in" | "manual_increase" | "manual_decrease" | "welfare_cycle_subscribe_transfer" | "welfare_cycle_daily_yield_payout" | "welfare_cycle_maturity_yield_payout" | "welfare_cycle_maturity_principal_return" | "asset_convert_order_pay_debit" | "asset_convert_order_target_credit" | "trade_market_buy_quote_transfer" | "trade_market_buy_base_transfer" | "trade_market_sell_base_transfer" | "trade_market_sell_quote_transfer" | undefined;
4417
+ referenceId?: string | undefined;
4418
+ referenceType?: "deposit_order" | "withdraw_order" | "transfer_order" | "internal_transfer_order" | "manual_adjustment" | "welfare_cycle_subscription" | "welfare_cycle_daily_payout" | "welfare_cycle_maturity_settlement" | "asset_convert_order" | "trade_market_order" | undefined;
4419
+ operatorId?: string | null | undefined;
4420
+ startDate?: Date | undefined;
4420
4421
  limit?: number | undefined;
4421
4422
  offset?: number | undefined;
4422
4423
  pageSize?: number | undefined;
4423
4424
  pageIndex?: number | undefined;
4424
- userId: string;
4425
+ endDate?: Date | undefined;
4426
+ changeDirection?: "increase" | "decrease" | undefined;
4425
4427
  };
4426
4428
  headers: {};
4427
4429
  response: {
@@ -1,11 +1,90 @@
1
1
  export declare const getLedgerEntriesAdminFilterDto: import("@sinclair/typebox").TObject<{
2
+ userId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2
3
  assetId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
3
4
  accountId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
5
+ bizType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
6
+ deposit_credit: "deposit_credit";
7
+ withdraw_freeze: "withdraw_freeze";
8
+ withdraw_release: "withdraw_release";
9
+ withdraw_debit: "withdraw_debit";
10
+ transfer_out: "transfer_out";
11
+ transfer_in: "transfer_in";
12
+ internal_transfer_out: "internal_transfer_out";
13
+ internal_transfer_in: "internal_transfer_in";
14
+ manual_increase: "manual_increase";
15
+ manual_decrease: "manual_decrease";
16
+ welfare_cycle_subscribe_transfer: "welfare_cycle_subscribe_transfer";
17
+ welfare_cycle_daily_yield_payout: "welfare_cycle_daily_yield_payout";
18
+ welfare_cycle_maturity_yield_payout: "welfare_cycle_maturity_yield_payout";
19
+ welfare_cycle_maturity_principal_return: "welfare_cycle_maturity_principal_return";
20
+ asset_convert_order_pay_debit: "asset_convert_order_pay_debit";
21
+ asset_convert_order_target_credit: "asset_convert_order_target_credit";
22
+ trade_market_buy_quote_transfer: "trade_market_buy_quote_transfer";
23
+ trade_market_buy_base_transfer: "trade_market_buy_base_transfer";
24
+ trade_market_sell_base_transfer: "trade_market_sell_base_transfer";
25
+ trade_market_sell_quote_transfer: "trade_market_sell_quote_transfer";
26
+ }>>;
27
+ referenceType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
28
+ deposit_order: "deposit_order";
29
+ withdraw_order: "withdraw_order";
30
+ transfer_order: "transfer_order";
31
+ internal_transfer_order: "internal_transfer_order";
32
+ manual_adjustment: "manual_adjustment";
33
+ welfare_cycle_subscription: "welfare_cycle_subscription";
34
+ welfare_cycle_daily_payout: "welfare_cycle_daily_payout";
35
+ welfare_cycle_maturity_settlement: "welfare_cycle_maturity_settlement";
36
+ asset_convert_order: "asset_convert_order";
37
+ trade_market_order: "trade_market_order";
38
+ }>>;
39
+ referenceId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
40
+ operatorId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
41
+ changeDirection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"increase">, import("@sinclair/typebox").TLiteral<"decrease">]>>;
42
+ startDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
43
+ endDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
4
44
  }>;
5
45
  export declare const getLedgerEntriesAdminQueryDto: import("@sinclair/typebox").TObject<{
6
- userId: import("@sinclair/typebox").TString;
46
+ userId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
7
47
  accountId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
48
  assetId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
49
+ bizType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
50
+ deposit_credit: "deposit_credit";
51
+ withdraw_freeze: "withdraw_freeze";
52
+ withdraw_release: "withdraw_release";
53
+ withdraw_debit: "withdraw_debit";
54
+ transfer_out: "transfer_out";
55
+ transfer_in: "transfer_in";
56
+ internal_transfer_out: "internal_transfer_out";
57
+ internal_transfer_in: "internal_transfer_in";
58
+ manual_increase: "manual_increase";
59
+ manual_decrease: "manual_decrease";
60
+ welfare_cycle_subscribe_transfer: "welfare_cycle_subscribe_transfer";
61
+ welfare_cycle_daily_yield_payout: "welfare_cycle_daily_yield_payout";
62
+ welfare_cycle_maturity_yield_payout: "welfare_cycle_maturity_yield_payout";
63
+ welfare_cycle_maturity_principal_return: "welfare_cycle_maturity_principal_return";
64
+ asset_convert_order_pay_debit: "asset_convert_order_pay_debit";
65
+ asset_convert_order_target_credit: "asset_convert_order_target_credit";
66
+ trade_market_buy_quote_transfer: "trade_market_buy_quote_transfer";
67
+ trade_market_buy_base_transfer: "trade_market_buy_base_transfer";
68
+ trade_market_sell_base_transfer: "trade_market_sell_base_transfer";
69
+ trade_market_sell_quote_transfer: "trade_market_sell_quote_transfer";
70
+ }>>;
71
+ referenceId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
72
+ referenceType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
73
+ deposit_order: "deposit_order";
74
+ withdraw_order: "withdraw_order";
75
+ transfer_order: "transfer_order";
76
+ internal_transfer_order: "internal_transfer_order";
77
+ manual_adjustment: "manual_adjustment";
78
+ welfare_cycle_subscription: "welfare_cycle_subscription";
79
+ welfare_cycle_daily_payout: "welfare_cycle_daily_payout";
80
+ welfare_cycle_maturity_settlement: "welfare_cycle_maturity_settlement";
81
+ asset_convert_order: "asset_convert_order";
82
+ trade_market_order: "trade_market_order";
83
+ }>>;
84
+ operatorId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
85
+ startDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
86
+ endDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
87
+ changeDirection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"increase">, import("@sinclair/typebox").TLiteral<"decrease">]>>;
9
88
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
10
89
  offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
11
90
  pageSize: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
@@ -386,13 +386,20 @@ export declare const ledgerAdminRouter: Elysia<"/ledger", {
386
386
  body: {};
387
387
  params: {};
388
388
  query: {
389
+ userId?: string | undefined;
389
390
  accountId?: string | undefined;
390
391
  assetId?: string | undefined;
392
+ bizType?: "deposit_credit" | "withdraw_freeze" | "withdraw_release" | "withdraw_debit" | "transfer_out" | "transfer_in" | "internal_transfer_out" | "internal_transfer_in" | "manual_increase" | "manual_decrease" | "welfare_cycle_subscribe_transfer" | "welfare_cycle_daily_yield_payout" | "welfare_cycle_maturity_yield_payout" | "welfare_cycle_maturity_principal_return" | "asset_convert_order_pay_debit" | "asset_convert_order_target_credit" | "trade_market_buy_quote_transfer" | "trade_market_buy_base_transfer" | "trade_market_sell_base_transfer" | "trade_market_sell_quote_transfer" | undefined;
393
+ referenceId?: string | undefined;
394
+ referenceType?: "deposit_order" | "withdraw_order" | "transfer_order" | "internal_transfer_order" | "manual_adjustment" | "welfare_cycle_subscription" | "welfare_cycle_daily_payout" | "welfare_cycle_maturity_settlement" | "asset_convert_order" | "trade_market_order" | undefined;
395
+ operatorId?: string | null | undefined;
396
+ startDate?: Date | undefined;
391
397
  limit?: number | undefined;
392
398
  offset?: number | undefined;
393
399
  pageSize?: number | undefined;
394
400
  pageIndex?: number | undefined;
395
- userId: string;
401
+ endDate?: Date | undefined;
402
+ changeDirection?: "increase" | "decrease" | undefined;
396
403
  };
397
404
  headers: {};
398
405
  response: {
@@ -1,7 +1,20 @@
1
- import type { LedgerEntryQueryOptions } from "../internal/service";
2
- import { BaseLedgerService } from "../internal/service";
3
- export declare abstract class AdminLedgerService extends BaseLedgerService {
4
- static getLedgerEntries(userId: string, options?: LedgerEntryQueryOptions): Promise<{
1
+ import { ledgerEntry } from "../schema";
2
+ export interface AdminLedgerEntryQueryOptions {
3
+ userId?: string;
4
+ assetId?: string;
5
+ accountId?: string;
6
+ bizType?: typeof ledgerEntry.$inferSelect.bizType;
7
+ referenceType?: typeof ledgerEntry.$inferSelect.referenceType;
8
+ referenceId?: string;
9
+ operatorId?: string | null;
10
+ changeDirection?: "increase" | "decrease";
11
+ startDate?: Date;
12
+ endDate?: Date;
13
+ limit?: number;
14
+ offset?: number;
15
+ }
16
+ export declare abstract class AdminLedgerService {
17
+ static getLedgerEntries(options?: AdminLedgerEntryQueryOptions): Promise<{
5
18
  items: {
6
19
  id: string;
7
20
  createdAt: Date;
@@ -26,152 +26,6 @@ export interface BalanceChangeResult {
26
26
  toLockedAfter?: string | null;
27
27
  isIdempotent?: boolean;
28
28
  }
29
- export interface LedgerEntryQueryOptions {
30
- assetId?: string;
31
- accountId?: string;
32
- limit?: number | undefined;
33
- offset?: number | undefined;
34
- }
35
- export declare abstract class BaseLedgerService {
36
- protected static listLedgerEntries(userId: string, options?: LedgerEntryQueryOptions): Promise<{
37
- items: {
38
- id: string;
39
- createdAt: Date;
40
- assetId: string;
41
- fromAccountId: string | null;
42
- toAccountId: string | null;
43
- bizType: "deposit_credit" | "withdraw_freeze" | "withdraw_release" | "withdraw_debit" | "transfer_out" | "transfer_in" | "internal_transfer_out" | "internal_transfer_in" | "manual_increase" | "manual_decrease" | "welfare_cycle_subscribe_transfer" | "welfare_cycle_daily_yield_payout" | "welfare_cycle_maturity_yield_payout" | "welfare_cycle_maturity_principal_return" | "asset_convert_order_pay_debit" | "asset_convert_order_target_credit" | "trade_market_buy_quote_transfer" | "trade_market_buy_base_transfer" | "trade_market_sell_base_transfer" | "trade_market_sell_quote_transfer";
44
- amount: string;
45
- fromAvailableBefore: string | null;
46
- fromAvailableAfter: string | null;
47
- fromLockedBefore: string | null;
48
- fromLockedAfter: string | null;
49
- toAvailableBefore: string | null;
50
- toAvailableAfter: string | null;
51
- toLockedBefore: string | null;
52
- toLockedAfter: string | null;
53
- referenceId: string;
54
- referenceType: "deposit_order" | "withdraw_order" | "transfer_order" | "internal_transfer_order" | "manual_adjustment" | "welfare_cycle_subscription" | "welfare_cycle_daily_payout" | "welfare_cycle_maturity_settlement" | "asset_convert_order" | "trade_market_order";
55
- idempotencyKey: string;
56
- operatorId: string | null;
57
- memo: string | null;
58
- asset: {
59
- symbol: string;
60
- id: string;
61
- name: string;
62
- createdAt: Date;
63
- updatedAt: Date;
64
- code: string;
65
- iconUrl: string;
66
- category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
67
- isActive: boolean;
68
- typeId: string;
69
- precision: number;
70
- };
71
- fromAccount: {
72
- id: string;
73
- createdAt: Date;
74
- updatedAt: Date;
75
- userId: string;
76
- status: "active" | "frozen" | "disabled";
77
- assetId: string;
78
- ledgerAccountTypeId: string;
79
- available: string;
80
- locked: string;
81
- version: number;
82
- asset: {
83
- symbol: string;
84
- id: string;
85
- name: string;
86
- createdAt: Date;
87
- updatedAt: Date;
88
- code: string;
89
- iconUrl: string;
90
- category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
91
- isActive: boolean;
92
- typeId: string;
93
- precision: number;
94
- };
95
- ledgerAccountType: {
96
- id: string;
97
- name: string;
98
- createdAt: Date;
99
- updatedAt: Date;
100
- description: string | null;
101
- key: string;
102
- isActive: boolean;
103
- allowDeposit: boolean;
104
- allowWithdraw: boolean;
105
- minWithdrawAmount: string;
106
- maxWithdrawAmount: string;
107
- allowTransfer: boolean;
108
- minTransferAmount: string;
109
- maxTransferAmount: string;
110
- allowInternalTransfer: boolean;
111
- allowInternalReceiveTransfer: boolean;
112
- minInternalTransferAmount: string;
113
- maxInternalTransferAmount: string;
114
- internalTransferRatio: string;
115
- allowTransaction: boolean;
116
- hasExpiry: boolean;
117
- expiryDays: number | null;
118
- sortOrder: number;
119
- };
120
- } | null;
121
- toAccount: {
122
- id: string;
123
- createdAt: Date;
124
- updatedAt: Date;
125
- userId: string;
126
- status: "active" | "frozen" | "disabled";
127
- assetId: string;
128
- ledgerAccountTypeId: string;
129
- available: string;
130
- locked: string;
131
- version: number;
132
- asset: {
133
- symbol: string;
134
- id: string;
135
- name: string;
136
- createdAt: Date;
137
- updatedAt: Date;
138
- code: string;
139
- iconUrl: string;
140
- category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
141
- isActive: boolean;
142
- typeId: string;
143
- precision: number;
144
- };
145
- ledgerAccountType: {
146
- id: string;
147
- name: string;
148
- createdAt: Date;
149
- updatedAt: Date;
150
- description: string | null;
151
- key: string;
152
- isActive: boolean;
153
- allowDeposit: boolean;
154
- allowWithdraw: boolean;
155
- minWithdrawAmount: string;
156
- maxWithdrawAmount: string;
157
- allowTransfer: boolean;
158
- minTransferAmount: string;
159
- maxTransferAmount: string;
160
- allowInternalTransfer: boolean;
161
- allowInternalReceiveTransfer: boolean;
162
- minInternalTransferAmount: string;
163
- maxInternalTransferAmount: string;
164
- internalTransferRatio: string;
165
- allowTransaction: boolean;
166
- hasExpiry: boolean;
167
- expiryDays: number | null;
168
- sortOrder: number;
169
- };
170
- } | null;
171
- }[];
172
- total: number;
173
- }>;
174
- }
175
29
  export declare abstract class InternalLedgerService {
176
30
  static increaseAvailableBalance(tx: TransactionTx, params: CreateLedgerEntryParams): Promise<BalanceChangeResult>;
177
31
  static decreaseAvailableBalance(tx: TransactionTx, params: CreateLedgerEntryParams): Promise<BalanceChangeResult>;
@@ -1,7 +1,11 @@
1
- import type { LedgerEntryQueryOptions } from "../internal/service";
2
- import { BaseLedgerService } from "../internal/service";
3
- export declare abstract class UserLedgerService extends BaseLedgerService {
4
- static getLedgerEntries(userId: string, options?: LedgerEntryQueryOptions): Promise<{
1
+ export interface UserLedgerEntryQueryOptions {
2
+ assetId?: string;
3
+ accountId?: string;
4
+ limit?: number;
5
+ offset?: number;
6
+ }
7
+ export declare abstract class UserLedgerService {
8
+ static getLedgerEntries(userId: string, options?: UserLedgerEntryQueryOptions): Promise<{
5
9
  items: {
6
10
  id: string;
7
11
  createdAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2wa-org/eden",
3
- "version": "0.0.60",
3
+ "version": "0.0.63",
4
4
  "description": "Elysia API type definitions for Eden Treaty",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "files": [