Documentation ¶
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) ClaimAtomicSwap(ctx sdk.Context, from sdk.AccAddress, swapID []byte, randomNumber []byte) error
- func (k Keeper) CreateAtomicSwap(ctx sdk.Context, randomNumberHash []byte, timestamp int64, heightSpan uint64, ...) error
- 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) DeleteClosedAtomicSwapsFromLongtermStorage(ctx sdk.Context)
- func (k Keeper) GetAllAssetSupplies(ctx sdk.Context) (supplies types.AssetSupplies)
- func (k Keeper) GetAllAtomicSwaps(ctx sdk.Context) (atomicSwaps types.AtomicSwaps)
- func (k Keeper) GetAssetByCoinID(ctx sdk.Context, coinID int) (types.AssetParam, bool)
- func (k Keeper) GetAssetByDenom(ctx sdk.Context, denom string) (types.AssetParam, bool)
- func (k Keeper) GetAssetSupply(ctx sdk.Context, denom []byte) (types.AssetSupply, bool)
- func (k Keeper) GetAssets(ctx sdk.Context) (types.AssetParams, bool)
- func (k Keeper) GetAtomicSwap(ctx sdk.Context, swapID []byte) (types.AtomicSwap, bool)
- func (k Keeper) GetBnbDeputyAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetBnbDeputyFixedFee(ctx sdk.Context) sdk.Int
- func (k Keeper) GetMaxAmount(ctx sdk.Context) sdk.Int
- func (k Keeper) GetMaxBlockLock(ctx sdk.Context) uint64
- func (k Keeper) GetMinAmount(ctx sdk.Context) sdk.Int
- func (k Keeper) GetMinBlockLock(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- 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) InsertIntoByBlockIndex(ctx sdk.Context, atomicSwap types.AtomicSwap)
- func (k Keeper) InsertIntoLongtermStorage(ctx sdk.Context, atomicSwap types.AtomicSwap)
- func (k Keeper) IterateAssetSupplies(ctx sdk.Context, cb func(supply types.AssetSupply) (stop bool))
- func (k Keeper) IterateAtomicSwaps(ctx sdk.Context, cb func(atomicSwap types.AtomicSwap) (stop bool))
- func (k Keeper) IterateAtomicSwapsByBlock(ctx sdk.Context, inclusiveCutoffTime uint64, ...)
- func (k Keeper) IterateAtomicSwapsLongtermStorage(ctx sdk.Context, inclusiveCutoffTime uint64, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RefundAtomicSwap(ctx sdk.Context, from sdk.AccAddress, swapID []byte) error
- func (k Keeper) RemoveAtomicSwap(ctx sdk.Context, swapID []byte)
- func (k Keeper) RemoveFromByBlockIndex(ctx sdk.Context, atomicSwap types.AtomicSwap)
- func (k Keeper) RemoveFromLongtermStorage(ctx sdk.Context, atomicSwap types.AtomicSwap)
- func (k Keeper) SetAssetSupply(ctx sdk.Context, supply types.AssetSupply, denom []byte)
- func (k Keeper) SetAtomicSwap(ctx sdk.Context, atomicSwap types.AtomicSwap)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpdateAssetSupplies(ctx sdk.Context)
- func (k Keeper) UpdateExpiredAtomicSwaps(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 NewQuerier ¶
NewQuerier is the module level router for state queries
Types ¶
type Keeper ¶
Keeper of the bep3 store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.SupplyKeeper, ak types.AccountKeeper, paramstore subspace.Subspace, maccs map[string]bool) Keeper
NewKeeper creates a bep3 keeper
func (Keeper) ClaimAtomicSwap ¶
func (k Keeper) ClaimAtomicSwap(ctx sdk.Context, from sdk.AccAddress, swapID []byte, randomNumber []byte) error
ClaimAtomicSwap validates a claim attempt, and if successful, sends the escrowed amount and closes the AtomicSwap.
func (Keeper) CreateAtomicSwap ¶
func (k Keeper) CreateAtomicSwap(ctx sdk.Context, randomNumberHash []byte, timestamp int64, heightSpan uint64, sender sdk.AccAddress, recipient sdk.AccAddress, senderOtherChain, recipientOtherChain string, amount sdk.Coins, crossChain bool) error
CreateAtomicSwap creates a new atomic swap.
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 outoing supply
func (Keeper) DeleteClosedAtomicSwapsFromLongtermStorage ¶
DeleteClosedAtomicSwapsFromLongtermStorage removes swaps one week after completion.
func (Keeper) GetAllAssetSupplies ¶
func (k Keeper) GetAllAssetSupplies(ctx sdk.Context) (supplies types.AssetSupplies)
GetAllAssetSupplies returns current asset supplies from the store as an array of sdk.Coin
func (Keeper) GetAllAtomicSwaps ¶
func (k Keeper) GetAllAtomicSwaps(ctx sdk.Context) (atomicSwaps types.AtomicSwaps)
GetAllAtomicSwaps returns all AtomicSwaps from the store
func (Keeper) GetAssetByCoinID ¶
GetAssetByCoinID returns an asset by its denom
func (Keeper) GetAssetByDenom ¶
GetAssetByDenom returns an asset by its denom
func (Keeper) GetAssetSupply ¶
GetAssetSupply gets an asset's current supply from the store.
func (Keeper) GetAtomicSwap ¶
GetAtomicSwap gets an AtomicSwap from the store.
func (Keeper) GetBnbDeputyAddress ¶
func (k Keeper) GetBnbDeputyAddress(ctx sdk.Context) sdk.AccAddress
GetBnbDeputyAddress returns the Bnbchain's deputy address
func (Keeper) GetBnbDeputyFixedFee ¶ added in v0.8.0
GetBnbDeputyFixedFee returns the deputy's fixed fee
func (Keeper) GetMaxAmount ¶ added in v0.8.0
GetMaxAmount returns the maximum amount
func (Keeper) GetMaxBlockLock ¶
GetMaxBlockLock returns the maximum block lock
func (Keeper) GetMinAmount ¶ added in v0.8.0
GetMinAmount returns the minimum amount
func (Keeper) GetMinBlockLock ¶
GetMinBlockLock returns the minimum block lock
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 outoing supply
func (Keeper) InsertIntoByBlockIndex ¶
func (k Keeper) InsertIntoByBlockIndex(ctx sdk.Context, atomicSwap types.AtomicSwap)
InsertIntoByBlockIndex adds a swap ID and expiration time into the byBlock index.
func (Keeper) InsertIntoLongtermStorage ¶
func (k Keeper) InsertIntoLongtermStorage(ctx sdk.Context, atomicSwap types.AtomicSwap)
InsertIntoLongtermStorage adds a swap ID and deletion time into the longterm storage index. Completed swaps are stored for 1 week.
func (Keeper) IterateAssetSupplies ¶
func (k Keeper) IterateAssetSupplies(ctx sdk.Context, cb func(supply types.AssetSupply) (stop bool))
IterateAssetSupplies provides an iterator over current asset supplies. For each asset supply, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) IterateAtomicSwaps ¶
func (k Keeper) IterateAtomicSwaps(ctx sdk.Context, cb func(atomicSwap types.AtomicSwap) (stop bool))
IterateAtomicSwaps provides an iterator over all stored AtomicSwaps. For each AtomicSwap, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) IterateAtomicSwapsByBlock ¶
func (k Keeper) IterateAtomicSwapsByBlock(ctx sdk.Context, inclusiveCutoffTime uint64, cb func(swapID []byte) (stop bool))
IterateAtomicSwapsByBlock provides an iterator over AtomicSwaps ordered by AtomicSwap expiration block For each AtomicSwap cb will be called. If cb returns true the iterator will close and stop.
func (Keeper) IterateAtomicSwapsLongtermStorage ¶
func (k Keeper) IterateAtomicSwapsLongtermStorage(ctx sdk.Context, inclusiveCutoffTime uint64, cb func(swapID []byte) (stop bool))
IterateAtomicSwapsLongtermStorage provides an iterator over AtomicSwaps ordered by deletion height. For each AtomicSwap cb will be called. If cb returns true the iterator will close and stop.
func (Keeper) RefundAtomicSwap ¶
RefundAtomicSwap refunds an AtomicSwap, sending assets to the original sender and closing the AtomicSwap.
func (Keeper) RemoveAtomicSwap ¶
RemoveAtomicSwap removes an AtomicSwap from the AtomicSwapKeyPrefix.
func (Keeper) RemoveFromByBlockIndex ¶
func (k Keeper) RemoveFromByBlockIndex(ctx sdk.Context, atomicSwap types.AtomicSwap)
RemoveFromByBlockIndex removes an AtomicSwap from the byBlock index.
func (Keeper) RemoveFromLongtermStorage ¶
func (k Keeper) RemoveFromLongtermStorage(ctx sdk.Context, atomicSwap types.AtomicSwap)
RemoveFromLongtermStorage removes a swap from the into the longterm storage index
func (Keeper) SetAssetSupply ¶
SetAssetSupply updates an asset's current active supply
func (Keeper) SetAtomicSwap ¶
func (k Keeper) SetAtomicSwap(ctx sdk.Context, atomicSwap types.AtomicSwap)
SetAtomicSwap puts the AtomicSwap into the store, and updates any indexes.
func (Keeper) UpdateAssetSupplies ¶ added in v0.9.0
UpdateAssetSupplies applies updates to the asset limit from parameters to the asset supplies
func (Keeper) UpdateExpiredAtomicSwaps ¶
UpdateExpiredAtomicSwaps finds all AtomicSwaps that are past (or at) their ending times and expires them.