from stellar_base.keypair import Keypair
from stellar_base.utils import StellarMnemonic


def generate_random_keypair():
    print("Generate random keypair")
    keypair = Keypair.random()
    print("Public key / Account address:\n", keypair.address().decode())
    print("Seed / Your secret to keep it on local:\n",
          keypair.seed().decode())


def create_keypair_determinist_english():
    print("Create keypair determinist english")
    mnemonic = ('illness spike retreat truth genius clock brain pass '
                'fit cave bargain toe')
    keypair = Keypair.deterministic(mnemonic)
    print("Public key / Account address:\n", keypair.address().decode())
    print("Seed / Your secret to keep it on local:\n",
          keypair.seed().decode())


def create_multiple_keypair():
    print("Create multiple keypair")
    sm = StellarMnemonic()
    secret_phrase = sm.generate()
    kp0 = Keypair.deterministic(secret_phrase, index=0)
    kp1 = Keypair.deterministic(secret_phrase, index=1)
    kp2 = Keypair.deterministic(secret_phrase, index=2)
    for keypair in (kp0, kp1, kp2):
        print("Public key / Account address:\n", keypair.address().decode())
        print("Seed / Your secret to keep it on local:\n",
              keypair.seed().decode())


if __name__ == "__main__":
    generate_random_keypair()
    create_keypair_determinist_english()
    create_multiple_keypair()

@@ -6,20 +6,19 @@
 stellar_
-base
+sdk
 .keypair
@@ -37,108 +37,51 @@
 air%0A
-from stellar_base.utils import StellarMnemonic%0A%0A%0Adef generate_
+%0A# create a 
 random
-_
+ 
 keypair
-():%0A    
+%0A
 print(%22
-Gener
+cre
 ate 
+a 
 rand
@@ -93,27 +93,18 @@
 ypair%22)%0A
-    keypair
+kp
  = Keypa
@@ -119,241 +119,162 @@
 m()%0A
-    
 print(%22
-Public key / Account address:%5Cn%22, keypair.address().decode())%0A    print(%22Seed / Your secret to keep it on local:%5Cn%22,%0A          keypair.seed().decode())%0A%0A%0Adef
+Secret: %7B%7D%22.format(kp.secret()))%0Aprint(%22Public Key: %7B%7D%22.format(kp.public_key()))%0Aprint(%22%22)%0A%0A#
  create
-_
+ a 
 keypair
-_determinist_english():%0A    
+ from secret%0A
 print(%22
-C
+c
 reate 
+a 
 keypair 
 dete
@@ -273,986 +273,456 @@
 air 
-determinist english%22)%0A    mnemonic = ('illness spike retreat truth genius clock brain pass '%0A                'fit cave bargain toe')%0A    keypair = Keypair.deterministic(mnemonic)%0A    print(%22Public key / Account address:%5Cn%22, keypair.address().decode())%0A    print(%22Seed / Your secret to keep it on local:%5Cn%22,%0A          keypair.seed().decode())%0A%0A%0Adef create_multiple_keypair():%0A    print(%22Create multiple keypair%22)%0A    sm = StellarMnemonic()%0A    secret_phrase = sm.generate()%0A    kp0 = Keypair.deterministic(secret_phrase, index=0)%0A    kp1 = Keypair.deterministic(secret_phrase, index=1)%0A    kp2 = Keypair.deterministic(secret_phrase, index=2)%0A    for keypair in (kp0, kp1, kp2):%0A        print(%22Public key / Account address:%5Cn%22, keypair.address().decode())%0A        print(%22Seed / Your secret to keep it on local:%5Cn%22,%0A              keypair.seed().decode())%0A%0A%0Aif __name__ == %22__main__%22:%0A    generate_random_keypair()%0A    create_keypair_determinist_english()%0A    create_multiple_keypair(
+from secret%22)%0Asecret = %22SBRR6ZPBHHTDXYSFRZR2QZCGDZURNE5ON4M4F3HQA42G3Z62SFCR7EEJ%22%0Akp = Keypair.from_secret(secret)%0Aprint(%22Secret: %7B%7D%22.format(kp.secret()))%0Aprint(%22Public Key: %7B%7D%22.format(kp.public_key()))%0Aprint(%22%22)%0A%0A# create a keypair from public key%0Aprint(%22create a keypair from public key%22)%0Apublic_key = %22GDCZ6JDZMWYORTIHEO2E4ZXKBQ2TLXNRQJPJH5RCFN7Q7I24G4RGLXP6%22%0Akp = Keypair.from_public_key(public_key)%0Aprint(%22Public Key: %7B%7D%22.format(kp.public_key())
 )%0A

create keypair