@r2wa-org/eden 0.0.59 → 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.
- package/dist/src/admin/admin/dto.schemas.d.ts +8 -0
- package/dist/src/admin/admin/errors/index.d.ts +1 -0
- package/dist/src/admin/admin/errors/locales/zh.d.ts +1 -0
- package/dist/src/admin/admin/router.d.ts +31 -0
- package/dist/src/admin/admin/service.d.ts +3 -0
- package/dist/src/admin/index.d.ts +166 -35
- package/dist/src/asset-convert-product/admin/dto.schemas.d.ts +44 -12
- package/dist/src/asset-convert-product/admin/router.d.ts +83 -23
- package/dist/src/asset-convert-product/admin/service.d.ts +73 -17
- package/dist/src/asset-convert-product/db.schemas.d.ts +76 -8
- package/dist/src/asset-convert-product/errors/index.d.ts +4 -0
- package/dist/src/asset-convert-product/errors/locales/zh.d.ts +4 -0
- package/dist/src/asset-convert-product/internal/service.d.ts +4 -3
- package/dist/src/asset-convert-product/schema.d.ts +41 -6
- package/dist/src/asset-convert-product/user/dto.schemas.d.ts +264 -14
- package/dist/src/asset-convert-product/user/router.d.ts +10 -8
- package/dist/src/asset-convert-product/user/service.d.ts +9 -5
- package/dist/src/index.d.ts +263 -48
- package/dist/src/ledger/admin/dto.schemas.d.ts +80 -1
- package/dist/src/ledger/admin/router.d.ts +8 -1
- package/dist/src/ledger/admin/service.d.ts +17 -4
- package/dist/src/ledger/internal/service.d.ts +0 -146
- package/dist/src/ledger/user/service.d.ts +8 -4
- package/dist/src/ledger-account/admin/router.d.ts +1 -1
- package/dist/src/ledger-account/user/dto.schemas.d.ts +5 -0
- package/dist/src/ledger-account/user/router.d.ts +61 -0
- package/dist/src/ledger-account/user/service.d.ts +51 -1
- package/dist/src/ledger-account-import/admin/dto.schemas.d.ts +6 -6
- package/dist/src/ledger-account-import/admin/router.d.ts +9 -9
- package/dist/src/ledger-account-import/admin/service.d.ts +7 -7
- package/dist/src/ledger-account-import/db.schemas.d.ts +4 -4
- package/dist/src/ledger-account-import/schema.d.ts +2 -2
- package/dist/src/welfare-cycle/admin/dto.schemas.d.ts +95 -2
- package/dist/src/welfare-cycle/admin/router.d.ts +34 -1
- package/dist/src/welfare-cycle/admin/service.d.ts +26 -1
- package/dist/src/welfare-cycle/db.schemas.d.ts +174 -4
- package/dist/src/welfare-cycle/errors/index.d.ts +6 -0
- package/dist/src/welfare-cycle/errors/locales/zh.d.ts +6 -0
- package/dist/src/welfare-cycle/internal/service.d.ts +41 -3
- package/dist/src/welfare-cycle/schema.d.ts +92 -3
- package/dist/src/welfare-cycle/user/dto.schemas.d.ts +106 -6
- package/dist/src/welfare-cycle/user/router.d.ts +14 -5
- package/dist/src/welfare-cycle/user/service.d.ts +14 -3
- package/dist/src/withdraw/user/dto.schemas.d.ts +599 -0
- package/dist/src/withdraw/user/router.d.ts +73 -0
- package/dist/src/withdraw/user/service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
401
|
+
endDate?: Date | undefined;
|
|
402
|
+
changeDirection?: "increase" | "decrease" | undefined;
|
|
396
403
|
};
|
|
397
404
|
headers: {};
|
|
398
405
|
response: {
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
@@ -583,8 +583,8 @@ export declare const ledgerAccountAdminRouter: Elysia<"/ledger_accounts", {
|
|
|
583
583
|
response: {
|
|
584
584
|
200: {
|
|
585
585
|
totalCount: number;
|
|
586
|
-
failedCount: number;
|
|
587
586
|
successCount: number;
|
|
587
|
+
failedCount: number;
|
|
588
588
|
results: {
|
|
589
589
|
accountId?: string | undefined;
|
|
590
590
|
ledgerEntryId?: string | undefined;
|
|
@@ -184,6 +184,11 @@ export declare const ledgerAccountIdParamsSchema: import("@sinclair/typebox").TO
|
|
|
184
184
|
id: import("@sinclair/typebox").TString;
|
|
185
185
|
}>;
|
|
186
186
|
export type LedgerAccountIdParamsType = typeof ledgerAccountIdParamsSchema.static;
|
|
187
|
+
export declare const ledgerAccountByTypeAndAssetParamsSchema: import("@sinclair/typebox").TObject<{
|
|
188
|
+
accountTypeKey: import("@sinclair/typebox").TString;
|
|
189
|
+
assetCode: import("@sinclair/typebox").TString;
|
|
190
|
+
}>;
|
|
191
|
+
export type LedgerAccountByTypeAndAssetParamsType = typeof ledgerAccountByTypeAndAssetParamsSchema.static;
|
|
187
192
|
export declare const ledgerAccountResponseSchema: import("drizzle-typebox").BuildSchema<"select", {
|
|
188
193
|
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
189
194
|
name: "created_at";
|
|
@@ -379,6 +379,67 @@ export declare const ledgerAccountRouter: Elysia<"/ledger_accounts", {
|
|
|
379
379
|
response: {};
|
|
380
380
|
}, {
|
|
381
381
|
ledger_accounts: {};
|
|
382
|
+
} & {
|
|
383
|
+
ledger_accounts: {
|
|
384
|
+
"account-types": {
|
|
385
|
+
":accountTypeKey": {
|
|
386
|
+
assets: {
|
|
387
|
+
":assetCode": {
|
|
388
|
+
get: {
|
|
389
|
+
body: {};
|
|
390
|
+
params: {
|
|
391
|
+
assetCode: string;
|
|
392
|
+
accountTypeKey: string;
|
|
393
|
+
};
|
|
394
|
+
query: {};
|
|
395
|
+
headers: {};
|
|
396
|
+
response: {
|
|
397
|
+
200: {
|
|
398
|
+
id: string;
|
|
399
|
+
createdAt: Date;
|
|
400
|
+
updatedAt: Date;
|
|
401
|
+
userId: string;
|
|
402
|
+
status: "active" | "frozen" | "disabled";
|
|
403
|
+
asset: {
|
|
404
|
+
symbol: string;
|
|
405
|
+
id: string;
|
|
406
|
+
name: string;
|
|
407
|
+
code: string;
|
|
408
|
+
iconUrl: string;
|
|
409
|
+
category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
|
|
410
|
+
isActive: boolean;
|
|
411
|
+
precision: number;
|
|
412
|
+
};
|
|
413
|
+
assetId: string;
|
|
414
|
+
ledgerAccountTypeId: string;
|
|
415
|
+
available: string;
|
|
416
|
+
locked: string;
|
|
417
|
+
version: number;
|
|
418
|
+
ledgerAccountType: {
|
|
419
|
+
id: string;
|
|
420
|
+
name: string;
|
|
421
|
+
description: string | null;
|
|
422
|
+
key: string;
|
|
423
|
+
isActive: boolean;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
422: {
|
|
427
|
+
type: "validation";
|
|
428
|
+
on: string;
|
|
429
|
+
summary?: string;
|
|
430
|
+
message?: string;
|
|
431
|
+
found?: unknown;
|
|
432
|
+
property?: string;
|
|
433
|
+
expected?: string;
|
|
434
|
+
};
|
|
435
|
+
401: "Unauthorized";
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
};
|
|
382
443
|
} & {
|
|
383
444
|
ledger_accounts: {
|
|
384
445
|
":id": {
|
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
import { BaseLedgerAccountService } from "../internal/service";
|
|
2
|
-
import type { LedgerAccountIdParamsType } from "./dto.schemas";
|
|
2
|
+
import type { LedgerAccountByTypeAndAssetParamsType, LedgerAccountIdParamsType } from "./dto.schemas";
|
|
3
3
|
export declare abstract class UserLedgerAccountService extends BaseLedgerAccountService {
|
|
4
|
+
static getAccountByTypeAndAsset(userId: string, params: LedgerAccountByTypeAndAssetParamsType): Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
userId: string;
|
|
9
|
+
status: "active" | "frozen" | "disabled";
|
|
10
|
+
assetId: string;
|
|
11
|
+
ledgerAccountTypeId: string;
|
|
12
|
+
available: string;
|
|
13
|
+
locked: string;
|
|
14
|
+
version: number;
|
|
15
|
+
asset: {
|
|
16
|
+
symbol: string;
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
code: string;
|
|
22
|
+
iconUrl: string;
|
|
23
|
+
category: "FIAT" | "CRYPTO" | "POINT" | "RWA";
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
typeId: string;
|
|
26
|
+
precision: number;
|
|
27
|
+
};
|
|
28
|
+
ledgerAccountType: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
updatedAt: Date;
|
|
33
|
+
description: string | null;
|
|
34
|
+
key: string;
|
|
35
|
+
isActive: boolean;
|
|
36
|
+
allowDeposit: boolean;
|
|
37
|
+
allowWithdraw: boolean;
|
|
38
|
+
minWithdrawAmount: string;
|
|
39
|
+
maxWithdrawAmount: string;
|
|
40
|
+
allowTransfer: boolean;
|
|
41
|
+
minTransferAmount: string;
|
|
42
|
+
maxTransferAmount: string;
|
|
43
|
+
allowInternalTransfer: boolean;
|
|
44
|
+
allowInternalReceiveTransfer: boolean;
|
|
45
|
+
minInternalTransferAmount: string;
|
|
46
|
+
maxInternalTransferAmount: string;
|
|
47
|
+
internalTransferRatio: string;
|
|
48
|
+
allowTransaction: boolean;
|
|
49
|
+
hasExpiry: boolean;
|
|
50
|
+
expiryDays: number | null;
|
|
51
|
+
sortOrder: number;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
4
54
|
static getAccountById(userId: string, params: LedgerAccountIdParamsType): Promise<{
|
|
5
55
|
id: string;
|
|
6
56
|
createdAt: Date;
|
|
@@ -72,7 +72,7 @@ export declare const ledgerAccountImportJobResponseSchema: import("drizzle-typeb
|
|
|
72
72
|
tableName: "ledger_account_import_job";
|
|
73
73
|
dataType: "string";
|
|
74
74
|
columnType: "PgEnumColumn";
|
|
75
|
-
data: "pending" | "
|
|
75
|
+
data: "pending" | "running" | "success" | "failed";
|
|
76
76
|
driverParam: string;
|
|
77
77
|
notNull: true;
|
|
78
78
|
hasDefault: true;
|
|
@@ -254,9 +254,9 @@ export declare const ledgerAccountImportJobListQuerySchema: import("@sinclair/ty
|
|
|
254
254
|
pageIndex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
255
255
|
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
256
256
|
pending: "pending";
|
|
257
|
-
failed: "failed";
|
|
258
257
|
running: "running";
|
|
259
258
|
success: "success";
|
|
259
|
+
failed: "failed";
|
|
260
260
|
}>>;
|
|
261
261
|
}>;
|
|
262
262
|
export type LedgerAccountImportJobListQueryType = typeof ledgerAccountImportJobListQuerySchema.static;
|
|
@@ -335,7 +335,7 @@ export declare const ledgerAccountImportJobListResponseSchema: import("@sinclair
|
|
|
335
335
|
tableName: "ledger_account_import_job";
|
|
336
336
|
dataType: "string";
|
|
337
337
|
columnType: "PgEnumColumn";
|
|
338
|
-
data: "pending" | "
|
|
338
|
+
data: "pending" | "running" | "success" | "failed";
|
|
339
339
|
driverParam: string;
|
|
340
340
|
notNull: true;
|
|
341
341
|
hasDefault: true;
|
|
@@ -719,7 +719,7 @@ export declare const ledgerAccountImportItemResponseSchema: import("drizzle-type
|
|
|
719
719
|
tableName: "ledger_account_import_item";
|
|
720
720
|
dataType: "string";
|
|
721
721
|
columnType: "PgEnumColumn";
|
|
722
|
-
data: "
|
|
722
|
+
data: "success" | "failed" | "ignored";
|
|
723
723
|
driverParam: string;
|
|
724
724
|
notNull: true;
|
|
725
725
|
hasDefault: false;
|
|
@@ -877,8 +877,8 @@ export declare const ledgerAccountImportItemListQuerySchema: import("@sinclair/t
|
|
|
877
877
|
pageSize: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
878
878
|
pageIndex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
879
879
|
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
880
|
-
failed: "failed";
|
|
881
880
|
success: "success";
|
|
881
|
+
failed: "failed";
|
|
882
882
|
ignored: "ignored";
|
|
883
883
|
}>>;
|
|
884
884
|
}>;
|
|
@@ -1094,7 +1094,7 @@ export declare const ledgerAccountImportItemListResponseSchema: import("@sinclai
|
|
|
1094
1094
|
tableName: "ledger_account_import_item";
|
|
1095
1095
|
dataType: "string";
|
|
1096
1096
|
columnType: "PgEnumColumn";
|
|
1097
|
-
data: "
|
|
1097
|
+
data: "success" | "failed" | "ignored";
|
|
1098
1098
|
driverParam: string;
|
|
1099
1099
|
notNull: true;
|
|
1100
1100
|
hasDefault: false;
|
|
@@ -395,9 +395,9 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
395
395
|
id: string;
|
|
396
396
|
createdAt: Date;
|
|
397
397
|
updatedAt: Date;
|
|
398
|
-
status: "pending" | "
|
|
399
|
-
failed: number;
|
|
398
|
+
status: "pending" | "running" | "success" | "failed";
|
|
400
399
|
success: number;
|
|
400
|
+
failed: number;
|
|
401
401
|
ignored: number;
|
|
402
402
|
fileId: string;
|
|
403
403
|
total: number;
|
|
@@ -428,7 +428,7 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
428
428
|
body: {};
|
|
429
429
|
params: {};
|
|
430
430
|
query: {
|
|
431
|
-
status?: "pending" | "
|
|
431
|
+
status?: "pending" | "running" | "success" | "failed" | undefined;
|
|
432
432
|
limit?: number | undefined;
|
|
433
433
|
offset?: number | undefined;
|
|
434
434
|
pageSize?: number | undefined;
|
|
@@ -442,9 +442,9 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
442
442
|
id: string;
|
|
443
443
|
createdAt: Date;
|
|
444
444
|
updatedAt: Date;
|
|
445
|
-
status: "pending" | "
|
|
446
|
-
failed: number;
|
|
445
|
+
status: "pending" | "running" | "success" | "failed";
|
|
447
446
|
success: number;
|
|
447
|
+
failed: number;
|
|
448
448
|
ignored: number;
|
|
449
449
|
fileId: string;
|
|
450
450
|
total: number;
|
|
@@ -493,9 +493,9 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
493
493
|
id: string;
|
|
494
494
|
createdAt: Date;
|
|
495
495
|
updatedAt: Date;
|
|
496
|
-
status: "pending" | "
|
|
497
|
-
failed: number;
|
|
496
|
+
status: "pending" | "running" | "success" | "failed";
|
|
498
497
|
success: number;
|
|
498
|
+
failed: number;
|
|
499
499
|
ignored: number;
|
|
500
500
|
fileId: string;
|
|
501
501
|
total: number;
|
|
@@ -531,7 +531,7 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
531
531
|
id: string;
|
|
532
532
|
};
|
|
533
533
|
query: {
|
|
534
|
-
status?: "
|
|
534
|
+
status?: "success" | "failed" | "ignored" | undefined;
|
|
535
535
|
limit?: number | undefined;
|
|
536
536
|
offset?: number | undefined;
|
|
537
537
|
pageSize?: number | undefined;
|
|
@@ -547,7 +547,7 @@ export declare const ledgerAccountImportAdminRouter: Elysia<"/ledger_account_imp
|
|
|
547
547
|
updatedAt: Date;
|
|
548
548
|
phoneNumber: string | null;
|
|
549
549
|
userId: string | null;
|
|
550
|
-
status: "
|
|
550
|
+
status: "success" | "failed" | "ignored";
|
|
551
551
|
assetId: string | null;
|
|
552
552
|
ledgerAccountTypeId: string | null;
|
|
553
553
|
amount: string | null;
|
|
@@ -6,9 +6,9 @@ export declare abstract class AdminLedgerAccountImportService extends BaseLedger
|
|
|
6
6
|
id: string;
|
|
7
7
|
createdAt: Date;
|
|
8
8
|
updatedAt: Date;
|
|
9
|
-
status: "pending" | "
|
|
10
|
-
failed: number;
|
|
9
|
+
status: "pending" | "running" | "success" | "failed";
|
|
11
10
|
success: number;
|
|
11
|
+
failed: number;
|
|
12
12
|
ignored: number;
|
|
13
13
|
fileId: string;
|
|
14
14
|
total: number;
|
|
@@ -22,9 +22,9 @@ export declare abstract class AdminLedgerAccountImportService extends BaseLedger
|
|
|
22
22
|
id: string;
|
|
23
23
|
createdAt: Date;
|
|
24
24
|
updatedAt: Date;
|
|
25
|
-
status: "pending" | "
|
|
26
|
-
failed: number;
|
|
25
|
+
status: "pending" | "running" | "success" | "failed";
|
|
27
26
|
success: number;
|
|
27
|
+
failed: number;
|
|
28
28
|
ignored: number;
|
|
29
29
|
fileId: string;
|
|
30
30
|
total: number;
|
|
@@ -44,7 +44,7 @@ export declare abstract class AdminLedgerAccountImportService extends BaseLedger
|
|
|
44
44
|
updatedAt: Date;
|
|
45
45
|
phoneNumber: string | null;
|
|
46
46
|
userId: string | null;
|
|
47
|
-
status: "
|
|
47
|
+
status: "success" | "failed" | "ignored";
|
|
48
48
|
assetId: string | null;
|
|
49
49
|
ledgerAccountTypeId: string | null;
|
|
50
50
|
amount: string | null;
|
|
@@ -73,9 +73,9 @@ export declare abstract class AdminLedgerAccountImportService extends BaseLedger
|
|
|
73
73
|
id: string;
|
|
74
74
|
createdAt: Date;
|
|
75
75
|
updatedAt: Date;
|
|
76
|
-
status: "pending" | "
|
|
77
|
-
failed: number;
|
|
76
|
+
status: "pending" | "running" | "success" | "failed";
|
|
78
77
|
success: number;
|
|
78
|
+
failed: number;
|
|
79
79
|
ignored: number;
|
|
80
80
|
fileId: string;
|
|
81
81
|
total: number;
|