github.com/status-im/status-go@v1.1.0/services/wallet/onramp/types.go (about)

     1  package onramp
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/ethereum/go-ethereum/common"
     7  
     8  	"github.com/status-im/status-go/services/wallet/token"
     9  )
    10  
    11  type Provider interface {
    12  	ID() string
    13  	GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, error)
    14  	GetURL(ctx context.Context, parameters Parameters) (string, error)
    15  }
    16  
    17  type Parameters struct {
    18  	IsRecurrent bool            `json:"isRecurrent"`
    19  	DestAddress *common.Address `json:"destAddress,omitempty"`
    20  	ChainID     *uint64         `json:"chainID,omitempty"`
    21  	Symbol      *string         `json:"symbol,omitempty"`
    22  }
    23  
    24  type CryptoOnRamp struct {
    25  	ID                        string         `json:"id"`
    26  	Name                      string         `json:"name"`
    27  	Description               string         `json:"description"`
    28  	Fees                      string         `json:"fees"`
    29  	LogoURL                   string         `json:"logoUrl"`
    30  	Hostname                  string         `json:"hostname"`
    31  	SupportsSinglePurchase    bool           `json:"supportsSinglePurchase"`
    32  	SupportsRecurrentPurchase bool           `json:"supportsRecurrentPurchase"`
    33  	SupportedChainIDs         []uint64       `json:"supportedChainIds"`
    34  	SupportedTokens           []*token.Token `json:"supportedTokens"`    // Empty array means supported assets are not specified
    35  	URLsNeedParameters        bool           `json:"urlsNeedParameters"` // True means Parameters are required for URL generation
    36  	// Deprecated fields below, only used by mobile
    37  	Params           map[string]string `json:"params"`
    38  	SiteURL          string            `json:"siteUrl"`          // Replaced by call to GetURL
    39  	RecurrentSiteURL string            `json:"recurrentSiteUrl"` // Replaced by call to GetURL
    40  }