# User ## [](#api) user.api - **Type** ```ts interface User { api: Api; } ``` ## [](#id) user.id The user's ADAMANT address - **Type** ```ts interface User { id: string; } ``` ## [](#publicKey) user.publicKey The user's Public Key - **Type** ```ts interface User { publicKey: string; } ``` ## [](#balance) user.balance() Gets the user's account balance - **Type** ```ts interface User { balance(): Promise; } interface GetAccountBalanceResponseDto { balance: string; nodeTimestamp: number; success: boolean; unconfirmedBalance: string; } ``` ## [](#chatMessages) user.chatMessages() Returns list of the chat messages between the bot and the user - **Type** ```ts interface User { chatMessages(): Promise; } interface GetChatMessagesResponseDto { messages: (ChatMessageTransaction | TokenTransferTransaction)[]; nodeTimestamp: number; participants: ChatParticipant[]; success: boolean; } type TokenTransferTransaction = { asset: TokenTransferAsset; type: number; } & BaseTransaction; type ChatMessageTransaction = { asset: ChatMessageAsset; type: number; } & BaseTransaction; interface ChatParticipant { address: string; publicKey: string; } interface BaseTransaction { amount: number; asset: object; blockId: string; block_timestamp: number; confirmations: number; fee: number; height: number; id: string; recipientId: string; recipientPublicKey: string; senderId: string; senderPublicKey: string; signature: string; signatures: string[]; timestamp: number; type: number; } type TokenTransferAsset = object; interface ChatMessageAsset { chat: { message?: string; own_message?: string; type?: number }; } ``` ## [](#info) user.info() Returns the user's account information using - **Type** ```ts interface User { info(): Promise; } interface GetAccountInfoResponseDto { account: AccountDto; nodeTimestamp: number; success: boolean; } interface AccountDto { address: string; balance: string; multisignatures: string[]; publicKey: string; secondPublicKey: string; secondSignature: number; u_multisignatures: string[]; unconfirmedBalance: string; unconfirmedSignature: number; } ``` ## [](#reply) user.reply() Sends a message to the user - **Type** ```ts interface User { reply( message: string, messageType?: MessageType, amount?: number, isADM?: boolean ): Promise; } interface TransferTokenResponseDto { nodeTimestamp: number; success: boolean; transactionId: string; } ``` - **References** [`MessageType`](Api/Types.md#MessageType) ## [](#send) user.send() Sends the given amount of tokens to the user - **Type** ```ts interface User { send(amount: number, isADM?: boolean): Promise; } interface TransferTokenResponseDto { nodeTimestamp: number; success: boolean; transactionId: string; } ```