///
import * as IlpPacket from 'ilp-packet';
import BigNumber from 'bignumber.js';
import { Account } from './account';
import { Protocol, BtpData, Claim, Paychan, Store } from './util';
declare const MiniAccountsPlugin: any;
export interface ExtraInfo {
address: string;
account: string;
currencyScale: number;
channel?: string;
clientChannel?: string;
}
export declare enum AdminCommandName {
BLOCK = "block",
SETTLE = "settle"
}
export interface AdminCommand {
command: AdminCommandName;
account: string;
amount?: string;
}
export interface IlpPluginAsymServerOpts {
assetScale?: number;
currencyScale?: number;
maxPacketAmount?: string;
xrpServer: string;
secret: string;
address: string;
maxBalance?: string;
bandwidth?: string;
claimInterval?: number;
_store: Store;
maxFeePercent?: string;
log: any;
}
export default class IlpPluginAsymServer extends MiniAccountsPlugin {
static version: number;
private _maxPacketAmount;
private _currencyScale;
private _xrpServer;
private _secret;
private _address;
private _api;
private _watcher;
private _bandwidth;
private _claimInterval;
private _store;
private _txSubmitter;
private _maxFeePercent;
private _channelToAccount;
private _accounts;
private _log;
constructor(opts: IlpPluginAsymServerOpts);
xrpToBase(amount: BigNumber.Value): string;
baseToXrp(amount: BigNumber.Value): string;
sendTransfer(): void;
_validatePaychanDetails(paychan: Paychan): void;
_getAccount(from: string): Account;
_extraInfo(account: Account): ExtraInfo;
_channelClaim(account: Account, close?: boolean): Promise;
_channelClose(channelId: string): Promise;
_preConnect(): Promise;
_connect(address: string, btpData: BtpData): Promise;
_fundOutgoingChannel(account: Account, primary: Protocol): Promise;
_handleCustomData(from: string, message: BtpData): Promise;
_isClaimProfitable(account: Account): Promise;
_autoClaim(account: Account): Promise;
_registerAutoClaim(account: Account): Promise;
_expireData(account: Account, ilpData: Buffer): Promise;
_handleIncomingPrepare(account: Account, ilpData: Buffer): void;
_rejectIncomingTransfer(account: Account, ilpData: Buffer): void;
_sendPrepare(destination: string, parsedPacket: IlpPacket.IlpPacket): void;
_handlePrepareResponse(destination: string, parsedResponse: IlpPacket.IlpPacket, preparePacket: IlpPacket.IlpPacket): void;
_getAmountOwed(to: string): BigNumber;
_increaseAmountOwed(amount: string, to: string): void;
_decreaseAmountOwed(amount: string, to: string): void;
sendMoney(): Promise;
_sendMoneyToAccount(transferAmount: string, to: string): {
protocolName: string;
contentType: number;
data: Buffer;
}[];
_handleClaim(account: Account, claim: Claim): void;
_handleMoney(from: string, btpData: BtpData): void;
_disconnect(): Promise;
getAdminInfo(): Promise<{
xrpAddress: string;
xrpBalance: {
total: string;
reserved: string;
available: string;
};
clients: {
account: string;
xrpAddress: any;
channel: string;
channelBalance: any;
clientChannel: string;
clientChannelBalance: string;
state: string;
}[];
}>;
sendAdminInfo(cmd: AdminCommand): Promise<{}>;
}
export {};