Documentation
¶
Index ¶
- Constants
- 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 PerComputeUnit
- type Percentiles
- 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, wallet *solana.Wallet, ...) (string, error)
- type SlippageTolerance
- type SolInstruction
- type SolKey
- type SolanaGasTracker
- type SolanaGasTrackerResponse
- type Step
- type TotalImpact
- type TransactionData
Constants ¶
View Source
const ( BscChainID = 56 SolanaChainID = 792703809 )
Variables ¶
View Source
var ( SOL = "11111111111111111111111111111111" BSC = common.HexToAddress("0x0000000000000000000000000000000000000000") 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 PerComputeUnit ¶
type PerComputeUnit struct {
Percentiles Percentiles `json:"percentiles"`
}
type Percentiles ¶
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) Quote ¶
func (client *RelaylinkClient) Quote(ctx context.Context, chainId int64, user, inputToken, outputToken string, amount *big.Int, slippageBps int) (*QuoteResponse, error)
func (*RelaylinkClient) SendSwapTransaction ¶
func (client *RelaylinkClient) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, wallet *solana.Wallet, swapResponse *QuoteResponse, priorityLevel settings.PriorityLevel, maxRetries uint) (string, 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 SolanaGasTracker ¶
type SolanaGasTracker struct {
PerComputeUnit PerComputeUnit `json:"per_compute_unit"`
}
type SolanaGasTrackerResponse ¶
type SolanaGasTrackerResponse struct {
Sol SolanaGasTracker `json:"sol"`
}
type TotalImpact ¶
type TransactionData ¶
type TransactionData struct {
// evm
EvmFrom string `json:"from"`
EvmTo string `json:"to"`
EvmData string `json:"data"`
EvmValue string `json:"value"`
EvmMaxFeePerGas string `json:"maxFeePerGas"`
EvmMaxPriorityFeePerGas string `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.