@mxlabs/okxnotify
Version:
OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle
142 lines (141 loc) • 4.56 kB
TypeScript
/**
* 收集 DEFI Web3 Wallet 的数据
*/
import { DEFI_TYPE_ENUM, OKX_ACCOUNT_ID_ENUM, OKX_WALLET_CONFIG } from './constant';
interface GetUserAssetPlatformListBatchRes {
platformListByAccountId: {
platformListVoList: {
platformName: string;
analysisPlatformId: number;
platformLogo: string;
currencyAmount: string;
isSupportInvest: boolean;
platformUrl: string;
network: string;
networkLogo: string;
chainId: number;
investmentCount: number;
}[];
networkTotalAssetVoList: {
totalCurrencyAmount: string;
chainId: number;
chainName: string;
chainLogo: string;
}[];
totalAssets: string;
}[];
updateAt: number;
assetStatus: number;
}
/**
* 获取钱包别名
* @param accountId
* @returns
*/
export declare const getWalletAliasByAccountId: (accountId: string) => string;
export declare const getAccountIdFromAddress: ({ address }: {
address: string;
}) => Promise<any>;
/**
* 获取当前用户 WalletId 已绑定的DEFI平台列表
* @param param0
*/
export declare const getUserAssetPlatformList: ({ accountId, }: {
accountId: string;
}) => Promise<GetUserAssetPlatformListBatchRes>;
interface GetUserAssetDetailFromPlatformItem {
platformName: string;
platformUrl: string;
network: string;
accountId: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]['accountId'];
address: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]['address'];
alias: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]['alias'];
borrow: {
investmentName: string;
investName: string;
totalValue: number;
investNumber: number;
symbols: string;
}[];
supply: {
investmentName: string;
investName: string;
totalValue: number;
investNumber: number;
symbols: string;
}[];
}
/**
* 获取用户资产详情,通过DEFI平台列表获取
* 由于会进行循环贷,可以看到多个投资品情况
* - 质押多少
* - 借贷多少
* @param accountId 用户AccountId
* @returns
*/
export declare const getUserAssetDetailFromPlatform: ({ accountId, }: {
accountId: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]["accountId"];
}) => Promise<GetUserAssetDetailFromPlatformItem[]>;
/**
* 获取多个用户资产详情,批量获取投资品列表
* @param param0
* @returns
*/
export declare const getUserAssetDetailFromPlatformBatch: ({ accountIdList, }: {
accountIdList: (typeof OKX_ACCOUNT_ID_ENUM)[keyof typeof OKX_ACCOUNT_ID_ENUM][];
}) => Promise<Array<{
accountId: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]["accountId"];
address: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]["address"];
alias: (typeof OKX_WALLET_CONFIG)[keyof typeof OKX_WALLET_CONFIG]["alias"];
investType: (typeof DEFI_TYPE_ENUM)[keyof typeof DEFI_TYPE_ENUM];
investmentName: string;
totalValue: number;
investNumber: number;
investName: string;
symbols: string;
platformName: string;
platformUrl: string;
network: string;
}>>;
/**
* 获取多个用户资产详情,批量获取投资品列表
* @param param0
* @returns
*/
export declare const getUserAssetPlatformListBatch: ({ accountIdList, }: {
accountIdList: (typeof OKX_ACCOUNT_ID_ENUM)[keyof typeof OKX_ACCOUNT_ID_ENUM][];
}) => Promise<{
accountId: (typeof OKX_ACCOUNT_ID_ENUM)[keyof typeof OKX_ACCOUNT_ID_ENUM];
platformList: {
platformName: string;
currencyAmount: string;
network: string;
chainId: number;
analysisPlatformId: number;
}[];
totalAssets: string;
}[]>;
interface GetUserAssetTokenListRes {
walletId: string;
accountId: string;
tokens: Array<{
walletId?: string;
accountId: string;
/** 币的数量,重要字段 */
coinAmount: number;
/** 折算成法币的金额,重要字段 */
currencyAmount: number;
/** 资产符号,如 ETH */
symbol: string;
/** 资产名称,如 Ethereum */
name: string;
}>;
}
/**
* 获取用户资产Token列表
* @param param0
*/
export declare const getUserAssetTokenListBatch: ({ accountIdList, }: {
accountIdList: (typeof OKX_ACCOUNT_ID_ENUM)[keyof typeof OKX_ACCOUNT_ID_ENUM][];
}) => Promise<GetUserAssetTokenListRes["tokens"]>;
export {};