Commit Graph

304 Commits

Author SHA1 Message Date
ghubstan
9f01279141
Merge branch 'master' into 1-basic-api-bsqswap-support 2021-11-12 18:56:54 -03:00
ghubstan
564303ac20
Normalize API gRPC bsq-swap related protos & wrappers
This commit refactors the first cut of the BsqSwapTradeInfo and
TradeInfo gRPC proto defs and wrappers.  The change avoids duplication
of fields between BsqSwapTradeInfo and TradeInfo, and adds a
bsqSwapTradeInfo field to the old TradeInfo proto & wrapper.

The immediate goal is moving towards getting the API's 'gettrade'
method to work for both Bisq v1 trades and BSQ swap trades:  the TradeInfo
proto sent to the CLI should represent either a Bisq v1 trade or a BSQ
swap trade.  A mid-term term goal is to also make a new 'gettrades' method
return a List<TradeInfo> to the CLI, where items in the List<TradeInfo>
can be either v1 trades or bsq-swap trades.
2021-11-12 18:48:35 -03:00
jmacxx
bf311e36fb
Add payment methods ACH Transfer and Domestic Wire Transfer 2021-11-12 11:50:43 -06:00
ghubstan
5924312e64
Adjust bsq-swap-offer related gRPC services & msgs
- Adjust GetBsqSwapOffer(s) rpc services to remove currency param.
- Adjust OfferInfo and remove BsqSwapOfferInfo.
- Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used.
- Add comment about adding sub-message BsqSwapTradeInfo field to TradeInfo.
2021-11-11 12:51:00 -03:00
jmacxx
f72b6c0b0a
Add payment methods Tikkie and TransferWise-USD 2021-11-10 21:48:10 -06:00
Christoph Atteneder
1578f45ffc
Merge pull request #5812 from ghubstan/02-cli-console-formatting-api
Deprecate and replace hard-coded CLI console output formatters
2021-11-09 21:21:52 +01:00
ghubstan
20cc085dc8
Merge branch 'master' into 02-cli-console-formatting-api 2021-11-09 09:20:06 -03:00
chimp1984
7c32587453
Persist bsq blocks as buckets of 1000 blocks
Improve logging

Add BsqBlockStore to protobuf

Remove DaoStateMonitoringService field

Do not persist the blocks in daoState anymore.

This improves persistence performance and reduces memory
requirements for snapshots.
2021-11-09 13:01:19 +01:00
ghubstan
edd01418ca
Remove fields/methods/logic for creating redundant bsq-swap accounts
The user's default bsq-swap account is used instead.
2021-11-07 10:36:40 -03:00
chimp1984
1f929926cc
Remove prevHash from StateHash classes (the prevHash was only used for display.
For creating the hash we take the hash from the previous element. By removing it
we safe about 3 MB on data)

Add isSelfCreated field to DaoStateHash (indicates if we have created
the hash by ourself or if we have received it from a peer -> will be
part of later commits)
2021-11-04 12:48:09 +01:00
chimp1984
1abe68637d
Add useFullModeDaoMonitor field to PreferencesPayload
Add toggle to PreferencesView
Set useFullModeDaoMonitor default to true for headless nodes
2021-11-04 12:48:08 +01:00
chimp1984
f7fcaa915e
Add BSQ swap code 2021-11-02 16:18:50 +01:00
chimp1984
14765d6caa
Move protobuf OfferPayload.Direction to OfferDirection 2021-10-21 15:36:21 +02:00
chimp1984
d063aff5bf
Let OfferPayload extend OfferPayloadBase 2021-10-21 13:50:15 +02:00
chimp1984
a927bea71f
Add scriptTypeId to RawTransactionInput
Add convenience methods
2021-10-20 13:36:41 +02:00
chimp1984
88198be7ff
Rename availableConfirmedBalance to availableBalance
It does not include only confirmed txs as we include
the unconfirmed own change outputs.
2021-10-20 13:25:29 +02:00
jmacxx
b72b70ee8c
Add payment methods Strike and Verse 2021-10-12 14:37:26 -05:00
Christoph Atteneder
9ad4671773
Merge pull request #5746 from jmacxx/missing_invalid_transaction_diagnostic
Fix issue of Trade Step 1 validation done too soon
2021-10-12 10:02:23 +02:00
jmacxx
9ab659ceac
Fix issue of Trade Step 1 validation done too soon
Deprecate 4 states which are not used.
ShareBuyerPaymentAccountMessage can arrive before deposit broadcast completes.
2021-10-11 09:31:57 -05:00
jmacxx
df2d0b3332
Add payment methods Monese and SatisPay 2021-10-07 17:28:42 -05:00
jmacxx
b156f034ad
add payment methods Bizum and Pix 2021-10-03 18:19:37 -05:00
jmacxx
f792db98d0
add Nequi payment method
Signed-off-by: jmacxx <47253594+jmacxx@users.noreply.github.com>
2021-09-28 07:51:06 -05:00
jmacxx
9e5a1c2fd4
add payment method CelPay
Signed-off-by: jmacxx <47253594+jmacxx@users.noreply.github.com>
2021-09-28 07:51:05 -05:00
Christoph Atteneder
14c2e37cca
Merge pull request #5704 from ghubstan/fix-cli-alt-trade-volume-bug
CLI bug fix: show trade's contract volume, not moving offer volume
2021-09-27 11:17:21 +02:00
ghubstan
484f882077
Show frozen fiat trade cost in CLI console
This is a bug fix for the CLI's displayed fiat trade cost
value, which should be trade.volume, not offer.volume.  Offer volume
varies with BTC volatility, and the CLI should be showing the trade.volume
value instead, frozen when the contract is made.
2021-09-17 16:25:37 -03:00
jmacxx
78cd61564c
Add five Indian payment methods 2021-09-15 15:25:43 -05:00
jmacxx
3430055144
add SWIFT payment method
rebased to master
2021-09-08 14:57:08 -05:00
sqrrm
58e09c96ee
Merge pull request #5666 from ghubstan/08-handle-extradata-in-editoffer
Adjust API 'editoffer' to PR 5651 (include extraData field when editing offer)
2021-08-30 10:46:23 +02:00
jmacxx
984a269776
Add Payment Methods: Paysera and Paxum 2021-08-25 13:38:54 -05:00
ghubstan
71a61c63da
Display Enabled=PENDING in CLI 'createoffer' output
A newly created offer has no OpenOffer+State (AVAILABLE || DEACTIVATED)
when displayed in the CLI's console.  This change adds a 'bool isMyPendingOffer'
to the OfferInfo proto + wrapper, and the CLI's console offer output formatter
uses it to determine if it should display a new offer's Enabled column value
as PENDING, instead of an ambiguous NO value.
2021-08-14 16:58:47 -03:00
ghubstan
b8379e2003
Merge branch 'master' into 05-update-api-beta-test-guide 2021-07-30 11:53:34 -03:00
BtcContributor
3be547c445
Add Capitual payment method. Waiting for final Info text to add. 2021-07-19 13:28:11 +02:00
Christoph Atteneder
e5765aeef2
Delay sending of payment account information during trade by @chimp1984
It also removes the op return from the multisig transaction
2021-06-28 09:47:52 +02:00
ghubstan
32688a713f
Add bool isMyOffer to OfferInfo proto 2021-06-15 11:17:02 -03:00
ghubstan
1daf4715f8
Add OfferInfo field isActivated, rpc EditOffer to proto 2021-06-13 11:59:58 -03:00
BtcContributor
8dfe2601df
Restore proto order and add backward compatibility 2021-05-18 18:10:20 +02:00
BtcContributor
2809e8d768
Add Account owner full name field to Uphold payment method 2021-05-17 11:24:07 +02:00
ghubstan
2308afb41b
Adjust to changing minimum tx fee rates
- Append minFeeServiceRate to TxFeeRateInfo proto.
- Display min rate in CLI console.
- Fix broken test due to changing min fee rate.
2021-04-19 12:08:52 -03:00
ghubstan
6bde12ba40
Improve takeoffer output and failure reason messaging
- Added AvailabilityResultWithDescription proto for better takeoffer failure msgs.
- Added VerifyBsqSentToAddress impl to api, but don't expose to CLI yet.
- Show BSQ Buyer Address in gettrade output (changed cli output formatting classes).
- Fixed api.model.PaymentAccountPayloadInfo altcoin instant acct support bug
2021-04-01 16:40:08 -03:00
ghubstan
6299dc33d9
Merge branch '01-api-add-createcryptopaymentacct' into 02-api-trade-contract-details 2021-04-01 15:58:59 -03:00
ghubstan
4fbdc32ba4
Remove space char 2021-04-01 15:45:53 -03:00
ghubstan
58c885efc1
Add support for creating instant altcoin payment accounts in api
- Added bool tradeInstant field to proto message def.
- Adjusted core createcryptopaymentacct impl to new tradeInstant request param.
- Adjusted cli side createcryptopaymentacct impl to new tradeInstant request param.
- Fixed CliMain's takeoffer help text (was missing the --payment-account opt).
2021-04-01 15:43:48 -03:00
ghubstan
2d66a5996d
Merge branch 'master' into 01-api-add-createcryptopaymentacct 2021-04-01 14:54:05 -03:00
ghubstan
9e035e5542
Provide more offer & contract detail available to CLI.
This change adds offer and trade contract detail to the API's Offer
and Trade protos, and improves CLI output formatting.

- Appended missing fields to OfferInfo proto message:
	uint64 sellerSecurityDeposit = 20;
	string offerFeePaymentTxId = 21;
	uint64 txFee = 22;
	uint64 makerFee = 23;

- Added new api proto messages ContractInfo and PaymentAccountPayloadInfo.
  Lighterweight protos are needed because core Trade/Contract classes are
  not visible to CLI.

- Appended ContractInfo field to api proto message TradeInfo.

- Added proto / model converters for ContractInfo and PaymentAccountPayloadInfo,
  and adjusted OfferInfo & TradeInfo.

- Improved CLI output formatting.  Added more trade detail to CLI's gettrade output,
  and prepared to support BTC/BSQ trading pair.  Note a reviewer is advised to
  look at the CLI outout formatting class files instead getting bogged down in the
  many commit changes.
2021-03-25 19:23:06 -03:00
ghubstan
c3f5669cf8
Add api method createcryptopaymentacct
This change supports creation of BSQ BLOCKCHAIN payment method accounts.

- Added proto message defs to grpc.proto.
- Added grpc server boilerplate to GrpcPaymentAccountsService.
- Added server impl to CoreApi, CorePaymentAccountsService.
- Added createcryptopaymentacct-help.txt.
- Added CLI side support for new api method.
- Added opt parsing unit tests to OptionParsersTest.

This is the 1st PR in a series, with the goal of supporting the BTC/BSQ trading
pair.  Support for other crypto currency payment accounts will be added later.
2021-03-25 18:36:26 -03:00
Steven Barclay
f21379160b
Merge branch 'release/v1.6.0' into implement-segwit-for-bsq 2021-03-20 23:18:49 +00:00
ghubstan
344f1613d1
Fix api getfundingaddresses bug
This change uses recently added walletService.isAddressUnused to ensure
the api's CoreWalletsService creates an unused address if none exists.

- grpc.proto:  Add bool isAddressUnused field to message AddressBalanceInfo.
- AddressBalanceInfo:  Adjust AddressBalanceInfo proto wrapper.
- CoreWalletsService:  Use walletService.isAddressUnused in getFundingAddresses.
- GrpcClient:  Adjust to modified AddressBalanceInfo.
- TableFormat, ColumnHeaderConstants:  Add 'Is Used' column to getfundingaddresses output.

Note: bugfix is out of scope for this PR, but the test case helped expose this bug.
2021-03-19 21:24:26 +01:00
ghubstan
9b62a005df
Refactor takeoffer reply proto & ErrorMessageHandler
- Add description msg TakeOfferReply proto, and fromProto method
  to core.offer.enum AvailabilityResult.  The description field
  maps a client usable error message to the enum.

- Adjust GrpcErrorMessageHandler to add AvailabilityResult.description()
  to takeoffer reply.

- Refactor (split up) GrpcClient's takeOffer.  Add getTakeOfferReply()
  to give clients a chance to make choices based on the reply's
  AvailabilityResult when the takeoffer command did not result in a
  trade. (Some errors are fatal, some not.)
2021-03-19 19:38:03 +01:00
ghubstan
d747acc567
Adjust protos for takeoffer error handing
- Add PRICE_CHECK_FAILED to enum AvailabilityResult.
- Add enum AvailabilityResult to TakeOfferReply message.
2021-03-19 19:36:48 +01:00
sqrrm
53f42c4885
Merge pull request #5303 from ghubstan/03-add-long-running-trade-test
Add LongRunningTradesTest to apitest
2021-03-19 12:20:00 +01:00
sqrrm
1c3fc41c33
Merge pull request #5294 from ghubstan/01-fix-takeoffer-err-handling
Improve takeoffer error handing
2021-03-19 11:55:18 +01:00
jmacxx
47ad4219e2
Merge branch 'master' into mempool_check_maker_tx 2021-03-17 16:26:38 -05:00
jmacxx
9fcd65f320
Validate maker/taker fees using mempool lookup
apply @chimp1984 patch.txt code review suggestions
taker tx check moved to trade step 2, after confirmation
solve issue with calculating expected fees for unconfirmed tx
resolve conflict with PR5207 (Disputes UI)
check new offers after 1 block; check Json string not null; warn -> info
remove unused parameter
remove debugging log.warn message
2021-03-17 16:23:18 -05:00
ghubstan
8783889c36
Fix api getfundingaddresses bug
This change uses recently added walletService.isAddressUnused to ensure
the api's CoreWalletsService creates an unused address if none exists.

- grpc.proto:  Add bool isAddressUnused field to message AddressBalanceInfo.
- AddressBalanceInfo:  Adjust AddressBalanceInfo proto wrapper.
- CoreWalletsService:  Use walletService.isAddressUnused in getFundingAddresses.
- GrpcClient:  Adjust to modified AddressBalanceInfo.
- TableFormat, ColumnHeaderConstants:  Add 'Is Used' column to getfundingaddresses output.

Note: bugfix is out of scope for this PR, but the test case helped expose this bug.
2021-03-15 16:15:06 -03:00
ghubstan
1d56d79457
Refactor takeoffer reply proto & ErrorMessageHandler
- Add description msg TakeOfferReply proto, and fromProto method
  to core.offer.enum AvailabilityResult.  The description field
  maps a client usable error message to the enum.

- Adjust GrpcErrorMessageHandler to add AvailabilityResult.description()
  to takeoffer reply.

- Refactor (split up) GrpcClient's takeOffer.  Add getTakeOfferReply()
  to give clients a chance to make choices based on the reply's
  AvailabilityResult when the takeoffer command did not result in a
  trade. (Some errors are fatal, some not.)
2021-03-15 11:17:09 -03:00
ghubstan
5c097d3bcf
Adjust protos for takeoffer error handing
- Add PRICE_CHECK_FAILED to enum AvailabilityResult.
- Add enum AvailabilityResult to TakeOfferReply message.
2021-03-10 14:15:29 -03:00
jmacxx
cc56470b2f
Improve chat functionality of mediation/arbitration
Show badge with number of unread chat messages on each ticket
Use icons for chat, info and process ticket functions
Select a row by clicking on it, no clunky select button needed.
Show chat messages in a movable popup window.
More space for ticket list.

Implement requested feature additions:

Indicate if the trade period is over
Indicate more clearly the sender of each chat message
Support badge count
Indicate the XMR tx proof (when applicable)
Allow trader to close own mediation ticket if the trade is paid out

Fixes:

null check for cases when extraData null/not applicable
when upgrading closed disputes, clear chat unread count
2021-03-03 18:41:17 -06:00
ghubstan
1154085632
Add api method 'stop'
This change gives CLI users a 'stop' command to shutdown a daemon.

- Server side gRPC boilerpate was added to :proto and :daemon.

- When the new GrpcShutdownService accepts a 'stop' request from the CLI,
  it calls UserThread.runAfter(BisqHeadlessApp.getShutDownHandler(), 500, MILLISECONDS);

- Method help file 'stop-help.txt' was added to :core.

- Client side gRPC boiler plate and 'stop' implementation was added to :cli.
2021-02-18 11:54:10 -03:00
Christoph Atteneder
31b7292d56
Merge pull request #5117 from jmacxx/add_country_amazon_account
Specify Amazon eGift Card country
2021-02-12 20:34:51 +01:00
jmacxx
d72b1a6639
Specify Amazon eGift Card country
Adds countryCode to AmazonGiftCardAccountPayload
Account upgrade done at startup => Eurozone accounts will prompt for country.
Trade buyer step 2 prompts use of the appropriate Amazon website for buying gift card.
2021-02-03 13:57:20 -06:00
jmacxx
da45b8e6cf
Add pre-release software update notifications 2021-01-22 20:08:02 -06:00
Steven Barclay
5990fcf9e7
Bring ScryptType enum up to date with latest bitcoind
Add 'witness_v1_taproot' script type to the enum and proto.pb, so that
it doesn't cause any problems when Taproot is activated and the new
script type starts showing up in RPC getBlock(..) responses (including
possibly BSQ transactions).

