Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddHTLCToExpiredQueue(ctx sdk.Context, expirationHeight uint64, id tmbytes.HexBytes)
- func (k Keeper) AssetParams(ctx sdk.Context) (res []types.AssetParam)
- func (k Keeper) AssetSupplies(c context.Context, request *types.QueryAssetSuppliesRequest) (*types.QueryAssetSuppliesResponse, error)
- func (k Keeper) AssetSupply(c context.Context, request *types.QueryAssetSupplyRequest) (*types.QueryAssetSupplyResponse, error)
- func (k Keeper) ClaimHTLC(ctx sdk.Context, id tmbytes.HexBytes, secret tmbytes.HexBytes) (string, bool, types.SwapDirection, error)
- func (k Keeper) CreateHTLC(ctx sdk.Context, sender sdk.AccAddress, to sdk.AccAddress, ...) (id tmbytes.HexBytes, err error)
- func (k Keeper) CreateNewAssetSupply(ctx sdk.Context, denom string) types.AssetSupply
- func (k Keeper) DecrementCurrentAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) DecrementIncomingAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) DecrementOutgoingAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) DeleteHTLCFromExpiredQueue(ctx sdk.Context, expirationHeight uint64, id tmbytes.HexBytes)
- func (k Keeper) EnsureModuleAccountPermissions(ctx sdk.Context) error
- func (k Keeper) GetAllAssetSupplies(ctx sdk.Context) (supplies []types.AssetSupply)
- func (k Keeper) GetAsset(ctx sdk.Context, denom string) (types.AssetParam, error)
- func (k Keeper) GetAssetSupply(ctx sdk.Context, denom string) (assetSupply types.AssetSupply, found bool)
- func (k Keeper) GetAssets(ctx sdk.Context) ([]types.AssetParam, bool)
- func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
- func (k Keeper) GetDeputyAddress(ctx sdk.Context, denom string) (sdk.AccAddress, error)
- func (k Keeper) GetFixedFee(ctx sdk.Context, denom string) (sdk.Int, error)
- func (k Keeper) GetHTLC(ctx sdk.Context, id tmbytes.HexBytes) (htlc types.HTLC, found bool)
- func (k Keeper) GetHTLCAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetMaxBlockLock(ctx sdk.Context, denom string) (uint64, error)
- func (k Keeper) GetMaxSwapAmount(ctx sdk.Context, denom string) (sdk.Int, error)
- func (k Keeper) GetMinBlockLock(ctx sdk.Context, denom string) (uint64, error)
- func (k Keeper) GetMinSwapAmount(ctx sdk.Context, denom string) (sdk.Int, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPreviousBlockTime(ctx sdk.Context) (blockTime time.Time, found bool)
- func (k Keeper) GetSupplyLimit(ctx sdk.Context, denom string) (types.SupplyLimit, error)
- func (k Keeper) HTLC(c context.Context, request *types.QueryHTLCRequest) (*types.QueryHTLCResponse, error)
- func (k Keeper) HasHTLC(ctx sdk.Context, id tmbytes.HexBytes) bool
- func (k Keeper) IncrementCurrentAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) IncrementIncomingAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) IncrementOutgoingAssetSupply(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) IterateAssetSupplies(ctx sdk.Context, cb func(supply types.AssetSupply) (stop bool))
- func (k Keeper) IterateHTLCExpiredQueueByHeight(ctx sdk.Context, height uint64, ...)
- func (k Keeper) IterateHTLCs(ctx sdk.Context, op func(id tmbytes.HexBytes, h types.HTLC) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RefundHTLC(ctx sdk.Context, h types.HTLC, id tmbytes.HexBytes) error
- func (k Keeper) SetAsset(ctx sdk.Context, asset types.AssetParam)
- func (k Keeper) SetAssetSupply(ctx sdk.Context, supply types.AssetSupply, denom string)
- func (k Keeper) SetHTLC(ctx sdk.Context, htlc types.HTLC, id tmbytes.HexBytes)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetPreviousBlockTime(ctx sdk.Context, blockTime time.Time)
- func (k Keeper) UpdateTimeBasedSupplyLimits(ctx sdk.Context)
- func (k Keeper) ValidateLiveAsset(ctx sdk.Context, coin sdk.Coin) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶ added in v1.2.0
NewMsgServerImpl returns an implementation of the HTLC MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the HTLC keeper
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, authority string, ) Keeper
NewKeeper creates a new HTLC Keeper instance
func (Keeper) AddHTLCToExpiredQueue ¶
func (k Keeper) AddHTLCToExpiredQueue( ctx sdk.Context, expirationHeight uint64, id tmbytes.HexBytes, )
AddHTLCToExpiredQueue adds the specified HTLC to the expiration queue
func (Keeper) AssetParams ¶ added in v1.4.0
func (k Keeper) AssetParams(ctx sdk.Context) (res []types.AssetParam)
MaxRequestTimeout returns the maximum request timeout
func (Keeper) AssetSupplies ¶ added in v1.4.0
func (k Keeper) AssetSupplies(c context.Context, request *types.QueryAssetSuppliesRequest) (*types.QueryAssetSuppliesResponse, error)
func (Keeper) AssetSupply ¶ added in v1.4.0
func (k Keeper) AssetSupply(c context.Context, request *types.QueryAssetSupplyRequest) (*types.QueryAssetSupplyResponse, error)
func (Keeper) ClaimHTLC ¶
func (k Keeper) ClaimHTLC( ctx sdk.Context, id tmbytes.HexBytes, secret tmbytes.HexBytes, ) ( string, bool, types.SwapDirection, error, )
ClaimHTLC claims the specified HTLC with the given secret
func (Keeper) CreateHTLC ¶
func (k Keeper) CreateHTLC( ctx sdk.Context, sender sdk.AccAddress, to sdk.AccAddress, receiverOnOtherChain string, senderOnOtherChain string, amount sdk.Coins, hashLock tmbytes.HexBytes, timestamp uint64, timeLock uint64, transfer bool, ) ( id tmbytes.HexBytes, err error, )
CreateHTLC creates an HTLC
func (Keeper) CreateNewAssetSupply ¶ added in v1.4.0
CreateNewAssetSupply creates a new AssetSupply in the store for the input denom
func (Keeper) DecrementCurrentAssetSupply ¶ added in v1.4.0
DecrementCurrentAssetSupply decrement an asset's supply by the coin
func (Keeper) DecrementIncomingAssetSupply ¶ added in v1.4.0
DecrementIncomingAssetSupply decrements an asset's incoming supply
func (Keeper) DecrementOutgoingAssetSupply ¶ added in v1.4.0
DecrementOutgoingAssetSupply decrements an asset's outgoing supply
func (Keeper) DeleteHTLCFromExpiredQueue ¶
func (k Keeper) DeleteHTLCFromExpiredQueue( ctx sdk.Context, expirationHeight uint64, id tmbytes.HexBytes, )
DeleteHTLCFromExpiredQueue removes the specified HTLC from the expiration queue
func (Keeper) EnsureModuleAccountPermissions ¶ added in v1.4.0
EnsureModuleAccountPermissions syncs the bep3 module account's permissions with those in the supply keeper.
func (Keeper) GetAllAssetSupplies ¶ added in v1.4.0
func (k Keeper) GetAllAssetSupplies(ctx sdk.Context) (supplies []types.AssetSupply)
GetAllAssetSupplies returns all asset supplies from the store
func (Keeper) GetAsset ¶ added in v1.4.0
GetAsset returns the asset param associated with the input denom
func (Keeper) GetAssetSupply ¶ added in v1.4.0
func (k Keeper) GetAssetSupply( ctx sdk.Context, denom string, ) (assetSupply types.AssetSupply, found bool)
GetAssetSupply gets an asset's current supply from the store.
func (Keeper) GetAuthorizedAddresses ¶ added in v1.4.0
func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
GetAuthorizedAddresses returns a list of addresses that have special authorization within this module, eg all the deputies.
func (Keeper) GetDeputyAddress ¶ added in v1.4.0
GetDeputyAddress returns the deputy address for the input denom
func (Keeper) GetFixedFee ¶ added in v1.4.0
GetFixedFee returns the fixed fee for incoming swaps
func (Keeper) GetHTLCAccount ¶
func (k Keeper) GetHTLCAccount(ctx sdk.Context) authtypes.ModuleAccountI
GetHTLCAccount returns the HTLC module account
func (Keeper) GetMaxBlockLock ¶ added in v1.4.0
GetMaxBlockLock returns the maximum block lock
func (Keeper) GetMaxSwapAmount ¶ added in v1.4.0
GetMaxSwapAmount returns the maximum swap amount
func (Keeper) GetMinBlockLock ¶ added in v1.4.0
GetMinBlockLock returns the minimum block lock
func (Keeper) GetMinSwapAmount ¶ added in v1.4.0
GetMinSwapAmount returns the minimum swap amount
func (Keeper) GetPreviousBlockTime ¶ added in v1.4.0
GetPreviousBlockTime get the blocktime for the previous block
func (Keeper) GetSupplyLimit ¶ added in v1.4.0
GetSupplyLimit returns the supply limit for the input denom
func (Keeper) HTLC ¶
func (k Keeper) HTLC(c context.Context, request *types.QueryHTLCRequest) (*types.QueryHTLCResponse, error)
func (Keeper) IncrementCurrentAssetSupply ¶ added in v1.4.0
IncrementCurrentAssetSupply increments an asset's supply by the coin
func (Keeper) IncrementIncomingAssetSupply ¶ added in v1.4.0
IncrementIncomingAssetSupply increments an asset's incoming supply
func (Keeper) IncrementOutgoingAssetSupply ¶ added in v1.4.0
IncrementOutgoingAssetSupply increments an asset's outgoing supply
func (Keeper) IterateAssetSupplies ¶ added in v1.4.0
func (k Keeper) IterateAssetSupplies( ctx sdk.Context, cb func(supply types.AssetSupply) (stop bool), )
IterateAssetSupplies provides an iterator over all stored AssetSupplies.
func (Keeper) IterateHTLCExpiredQueueByHeight ¶
func (k Keeper) IterateHTLCExpiredQueueByHeight( ctx sdk.Context, height uint64, op func(id tmbytes.HexBytes, h types.HTLC) (stop bool), )
IterateHTLCExpiredQueueByHeight iterates through the HTLC expiration queue by the specified height
func (Keeper) IterateHTLCs ¶
func (k Keeper) IterateHTLCs( ctx sdk.Context, op func(id tmbytes.HexBytes, h types.HTLC) (stop bool), )
IterateHTLCs iterates through the HTLCs
func (Keeper) Params ¶ added in v1.4.0
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RefundHTLC ¶
RefundHTLC refunds the specified HTLC
func (Keeper) SetAsset ¶ added in v1.4.0
func (k Keeper) SetAsset(ctx sdk.Context, asset types.AssetParam)
SetAsset sets an asset in the params
func (Keeper) SetAssetSupply ¶ added in v1.4.0
SetAssetSupply updates an asset's supply
func (Keeper) SetPreviousBlockTime ¶ added in v1.4.0
SetPreviousBlockTime set the time of the previous block
func (Keeper) UpdateTimeBasedSupplyLimits ¶ added in v1.4.0
UpdateTimeBasedSupplyLimits updates the time based supply for each asset, resetting it if the current time window has elapsed.
type Migrator ¶ added in v1.8.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v1.8.0
NewMigrator returns a new Migrator.