update dist

This commit is contained in:
woodser 2024-08-07 07:00:58 -04:00
parent 5173381e4e
commit 2fc2807ee0
3 changed files with 43 additions and 3 deletions

View File

@ -1,12 +1,13 @@
import type * as grpcWeb from "grpc-web";
import { GetVersionClient, AccountClient, XmrConnectionsClient, DisputesClient, DisputeAgentsClient, NotificationsClient, WalletsClient, PriceClient, OffersClient, PaymentAccountsClient, TradesClient, ShutdownServerClient, XmrNodeClient } from './protobuf/GrpcServiceClientPb';
import { GetTradeStatisticsClient, GetVersionClient, AccountClient, XmrConnectionsClient, DisputesClient, DisputeAgentsClient, NotificationsClient, WalletsClient, PriceClient, OffersClient, PaymentAccountsClient, TradesClient, ShutdownServerClient, XmrNodeClient } from './protobuf/GrpcServiceClientPb';
import { MarketPriceInfo, MarketDepthInfo, XmrBalanceInfo, OfferInfo, TradeInfo, XmrTx, XmrDestination, NotificationMessage, UrlConnection } from "./protobuf/grpc_pb";
import { OfferDirection, PaymentMethod, PaymentAccountForm, PaymentAccountFormField, PaymentAccount, PaymentAccountPayload, Attachment, DisputeResult, Dispute, ChatMessage, XmrNodeSettings } from "./protobuf/pb_pb";
import { TradeStatistics3, OfferDirection, PaymentMethod, PaymentAccountForm, PaymentAccountFormField, PaymentAccount, PaymentAccountPayload, Attachment, DisputeResult, Dispute, ChatMessage, XmrNodeSettings } from "./protobuf/pb_pb";
/**
* Haveno daemon client.
*/
export default class HavenoClient {
/** @private */ _appName: string | undefined;
/** @private */ _getTradeStatisticsClient: GetTradeStatisticsClient;
/** @private */ _getVersionClient: GetVersionClient;
/** @private */ _disputeAgentsClient: DisputeAgentsClient;
/** @private */ _disputesClient: DisputesClient;
@ -388,6 +389,12 @@ export default class HavenoClient {
* @return {PaymentAccount} the created payment account
*/
createCryptoPaymentAccount(accountName: string, assetCode: string, address: string): Promise<PaymentAccount>;
/**
* Delete a payment account.
*
* @param paymentAccountId {string} the id of the payment account to delete
*/
deletePaymentAccount(paymentAccountId: string): Promise<void>;
/**
* Get available offers to buy or sell XMR.
*
@ -449,6 +456,12 @@ export default class HavenoClient {
* @return {TradeInfo} the trade with the given id
*/
getTrade(tradeId: string): Promise<TradeInfo>;
/**
* Get all trade statistics.
*
* @return {TradeStatistics3[]} all user trades
*/
getTradeStatistics(): Promise<TradeStatistics3[]>;
/**
* Get all trades.
*

27
dist/HavenoClient.js vendored
View File

@ -58,6 +58,7 @@ class HavenoClient {
HavenoUtils_1.default.log(2, "Creating Haveno client connected to " + url);
this._url = url;
this._password = password;
this._getTradeStatisticsClient = new GrpcServiceClientPb_1.GetTradeStatisticsClient(this._url);
this._getVersionClient = new GrpcServiceClientPb_1.GetVersionClient(this._url);
this._accountClient = new GrpcServiceClientPb_1.AccountClient(this._url);
this._xmrConnectionsClient = new GrpcServiceClientPb_1.XmrConnectionsClient(this._url);
@ -933,6 +934,19 @@ class HavenoClient {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Delete a payment account.
*
* @param paymentAccountId {string} the id of the payment account to delete
*/
async deletePaymentAccount(paymentAccountId) {
try {
await this._paymentAccountsClient.deletePaymentAccount(new grpc_pb_1.DeletePaymentAccountRequest().setPaymentAccountId(paymentAccountId), { password: this._password });
}
catch (e) {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Get available offers to buy or sell XMR.
*
@ -1075,6 +1089,19 @@ class HavenoClient {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Get all trade statistics.
*
* @return {TradeStatistics3[]} all user trades
*/
async getTradeStatistics() {
try {
return (await this._getTradeStatisticsClient.getTradeStatistics(new grpc_pb_1.GetTradeStatisticsRequest(), { password: this._password })).getTradeStatisticsList();
}
catch (e) {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Get all trades.
*

File diff suppressed because one or more lines are too long