Documentation
¶
Index ¶
- func EncodeRoutingMessage(sender sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)
- func Migrate6to7(k Keeper) func(ctx sdk.Context) error
- func NewMessageRoute(nexus types.Nexus, account types.AccountKeeper, wasm types.WasmKeeper) exported.MessageRoute
- 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) ActivateWasmConnection(ctx sdk.Context)
- 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) DeactivateWasmConnection(ctx sdk.Context)
- func (k Keeper) DequeueRouteMessage(ctx sdk.Context) (msg exported.GeneralMessage, ok bool)
- func (k Keeper) EnqueueForTransfer(ctx sdk.Context, sender exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)
- func (k Keeper) EnqueueRouteMessage(ctx sdk.Context, id string) 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) GenerateMessageID(ctx sdk.Context) (string, []byte, uint64)
- 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) GetMessage(ctx sdk.Context, id string) (m exported.GeneralMessage, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetProcessingMessages(ctx sdk.Context, chain exported.ChainName, limit int64) []exported.GeneralMessage
- func (k Keeper) GetRecipient(ctx sdk.Context, depositAddress exported.CrossChainAddress) (exported.CrossChainAddress, bool)
- 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) IsWasmConnectionActivated(ctx sdk.Context) 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) RouteMessage(ctx sdk.Context, id string, routingCtx ...exported.RoutingContext) error
- func (k *Keeper) SetAddressValidators(validators *types.AddressValidators)
- func (k Keeper) SetChain(ctx sdk.Context, chain exported.Chain)
- func (k Keeper) SetChainMaintainerState(ctx sdk.Context, maintainerState exported.MaintainerState) error
- func (k Keeper) SetMessageExecuted(ctx sdk.Context, id string) error
- func (k Keeper) SetMessageFailed(ctx sdk.Context, id string) error
- func (k *Keeper) SetMessageRouter(router types.MessageRouter)
- func (k Keeper) SetNewMessage(ctx sdk.Context, msg exported.GeneralMessage) 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) SubTransferFee(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) ValidateAddress(ctx sdk.Context, address exported.CrossChainAddress) error
- type Messenger
- 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) Message(c context.Context, req *types.MessageRequest) (*types.MessageResponse, error)
- func (q Querier) Params(c context.Context, req *types.ParamsRequest) (*types.ParamsResponse, 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 EncodeRoutingMessage ¶ added in v0.35.0
func EncodeRoutingMessage(sender sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)
EncodeRoutingMessage encodes the message from the wasm contract into a sdk.Msg
func Migrate6to7 ¶ added in v0.35.0
Migrate6to7 returns the handler that performs in-place store migrations
func NewMessageRoute ¶ added in v0.35.0
func NewMessageRoute(nexus types.Nexus, account types.AccountKeeper, wasm types.WasmKeeper) exported.MessageRoute
NewMessageRoute creates a new message route
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) ActivateWasmConnection ¶ added in v1.0.0
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) DeactivateWasmConnection ¶ added in v1.0.0
func (Keeper) DequeueRouteMessage ¶ added in v0.35.0
DequeueRouteMessage dequeues the next general message to be routed
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) EnqueueRouteMessage ¶ added in v0.35.0
EnqueueRouteMessage enqueues the given general message to be routed
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) GenerateMessageID ¶ added in v0.32.0
GenerateMessageID generates a unique general message ID, and returns the message ID, current transacation ID and a unique integer nonce The message ID is just a concatenation of the transaction ID and the nonce
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) GetMessage ¶ added in v0.32.0
GetMessage returns the general message by ID
func (Keeper) GetProcessingMessages ¶ added in v0.33.0
func (k Keeper) GetProcessingMessages(ctx sdk.Context, chain exported.ChainName, limit int64) []exported.GeneralMessage
GetProcessingMessages returns up to #limit messages that are currently being processed
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) 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) IsWasmConnectionActivated ¶ added in v1.0.0
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) RouteMessage ¶ added in v0.35.0
func (k Keeper) RouteMessage(ctx sdk.Context, id string, routingCtx ...exported.RoutingContext) error
RouteMessage routes the given general message to the corresponding module and set the message status to processing
func (*Keeper) SetAddressValidators ¶ added in v0.35.0
func (k *Keeper) SetAddressValidators(validators *types.AddressValidators)
SetAddressValidators sets the nexus address validator. It will panic if called more than once
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) SetMessageExecuted ¶ added in v0.32.0
SetMessageExecuted sets the general message as executed
func (Keeper) SetMessageFailed ¶ added in v0.32.0
SetMessageFailed sets the general message as failed
func (*Keeper) SetMessageRouter ¶ added in v0.35.0
func (k *Keeper) SetMessageRouter(router types.MessageRouter)
func (Keeper) SetNewMessage ¶ added in v0.31.0
SetNewMessage sets the given general messsage as approved
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.
func (Keeper) SubTransferFee ¶ added in v0.11.1
SubTransferFee subtracts coin from transfer fee
func (Keeper) ValidateAddress ¶ added in v0.32.0
ValidateAddress validates the given cross chain address
type Messenger ¶ added in v0.35.0
func NewMessenger ¶ added in v0.35.0
NewMessenger returns a new Messenger
func (Messenger) DispatchMsg ¶ added in v0.35.0
func (m Messenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error)
DispatchMsg decodes the messages from the cosmowasm gateway and routes them to the nexus module if possible
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) Message ¶ added in v0.32.0
func (q Querier) Message(c context.Context, req *types.MessageRequest) (*types.MessageResponse, error)
Message queries the general message for a given message ID
func (Querier) Params ¶ added in v0.34.0
func (q Querier) Params(c context.Context, req *types.ParamsRequest) (*types.ParamsResponse, error)
Params returns the reward module params
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