Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func ParamKeyTable() paramstypes.KeyTable
- 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) 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)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the HTLC MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier creates a new HTLC Querier instance
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, paramSpace paramstypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, blockedAddrs map[string]bool, ) 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 ¶
func (k Keeper) AssetParams(ctx sdk.Context) (res []types.AssetParam)
MaxRequestTimeout returns the maximum request timeout
func (Keeper) AssetSupplies ¶
func (k Keeper) AssetSupplies(c context.Context, request *types.QueryAssetSuppliesRequest) (*types.QueryAssetSuppliesResponse, error)
func (Keeper) AssetSupply ¶
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 ¶
CreateNewAssetSupply creates a new AssetSupply in the store for the input denom
func (Keeper) DecrementCurrentAssetSupply ¶
DecrementCurrentAssetSupply decrement an asset's supply by the coin
func (Keeper) DecrementIncomingAssetSupply ¶
DecrementIncomingAssetSupply decrements an asset's incoming supply
func (Keeper) DecrementOutgoingAssetSupply ¶
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 ¶
EnsureModuleAccountPermissions syncs the bep3 module account's permissions with those in the supply keeper.
func (Keeper) GetAllAssetSupplies ¶
func (k Keeper) GetAllAssetSupplies(ctx sdk.Context) (supplies []types.AssetSupply)
GetAllAssetSupplies returns all asset supplies from the store
func (Keeper) GetAssetSupply ¶
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 ¶
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 ¶
GetDeputyAddress returns the deputy address for the input denom
func (Keeper) GetFixedFee ¶
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 ¶
GetMaxBlockLock returns the maximum block lock
func (Keeper) GetMaxSwapAmount ¶
GetMaxSwapAmount returns the maximum swap amount
func (Keeper) GetMinBlockLock ¶
GetMinBlockLock returns the minimum block lock
func (Keeper) GetMinSwapAmount ¶
GetMinSwapAmount returns the minimum swap amount
func (Keeper) GetPreviousBlockTime ¶
GetPreviousBlockTime get the blocktime for the previous block
func (Keeper) GetSupplyLimit ¶
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 ¶
IncrementCurrentAssetSupply increments an asset's supply by the coin
func (Keeper) IncrementIncomingAssetSupply ¶
IncrementIncomingAssetSupply increments an asset's incoming supply
func (Keeper) IncrementOutgoingAssetSupply ¶
IncrementOutgoingAssetSupply increments an asset's outgoing supply
func (Keeper) IterateAssetSupplies ¶
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 ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RefundHTLC ¶
RefundHTLC refunds the specified HTLC
func (Keeper) SetAsset ¶
func (k Keeper) SetAsset(ctx sdk.Context, asset types.AssetParam)
SetAsset sets an asset in the params
func (Keeper) SetAssetSupply ¶
SetAssetSupply updates an asset's supply
func (Keeper) SetPreviousBlockTime ¶
SetPreviousBlockTime set the time of the previous block
func (Keeper) UpdateTimeBasedSupplyLimits ¶
UpdateTimeBasedSupplyLimits updates the time based supply for each asset, resetting it if the current time window has elapsed.