mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-02-23 16:09:57 -05:00
use underscores in grpc.proto for correct camelcase in grpc-web
fix possibly undefined typescript checks rebuild protobuf TS definitions
This commit is contained in:
parent
febe4d7526
commit
3d8e37e646
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
// generate imports for haveno services and types using grpc-web
|
# generate imports for haveno services and types using grpc-web
|
||||||
cd ./config || exit 1
|
cd ./config || exit 1
|
||||||
protoc -I=./ *.proto --js_out=import_style=commonjs,binary:./ --grpc-web_out=import_style=typescript,mode=grpcwebtext:./ || exit 1
|
protoc -I=./ *.proto --js_out=import_style=commonjs,binary:./ --grpc-web_out=import_style=typescript,mode=grpcwebtext:./ || exit 1
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
// move imports to src folder
|
# move imports to src folder
|
||||||
mv ./config/grpc_pb.d.ts ./src/protobuf || exit 1
|
mv ./config/grpc_pb.d.ts ./src/protobuf || exit 1
|
||||||
mv ./config/grpc_pb.js ./src/protobuf || exit 1
|
mv ./config/grpc_pb.js ./src/protobuf || exit 1
|
||||||
mv ./config/pb_pb.d.ts ./src/protobuf || exit 1
|
mv ./config/pb_pb.d.ts ./src/protobuf || exit 1
|
||||||
|
@ -33,8 +33,8 @@ service DisputeAgents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message RegisterDisputeAgentRequest {
|
message RegisterDisputeAgentRequest {
|
||||||
string disputeAgentType = 1;
|
string dispute_agent_type = 1;
|
||||||
string registrationKey = 2;
|
string registration_key = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RegisterDisputeAgentReply {
|
message RegisterDisputeAgentReply {
|
||||||
@ -50,11 +50,11 @@ service Help {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetMethodHelpRequest {
|
message GetMethodHelpRequest {
|
||||||
string methodName = 1;
|
string method_name = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetMethodHelpReply {
|
message GetMethodHelpReply {
|
||||||
string methodHelp = 1;
|
string method_help = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -94,7 +94,7 @@ message GetMyOfferReply {
|
|||||||
|
|
||||||
message GetOffersRequest {
|
message GetOffersRequest {
|
||||||
string direction = 1;
|
string direction = 1;
|
||||||
string currencyCode = 2;
|
string currency_code = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetOffersReply {
|
message GetOffersReply {
|
||||||
@ -103,7 +103,7 @@ message GetOffersReply {
|
|||||||
|
|
||||||
message GetMyOffersRequest {
|
message GetMyOffersRequest {
|
||||||
string direction = 1;
|
string direction = 1;
|
||||||
string currencyCode = 2;
|
string currency_code = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetMyOffersReply {
|
message GetMyOffersReply {
|
||||||
@ -111,17 +111,17 @@ message GetMyOffersReply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CreateOfferRequest {
|
message CreateOfferRequest {
|
||||||
string currencyCode = 1;
|
string currency_code = 1;
|
||||||
string direction = 2;
|
string direction = 2;
|
||||||
string price = 3;
|
string price = 3;
|
||||||
bool useMarketBasedPrice = 4;
|
bool use_market_based_price = 4;
|
||||||
double marketPriceMargin = 5;
|
double market_price_margin = 5;
|
||||||
uint64 amount = 6 [jstype = JS_STRING];
|
uint64 amount = 6 [jstype = JS_STRING];
|
||||||
uint64 minAmount = 7 [jstype = JS_STRING];
|
uint64 min_amount = 7 [jstype = JS_STRING];
|
||||||
double buyerSecurityDeposit = 8;
|
double buyer_security_deposit = 8;
|
||||||
uint64 triggerPrice = 9 [jstype = JS_STRING];
|
uint64 trigger_price = 9 [jstype = JS_STRING];
|
||||||
string paymentAccountId = 10;
|
string payment_account_id = 10;
|
||||||
string makerFeeCurrencyCode = 11;
|
string maker_fee_currency_code = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateOfferReply {
|
message CreateOfferReply {
|
||||||
@ -139,30 +139,30 @@ message OfferInfo {
|
|||||||
string id = 1;
|
string id = 1;
|
||||||
string direction = 2;
|
string direction = 2;
|
||||||
uint64 price = 3;
|
uint64 price = 3;
|
||||||
bool useMarketBasedPrice = 4;
|
bool use_market_based_price = 4;
|
||||||
double marketPriceMargin = 5;
|
double market_price_margin = 5;
|
||||||
uint64 amount = 6;
|
uint64 amount = 6;
|
||||||
uint64 minAmount = 7;
|
uint64 min_amount = 7;
|
||||||
uint64 volume = 8;
|
uint64 volume = 8;
|
||||||
uint64 minVolume = 9;
|
uint64 min_volume = 9;
|
||||||
uint64 buyerSecurityDeposit = 10;
|
uint64 buyer_security_deposit = 10;
|
||||||
uint64 triggerPrice = 11;
|
uint64 trigger_price = 11;
|
||||||
bool isCurrencyForMakerFeeBtc = 12;
|
bool is_currency_for_maker_fee_btc = 12;
|
||||||
string paymentAccountId = 13;
|
string payment_account_id = 13;
|
||||||
string paymentMethodId = 14;
|
string payment_method_id = 14;
|
||||||
string paymentMethodShortName = 15;
|
string payment_method_short_name = 15;
|
||||||
string baseCurrencyCode = 16;
|
string base_currency_code = 16;
|
||||||
string counterCurrencyCode = 17;
|
string counter_currency_code = 17;
|
||||||
uint64 date = 18;
|
uint64 date = 18;
|
||||||
string state = 19;
|
string state = 19;
|
||||||
uint64 sellerSecurityDeposit = 20;
|
uint64 seller_security_deposit = 20;
|
||||||
string offerFeePaymentTxId = 21;
|
string offer_fee_payment_tx_id = 21;
|
||||||
uint64 txFee = 22;
|
uint64 tx_fee = 22;
|
||||||
uint64 makerFee = 23;
|
uint64 maker_fee = 23;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AvailabilityResultWithDescription {
|
message AvailabilityResultWithDescription {
|
||||||
AvailabilityResult availabilityResult = 1;
|
AvailabilityResult availability_result = 1;
|
||||||
string description = 2;
|
string description = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,51 +186,51 @@ service PaymentAccounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CreatePaymentAccountRequest {
|
message CreatePaymentAccountRequest {
|
||||||
string paymentAccountForm = 1;
|
string payment_account_form = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreatePaymentAccountReply {
|
message CreatePaymentAccountReply {
|
||||||
PaymentAccount paymentAccount = 1;
|
PaymentAccount payment_account = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentAccountsRequest {
|
message GetPaymentAccountsRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentAccountsReply {
|
message GetPaymentAccountsReply {
|
||||||
repeated PaymentAccount paymentAccounts = 1;
|
repeated PaymentAccount payment_accounts = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentMethodsRequest {
|
message GetPaymentMethodsRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentMethodsReply {
|
message GetPaymentMethodsReply {
|
||||||
repeated PaymentMethod paymentMethods = 1;
|
repeated PaymentMethod payment_methods = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentAccountFormRequest {
|
message GetPaymentAccountFormRequest {
|
||||||
string paymentMethodId = 1;
|
string payment_method_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentAccountFormReply {
|
message GetPaymentAccountFormReply {
|
||||||
string paymentAccountFormJson = 1;
|
string payment_account_form_json = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateCryptoCurrencyPaymentAccountRequest {
|
message CreateCryptoCurrencyPaymentAccountRequest {
|
||||||
string accountName = 1;
|
string account_name = 1;
|
||||||
string currencyCode = 2;
|
string currency_code = 2;
|
||||||
string address = 3;
|
string address = 3;
|
||||||
bool tradeInstant = 4;
|
bool trade_instant = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateCryptoCurrencyPaymentAccountReply {
|
message CreateCryptoCurrencyPaymentAccountReply {
|
||||||
PaymentAccount paymentAccount = 1;
|
PaymentAccount payment_account = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetCryptoCurrencyPaymentMethodsRequest {
|
message GetCryptoCurrencyPaymentMethodsRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetCryptoCurrencyPaymentMethodsReply {
|
message GetCryptoCurrencyPaymentMethodsReply {
|
||||||
repeated PaymentMethod paymentMethods = 1;
|
repeated PaymentMethod payment_methods = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -243,7 +243,7 @@ service Price {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message MarketPriceRequest {
|
message MarketPriceRequest {
|
||||||
string currencyCode = 1;
|
string currency_code = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MarketPriceReply {
|
message MarketPriceReply {
|
||||||
@ -263,7 +263,7 @@ message GetTradeStatisticsRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetTradeStatisticsReply {
|
message GetTradeStatisticsReply {
|
||||||
repeated TradeStatistics3 TradeStatistics = 1;
|
repeated TradeStatistics3 trade_statistics = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -301,32 +301,32 @@ service Trades {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message TakeOfferRequest {
|
message TakeOfferRequest {
|
||||||
string offerId = 1;
|
string offer_id = 1;
|
||||||
string paymentAccountId = 2;
|
string payment_account_id = 2;
|
||||||
string takerFeeCurrencyCode = 3;
|
string taker_fee_currency_code = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TakeOfferReply {
|
message TakeOfferReply {
|
||||||
TradeInfo trade = 1;
|
TradeInfo trade = 1;
|
||||||
AvailabilityResultWithDescription failureReason = 2;
|
AvailabilityResultWithDescription failure_reason = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConfirmPaymentStartedRequest {
|
message ConfirmPaymentStartedRequest {
|
||||||
string tradeId = 1;
|
string trade_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConfirmPaymentStartedReply {
|
message ConfirmPaymentStartedReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConfirmPaymentReceivedRequest {
|
message ConfirmPaymentReceivedRequest {
|
||||||
string tradeId = 1;
|
string trade_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConfirmPaymentReceivedReply {
|
message ConfirmPaymentReceivedReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTradeRequest {
|
message GetTradeRequest {
|
||||||
string tradeId = 1;
|
string trade_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTradeReply {
|
message GetTradeReply {
|
||||||
@ -334,14 +334,14 @@ message GetTradeReply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message KeepFundsRequest {
|
message KeepFundsRequest {
|
||||||
string tradeId = 1;
|
string trade_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KeepFundsReply {
|
message KeepFundsReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
message WithdrawFundsRequest {
|
message WithdrawFundsRequest {
|
||||||
string tradeId = 1;
|
string trade_id = 1;
|
||||||
string address = 2;
|
string address = 2;
|
||||||
string memo = 3;
|
string memo = 3;
|
||||||
}
|
}
|
||||||
@ -351,54 +351,54 @@ message WithdrawFundsReply {
|
|||||||
|
|
||||||
message TradeInfo {
|
message TradeInfo {
|
||||||
OfferInfo offer = 1;
|
OfferInfo offer = 1;
|
||||||
string tradeId = 2;
|
string trade_id = 2;
|
||||||
string shortId = 3;
|
string short_id = 3;
|
||||||
uint64 date = 4;
|
uint64 date = 4;
|
||||||
string role = 5;
|
string role = 5;
|
||||||
uint64 txFeeAsLong = 7;
|
uint64 tx_fee_as_long = 7;
|
||||||
uint64 takerFeeAsLong = 8;
|
uint64 taker_fee_as_long = 8;
|
||||||
string takerFeeTxId = 9;
|
string taker_fee_tx_id = 9;
|
||||||
reserved 10; // was depositTxId
|
reserved 10; // was depositTxId
|
||||||
string payoutTxId = 11;
|
string payout_tx_id = 11;
|
||||||
uint64 tradeAmountAsLong = 12;
|
uint64 trade_amount_as_long = 12;
|
||||||
uint64 tradePrice = 13;
|
uint64 trade_price = 13;
|
||||||
string tradingPeerNodeAddress = 14;
|
string trading_peer_node_address = 14;
|
||||||
string state = 15;
|
string state = 15;
|
||||||
string phase = 16;
|
string phase = 16;
|
||||||
string tradePeriodState = 17;
|
string trade_period_state = 17;
|
||||||
bool isDepositPublished = 18;
|
bool is_deposit_published = 18;
|
||||||
bool isDepositConfirmed = 19;
|
bool is_deposit_confirmed = 19;
|
||||||
bool isFiatSent = 20;
|
bool is_fiat_sent = 20;
|
||||||
bool isFiatReceived = 21;
|
bool is_fiat_received = 21;
|
||||||
bool isPayoutPublished = 22;
|
bool is_payout_published = 22;
|
||||||
bool isWithdrawn = 23;
|
bool is_withdrawn = 23;
|
||||||
string contractAsJson = 24;
|
string contract_as_json = 24;
|
||||||
ContractInfo contract = 25;
|
ContractInfo contract = 25;
|
||||||
|
|
||||||
string makerDepositTxId = 100;
|
string maker_deposit_tx_id = 100;
|
||||||
string takerDepositTxId = 101;
|
string taker_deposit_tx_id = 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ContractInfo {
|
message ContractInfo {
|
||||||
string buyerNodeAddress = 1;
|
string buyer_node_address = 1;
|
||||||
string sellerNodeAddress = 2;
|
string seller_node_address = 2;
|
||||||
reserved 3; // was mediatorNodeAddress
|
reserved 3; // was mediator_node_address
|
||||||
reserved 4; // was refundAgendNodeAddress
|
reserved 4; // was refund_agent_node_address
|
||||||
bool isBuyerMakerAndSellerTaker = 5;
|
bool is_buyer_maker_and_seller_taker = 5;
|
||||||
string makerAccountId = 6;
|
string maker_account_id = 6;
|
||||||
string takerAccountId = 7;
|
string taker_account_id = 7;
|
||||||
PaymentAccountPayloadInfo makerPaymentAccountPayload = 8;
|
PaymentAccountPayloadInfo maker_payment_account_payload = 8;
|
||||||
PaymentAccountPayloadInfo takerPaymentAccountPayload = 9;
|
PaymentAccountPayloadInfo taker_payment_account_payload = 9;
|
||||||
string makerPayoutAddressString = 10;
|
string maker_payout_address_string = 10;
|
||||||
string takerPayoutAddressString = 11;
|
string taker_payout_address_string = 11;
|
||||||
uint64 lockTime = 12;
|
uint64 lock_time = 12;
|
||||||
|
|
||||||
string arbitratorNodeAddress = 100;
|
string arbitrator_node_address = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PaymentAccountPayloadInfo {
|
message PaymentAccountPayloadInfo {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string paymentMethodId = 2;
|
string payment_method_id = 2;
|
||||||
string address = 3;
|
string address = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,20 +407,20 @@ message PaymentAccountPayloadInfo {
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
message TxFeeRateInfo {
|
message TxFeeRateInfo {
|
||||||
bool useCustomTxFeeRate = 1;
|
bool use_custom_tx_fee_rate = 1;
|
||||||
uint64 customTxFeeRate = 2;
|
uint64 custom_tx_fee_rate = 2;
|
||||||
uint64 feeServiceRate = 3;
|
uint64 fee_service_rate = 3;
|
||||||
uint64 lastFeeServiceRequestTs = 4;
|
uint64 last_fee_service_request_ts = 4;
|
||||||
uint64 minFeeServiceRate = 5;
|
uint64 min_fee_service_rate = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TxInfo {
|
message TxInfo {
|
||||||
string txId = 1;
|
string tx_id = 1;
|
||||||
uint64 inputSum = 2;
|
uint64 input_sum = 2;
|
||||||
uint64 outputSum = 3;
|
uint64 output_sum = 3;
|
||||||
uint64 fee = 4;
|
uint64 fee = 4;
|
||||||
int32 size = 5;
|
int32 size = 5;
|
||||||
bool isPending = 6;
|
bool is_pending = 6;
|
||||||
string memo = 7;
|
string memo = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ service Wallets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetBalancesRequest {
|
message GetBalancesRequest {
|
||||||
string currencyCode = 1;
|
string currency_code = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBalancesReply {
|
message GetBalancesReply {
|
||||||
@ -474,7 +474,7 @@ message GetAddressBalanceRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetAddressBalanceReply {
|
message GetAddressBalanceReply {
|
||||||
AddressBalanceInfo addressBalanceInfo = 1;
|
AddressBalanceInfo address_balance_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetUnusedBsqAddressRequest {
|
message GetUnusedBsqAddressRequest {
|
||||||
@ -487,22 +487,22 @@ message GetUnusedBsqAddressReply {
|
|||||||
message SendBsqRequest {
|
message SendBsqRequest {
|
||||||
string address = 1;
|
string address = 1;
|
||||||
string amount = 2;
|
string amount = 2;
|
||||||
string txFeeRate = 3;
|
string tx_fee_rate = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SendBsqReply {
|
message SendBsqReply {
|
||||||
TxInfo txInfo = 1;
|
TxInfo tx_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SendBtcRequest {
|
message SendBtcRequest {
|
||||||
string address = 1;
|
string address = 1;
|
||||||
string amount = 2;
|
string amount = 2;
|
||||||
string txFeeRate = 3;
|
string tx_fee_rate = 3;
|
||||||
string memo = 4;
|
string memo = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SendBtcReply {
|
message SendBtcReply {
|
||||||
TxInfo txInfo = 1;
|
TxInfo tx_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message VerifyBsqSentToAddressRequest {
|
message VerifyBsqSentToAddressRequest {
|
||||||
@ -511,49 +511,49 @@ message VerifyBsqSentToAddressRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message VerifyBsqSentToAddressReply {
|
message VerifyBsqSentToAddressReply {
|
||||||
bool isAmountReceived = 1;
|
bool is_amount_received = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTxFeeRateRequest {
|
message GetTxFeeRateRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTxFeeRateReply {
|
message GetTxFeeRateReply {
|
||||||
TxFeeRateInfo txFeeRateInfo = 1;
|
TxFeeRateInfo tx_fee_rate_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetTxFeeRatePreferenceRequest {
|
message SetTxFeeRatePreferenceRequest {
|
||||||
uint64 txFeeRatePreference = 1;
|
uint64 tx_fee_rate_preference = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetTxFeeRatePreferenceReply {
|
message SetTxFeeRatePreferenceReply {
|
||||||
TxFeeRateInfo txFeeRateInfo = 1;
|
TxFeeRateInfo tx_fee_rate_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnsetTxFeeRatePreferenceRequest {
|
message UnsetTxFeeRatePreferenceRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnsetTxFeeRatePreferenceReply {
|
message UnsetTxFeeRatePreferenceReply {
|
||||||
TxFeeRateInfo txFeeRateInfo = 1;
|
TxFeeRateInfo tx_fee_rate_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTransactionRequest {
|
message GetTransactionRequest {
|
||||||
string txId = 1;
|
string tx_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTransactionReply {
|
message GetTransactionReply {
|
||||||
TxInfo txInfo = 1;
|
TxInfo tx_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetFundingAddressesRequest {
|
message GetFundingAddressesRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetFundingAddressesReply {
|
message GetFundingAddressesReply {
|
||||||
repeated AddressBalanceInfo addressBalanceInfo = 1;
|
repeated AddressBalanceInfo address_balance_info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetWalletPasswordRequest {
|
message SetWalletPasswordRequest {
|
||||||
string password = 1;
|
string password = 1;
|
||||||
string newPassword = 2;
|
string new_password = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetWalletPasswordReply {
|
message SetWalletPasswordReply {
|
||||||
@ -590,33 +590,33 @@ message BalancesInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message BsqBalanceInfo {
|
message BsqBalanceInfo {
|
||||||
uint64 availableConfirmedBalance = 1;
|
uint64 available_confirmed_balance = 1;
|
||||||
uint64 unverifiedBalance = 2;
|
uint64 unverified_balance = 2;
|
||||||
uint64 unconfirmedChangeBalance = 3;
|
uint64 unconfirmed_change_balance = 3;
|
||||||
uint64 lockedForVotingBalance = 4;
|
uint64 locked_for_voting_balance = 4;
|
||||||
uint64 lockupBondsBalance = 5;
|
uint64 lockup_bonds_balance = 5;
|
||||||
uint64 unlockingBondsBalance = 6;
|
uint64 unlocking_bonds_balance = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BtcBalanceInfo {
|
message BtcBalanceInfo {
|
||||||
uint64 availableBalance = 1;
|
uint64 available_balance = 1;
|
||||||
uint64 reservedBalance = 2;
|
uint64 reserved_balance = 2;
|
||||||
uint64 totalAvailableBalance = 3;
|
uint64 total_available_balance = 3;
|
||||||
uint64 lockedBalance = 4;
|
uint64 locked_balance = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message XmrBalanceInfo {
|
message XmrBalanceInfo {
|
||||||
uint64 unlockedBalance = 1 [jstype = JS_STRING];
|
uint64 unlocked_balance = 1 [jstype = JS_STRING];
|
||||||
uint64 lockedBalance = 2 [jstype = JS_STRING];
|
uint64 locked_balance = 2 [jstype = JS_STRING];
|
||||||
uint64 reservedOfferBalance = 3 [jstype = JS_STRING];
|
uint64 reserved_offer_balance = 3 [jstype = JS_STRING];
|
||||||
uint64 reservedTradeBalance = 4 [jstype = JS_STRING];
|
uint64 reserved_trade_balance = 4 [jstype = JS_STRING];
|
||||||
}
|
}
|
||||||
|
|
||||||
message AddressBalanceInfo {
|
message AddressBalanceInfo {
|
||||||
string address = 1;
|
string address = 1;
|
||||||
int64 balance = 2;
|
int64 balance = 2;
|
||||||
int64 numConfirmations = 3;
|
int64 num_confirmations = 3;
|
||||||
bool isAddressUnused = 4;
|
bool is_address_unused = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -15,10 +15,10 @@ test("Can get the version", async () => {
|
|||||||
|
|
||||||
test("Can get the user's balances", async () => {
|
test("Can get the user's balances", async () => {
|
||||||
let balances: XmrBalanceInfo = await daemon.getBalances();
|
let balances: XmrBalanceInfo = await daemon.getBalances();
|
||||||
expect(balances.getUnlockedbalance()); // TODO: correct camelcase in grpc
|
expect(balances.getUnlockedBalance());
|
||||||
expect(balances.getLockedbalance());
|
expect(balances.getLockedBalance());
|
||||||
expect(balances.getReservedofferbalance());
|
expect(balances.getReservedOfferBalance());
|
||||||
expect(balances.getReservedtradebalance());
|
expect(balances.getReservedTradeBalance());
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Can get offers", async () => {
|
test("Can get offers", async () => {
|
||||||
@ -64,7 +64,7 @@ test("Can post and remove an offer", async () => {
|
|||||||
if (!ethPaymentAccount) throw new Error("Test requires ethereum payment account to post offer");
|
if (!ethPaymentAccount) throw new Error("Test requires ethereum payment account to post offer");
|
||||||
|
|
||||||
// get unlocked balance before reserving offer
|
// get unlocked balance before reserving offer
|
||||||
let unlockedBalanceBefore: bigint = BigInt((await daemon.getBalances()).getUnlockedbalance()); // TODO: correct camelcase
|
let unlockedBalanceBefore: bigint = BigInt((await daemon.getBalances()).getUnlockedBalance());
|
||||||
|
|
||||||
// post offer
|
// post offer
|
||||||
let amount: bigint = BigInt("250000000000");
|
let amount: bigint = BigInt("250000000000");
|
||||||
@ -88,7 +88,7 @@ test("Can post and remove an offer", async () => {
|
|||||||
testOffer(offer);
|
testOffer(offer);
|
||||||
|
|
||||||
// unlocked balance has decreased
|
// unlocked balance has decreased
|
||||||
let unlockedBalanceAfter: bigint = BigInt((await daemon.getBalances()).getUnlockedbalance());
|
let unlockedBalanceAfter: bigint = BigInt((await daemon.getBalances()).getUnlockedBalance());
|
||||||
expect(unlockedBalanceAfter).toBeLessThan(unlockedBalanceBefore);
|
expect(unlockedBalanceAfter).toBeLessThan(unlockedBalanceBefore);
|
||||||
|
|
||||||
// offer is included in my offers only
|
// offer is included in my offers only
|
||||||
@ -102,7 +102,7 @@ test("Can post and remove an offer", async () => {
|
|||||||
if (getOffer(await daemon.getOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in my offers after removal");
|
if (getOffer(await daemon.getOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in my offers after removal");
|
||||||
|
|
||||||
// reserved balance restored
|
// reserved balance restored
|
||||||
expect(unlockedBalanceBefore).toEqual(BigInt((await daemon.getBalances()).getUnlockedbalance()));
|
expect(unlockedBalanceBefore).toEqual(BigInt((await daemon.getBalances()).getUnlockedBalance()));
|
||||||
});
|
});
|
||||||
|
|
||||||
// ------------------------------- HELPERS ------------------------------------
|
// ------------------------------- HELPERS ------------------------------------
|
||||||
|
@ -58,7 +58,7 @@ class HavenoDaemon {
|
|||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._walletsClient.getBalances(request, {password: that._password}, function(err: grpcWeb.Error, response: GetBalancesReply) {
|
that._walletsClient.getBalances(request, {password: that._password}, function(err: grpcWeb.Error, response: GetBalancesReply) {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
else resolve(response.getBalances()?.getXmr());
|
else resolve(response.getBalances()!.getXmr()!);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ class HavenoDaemon {
|
|||||||
async getOffers(direction: string): Promise<OfferInfo[]> {
|
async getOffers(direction: string): Promise<OfferInfo[]> {
|
||||||
let request = new GetOffersRequest()
|
let request = new GetOffersRequest()
|
||||||
.setDirection(direction)
|
.setDirection(direction)
|
||||||
.setCurrencycode("XMR");
|
.setCurrencyCode("XMR");
|
||||||
let that = this;
|
let that = this;
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._offersClient.getOffers(request, {password: that._password}, function(err: grpcWeb.Error, response: GetOffersReply) {
|
that._offersClient.getOffers(request, {password: that._password}, function(err: grpcWeb.Error, response: GetOffersReply) {
|
||||||
@ -94,7 +94,7 @@ class HavenoDaemon {
|
|||||||
let that = this;
|
let that = this;
|
||||||
let request = new GetOffersRequest()
|
let request = new GetOffersRequest()
|
||||||
.setDirection(direction)
|
.setDirection(direction)
|
||||||
.setCurrencycode("XMR");
|
.setCurrencyCode("XMR");
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._offersClient.getMyOffers(request, {password: that._password}, function(err: grpcWeb.Error, response: GetOffersReply) {
|
that._offersClient.getMyOffers(request, {password: that._password}, function(err: grpcWeb.Error, response: GetOffersReply) {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
@ -113,7 +113,7 @@ class HavenoDaemon {
|
|||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._paymentAccountsClient.getPaymentAccounts(new GetPaymentAccountsRequest(), {password: that._password}, function(err: grpcWeb.Error, response: GetPaymentAccountsReply) {
|
that._paymentAccountsClient.getPaymentAccounts(new GetPaymentAccountsRequest(), {password: that._password}, function(err: grpcWeb.Error, response: GetPaymentAccountsReply) {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
else resolve(response.getPaymentaccountsList());
|
else resolve(response.getPaymentAccountsList());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -133,14 +133,14 @@ class HavenoDaemon {
|
|||||||
tradeInstant: boolean): Promise<PaymentAccount> {
|
tradeInstant: boolean): Promise<PaymentAccount> {
|
||||||
let that = this;
|
let that = this;
|
||||||
let request = new CreateCryptoCurrencyPaymentAccountRequest()
|
let request = new CreateCryptoCurrencyPaymentAccountRequest()
|
||||||
.setAccountname(accountName)
|
.setAccountName(accountName)
|
||||||
.setCurrencycode(currencyCode)
|
.setCurrencyCode(currencyCode)
|
||||||
.setAddress(address)
|
.setAddress(address)
|
||||||
.setTradeinstant(tradeInstant);
|
.setTradeInstant(tradeInstant);
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._paymentAccountsClient.createCryptoCurrencyPaymentAccount(request, {password: that._password}, function(err: grpcWeb.Error, response: CreateCryptoCurrencyPaymentAccountReply) {
|
that._paymentAccountsClient.createCryptoCurrencyPaymentAccount(request, {password: that._password}, function(err: grpcWeb.Error, response: CreateCryptoCurrencyPaymentAccountReply) {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
else resolve(response.getPaymentaccount());
|
else resolve(response.getPaymentAccount()!);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -172,21 +172,21 @@ class HavenoDaemon {
|
|||||||
triggerPrice?: number): Promise<OfferInfo> {
|
triggerPrice?: number): Promise<OfferInfo> {
|
||||||
let that = this;
|
let that = this;
|
||||||
let request = new CreateOfferRequest()
|
let request = new CreateOfferRequest()
|
||||||
.setCurrencycode(currencyCode)
|
.setCurrencyCode(currencyCode)
|
||||||
.setDirection(direction)
|
.setDirection(direction)
|
||||||
.setPrice(price.toString())
|
.setPrice(price.toString())
|
||||||
.setUsemarketbasedprice(useMarketBasedPrice)
|
.setUseMarketBasedPrice(useMarketBasedPrice)
|
||||||
.setMarketpricemargin(marketPriceMargin)
|
.setMarketPriceMargin(marketPriceMargin)
|
||||||
.setAmount(amount.toString())
|
.setAmount(amount.toString())
|
||||||
.setMinamount(minAmount.toString())
|
.setMinAmount(minAmount.toString())
|
||||||
.setBuyersecuritydeposit(buyerSecurityDeposit)
|
.setBuyerSecurityDeposit(buyerSecurityDeposit)
|
||||||
.setPaymentaccountid(paymentAccountId)
|
.setPaymentAccountId(paymentAccountId)
|
||||||
.setMakerfeecurrencycode("XMR");
|
.setMakerFeeCurrencyCode("XMR");
|
||||||
if (triggerPrice) request.setTriggerprice(BigInt(triggerPrice.toString()).toString());
|
if (triggerPrice) request.setTriggerPrice(BigInt(triggerPrice.toString()).toString());
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._offersClient.createOffer(request, {password: that._password}, function(err: grpcWeb.Error, response: CreateOfferReply) {
|
that._offersClient.createOffer(request, {password: that._password}, function(err: grpcWeb.Error, response: CreateOfferReply) {
|
||||||
if (err) reject(err);
|
if (err) reject(err);
|
||||||
else resolve(response.getOffer());
|
else resolve(response.getOffer()!);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ class HavenoDaemon {
|
|||||||
*
|
*
|
||||||
* @param {string} id - the offer id to cancel
|
* @param {string} id - the offer id to cancel
|
||||||
*/
|
*/
|
||||||
async cancelOffer(id: string) {
|
async cancelOffer(id: string): Promise<void> {
|
||||||
let that = this;
|
let that = this;
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
that._offersClient.cancelOffer(new CancelOfferRequest().setId(id), {password: that._password}, function(err: grpcWeb.Error) {
|
that._offersClient.cancelOffer(new CancelOfferRequest().setId(id), {password: that._password}, function(err: grpcWeb.Error) {
|
||||||
|
812
src/protobuf/grpc_pb.d.ts
vendored
812
src/protobuf/grpc_pb.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user