status-go/services/wallet/on_ramp.go

146 lines
22 KiB
Go

package wallet
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"time"
)
const (
DataSourceHTTP DataSourceType = iota + 1
DataSourceStatic
)
type CryptoOnRamp struct {
Name string `json:"name"`
Description string `json:"description"`
Fees string `json:"fees"`
LogoURL string `json:"logoUrl"`
SiteURL string `json:"siteUrl"`
Hostname string `json:"hostname"`
Params map[string]string `json:"params"` // TODO implement params in JSON and parsing status-mobile
}
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/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8RERMWHBc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3YHjLTGpqtxKdoRNy1Fhh2CQnjD8NtQGS0qejEzcHUql9WEs+WwlGi6r4lyrMH6jwyMivldS16emA92AGZQZA8hFqTSDyN8ciyGwRUQw/GGeCPTJ1hzc04/XX2jDwV2UmOSvyLmPQ7NUGIUZEAajkxBmIjxHRy11AJ27uhRVHytEKCyTCpxZ4okj7A4h7oUk0rh9OirrL7MCoF2CJqGV86/Ib/CshI7x0Ql8+H43Dr0/hI/eOYHhbjmg3LC836Z4XBWkEoYdVOdT6LVwRSkql0Vk53fEEI49W0Ie7+MGDv9XJ6H1F7KND5JtvA0KSFu1I5Es+UGPKLIvZKBrFJ1Ngzh6cAC97XEM94xRJkVHbMiibEtcfBYWydKQQ7FqpMBAdE4YedRLUHNOGUpqchAtznZm7eXCydbhoWHROeYax9enbN2Gulme5fyUAMiF1ZonsXBLJBd7Iu5IJCy/OVNSJnxpK9kXm0yyix2wx0Nbdp5RjdjnQzzcIhZLBE3EfcqAs8spA9BdeD4Gksg1BOZt7v3JqeApm0LrLFp4H88Ul0zIymLysBNNE9O/m2RTeTp4HhQqp4K33KeKPm4GTvU0ntJyWgC0i+s/I2AwL4FLMmdYeHDUViaH/5f/GUG6woCqz20Z1Br1X2EUqg8g/XM6NfE//F9h8MhQWu/msY2nGzB/+V+Ig4erx8fbRgAAAABJRU5ErkJggg=="
data := fmt.Sprintf(`
[
{
"name": "Ramp",
"description": "Global crypto to fiat flow",
"fees": "0.49%% - 2.9%%",
"logoUrl": "%s",
"siteUrl": "https://buy.ramp.network/?hostApiKey=zrtf9u2uqebeyzcs37fu5857tktr3eg9w5tffove&swapAsset=DAI,ETH,USDC,USDT",
"hostname": "ramp.network"
},
{
"name": "MoonPay",
"description": "The new standard for fiat to crypto",
"fees": "1%%-4.5%%",
"logoUrl": "%s",
"siteUrl": "https://buy.moonpay.com/?apiKey=pk_live_YQC6CQPA5qqDu0unEwHJyAYQyeIqFGR",
"hostname": "moonpay.com"
},
{
"name": "Latamex",
"description": "Easily buy crypto in Argentina, Mexico, and Brazil",
"fees": "1%% - 1.7%%",
"logoUrl": "%s",
"siteUrl": "https://latamex.com/",
"hostname": "latamex.com"
}
]`, logoRamp, logoMoonPay, logoLatamex)
return []byte(data), nil
}