-
Notifications
You must be signed in to change notification settings - Fork 973
Implement BAT into payments #10945
Comments
@mrose17 questions 😃 |
Resolves brave#10945 Auditors: Test Plan:
you have questions, we have answers!
ps: @NejcZdovc - thanks for finding and fixing the bugs in the |
and i have a few more answers
|
|
got it, thanks! |
Resolves brave#10945 Auditors: Test Plan:
adding crypto svg icons for buttons |
Resolves brave#10945
no-qa-needed (as it had been done already) ? |
@NejcZdovc, as per @luixxiul suggestion, can we mark this as Is there anything that needs to be addressed by QA in this particular issue? |
no I don't think so. BAT flow become main stream now with ledger manual test plan |
Resolves brave#9740 Resolves brave#10945 Resolves brave#11251 Resolves brave#11264 Resolves brave#11285 Resolves brave#11289 Resolves brave#11292 Resolves brave#11293
Describe the issue you encountered:
Implement BAT into the existing ledger code.
Notes from @mrose17:
ledger*
packagespackage.json
require('ledger-*')
inapp/ledger.js
use thebat-*
package insteadgeoip
, as this is no longer usedledgerClient = ...
includeversion: 'v2'
in theoptions
parameter. the easiest way to do this is to add that value toclientOptions
near the top of the fileledigerClient.getWalletAddress
, which returns the BAT address, or you can callledgerClient.getWalletAddresses
which returns an array of all addressesupdateLedgerInfo
andgetPaymentInfo
routines because this is where you get the current wallet state7a. here is an example of what
getPaymentInfo
gets when the callback toclient.getWalletProperties
invokes the callback:the
balance
andunconfirmed
fields are now denominated in BAT rather than BTC. instead ofsatoshis
, theprobi
field shows the BAT "wei", so if you want the exact number of BAT, you'll need to put that into a BigNum and then divide by 10^18. you can convert to USD by doing balance * rates.USDyou may notice that
buyURL
andbuyURLExpires
have gone away.when we have a buy widget for BAT, then
buyURL
will come back.7b. here is an example of what
updateLedgerInfo
sees inledgerInfo._internal.paymentInfo
:again, no
btc
andsatoshis
fields, butBAT
andprobi
fields.8. finally, there is one bit of information hiding that i missed in the
ledger-client
package: ingetStateInfo
instead of doingledgerInfo.passphrase = state.properties.wallet.keychains.passphrase
do
ledgerInfo.passphrase = ledgerClient.prototype.getWalletPassphrase(state)
The text was updated successfully, but these errors were encountered: