51 lines
7.8 KiB
Go
51 lines
7.8 KiB
Go
package onramp
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
walletCommon "github.com/status-im/status-go/services/wallet/common"
|
|
)
|
|
|
|
const moonpayID = "moonpay"
|
|
const moonpayURL = "https://buy.moonpay.com/?apiKey=pk_live_YQC6CQPA5qqDu0unEwHJyAYQyeIqFGR"
|
|
|
|
type MoonPayProvider struct{}
|
|
|
|
func NewMoonPayProvider() *MoonPayProvider {
|
|
return &MoonPayProvider{}
|
|
}
|
|
|
|
func (p *MoonPayProvider) ID() string {
|
|
return moonpayID
|
|
}
|
|
|
|
func (p *MoonPayProvider) GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error) {
|
|
const (
|
|
logoMoonPay = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAADhjcHJ0AAABQAAAAE53dHB0AAABkAAAABRjaGFkAAABpAAAACxyWFlaAAAB0AAAABRiWFlaAAAB5AAAABRnWFlaAAAB+AAAABRyVFJDAAACDAAAACBnVFJDAAACLAAAACBiVFJDAAACTAAAACBjaHJtAAACbAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABwAAAAcAHMAUgBHAEIAIABiAHUAaQBsAHQALQBpAG4AAG1sdWMAAAAAAAAAAQAAAAxlblVTAAAAMgAAABwATgBvACAAYwBvAHAAeQByAGkAZwBoAHQALAAgAHUAcwBlACAAZgByAGUAZQBsAHkAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y1zZjMyAAAAAAABDEoAAAXj///zKgAAB5sAAP2H///7ov///aMA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VRg5ESI5EaT0K3Ohsyp7A6f9rukfNVXJj86BUu3PBNZ5ULGhAIiNROg2C7hKCEXKcOwZ9ihaBCJUqXhvN1ugu8DGKUAbj7EBdBoUEquIi6AAyeybL+tc0fURV+X2MBnMcAfKHnoCrQkc0/ZJpB25GTQALJJ7+qUJcsfsg8XvAsH96AAoBB784pFOQP06g8P9lL7PYx6h7h9BwpaYJuTk7f5PYowCJKyYjNHZJ0EvTDdAFaVC9BL7FvCkLimOSEJjk6Ca6zZGhRkRTSqaoFEbnK1ZoMAPzsoAaHqG/koAxF6HXD18oXy2hkrcExN90mEyio5Pywg2qjJr/gZYNXS/t5c5SvFAgA6ITmaSOSDI4uNTIsudbs+lqnyWQZPxsQAljnPwGrwSlAWTCgubFYFA5Veiy7rUY2BrzHZkpoKOmiCqxgQCsEu2dTd1HfsjUfW4v47MQE6gKSAl1QKFqSItUaj/qhzl3XKyuekw0YiDG0InA6PTZXhmQSDl0aVFAjyQD+nTwErID8h+tFWLaTwj9am+/0XTnw1MTGx7cp5Q6ku4ACDm88pf5Nv/9k="
|
|
)
|
|
|
|
onramp := CryptoOnRamp{
|
|
ID: moonpayID,
|
|
Name: "MoonPay",
|
|
Description: "The new standard for fiat to crypto",
|
|
Fees: "1% - 4.5%",
|
|
LogoURL: logoMoonPay,
|
|
Hostname: "moonpay.com",
|
|
SupportsSinglePurchase: true,
|
|
SupportsRecurrentPurchase: false,
|
|
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet, walletCommon.ArbitrumMainnet, walletCommon.OptimismMainnet},
|
|
URLsNeedParameters: false,
|
|
SiteURL: moonpayURL,
|
|
}
|
|
|
|
return onramp, nil
|
|
}
|
|
|
|
func (p *MoonPayProvider) GetURL(ctx context.Context, parameters Parameters) (string, error) {
|
|
if !parameters.IsRecurrent {
|
|
return moonpayURL, nil
|
|
}
|
|
return "", fmt.Errorf("Recurrent transactions are not supported by MoonPay")
|
|
}
|