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+AAAABRyVFJDAAACDAAAACBnVFJDAAACLAAAACBiVFJDAAACTAAAACBjaHJtAAACbAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABwAAAAcAHMAUgBHAEIAIABiAHUAaQBsAHQALQBpAG4AAG1sdWMAAAAAAAAAAQAAAAxlblVTAAAAMgAAABwATgBvACAAYwBvAHAAeQByAGkAZwBoAHQALAAgAHUAcwBlACAAZgByAGUAZQBsAHkAAAAAWFlaIAAAAAAAAPbWAAE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AAAAAEAESExQVGBQFBhcZGhsSAwwdGQ4fAQ8f/aAAgBAQABPyH8JFytkoRJxtir1D2iWgc/vkIzPP1zfSe7mcu5NfoMWFWBXQshh/oBEGYmEXPxSq4Z/B3bLZrgwkqurPt6RRmMki8ub3tSTruti6qMM2mk19Th7hSHw3ZreiMTpL1SfzMKWQ8PXcH65KqltZRQ8rfacYk+8HF5MMTF/C0J1PMeRFi
|
||
|
)
|
||
|
|
||
|
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")
|
||
|
}
|