onramp

package
v0.184.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoOnRamp

type CryptoOnRamp struct {
	ID                        string         `json:"id"`
	Name                      string         `json:"name"`
	Description               string         `json:"description"`
	Fees                      string         `json:"fees"`
	LogoURL                   string         `json:"logoUrl"`
	Hostname                  string         `json:"hostname"`
	SupportsSinglePurchase    bool           `json:"supportsSinglePurchase"`
	SupportsRecurrentPurchase bool           `json:"supportsRecurrentPurchase"`
	SupportedChainIDs         []uint64       `json:"supportedChainIds"`
	SupportedTokens           []*token.Token `json:"supportedTokens"`    // Empty array means supported assets are not specified
	URLsNeedParameters        bool           `json:"urlsNeedParameters"` // True means Parameters are required for URL generation
	// Deprecated fields below, only used by mobile
	Params           map[string]string `json:"params"`
	SiteURL          string            `json:"siteUrl"`          // Replaced by call to GetURL
	RecurrentSiteURL string            `json:"recurrentSiteUrl"` // Replaced by call to GetURL
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(providers []Provider) *Manager

func (*Manager) GetProviders added in v0.182.43

func (c *Manager) GetProviders(ctx context.Context) ([]CryptoOnRamp, error)

func (*Manager) GetURL added in v0.182.43

func (c *Manager) GetURL(ctx context.Context, providerID string, parameters Parameters) (string, error)

type MercuryoProvider added in v0.182.43

type MercuryoProvider struct {
	// contains filtered or unexported fields
}

func NewMercuryoProvider added in v0.182.43

func NewMercuryoProvider(tokenManager token.ManagerInterface) *MercuryoProvider

func (*MercuryoProvider) GetCryptoOnRamp added in v0.182.43

func (p *MercuryoProvider) GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error)

func (*MercuryoProvider) GetURL added in v0.182.43

func (p *MercuryoProvider) GetURL(ctx context.Context, parameters Parameters) (string, error)

func (*MercuryoProvider) ID added in v0.182.43

func (p *MercuryoProvider) ID() string

type MoonPayProvider added in v0.182.43

type MoonPayProvider struct{}

func NewMoonPayProvider added in v0.182.43

func NewMoonPayProvider() *MoonPayProvider

func (*MoonPayProvider) GetCryptoOnRamp added in v0.182.43

func (p *MoonPayProvider) GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error)

func (*MoonPayProvider) GetURL added in v0.182.43

func (p *MoonPayProvider) GetURL(ctx context.Context, parameters Parameters) (string, error)

func (*MoonPayProvider) ID added in v0.182.43

func (p *MoonPayProvider) ID() string

type Parameters added in v0.182.43

type Parameters struct {
	IsRecurrent bool            `json:"isRecurrent"`
	DestAddress *common.Address `json:"destAddress,omitempty"`
	ChainID     *uint64         `json:"chainID,omitempty"`
	Symbol      *string         `json:"symbol,omitempty"`
}

type Provider added in v0.182.43

type Provider interface {
	ID() string
	GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error)
	GetURL(ctx context.Context, parameters Parameters) (string, error)
}

type RampProvider added in v0.182.43

type RampProvider struct{}

func NewRampProvider added in v0.182.43

func NewRampProvider() *RampProvider

func (*RampProvider) GetCryptoOnRamp added in v0.182.43

func (p *RampProvider) GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error)

func (*RampProvider) GetURL added in v0.182.43

func (p *RampProvider) GetURL(ctx context.Context, parameters Parameters) (string, error)

func (*RampProvider) ID added in v0.182.43

func (p *RampProvider) ID() string

Directories

Path Synopsis
Package mock_onramp is a generated GoMock package.
Package mock_onramp is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL