-
Notifications
You must be signed in to change notification settings - Fork 242
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
feat(wallet)_: added supported chains and recurrent purchase url to o… #5231
Conversation
173d317
to
e2b3abd
Compare
Jenkins BuildsClick to see older builds (5)
|
SiteURL string `json:"siteUrl"` | ||
RecurrentSiteURL string `json:"recurrentSiteUrl"` | ||
Hostname string `json:"hostname"` | ||
Params map[string]string `json:"params"` // TODO implement params in JSON and parsing status-mobile |
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 know the comment was not added by you, but if it's still relevant, can we move this to a GitHub issue? It will be easier to track.
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.
Same as this I think... #5231 (comment)
This needs some cleanup/rework probably, but I want to change as little as possible until there's a real need.
ramps := []CryptoOnRamp{ | ||
{ | ||
Name: "Ramp", | ||
Description: "Global crypto to fiat flow", | ||
Fees: "0.49% - 2.9%", | ||
LogoURL: logoRamp, | ||
SiteURL: "https://ramp.network/buy?hostApiKey=zrtf9u2uqebeyzcs37fu5857tktr3eg9w5tffove&swapAsset=DAI,ETH,USDC,USDT", | ||
Hostname: "ramp.network", | ||
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet, walletCommon.ArbitrumMainnet, walletCommon.OptimismMainnet}, | ||
}, | ||
{ | ||
Name: "MoonPay", | ||
Description: "The new standard for fiat to crypto", | ||
Fees: "1% - 4.5%", | ||
LogoURL: logoMoonPay, | ||
SiteURL: "https://buy.moonpay.com/?apiKey=pk_live_YQC6CQPA5qqDu0unEwHJyAYQyeIqFGR", | ||
Hostname: "moonpay.com", | ||
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet, walletCommon.ArbitrumMainnet, walletCommon.OptimismMainnet}, | ||
}, | ||
{ | ||
Name: "Latamex", | ||
Description: "Easily buy crypto in Argentina, Mexico, and Brazil", | ||
Fees: "1% - 1.7%", | ||
LogoURL: logoLatamex, | ||
SiteURL: "https://latamex.com/", | ||
Hostname: "latamex.com", | ||
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet}, | ||
}, |
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 don't see any providers with RecurrentSiteURL
. Don't we still have any recurrent options?
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.
Oh, I see. We have a separate issue for that.
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.
Yeap! Mercuryo is coming as soon as we sign the deal! That will be our first recurrent-enabled provider, but I wanted to leave the API ready beforehand in case someone wants to start doing the client work.
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.
LGTM! Tested on Mobile 👍
I remember seeing the supported chains in the design, but I can't find them anymore. Figma Design. Do you have a link to that? |
} | ||
|
||
func (c *Manager) getFromHTTPDataSource() ([]CryptoOnRamp, error) { | ||
if c.options.DataSource == "" { |
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.
dont we need this same check in getFromStaticDataSource?
@@ -61,8 +62,8 @@ func NewService( | |||
feed *event.Feed, | |||
mediaServer *server.MediaServer, | |||
) *Service { | |||
cryptoOnRampManager := NewCryptoOnRampManager(&CryptoOnRampOptions{ | |||
dataSourceType: DataSourceStatic, | |||
cryptoOnRampManager := onramp.NewManager(&onramp.Options{ |
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.
it seems like we are setting default to Static? is this a todo to also support fetch from http?
I am not sure I understand when we would do a static fetch and when we would perform a http request in case of on ramp providers?
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.
So... This code was done like 3 years ago and apparently the original spec was to be able to fetch the list of providers from the web (so we don't need to release a new Status version to change it). However, there were some issues with that approach, a static list was introduced and the http source was left as eternal tech debt :-)
This whole thing could use some cleanup/rework, but there's no real need for that at the moment. I just moved some code around for better organization, but otherwise tried changing as little as possible.
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.
Also, the diff is messed up, there's almost no new code other than:
- Moving the list of providers to a separate file
- Specifying the static list of providers as structs instead of JSON strings
- Adding chains and recurrentURL fields to struct
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.
LGTM :)
hmm it was there, but it looks like it got removed to match the desktop designs... I guess I could remove it, though it doesn't hurt to have the extra info. |
e2b3abd
to
dacae39
Compare
…nramp providers
Closes status-im/status-desktop#14817
Moved onramp code to separate package for better organization.
Moved static onramp provider definitions to separate file.
Added supported chains (used in the mobile designs) and recurrent URL (to be used in status-im/status-desktop#14818) to onramp providers.
Tested on desktop, everything looks the same
![image](https://private-user-images.githubusercontent.com/11161531/333714347-3a6f2b99-4731-413c-811b-5da7d3e42c8f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzNjE1MzcsIm5iZiI6MTcyMjM2MTIzNywicGF0aCI6Ii8xMTE2MTUzMS8zMzM3MTQzNDctM2E2ZjJiOTktNDczMS00MTNjLTgxMWItNWRhN2QzZTQyYzhmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMwVDE3NDAzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmMTUwZDdlOGM2YjEzMDc0MDJhNGYyMDYxZTJhNDAwNGYwYmZmYzY4YTRkOThlZjNjZDUxZjEwMDY1MjdmYzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.EQOSZrN3cC0bzIy4q0yQqnWInyE-WRWfw7gzJx7Yo6c)