Documentation
¶
Index ¶
- Variables
- type Chain
- type Chains
- type Check
- type Contracts
- type Currency
- type CurrencyMetadata
- type Details
- type ERC20Currency
- type ErrorResponse
- type ExplorerPaths
- type FeaturedToken
- type FeeCurrency
- type FeeDetails
- type Fees
- type Item
- type QuoteResponse
- type RelaylinkClient
- func (client *RelaylinkClient) GetChains(ctx context.Context) ([]Chain, error)
- func (client *RelaylinkClient) GetChainsByID(ctx context.Context, chainId int64) (Chain, bool)
- func (client *RelaylinkClient) Quote(ctx context.Context, chainId int64, user, inputToken, outputToken string, ...) (*QuoteResponse, error)
- func (client *RelaylinkClient) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, prv *ecdsa.PrivateKey, ...) (string, uint64, error)
- type SlippageTolerance
- type SolInstruction
- type SolKey
- type Step
- type TotalImpact
- type TransactionData
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ETH = common.HexToAddress("0x0000000000000000000000000000000000000000")
)
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
ID int64 `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
HTTPRpcUrl string `json:"httpRpcUrl"`
WSRpcUrl string `json:"wsRpcUrl"`
ExplorerUrl string `json:"explorerUrl"`
ExplorerName string `json:"explorerName"`
ExplorerPaths ExplorerPaths `json:"explorerPaths"`
DepositEnabled bool `json:"depositEnabled"`
TokenSupport string `json:"tokenSupport"`
Disabled bool `json:"disabled"`
PartialDisableLimit int `json:"partialDisableLimit"`
BlockProductionLagging bool `json:"blockProductionLagging"`
Currency Currency `json:"currency"`
WithdrawalFee int `json:"withdrawalFee"`
DepositFee int `json:"depositFee"`
SurgeEnabled bool `json:"surgeEnabled"`
FeaturedTokens []FeaturedToken `json:"featuredTokens"`
ERC20Currencies []ERC20Currency `json:"erc20Currencies"`
IconUrl string `json:"iconUrl"`
LogoUrl string `json:"logoUrl"`
BrandColor string `json:"brandColor"`
Contracts Contracts `json:"contracts"`
VMType string `json:"vmType"`
ExplorerQueryParams map[string]string `json:"explorerQueryParams"`
BaseChainId int `json:"baseChainId"`
StatusMessage string `json:"statusMessage"`
Tags []string `json:"tags"`
}
type CurrencyMetadata ¶
type Details ¶
type Details struct {
Operation string `json:"operation"`
Sender string `json:"sender"`
Recipient string `json:"recipient"`
CurrencyIn FeeDetails `json:"currencyIn"`
CurrencyOut FeeDetails `json:"currencyOut"`
CurrencyGasTopup FeeDetails `json:"currencyGasTopup"`
TotalImpact TotalImpact `json:"totalImpact"`
SwapImpact TotalImpact `json:"swapImpact"`
Rate string `json:"rate"`
SlippageTolerance SlippageTolerance `json:"slippageTolerance"`
TimeEstimate int `json:"timeEstimate"`
UserBalance string `json:"userBalance"`
}
type ERC20Currency ¶
type ERC20Currency struct {
ID string `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Address string `json:"address"`
Decimals int `json:"decimals"`
SupportsBridging bool `json:"supportsBridging"`
SupportsPermit bool `json:"supportsPermit"`
WithdrawalFee int `json:"withdrawalFee"`
DepositFee int `json:"depositFee"`
SurgeEnabled bool `json:"surgeEnabled"`
}
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type ExplorerPaths ¶
type ExplorerPaths struct {
Transaction string `json:"transaction"`
}
type FeaturedToken ¶
type FeeCurrency ¶
type FeeDetails ¶
type Fees ¶
type Fees struct {
Gas FeeDetails `json:"gas"`
Relayer FeeDetails `json:"relayer"`
RelayerGas FeeDetails `json:"relayerGas"`
RelayerService FeeDetails `json:"relayerService"`
App FeeDetails `json:"app"`
}
type Item ¶
type Item struct {
Status string `json:"status"`
Data TransactionData `json:"data"`
Check Check `json:"check"`
}
type QuoteResponse ¶
type RelaylinkClient ¶
type RelaylinkClient struct {
// contains filtered or unexported fields
}
func NewRelaylinkClient ¶
func NewRelaylinkClient(transportProxy *http.Transport) *RelaylinkClient
func (*RelaylinkClient) GetChains ¶
func (client *RelaylinkClient) GetChains(ctx context.Context) ([]Chain, error)
func (*RelaylinkClient) GetChainsByID ¶
func (*RelaylinkClient) SendSwapTransaction ¶
func (client *RelaylinkClient) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, prv *ecdsa.PrivateKey, swapResponse *QuoteResponse) (string, uint64, error)
type SlippageTolerance ¶
type SlippageTolerance struct {
Origin struct {
Usd decimal.Decimal `json:"usd"`
Value decimal.Decimal `json:"value"`
Percent decimal.Decimal `json:"percent"`
} `json:"origin"`
Destination struct {
Usd decimal.Decimal `json:"usd"`
Value decimal.Decimal `json:"value"`
Percent decimal.Decimal `json:"percent"`
} `json:"destination"`
}
type SolInstruction ¶
type TotalImpact ¶
type TransactionData ¶
type TransactionData struct {
// evm
EvmFrom common.Address `json:"from"`
EvmTo common.Address `json:"to"`
EvmGas decimal.Decimal `json:"gas"`
EvmData string `json:"data"`
EvmValue decimal.Decimal `json:"value"`
EvmMaxFeePerGas decimal.Decimal `json:"maxFeePerGas"`
EvmMaxPriorityFeePerGas decimal.Decimal `json:"maxPriorityFeePerGas"`
EvmChainID int `json:"chainId"`
// sol
SolInstructions []SolInstruction `json:"instructions"`
SolAddressLookupTableAddresses []string `json:"addressLookupTableAddresses"`
}
Click to show internal directories.
Click to hide internal directories.