-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live balances, transactions and prices #9
Conversation
chescalante
commented
Dec 14, 2021
•
edited by ilanolkies
edited by ilanolkies
- connect by address
- handle disconnect
- polling strategy for tokens
- push transactions
- (push tokens)
- polling strategy for prices
- cache for prices
…he coinmarketcap api
@@ -3,6 +3,9 @@ import express, { Request, Response } from 'express' | |||
import { Api } from './api' | |||
import registeredDapps from './registered_dapps' | |||
import { isValidAddress } from './utils' | |||
import { Server } from 'socket.io' | |||
import http from 'http' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import http from 'http' | |
import https from 'https' |
Lets make this safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need a ssl certificate for that. (https://nodejs.org/en/knowledge/HTTP/servers/how-to-create-a-HTTPS-server/)
Let's do it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: #12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, definitely.
For dev you can use a self signed (self generated) for prod, you should cordinate that with devops
…the token is supported or not, since we are doing that inside the coinmarketcap function
…the token is supported or not, since we are doing that inside the coinmarketcap function
… if there are no addresses
…doesnt have any token yet, the backend wont crash because of the coinmarket cap api no receiving tokens ids
Feature/live prices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Most of the corrections are about modeling. Should we prepare a better definition before addressing the changes?
id: params.addresses.map(address => addressToCoinmarketcapId[address]).join(','), | ||
const fromQueryParamsToRequestParams = (params: PricesQueryParams, chaindId: number): ICoinMarketCapQuoteParams => ({ | ||
id: params.addresses | ||
.filter((address) => isTokenSupported(address, chaindId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this again? We should do decide where to do it and do it only once
} | ||
} | ||
|
||
const executeFactory = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we wan to declare the functions before we use them. Should we reorder this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job team! Code looks good. We can take this as a starting point for the refactor. There are some things to fix, I am not receiving transactions and prices events.
* Custom error class and errorhandler functio * Removing errorhandler from here and using it in setupAPI * Uncommenting the asserts that checked the text of the error message response * Implementing next function in the error handlers of the promises * Update src/middleware/index.ts Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com> * Update src/middleware/index.ts Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com> * Update src/api/index.ts Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com> * applying suggestions Co-authored-by: Agustin Villalobos <agustin.villalobos@iovlabs.org> Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com>
Fix how transactions are selected to be pushed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job team!!!