Also change the Java enum order (which shouldn't cause any problems as
the ordinal isn't used directly in hashCode calculations) and add the
missing 'witness_unknown' enum value to pb.proto to bring it in sync.
2021-01-21 10:08:15 +00:00
Christoph Atteneder
334fbdbc86
Merge pull request #5092 from jmacxx/add_cashbymail3
Add payment method "Cash by mail"
2021-01-21 10:26:59 +01:00
jmacxx
e11209d395
Add payment method "Cash by mail" 2021-01-18 21:15:18 -06:00
sqrrm
d3971ef7dd
Merge pull request #5072 from chimp1984/persist-and-republish-mailbox-messages
Persist and republish mailbox messages
2021-01-16 20:24:13 +01:00
ghubstan
a067ba1228
Add new CoreHelpService and method help docs
Adds all the gRPC server boilerplate, and a simple help service
that serves method help in man page format.  Help text is maintained
in text files located in core/src/main/resources/help.

Only some of the method help text files are defined in this
change, more to be added.
2021-01-14 10:19:39 -03:00
chimp1984
32f887478b
Persist map for removed mailbox messages (AddOncePayload more generally)
We add the date when we add the hash so that we can remove expired data.
2021-01-12 10:48:26 -05:00
ghubstan
0c6005ed2d
Stub out support for OpenOffer's triggerPrice in api
This is a feature that will not be included in api v1, but partial
support is added in this change to the server.  CLI will pass a
default triggerPrice of 0 (unused) with the createoffer command.

When fully implemented, an optional trigger-price param will be
added to the CLI's createoffer method, and the value will only be
visible to offer owners.  New enableoffer and disableoffer
methods will also need to be added.
2021-01-11 14:36:51 -03:00
Christoph Atteneder
1daa58624d
Merge pull request #5061 from chimp1984/persist-failed-mailbox-msg-decryption-attempts
Persist failed attempts of decrypting mailbox messages
2021-01-08 10:35:41 +01:00
sqrrm
76e2330b15
Merge pull request #5056 from ghubstan/add-getmyoffers-api-method
Add new api methods 'getmyoffers' and 'getmyoffer'
2021-01-07 22:51:33 +01:00
chimp1984
21eaea0703
Add IgnoredMailboxMap to persist failed decryption
attempts and optimize performance by that
2021-01-06 21:20:50 -05:00
ghubstan
18de222d38
Add new api methods 'getmyoffers' and 'getmyoffer'
Similar to 'getoffers' and 'getoffer', but filters out offers not
created by the user.  The new methods are so similar some offer list
filtering and sorting was refactored in CoreOffersService.

Also fixed some createoffer apitest cases in anticipation of a new OfferFilter,
which will filter out offers not matching any user payment account.
2021-01-04 21:43:34 -03:00
chimp1984
c2174607f5
Add isTakerApiUser field to OfferAvailabilityRequest
Add UNCONF_TX_LIMIT_HIT and MAKER_DENIED_API_USER to AvailabilityResult enum
Apply handling for api filter features
2021-01-04 12:35:29 -05:00
chimp1984
95063b6c7f
Add denyApiTaker field to Preferences 2021-01-04 12:00:29 -05:00
chimp1984
cfabf79ca4
Merge branch 'add-toggle-for-hiding-not-takable-offers' into add-new-filter-entries 2021-01-04 11:48:02 -05:00
chimp1984
4bbc394b2d
Add disableApi flag to filter 2021-01-04 11:44:50 -05:00
chimp1984
9e275048f6
Add toggle for filtering offers which can be taken with users accounts 2021-01-04 11:32:56 -05:00
sqrrm
7bc9c102d0
Merge pull request #5045 from chimp1984/add-option-to-hide-non-supported-payment-methods
Add option to hide non supported payment methods
2021-01-04 12:06:41 +01:00
chimp1984
05b993e7b9
Rename bannedNodeAddress to nodeAddressesBannedFromTrading 2021-01-03 18:53:15 -05:00
chimp1984
eddb7cb555
Add option in preferences to hide payment methods which are not part of the users accounts.
Default value is false, so same behaviour as before the change.
If no payment account is setup then we also show all payment methods.
In that case (no payment account) we disable the toggle as well as set it to false.
2021-01-01 21:52:34 -05:00
chimp1984
c8bf1d469e
Add support to filter manager for network wide banned nodes 2021-01-01 16:51:24 -05:00
Christoph Atteneder
a2a542e11e
Merge pull request #4999 from chimp1984/persist-app-window-layout
Add generic map (cookie) to UserPayload
2020-12-29 19:44:29 +01:00
chimp1984
d76a810691
Add generic map (cookie) to UserPayload for persisting UI states like app layout 2020-12-24 17:05:04 -05:00
chimp1984
0e6b983564
Add triggerPrice 2020-12-23 21:50:53 -05:00
ghubstan
64c2ac5169
Adjust grpc.proto to reverting 6aa385e494 2020-12-21 15:17:52 -03:00
ghubstan
672eb79f95
Revert "Append nullable withdrawalTxId field to Trade proto message"
This reverts commit 6aa385e494.
2020-12-21 15:05:54 -03:00
ghubstan
5522d0c53e
Add new api method gettransaction
This change was prompted by the recent changes in the main branch to
allow a tx memo field to be set from the UI and API.

This and the prior PR address the API's need to be able to fetch a
tx (with a memo).  The API can now get a completed trade's withdrawal
txid and pass it as a gettransaction parameter.

See previous PR "Append nullable withdrawalTxId field to Trade".

	https://github.com/bisq-network/bisq/pull/4937

A summary of changes by file:

grpc.proto

- Added withdrawalTxId field to existing TradeInfo proto & wrapper.
- Reordered fields in TradeInfo proto.
- Added new fields to be displayed by TxInfo proto in CLI.
- Fixed typo: unsetTxFeeRatePreference -> UnsetTxFeeRatePreference.
- Added new GetTransaction rpc.

GrpcWalletsService - Added new getTransaction gRPC boilerplate.

CoreWalletsService - Added new getTransaction implementation.

TxInfo - Added the new fields for displaying a tx summary from CLI.
This is not intended to be more than a brief summary;  a block explorer
or bitcoin-core client should be used to see the complete definition.

TradeInfo - Added the new withdrawalTxId field defined in grpc.proto.

CliMain - Added new 'case gettransaction'.

TransactionFormat - Formats a TxInfo sent from the server to CLI.

ColumnHeaderConstants - Added console headers used by TransactionFormat.

TradeFormat - Displays a completed trade's WithdrawalTxId if present.

Apitest - Adjusted affected tests: assert tx memo is persisted and
test gettransaction.
2020-12-14 15:01:03 -03:00
ghubstan
6aa385e494
Append nullable withdrawalTxId field to Trade proto message
The withdrawalTxId field will be set in TradeManager#onWithdrawRequest
upon successful trade completion and withdrawal of funds.

Persisting withdrawalTxId will allow the api and ui to find the withdrawalTxId
for a completed trade after the seller withdraws funds to an external wallet.
In turn, the withdrawal tx's memo field will be accessible in a new (todo)
api getTx(txID) api method.

Changed:

- Appended field 'string withdrawal_tx_id = 40' to pb.proto's Trade message.

- Added nullable 'String withdrawalTxId' to Trade entity class.

- Added trade.setWithdrawalTxId(transaction.getTxId().toString()) in
  TradeManager#onWithdrawRequest's callback.
2020-12-12 12:01:55 -03:00
ghubstan
259bad629a
Merge branch 'master' into 05-use-memo-tx-field 2020-12-10 11:59:28 -03:00
ghubstan
bd66008062
Support tx memo field for btc withdrawals from api
- Added optional memo parameter to the api's sendbtc and
  withdrawfunds commands.

- Removed the @Nullable annotation was removed because protobuf
  does not support null.

- Visibility in two wallet check methods were changed from private
  to pkg protected so the CoreTradeService could use them.

- Adjusted affected tests.  (Asserting the memo field was set on a
  transaction cannot be checked from apitest yet.)
2020-12-09 16:51:56 -03:00
ghubstan
6c9f0c252d
Add new api method 'sendbtc' and test
Takes an address, amount, and optional txfeerate param,
returns a lightweight TxInfo proto.

Also overloaded two BtcWalletService methods to allow sendbtc
to pass in the tx fee rate -- overriding the fee service and
custom fee rate setting.
2020-12-08 21:12:02 -03:00
Christoph Atteneder
29c2e0002d
Merge branch 'master' of github.com:bisq-network/bisq into hotfix/v1.5.1
# Conflicts:
#	build.gradle
#	core/src/main/java/bisq/core/btc/setup/WalletConfig.java
#	desktop/package/linux/Dockerfile
#	desktop/package/linux/package.sh
#	desktop/package/linux/release.sh
#	desktop/package/macosx/create_app.sh
#	desktop/package/macosx/finalize.sh
#	desktop/package/macosx/insert_snapshot_version.sh
#	desktop/package/windows/package.bat
#	desktop/package/windows/release.bat
#	relay/src/main/resources/version.txt
#	seednode/src/main/java/bisq/seednode/SeedNodeMain.java
2020-12-08 22:19:11 +01:00
ghubstan
159d4cc6f5
Add optional txFeeRate parameter to api sendbsq
If present in the sendbsq command, the parameter will override the fee
service and custom fee rate setting for the BSQ transaction.

Also changed the sendbsq grpc return type to a lightweight TX proto wrapper.

Besides some small refactoring in the CLI, all the changes are
adjustments for this new sendbsq parameter and its new grpc return value.
2020-12-04 17:17:37 -03:00
chimp1984
8f99ca0b63
Add uid to trade to make sure that look up for process model cannot
fail in case of multiple trades with the same offer id.
Use uid instead of the weaker offerId as key for the tradeProtocolByTradeId map
2020-12-03 14:43:35 -05:00
ghubstan
65df9e1503
Change sendbsq's amount parameter type to String 2020-12-02 14:52:05 -03:00
ghubstan
987d89319e
Use ListenableFuture and callback when requesting tx fee
This change fixes the blocking problem in the fee rate request api.
Also redefined the TxFeeRateInfo.

- Redefined grpc.proto message TxFeeRateInfo, added
  lastFeeServiceRequestTs field. (CLI user may want to know
  TS of last fee request.)

- Adjusted TxFeeRateInfo proto wrapper.

- Adjusted CurrencyFormat and BtcTxFeeRateTest to new TxFeeRateInfo.

- Added @Getter annotation to FeeService.  (CLI user may want to know
  TS of last fee request).

- Pass resultHandler from GrpcWalletsService through CoreApi, to
  CoreWalletsService's tx fee rate api methods.
2020-12-01 21:10:47 -03:00
ghubstan
faf030fbc5
Add useCustomTxFeeRate field to TxFeeRateInfo proto wrapper
This is set from the core preferences.isUseCustomWithdrawalTxFee(),
and simplifies fee changing logic in the API.
2020-12-01 17:14:08 -03:00
ghubstan
9662f26b23
Add protbuf TxFeeRateInfo 2020-11-26 18:03:42 -03:00
ghubstan
44646763ef
Add protobuf defs for gettxfeerate, settxfeerate, unsettxfeerate 2020-11-26 18:02:32 -03:00
ghubstan
8f13b85e19
Merge branch 'master' into 20-pr-change-requests-A 2020-11-26 17:19:00 -03:00
Steven Barclay
5a3b072692
Withhold witnesses in buyer->seller depositTx data, until last step
Strip all input witnesses from the depositTx message fields sent from
the buyer, until the last (DelayedPayoutTxSignatureResponse) message is
sent, where they can be bundled in as an extra field. Since the witness
data doesn't affect the final deposit tx id, the seller does not need to
know it until actually publishing the tx.

In the (fully) segwit case, this allows the buyer to prevent the seller
from publishing the deposit tx until the buyer has a valid, fully signed
delayedPayoutTx. Provide the final witness data in an extra 'depositTx'
field in DelayedPayoutTxSignatureResponse, which the seller can merge
with his depositTx witness block (for his own input signatures).
2020-11-19 17:19:13 +00:00
Steven Barclay
f02d5ee216
Send seller's delayedPayoutTx signature to peer ASAP
Include a new 'delayedPayoutTxSellerSignature' field with the prepared
delayed payout tx sent to the buyer, in DelayedPayoutTxSignatureRequest.
This will allow the buyer to compute the final, signed delayedPayoutTx
as early as possible and withhold their deposit tx witness from the
seller until they know they have a valid delayedPayoutTx, preventing its
premature publishing in the fully segwit case. (To be done in a later
commit - for now just save the seller's delayedPayoutTx signature.)

As part of this, run the SellerSignsDelayedPayoutTx trade task at an
earlier step (just after payout tx creation) to make its signature
available to the seller ASAP. Also rename 'delayedPayoutTxSignature' to
'delayedPayoutTxBuyerSignature' in DelayedPayoutTxSignatureResponse.
2020-11-19 17:19:12 +00:00
ghubstan
08228d07bc
Replace existing api method 'createpaymentacct' impl
In the CLI, this method now takes a single argument, the path to a json
file (a payment account form).  The json text is read from the file
and sent to the server, where it is serialized to a new PaymentAccount
instance, saved, and sent back to the CLI as a protobuf.PaymentAccount.

- Modified existing gRPC boilerplate in grpc.proto and GrpcPaymentAccountsService.

- Modified existing method signatures in CoreApi and CorePaymentAccountsService.

- Replaced existing method impl in CorePaymentAccountsService and
  removed dead code.

- Replaced the CLI's existing 'createpaymentacct' method impl.

- Modified existing tests.
2020-11-18 19:23:21 -03:00
ghubstan
8996fa1748
Add boilerplate for new 'getpaymentacctform' api method 2020-11-18 16:17:24 -03:00
ghubstan
ec381522ff
Add api method 'getpaymentmethods'
Returns a list of supported payment method IDs.  This gives CLI users
the correct payment method id for creating a new payment account.

- Added gRPC service GetPaymentMethods to grpc.proto.

- Added gRPC boilerplate method to GrpcPaymentAccountsService.

- Added implimentation to CoreApi -> CorePaymentAccountsService.

- Refactored PaymentAccountTest hierarchy.

- Add api method to CLI.
2020-11-18 12:03:22 -03:00
ghubstan
7e9ab22d65
Refactor api getbalance methods.
This change fixes the recently bloated wallet balances api.  Now there
is one CLI getbalance [bsq|btc] method that calls a getbalances(currency-code)
on the server.  The server returns full wallet balance information for
BSQ, BTC, or both if the CLI's currency argument is absent.

- grpc.proto:  Reduced number of getbalance(s) proto services from
  four to one.

- GrpcWalletsService:  Reduced number of getbalance(s) gRPC service
  boilerplate methods from four to one.

- CoreApi, CoreWalletsService:  Reduced number of getbalance(s) gRPC
  service implementation methods from four to one.

- CliMain:  Reduced number of getbalance(s) commands from four to one.

- BalancesInfo: Changed BsqBalanceInfo & BtcBalanceInfo field names
  to bsq and btc, respectively, to make calling their accessors
  more readable, less verbose.

- BtcBalanceInfo, BsqBalanceInfo: Defined static final EMPTY instances
  as place holders in a BalancesInfo returned by the gRPC server, when
  one or the other balance types is not requested.  Would be nice
  to serve Optional.empty() instead, but protobuf does not support
  it or null.

- Adjusted affected api tests and build doc.
2020-11-14 13:08:10 -03:00
ghubstan
9f033ee572
Add proto fields to support trade fee currency choice
This change adds proto support for paying maker fees in bsq or btc.
The implementation will come in a future PR.

- Added makerFeeCurrencyCode field to CreateOfferRequest proto.

- Added isCurrencyForMakerFeeBtc field to OfferInfo proto wrapper.

- Add takerFeeCurrencyCode field to TakeOfferRequest proto.
2020-11-13 12:03:15 -03:00
ghubstan
3e98910cc6
Define proto fapi method 'sendbsq'
This change adds the proto to support a future api implementation for
transfering bsq.
2020-11-13 11:44:42 -03:00
ghubstan
4c03b463fe
Define proto for api method 'getunusedbsqaddress'
This change adds a proto to support a future api implementation for
getting an unused, bsq funding address.
2020-11-13 11:35:06 -03:00
ghubstan
fc8af8c072
Define new grpc bsq/btc balances protos
This change adds proto serivces and messages to support new api
implementations for serving bsq, btc or all wallet balances.

- RPC GetBsqBalances will return complete BSQ balance info.
- Message BsqBalanceInfo is proto returned by rpc GetBsqBalances.

- RPC GetBtcBalances wil return complete BTC balance info.
- Message BtcBalanceInfo is proto returned by rpc GetBtcBalances.

- RPC GetBalances returns complete BTC and BSQ balance info.
- Message BalancesInfo is proto returned by rpc GetBalances.

RPC GetBalance remains unchnaged, still returns only the available
BTC balance.  It may be deprecated and removed in a future PR.
2020-11-13 11:01:02 -03:00
chimp1984
a238c205ab
Add Amazon eGift Card payment method 2020-11-13 00:26:23 -05:00
chimp1984
9cd5dc9e26
Add support for persisting MailboxMessageList 2020-11-11 22:19:44 -05:00
Oscar Guindzberg
c4131c7398
Rename "tx size" to "tx vsize" 2020-11-05 19:28:45 -03:00
Christoph Atteneder
8fe8261a1e
Clean up code 2020-11-03 15:42:46 +01:00
Luis Aranguren
ecf9d49f65
Resolve conflicts with master 2020-11-03 15:42:23 +01:00
sqrrm
9e1466417f
Merge pull request #4713 from ghubstan/12-stub-canceloffer
Stub out 'canceloffer offer-id' api method
2020-11-02 12:59:03 +01:00
Christoph Atteneder
9ab65459df
Merge pull request #4736 from jmacxx/add_autoconf_service_filter
Admin filter for auto-confirmation service addresses
2020-11-02 10:47:22 +01:00
jmacxx
15b8e72059
Admin filter for auto-confirmation service addresses
A service address can be filtered out using the admin key.  This would
be useful if a federated server failed, it could be filtered out so
that the auto-confirmation operates with the remaining services.  If
all federated service addresses were filtered out the user would have to
either confirm manually or use their own explorer service.
2020-11-01 08:20:33 -06:00
sqrrm
89620a02da
Merge pull request #4706 from chimp1984/remove-outliers-at-bsq-rate
Remove outliers when calculating BSQ rate
2020-10-31 23:07:40 +01:00
sqrrm
605f4b3015
Merge pull request #4726 from chimp1984/add-transferwise-payment-method
Add transferwise account
2020-10-31 13:20:41 +01:00
sqrrm
c4e2021e37
Merge pull request #4709 from ghubstan/9-closetrade-protos
Stub out api methods 'keepfunds', 'withdrawfunds'
2020-10-30 14:05:16 +01:00
sqrrm
3c56268149
Merge pull request #4701 from ghubstan/5-refactor-trade-utils
Add getRole(tradeId) to core api
2020-10-30 13:43:15 +01:00
sqrrm
3356c8f632
Merge pull request #4696 from ghubstan/1-add-grpc-trade-proto-fields
Add fields to grpc TradeInfo proto & wrapper
2020-10-29 22:31:26 +01:00
chimp1984
ebce18c338
Add transferwise account 2020-10-28 21:35:47 -05:00
ghubstan
027a7d5cd3
Stub out canceloffer api method
The implementation will be added to CoreOffersService in the next PR.
2020-10-27 14:54:50 -03:00
ghubstan
a8decafc2f
Stub out api methods 'keepfunds', 'withdrawfunds'
This PR adds trade closing method stubs to keep funds in the
Bisq wallet or send them to an external BTC wallet.

- Add grpc protos
- Add new methods to GrpcTradesService, CoreApi
- Stub out implementations in CoreTradesService
- Add methods to CLI
2020-10-26 17:43:08 -03:00
chimp1984
8bfe9b82c8
Remove outliers when calculating BSQ rate
Add percentage for upper and lower threshold for outlier detection.
2020-10-25 18:34:22 -05:00
ghubstan
161dbade0d
Add getRole(tradeId) to core api
API users will need to see their role as maker/taker when looking at trade details.

- Add getRole(trade) to TradeUtil.
- Add getTradeRole(tradeId) to CoreApi, CoreTradesService.
- Add role field to TradeInfo proto and its wrapper class.
2020-10-25 16:22:20 -03:00
ghubstan
63cf436990
Add fields to grpc TradeInfo proto & wrapper 2020-10-24 16:27:03 -03:00
chimp1984
21bd85c488
Remove signature from GetInventoryRequest (as monitor is public it does not make sense to limit requests).
Add html output and webserver
2020-10-23 01:17:33 -05:00
chimp1984
ca7fe94c06
Add signature to request to limit the feature to requests from trusted nodes (monitor) 2020-10-23 01:17:32 -05:00
chimp1984
9dab186086
Move inventory package to core as we want to include other domain data as well like DAO state
Add more data to inventory map and change type of value to String.
2020-10-23 01:17:32 -05:00
ghubstan
e809af37cc
Add 'takeoffer' API method
- Add new core.offer.takeoffer.TakeOfferModel

	Would have been nice to move more logic from
	bisq.desktop.main.offer.takeoffer.TakeOfferDataModel,
	but it has JFX dependencies that cannot be use in :core.

- Add grpc protos to support takeoffer, confirmpaymentsent, confirmpaymentreceived

	Only takeoffer is implemented in this commit.

- Refactor OfferInfo grpc proto wrapper, and add offer state field

- Add new TradeInfo grpc proto wrapper

- Implement takeoffer on server and cli side

- Refactor offer/trade tests, add test cases
2020-10-20 16:00:05 -03:00
Christoph Atteneder
ebe4618bfe
Merge pull request #4655 from bisq-network/release/v1.4.0
Release/v1.4.0 and v1.4.1
2020-10-20 09:10:12 +02:00
chimp1984
5f9d3d1f0d
Add GetInventory messages
This will be used for monitoring seed nodes.
Instead of requesting all data (we cannot request all in fact as it is too large)
we request the number of items the node has.

This code will not have any impact atm. It will be triggered once a new monitor module gets added which
will send the GetInventoryRequest to the seeds.
2020-10-13 23:30:39 -05:00
chimp1984
6766835af6
Use TradeStatistics3 in protobuf file 2020-10-08 18:49:14 -05:00
chimp1984
6d43c09b33
Delete TradeStatistics (version 1) 2020-10-08 18:48:52 -05:00
chimp1984
00bed02839
Add TradeStatistics3 and related classes
Add TRADE_STATISTICS_3 Capability
Add TradeStatistics3 to proto resolvers
Make message TradeStatistics2 deprecated
2020-10-08 18:48:17 -05:00
Oscar Guindzberg
ced357ce25
AddressEntry: Add boolean segwit flag 2020-10-08 16:33:49 -03:00
ghubstan
29d1905f31
Add new 'getoffer offer-id' api method
There are a number of use cases where a user may want to see a single
offer instead of every offer for a currency pair on the buy or sell side.
The changes are:

- Add getoffer to grpc.proto
- Add new method to GrpcOffersService, CoreApi, CoreOffersService
- Add new method to CLI
- Adjust create offer tests to use this new convenience
2020-10-07 12:09:13 -03:00
chimp1984
ccfda5b043
Cleanups, add generics, add final, remove unused code/comments/todos, 2020-10-03 12:48:21 -05:00
chimp1984
fa0d261397
Fix remaining issues, cleanups, add persit calls, remove unused code,...
Sorry too tired to create another 20 commits...
2020-10-03 12:48:21 -05:00
sqrrm
f051a03d29
Merge pull request #4559 from ghubstan/cli-create-offer
Build out 'createoffer' API method
2020-10-03 17:04:11 +02:00
chimp1984
ef7f5a7f63
Revert nonce index at PreliminaryGetDataRequest protobuf entry to 21 as it was the version used in master as well. We cannot change that without breaking compatibility. 2020-10-02 13:13:45 -05:00
chimp1984
5027c861e3
Fix proto field index 2020-10-01 16:33:33 -05:00
chimp1984
384152fb6b
Add version field to data requests classes 2020-10-01 15:05:31 -05:00
chimp1984
fb41a1984b
Merge branch 'master_upstream' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/TradeManager.java
#	desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java
2020-10-01 09:24:46 -05:00
sqrrm
0b1894a939
Merge pull request #4554 from ghubstan/create-offer
Change 'createoffer' api method return type
2020-10-01 14:48:38 +02:00
ghubstan
2f3e3a31e1
Add simple mkt-price service & test calculated offer prices
A gRPC price service was added, and api create-offer tests can check
mkt based price margin calculations.
2020-09-25 20:48:26 -03:00
chimp1984
10bedee803
Merge branch 'dispute-agent-branch' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSetupDepositTxListener.java
2020-09-25 15:03:28 -05:00