diff --git a/Cargo.lock b/Cargo.lock index 0e1bd2ff89..a91d299c68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1535,6 +1535,12 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "indoc" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" + [[package]] name = "inout" version = "0.1.3" @@ -1695,6 +1701,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "iota-sdk-python" +version = "1.1.1" +dependencies = [ + "futures", + "iota-sdk-bindings-core", + "once_cell", + "pyo3", + "serde_json", + "tokio", +] + [[package]] name = "iota-sdk-wasm" version = "0.1.0" @@ -2172,6 +2190,29 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + [[package]] name = "paste" version = "1.0.14" @@ -2383,6 +2424,67 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pyo3" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset 0.9.0", + "parking_lot", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "quote" version = "1.0.33" @@ -3115,6 +3217,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + [[package]] name = "thiserror" version = "1.0.50" @@ -3393,6 +3501,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + [[package]] name = "universal-hash" version = "0.5.1" diff --git a/bindings/python/examples/how_tos/account_output/destroy.py b/bindings/python/examples/how_tos/account_output/destroy.py index c322e40263..0b84209623 100644 --- a/bindings/python/examples/how_tos/account_output/destroy.py +++ b/bindings/python/examples/how_tos/account_output/destroy.py @@ -17,7 +17,7 @@ # Sync wallet with the node balance = wallet.sync() -# We try to destroy the first account in the account +# We try to destroy the first account in the wallet account_id = balance.accounts[0] wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) diff --git a/bindings/python/examples/how_tos/accounts_and_addresses/consolidate_outputs.py b/bindings/python/examples/how_tos/accounts_and_addresses/consolidate_outputs.py index 097eea5c82..5b2a752e0d 100644 --- a/bindings/python/examples/how_tos/accounts_and_addresses/consolidate_outputs.py +++ b/bindings/python/examples/how_tos/accounts_and_addresses/consolidate_outputs.py @@ -4,7 +4,7 @@ from iota_sdk import ConsolidationParams, Utils, Wallet, WalletOptions, FeatureType -# In this example we will consolidate basic outputs from an account with only an AddressUnlockCondition by sending +# In this example we will consolidate basic outputs from a wallet with only an AddressUnlockCondition by sending # them to the same address again. # This example uses secrets in environment variables for simplicity which diff --git a/bindings/python/examples/how_tos/accounts_and_addresses/list_outputs.py b/bindings/python/examples/how_tos/accounts_and_addresses/list_outputs.py index 2010082529..aaabc7ee45 100644 --- a/bindings/python/examples/how_tos/accounts_and_addresses/list_outputs.py +++ b/bindings/python/examples/how_tos/accounts_and_addresses/list_outputs.py @@ -4,7 +4,7 @@ from iota_sdk import Wallet, WalletOptions -# In this example we will get outputs stored in the account +# In this example we will get outputs stored in the wallet # This example uses secrets in environment variables for simplicity which # should not be done in production. @@ -13,7 +13,7 @@ wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH'))) wallet.sync() -# All outputs stored in the account +# All outputs stored in the wallet outputs = wallet.outputs() # Print all output ids @@ -21,7 +21,7 @@ for output in outputs: print(output.output_id) -# All unspent outputs stored in the account +# All unspent outputs stored in the wallet outputs = wallet.unspent_outputs() # Print all unspent output ids diff --git a/bindings/python/examples/how_tos/accounts_and_addresses/list_transactions.py b/bindings/python/examples/how_tos/accounts_and_addresses/list_transactions.py index 344e1921a9..af354a5d61 100644 --- a/bindings/python/examples/how_tos/accounts_and_addresses/list_transactions.py +++ b/bindings/python/examples/how_tos/accounts_and_addresses/list_transactions.py @@ -13,7 +13,7 @@ wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH'))) wallet.sync({'syncIncomingTransactions': True}) -# All transactions sent from the the account +# All transactions sent from the wallet transactions = wallet.transactions() print('Sent transactions:') for transaction in transactions: diff --git a/bindings/python/examples/how_tos/advanced_transactions/claim_transaction.py b/bindings/python/examples/how_tos/advanced_transactions/claim_transaction.py index 2bc3610407..c833932317 100644 --- a/bindings/python/examples/how_tos/advanced_transactions/claim_transaction.py +++ b/bindings/python/examples/how_tos/advanced_transactions/claim_transaction.py @@ -22,7 +22,7 @@ # Sync wallet with the node wallet.sync() -# Only the unspent outputs in the account +# Only the unspent outputs in the wallet output_ids = wallet.claimable_outputs('All') print('Available outputs to claim:') diff --git a/bindings/python/examples/how_tos/native_tokens/create.py b/bindings/python/examples/how_tos/native_tokens/create.py index 4a883a940a..6510b4b80d 100644 --- a/bindings/python/examples/how_tos/native_tokens/create.py +++ b/bindings/python/examples/how_tos/native_tokens/create.py @@ -32,7 +32,7 @@ print(f'Block included: {os.environ["EXPLORER_URL"]}/block/{block_id}') wallet.sync() - print("Account synced") + print("Wallet synced") print('Preparing transaction to create native token...') diff --git a/bindings/python/examples/how_tos/native_tokens/destroy_foundry.py b/bindings/python/examples/how_tos/native_tokens/destroy_foundry.py index 8682b1dad7..45a04537dc 100644 --- a/bindings/python/examples/how_tos/native_tokens/destroy_foundry.py +++ b/bindings/python/examples/how_tos/native_tokens/destroy_foundry.py @@ -17,7 +17,7 @@ wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) -# We try to destroy the first foundry in the account +# We try to destroy the first foundry in the wallet foundry_id = balance.foundries[0] # Send transaction.