Address (Class)¶
A Kaspa blockchain address.
In string form, the Kaspa addresses are represented by a bech32-encoded
address string combined with a network type prefix. The bech32 string encoding is
comprised of a public key, the public key version and the resulting checksum.
prefix
property
writable
¶
The network prefix of the address (kaspa, kaspatest, kaspasim, or kaspadev).
__new__
¶
__new__(address: str) -> Address
Create a new Address from a string.
| PARAMETER | DESCRIPTION |
|---|---|
address
|
A valid Kaspa address string.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Address
|
A new Address instance.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If the address string is invalid. |
__str__
¶
The string representation.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The address as a string
TYPE:
|
short
¶
Get a shortened representation of the address.
| PARAMETER | DESCRIPTION |
|---|---|
n
|
The number of characters to show at the start and end of the payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A shortened address string in the format
TYPE:
|
to_string
¶
The string representation of the Address.
| RETURNS | DESCRIPTION |
|---|---|
str
|
A bech32 encoded Kaspa address string.
TYPE:
|
validate
staticmethod
¶
Check if an address string is valid.
| PARAMETER | DESCRIPTION |
|---|---|
address
|
A Kaspa address string to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the address is valid, False otherwise.
TYPE:
|