ibcutils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

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 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.

Directories

Path Synopsis
This file contains the variables, constants, and default values used in the testing package and commonly defined in tests.
This file contains the variables, constants, and default values used in the testing package and commonly defined in tests.

Jump to

Keyboard shortcuts

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