commit dist

This commit is contained in:
woodser 2022-05-04 21:30:48 -04:00
parent 65868f21e5
commit 4b1565050e
22 changed files with 79754 additions and 1 deletions

1
.gitignore vendored
View File

@ -12,7 +12,6 @@ backup.zip
# production
/build
/dist
# misc
.DS_Store

524
dist/HavenoClient.d.ts vendored Normal file
View File

@ -0,0 +1,524 @@
import type * as grpcWeb from "grpc-web";
import { GetVersionClient, AccountClient, MoneroConnectionsClient, DisputesClient, DisputeAgentsClient, NotificationsClient, WalletsClient, PriceClient, OffersClient, PaymentAccountsClient, TradesClient, ShutdownServerClient, MoneroNodeClient } from './protobuf/GrpcServiceClientPb';
import { MarketPriceInfo, MarketDepthInfo, XmrBalanceInfo, OfferInfo, TradeInfo, XmrTx, XmrDestination, NotificationMessage, UrlConnection } from "./protobuf/grpc_pb";
import { PaymentMethod, PaymentAccount, Attachment, DisputeResult, Dispute, ChatMessage, MoneroNodeSettings } from "./protobuf/pb_pb";
/**
* Haveno daemon client using gRPC.
*/
export default class HavenoClient {
_appName: string | undefined;
_getVersionClient: GetVersionClient;
_disputeAgentsClient: DisputeAgentsClient;
_disputesClient: DisputesClient;
_notificationsClient: NotificationsClient;
_notificationStream: grpcWeb.ClientReadableStream<NotificationMessage> | undefined;
_moneroConnectionsClient: MoneroConnectionsClient;
_moneroNodeClient: MoneroNodeClient;
_walletsClient: WalletsClient;
_priceClient: PriceClient;
_paymentAccountsClient: PaymentAccountsClient;
_offersClient: OffersClient;
_tradesClient: TradesClient;
_accountClient: AccountClient;
_shutdownServerClient: ShutdownServerClient;
_url: string;
_password: string;
_process: any;
_processLogging: boolean;
_walletRpcPort: number | undefined;
_notificationListeners: ((_notification: NotificationMessage) => void)[];
_registerNotificationListenerCalled: boolean;
_keepAliveLooper: any;
_keepAlivePeriodMs: number;
static readonly _fullyInitializedMessage = "Application fully initialized";
static readonly _loginRequiredMessage = "Interactive login required";
/**
* Construct a client connected to a Haveno daemon.
*
* @param {string} url - Haveno daemon url
* @param {string} password - Haveno daemon password
*/
constructor(url: string, password: string);
/**
* Start a new Haveno process.
*
* @param {string} havenoPath - path to Haveno binaries
* @param {string[]} cmd - command to start the process
* @param {string} url - Haveno daemon url (must proxy to api port)
* @param {boolean} enableLogging - specifies if logging is enabled or disabled at log level 3
* @return {haveno} a client connected to the newly started Haveno process
*/
static startProcess(havenoPath: string, cmd: string[], url: string, enableLogging: boolean): Promise<HavenoClient>;
/**
* Return the process running the haveno daemon.
*
* @return the process running the haveno daemon
*/
getProcess(): any;
/**
* Enable or disable process logging.
*
* @param {boolean} enabled - specifies if logging is enabled or disabled
*/
setProcessLogging(enabled: boolean): void;
/**
* Get the URL of the Haveno daemon.
*
* @return {string} the URL of the Haveno daemon
*/
getUrl(): string;
/**
* Get the port of the primary wallet rpc instance if known.
*
* @return {number|undefined} the port of the primary wallet rpc instance if known
*/
getWalletRpcPort(): number | undefined;
/**
* Get the name of the Haveno application folder.
*/
getAppName(): string | undefined;
/**
* Get the Haveno version.
*
* @return {string} the Haveno daemon version
*/
getVersion(): Promise<string>;
/**
* Indicates if connected and authenticated with the Haveno daemon.
*
* @return {boolean} true if connected with the Haveno daemon, false otherwise
*/
isConnectedToDaemon(): Promise<boolean>;
/**
* Indicates if the Haveno account is created.
*
* @return {boolean} true if the account is created, false otherwise
*/
accountExists(): Promise<boolean>;
/**
* Indicates if the Haveno account is open and authenticated with the correct password.
*
* @return {boolean} true if the account is open and authenticated, false otherwise
*/
isAccountOpen(): Promise<boolean>;
/**
* Create and open a new Haveno account.
*
* @param {string} password - the password to encrypt the account
*/
createAccount(password: string): Promise<void>;
/**
* Open existing Haveno account.
*
* @param {string} password - the account password
*/
openAccount(password: string): Promise<void>;
/**
* Change the Haveno account password.
*
* @param {string} password - the new account password
*/
changePassword(password: string): Promise<void>;
/**
* Close the currently open account.
*/
closeAccount(): Promise<void>;
/**
* Permanently delete the Haveno account and shutdown the server. // TODO: possible to not shutdown server?
*/
deleteAccount(): Promise<void>;
/**
* Backup the account to the given stream. TODO: stream type?
*/
backupAccount(stream: any): Promise<number>;
/**
* Restore the account from zip bytes.
*
* Sends chunked requests if size over max grpc envelope size (41943404 bytes).
*
* @param {Uint8Array} zipBytes - the bytes of the zipped account to restore
*/
restoreAccount(zipBytes: Uint8Array): Promise<void>;
/**
* Add a listener to receive notifications from the Haveno daemon.
*
* @param {(notification: NotificationMessage) => void} listener - the notification listener to add
*/
addNotificationListener(listener: (_notification: NotificationMessage) => void): Promise<void>;
/**
* Remove a notification listener.
*
* @param {(notification: NotificationMessage) => void} listener - the notification listener to remove
*/
removeNotificationListener(listener: (_notification: NotificationMessage) => void): Promise<void>;
/**
* Indicates if connected to the Monero network based on last connection check.
*
* @return {boolean} true if connected to the Monero network, false otherwise
*/
isConnectedToMonero(): Promise<boolean>;
/**
* Add a Monero daemon connection.
*
* @param {string | UrlConnection} connection - daemon url or connection to add
*/
addMoneroConnection(connection: string | UrlConnection): Promise<void>;
/**
* Remove a Monero daemon connection.
*
* @param {string} url - url of the daemon connection to remove
*/
removeMoneroConnection(url: string): Promise<void>;
/**
* Get the current Monero daemon connection.
*
* @return {UrlConnection | undefined} the current daemon connection, undefined if no current connection
*/
getMoneroConnection(): Promise<UrlConnection | undefined>;
/**
* Get all Monero daemon connections.
*
* @return {UrlConnection[]} all daemon connections
*/
getMoneroConnections(): Promise<UrlConnection[]>;
/**
* Set the current Monero daemon connection.
*
* Add the connection if not previously seen.
* If the connection is provided as string, connect to the URI with any previously set credentials and priority.
* If the connection is provided as UrlConnection, overwrite any previously set credentials and priority.
* If undefined connection provided, disconnect the client.
*
* @param {string | UrlConnection} connection - connection to set as current
*/
setMoneroConnection(connection?: string | UrlConnection): Promise<void>;
/**
* Check the current Monero daemon connection.
*
* If disconnected and auto switch enabled, switch to the best available connection and return its status.
*
* @return {UrlConnection | undefined} the current daemon connection status, undefined if no current connection
*/
checkMoneroConnection(): Promise<UrlConnection | undefined>;
/**
* Check all Monero daemon connections.
*
* @return {UrlConnection[]} status of all managed connections.
*/
checkMoneroConnections(): Promise<UrlConnection[]>;
/**
* Check the connection and start checking the connection periodically.
*
* @param {number} refreshPeriod - time between checks in milliseconds (default 15000 ms or 15 seconds)
*/
startCheckingConnection(refreshPeriod: number): Promise<void>;
/**
* Stop checking the connection status periodically.
*/
stopCheckingConnection(): Promise<void>;
/**
* Get the best available connection in order of priority then response time.
*
* @return {UrlConnection | undefined} the best available connection in order of priority then response time, undefined if no connections available
*/
getBestAvailableConnection(): Promise<UrlConnection | undefined>;
/**
* Automatically switch to the best available connection if current connection is disconnected after being checked.
*
* @param {boolean} autoSwitch - whether auto switch is enabled or disabled
*/
setAutoSwitch(autoSwitch: boolean): Promise<void>;
/**
* Returns whether daemon is running a local monero node.
*/
isMoneroNodeRunning(): Promise<boolean>;
/**
* Gets the current local monero node settings.
*/
getMoneroNodeSettings(): Promise<MoneroNodeSettings | undefined>;
/**
* Starts the local monero node.
*
* @param {MoneroNodeSettings} settings - the settings to start the local node with
*/
startMoneroNode(settings: MoneroNodeSettings): Promise<void>;
/**
* Stops the local monero node.
*/
stopMoneroNode(): Promise<void>;
/**
* Register as a dispute agent.
*
* @param {string} disputeAgentType - type of dispute agent to register, e.g. mediator, refundagent
* @param {string} registrationKey - registration key
*/
registerDisputeAgent(disputeAgentType: string, registrationKey: string): Promise<void>;
/**
* Get the user's balances.
*
* @return {XmrBalanceInfo} the user's balances
*/
getBalances(): Promise<XmrBalanceInfo>;
/**
* Get a new subaddress in the Monero wallet to receive deposits.
*
* @return {string} the deposit address (a subaddress in the Haveno wallet)
*/
getNewDepositAddress(): Promise<string>;
/**
* Get all transactions in the Monero wallet.
*
* @return {XmrTx[]} the transactions
*/
getXmrTxs(): Promise<XmrTx[]>;
/**
* Get a transaction by hash in the Monero wallet.
*
* @param {String} txHash - hash of the transaction to get
* @return {XmrTx} the transaction with the hash
*/
getXmrTx(txHash: string): Promise<XmrTx>;
/**
* Create but do not relay a transaction to send funds from the Monero wallet.
*
* @return {XmrTx} the created transaction
*/
createXmrTx(destinations: XmrDestination[]): Promise<XmrTx>;
/**
* Relay a previously created transaction to send funds from the Monero wallet.
*
* @return {string} the hash of the relayed transaction
*/
relayXmrTx(metadata: string): Promise<string>;
/**
* Get the current market price per 1 XMR in the given currency.
*
* @param {string} currencyCode - currency code (fiat or crypto) to get the price of
* @return {number} the current market price per 1 XMR in the given currency
*/
getPrice(currencyCode: string): Promise<number>;
/**
* Get the current market prices of all currencies.
*
* @return {MarketPrice[]} price per 1 XMR in all supported currencies (fiat & crypto)
*/
getPrices(): Promise<MarketPriceInfo[]>;
/**
* Get the market depth of a currency.
*
* @param {string} assetCode - asset to get the market depth of
* @return {MarketDepthInfo} market depth of the given currency
*/
getMarketDepth(assetCode: string): Promise<MarketDepthInfo>;
/**
* Get payment methods.
*
* @return {PaymentMethod[]} the payment methods
*/
getPaymentMethods(): Promise<PaymentMethod[]>;
/**
* Get payment accounts.
*
* @return {PaymentAccount[]} the payment accounts
*/
getPaymentAccounts(): Promise<PaymentAccount[]>;
/**
* Get a payment account by id.
*
* @param {string} paymentAccountId - the payment account id to get
* @return {PaymentAccount} the payment account
*/
getPaymentAccount(paymentAccountId: string): Promise<PaymentAccount>;
/**
* Get a form for the given payment method to complete and create a new payment account.
*
* @return {object} the payment account form as JSON
*/
getPaymentAccountForm(paymentMethodId: string): Promise<any>;
/**
* Create a payment account.
*
* @param {object} paymentAccountForm - the completed form as JSON to create the payment account
* @return {PaymentAccount} the created payment account
*/
createPaymentAccount(paymentAccountForm: any): Promise<PaymentAccount>;
/**
* Create a crypto payment account.
*
* @param {string} accountName - description of the account
* @param {string} assetCode - traded asset code
* @param {string} address - payment address of the account
* @return {PaymentAccount} the created payment account
*/
createCryptoPaymentAccount(accountName: string, assetCode: string, address: string): Promise<PaymentAccount>;
/**
* Get available offers to buy or sell XMR.
*
* @param {string} assetCode - traded asset code
* @param {string|undefined} direction - "buy" or "sell" (default all)
* @return {OfferInfo[]} the available offers
*/
getOffers(assetCode: string, direction?: string): Promise<OfferInfo[]>;
/**
* Get the user's posted offers to buy or sell XMR.
*
* @param {string} assetCode - traded asset code
* @param {string|undefined} direction - "buy" or "sell" XMR (default all)
* @return {OfferInfo[]} the user's created offers
*/
getMyOffers(assetCode: string, direction?: string): Promise<OfferInfo[]>;
/**
* Get my offer by id.
*
* @param {string} offerId - id of the user's created offer
* @return {OfferInfo} the user's created offer
*/
getMyOffer(offerId: string): Promise<OfferInfo>;
/**
* Post an offer.
*
* @param {string} direction - "buy" or "sell" XMR
* @param {bigint} amount - amount of XMR to trade
* @param {string} assetCode - asset code to trade for XMR
* @param {string} paymentAccountId - payment account id
* @param {number} buyerSecurityDeposit - buyer security deposit as % of trade amount
* @param {number} price - trade price (optional, default to market price)
* @param {number} marketPriceMargin - if using market price, % from market price to accept (optional, default 0%)
* @param {bigint} minAmount - minimum amount to trade (optional, default to fixed amount)
* @param {number} triggerPrice - price to remove offer (optional)
* @return {OfferInfo} the posted offer
*/
postOffer(direction: string, amount: bigint, assetCode: string, paymentAccountId: string, buyerSecurityDeposit: number, price?: number, marketPriceMargin?: number, triggerPrice?: number, minAmount?: bigint): Promise<OfferInfo>;
/**
* Remove a posted offer, releasing its reserved funds.
*
* @param {string} offerId - the offer id to cancel
*/
removeOffer(offerId: string): Promise<void>;
/**
* Take an offer.
*
* @param {string} offerId - id of the offer to take
* @param {string} paymentAccountId - id of the payment account
* @return {TradeInfo} the initialized trade
*/
takeOffer(offerId: string, paymentAccountId: string): Promise<TradeInfo>;
/**
* Get a trade by id.
*
* @param {string} tradeId - the id of the trade and its offer
* @return {TradeInfo} the trade with the given id
*/
getTrade(tradeId: string): Promise<TradeInfo>;
/**
* Get all trades.
*
* @return {TradeInfo[]} all user trades
*/
getTrades(): Promise<TradeInfo[]>;
/**
* Confirm a payment is started.
*
* @param {string} tradeId - the id of the trade
*/
confirmPaymentStarted(tradeId: string): Promise<void>;
/**
* Confirm a payment is received.
*
* @param {string} tradeId - the id of the trade
*/
confirmPaymentReceived(tradeId: string): Promise<void>;
/**
* Get all chat messages for a trade.
*
* @param {string} tradeId - the id of the trade
*/
getChatMessages(tradeId: string): Promise<ChatMessage[]>;
/**
* Send a trade chat message.
*
* @param {string} tradeId - the id of the trade
* @param {string} message - the message
*/
sendChatMessage(tradeId: string, message: string): Promise<void>;
/**
* Get a dispute by trade id.
*
* @param {string} tradeId - the id of the trade
*/
getDispute(tradeId: string): Promise<Dispute>;
/**
* Get all disputes.
*/
getDisputes(): Promise<Dispute[]>;
/**
* Open a dispute for a trade.
*
* @param {string} tradeId - the id of the trade
*/
openDispute(tradeId: string): Promise<void>;
/**
* Resolve a dispute. By default, the winner receives the trade amount and the security deposits are returned,
* but the arbitrator may award a custom amount to the winner.
*
* @param {string} tradeId - the id of the trade
* @param {DisputeResult.Winner} winner - the winner of the dispute
* @param {DisputeResult.Reason} reason - the reason for the dispute
* @param {string} summaryNotes - summary of the dispute
* @param {bigint} customWinnerAmount - custom amount to award the winner (optional)
*/
resolveDispute(tradeId: string, winner: DisputeResult.Winner, reason: DisputeResult.Reason, summaryNotes: string, customWinnerAmount?: bigint): Promise<void>;
/**
* Send a dispute chat message.
*
* @param {string} disputeId - the id of the dispute
* @param {string} message - the message
* @param {Attachment[]} attachments - attachments
*/
sendDisputeChatMessage(disputeId: string, message: string, attachments: Attachment[]): Promise<void>;
/**
* Disconnect this client from the server.
*/
disconnect(): Promise<void>;
/**
* Shutdown the Haveno daemon server and stop the process if applicable.
*/
shutdownServer(): Promise<void>;
/**
* Wait for the application to be fully initialized with an account and a
* connection to the Haveno network.
*
* TODO:
*
* Currently when the application starts, the account is first initialized with createAccount()
* or openAccount() which return immediately. A notification is sent after all setup is complete and
* the application is connected to the Haveno network.
*
* Ideally when the application starts, the system checks the Haveno network connection, supporting
* havenod.isHavenoConnectionInitialized() and havenod.awaitHavenoConnectionInitialized().
* Independently, gRPC createAccount() and openAccount() return after all account setup and reading from disk.
*
* @hidden
*/
_awaitAppInitialized(): Promise<void>;
_isAppInitialized(): Promise<boolean>;
/**
* Update notification listener registration.
* Due to the nature of grpc streaming, this method returns a promise
* which may be resolved before the listener is actually registered.
*/
_updateNotificationListenerRegistration(): Promise<void>;
/**
* Send a notification.
*
* @hidden
* @param {NotificationMessage} notification - notification to send
*/
_sendNotification(notification: NotificationMessage): Promise<void>;
/**
* Restore an account chunk from zip bytes.
*
* @hidden
*/
_restoreAccountChunk(zipBytes: Uint8Array, offset: number, totalLength: number, hasMore: boolean): Promise<void>;
}

