ibc

package
v12.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReceivedCoin

func GetReceivedCoin(srcPort, srcChannel, dstPort, dstChannel, rawDenom, rawAmt string) sdk.Coin

GetReceivedCoin returns the transferred coin from an ICS20 FungibleTokenPacketData as seen from the destination chain. If the receiving chain is the source chain of the tokens, it removes the prefix path added by source (i.e sender) chain to the denom. Otherwise, it adds the prefix path from the destination chain to the denom.

func GetSentCoin

func GetSentCoin(rawDenom, rawAmt string) sdk.Coin

GetSentCoin returns the sent coin from an ICS20 FungibleTokenPacketData.

func GetTransferAmount

func GetTransferAmount(packet channeltypes.Packet) (string, error)

GetTransferAmount returns the amount from an ICS20 FungibleTokenPacketData as a string.

func GetTransferSenderRecipient

func GetTransferSenderRecipient(packet channeltypes.Packet) (
	sender, recipient sdk.AccAddress,
	senderBech32, recipientBech32 string,
	err error,
)

GetTransferSenderRecipient returns the sender and recipient sdk.AccAddresses from an ICS20 FungibleTokenPacketData as well as the original sender bech32 address from the packet data. This function fails if:

  • the packet data is not FungibleTokenPacketData
  • sender address is invalid
  • recipient address is invalid

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module a concrete type for a module boilerplate.

func NewModule

func NewModule(app porttypes.IBCModule) *Module

NewModule creates a new IBC Module boilerplate given the underlying IBC app

func (Module) OnAcknowledgementPacket

func (im Module) OnAcknowledgementPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	acknowledgement []byte,
	relayer sdk.AccAddress,
) error

OnAcknowledgementPacket implements the Module interface. It calls the underlying app's OnAcknowledgementPacket callback.

func (Module) OnChanCloseConfirm

func (im Module) OnChanCloseConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

OnChanCloseConfirm implements the Module interface. It calls the underlying app's OnChanCloseConfirm callback.

func (Module) OnChanCloseInit

func (im Module) OnChanCloseInit(
	ctx sdk.Context,
	portID,
	channelID string,
) error

OnChanCloseInit implements the Module interface It calls the underlying app's OnChanCloseInit callback.

func (Module) OnChanOpenAck

func (im Module) OnChanOpenAck(
	ctx sdk.Context,
	portID,
	channelID,
	counterpartyChannelID,
	counterpartyVersion string,
) error

OnChanOpenAck implements the Module interface. It calls the underlying app's OnChanOpenAck callback.

func (Module) OnChanOpenConfirm

func (im Module) OnChanOpenConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

OnChanOpenConfirm implements the Module interface. It calls the underlying app's OnChanOpenConfirm callback.

func (Module) OnChanOpenInit

func (im Module) OnChanOpenInit(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID string,
	channelID string,
	chanCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	version string,
) (string, error)

OnChanOpenInit implements the Module interface It calls the underlying app's OnChanOpenInit callback.

func (Module) OnChanOpenTry

func (im Module) OnChanOpenTry(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID,
	channelID string,
	chanCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	counterpartyVersion string,
) (version string, err error)

OnChanOpenTry implements the Module interface. It calls the underlying app's OnChanOpenTry callback.

func (Module) OnRecvPacket

func (im Module) OnRecvPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	relayer sdk.AccAddress,
) exported.Acknowledgement

OnRecvPacket implements the Module interface. It calls the underlying app's OnRecvPacket callback.

func (Module) OnTimeoutPacket

func (im Module) OnTimeoutPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	relayer sdk.AccAddress,
) error

OnTimeoutPacket implements the Module interface. It calls the underlying app's OnTimeoutPacket callback.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL