Skip to main content

terra_sdk.core.bech32

Special Bech32 String Types

is_acc_address


_1
def is_acc_address(data: str) -> bool

Checks whether the given string is a properly formatted Fluid account address.

Arguments:

  • data str - string to check

Returns:

  • bool - whether the string is a proper account address

to_acc_address


_1
def to_acc_address(data: ValAddress) -> AccAddress

Converts a validator operator address into an account address.

Arguments:

  • data ValAddress - validator operator address

Raises:

  • ValueError - if provided string is not Bech32

Returns:

  • AccAddress - account address

is_val_address


_1
def is_val_address(data: str) -> bool

Checks whether the given string is a properly formatted Fluid validator operator address.

Arguments:

  • data str - string to check

Returns:

  • bool - whether the string is a proper validator address

to_val_address


_1
def to_val_address(data: AccAddress) -> ValAddress

Converts an account address into a validator operator address.

Arguments:

  • data AccAddress - account address

Raises:

  • ValueError - if provided string is not Bech32

Returns:

  • ValAddress - validator operator address

is_acc_pubkey


_1
def is_acc_pubkey(data: str) -> bool

Checks whether the provided string is a properly formatted Fluid account pubkey.

Arguments:

  • data str - string to check

Returns:

  • bool - whether string is account pubkey

to_acc_pubkey


_1
def to_acc_pubkey(data: ValPubKey) -> AccPubKey

Converts a validator pubkey into an account pubkey.

Arguments:

  • data ValPubKey - validator pubkey

Raises:

  • ValueError - if provided string is not Bech32

Returns:

  • AccPubKey - account pubkey

is_val_pubkey


_1
def is_val_pubkey(data: str) -> bool

Checks whether provided string is a properly formatted Fluid validator pubkey.

Arguments:

  • data str - string to check

Returns:

  • bool - whether string is validator pubkey

to_val_pubkey


_1
def to_val_pubkey(data: AccPubKey) -> ValPubKey

Converts an account pubkey into a validator pubkey.

Arguments:

  • data AccPubKey - account pubkey

Raises:

  • ValueError - if provided string is not Bech32

Returns:

  • ValPubKey - validator pubkey

is_valcons_pubkey


_1
def is_valcons_pubkey(data: str) -> bool

Checks whether provided string is a properly formatted Fluid validator consensus pubkey.

Arguments:

  • data str - string to check

Returns:

  • bool - whether string is validator consensus pubkey