1333
dist/HavenoClient.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
dist/HavenoClient.js.map vendored Normal file

File diff suppressed because one or more lines are too long

3
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import HavenoClient from "./HavenoClient";
import HavenoUtils from "./utils/HavenoUtils";
export { HavenoClient, HavenoUtils };

4
dist/index.js vendored Normal file
View File

@ -0,0 +1,4 @@
import HavenoClient from "./HavenoClient";
import HavenoUtils from "./utils/HavenoUtils";
export { HavenoClient, HavenoUtils };
//# sourceMappingURL=index.js.map

1
dist/index.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,YAAY,EAAE,WAAW,EAAC,CAAA"}

461
dist/protobuf/GrpcServiceClientPb.d.ts vendored Normal file
View File

@ -0,0 +1,461 @@
/**
* @fileoverview gRPC-Web generated client stub for io.bisq.protobuffer
* @enhanceable
* @public
*/
import * as grpcWeb from 'grpc-web';
import * as grpc_pb from './grpc_pb';
export declare class HelpClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetMethodHelp: grpcWeb.MethodDescriptor<grpc_pb.GetMethodHelpRequest, grpc_pb.GetMethodHelpReply>;
getMethodHelp(request: grpc_pb.GetMethodHelpRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetMethodHelpReply>;
getMethodHelp(request: grpc_pb.GetMethodHelpRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetMethodHelpReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetMethodHelpReply>;
}
export declare class GetVersionClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetVersion: grpcWeb.MethodDescriptor<grpc_pb.GetVersionRequest, grpc_pb.GetVersionReply>;
getVersion(request: grpc_pb.GetVersionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetVersionReply>;
getVersion(request: grpc_pb.GetVersionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetVersionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetVersionReply>;
}
export declare class AccountClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoAccountExists: grpcWeb.MethodDescriptor<grpc_pb.AccountExistsRequest, grpc_pb.AccountExistsReply>;
accountExists(request: grpc_pb.AccountExistsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.AccountExistsReply>;
accountExists(request: grpc_pb.AccountExistsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.AccountExistsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.AccountExistsReply>;
methodInfoIsAccountOpen: grpcWeb.MethodDescriptor<grpc_pb.IsAccountOpenRequest, grpc_pb.IsAccountOpenReply>;
isAccountOpen(request: grpc_pb.IsAccountOpenRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.IsAccountOpenReply>;
isAccountOpen(request: grpc_pb.IsAccountOpenRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.IsAccountOpenReply) => void): grpcWeb.ClientReadableStream<grpc_pb.IsAccountOpenReply>;
methodInfoCreateAccount: grpcWeb.MethodDescriptor<grpc_pb.CreateAccountRequest, grpc_pb.CreateAccountReply>;
createAccount(request: grpc_pb.CreateAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CreateAccountReply>;
createAccount(request: grpc_pb.CreateAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CreateAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CreateAccountReply>;
methodInfoOpenAccount: grpcWeb.MethodDescriptor<grpc_pb.OpenAccountRequest, grpc_pb.OpenAccountReply>;
openAccount(request: grpc_pb.OpenAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.OpenAccountReply>;
openAccount(request: grpc_pb.OpenAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.OpenAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.OpenAccountReply>;
methodInfoIsAppInitialized: grpcWeb.MethodDescriptor<grpc_pb.IsAppInitializedRequest, grpc_pb.IsAppInitializedReply>;
isAppInitialized(request: grpc_pb.IsAppInitializedRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.IsAppInitializedReply>;
isAppInitialized(request: grpc_pb.IsAppInitializedRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.IsAppInitializedReply) => void): grpcWeb.ClientReadableStream<grpc_pb.IsAppInitializedReply>;
methodInfoChangePassword: grpcWeb.MethodDescriptor<grpc_pb.ChangePasswordRequest, grpc_pb.ChangePasswordReply>;
changePassword(request: grpc_pb.ChangePasswordRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.ChangePasswordReply>;
changePassword(request: grpc_pb.ChangePasswordRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.ChangePasswordReply) => void): grpcWeb.ClientReadableStream<grpc_pb.ChangePasswordReply>;
methodInfoCloseAccount: grpcWeb.MethodDescriptor<grpc_pb.CloseAccountRequest, grpc_pb.CloseAccountReply>;
closeAccount(request: grpc_pb.CloseAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CloseAccountReply>;
closeAccount(request: grpc_pb.CloseAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CloseAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CloseAccountReply>;
methodInfoDeleteAccount: grpcWeb.MethodDescriptor<grpc_pb.DeleteAccountRequest, grpc_pb.DeleteAccountReply>;
deleteAccount(request: grpc_pb.DeleteAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.DeleteAccountReply>;
deleteAccount(request: grpc_pb.DeleteAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.DeleteAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.DeleteAccountReply>;
methodInfoBackupAccount: grpcWeb.MethodDescriptor<grpc_pb.BackupAccountRequest, grpc_pb.BackupAccountReply>;
backupAccount(request: grpc_pb.BackupAccountRequest, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<grpc_pb.BackupAccountReply>;
methodInfoRestoreAccount: grpcWeb.MethodDescriptor<grpc_pb.RestoreAccountRequest, grpc_pb.RestoreAccountReply>;
restoreAccount(request: grpc_pb.RestoreAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.RestoreAccountReply>;
restoreAccount(request: grpc_pb.RestoreAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.RestoreAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.RestoreAccountReply>;
}
export declare class DisputesClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetDispute: grpcWeb.MethodDescriptor<grpc_pb.GetDisputeRequest, grpc_pb.GetDisputeReply>;
getDispute(request: grpc_pb.GetDisputeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetDisputeReply>;
getDispute(request: grpc_pb.GetDisputeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetDisputeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetDisputeReply>;
methodInfoGetDisputes: grpcWeb.MethodDescriptor<grpc_pb.GetDisputesRequest, grpc_pb.GetDisputesReply>;
getDisputes(request: grpc_pb.GetDisputesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetDisputesReply>;
getDisputes(request: grpc_pb.GetDisputesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetDisputesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetDisputesReply>;
methodInfoOpenDispute: grpcWeb.MethodDescriptor<grpc_pb.OpenDisputeRequest, grpc_pb.OpenDisputeReply>;
openDispute(request: grpc_pb.OpenDisputeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.OpenDisputeReply>;
openDispute(request: grpc_pb.OpenDisputeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.OpenDisputeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.OpenDisputeReply>;
methodInfoResolveDispute: grpcWeb.MethodDescriptor<grpc_pb.ResolveDisputeRequest, grpc_pb.ResolveDisputeReply>;
resolveDispute(request: grpc_pb.ResolveDisputeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.ResolveDisputeReply>;
resolveDispute(request: grpc_pb.ResolveDisputeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.ResolveDisputeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.ResolveDisputeReply>;
methodInfoSendDisputeChatMessage: grpcWeb.MethodDescriptor<grpc_pb.SendDisputeChatMessageRequest, grpc_pb.SendDisputeChatMessageReply>;
sendDisputeChatMessage(request: grpc_pb.SendDisputeChatMessageRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SendDisputeChatMessageReply>;
sendDisputeChatMessage(request: grpc_pb.SendDisputeChatMessageRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SendDisputeChatMessageReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SendDisputeChatMessageReply>;
}
export declare class DisputeAgentsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoRegisterDisputeAgent: grpcWeb.MethodDescriptor<grpc_pb.RegisterDisputeAgentRequest, grpc_pb.RegisterDisputeAgentReply>;
registerDisputeAgent(request: grpc_pb.RegisterDisputeAgentRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.RegisterDisputeAgentReply>;
registerDisputeAgent(request: grpc_pb.RegisterDisputeAgentRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.RegisterDisputeAgentReply) => void): grpcWeb.ClientReadableStream<grpc_pb.RegisterDisputeAgentReply>;
}
export declare class NotificationsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoRegisterNotificationListener: grpcWeb.MethodDescriptor<grpc_pb.RegisterNotificationListenerRequest, grpc_pb.NotificationMessage>;
registerNotificationListener(request: grpc_pb.RegisterNotificationListenerRequest, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<grpc_pb.NotificationMessage>;
methodInfoSendNotification: grpcWeb.MethodDescriptor<grpc_pb.SendNotificationRequest, grpc_pb.SendNotificationReply>;
sendNotification(request: grpc_pb.SendNotificationRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SendNotificationReply>;
sendNotification(request: grpc_pb.SendNotificationRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SendNotificationReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SendNotificationReply>;
}
export declare class MoneroConnectionsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoAddConnection: grpcWeb.MethodDescriptor<grpc_pb.AddConnectionRequest, grpc_pb.AddConnectionReply>;
addConnection(request: grpc_pb.AddConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.AddConnectionReply>;
addConnection(request: grpc_pb.AddConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.AddConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.AddConnectionReply>;
methodInfoRemoveConnection: grpcWeb.MethodDescriptor<grpc_pb.RemoveConnectionRequest, grpc_pb.RemoveConnectionReply>;
removeConnection(request: grpc_pb.RemoveConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.RemoveConnectionReply>;
removeConnection(request: grpc_pb.RemoveConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.RemoveConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.RemoveConnectionReply>;
methodInfoGetConnection: grpcWeb.MethodDescriptor<grpc_pb.GetConnectionRequest, grpc_pb.GetConnectionReply>;
getConnection(request: grpc_pb.GetConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetConnectionReply>;
getConnection(request: grpc_pb.GetConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetConnectionReply>;
methodInfoGetConnections: grpcWeb.MethodDescriptor<grpc_pb.GetConnectionsRequest, grpc_pb.GetConnectionsReply>;
getConnections(request: grpc_pb.GetConnectionsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetConnectionsReply>;
getConnections(request: grpc_pb.GetConnectionsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetConnectionsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetConnectionsReply>;
methodInfoSetConnection: grpcWeb.MethodDescriptor<grpc_pb.SetConnectionRequest, grpc_pb.SetConnectionReply>;
setConnection(request: grpc_pb.SetConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SetConnectionReply>;
setConnection(request: grpc_pb.SetConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SetConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SetConnectionReply>;
methodInfoCheckConnection: grpcWeb.MethodDescriptor<grpc_pb.CheckConnectionRequest, grpc_pb.CheckConnectionReply>;
checkConnection(request: grpc_pb.CheckConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CheckConnectionReply>;
checkConnection(request: grpc_pb.CheckConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CheckConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CheckConnectionReply>;
methodInfoCheckConnections: grpcWeb.MethodDescriptor<grpc_pb.CheckConnectionsRequest, grpc_pb.CheckConnectionsReply>;
checkConnections(request: grpc_pb.CheckConnectionsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CheckConnectionsReply>;
checkConnections(request: grpc_pb.CheckConnectionsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CheckConnectionsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CheckConnectionsReply>;
methodInfoStartCheckingConnections: grpcWeb.MethodDescriptor<grpc_pb.StartCheckingConnectionsRequest, grpc_pb.StartCheckingConnectionsReply>;
startCheckingConnections(request: grpc_pb.StartCheckingConnectionsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.StartCheckingConnectionsReply>;
startCheckingConnections(request: grpc_pb.StartCheckingConnectionsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StartCheckingConnectionsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StartCheckingConnectionsReply>;
methodInfoStopCheckingConnections: grpcWeb.MethodDescriptor<grpc_pb.StopCheckingConnectionsRequest, grpc_pb.StopCheckingConnectionsReply>;
stopCheckingConnections(request: grpc_pb.StopCheckingConnectionsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.StopCheckingConnectionsReply>;
stopCheckingConnections(request: grpc_pb.StopCheckingConnectionsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StopCheckingConnectionsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StopCheckingConnectionsReply>;
methodInfoGetBestAvailableConnection: grpcWeb.MethodDescriptor<grpc_pb.GetBestAvailableConnectionRequest, grpc_pb.GetBestAvailableConnectionReply>;
getBestAvailableConnection(request: grpc_pb.GetBestAvailableConnectionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetBestAvailableConnectionReply>;
getBestAvailableConnection(request: grpc_pb.GetBestAvailableConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetBestAvailableConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetBestAvailableConnectionReply>;
methodInfoSetAutoSwitch: grpcWeb.MethodDescriptor<grpc_pb.SetAutoSwitchRequest, grpc_pb.SetAutoSwitchReply>;
setAutoSwitch(request: grpc_pb.SetAutoSwitchRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SetAutoSwitchReply>;
setAutoSwitch(request: grpc_pb.SetAutoSwitchRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SetAutoSwitchReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SetAutoSwitchReply>;
}
export declare class MoneroNodeClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoIsMoneroNodeRunning: grpcWeb.MethodDescriptor<grpc_pb.IsMoneroNodeRunningRequest, grpc_pb.IsMoneroNodeRunningReply>;
isMoneroNodeRunning(request: grpc_pb.IsMoneroNodeRunningRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.IsMoneroNodeRunningReply>;
isMoneroNodeRunning(request: grpc_pb.IsMoneroNodeRunningRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.IsMoneroNodeRunningReply) => void): grpcWeb.ClientReadableStream<grpc_pb.IsMoneroNodeRunningReply>;
methodInfoGetMoneroNodeSettings: grpcWeb.MethodDescriptor<grpc_pb.GetMoneroNodeSettingsRequest, grpc_pb.GetMoneroNodeSettingsReply>;
getMoneroNodeSettings(request: grpc_pb.GetMoneroNodeSettingsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetMoneroNodeSettingsReply>;
getMoneroNodeSettings(request: grpc_pb.GetMoneroNodeSettingsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetMoneroNodeSettingsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetMoneroNodeSettingsReply>;
methodInfoStartMoneroNode: grpcWeb.MethodDescriptor<grpc_pb.StartMoneroNodeRequest, grpc_pb.StartMoneroNodeReply>;
startMoneroNode(request: grpc_pb.StartMoneroNodeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.StartMoneroNodeReply>;
startMoneroNode(request: grpc_pb.StartMoneroNodeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StartMoneroNodeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StartMoneroNodeReply>;
methodInfoStopMoneroNode: grpcWeb.MethodDescriptor<grpc_pb.StopMoneroNodeRequest, grpc_pb.StopMoneroNodeReply>;
stopMoneroNode(request: grpc_pb.StopMoneroNodeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.StopMoneroNodeReply>;
stopMoneroNode(request: grpc_pb.StopMoneroNodeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StopMoneroNodeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StopMoneroNodeReply>;
}
export declare class OffersClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetOffer: grpcWeb.MethodDescriptor<grpc_pb.GetOfferRequest, grpc_pb.GetOfferReply>;
getOffer(request: grpc_pb.GetOfferRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetOfferReply>;
getOffer(request: grpc_pb.GetOfferRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetOfferReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetOfferReply>;
methodInfoGetMyOffer: grpcWeb.MethodDescriptor<grpc_pb.GetMyOfferRequest, grpc_pb.GetMyOfferReply>;
getMyOffer(request: grpc_pb.GetMyOfferRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetMyOfferReply>;
getMyOffer(request: grpc_pb.GetMyOfferRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetMyOfferReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetMyOfferReply>;
methodInfoGetOffers: grpcWeb.MethodDescriptor<grpc_pb.GetOffersRequest, grpc_pb.GetOffersReply>;
getOffers(request: grpc_pb.GetOffersRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetOffersReply>;
getOffers(request: grpc_pb.GetOffersRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetOffersReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetOffersReply>;
methodInfoGetMyOffers: grpcWeb.MethodDescriptor<grpc_pb.GetMyOffersRequest, grpc_pb.GetMyOffersReply>;
getMyOffers(request: grpc_pb.GetMyOffersRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetMyOffersReply>;
getMyOffers(request: grpc_pb.GetMyOffersRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetMyOffersReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetMyOffersReply>;
methodInfoCreateOffer: grpcWeb.MethodDescriptor<grpc_pb.CreateOfferRequest, grpc_pb.CreateOfferReply>;
createOffer(request: grpc_pb.CreateOfferRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CreateOfferReply>;
createOffer(request: grpc_pb.CreateOfferRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CreateOfferReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CreateOfferReply>;
methodInfoCancelOffer: grpcWeb.MethodDescriptor<grpc_pb.CancelOfferRequest, grpc_pb.CancelOfferReply>;
cancelOffer(request: grpc_pb.CancelOfferRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CancelOfferReply>;
cancelOffer(request: grpc_pb.CancelOfferRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CancelOfferReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CancelOfferReply>;
}
export declare class PaymentAccountsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoCreatePaymentAccount: grpcWeb.MethodDescriptor<grpc_pb.CreatePaymentAccountRequest, grpc_pb.CreatePaymentAccountReply>;
createPaymentAccount(request: grpc_pb.CreatePaymentAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CreatePaymentAccountReply>;
createPaymentAccount(request: grpc_pb.CreatePaymentAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CreatePaymentAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CreatePaymentAccountReply>;
methodInfoGetPaymentAccounts: grpcWeb.MethodDescriptor<grpc_pb.GetPaymentAccountsRequest, grpc_pb.GetPaymentAccountsReply>;
getPaymentAccounts(request: grpc_pb.GetPaymentAccountsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetPaymentAccountsReply>;
getPaymentAccounts(request: grpc_pb.GetPaymentAccountsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetPaymentAccountsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetPaymentAccountsReply>;
methodInfoGetPaymentMethods: grpcWeb.MethodDescriptor<grpc_pb.GetPaymentMethodsRequest, grpc_pb.GetPaymentMethodsReply>;
getPaymentMethods(request: grpc_pb.GetPaymentMethodsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetPaymentMethodsReply>;
getPaymentMethods(request: grpc_pb.GetPaymentMethodsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetPaymentMethodsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetPaymentMethodsReply>;
methodInfoGetPaymentAccountForm: grpcWeb.MethodDescriptor<grpc_pb.GetPaymentAccountFormRequest, grpc_pb.GetPaymentAccountFormReply>;
getPaymentAccountForm(request: grpc_pb.GetPaymentAccountFormRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetPaymentAccountFormReply>;
getPaymentAccountForm(request: grpc_pb.GetPaymentAccountFormRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetPaymentAccountFormReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetPaymentAccountFormReply>;
methodInfoCreateCryptoCurrencyPaymentAccount: grpcWeb.MethodDescriptor<grpc_pb.CreateCryptoCurrencyPaymentAccountRequest, grpc_pb.CreateCryptoCurrencyPaymentAccountReply>;
createCryptoCurrencyPaymentAccount(request: grpc_pb.CreateCryptoCurrencyPaymentAccountRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CreateCryptoCurrencyPaymentAccountReply>;
createCryptoCurrencyPaymentAccount(request: grpc_pb.CreateCryptoCurrencyPaymentAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CreateCryptoCurrencyPaymentAccountReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CreateCryptoCurrencyPaymentAccountReply>;
methodInfoGetCryptoCurrencyPaymentMethods: grpcWeb.MethodDescriptor<grpc_pb.GetCryptoCurrencyPaymentMethodsRequest, grpc_pb.GetCryptoCurrencyPaymentMethodsReply>;
getCryptoCurrencyPaymentMethods(request: grpc_pb.GetCryptoCurrencyPaymentMethodsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetCryptoCurrencyPaymentMethodsReply>;
getCryptoCurrencyPaymentMethods(request: grpc_pb.GetCryptoCurrencyPaymentMethodsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetCryptoCurrencyPaymentMethodsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetCryptoCurrencyPaymentMethodsReply>;
}
export declare class PriceClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetMarketPrice: grpcWeb.MethodDescriptor<grpc_pb.MarketPriceRequest, grpc_pb.MarketPriceReply>;
getMarketPrice(request: grpc_pb.MarketPriceRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.MarketPriceReply>;
getMarketPrice(request: grpc_pb.MarketPriceRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.MarketPriceReply) => void): grpcWeb.ClientReadableStream<grpc_pb.MarketPriceReply>;
methodInfoGetMarketPrices: grpcWeb.MethodDescriptor<grpc_pb.MarketPricesRequest, grpc_pb.MarketPricesReply>;
getMarketPrices(request: grpc_pb.MarketPricesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.MarketPricesReply>;
getMarketPrices(request: grpc_pb.MarketPricesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.MarketPricesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.MarketPricesReply>;
methodInfoGetMarketDepth: grpcWeb.MethodDescriptor<grpc_pb.MarketDepthRequest, grpc_pb.MarketDepthReply>;
getMarketDepth(request: grpc_pb.MarketDepthRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.MarketDepthReply>;
getMarketDepth(request: grpc_pb.MarketDepthRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.MarketDepthReply) => void): grpcWeb.ClientReadableStream<grpc_pb.MarketDepthReply>;
}
export declare class GetTradeStatisticsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetTradeStatistics: grpcWeb.MethodDescriptor<grpc_pb.GetTradeStatisticsRequest, grpc_pb.GetTradeStatisticsReply>;
getTradeStatistics(request: grpc_pb.GetTradeStatisticsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetTradeStatisticsReply>;
getTradeStatistics(request: grpc_pb.GetTradeStatisticsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetTradeStatisticsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetTradeStatisticsReply>;
}
export declare class ShutdownServerClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoStop: grpcWeb.MethodDescriptor<grpc_pb.StopRequest, grpc_pb.StopReply>;
stop(request: grpc_pb.StopRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.StopReply>;
stop(request: grpc_pb.StopRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StopReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StopReply>;
}
export declare class TradesClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetTrade: grpcWeb.MethodDescriptor<grpc_pb.GetTradeRequest, grpc_pb.GetTradeReply>;
getTrade(request: grpc_pb.GetTradeRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetTradeReply>;
getTrade(request: grpc_pb.GetTradeRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetTradeReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetTradeReply>;
methodInfoGetTrades: grpcWeb.MethodDescriptor<grpc_pb.GetTradesRequest, grpc_pb.GetTradesReply>;
getTrades(request: grpc_pb.GetTradesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetTradesReply>;
getTrades(request: grpc_pb.GetTradesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetTradesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetTradesReply>;
methodInfoTakeOffer: grpcWeb.MethodDescriptor<grpc_pb.TakeOfferRequest, grpc_pb.TakeOfferReply>;
takeOffer(request: grpc_pb.TakeOfferRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.TakeOfferReply>;
takeOffer(request: grpc_pb.TakeOfferRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.TakeOfferReply) => void): grpcWeb.ClientReadableStream<grpc_pb.TakeOfferReply>;
methodInfoConfirmPaymentStarted: grpcWeb.MethodDescriptor<grpc_pb.ConfirmPaymentStartedRequest, grpc_pb.ConfirmPaymentStartedReply>;
confirmPaymentStarted(request: grpc_pb.ConfirmPaymentStartedRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.ConfirmPaymentStartedReply>;
confirmPaymentStarted(request: grpc_pb.ConfirmPaymentStartedRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.ConfirmPaymentStartedReply) => void): grpcWeb.ClientReadableStream<grpc_pb.ConfirmPaymentStartedReply>;
methodInfoConfirmPaymentReceived: grpcWeb.MethodDescriptor<grpc_pb.ConfirmPaymentReceivedRequest, grpc_pb.ConfirmPaymentReceivedReply>;
confirmPaymentReceived(request: grpc_pb.ConfirmPaymentReceivedRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.ConfirmPaymentReceivedReply>;
confirmPaymentReceived(request: grpc_pb.ConfirmPaymentReceivedRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.ConfirmPaymentReceivedReply) => void): grpcWeb.ClientReadableStream<grpc_pb.ConfirmPaymentReceivedReply>;
methodInfoKeepFunds: grpcWeb.MethodDescriptor<grpc_pb.KeepFundsRequest, grpc_pb.KeepFundsReply>;
keepFunds(request: grpc_pb.KeepFundsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.KeepFundsReply>;
keepFunds(request: grpc_pb.KeepFundsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.KeepFundsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.KeepFundsReply>;
methodInfoWithdrawFunds: grpcWeb.MethodDescriptor<grpc_pb.WithdrawFundsRequest, grpc_pb.WithdrawFundsReply>;
withdrawFunds(request: grpc_pb.WithdrawFundsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.WithdrawFundsReply>;
withdrawFunds(request: grpc_pb.WithdrawFundsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.WithdrawFundsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.WithdrawFundsReply>;
methodInfoGetChatMessages: grpcWeb.MethodDescriptor<grpc_pb.GetChatMessagesRequest, grpc_pb.GetChatMessagesReply>;
getChatMessages(request: grpc_pb.GetChatMessagesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetChatMessagesReply>;
getChatMessages(request: grpc_pb.GetChatMessagesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetChatMessagesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetChatMessagesReply>;
methodInfoSendChatMessage: grpcWeb.MethodDescriptor<grpc_pb.SendChatMessageRequest, grpc_pb.SendChatMessageReply>;
sendChatMessage(request: grpc_pb.SendChatMessageRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SendChatMessageReply>;
sendChatMessage(request: grpc_pb.SendChatMessageRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SendChatMessageReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SendChatMessageReply>;
}
export declare class WalletsClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | {
[index: string]: string;
};
options_: null | {
[index: string]: any;
};
constructor(hostname: string, credentials?: null | {
[index: string]: string;
}, options?: null | {
[index: string]: any;
});
methodInfoGetBalances: grpcWeb.MethodDescriptor<grpc_pb.GetBalancesRequest, grpc_pb.GetBalancesReply>;
getBalances(request: grpc_pb.GetBalancesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetBalancesReply>;
getBalances(request: grpc_pb.GetBalancesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetBalancesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetBalancesReply>;
methodInfoGetNewDepositAddress: grpcWeb.MethodDescriptor<grpc_pb.GetNewDepositAddressRequest, grpc_pb.GetNewDepositAddressReply>;
getNewDepositAddress(request: grpc_pb.GetNewDepositAddressRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetNewDepositAddressReply>;
getNewDepositAddress(request: grpc_pb.GetNewDepositAddressRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetNewDepositAddressReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetNewDepositAddressReply>;
methodInfoGetXmrTxs: grpcWeb.MethodDescriptor<grpc_pb.GetXmrTxsRequest, grpc_pb.GetXmrTxsReply>;
getXmrTxs(request: grpc_pb.GetXmrTxsRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetXmrTxsReply>;
getXmrTxs(request: grpc_pb.GetXmrTxsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetXmrTxsReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetXmrTxsReply>;
methodInfoCreateXmrTx: grpcWeb.MethodDescriptor<grpc_pb.CreateXmrTxRequest, grpc_pb.CreateXmrTxReply>;
createXmrTx(request: grpc_pb.CreateXmrTxRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.CreateXmrTxReply>;
createXmrTx(request: grpc_pb.CreateXmrTxRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.CreateXmrTxReply) => void): grpcWeb.ClientReadableStream<grpc_pb.CreateXmrTxReply>;
methodInforelayXmrTx: grpcWeb.MethodDescriptor<grpc_pb.RelayXmrTxRequest, grpc_pb.RelayXmrTxReply>;
relayXmrTx(request: grpc_pb.RelayXmrTxRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.RelayXmrTxReply>;
relayXmrTx(request: grpc_pb.RelayXmrTxRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.RelayXmrTxReply) => void): grpcWeb.ClientReadableStream<grpc_pb.RelayXmrTxReply>;
methodInfoGetAddressBalance: grpcWeb.MethodDescriptor<grpc_pb.GetAddressBalanceRequest, grpc_pb.GetAddressBalanceReply>;
getAddressBalance(request: grpc_pb.GetAddressBalanceRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetAddressBalanceReply>;
getAddressBalance(request: grpc_pb.GetAddressBalanceRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetAddressBalanceReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetAddressBalanceReply>;
methodInfoSendBtc: grpcWeb.MethodDescriptor<grpc_pb.SendBtcRequest, grpc_pb.SendBtcReply>;
sendBtc(request: grpc_pb.SendBtcRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SendBtcReply>;
sendBtc(request: grpc_pb.SendBtcRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SendBtcReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SendBtcReply>;
methodInfoGetTxFeeRate: grpcWeb.MethodDescriptor<grpc_pb.GetTxFeeRateRequest, grpc_pb.GetTxFeeRateReply>;
getTxFeeRate(request: grpc_pb.GetTxFeeRateRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetTxFeeRateReply>;
getTxFeeRate(request: grpc_pb.GetTxFeeRateRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetTxFeeRateReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetTxFeeRateReply>;
methodInfoSetTxFeeRatePreference: grpcWeb.MethodDescriptor<grpc_pb.SetTxFeeRatePreferenceRequest, grpc_pb.SetTxFeeRatePreferenceReply>;
setTxFeeRatePreference(request: grpc_pb.SetTxFeeRatePreferenceRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SetTxFeeRatePreferenceReply>;
setTxFeeRatePreference(request: grpc_pb.SetTxFeeRatePreferenceRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SetTxFeeRatePreferenceReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SetTxFeeRatePreferenceReply>;
methodInfoUnsetTxFeeRatePreference: grpcWeb.MethodDescriptor<grpc_pb.UnsetTxFeeRatePreferenceRequest, grpc_pb.UnsetTxFeeRatePreferenceReply>;
unsetTxFeeRatePreference(request: grpc_pb.UnsetTxFeeRatePreferenceRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.UnsetTxFeeRatePreferenceReply>;
unsetTxFeeRatePreference(request: grpc_pb.UnsetTxFeeRatePreferenceRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.UnsetTxFeeRatePreferenceReply) => void): grpcWeb.ClientReadableStream<grpc_pb.UnsetTxFeeRatePreferenceReply>;
methodInfoGetTransaction: grpcWeb.MethodDescriptor<grpc_pb.GetTransactionRequest, grpc_pb.GetTransactionReply>;
getTransaction(request: grpc_pb.GetTransactionRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetTransactionReply>;
getTransaction(request: grpc_pb.GetTransactionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetTransactionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetTransactionReply>;
methodInfoGetFundingAddresses: grpcWeb.MethodDescriptor<grpc_pb.GetFundingAddressesRequest, grpc_pb.GetFundingAddressesReply>;
getFundingAddresses(request: grpc_pb.GetFundingAddressesRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.GetFundingAddressesReply>;
getFundingAddresses(request: grpc_pb.GetFundingAddressesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetFundingAddressesReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetFundingAddressesReply>;
methodInfoSetWalletPassword: grpcWeb.MethodDescriptor<grpc_pb.SetWalletPasswordRequest, grpc_pb.SetWalletPasswordReply>;
setWalletPassword(request: grpc_pb.SetWalletPasswordRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.SetWalletPasswordReply>;
setWalletPassword(request: grpc_pb.SetWalletPasswordRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SetWalletPasswordReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SetWalletPasswordReply>;
methodInfoRemoveWalletPassword: grpcWeb.MethodDescriptor<grpc_pb.RemoveWalletPasswordRequest, grpc_pb.RemoveWalletPasswordReply>;
removeWalletPassword(request: grpc_pb.RemoveWalletPasswordRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.RemoveWalletPasswordReply>;
removeWalletPassword(request: grpc_pb.RemoveWalletPasswordRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.RemoveWalletPasswordReply) => void): grpcWeb.ClientReadableStream<grpc_pb.RemoveWalletPasswordReply>;
methodInfoLockWallet: grpcWeb.MethodDescriptor<grpc_pb.LockWalletRequest, grpc_pb.LockWalletReply>;
lockWallet(request: grpc_pb.LockWalletRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.LockWalletReply>;
lockWallet(request: grpc_pb.LockWalletRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.LockWalletReply) => void): grpcWeb.ClientReadableStream<grpc_pb.LockWalletReply>;
methodInfoUnlockWallet: grpcWeb.MethodDescriptor<grpc_pb.UnlockWalletRequest, grpc_pb.UnlockWalletReply>;
unlockWallet(request: grpc_pb.UnlockWalletRequest, metadata: grpcWeb.Metadata | null): Promise<grpc_pb.UnlockWalletReply>;
unlockWallet(request: grpc_pb.UnlockWalletRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.UnlockWalletReply) => void): grpcWeb.ClientReadableStream<grpc_pb.UnlockWalletReply>;
}

1045
dist/protobuf/GrpcServiceClientPb.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1
dist/protobuf/grpc_pb.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

25178
dist/protobuf/grpc_pb.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
dist/protobuf/grpc_pb.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/protobuf/pb_pb.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

50992
dist/protobuf/pb_pb.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
dist/protobuf/pb_pb.js.map vendored Normal file

File diff suppressed because one or more lines are too long

52
dist/utils/HavenoUtils.d.ts vendored Normal file
View File

@ -0,0 +1,52 @@
/**
* Collection of utilities for working with Haveno.
*/
export default class HavenoUtils {
static logLevel: number;
static centinerosToAUMultiplier: number;
static months: string[];
static lastLogTimeMs: number;
/**
* Set the log level with 0 being least verbose.
*
* @param {int} level - the log level
*/
static setLogLevel(level: number): Promise<void>;
/**
* Get the log level.
*
* @return {int} the current log level
*/
static getLogLevel(): number;
/**
* Log a message. // TODO (woodser): switch to log library?
*
* @param {int} level - log level of the message
* @param {string} msg - message to log
* @param {boolean?} warn - log the message as a warning if true
*/
static log(level: number, msg: string): void;
/**
* Format a timestamp as e.g. Jul-07 hh:mm:ss:ms. // TODO: move to GenUtils?
*
* @param {number} timestamp - the timestamp in milliseconds to format
* @return {string} the formatted timestamp
*/
static formatTimestamp(timestamp: number): string;
/**
* Kill the given process.
*
* TODO (woodser): move this to monero-javascript GenUtils.js as common utility
*
* @param {Process} process - the nodejs child process to child
* @param {String} signal - the kill signal, e.g. SIGTERM, SIGKILL, SIGINT (default)
*/
static kill(process: any, signal?: string): Promise<void>;
/**
* Convert centineros to atomic units.
*
* @param {number} centineros - denominates an amount of XMR in centineros
* @return {BigInt} the amount denominated in atomic units
*/
static centinerosToAtomicUnits(centineros: number): bigint;
}

79
dist/utils/HavenoUtils.js vendored Normal file
View File

@ -0,0 +1,79 @@
import assert from "assert";
import console from 'console';
/**
* Collection of utilities for working with Haveno.
*/
export default class HavenoUtils {
/**
* Set the log level with 0 being least verbose.
*
* @param {int} level - the log level
*/
static async setLogLevel(level) {
assert(level === parseInt(level + "", 10) && level >= 0, "Log level must be an integer >= 0");
HavenoUtils.logLevel = level;
}
/**
* Get the log level.
*
* @return {int} the current log level
*/
static getLogLevel() {
return HavenoUtils.logLevel;
}
/**
* Log a message. // TODO (woodser): switch to log library?
*
* @param {int} level - log level of the message
* @param {string} msg - message to log
* @param {boolean?} warn - log the message as a warning if true
*/
static log(level, msg) {
assert(level === parseInt(level + "", 10) && level >= 0, "Log level must be an integer >= 0");
if (HavenoUtils.logLevel >= level) {
const now = Date.now();
const formattedTimeSinceLastLog = HavenoUtils.lastLogTimeMs ? " (+" + (now - HavenoUtils.lastLogTimeMs) + " ms)" : "\t";
HavenoUtils.lastLogTimeMs = now;
console.log(HavenoUtils.formatTimestamp(now) + formattedTimeSinceLastLog + "\t[L" + level + "] " + msg);
}
}
/**
* Format a timestamp as e.g. Jul-07 hh:mm:ss:ms. // TODO: move to GenUtils?
*
* @param {number} timestamp - the timestamp in milliseconds to format
* @return {string} the formatted timestamp
*/
static formatTimestamp(timestamp) {
const date = new Date(timestamp);
return HavenoUtils.months[date.getMonth()] + "-" + date.getDate() + " " + date.getHours() + ':' + ("0" + date.getMinutes()).substr(-2) + ':' + ("0" + date.getSeconds()).substr(-2) + ':' + ("0" + date.getMilliseconds()).substr(-2);
}
/**
* Kill the given process.
*
* TODO (woodser): move this to monero-javascript GenUtils.js as common utility
*
* @param {Process} process - the nodejs child process to child
* @param {String} signal - the kill signal, e.g. SIGTERM, SIGKILL, SIGINT (default)
*/
static async kill(process, signal) {
return new Promise(function (resolve, reject) {
process.on("exit", function () { resolve(); });
process.on("error", function (err) { reject(err); });
process.kill(signal ? signal : "SIGINT");
});
}
/**
* Convert centineros to atomic units.
*
* @param {number} centineros - denominates an amount of XMR in centineros
* @return {BigInt} the amount denominated in atomic units
*/
static centinerosToAtomicUnits(centineros) {
return BigInt(centineros) * BigInt(HavenoUtils.centinerosToAUMultiplier);
}
}
HavenoUtils.logLevel = 0;
HavenoUtils.centinerosToAUMultiplier = 10000;
HavenoUtils.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
HavenoUtils.lastLogTimeMs = 0;
//# sourceMappingURL=HavenoUtils.js.map

1
dist/utils/HavenoUtils.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"HavenoUtils.js","sourceRoot":"","sources":["../../src/utils/HavenoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAO9B;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACpC,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,mCAAmC,CAAC,CAAC;QAC9F,WAAW,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAW;QAChB,OAAO,WAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,KAAa,EAAE,GAAW;QACnC,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,mCAAmC,CAAC,CAAC;QAC9F,IAAI,WAAW,CAAC,QAAQ,IAAI,KAAK,EAAE;YACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACvB,MAAM,yBAAyB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,GAAG,WAAW,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;YACxH,WAAW,CAAC,aAAa,GAAG,GAAG,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,yBAAyB,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;SACzG;IACH,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,SAAiB;QACtC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,GAAI,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACzO,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAY,EAAE,MAAe;QAC7C,OAAO,IAAI,OAAO,CAAC,UAAS,OAAO,EAAE,MAAM;YACzC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,cAAa,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAS,GAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,CAAC,UAAkB;QAC/C,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAC3E,CAAC;;AA5EM,oBAAQ,GAAG,CAAC,CAAC;AACb,oCAAwB,GAAG,KAAK,CAAC;AACjC,kBAAM,GAAG,CAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,CAAC,CAAC;AACnF,yBAAa,GAAG,CAAC,CAAC"}

27
dist/utils/TaskLooper.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
/// <reference types="node" />
/**
* Run a task in a fixed period loop.
*/
export default class TaskLooper {
_fn: () => Promise<void>;
_isStarted: boolean;
_isLooping: boolean;
_timeout: NodeJS.Timeout | undefined;
/**
* Build the looper with a function to invoke on a fixed period loop.
*
* @param {function} fn - the async function to invoke
*/
constructor(fn: () => Promise<void>);
/**
* Start the task loop.
*
* @param {int} periodInMs the loop period in milliseconds
*/
start(periodInMs: number): void;
/**
* Stop the task loop.
*/
stop(): void;
_runLoop(periodInMs: number): Promise<void>;
}

47
dist/utils/TaskLooper.js vendored Normal file
View File

@ -0,0 +1,47 @@
/**
* Run a task in a fixed period loop.
*/
export default class TaskLooper {
/**
* Build the looper with a function to invoke on a fixed period loop.
*
* @param {function} fn - the async function to invoke
*/
constructor(fn) {
this._fn = fn;
this._isStarted = false;
this._isLooping = false;
}
/**
* Start the task loop.
*
* @param {int} periodInMs the loop period in milliseconds
*/
start(periodInMs) {
if (this._isStarted)
return;
this._isStarted = true;
this._runLoop(periodInMs);
}
/**
* Stop the task loop.
*/
stop() {
if (!this._isStarted)
throw new Error("Cannot stop TaskLooper because it's not started");
this._isStarted = false;
clearTimeout(this._timeout);
this._timeout = undefined;
}
async _runLoop(periodInMs) {
this._isLooping = true;
while (this._isStarted) {
const startTime = Date.now();
await this._fn();
if (this._isStarted)
await new Promise((resolve) => { this._timeout = setTimeout(resolve, periodInMs - (Date.now() - startTime)); });
}
this._isLooping = false;
}
}
//# sourceMappingURL=TaskLooper.js.map

1
dist/utils/TaskLooper.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"TaskLooper.js","sourceRoot":"","sources":["../../src/utils/TaskLooper.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAO7B;;;;OAIG;IACH,YAAY,EAAuB;QACjC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAkB;QACtB,IAAI,IAAI,CAAC,UAAU;YAAE,OAAO;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACzF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,YAAY,CAAC,IAAI,CAAC,QAAS,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAkB;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,UAAU,EAAE;YACtB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,UAAU;gBAAE,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtI;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF"}