Exemplo n.º 1
0
 def test_derive_classic_address_secp256k1(self):
     self.assertEqual(
         keypairs.derive_classic_address(
             "030D58EB48B4420B1F7B9DF55087E0E29FEF0E8468F9A6825B01CA2C361042D435",
         ),
         "rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw1",
     )
Exemplo n.º 2
0
 def test_derive_classic_address_ed25519(self):
     self.assertEqual(
         keypairs.derive_classic_address(
             "ED01FA53FA5A7E77798F882ECE20B1ABC00BB358A9E55A202D0D0676BD0CE37A63",
         ),
         "rLUEXYuLiQptky37CqLcm9USQpPiz5rkpD",
     )
Exemplo n.º 3
0
    def __init__(self: Wallet, seed: str, sequence: int) -> None:
        """
        Generate a new Wallet.

        Args:
            seed: The seed from which the public and private keys are derived.
            sequence: The next sequence number for the account.
        """
        #: The core value that is used to derive all other information about
        #: this wallet. MUST be kept secret!
        self.seed = seed

        pk, sk = derive_keypair(self.seed)
        #: The public key that is used to identify this wallet's signatures, as
        #: a hexadecimal string.
        self.public_key = pk
        #: The private key that is used to create signatures, as a hexadecimal
        #: string. MUST be kept secret!
        self.private_key = sk

        #: The address that publicly identifies this wallet, as a base58 string.
        self.classic_address = derive_classic_address(self.public_key)

        #: The next available sequence number to use for transactions from this
        #: wallet.
        #: Must be updated by the user. Increments on the ledger with every successful
        #: transaction submission, and stays the same with every failed transaction
        #: submission.
        self.sequence = sequence
Exemplo n.º 4
0
    def __init__(self: Wallet, seed: str, sequence: int) -> None:
        """
        Generate a new Wallet.

        Args:
            seed: The seed from which the public and private keys are derived.
            sequence: The next sequence number for the account.
        """
        self.seed = seed
        """
        The core value that is used to derive all other information about
        this wallet. MUST be kept secret!
        """

        pk, sk = derive_keypair(self.seed)
        self.public_key = pk
        """
        The public key that is used to identify this wallet's signatures, as
        a hexadecimal string.
        """

        self.private_key = sk
        """
        The private key that is used to create signatures, as a hexadecimal
        string. MUST be kept secret!
        """

        self.classic_address = derive_classic_address(self.public_key)
        """The address that publicly identifies this wallet, as a base58 string."""

        self.sequence = sequence
        """
Exemplo n.º 5
0
    def __init__(self: Wallet, seed: str) -> None:
        """
        Generate a new Wallet.

        Args:
            seed: The seed from which the public and private keys are derived.
        """
        #: The core value that is used to derive all other information about
        #: this wallet. MUST be kept secret!
        self.seed = seed

        pk, sk = derive_keypair(self.seed)
        #: The public key that is used to identify this wallet's signatures, as
        #: a hexadecimal string.
        self.public_key = pk
        #: The private key that is used to create signatures, as a hexadecimal
        #: string. MUST be kept secret!
        self.private_key = sk

        #: The address that publicly identifies this wallet, as a base58 string.
        self.classic_address = derive_classic_address(self.public_key)

        #: The next available sequence number to use for transactions from this
        #: wallet. Must be maintained by the user; is not updated by the library.
        self.next_sequence_num = 0
Exemplo n.º 6
0
    def __init__(self: Wallet, seed: str) -> None:
        """
        Generate a new Wallet.

        Args:
            seed: The seed from which the public and private keys are derived.
        """
        self.seed = seed
        self.pub_key, self.priv_key = derive_keypair(self.seed)
        self.classic_address = derive_classic_address(self.pub_key)
        self.next_sequence_num = 0