JoeGruffins / cake_wallet

The open source repository for Cake Wallet, a noncustodial multi-currency wallet, and Monero.com, a noncustodial Monero-only wallet. Need help? Check out https://guides.cakewallet.com
https://cakewallet.com
MIT License
0 stars 2 forks source link

Enable buy and sell for decred and fix wallet bug on ios #14

Closed ukane-philemon closed 3 months ago

ukane-philemon commented 4 months ago

Issue Number (if Applicable): Fixes #

Description

  1. This PR fixes a bug where existing decred wallets are not found after the wallet app is restarted on ios.
  2. This PR enables buy and sell onramp. Note: sell doesn't work rn (from my end) but there's a buy option for decred.

Builds on: #12

Pull Request - Checklist

ukane-philemon commented 4 months ago

Note: I've not been able to make onramper select decred as the default currency.

JoeGruffins commented 3 months ago

I don't think 44556dd isn't the right way to handle this bug.

I think we should just make the key a combination of txid:vout, so like "50a595cae0c57244d42a03725948c41041159ddc4f365171cb9fd8084a8ed04d:0", then they are all unique.

ukane-philemon commented 3 months ago

I think we should just make the key a combination of txid:vout, so like "50a595cae0c57244d42a03725948c41041159ddc4f365171cb9fd8084a8ed04d:0", then they are all unique.

Errm, okay. I'll try your suggestion. However, we still need to set output addresses, I think.

JoeGruffins commented 3 months ago

However, we still need to set output addresses, I think.

I could be wrong but I dont think we will. The problem was having different outputs using the same id. The values are already divided up by dcrwallet and we don't need to worry about adding them together. Really the map is not transactions but UTXO (and spent txo) which is confusing but we should leave the name anyway imo.

ukane-philemon commented 3 months ago

Okay.

JoeGruffins commented 3 months ago

Thanks this looks correct to me!

Two things I noticed, one is pending transactions are not being confirmed. Another is can you change the libwallet version in the android script as well?

ukane-philemon commented 3 months ago

one is pending transactions are not being confirmed.

They are replaced.

Another is can you change the libwallet version in the android script as well?

Sure, missed that.

JoeGruffins commented 3 months ago

It seems the ui is not updating because the id is not the same as the map id. Can you not add vout to the transaction info and just make the id the txid:vout? You can make dcrdata work in lib/view_model/transaction_details_view_model.dart with return 'https://dcrdata.decred.org/tx/${txId.substring(0, 64)}';

JoeGruffins commented 3 months ago

Changes have been added to the upstream pr so closing.