Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Multi wallet #1563

Merged
merged 355 commits into from
Dec 19, 2018
Merged

Multi wallet #1563

merged 355 commits into from
Dec 19, 2018

Conversation

rmisio
Copy link
Contributor

@rmisio rmisio commented Sep 19, 2018

This is the base branch for the multi-wallet client integration. It should be run with the multiwallet server branch.

closes #1585
closes #1425

js/start.js Outdated
return;
}

app.serverConfig.walletsHelp = 'CAUTION! - Rather than reading the wallet curs directly ' +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this helpful at all? If you were exploring app.serverConfig in the JS console, would you notice this warning?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would you see this in the console?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a developer is examining app.serverConfig in the console. Rather than them write code that directly references app.serverConfig.wallets, the preference is for them to get the curs from a utility function

// that currency, then exchange rate data is not needed.
// TODO:
// TODO:
// TODO: ugh - how to handle that case?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty interesting scenario, albeit quite the edge case, so we should probably take a lower scope path.

Anyhow, the idea is that if a listing is priced in a certain currency we don't have exchange rate data for then the Buy Now button is disabled. But, if the listing happens to be priced in one of the accepted currencies (and the accepted currency is supported by the user's wallet), then as long as the user pays in that currency, the purchase would work. So maybe in this case, we leave the button enabled:

image

And then in the Checkout, maybe we just disable all options other than the one in the pricing currency? Maybe with a little 'exchange rate unavailabletext, similar to howNot available` is used when your wallet doesn't support one of the accepted currencies?

image

(just want to stress to not put too much effort into this because most listings are probably priced in fiat AND the exchange rate API shouldn't be down too often (hopefully))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to allow like to like crypto purchases (ie if the listing is priced in a crypto coin, I can buy it with that crypto coin), since that would allow the network to keep working if the ticker was down, but not if it adds a lot of complexity.

Your idea seems right to me, we'd just disable all the currencies that won't work with a note next to each explaining why.

Copy link
Contributor

@jjeffryes jjeffryes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through things, this looks really good. I had a couple of thoughts so far.

`https://blockchair.com/bitcoin/transaction/${txid}`
),
canShapeShiftIntoWallet: true,
canShapeShiftIntoPurchase: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder here that the shapeshift code can be removed since we don't use shapeshift any more.

/**
* Returns a list of the crypto currencies supported by the wallet.
*
* @param {object} [options={}] - Function options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the brackets around the object needed? It looks like jsDoc uses them if the object is in an array, the options aren't part of an array passed to the supportedWalletCurs function here are they? http://usejsdoc.org/tags-param.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjeffryes The bracket notation on the variable name signifies that it's optional:
http://usejsdoc.org/tags-param.html#optional-parameters-and-default-values

The type is driven by the preceding fragment ({object} in this case).

@@ -316,23 +321,23 @@ function fetchVerifiedMods() {
const fetchStartupDataDeferred = $.Deferred();
let ownFollowingFetch;
let exchangeRatesFetch;
let walletBalanceFetch;
let walletBalancesFetch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought renaming this. We should probably take care across the app to make sure names still make sense with the multi wallet.

<div class="flex snipKids gutterH tx5 detailsRow">
<% if (ob.hasValidCurrency) { %>
<div class="flex gutterH tx5 detailsRow">
<% if (ob.hasValidCurrency && false) { %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the && false just test code?

<div class="statsWrap flexColRows clrBr">
<div class="js-walletStatsContainer"></div>
<div class="buttonWrap">
<a class="btn clrP clrBr clrSh2 btnReceiveMoney js-toggleSendReceive"><%= ob.polyT('wallet.btnReceiveMoney') %></a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to use the top nav button classes I made for the donations modal here.

I assume this will replace the sendReceiveNav? Or is it the other way around?

initialState: {
active: false,
balance: 0,
displayCur: app && app.settings && app.settings.get('localCurrency') || 'PLN',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaulting to zloty?:)


render() {
const state = this.getState();
this.$el.toggleClass('active', state.active);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to handle the active state styling inside the coinNavItem template, so there isn't an extra DOM change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but that then gives you an extra wrapping element which, not only is kind of ugly, but also doesn't play nice with stuff like padMdKids borderStacked.

I'll keep this in mind though and maybe circle back to it when I make some other optimizations.

jjeffryes and others added 28 commits December 11, 2018 17:07
Co-Authored-By: rmisio <rmisio@users.noreply.github.com>
removing polyTfallback and using native functionality
Fix Vertical Centering on Mod Message
Ignore temp folder when building binaries
Update Debian dependency for libgconf2.4
@jjeffryes jjeffryes merged commit fae50c8 into master Dec 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multicoin Integration - Wallet
3 participants