GithubHelp home page GithubHelp logo

pysui's People

Contributors

caffeineduck avatar debjit-bw avatar frankc01 avatar harodggg avatar kaellis avatar kgrofelnik avatar loverdos avatar randypen avatar robmcl4 avatar thayallans avatar vffv2000 avatar yolley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pysui's Issues

Build SUI transactions and execute

Implement base Sui RPC transaction building, validation using rpc.discover meta data, sign and execute.

Example of SUI transactions:

  • transfer
  • spilt

Using dataclass for various Sui types

Eliminate manual parsing of inbound descriptors from various sui_get... calls
Objectify transaction results
Objectify normalized package, modules, et.

[maintenance] Increase reuse

There is an incredible amount of redundant/duplicate code. Side effect of pushing catch up capability with evolving SUI RPC.

Primary focus areas:

  1. Builders
  2. Result data classes
  3. Clients (sync/async)

These changes MUST NOT break SDK class interfaces.

Option to separate transaction from signing

Currently, the submission of a transaction, signing and executing transaction all happen in the execute Client function.

Provide an option to return the TransactionBytes to be signed later.

[maintenance] Tracking Sui defects and changes

MystenLabs/sui#7423
Changes to secp256/k/r1 signing see #67

MystenLabs/sui#7790
Programmable transactions

MystenLabs/sui#7372
Deprecation of sui_devInspectMoveCall FIXED in pysui 0.11.0

MystenLabs/sui#7426
build/publish --with-unpublished-dependencies see #66

MystenLabs/sui#7237
This is causing fails in tracing back through object generations

MystenLabs/sui#7318
Dynamic 'type' and 'value' readability (Structural change to sui_getDynamicFields)

MystenLabs/sui#6989
Change to storing keys on disk (0.21.0) - FIXED in pysui 0.8.0

MystenLabs/sui#7052
This is causing fails in the deserialization of transaction events. Have temporary workaround - FIXED in pysui 0.9.0

Get Gas for Address

Discussed in #50

Originally posted by FrankC01 December 28, 2022
On synch or asynch client to get all the gas coins... note GetCoins this is a more terse result SuiCoinObject vs. ObjectRead

def get_gas(self, address: SuiAddress) -> list[SuiCoinObject]:
    """."""
    coin_type = SuiString("0x2::sui::SUI")
    result = self.execute(GetCoinTypeBalance(owner=address, coin_type=coin_type))
    if result.is_ok():
        limit = SuiInteger(result.result_data.items[0].coin_object_count)
        result = self.execute(GetCoins(owner=address, coin_type=coin_type, limit=limit))
        if result.is_ok():
            return result.result_data.data
    return []

Using getting descriptors to identify gas and then getting the object:

Addresses: 4
Total Sui Coin Objects: 25
real	0m2.210s
user	0m0.627s
sys	0m0.079s

Using new API:

Addresses: 4
Total Sui Coin Objects: 25
real	0m0.966s
user	0m0.399s
sys	0m0.065s

Relax strictness of builder constructors

Currently, transaction type builder's __init__ with **kwargs expects all arguments to be satisfied.

Change this to service the intersect of the builders specific keywords if any.

Asynch RPC Client

As synchronous RPC client is maturing adding an asynchronous RPC is needed.

Add faucet access in Client

Provide call to get gas from SUI faucet.

Example curl:

curl --location --request POST \
>   'http://faucet.devnet.sui.io/gas' \
>   --header 'Content-Type: application/json' \
>   --data-raw '{
>     "FixedAmountRequest": {
>       "recipient": "<ADDRESS>"
>     }
>   }'

Move to Poetry

Poetry seems like a better alternative instead of using pure venvs manage the dev-requirements, requirements and publishing the package to pypi. It even uses pyproject.toml which is supported by new versions of python for management of config and dependencies. Also it's dependency resolver is very good. I'm willing to contribute to poetry migration too.

Rebuild on publish

Discussed in #10

Originally posted by FrankC01 November 1, 2022
Currently, when doing a publish, pysui consumes all *.mv files in package/build/PACKAGENAME/bytecode_modules/ which may also pick up modules built for testing which will fail the publish.

Wondering if pysui should clean and shell out to clear and rebuild the package without test to ensure successful publish.

I've asked Sui team if there is some other discriminator in the actual compiled files (e.g. *.mv) to detect and report, so far I haven't heard back on that.

Nested event loop error is raised in `SuiAsynchClient`

If we initiate SuiAsynchClient before running the main event loop or in different task, it raised the nested event loop error due to asyncio.get_event_loop() and loop.run_until_complete() method being used from asyncio. The code I've mentioned is used in

class SuiAsynchClient(_ClientMixin):
    """Sui Asyncrhonous Client."""

    def __init__(self, config: SuiConfig) -> None:
        """Client initializer."""
        super().__init__(config)
        self._client = httpx.AsyncClient(http2=True)
        self._rpc_api = {}
        self._schema_dict = {}
        loop = asyncio.get_event_loop()
        loop.run_until_complete(self._build_api_descriptors())

Using the synchronous version of self_build_api_descriptors() rather than loop.run_until_complete() will fix this issue as the risk of creation of multiple loops will be gone. Also the get_event_loop() method is deprecated too.

Add keypair tooling

Currently generating a new 'address' uses default derivation path and generates the seed mnemonic.

  1. Provide support providing derivation paths and validate alignment to ed25519 and secp256k1 base paths
  2. Provide support for key recovery from mnemonics with optional derivation path

Run without binaries

With reference to feature

Caveats

  1. Without sui binaries the publish capability is somewhat impossible in that the user would have to somehow build the binaries of the move package and pysui re-builds the source move code to ensure no test bits are included
    2. Need sui keytool for signing with MultiSign pending Roaring Bitmap sourcing

Note: The publish will fail at the RPC level if the base64 encoded binaries contain test bits

Support new API and types in SUI RPC API 0.19.0

Update has two flavors:

  1. Change breaks return value types, immediate fix: coin balance (pushed in 0.4.1)
  2. Various other breaking changes: Will address in 0.4.2 weekend of Dec 17th, 2022
  • The main issue is in transactions submitted for execution have a new data structure that needs to be encapsulated with the txbytes from the Builder execution. It also requires serializing/deserializing the txbytes using BCS.
  • Other minor changes
  1. New API altogether to add support in Builders and RPC interfaces

Can't install req

Знімок екрана 2022-10-24 о 23 58 38

Знімок екрана 2022-10-24 о 23 59 05

And a link to pastebin, in case you need it https://pastebin.com/9CsYNr44

I have to tell you right away that I have the SUI binaries installed.

  1. I clone from the git to my computer
  2. Setup environment
    python3 -m venv pysuienv
  3. Activate
    source pysuienv/bin/activate
  4. And try to load packages, but all that happens is that there are errors

Coverage for `sui_getNormalized...` RPC API

Right now, only sui_getNormalizedMoveModulesByPackage is supported.

Need to cover:

sui_getMoveFunctionArgTypes
sui_getNormalizedMoveFunction
sui_getNormalizedMoveModule
sui_getNormalizedMoveStruct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.