2021-01-26 13:00:32 +00:00
|
|
|
package wallet
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
cryptoOnRampsData = "https://raw.githubusercontent.com/status-im/crypto-on-ramps/master/ramps.json"
|
|
|
|
|
|
|
|
DataSourceHTTP DataSourceType = iota + 1
|
|
|
|
DataSourceStatic
|
|
|
|
)
|
|
|
|
|
|
|
|
type CryptoOnRamp struct {
|
2021-05-17 14:51:33 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Fees string `json:"fees"`
|
|
|
|
LogoURL string `json:"logoUrl"`
|
|
|
|
SiteURL string `json:"siteUrl"`
|
|
|
|
Hostname string `json:"hostname"`
|
2022-07-17 13:37:14 +00:00
|
|
|
Params map[string]string `json:"params"` // TODO implement params in JSON and parsing status-mobile
|
2021-01-26 13:00:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type DataSourceType int
|
|
|
|
|
|
|
|
type CryptoOnRampOptions struct {
|
|
|
|
dataSource string
|
|
|
|
dataSourceType DataSourceType
|
|
|
|
}
|
|
|
|
|
|
|
|
type CryptoOnRampManager struct {
|
|
|
|
options *CryptoOnRampOptions
|
|
|
|
ramps []CryptoOnRamp
|
|
|
|
LastCalled time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCryptoOnRampManager(options *CryptoOnRampOptions) *CryptoOnRampManager {
|
|
|
|
return &CryptoOnRampManager{
|
|
|
|
options: options,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *CryptoOnRampManager) Get() ([]CryptoOnRamp, error) {
|
|
|
|
var data []byte
|
|
|
|
var err error
|
|
|
|
|
|
|
|
switch c.options.dataSourceType {
|
|
|
|
case DataSourceHTTP:
|
|
|
|
if !c.hasCacheExpired(time.Now()) {
|
|
|
|
return c.ramps, nil
|
|
|
|
}
|
|
|
|
data, err = c.getFromHTTPDataSource()
|
|
|
|
c.LastCalled = time.Now()
|
|
|
|
case DataSourceStatic:
|
|
|
|
data, err = c.getFromStaticDataSource()
|
|
|
|
default:
|
|
|
|
return nil, fmt.Errorf("unsupported CryptoOnRampManager.dataSourceType '%d'", c.options.dataSourceType)
|
|
|
|
}
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = json.Unmarshal(data, &c.ramps)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return c.ramps, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *CryptoOnRampManager) hasCacheExpired(t time.Time) bool {
|
|
|
|
// If LastCalled + 1 hour is before the given time, then 1 hour hasn't passed yet
|
|
|
|
return c.LastCalled.Add(time.Hour).Before(t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *CryptoOnRampManager) getFromHTTPDataSource() ([]byte, error) {
|
|
|
|
if c.options.dataSource == "" {
|
|
|
|
return nil, errors.New("data source is not set for CryptoOnRampManager")
|
|
|
|
}
|
|
|
|
|
|
|
|
sgc := http.Client{
|
|
|
|
Timeout: time.Second * 5,
|
|
|
|
}
|
|
|
|
|
|
|
|
req, err := http.NewRequest(http.MethodGet, c.options.dataSource, nil)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
req.Header.Set("User-Agent", "status-go")
|
|
|
|
|
|
|
|
res, err := sgc.Do(req)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
if res.Body != nil {
|
|
|
|
defer res.Body.Close()
|
|
|
|
}
|
|
|
|
|
|
|
|
body, err := ioutil.ReadAll(res.Body)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return body, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *CryptoOnRampManager) getFromStaticDataSource() ([]byte, error) {
|
|
|
|
logoMoonPay := "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAADhjcHJ0AAABQAAAAE53dHB0AAABkAAAABRjaGFkAAABpAAAACxyWFlaAAAB0AAAABRiWFlaAAAB5AAAABRnWFlaAAAB+AAAABRyVFJDAAACDAAAACBnVFJDAAACLAAAACBiVFJDAAACTAAAACBjaHJtAAACbAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABwAAAAcAHMAUgBHAEIAIABiAHUAaQBsAHQALQBpAG4AAG1sdWMAAAAAAAAAAQAAAAxlblVTAAAAMgAAABwATgBvACAAYwBvAHAAeQByAGkAZwBoAHQALAAgAHUAcwBlACAAZgByAGUAZQBsAHkAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y1zZjMyAAAAAAABDEoAAAXj///zKgAAB5sAAP2H///7ov///aMAAAPYAADAlFhZWiAAAAAAAABvlAAAOO4AAAOQWFlaIAAAAAAAACSdAAAPgwAAtr5YWVogAAAAAAAAYqUAALeQAAAY3nBhcmEAAAAAAAMAAAACZmYAAPKnAAANWQAAE9AAAApbcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltwYXJhAAAAAAADAAAAAmZmAADypwAADVkAABPQAAAKW2Nocm0AAAAAAAMAAAAAo9cAAFR7AABMzQAAmZoAACZmAAAPXP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8RERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkI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",
|
|
|
|
"description": "Global crypto to fiat flow",
|
2021-03-25 13:00:55 +00:00
|
|
|
"fees": "0.49%% - 2.9%%",
|
2021-01-26 13:00:32 +00:00
|
|
|
"logoUrl": "%s",
|
2021-10-01 13:25:54 +00:00
|
|
|
"siteUrl": "https://buy.ramp.network/?hostApiKey=zrtf9u2uqebeyzcs37fu5857tktr3eg9w5tffove&swapAsset=DAI,ETH,USDC,USDT",
|
2021-01-26 13:00:32 +00:00
|
|
|
"hostname": "ramp.network"
|
|
|
|
},
|
|
|
|
{
|
2021-05-17 14:51:33 +00:00
|
|
|
"name": "MoonPay",
|
|
|
|
"description": "The new standard for fiat to crypto",
|
|
|
|
"fees": "1%%-4.5%%",
|
2021-01-26 13:00:32 +00:00
|
|
|
"logoUrl": "%s",
|
2022-03-23 08:38:27 +00:00
|
|
|
"siteUrl": "https://buy.moonpay.com/?apiKey=pk_live_YQC6CQPA5qqDu0unEwHJyAYQyeIqFGR",
|
2021-05-17 14:51:33 +00:00
|
|
|
"hostname": "moonpay.com"
|
2021-03-25 13:00:55 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Latamex",
|
|
|
|
"description": "Easily buy crypto in Argentina, Mexico, and Brazil",
|
|
|
|
"fees": "1%% - 1.7%%",
|
|
|
|
"logoUrl": "%s",
|
|
|
|
"siteUrl": "https://latamex.com/",
|
|
|
|
"hostname": "latamex.com"
|
2021-01-26 13:00:32 +00:00
|
|
|
}
|
2021-05-17 14:51:33 +00:00
|
|
|
]`, logoRamp, logoMoonPay, logoLatamex)
|
2021-01-26 13:00:32 +00:00
|
|
|
|
|
|
|
return []byte(data), nil
|
|
|
|
}
|