@@ -57,15 +57,15 @@ your secret phrase:
57
57
58
58
.. code-block :: python
59
59
60
- kp = Keypair.deterministic(m , lang = ' chinese' )
60
+ kp = Keypair.deterministic(secret_phrase , lang = ' chinese' )
61
61
62
62
You can even create multiple key pairs from the same phrase, using a different
63
63
index with each call. For example:
64
64
65
65
.. code-block :: python
66
66
67
- kp1 = Keypair.deterministic(m , lang = ' chinese' , index = 1 )
68
- kp2 = Keypair.deterministic(m , lang = ' chinese' , index = 2 )
67
+ kp1 = Keypair.deterministic(secret_phrase , lang = ' chinese' , index = 1 )
68
+ kp2 = Keypair.deterministic(secret_phrase , lang = ' chinese' , index = 2 )
69
69
70
70
From the generated :class: `Keypair <stellar_base.keypair.Keypair> ` object, you
71
71
can easily access your public and private key.
@@ -146,7 +146,6 @@ account of your own, here's an example of how to do so:
146
146
.. code-block :: python
147
147
148
148
from stellar_base.keypair import Keypair
149
- from stellar_base.asset import Asset
150
149
from stellar_base.operation import CreateAccount, Payment
151
150
from stellar_base.transaction import Transaction
152
151
from stellar_base.transaction_envelope import TransactionEnvelope as Te
@@ -161,11 +160,11 @@ account of your own, here's an example of how to do so:
161
160
# new account in the create account operation. You'll need the seed in order
162
161
# to sign off on the transaction. This is the source account.
163
162
old_account_seed = " SCVLSUGYEAUC4MVWJORB63JBMY2CEX6ATTJ5MXTENGD3IELUQF4F6HUB"
164
- old_account_keypair = Keypair.from_seed(oldAccountSeed )
163
+ old_account_keypair = Keypair.from_seed(old_account_seed )
165
164
166
165
# This is the new account ID (the StrKey representation of your newly
167
166
# created public key). This is the destination account.
168
- new_account_addr = " GXXX "
167
+ new_account_addr = " GABRGTDZEDCQ5W663U2EI5KWRSU3EAWJCSI57H7XAMUO5BQRIGNNZGTY "
169
168
170
169
amount = ' 1' # Your new account minimum balance (in XLM) to transfer over
171
170
# create the CreateAccount operation
@@ -174,7 +173,7 @@ account of your own, here's an example of how to do so:
174
173
starting_balance = amount
175
174
)
176
175
# create a memo
177
- memo = TextMemo(' Transferring to my new account !' )
176
+ memo = TextMemo(' Hello, StellarCN !' )
178
177
179
178
# Get the current sequence of the source account by contacting Horizon. You
180
179
# should also check the response for errors!
@@ -186,7 +185,7 @@ account of your own, here's an example of how to do so:
186
185
# Create a transaction with our single create account operation, with the
187
186
# default fee of 100 stroops as of this writing (0.00001 XLM)
188
187
tx = Transaction(
189
- source = kp .address().decode(),
188
+ source = old_account_keypair .address().decode(),
190
189
sequence = sequence,
191
190
memo = memo,
192
191
operations = [
@@ -235,11 +234,11 @@ Like so:
235
234
236
235
.. code-block :: python
237
236
238
- print (" Balances: {} '.format(address.balances))
239
- print (" Sequence Number: {} '.format(address.sequence))
240
- print (" Flags: {} '.format(address.flags))
241
- print (" Signers: {} '.format(address.signers))
242
- print (" Data: {} '.format(address.data))
237
+ print (' Balances: {} ' .format(address.balances))
238
+ print (' Sequence Number: {} ' .format(address.sequence))
239
+ print (' Flags: {} ' .format(address.flags))
240
+ print (' Signers: {} ' .format(address.signers))
241
+ print (' Data: {} ' .format(address.data))
243
242
244
243
245
244
Most Recent Payments
@@ -268,7 +267,7 @@ signature.
268
267
269
268
.. code-block :: python
270
269
271
- address.payments(sse = True , limit = 100 )
270
+ address.payments(sse = True )
272
271
273
272
Other Account Attributes
274
273
------------------------
309
308
builder = Builder(secret = seed)
310
309
# builder = Builder(secret=seed, network='public') for LIVENET
311
310
312
- bob_address = ' GXXX '
311
+ bob_address = ' GABRGTDZEDCQ5W663U2EI5KWRSU3EAWJCSI57H7XAMUO5BQRIGNNZGTY '
313
312
builder.append_payment_op(bob_address, ' 100' , ' XLM' )
314
313
builder.add_text_memo(' For beers' ) # string length <= 28 bytes
315
314
builder.sign()
@@ -341,7 +340,7 @@ this, you use :meth:`import_from_xdr
341
340
.. code-block :: python
342
341
343
342
# This is the transaction that you need to add your signature to
344
- xdr_string = ' GXXX '
343
+ xdr_string = ' AAAAAAMTTHkgxQ7b3t00RHVWjKmyAskUkd+f9wMo7oYRQZrcAAAAZAAAAIHlSBzvAAAAAAAAAAAAAAABAAAAAAAAAAoAAAAFaGVsbG8AAAAAAAABAAAAB3N0ZWxsYXIAAAAAAAAAAAA= '
345
344
builder = Builder(secret = seed)
346
345
builder.import_from_xdr(xdr_string)
347
346
builder.sign()
@@ -404,7 +403,7 @@ In this example, Alice is sending Bob 100 CNY.
404
403
405
404
# Construct a transaction
406
405
tx = Transaction(
407
- source = Alice .address().decode(),
406
+ source = alice_kp .address().decode(),
408
407
sequence = sequence,
409
408
# time_bounds = {'minTime': 1531000000, 'maxTime': 1531234600},
410
409
memo = msg,
0 commit comments