pysui-utils


Namepysui-utils JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/yanjlee/sui_python_sdk
SummaryThis 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.
upload_time2024-05-30 08:13:13
maintainerNone
docs_urlNone
authoryanjlee
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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](https://github.com/FrankC01/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

```python
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 
```python
# 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()
```
```python
# Get address of your wallet 
my_wallet.get_address()
> '0xbb98ad0ae2f72677c6526d66ca3d3669c280c25a'
```
```python
random_wallet.get_address()
>'0x97534f7d430793fa4ff4619a5431c3d72fe8397d'
```

### Providers
```python
# 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)
```

```python
# Request tokens to your wallet 
provider.request_tokens_from_faucet(my_wallet.get_address())
```

```python
# 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
```python
# Get the transaction 
provider.get_transaction_block(tx_digest)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yanjlee/sui_python_sdk",
    "name": "pysui-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "yanjlee",
    "author_email": "yanjlee@163.com",
    "download_url": "https://files.pythonhosted.org/packages/63/36/53d7cbe5857136fa55fbddfa3846aa934c1ab739f036761148e7638e284c/pysui_utils-1.0.1.tar.gz",
    "platform": null,
    "description": "this project can only use for some simple methods or transaction\r\n\r\nif you want to get more Professional\uff0cConstructable complex methods or Programmable Transaction\r\n\r\nplease move here and use [pysui](https://github.com/FrankC01/pysui)\r\n\r\n\r\n-------------\r\n\r\nPython SDK to interact with Sui Blockchain \r\n\r\nforked from georgelombardi97/sui_python_sdk\r\n\r\nremove some api witch has not include in sui json api list\r\n\r\nadd more json api\r\n\r\nfix signing transactions signature method \r\n\r\n\r\nSupports creating wallets, fetching data, signing transactions \r\n# Install\r\n``\r\npip install suiutils-py\r\n``\r\n\r\nTodo: \r\n- Better type checking\r\n- Use objects instead of json or dict models \r\n- More functions & helpers   \r\n- Add more examples \r\n- Add websocket support & event subscription \r\n- Add support for publishing move packages \r\n\r\n# How to Use \r\n### Import required objects\r\n\r\n```python\r\nfrom suiutils_py.wallet import SuiWallet\r\nfrom suiutils_py.provider import SuiJsonRpcProvider\r\nfrom suiutils_py.rpc_tx_data_serializer import RpcTxDataSerializer\r\nfrom suiutils_py.signer_with_provider import SignerWithProvider\r\nfrom suiutils_py.models import TransferObjectTransaction, TransferSuiTransaction, MoveCallTransaction\r\n```\r\n\r\n### Wallet \r\n```python\r\n# Create wallet using a mnemonic\r\nmnemonic = \"all all all all all all all all all all all all\"\r\nmy_wallet = SuiWallet(mnemonic=mnemonic)\r\n# Create a new wallet with random address\r\nrandom_wallet = SuiWallet.create_random_wallet()\r\n```\r\n```python\r\n# Get address of your wallet \r\nmy_wallet.get_address()\r\n> '0xbb98ad0ae2f72677c6526d66ca3d3669c280c25a'\r\n```\r\n```python\r\nrandom_wallet.get_address()\r\n>'0x97534f7d430793fa4ff4619a5431c3d72fe8397d'\r\n```\r\n\r\n### Providers\r\n```python\r\n# Setup Providers\r\nrpc_url = \"https://fullnode.testnet.sui.io\"\r\nfaucet_url =\"https://faucet.testnet.sui.io/gas\"\r\n\r\nprovider = SuiJsonRpcProvider(rpc_url=rpc_url, faucet_url=faucet_url)\r\nserializer = RpcTxDataSerializer(rpc_url=rpc_url)\r\nsigner = SignerWithProvider(provider=provider, serializer=serializer, signer_wallet=my_wallet)\r\n```\r\n\r\n```python\r\n# Request tokens to your wallet \r\nprovider.request_tokens_from_faucet(my_wallet.get_address())\r\n```\r\n\r\n```python\r\n# Create a move call transaction\r\ntmp_move_call = MoveCallTransaction(\r\n            package_object_id='0xe220547c8a45080146d09cbb22578996628779890d70bd38ee4cf2eb05a4777d',\r\n            module=\"bluemove_x_testnet\",\r\n            function=\"mint_with_quantity\",\r\n            type_arguments=[\r\n\r\n            ],\r\n            arguments=[\r\n                '0x9269c5575b5a949fe094723e600eb0835193c207916442b8ae2162ae838d4ab2',\r\n                '1'\r\n            ],\r\n            gas_budget='10000000',\r\n            gas_payment=None,\r\n        )\r\n\r\n# Sign and execute the transaction\r\ntx_digest = signer.execute_move_call(tx_move_call=tmp_move_call)['result']['digest']\r\n```\r\n\r\n#### Fetch the Transaction\r\n```python\r\n# Get the transaction \r\nprovider.get_transaction_block(tx_digest)\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "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.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/yanjlee/sui_python_sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d09ab5df86b6b7466dab56ccee83aa6595822e1c0edf97e99edbf74bb317549",
                "md5": "6facebcb3baa0a9b553f3ff6233f7f19",
                "sha256": "50f888219a2328d14cb5dadeb38a8dc2f3fad61e4e1513626297a689bbd22efd"
            },
            "downloads": -1,
            "filename": "pysui_utils-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6facebcb3baa0a9b553f3ff6233f7f19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 2706,
            "upload_time": "2024-05-30T08:13:12",
            "upload_time_iso_8601": "2024-05-30T08:13:12.453617Z",
            "url": "https://files.pythonhosted.org/packages/1d/09/ab5df86b6b7466dab56ccee83aa6595822e1c0edf97e99edbf74bb317549/pysui_utils-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "633653d7cbe5857136fa55fbddfa3846aa934c1ab739f036761148e7638e284c",
                "md5": "9dec1b1f65baa18b990c9210d32376ae",
                "sha256": "d3214b2a24daadea8c105ba05101f94e4ee5ec77bfe64da6ba4fc4188c89ea39"
            },
            "downloads": -1,
            "filename": "pysui_utils-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9dec1b1f65baa18b990c9210d32376ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3400,
            "upload_time": "2024-05-30T08:13:13",
            "upload_time_iso_8601": "2024-05-30T08:13:13.808603Z",
            "url": "https://files.pythonhosted.org/packages/63/36/53d7cbe5857136fa55fbddfa3846aa934c1ab739f036761148e7638e284c/pysui_utils-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-30 08:13:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yanjlee",
    "github_project": "sui_python_sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pysui-utils"
}
        
Elapsed time: 9.75121s