Skip to main content

this project can only use for some simple methods or transaction

if you want to get more Professional,Constructable complex methods or Programmable Transaction

please move here and use pysui


Python SDK to interact with Sui Blockchain

forked from georgelombardi97/sui_python_sdk

remove some api witch has not include in sui json api list

add more json api

fix signing transactions signature method

Supports creating wallets, fetching data, signing transactions

Install

pip install suiutils-py

Todo:

  • Better type checking
  • Use objects instead of json or dict models
  • More functions & helpers
  • Add more examples
  • Add websocket support & event subscription
  • Add support for publishing move packages

How to Use

Import required objects

from suiutils_py.wallet import SuiWallet
from suiutils_py.provider import SuiJsonRpcProvider
from suiutils_py.rpc_tx_data_serializer import RpcTxDataSerializer
from suiutils_py.signer_with_provider import SignerWithProvider
from suiutils_py.models import TransferObjectTransaction, TransferSuiTransaction, MoveCallTransaction

Wallet

# Create wallet using a mnemonic
mnemonic = "all all all all all all all all all all all all"
my_wallet = SuiWallet(mnemonic=mnemonic)
# Create a new wallet with random address
random_wallet = SuiWallet.create_random_wallet()
# Get address of your wallet 
my_wallet.get_address()
> '0xbb98ad0ae2f72677c6526d66ca3d3669c280c25a'
random_wallet.get_address()
>'0x97534f7d430793fa4ff4619a5431c3d72fe8397d'

Providers

# Setup Providers
rpc_url = "https://fullnode.testnet.sui.io"
faucet_url ="https://faucet.testnet.sui.io/gas"

provider = SuiJsonRpcProvider(rpc_url=rpc_url, faucet_url=faucet_url)
serializer = RpcTxDataSerializer(rpc_url=rpc_url)
signer = SignerWithProvider(provider=provider, serializer=serializer, signer_wallet=my_wallet)
# Request tokens to your wallet 
provider.request_tokens_from_faucet(my_wallet.get_address())
# Create a move call transaction
tmp_move_call = MoveCallTransaction(
            package_object_id='0xe220547c8a45080146d09cbb22578996628779890d70bd38ee4cf2eb05a4777d',
            module="bluemove_x_testnet",
            function="mint_with_quantity",
            type_arguments=[

            ],
            arguments=[
                '0x9269c5575b5a949fe094723e600eb0835193c207916442b8ae2162ae838d4ab2',
                '1'
            ],
            gas_budget='10000000',
            gas_payment=None,
        )

# Sign and execute the transaction
tx_digest = signer.execute_move_call(tx_move_call=tmp_move_call)['result']['digest']

Fetch the Transaction

# Get the transaction 
provider.get_transaction_block(tx_digest)

Metadata

Release files for suiutils-py 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for suiutils-py 1.1.0
File Size Uploaded Provenance Actions
suiutils_py-1.1.0.tar.gz 10.0 kB Without provenance Details for suiutils_py-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for suiutils-py 1.1.0
File Interpreter ABI Platform Actions
suiutils_py-1.1.0-py3-none-any.whl Python 3 none any Details for suiutils_py-1.1.0-py3-none-any.whl

Total release size: 19.8 kB

Release files / suiutils_py-1.1.0.tar.gz

Download URL suiutils_py-1.1.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e2cd9772d8fb063e4d6cdc4dd2d8a9bb8efc4553388358a79842319914e866c5
BLAKE2b-256 checksum
How to use checksums
27fee452d08b9eb2e8dbb20f4fa0f0c8cff52401cb9a84efb036ce814909da07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Release files / suiutils_py-1.1.0-py3-none-any.whl

Download URL suiutils_py-1.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbc70b60b057fb9f1be693bbd23ef0d8352f067b80081881dd09891816666708
BLAKE2b-256 checksum
How to use checksums
8ca5072907aa520f418446fc8d2db5335d504fbc598d887bb2b5be17c5726ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Security for suiutils-py 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page