Documentation ¶
Index ¶
- Constants
- type Keeper
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTransferFallbackAddress(ctx sdk.Context, channelId string, sequence uint64) (address string, found bool)
- func (k Keeper) HandleFallbackAddress(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, ...) error
- func (k Keeper) IBCTransferStToken(ctx sdk.Context, stToken sdk.Coin, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveTransferFallbackAddress(ctx sdk.Context, channelId string, sequence uint64)
- func (k Keeper) RunLiquidStake(ctx sdk.Context, amount sdkmath.Int, ...) error
- func (k Keeper) RunRedeemStake(ctx sdk.Context, strideAddress string, redemptionReceiver string, ...) error
- func (k Keeper) SendToFallbackAddress(ctx sdk.Context, packetData []byte, fallbackAddress string) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTransferFallbackAddress(ctx sdk.Context, channelId string, sequence uint64, address string)
- func (k Keeper) TryLiquidStaking(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) TryRedeemStake(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) TryUpdateAirdropClaim(ctx sdk.Context, packet channeltypes.Packet, ...) error
Constants ¶
const ( // If the forward transfer fails, the tokens are sent to the fallback address // which is a less than ideal UX // As a result, we decided to use a long timeout here such, even in the case // of high activity, a timeout should be very unlikely to occur // Empirically we found that times of high market stress took roughly // 2 hours for transfers to complete LiquidStakeForwardTransferTimeout = (time.Hour * 3) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct { Cdc codec.BinaryCodec // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( Cdc codec.BinaryCodec, storeKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, stakeibcKeeper stakeibckeeper.Keeper, claimKeeper claimkeeper.Keeper, transferKeeper types.IbcTransferKeeper, ) *Keeper
func (Keeper) GetTransferFallbackAddress ¶
func (k Keeper) GetTransferFallbackAddress(ctx sdk.Context, channelId string, sequence uint64) (address string, found bool)
Returns a fallback address, given the channel ID and sequence number of the packet If no fallback address has been stored, return false
func (Keeper) HandleFallbackAddress ¶
func (k Keeper) HandleFallbackAddress(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, packetTimedOut bool) error
If there was a timeout or failed ack from an outbound transfer of one of the autopilot actions, we'll need to check if there was a fallback address. If one was stored, bank send to that address If the ack was successful, we should delete the address (if it exists)
func (Keeper) IBCTransferStToken ¶
func (k Keeper) IBCTransferStToken( ctx sdk.Context, stToken sdk.Coin, transferMetadata transfertypes.FungibleTokenPacketData, autopilotMetadata types.StakeibcPacketMetadata, ) error
Submits an IBC transfer of the stToken to a non-stride zone (either back to the host zone or to a different zone) The sender of the transfer is the hashed receiver of the original autopilot inbound transfer
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
OnAcknowledgementPacket should send to the fallback address if the ack is an ack error
func (Keeper) OnTimeoutPacket ¶
OnTimeoutPacket should always send to the fallback address
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveTransferFallbackAddress ¶
Removes a fallback address from the store This is used after the ack or timeout for a packet has been received
func (Keeper) RunLiquidStake ¶
func (k Keeper) RunLiquidStake( ctx sdk.Context, amount sdkmath.Int, transferMetadata transfertypes.FungibleTokenPacketData, autopilotMetadata types.StakeibcPacketMetadata, ) error
Submits a LiquidStake message from the transfer receiver If a forwarding recipient is specified, the stTokens are ibc transferred
func (Keeper) RunRedeemStake ¶
func (Keeper) SendToFallbackAddress ¶
func (k Keeper) SendToFallbackAddress(ctx sdk.Context, packetData []byte, fallbackAddress string) error
In the event of an ack error after a outbound transfer, we'll have to bank send to a fallback address
func (Keeper) SetTransferFallbackAddress ¶
func (k Keeper) SetTransferFallbackAddress(ctx sdk.Context, channelId string, sequence uint64, address string)
Stores a fallback address for an outbound transfer
func (Keeper) TryLiquidStaking ¶
func (k Keeper) TryLiquidStaking( ctx sdk.Context, packet channeltypes.Packet, transferMetadata transfertypes.FungibleTokenPacketData, autopilotMetadata types.StakeibcPacketMetadata, ) error
Attempts to do an autopilot liquid stake (and optional forward) The liquid stake is only allowed if the inbound packet came along a trusted channel
func (Keeper) TryRedeemStake ¶
func (k Keeper) TryRedeemStake( ctx sdk.Context, packet channeltypes.Packet, transferPacketData transfertypes.FungibleTokenPacketData, autopilotMetadata types.StakeibcPacketMetadata, ) error
func (Keeper) TryUpdateAirdropClaim ¶
func (k Keeper) TryUpdateAirdropClaim( ctx sdk.Context, packet channeltypes.Packet, transferMetadata transfertypes.FungibleTokenPacketData, ) error
Attempt to link a host address with a stride address to enable airdrop claims