games_app/backend/dist/services/treasuryService.d.ts

244 lines
6.4 KiB
TypeScript

/**
* Treasury overview and cold ↔ hot funding workflow.
*/
export declare function getTreasuryOverview(): Promise<{
sweepEnabled: boolean;
withdrawalsEnabled: boolean;
assets: {
walletType: import("../models").WalletType;
coldWallet: {
id: string;
address: string;
label: string | null;
isActive: boolean;
} | null;
hotWallet: {
id: string;
address: string;
isActive: boolean;
} | null;
hotOnChainBalance: string | null;
coldOnChainBalance: string | null;
hotNativeBalance: string | null;
coldNativeBalance: string | null;
nativeSymbol: string | null;
nativeDecimals: number | null;
minNativeForWithdraw: string | null;
hotNativeOk: boolean | null;
}[];
recentPendingSweeps: number;
recentFailedSweeps: number;
inProgressSweeps: {
count: number;
totalAmountRaw: string;
};
pendingColdToHotFunding: {
id: string;
walletTypeId: number;
direction: string;
amount: string;
fromAddress: string | null;
toAddress: string | null;
status: string;
createdAt: Date;
}[];
stuckDepositAddresses: number;
}>;
export declare function setColdWallet(input: {
walletTypeId: number;
address: string;
label?: string;
}): Promise<{
id: string;
walletTypeId: number;
address: string;
label: string | null;
isActive: boolean;
}>;
export declare function listColdWallets(): Promise<{
id: string;
walletTypeId: number;
address: string;
label: string | null;
isActive: boolean;
createdAt: Date;
}[]>;
export declare function listSweeps(opts: {
status?: string;
limit?: number;
offset?: number;
}): Promise<{
items: {
id: string;
userId: string;
walletTypeId: number;
fromAddress: string;
toColdAddress: string;
amount: string;
status: string;
blockchainTxId: string | null;
depositTransactionId: string | null;
errorMessage: string | null;
createdAt: Date;
}[];
total: number;
}>;
export declare function previewHotToColdGas(walletTypeId: number): Promise<{
walletTypeId: number;
network: string;
symbol: string;
decimals: number;
fromHot: string;
toCold: string;
hotNative: string;
coldNative: string;
minReserve: string;
txBuffer: string;
maxSendable: string;
}>;
export declare function executeHotToColdGas(input: {
walletTypeId: number;
amountRaw: bigint;
notes?: string;
requestedBy: string;
approvedBy: string;
}): Promise<{
fundingId: string;
blockchainTxId: string;
from: string;
to: string;
amount: string;
symbol: string;
message: string;
}>;
/** Preview USDT (or network token) Hot → Cold: balances, gas, maxSendable after reserve. */
export declare function previewHotToColdUsdt(walletTypeId: number): Promise<{
walletTypeId: number;
network: string;
walletCode: string;
tokenSymbol: string;
tokenDecimals: number;
tokenContract: string;
fromHot: string;
toCold: string;
hotUsdt: string;
coldUsdt: string;
hotNative: string;
nativeSymbol: string;
nativeDecimals: number;
minNativeForWithdraw: string;
txFeeBuffer: string;
minUsdtReserve: string;
maxSendable: string;
gasOk: boolean;
gasHint: string | null;
}>;
/** Platform-signed USDT Hot → Cold after Super Admin approval. */
export declare function executeHotToColdUsdt(input: {
walletTypeId: number;
amountRaw: bigint;
notes?: string;
requestedBy: string;
approvedBy: string;
}): Promise<{
fundingId: string;
blockchainTxId: string;
from: string;
to: string;
amount: string;
symbol: string;
network: string;
message: string;
}>;
export declare function requestColdToHotGasFunding(requestedBy: string, input: {
walletTypeId: number;
amountRaw: bigint;
notes?: string;
approvedBy?: string;
}): Promise<{
id: string;
status: string;
fromAddress: string | null;
toAddress: string | null;
amount: string;
symbol: string;
message: string;
}>;
export declare function requestColdToHotFunding(requestedBy: string, input: {
walletTypeId: number;
amountRaw: bigint;
notes?: string;
approvedBy?: string;
}): Promise<{
id: string;
status: string;
fromAddress: string | null;
toAddress: string | null;
amount: string;
message: string;
}>;
export declare function confirmColdToHotFunding(adminUserId: string, fundingId: string, blockchainTxId: string): Promise<{
id: string;
status: string;
blockchainTxId: string | null;
}>;
export declare function listFunding(opts: {
status?: string;
limit?: number;
offset?: number;
}): Promise<{
items: {
id: string;
walletTypeId: number;
direction: string;
amount: string;
status: string;
blockchainTxId: string | null;
fromAddress: string | null;
toAddress: string | null;
notes: string | null;
approvedBy: string | null;
createdAt: Date;
}[];
total: number;
}>;
export declare function cancelFunding(fundingId: string): Promise<void>;
export type StuckDepositIssue = 'uncredited' | 'awaiting_sweep_approval' | 'sweep_failed' | 'credited_still_on_hd';
export declare function listStuckDeposits(): Promise<{
checkedAt: string;
count: number;
items: {
userId: string;
userLabel: string;
walletTypeId: number;
walletCode: string;
walletName: string;
network: string;
decimals: number;
address: string;
onChainAmount: string;
lastCheckedAt: Date;
issue: StuckDepositIssue;
}[];
}>;
export declare function scanStuckDeposits(): Promise<{
sweepEnabled: boolean;
sweepsEnqueued: number;
sweepsAlreadyQueued: number;
checkedAt: string;
count: number;
items: {
userId: string;
userLabel: string;
walletTypeId: number;
walletCode: string;
walletName: string;
network: string;
decimals: number;
address: string;
onChainAmount: string;
lastCheckedAt: Date;
issue: StuckDepositIssue;
}[];
}>;
//# sourceMappingURL=treasuryService.d.ts.map