CoinTicker should be Realm object. #493
Comments
This issue now has a funding of 0.05 ETH (27.92 USD @ $558.46/ETH) attached to it.
|
Please provide little bit description and directions. |
@maektwain updated the issue, please take a look. |
I understand you want to integrate If so, should the ticker be called I think I will attempt this task and come with a PR during weekend. |
@DarthMike thanks for doing this! I think Currently, we store tickers object into Do you have telegram? can you message me at vikmeup? |
Yes, so currently the way it's done: struct TokenObject {
var price: CoinTicker
} unless you know better alternatives? always up for it |
Something has come up, won't be able to work on this for a while. Just letting you know so if somebody else wants to, they can pick it up. |
@vikmeup I’m looking at this issue if nobody else is. |
@johnnynanjiang nice! thank you |
- fix a discrepency in TokensDataStore - add an unit test for TokensDataStore
@johnnynanjiang Feel free to pick this up on Gitcoin here by clicking 'Start Work'! |
- add CoinTickerObject Realm object - switch from UserDefaults to Realm for tickers
- refactor and update unit test
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Work has been started. has committed to working on this project to be completed 10 months from now. , please see the below comments / questions regarding approach for this ticket from the bounty hunter(s): |
Thanks @vs77bb just done it |
Hi @vikmeup and @OlegGordiichuk, just wanted to clarify some points and get your insights. I've made some changes so far so that CoinTicker now gets saved and retrieved from Realm (via CoinTickerObject, with a tickerskey for distinguishing currency and network. CoinTickerObject will eventually replace CoinTicker) Now I'm looking at combining TokenObject and CoinTicker
Some options as follows:
Which way do you prefer or if I miss or misunderstand anything here? Thanks and regards |
@johnnynanjiang I would go with option #3, I think balance and pricing should be two separate entities in general. I'm also open to suggestions if you have ideas on how to simplify it. @OlegGordiichuk did you have anything in mind on this? |
- replace CoinTicker with CoinTickerObject
@vikmeup yeah it makes sense, will raise a PR soon, thanks. |
- fix test
@johnnynanjiang another reason why we need this change to sort tokens by total value. |
@vikmeup ok, I guess the idea is that there would be a new field called 'balance' in TokenObject, whenever TokenObject list or CoinTickerObject list get updated in Realm, 'balance' will get updated to 'token amount (from TokenObject) * token price (from CoinTickerObject)' in TokenObject. How does it sound? |
I think that make sense to me to have balance field on TokenObject. I think this logic should be simplified, we could have pricing storage as it is and just update balance when pricing changes. That’s not what original issue states tho, but that’s ok! We just need good solution. Can you telegram me: vikmeup? |
- update balance whenever token, ticker or balance get updated
- update wording to camel case
@vikmeup sure, I have implemented the logic in TokensDataStore as it is where we store/update TokenObject, CoinTickerObject, and Balance. Testing at the moment, as well as implementing Realm migration as new field 'balance' has been added. |
@gitcoinbot yes, submitted a PR and there is some work to be done. |
@johnnynanjiang. 👋 thanks for the atMention, but you need to install @gitcoinbot on this repo for me to be able to respond. More details in the documentation. ✌️ |
* Bug/493 (#493) - fix a discrepency in TokensDataStore - add an unit test for TokensDataStore * Bug/493 (#493) - add CoinTickerObject Realm object - switch from UserDefaults to Realm for tickers * Bug/493 (#493) - refactor and update unit test * Bug/493 (#493) - replace CoinTicker with CoinTickerObject * Bug/493 (#493) - fix test * Bug/493 (#493) - update balance whenever token, ticker or balance get updated * Bug/493 (#493) - update wording to camel case * Bug/493 (#493) - implement TokenObject data migration in Realm * Bug/493 (#493) - exclude field to avoid decoding error * Bug/493 (#493) - refactoring * Bug/493 (#493) - change TokenObject.balance type to Double * Bug/493 (#493) - fix Realm migration * Bug/493 (#493) - apply use of TokenObject.balance * Bug/493 (#493) - apply use of TokenObject.balance * Revert "Bug/493 (#493)" This reverts commit 1be6c79. * Revert "Bug/493 (#493)" This reverts commit 945c37d. * Bug/493 (#493) - fix unit tests * [#493] - update cocoapods to 1.5.0 * [#493] - bump the Realm schema version to 50 * [#493] - fix Realm migration for shared data store, and refactoring * [#493] - remove redundant code * [#493] - remove redundant Realm migration code * [#493] - change from realm.add back to realm.create * [#493] - remove duplicate .map{} * [#493] - use try? instead of try catch * [#493] - rename CoinTickerObject back to CoinTicker * [#493] - fix merge conflict * [#493] - fix unit tests
* Bug/493 (#493) - fix a discrepency in TokensDataStore - add an unit test for TokensDataStore * Bug/493 (#493) - add CoinTickerObject Realm object - switch from UserDefaults to Realm for tickers * Bug/493 (#493) - refactor and update unit test * Bug/493 (#493) - replace CoinTicker with CoinTickerObject * Bug/493 (#493) - fix test * Bug/493 (#493) - update balance whenever token, ticker or balance get updated * Bug/493 (#493) - update wording to camel case * Bug/493 (#493) - implement TokenObject data migration in Realm * Bug/493 (#493) - exclude field to avoid decoding error * Bug/493 (#493) - refactoring * Bug/493 (#493) - change TokenObject.balance type to Double * Bug/493 (#493) - fix Realm migration * Bug/493 (#493) - apply use of TokenObject.balance * Bug/493 (#493) - apply use of TokenObject.balance * Revert "Bug/493 (#493)" This reverts commit 1be6c79. * Revert "Bug/493 (#493)" This reverts commit 945c37d. * Bug/493 (#493) - fix unit tests * [#493] - update cocoapods to 1.5.0 * [#493] - bump the Realm schema version to 50 * [#493] - fix Realm migration for shared data store, and refactoring * [#493] - remove redundant code * [#493] - remove redundant Realm migration code * [#493] - change from realm.add back to realm.create * [#493] - remove duplicate .map{} * [#493] - use try? instead of try catch * [#493] - rename CoinTickerObject back to CoinTicker * [#493] - fix merge conflict * [#493] - fix unit tests * [#493] - fix realm.write() * [#493] - replace try! with try?
Work for 0.05 ETH (30.31 USD @ $606.25/ETH) has been submitted by: Submitters, please leave a comment to let the funder (and the other parties involved) that you've submitted you work. If you don't leave a comment, the funder may expire your submission at their discretion.
|
@vikmeup Mind going to the Gitcoin Issue and accepting work, assuming this one is ready for pay out? Hope you both are doing well! |
@vikmeup Bump to see if @johnnynanjiang should be paid for this PR which looks to be merged. Hope you are doing well! |
@vs77bb I’m pretty sure I already pressed to pay, not sure why it didn’t happen yet. |
It seems that the work has not been accepted yet.
https://gitcoin.co/funding/details?url=https://github.com/TrustWallet/trust-wallet-ios/issues/493
…On Tue, May 15, 2018 at 8:54 AM, Viktor Radchenko ***@***.***> wrote:
@vs77bb <https://github.com/vs77bb> I’m pretty sure I already pressed to
pay, not sure why it didn’t happen yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#493 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALXc5zYx71gdyLYUzC8KJA0rQ-6FJU2vks5tygsngaJpZM4SuenL>
.
|
@vikmeup do you have a tx id for the acceptance transaction? were not seeing it here at gitcoin |
@owocki when I press "Accept", it gives me this in the console:
I'm doing from Trust, do you what this could be? |
@vikmeup thanks for the heads up! i just put in a fix for this ( gitcoinco/web@e9ca613 ) and deployed it! |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done The funding of 0.05 ETH (34.94 USD @ $698.88/ETH) attached to this issue has been approved & issued to @johnnynanjiang.
|
Also we should have relationship between CoinTicker and TokenObject.
TokenObject
is anERC20
object that contains information about specific token and also current balance of the user.CoinTicker
coinmarket ticker that contains price information for the specified token. This need to be combined intoTokenObject
so you can easily get pricing and later sortTokenObject
by total value in the tokens list.Keep in mind, there is different currencies available.
The text was updated successfully, but these errors were encountered: