Bookmark
cosmpy.aerial.wallet
Wallet generation.
Wallet Objects
class Wallet(ABC, UserString)
Wallet generation.
Arguments:
ABC
: ABC abstract method.UserString
: user string.
Address
@abstractmethod
def address() -> Address
Get the address of the wallet.
Returns:
None.
public_key
@abstractmethod
def public_key() -> PublicKey
Get the public key of the wallet.
Returns:
None.
Signer
@abstractmethod
def signer() -> Signer
Get the signer of the wallet.
Returns: None.
data
@property
def data()
Get the address of the wallet.
Returns: Address.
json
def __json__()
Return the address in string format.
Returns:
Address in string format.
LocalWallet Objects
class LocalWallet(Wallet)
Generate local wallet.
Arguments:
Wallet
: wallet.
Generate
@staticmethod
def generate(prefix: Optional[str] = None) -> "LocalWallet"
Generate local wallet.
Arguments:
prefix
: prefix, defaults to None.
Returns:
Local wallet.
from_mnemonic
@staticmethod
def from_mnemonic(
mnemonic: str,
prefix: Optional[str] = None
) -> "LocalWallet"
Generate local wallet from mnemonic.
Arguments:
mnemonic
: mnemonic.prefix
: prefix, defaults to None.
Returns:
Local wallet.
from_unsafe_seed
@staticmethod
def from_unsafe_seed(
text: str,
index: Optional[int] = None,
prefix: Optional[str] = None
) -> "LocalWallet"
Generate local wallet from unsafe seed.
Arguments:
text
: text.index
: index, defaults to None.prefix
: prefix, defaults to None.
Returns:
Local wallet.
init
def __init__(private_key: PrivateKey, prefix: Optional[str] = None)
Init wallet with.
Arguments:
private_key
: private key of the wallet.prefix
: prefix, defaults to None.
address
def address() -> Address
Get the wallet address.
Returns:
Wallet address.
public_key
def public_key() ->PublicKey
Get the public key of the wallet.
Returns:
Public key.
signer
def signer() -> PrivateKey
Get the signer of the wallet.
Returns:
Signer.