@r2wa-org/eden 0.0.60 → 0.0.62

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.
@@ -4092,13 +4092,20 @@ export declare const adminRouter: Elysia<"/admin", {
4092
4092
  body: {};
4093
4093
  params: {};
4094
4094
  query: {
4095
+ userId?: string | undefined;
4095
4096
  accountId?: string | undefined;
4096
4097
  assetId?: string | undefined;
4098
+ 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;
4099
+ referenceId?: string | undefined;
4100
+ 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;
4101
+ operatorId?: string | null | undefined;
4102
+ startDate?: Date | undefined;
4097
4103
  limit?: number | undefined;
4098
4104
  offset?: number | undefined;
4099
4105
  pageSize?: number | undefined;
4100
4106
  pageIndex?: number | undefined;
4101
- userId: string;
4107
+ endDate?: Date | undefined;
4108
+ changeDirection?: "increase" | "decrease" | undefined;
4102
4109
  };
4103
4110
  headers: {};
4104
4111
  response: {
@@ -4415,13 +4415,20 @@ declare const app: Elysia<"/api", {
4415
4415
  body: {};
4416
4416
  params: {};
4417
4417
  query: {
4418
+ userId?: string | undefined;
4418
4419
  accountId?: string | undefined;
4419
4420
  assetId?: string | undefined;
4421
+ 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;
4422
+ referenceId?: string | undefined;
4423
+ 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;
4424
+ operatorId?: string | null | undefined;
4425
+ startDate?: Date | undefined;
4420
4426
  limit?: number | undefined;
4421
4427
  offset?: number | undefined;
4422
4428
  pageSize?: number | undefined;
4423
4429
  pageIndex?: number | undefined;
4424
- userId: string;
4430
+ endDate?: Date | undefined;
4431
+ changeDirection?: "increase" | "decrease" | undefined;
4425
4432
  };
4426
4433
  headers: {};
4427
4434
  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.62",
4
4
  "description": "Elysia API type definitions for Eden Treaty",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "files": [