Documentation ¶
Index ¶
- Constants
- func GetMigrationHandler(k Keeper) func(ctx sdk.Context) error
- func NewMsgServerImpl(k types.Nexus, snapshotter types.Snapshotter, staking types.StakingKeeper, ...) types.MsgServiceServer
- func NewQuerier(k types.Nexus) sdk.Querier
- func QueryChainMaintainersByChain(ctx sdk.Context, k types.Nexus, chainStr string) ([]byte, error)
- type Keeper
- func (k Keeper) ActivateChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) AddChainMaintainer(ctx sdk.Context, chain exported.Chain, maintainer sdk.ValAddress) error
- 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) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) Fee(c context.Context, req *types.FeeRequest) (*types.FeeResponse, error)
- func (k Keeper) GetChain(ctx sdk.Context, chainName string) (chain exported.Chain, ok bool)
- func (k Keeper) GetChainByNativeAsset(ctx sdk.Context, asset string) (chain exported.Chain, ok bool)
- 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) (feeInfo exported.FeeInfo, found bool)
- 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, maintainer sdk.ValAddress) bool
- func (k Keeper) LatestDepositAddress(c context.Context, req *types.LatestDepositAddressRequest) (*types.LatestDepositAddressResponse, error)
- func (k Keeper) LinkAddresses(ctx sdk.Context, depositAddress exported.CrossChainAddress, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RegisterAsset(ctx sdk.Context, chain exported.Chain, asset exported.Asset) 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, maintainer sdk.ValAddress) error
- func (k Keeper) SetChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params)
- func (k *Keeper) SetRouter(router types.Router)
- func (k Keeper) SubTransferFee(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) TransferFee(c context.Context, req *types.TransferFeeRequest) (*types.TransferFeeResponse, error)
- func (k Keeper) TransfersForChain(c context.Context, req *types.TransfersForChainRequest) (*types.TransfersForChainResponse, error)
Constants ¶
const (
QueryChainMaintainers = "chain-maintainers"
)
Query labels
Variables ¶
This section is empty.
Functions ¶
func GetMigrationHandler ¶ added in v0.13.0
GetMigrationHandler returns the handler that performs in-place store migrations from v0.14 to v0.15. The migration includes: - migrate linked addresses key
func NewMsgServerImpl ¶
func NewMsgServerImpl(k types.Nexus, snapshotter types.Snapshotter, staking types.StakingKeeper, axelarnet types.AxelarnetKeeper) types.MsgServiceServer
NewMsgServerImpl returns an implementation of the nexus MsgServiceServer interface for the provided Keeper.
func NewQuerier ¶
NewQuerier returns a new querier for the nexus module
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, maintainer sdk.ValAddress) error
AddChainMaintainer adds the given address to be one of the given chain's maintainers
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 appoints the amount of tokens to be transferred/minted to the recipient previously linked to the specified sender
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) Fee ¶ added in v0.15.0
func (k Keeper) Fee(c context.Context, req *types.FeeRequest) (*types.FeeResponse, error)
Fee returns the fee info for an asset on a specific chain
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) GetChainMaintainers ¶
GetChainMaintainers returns the maintainers of the given chain
func (Keeper) GetFeeInfo ¶ added in v0.15.0
func (k Keeper) GetFeeInfo(ctx sdk.Context, chain exported.Chain, asset string) (feeInfo exported.FeeInfo, found bool)
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, maintainer sdk.ValAddress) bool
IsChainMaintainer returns true if the given address is one of the given chain's maintainers; false otherwise
func (Keeper) LatestDepositAddress ¶ added in v0.9.0
func (k Keeper) LatestDepositAddress(c context.Context, req *types.LatestDepositAddressRequest) (*types.LatestDepositAddressResponse, error)
LatestDepositAddress returns the deposit address for the provided recipient
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) RegisterAsset ¶
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, maintainer sdk.ValAddress) error
RemoveChainMaintainer removes the given address from the given chain's maintainers
func (*Keeper) SetRouter ¶ added in v0.9.0
SetRouter sets the nexus router. It will panic if called more than once
func (Keeper) SubTransferFee ¶ added in v0.11.1
SubTransferFee subtracts coin from transfer fee
func (Keeper) TransferFee ¶ added in v0.15.0
func (k Keeper) TransferFee(c context.Context, req *types.TransferFeeRequest) (*types.TransferFeeResponse, error)
TransferFee returns the transfer fee for a cross chain transfer
func (Keeper) TransfersForChain ¶ added in v0.13.1
func (k Keeper) TransfersForChain(c context.Context, req *types.TransfersForChainRequest) (*types.TransfersForChainResponse, error)
TransfersForChain returns the transfers for a given chain