Skip to main content

This project is dedicated to sharing and teaching the fundamentals and techniques of sui crypto engineering. Crypto engineering involves analyzing how websites and web applications work, and cracking or modifying existing code to achieve specific objectives. This project includes a series of tutorials, practical tools, and case studies aimed at helping developers, security researchers, and enthusiasts understand how to effectively reverse engineer web technologies.

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysui_utils-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

pysui_utils-1.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pysui_utils-1.0.1.tar.gz.

File metadata

  • Download URL: pysui_utils-1.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.2

File hashes

Hashes for pysui_utils-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d3214b2a24daadea8c105ba05101f94e4ee5ec77bfe64da6ba4fc4188c89ea39
MD5 9dec1b1f65baa18b990c9210d32376ae
BLAKE2b-256 633653d7cbe5857136fa55fbddfa3846aa934c1ab739f036761148e7638e284c

See more details on using hashes here.

File details

Details for the file pysui_utils-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pysui_utils-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.2

File hashes

Hashes for pysui_utils-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50f888219a2328d14cb5dadeb38a8dc2f3fad61e4e1513626297a689bbd22efd
MD5 6facebcb3baa0a9b553f3ff6233f7f19
BLAKE2b-256 1d09ab5df86b6b7466dab56ccee83aa6595822e1c0edf97e99edbf74bb317549

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page