Documentation ¶
Index ¶
- func GetAltheaAddressFromBech32(address string) (sdk.AccAddress, error)
- func GetReceivedCoin(srcPort, srcChannel, dstPort, dstChannel, rawDenom, rawAmt string) sdk.Coin
- func GetTransferAmount(packet channeltypes.Packet) (string, error)
- func GetTransferSenderRecipient(packet channeltypes.Packet) (sender, recipient sdk.AccAddress, senderBech32, recipientBech32 string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAltheaAddressFromBech32 ¶
func GetAltheaAddressFromBech32(address string) (sdk.AccAddress, error)
GetAltheaAddressFromBech32 returns the sdk.Account address of given address, while also changing bech32 human readable prefix (HRP) to the value set on the global sdk.Config (eg: `althea`). The function fails if the provided bech32 address is invalid.
func GetReceivedCoin ¶
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 GetTransferAmount ¶
func GetTransferAmount(packet channeltypes.Packet) (string, error)
GetTransferAmount returns the amount from an ICS20 FungibleTokenPacketData.
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 ¶
This section is empty.