Documentation ¶
Index ¶
- Variables
- func NewQuerier(k BaseKeeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, ak types.CUKeeper)
- type BaseKeeper
- func (keeper BaseKeeper) AddCoin(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) AddCoinHold(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) AddCoins(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) AddCoinsHold(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) BlacklistedAddr(addr sdk.CUAddress) bool
- func (keeper BaseKeeper) CancelWithdrawal(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string) sdk.Result
- func (keeper BaseKeeper) CheckCollectOrders(ctx sdk.Context, orderIDs []string, orderStatus sdk.OrderStatus, ...) (sdk.Coins, *sdk.IBCToken, []*sdk.UtxoIn, []*sdk.OrderCollect, ...)
- func (keeper BaseKeeper) CheckDecodedUtxoTransaction(ctx sdk.Context, chain, symbol string, opCUAddr sdk.CUAddress, ...) (sdk.Int, sdk.Error)
- func (keeper BaseKeeper) CheckSysTransferOrders(ctx sdk.Context, order *sdk.OrderSysTransfer, orderStatus sdk.OrderStatus) (*sdk.IBCToken, sdk.Error)
- func (keeper BaseKeeper) CheckWithdrawalOpCU(ctx sdk.Context, opCU exported.CUIBCAsset, chain, symbol string, sendable bool, ...) sdk.Error
- func (keeper BaseKeeper) CheckWithdrawalOrders(ctx sdk.Context, orderIDs []string, orderStatus sdk.OrderStatus) (*sdk.IBCToken, []*sdk.OrderWithdrawal, sdk.Error)
- func (keeper BaseKeeper) Codespace() sdk.CodespaceType
- func (keeper BaseKeeper) CollectFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, costFee sdk.Int) sdk.Result
- func (keeper BaseKeeper) CollectSignFinish(ctx sdk.Context, orderIDs []string, signedTx []byte) sdk.Result
- func (keeper BaseKeeper) CollectWaitSign(ctx sdk.Context, toCUAddr sdk.CUAddress, orderIDs []string, rawData []byte) sdk.Result
- func (keeper BaseKeeper) ConfirmedDeposit(ctx sdk.Context, fromCUAddr sdk.CUAddress, ...) sdk.Result
- func (keeper *BaseKeeper) DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error)
- func (keeper BaseKeeper) Deposit(ctx sdk.Context, fromCUAddr, toCUAddr sdk.CUAddress, symbol sdk.Symbol, ...) sdk.Result
- func (keeper BaseKeeper) GetAllBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins
- func (keeper BaseKeeper) GetAllHoldBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins
- func (keeper BaseKeeper) GetBalance(ctx sdk.Context, addr sdk.CUAddress, symbol string) sdk.Int
- func (keeper BaseKeeper) GetHoldBalance(ctx sdk.Context, addr sdk.CUAddress, symbol string) sdk.Int
- func (keeper BaseKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) (sdk.Result, sdk.Error)
- func (keeper BaseKeeper) IsSendEnabled(ctx sdk.Context) bool
- func (keeper BaseKeeper) LockCoin(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) ([]sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) LockCoins(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) ([]sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) OpcuAssetTransfer(ctx sdk.Context, opCUAddr sdk.CUAddress, toAddr, orderID, symbol string, ...) sdk.Result
- func (keeper BaseKeeper) OpcuAssetTransferFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, costFee sdk.Int) sdk.Result
- func (keeper BaseKeeper) OpcuAssetTransferSignFinish(ctx sdk.Context, orderID string, signedTx []byte) sdk.Result
- func (keeper BaseKeeper) OpcuAssetTransferWaitSign(ctx sdk.Context, orderID string, signHashes [][]byte, rawData []byte) sdk.Result
- func (keeper *BaseKeeper) OrderRetry(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, ...) sdk.Result
- func (keeper BaseKeeper) SendCoin(ctx sdk.Context, from, to sdk.CUAddress, coin sdk.Coin) (sdk.Result, []sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) SendCoins(ctx sdk.Context, from, to sdk.CUAddress, coins sdk.Coins) (sdk.Result, []sdk.Flow, sdk.Error)
- func (keeper *BaseKeeper) SetEvidenceKeeper(evidenceKeeper types.EvidenceKeeper)
- func (keeper BaseKeeper) SetSendEnabled(ctx sdk.Context, enabled bool)
- func (keeper *BaseKeeper) SetStakingKeeper(sk types.StakingKeeper)
- func (keeper BaseKeeper) SubCoin(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) SubCoinHold(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) SubCoins(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) SubCoinsHold(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) SysTransfer(ctx sdk.Context, fromCUAddr, toCUAddr sdk.CUAddress, ...) sdk.Result
- func (keeper BaseKeeper) SysTransferFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, costFee sdk.Int) sdk.Result
- func (keeper BaseKeeper) SysTransferSignFinish(ctx sdk.Context, orderID string, signedTx []byte) sdk.Result
- func (keeper BaseKeeper) SysTransferWaitSign(ctx sdk.Context, orderID string, signHash []byte, rawData []byte) sdk.Result
- func (keeper *BaseKeeper) UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error)
- func (keeper BaseKeeper) UnlockCoin(ctx sdk.Context, addr sdk.CUAddress, coin sdk.Coin) ([]sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) UnlockCoins(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) ([]sdk.Flow, sdk.Error)
- func (keeper BaseKeeper) Withdrawal(ctx sdk.Context, fromCUAddr sdk.CUAddress, toAddr, orderID, symbol string, ...) sdk.Result
- func (keeper BaseKeeper) WithdrawalConfirm(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, valid bool) sdk.Result
- func (keeper BaseKeeper) WithdrawalFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, costFee sdk.Int, ...) sdk.Result
- func (keeper BaseKeeper) WithdrawalSignFinish(ctx sdk.Context, orderIDs []string, signedTx []byte) sdk.Result
- func (keeper BaseKeeper) WithdrawalWaitSign(ctx sdk.Context, opCUAddr sdk.CUAddress, orderIDs []string, ...) sdk.Result
- type Keeper
- type SendKeeper
Constants ¶
This section is empty.
Variables ¶
var ( PriceUpLimitRatio = sdk.NewDecWithPrec(12, 1) //gas price uplimit 1.2x PriceLowLimitRatio = sdk.NewDecWithPrec(8, 1) //gas price lowlimit 0.8x )
Functions ¶
func NewQuerier ¶
func NewQuerier(k BaseKeeper) sdk.Querier
NewQuerier returns a new sdk.Keeper instance.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, ak types.CUKeeper)
RegisterInvariants registers the bank module invariants
Types ¶
type BaseKeeper ¶
type BaseKeeper struct {
// contains filtered or unexported fields
}
BaseKeeper manages transfers between accounts. It implements the ReceiptKeeper interface.
func NewBaseKeeper ¶
func NewBaseKeeper(cdc *codec.Codec, key sdk.StoreKey, ck types.CUKeeper, ik types.IBCAssetKeeper, tk types.TokenKeeper, ok types.OrderKeeper, rk types.ReceiptKeeper, sk types.StakingKeeper, cn types.Chainnode, paramSpace params.Subspace, codespace sdk.CodespaceType, blacklistedAddrs map[string]bool) *BaseKeeper
func (BaseKeeper) AddCoinHold ¶ added in v0.9.3
func (BaseKeeper) AddCoinsHold ¶ added in v0.9.3
func (BaseKeeper) BlacklistedAddr ¶ added in v0.9.3
func (keeper BaseKeeper) BlacklistedAddr(addr sdk.CUAddress) bool
func (BaseKeeper) CancelWithdrawal ¶
func (BaseKeeper) CheckCollectOrders ¶
func (keeper BaseKeeper) CheckCollectOrders(ctx sdk.Context, orderIDs []string, orderStatus sdk.OrderStatus, depositStatus sdk.DepositItemStatus) (sdk.Coins, *sdk.IBCToken, []*sdk.UtxoIn, []*sdk.OrderCollect, []*sdk.DepositItem, sdk.Error)
func (BaseKeeper) CheckDecodedUtxoTransaction ¶
func (keeper BaseKeeper) CheckDecodedUtxoTransaction(ctx sdk.Context, chain, symbol string, opCUAddr sdk.CUAddress, orderIDs []*sdk.OrderWithdrawal, tx *chainnode.ExtUtxoTransaction, fromAddr string) (sdk.Int, sdk.Error)
func (BaseKeeper) CheckSysTransferOrders ¶
func (keeper BaseKeeper) CheckSysTransferOrders(ctx sdk.Context, order *sdk.OrderSysTransfer, orderStatus sdk.OrderStatus) (*sdk.IBCToken, sdk.Error)
func (BaseKeeper) CheckWithdrawalOpCU ¶
func (keeper BaseKeeper) CheckWithdrawalOpCU(ctx sdk.Context, opCU exported.CUIBCAsset, chain, symbol string, sendable bool, fromAddr string) sdk.Error
func (BaseKeeper) CheckWithdrawalOrders ¶
func (keeper BaseKeeper) CheckWithdrawalOrders(ctx sdk.Context, orderIDs []string, orderStatus sdk.OrderStatus) (*sdk.IBCToken, []*sdk.OrderWithdrawal, sdk.Error)
func (BaseKeeper) Codespace ¶ added in v0.9.3
func (keeper BaseKeeper) Codespace() sdk.CodespaceType
Codespace returns the keeper's codespace.
func (BaseKeeper) CollectFinish ¶
func (BaseKeeper) CollectSignFinish ¶
func (BaseKeeper) CollectWaitSign ¶
func (BaseKeeper) ConfirmedDeposit ¶
func (*BaseKeeper) DelegateCoins ¶
func (keeper *BaseKeeper) DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error)
DelegateCoins performs delegation by deducting amt coins from an CustodianUnit with address addr. For vesting accounts, delegations amounts are tracked for both vesting and vested coins. The coins are then transferred from the delegator address to a ModuleAccount address. If any of the delegation amounts are negative, an error is returned.
func (BaseKeeper) Deposit ¶
func (keeper BaseKeeper) Deposit(ctx sdk.Context, fromCUAddr, toCUAddr sdk.CUAddress, symbol sdk.Symbol, toAddr, hash string, index uint64, amt sdk.Int, orderID, memo string) sdk.Result
Deposit
func (BaseKeeper) GetAllBalance ¶ added in v0.9.3
func (BaseKeeper) GetAllHoldBalance ¶ added in v0.9.3
func (BaseKeeper) GetBalance ¶ added in v0.9.3
func (BaseKeeper) GetHoldBalance ¶ added in v0.9.3
func (BaseKeeper) InputOutputCoins ¶ added in v0.9.3
func (keeper BaseKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) (sdk.Result, sdk.Error)
InputOutputCoins handles a list of inputs and outputs
func (BaseKeeper) IsSendEnabled ¶ added in v0.9.3
func (keeper BaseKeeper) IsSendEnabled(ctx sdk.Context) bool
IsSendEnabled returns the current SendEnabled nolint: errcheck
func (BaseKeeper) OpcuAssetTransfer ¶
func (keeper BaseKeeper) OpcuAssetTransfer(ctx sdk.Context, opCUAddr sdk.CUAddress, toAddr, orderID, symbol string, items []sdk.TransferItem) sdk.Result
func (BaseKeeper) OpcuAssetTransferFinish ¶
func (BaseKeeper) OpcuAssetTransferSignFinish ¶
func (BaseKeeper) OpcuAssetTransferWaitSign ¶
func (*BaseKeeper) OrderRetry ¶
func (*BaseKeeper) SetEvidenceKeeper ¶
func (keeper *BaseKeeper) SetEvidenceKeeper(evidenceKeeper types.EvidenceKeeper)
func (BaseKeeper) SetSendEnabled ¶ added in v0.9.3
func (keeper BaseKeeper) SetSendEnabled(ctx sdk.Context, enabled bool)
SetSendEnabled sets the send enabled
func (*BaseKeeper) SetStakingKeeper ¶
func (keeper *BaseKeeper) SetStakingKeeper(sk types.StakingKeeper)
func (BaseKeeper) SubCoinHold ¶ added in v0.9.3
func (BaseKeeper) SubCoinsHold ¶ added in v0.9.3
func (BaseKeeper) SysTransfer ¶
func (BaseKeeper) SysTransferFinish ¶
func (BaseKeeper) SysTransferSignFinish ¶
func (BaseKeeper) SysTransferWaitSign ¶
func (*BaseKeeper) UndelegateCoins ¶
func (keeper *BaseKeeper) UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error)
UndelegateCoins performs undelegation by crediting amt coins to an CustodianUnit with address addr. For vesting accounts, undelegation amounts are tracked for both vesting and vested coins. The coins are then transferred from a ModuleAccount address to the delegator address. If any of the undelegation amounts are negative, an error is returned.
func (BaseKeeper) UnlockCoin ¶ added in v0.9.3
func (BaseKeeper) UnlockCoins ¶ added in v0.9.3
func (BaseKeeper) Withdrawal ¶
func (BaseKeeper) WithdrawalConfirm ¶
func (keeper BaseKeeper) WithdrawalConfirm(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, valid bool) sdk.Result
WithdrawalConfirm confirm account type withdrawal order
func (BaseKeeper) WithdrawalFinish ¶
func (BaseKeeper) WithdrawalSignFinish ¶
type Keeper ¶
type Keeper interface { SendKeeper SetEvidenceKeeper(evidenceKeeper types.EvidenceKeeper) DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error) UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error) Deposit(ctx sdk.Context, fromCU, toCUAddr sdk.CUAddress, symbol sdk.Symbol, toAddr, hash string, index uint64, amt sdk.Int, orderID, memo string) sdk.Result ConfirmedDeposit(ctx sdk.Context, fromCUAddr sdk.CUAddress, validOrderIDs, invalidOrderIds []string) sdk.Result CollectWaitSign(ctx sdk.Context, toCUAddr sdk.CUAddress, orderIDs []string, rawData []byte) sdk.Result CollectSignFinish(ctx sdk.Context, orderIDs []string, signedTx []byte) sdk.Result CollectFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, costFee sdk.Int) sdk.Result Withdrawal(ctx sdk.Context, fromCU sdk.CUAddress, toAddr, orderID, symbol string, amt, gasFee sdk.Int) sdk.Result WithdrawalConfirm(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, valid bool) sdk.Result WithdrawalWaitSign(ctx sdk.Context, opCUAddr sdk.CUAddress, orderIDs []string, signHashes [][]byte, rawData []byte) sdk.Result WithdrawalSignFinish(ctx sdk.Context, orderIDs []string, signedTx []byte) sdk.Result WithdrawalFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, costFee sdk.Int, valid bool) sdk.Result CancelWithdrawal(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string) sdk.Result SysTransfer(ctx sdk.Context, fromCUAddr, toCUAddr sdk.CUAddress, toAddr, orderID, symbol string) sdk.Result SysTransferWaitSign(ctx sdk.Context, orderID string, signHash []byte, rawData []byte) sdk.Result SysTransferSignFinish(ctx sdk.Context, orderID string, signedTx []byte) sdk.Result SysTransferFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, costFee sdk.Int) sdk.Result OpcuAssetTransfer(ctx sdk.Context, opCUAddr sdk.CUAddress, toAddr, orderID, symbol string, items []sdk.TransferItem) sdk.Result OpcuAssetTransferWaitSign(ctx sdk.Context, orderID string, signHashes [][]byte, rawData []byte) sdk.Result OpcuAssetTransferSignFinish(ctx sdk.Context, orderID string, signedTx []byte) sdk.Result OpcuAssetTransferFinish(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderID string, costFee sdk.Int) sdk.Result OrderRetry(ctx sdk.Context, fromCUAddr sdk.CUAddress, orderIDs []string, retryTimes uint32, evidences []types.EvidenceValidator) sdk.Result }
Keeper defines a module interface that facilitates the transfer of coins between accounts.
type SendKeeper ¶
type SendKeeper interface { InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) (sdk.Result, sdk.Error) SendCoin(ctx sdk.Context, fromAddr sdk.CUAddress, toAddr sdk.CUAddress, amt sdk.Coin) (sdk.Result, []sdk.Flow, sdk.Error) SendCoins(ctx sdk.Context, fromAddr sdk.CUAddress, toAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, []sdk.Flow, sdk.Error) SubCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) SubCoinsHold(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) AddCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) AddCoinsHold(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) LockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) UnlockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) IsSendEnabled(ctx sdk.Context) bool SetSendEnabled(ctx sdk.Context, enabled bool) GetBalance(ctx sdk.Context, addr sdk.CUAddress, symbol string) sdk.Int GetAllBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins GetHoldBalance(ctx sdk.Context, addr sdk.CUAddress, symbol string) sdk.Int GetAllHoldBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins Codespace() sdk.CodespaceType BlacklistedAddr(addr sdk.CUAddress) bool }
SendKeeper defines a module interface that facilitates the transfer of coins between accounts without the possibility of creating coins.