status-go/services/wallet/on_ramp.go

171 lines
55 KiB
Go
Raw Normal View History

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 {
Name string `json:"name"`
Description string `json:"description"`
Fees string `json:"fees"`
Region string `json:"region"`
LogoURL string `json:"logoUrl"`
SiteURL string `json:"siteUrl"`
Hostname string `json:"hostname"`
}
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) {
logoWyre := "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAH4gAIAA4AFwAiAB5hY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAADhjcHJ0AAABQAAAAE53dHB0AAABkAAAABRjaGFkAAABpAAAACxyWFlaAAAB0AAAABRiWFlaAAAB5AAAABRnWFlaAAAB+AAAABRyVFJDAAACDAAAACBnVFJDAAACLAAAACBiVFJDAAACTAAAACBjaHJtAAACbAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABwAAAAcAHMAUgBHAEIAIABiAHUAaQBsAHQALQBpAG4AAG1sdWMAAAAAAAAAAQAAAAxlblVTAAAAMgAAABwATgBvACAAYwBvAHAAeQByAGkAZwBoAHQALAAgAHUAcwBlACAAZgByAGUAZQBsAHkAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y1zZjMyAAAAAAABDEoAAAXj///zKgAAB5sAAP2H///7ov///aMAAAPYAADAlFhZWiAAAAAAAABvlAAAOO4AAAOQWFlaIAAAAAAAACSdAAAPgwAAtr5YWVogAAAAAAAAYqUAALeQAAAY3nBhcmEAAAAAAAMAAAACZmYAAPKnAAANWQAAE9AAAApbcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltwYXJhAAAAAAADAAAAAmZmAADypwAADVkAABPQAAAKW2Nocm0AAAAAAAMAAAAAo9cAAFR7AABMzQAAmZoAACZmAAAPXP/bAE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UWXjjobPsh5BQYWgoUUn08Wm7htMbSrNp41BPvCEhCQkWqUyXXSn0F6fMc5rXqIW4lAyoxPuNuPFTfi03cNiM6RyW/thllHGMCx6Qo5ObgkdIyT41PWA5rGYzGYa89j0g6G4GY4SOvj5MZMZMSzvA6lV51rlPKTeks8DPEfWCkHqIqjbbb2EdlT5jnND3FpySTMj8wulTCToMxL0hZOXekJSEjAgnGsTTvOdK+ylZlUuviES8yh9OU/LUqgMcpv+9ohakHKTiG6u8nzawK37ohVaV9KYfn3ntCdP0N/8QAOhAAAQIDAwkFBgUFAAAAAAAAAQIDABEgIVBxEiIxMkFRgZGxBDAzQFITI0JhYqEQFJCi0TRygpLB/9oACAEBAAY/Av0M8gDKXFiURoRyi1CIlLJVuu5zGhHHpdzmNCOPS7nMaEcel3OY0I49LucxoRx6Xc5jQjj0u5zGhHHpdzmNCOPS7nMaEcel3OY0I49O6946hOJjxx
data := fmt.Sprintf(`
[
{
"name": "Wyre",
"description": "A secure bridge for fiat and crypto",
"fees": "from 2.9%%",
"region": "US & Europe",
"logoUrl": "%s",
"siteUrl": "https://pay.sendwyre.com/purchase",
"hostname": "sendwyre.com"
},
{
"name": "MoonPay",
"description": "The new standard for fiat to crypto",
"fees": "1%%-4.5%%",
"region": "US & Europe",
"logoUrl": "%s",
"siteUrl": "https://buy.moonpay.com",
"hostname": "moonpay.com"
},
{
"name": "Transak",
"description": "Global fiat <-> crypto payment gateway",
"fees": "1%%-4.5%%",
"region": "Global",
"logoUrl": "%s",
"siteUrl": "https://global.transak.com",
"hostname": "transak.com"
},
{
"name": "Ramp",
"description": "Global crypto to fiat flow",
"fees": "1.5%%",
"region": "Global",
"logoUrl": "%s",
"siteUrl": "https://ramp.network/buy/",
"hostname": "ramp.network"
},
{
"name": "LocalCryptos",
"description": "Non-custodial crypto marketplace",
"fees": "1.5%%",
"region": "Global",
"logoUrl": "%s",
"siteUrl": "https://localcryptos.com",
"hostname": "localcryptos.com"
}
]`, logoWyre, logoMoonPay, logoTransak, logoRamp, logoLocalCryptos)
return []byte(data), nil
}