Documentation ¶
Index ¶
- func GetMigrationHandler(k Keeper) func(ctx sdk.Context) error
- func NewMsgServerImpl(k types.Nexus, snapshotter types.Snapshotter, slashing types.SlashingKeeper, ...) types.MsgServiceServer
- type Keeper
- func (k Keeper) ActivateChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) AddChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error
- func (k Keeper) AddTransferFee(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) ArchivePendingTransfer(ctx sdk.Context, transfer exported.CrossChainTransfer)
- func (k Keeper) ComputeTransferFee(ctx sdk.Context, sourceChain exported.Chain, destinationChain exported.Chain, ...) (sdk.Coin, error)
- func (k Keeper) DeactivateChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) EnqueueForTransfer(ctx sdk.Context, sender exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)
- func (k Keeper) EnqueueTransfer(ctx sdk.Context, senderChain exported.Chain, ...) (exported.TransferID, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetChain(ctx sdk.Context, chainName exported.ChainName) (chain exported.Chain, ok bool)
- func (k Keeper) GetChainByNativeAsset(ctx sdk.Context, asset string) (chain exported.Chain, ok bool)
- func (k Keeper) GetChainMaintainerState(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) (exported.MaintainerState, bool)
- func (k Keeper) GetChainMaintainerStates(ctx sdk.Context, chain exported.Chain) []exported.MaintainerState
- func (k Keeper) GetChainMaintainers(ctx sdk.Context, chain exported.Chain) []sdk.ValAddress
- func (k Keeper) GetChains(ctx sdk.Context) (chains []exported.Chain)
- func (k Keeper) GetFeeInfo(ctx sdk.Context, chain exported.Chain, asset string) exported.FeeInfo
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetRecipient(ctx sdk.Context, depositAddress exported.CrossChainAddress) (exported.CrossChainAddress, bool)
- func (k Keeper) GetRouter() types.Router
- func (k Keeper) GetTransferFees(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetTransfersForChain(ctx sdk.Context, chain exported.Chain, state exported.TransferState) (transfers []exported.CrossChainTransfer)
- func (k Keeper) GetTransfersForChainPaginated(ctx sdk.Context, chain exported.Chain, state exported.TransferState, ...) ([]exported.CrossChainTransfer, *query.PageResponse, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k Keeper) IsAssetRegistered(ctx sdk.Context, chain exported.Chain, denom string) bool
- func (k Keeper) IsChainActivated(ctx sdk.Context, chain exported.Chain) bool
- func (k Keeper) IsChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) bool
- func (k Keeper) LinkAddresses(ctx sdk.Context, depositAddress exported.CrossChainAddress, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RateLimitTransfer(ctx sdk.Context, chain exported.ChainName, asset sdk.Coin, ...) error
- func (k Keeper) RegisterAsset(ctx sdk.Context, chain exported.Chain, asset exported.Asset, limit sdk.Uint, ...) error
- func (k Keeper) RegisterFee(ctx sdk.Context, chain exported.Chain, feeInfo exported.FeeInfo) error
- func (k Keeper) RemoveChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error
- func (k Keeper) SetChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) SetChainMaintainerState(ctx sdk.Context, maintainerState exported.MaintainerState) error
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params)
- func (k Keeper) SetRateLimit(ctx sdk.Context, chainName exported.ChainName, limit sdk.Coin, ...) error
- func (k *Keeper) SetRouter(router types.Router)
- func (k Keeper) SubTransferFee(ctx sdk.Context, coin sdk.Coin)
- type Querier
- func (q Querier) Assets(c context.Context, req *types.AssetsRequest) (*types.AssetsResponse, error)
- func (q Querier) ChainMaintainers(c context.Context, req *types.ChainMaintainersRequest) (*types.ChainMaintainersResponse, error)
- func (q Querier) ChainState(c context.Context, req *types.ChainStateRequest) (*types.ChainStateResponse, error)
- func (q Querier) Chains(c context.Context, req *types.ChainsRequest) (*types.ChainsResponse, error)
- func (q Querier) ChainsByAsset(c context.Context, req *types.ChainsByAssetRequest) (*types.ChainsByAssetResponse, error)
- func (q Querier) FeeInfo(c context.Context, req *types.FeeInfoRequest) (*types.FeeInfoResponse, error)
- func (q Querier) LatestDepositAddress(c context.Context, req *types.LatestDepositAddressRequest) (*types.LatestDepositAddressResponse, error)
- func (q Querier) RecipientAddress(c context.Context, req *types.RecipientAddressRequest) (*types.RecipientAddressResponse, error)
- func (q Querier) TransferFee(c context.Context, req *types.TransferFeeRequest) (*types.TransferFeeResponse, error)
- func (q Querier) TransferRateLimit(c context.Context, req *types.TransferRateLimitRequest) (*types.TransferRateLimitResponse, error)
- func (q Querier) TransfersForChain(c context.Context, req *types.TransfersForChainRequest) (*types.TransfersForChainResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMigrationHandler ¶ added in v0.13.0
GetMigrationHandler returns the handler that performs in-place store migrations
func NewMsgServerImpl ¶
func NewMsgServerImpl(k types.Nexus, snapshotter types.Snapshotter, slashing types.SlashingKeeper, staking types.StakingKeeper, axelarnet types.AxelarnetKeeper) types.MsgServiceServer
NewMsgServerImpl returns an implementation of the nexus MsgServiceServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper represents a nexus keeper
func (Keeper) ActivateChain ¶
ActivateChain activates the given chain
func (Keeper) AddChainMaintainer ¶
func (k Keeper) AddChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error
AddChainMaintainer adds the given address to be one of the given chain's maintainers
func (Keeper) AddTransferFee ¶ added in v0.17.0
AddTransferFee adds transfer fee
func (Keeper) ArchivePendingTransfer ¶
func (k Keeper) ArchivePendingTransfer(ctx sdk.Context, transfer exported.CrossChainTransfer)
ArchivePendingTransfer marks the transfer for the given recipient as concluded and archived
func (Keeper) ComputeTransferFee ¶ added in v0.15.0
func (k Keeper) ComputeTransferFee(ctx sdk.Context, sourceChain exported.Chain, destinationChain exported.Chain, asset sdk.Coin) (sdk.Coin, error)
ComputeTransferFee computes the fee for a cross-chain transfer. If fee_info is not set for an asset on a chain, default of zero is used
transfer_fee = min(total_max_fee, max(total_min_fee, (total_fee_rate) * amount))
INVARIANT: source_chain.min_fee + destination_chain.min_fee <= transfer_fee <= source_chain.max_fee + destination_chain.max_fee
func (Keeper) DeactivateChain ¶ added in v0.12.0
DeactivateChain deactivates the given chain
func (Keeper) EnqueueForTransfer ¶
func (k Keeper) EnqueueForTransfer(ctx sdk.Context, sender exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)
EnqueueForTransfer enqueues an asset transfer for the given deposit address
func (Keeper) EnqueueTransfer ¶ added in v0.17.0
func (k Keeper) EnqueueTransfer(ctx sdk.Context, senderChain exported.Chain, recipient exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)
EnqueueTransfer enqueues an asset transfer to the given recipient address
func (Keeper) ExportGenesis ¶ added in v0.9.0
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the reward module's genesis state.
func (Keeper) GetChain ¶
func (k Keeper) GetChain(ctx sdk.Context, chainName exported.ChainName) (chain exported.Chain, ok bool)
GetChain retrieves the specification for a supported blockchain
func (Keeper) GetChainByNativeAsset ¶ added in v0.14.0
func (k Keeper) GetChainByNativeAsset(ctx sdk.Context, asset string) (chain exported.Chain, ok bool)
GetChainByNativeAsset gets a chain by the native asset
func (Keeper) GetChainMaintainerState ¶ added in v0.25.0
func (k Keeper) GetChainMaintainerState(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) (exported.MaintainerState, bool)
GetChainMaintainerState returns the maintainer state of the given chain and address
func (Keeper) GetChainMaintainerStates ¶ added in v0.18.0
func (k Keeper) GetChainMaintainerStates(ctx sdk.Context, chain exported.Chain) []exported.MaintainerState
GetChainMaintainerStates returns the maintainer states of the given chain
func (Keeper) GetChainMaintainers ¶
GetChainMaintainers returns the maintainers of the given chain
func (Keeper) GetFeeInfo ¶ added in v0.15.0
GetFeeInfo retrieves the fee info for an asset on a chain, and returns zero fees if it doesn't exist
func (Keeper) GetRecipient ¶
func (k Keeper) GetRecipient(ctx sdk.Context, depositAddress exported.CrossChainAddress) (exported.CrossChainAddress, bool)
GetRecipient retrieves the cross chain recipient associated to the specified sender
func (Keeper) GetRouter ¶ added in v0.9.0
GetRouter returns the nexus router. If no router was set, it returns a (sealed) router with no handlers
func (Keeper) GetTransferFees ¶ added in v0.11.1
GetTransferFees returns the accumulated transfer fees
func (Keeper) GetTransfersForChain ¶
func (k Keeper) GetTransfersForChain(ctx sdk.Context, chain exported.Chain, state exported.TransferState) (transfers []exported.CrossChainTransfer)
GetTransfersForChain returns the current set of transfers with the given state for the given chain
func (Keeper) GetTransfersForChainPaginated ¶ added in v0.13.1
func (k Keeper) GetTransfersForChainPaginated(ctx sdk.Context, chain exported.Chain, state exported.TransferState, pageRequest *query.PageRequest) ([]exported.CrossChainTransfer, *query.PageResponse, error)
GetTransfersForChainPaginated returns the current set of transfers with the given state for the given chain with the given pagination properties
func (Keeper) InitGenesis ¶ added in v0.9.0
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
InitGenesis initializes the reward module's state from a given genesis state.
func (Keeper) IsAssetRegistered ¶
IsAssetRegistered returns true if the specified asset is supported by the given chain
func (Keeper) IsChainActivated ¶
IsChainActivated returns true if the given chain is activated; false otherwise
func (Keeper) IsChainMaintainer ¶
func (k Keeper) IsChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) bool
IsChainMaintainer returns true if the given address is one of the given chain's maintainers; false otherwise
func (Keeper) LinkAddresses ¶
func (k Keeper) LinkAddresses(ctx sdk.Context, depositAddress exported.CrossChainAddress, recipientAddress exported.CrossChainAddress) error
LinkAddresses links a sender address to a cross-chain recipient address
func (Keeper) RateLimitTransfer ¶ added in v0.27.0
func (k Keeper) RateLimitTransfer(ctx sdk.Context, chain exported.ChainName, asset sdk.Coin, direction exported.TransferDirection) error
RateLimitTransfer applies a rate limit to transfers, and returns an error if the rate limit is exceeded
func (Keeper) RegisterAsset ¶
func (k Keeper) RegisterAsset(ctx sdk.Context, chain exported.Chain, asset exported.Asset, limit sdk.Uint, window time.Duration) error
RegisterAsset indicates that the specified asset is supported by the given chain
func (Keeper) RegisterFee ¶ added in v0.15.0
RegisterFee registers the fee info for an asset on a chain
func (Keeper) RemoveChainMaintainer ¶
func (k Keeper) RemoveChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error
RemoveChainMaintainer removes the given address from the given chain's maintainers
func (Keeper) SetChainMaintainerState ¶ added in v0.25.0
func (k Keeper) SetChainMaintainerState(ctx sdk.Context, maintainerState exported.MaintainerState) error
SetChainMaintainerState sets the given chain's maintainer state
func (Keeper) SetRateLimit ¶ added in v0.27.0
func (k Keeper) SetRateLimit(ctx sdk.Context, chainName exported.ChainName, limit sdk.Coin, window time.Duration) error
SetRateLimit sets a rate limit for the given chain and asset. If max uint256 is provided as a limit, it's treated as a rate limit being infinite/not being set.
type Querier ¶ added in v0.18.0
type Querier struct {
// contains filtered or unexported fields
}
Querier implements the grpc queries for the nexus module
func NewGRPCQuerier ¶ added in v0.18.0
func NewGRPCQuerier(k Keeper, a types.AxelarnetKeeper) Querier
NewGRPCQuerier creates a new nexus Querier
func (Querier) Assets ¶ added in v0.18.0
func (q Querier) Assets(c context.Context, req *types.AssetsRequest) (*types.AssetsResponse, error)
Assets returns the registered assets of a chain
func (Querier) ChainMaintainers ¶ added in v0.26.3
func (q Querier) ChainMaintainers(c context.Context, req *types.ChainMaintainersRequest) (*types.ChainMaintainersResponse, error)
ChainMaintainers returns the chain maintainers for a given chain
func (Querier) ChainState ¶ added in v0.18.0
func (q Querier) ChainState(c context.Context, req *types.ChainStateRequest) (*types.ChainStateResponse, error)
ChainState returns the chain state in the network
func (Querier) Chains ¶ added in v0.18.0
func (q Querier) Chains(c context.Context, req *types.ChainsRequest) (*types.ChainsResponse, error)
Chains returns the chains registered on the network
func (Querier) ChainsByAsset ¶ added in v0.18.0
func (q Querier) ChainsByAsset(c context.Context, req *types.ChainsByAssetRequest) (*types.ChainsByAssetResponse, error)
ChainsByAsset returns all chains that an asset is registered on
func (Querier) FeeInfo ¶ added in v0.18.0
func (q Querier) FeeInfo(c context.Context, req *types.FeeInfoRequest) (*types.FeeInfoResponse, error)
FeeInfo returns the fee info for an asset on a specific chain
func (Querier) LatestDepositAddress ¶ added in v0.18.0
func (q Querier) LatestDepositAddress(c context.Context, req *types.LatestDepositAddressRequest) (*types.LatestDepositAddressResponse, error)
LatestDepositAddress returns the deposit address for the provided recipient
func (Querier) RecipientAddress ¶ added in v0.19.4
func (q Querier) RecipientAddress(c context.Context, req *types.RecipientAddressRequest) (*types.RecipientAddressResponse, error)
RecipientAddress returns the recipient address for a given deposit address
func (Querier) TransferFee ¶ added in v0.18.0
func (q Querier) TransferFee(c context.Context, req *types.TransferFeeRequest) (*types.TransferFeeResponse, error)
TransferFee returns the transfer fee for a cross chain transfer
func (Querier) TransferRateLimit ¶ added in v0.27.0
func (q Querier) TransferRateLimit(c context.Context, req *types.TransferRateLimitRequest) (*types.TransferRateLimitResponse, error)
TransferRateLimit queries the transfer rate limit for a given chain and asset
func (Querier) TransfersForChain ¶ added in v0.18.0
func (q Querier) TransfersForChain(c context.Context, req *types.TransfersForChainRequest) (*types.TransfersForChainResponse, error)
TransfersForChain returns the transfers for a given chain