Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sdk-py-examples #798

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/sdk-and-tools/sdk-py/sdk-py-cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ transaction = Transaction(
gas_limit=50000,
chain_id="D",
nonce=77,
amount=1000000000000000000
value=1000000000000000000
)

print(transaction.__dict__)
Expand All @@ -132,7 +132,7 @@ transaction = Transaction(
gas_limit=50000,
chain_id="D",
nonce=77,
amount=1000000000000000000,
value=1000000000000000000,
data=b"for the book"
)

Expand All @@ -144,7 +144,7 @@ Alternatively, we can create an EGLD transfer using a **transaction factory** (a
```
from multiversx_sdk_core.transaction_factories import TransactionsFactoryConfig

config = TransactionsFactoryConfig(chain_id="D")
config = TransactionsFactoryConfig("D")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been kept.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember deleting it. Will add it back next time

```

The **transaction factory** is parametrized at instantiation, and the transaction is obtained by invoking the `create_transaction...` method:
Expand Down Expand Up @@ -294,6 +294,7 @@ print(relayed_tx.__dict__)
from multiversx_sdk_core.transaction_builders.relayed_v2_builder import RelayedTransactionV2Builder
from multiversx_sdk_wallet.user_signer import UserSigner


signer = UserSigner.from_pem_file(Path("./testwallets/bob.pem"))

inner_tx = Transaction(
Expand Down Expand Up @@ -548,13 +549,13 @@ signer = UserSigner.from_pem_file(Path("./testwallets/alice.pem"))
Signing a transaction:

```
from multiversx_sdk_core import Transaction
from multiversx_sdk_core import Transaction, TransactionComputer

tx = Transaction(
nonce=90,
sender="erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th",
receiver="erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx",
amount=1000000000000000000,
value=1000000000000000000,
gas_limit=50000,
chain_id="D"
)
Expand Down Expand Up @@ -741,5 +742,4 @@ tx_on_network = provider.get_transaction("9270a6879b682a7b310c659f58b641ccdd5f08
print("Status:", tx_on_network.status)
print("Is completed:", tx_on_network.is_completed)
```

<!-- END_NOTEBOOK -->
Loading