import { ProviderInterface } from './providers/base-provider'; import { PrexStorage } from './storage/PrexStorage'; export type Address = `0x${string}`; export type Hex = `0x${string}`; export interface PrexClientOptions { apiKey?: string; endpoint?: string; debugMode?: boolean; maxFeePerGas?: string; maxPriorityFeePerGas?: string; provider?: ProviderInterface; storage?: PrexStorage; } export interface PrexUser { id: string; name: string; backupMode: boolean; privateKey?: Hex; address: Address; ownerIndex: number; walletId: string; isPasskeyPresentInDevice: boolean; passkeys: { id: string; userHandle: string; passkeyName: string; publicKey?: Hex; ownerIndex: number; isRegistered: boolean; backupStatus: boolean; createdAt: string; }[]; eoas: { id: number; ownerIndex: number; publicKey: Address; createdAt: string; }[]; } export interface SharedWalletList { sharedWallets: { address: Address; index: number; name?: string; isRemoved: boolean; owners: { address: Address; index: number; isRemoved: boolean; }[]; }[]; } export interface CreateWalletResult { wallet: PrexUser; } export interface TransferByLinkResponse { id: string; secret: string; hash: Hex; } export interface GetLinkTransferResponse { amount: bigint; token: Address; publicKey: Address; sender: Address; nonce: bigint; expiry: bigint; status: LinkRequestStatus; } export type LinkRequestStatus = 'EMPTY' | 'LIVE' | 'COMPLETED' | 'CANCELLED'; export type DistributionRequestStatus = | 'EMPTY' | 'PENDING' | 'COMPLETED' | 'CANCELLED'; export interface PagingOptions { limit: number; offset: number; } export interface TransferHistoryItem { id: string; movingType: string; token: Address; sender: Address; recipient: Address; recipientName: string; senderName: string; recipientPictureHash?: string; senderPictureHash?: string; recipientTokenHolder?: { balance: bigint; }; amount: bigint; metadata: Record; txHash: string; createdAt: number; } export interface LinkTransferHistoryItem { id: string; messageId?: string; token: string; sender: string; recipient?: string; senderName: string; recipientName?: string; amount: bigint; expiry: number; metadata: Record; txHash: string; status: LinkRequestStatus; createdAt: number; updatedAt: number; secret?: Hex; } export interface SwapHistoryItem { id: string; reactor: string; token: string; swapper: string; swapperName: string; amount: bigint; outputs: { id: string; token: string; amount: bigint; recipient: string; recipientName: string; }[]; createdAt: number; txHash: string; } export interface TokenHolder { id: string; token: string; holderAddress: string; holderName: string; balance: bigint; receivedAmount: bigint; sentAmount: bigint; receivedCount: number; sentCount: number; uniqueReceivedCount: number; uniqueSentCount: number; createdAt: number; updatedAt: number; } export interface TokenActivity { id: string; address: string; totalSupply: bigint; totalUniqueSenders: number; totalTransfers: number; totalTransferAmount: bigint; createdAt: number; updatedAt: number; } export interface TokenDistributeRequestEntity { id: string; status: DistributionRequestStatus; name: string; maxAmountPerAddress: bigint; expiry: number; token: string; sender: string; senderName: string; coordinate: string; cooltime: number; amountPerWithdrawal: bigint; amount: bigint; totalAmount: bigint; createdAt: number; txHash: string; secret?: string; shortCode?: string; } export type SignApprovalRequest = { contractAddress: Address; hash: Hex; }; export type SignTypedDataApprovalRequest = { domain: { name: string; version: string; chainId: number; verifyingContract: Address; }; types: any; message: any; }; export type ApprovalRequestFunction = ( request: string | SignApprovalRequest | SignTypedDataApprovalRequest ) => Promise; export type DistributeRequest = { id: Hex; amount: bigint; amountPerWithdrawal: bigint; cooltime: bigint; maxAmountPerAddress: bigint; token: Address; publicKey: Address; sender: Address; expiry: bigint; status: DistributionRequestStatus; name: string; coordinate: Hex; userStatus?: { lastDistributedAt: bigint; amount: bigint; }; }; export type Token = { address: Address; // The address of the token contract chainId: number; // The chain id of the token contract decimals: number; // The number of token decimals image: string | null; // A string url of the token logo name: string; symbol: string; // A ticker symbol or shorthand, up to 11 characters precision?: number; }; export type PumToken = { id: string; name: string; symbol: string; issuer: { name: string; address: Address; }; reserveCT: bigint; reserveStable: bigint; isMarketOpen: boolean; uniqueBuyers: number; metadata: string; createdAt: number; updatedAt: number; holders: { address: string; name?: string; }[]; hourlyPriceChange: PumTokenPrice[]; dailyPriceChange: PumTokenPrice[]; }; export type PumActionHistory = { id: string; user: { address: Address; name?: string; }; token?: { address: Address; name: string; symbol: string; issuer: { name: string; address: Address; }; }; action: 'ISSUE' | 'BUY' | 'SELL' | 'POINT'; recipient?: { address: Address; name?: string; }; amountIn?: bigint; amountOut?: bigint; txHash: string; createdAt: number; }; export type PumTokenPrice = { id: string; token?: { address: Address; name: string; symbol: string; }; interval: 'HOUR' | 'DAY'; open: bigint; high: bigint; low: bigint; close: bigint; volume: bigint; traderCount: number; buyers: { id: string; name?: string; }[]; sellers: { id: string; name?: string; }[]; startAt: number; createdAt: number; updatedAt: number; }; export type TransferHistoryQuery = | { user: Address; } | { token: Address; } | { token: Address; movingType: 'DIRECT' | 'SECRET' | 'ONETIME' | 'TOKEN_DISTRIBUTE'; } | { me: Address; other: Address; }; export type SubKeyMessage = { issuedAt: number; expiredAt: number; newPublicKey: string; extraHash: `0x${string}`; };