Documentation ¶
Index ¶
- Constants
- type FeeHistory
- type FeeManager
- func (f *FeeManager) GetL1Fee(ctx context.Context, chainID uint64, input []byte) (uint64, error)
- func (f *FeeManager) SuggestedFees(ctx context.Context, chainID uint64) (*SuggestedFees, error)
- func (f *FeeManager) SuggestedFeesGwei(ctx context.Context, chainID uint64) (*SuggestedFeesGwei, error)
- func (f *FeeManager) TransactionEstimatedTime(ctx context.Context, chainID uint64, maxFeePerGas *big.Int) TransactionEstimation
- type GasFeeMode
- type Graph
- type GraphV2
- type MaxFeesLevels
- type Node
- type NodeV2
- type Path
- type PathV2
- type RouteInputParams
- type Router
- func (r *Router) GetFeesManager() *FeeManager
- func (r *Router) GetPathProcessors() map[string]pathprocessor.PathProcessor
- func (r *Router) SuggestedRoutes(ctx context.Context, sendType SendType, addrFrom common.Address, ...) (*SuggestedRoutes, error)
- func (r *Router) SuggestedRoutesV2(ctx context.Context, input *RouteInputParams) (*SuggestedRoutesV2, error)
- type SendType
- func (s SendType) EstimateGas(ensService *ens.Service, stickersService *stickers.Service, ...) uint64
- func (s SendType) FetchPrices(marketManager *market.Manager, tokenID string) (map[string]float64, error)
- func (s SendType) FindToken(tokenManager *token.Manager, collectibles *collectibles.Service, ...) *token.Token
- func (s SendType) IsCollectiblesTransfer() bool
- func (s SendType) IsEnsTransfer() bool
- func (s SendType) IsStickersTransfer() bool
- type SuggestedFees
- type SuggestedFeesGwei
- type SuggestedRoutes
- type SuggestedRoutesV2
- type TransactionEstimation
Constants ¶
View Source
const EstimatePubKey = "" /* 132-byte string literal not displayed */
View Source
const EstimateUsername = "RandomUsername"
TODO: remove the following two consts once we fully move to routerV2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeeHistory ¶
type FeeHistory struct {
BaseFeePerGas []string `json:"baseFeePerGas"`
}
type FeeManager ¶
func (*FeeManager) GetL1Fee ¶
Returns L1 fee for placing a transaction to L1 chain, appicable only for txs made from L2.
func (*FeeManager) SuggestedFees ¶
func (f *FeeManager) SuggestedFees(ctx context.Context, chainID uint64) (*SuggestedFees, error)
func (*FeeManager) SuggestedFeesGwei ¶ added in v0.180.31
func (f *FeeManager) SuggestedFeesGwei(ctx context.Context, chainID uint64) (*SuggestedFeesGwei, error)
func (*FeeManager) TransactionEstimatedTime ¶
func (f *FeeManager) TransactionEstimatedTime(ctx context.Context, chainID uint64, maxFeePerGas *big.Int) TransactionEstimation
type MaxFeesLevels ¶ added in v0.180.31
type Path ¶
type Path struct { BridgeName string From *params.Network To *params.Network MaxAmountIn *hexutil.Big AmountIn *hexutil.Big AmountInLocked bool AmountOut *hexutil.Big GasAmount uint64 GasFees *SuggestedFeesGwei BonderFees *hexutil.Big TokenFees *big.Float Cost *big.Float EstimatedTime TransactionEstimation ApprovalRequired bool ApprovalGasFees *big.Float ApprovalAmountRequired *hexutil.Big ApprovalContractAddress *common.Address }
type PathV2 ¶
type PathV2 struct { ProcessorName string FromChain *params.Network // Source chain ToChain *params.Network // Destination chain FromToken *walletToken.Token // Token on the source chain AmountIn *hexutil.Big // Amount that will be sent from the source chain AmountInLocked bool // Is the amount locked AmountOut *hexutil.Big // Amount that will be received on the destination chain SuggestedLevelsForMaxFeesPerGas *MaxFeesLevels // Suggested max fees for the transaction TxBaseFee *hexutil.Big // Base fee for the transaction TxPriorityFee *hexutil.Big // Priority fee for the transaction TxGasAmount uint64 // Gas used for the transaction TxBonderFees *hexutil.Big // Bonder fees for the transaction - used for Hop bridge TxTokenFees *hexutil.Big // Token fees for the transaction - used for bridges (represent the difference between the amount in and the amount out) TxL1Fee *hexutil.Big // L1 fee for the transaction - used for for transactions placed on L2 chains ApprovalRequired bool // Is approval required for the transaction ApprovalAmountRequired *hexutil.Big // Amount required for the approval transaction ApprovalContractAddress *common.Address // Address of the contract that needs to be approved ApprovalBaseFee *hexutil.Big // Base fee for the approval transaction ApprovalPriorityFee *hexutil.Big // Priority fee for the approval transaction ApprovalGasAmount uint64 // Gas used for the approval transaction ApprovalL1Fee *hexutil.Big // L1 fee for the approval transaction - used for for transactions placed on L2 chains EstimatedTime TransactionEstimation // contains filtered or unexported fields }
type RouteInputParams ¶
type RouteInputParams struct { SendType SendType `json:"sendType" validate:"required"` AddrFrom common.Address `json:"addrFrom" validate:"required"` AddrTo common.Address `json:"addrTo" validate:"required"` AmountIn *hexutil.Big `json:"amountIn" validate:"required"` AmountOut *hexutil.Big `json:"amountOut"` TokenID string `json:"tokenID" validate:"required"` ToTokenID string `json:"toTokenID"` DisabledFromChainIDs []uint64 `json:"disabledFromChainIDs"` DisabledToChaindIDs []uint64 `json:"disabledToChaindIDs"` PreferedChainIDs []uint64 `json:"preferedChainIDs"` GasFeeMode GasFeeMode `json:"gasFeeMode" validate:"required"` FromLockedAmount map[uint64]*hexutil.Big `json:"fromLockedAmount"` TestnetMode bool `json:"testnetMode"` // For send types like EnsRegister, EnsRelease, EnsSetPubKey, StickersBuy Username string `json:"username"` PublicKey string `json:"publicKey"` PackID *hexutil.Big `json:"packID"` }
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(rpcClient *rpc.Client, transactor *transactions.Transactor, tokenManager *token.Manager, marketManager *market.Manager, collectibles *collectibles.Service, collectiblesManager *collectibles.Manager, ensService *ens.Service, stickersService *stickers.Service, featureFlags *protocolCommon.FeatureFlags) *Router
func (*Router) GetFeesManager ¶
func (r *Router) GetFeesManager() *FeeManager
func (*Router) GetPathProcessors ¶ added in v0.179.29
func (r *Router) GetPathProcessors() map[string]pathprocessor.PathProcessor
func (*Router) SuggestedRoutes ¶
func (r *Router) SuggestedRoutes( ctx context.Context, sendType SendType, addrFrom common.Address, addrTo common.Address, amountIn *big.Int, tokenID string, toTokenID string, disabledFromChainIDs, disabledToChaindIDs, preferedChainIDs []uint64, gasFeeMode GasFeeMode, fromLockedAmount map[uint64]*hexutil.Big, testnetMode bool, ) (*SuggestedRoutes, error)
func (*Router) SuggestedRoutesV2 ¶
func (r *Router) SuggestedRoutesV2(ctx context.Context, input *RouteInputParams) (*SuggestedRoutesV2, error)
type SendType ¶
type SendType int
func (SendType) EstimateGas ¶
func (s SendType) EstimateGas(ensService *ens.Service, stickersService *stickers.Service, network *params.Network, from common.Address, tokenID string) uint64
TODO: remove this function once we fully move to routerV2
func (SendType) FetchPrices ¶
func (SendType) IsCollectiblesTransfer ¶
func (SendType) IsEnsTransfer ¶ added in v0.179.28
func (SendType) IsStickersTransfer ¶ added in v0.180.31
type SuggestedFees ¶
type SuggestedFees struct { GasPrice *big.Int `json:"gasPrice"` BaseFee *big.Int `json:"baseFee"` MaxFeesLevels *MaxFeesLevels `json:"maxFeesLevels"` MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"` L1GasFee *big.Float `json:"l1GasFee,omitempty"` EIP1559Enabled bool `json:"eip1559Enabled"` }
type SuggestedFeesGwei ¶ added in v0.180.31
type SuggestedFeesGwei struct { GasPrice *big.Float `json:"gasPrice"` BaseFee *big.Float `json:"baseFee"` MaxPriorityFeePerGas *big.Float `json:"maxPriorityFeePerGas"` MaxFeePerGasLow *big.Float `json:"maxFeePerGasLow"` MaxFeePerGasMedium *big.Float `json:"maxFeePerGasMedium"` MaxFeePerGasHigh *big.Float `json:"maxFeePerGasHigh"` L1GasFee *big.Float `json:"l1GasFee,omitempty"` EIP1559Enabled bool `json:"eip1559Enabled"` }
////////////////////////////////////////////////////////////////////////////// TODO: remove `SuggestedFeesGwei` struct once new router is in place //////////////////////////////////////////////////////////////////////////////
type SuggestedRoutes ¶
type SuggestedRoutesV2 ¶
type TransactionEstimation ¶
type TransactionEstimation int
const ( Unknown TransactionEstimation = iota LessThanOneMinute LessThanThreeMinutes LessThanFiveMinutes MoreThanFiveMinutes )
Directories ¶
Path | Synopsis |
---|---|
mock_pathprocessor
Package mock_pathprocessor is a generated GoMock package.
|
Package mock_pathprocessor is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.