Pysui

Latest version: v0.61.0

Safety actively analyzes 634645 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 18

0.16.1

We've started to 'deprecate' various functions, classes and methods to provide early warnings where
your usage of `pysui` should consider changing.

Added

- `split_coin_equal` to SuiTransaction (a.k.a. Transaction Builder)
- Support for signing with MultiSig in SuiTransaction
- Support for running locally using [sui-base](https://github.com/sui-base/sui-base). The advantages are
the availabbility of highly configurable local nodes, management of different versions of Sui and consistent
wallet addresses across configuration.
- New pytests leveraging `sui-base`

Fixed

Changed

- Changed methods for loading a configuration. Choices are now:
1. `SuiClient.default_config()` (default configuration loading)
2. `SuiClient.sui_base_config()` (if running sui-base locally)

Removed

0.16.0

Added

- Added missing options for querying transactions
- Implemented QueryTransactions [enhancement](https://github.com/FrankC01/pysui/issues/84) builder and results supporing `suix_queryTransactions`
- MultiSig added [enhancement](https://github.com/FrankC01/pysui/issues/75)
- Implemented pysui.sui.sui_clients.Transaction/Transaction builder supporting Programmable Transactions [enhancement](https://github.com/FrankC01/pysui/issues/83)
- Documentation for Programmable Transaction in read-the-docs

Fixed

- GetTotalTxCount underlying RPC API method [fixed](https://github.com/FrankC01/pysui/issues/82)
- GetMultipleTx was calling obsolete RPC API method.
- Result type from calling faucet
- Added default dependency IDs for 0x1 and 0x2 in sui_utils.py for publishing

Changed

- _**Most, if not all, integer values as arguments to RPC methods have been changes in Sui 0.31.0 to strings
to support bigger integers for platforms without arbitrarily large numbers (ALN). This has resulted in
changes to many `pysui` Builder and result types.**_
- Gas requirements for transactions have increased 1000x on devnet. Use `GetReferenceGasPrice` and `DryRunTransaction` often until you get used to the [changes](https://docs.sui.io/devnet/build/sui-gas-charges).
- Increased default RPC timeout from 30 to 120 seconds on synch and asynch SuiClients.

Removed

- GetTxs aligning to dropped methods in RPC API 0.29.1
- GetTransactionsInRange aligning to dropped methods in RPC API 0.29.1

0.15.0

Added

- Added `get_objects` to synchronous and asynchronous SuiClients
- Address SignatureType in constant pool (base_deserailizers.py - deserialize_constants)
- GetCheckpoint builder and Checkpoint result for `sui_getCheckpoint` as per Sui 0.28.0
- GetCheckpoints builder and Checkpoint paginated results for `sui_getCheckpoints` as per Sui 0.28.1
- GetLatestSuiSystemState builder and results for `sui_getLatestSuiSystemState` as per Sui 0.28.0
- GetMultipleTx builder and TxResponseArray result for `sui_multiGetTransactions` as per Sui 0.28.0
- GetMultipleObjects builder for `sui_multiGetObjects` as per Sui 0.28.0
- QueryEvents builder for `sui_queryEvents` as per Sui 0.28.0

Fixed

- [bug](https://github.com/FrankC01/pysui/issues/76)
- [bug](https://github.com/FrankC01/pysui/issues/78)
- [bug](https://github.com/FrankC01/pysui/issues/67)

Changed

- **Breaking Change** Addresses are now 32 bytes (as apposed to 20) and are generated from keys using `blake2b` instead of `sha3_256`
- **Breaking Change** Prior 'module build' functions in `sui_utils.py` to support publishing have been replaced with `publish_build`. At the moment this will only prepare the core package modules. We will follow up with publishing unpublished dependencies in a later release. If you need that capabilit, use `sui client publish ...` from command line.
- **Breaking Change** event filters for QueryEvents and SubscribeEvents moved to `sui_types/event_filter.py`. Note that per Sui 0.28.0 the filters have changed.
- **Breaking Change** TxEffectResult renamed to TxResponse and restructured as per Sui 0.28.0
- **Breaking Change** Sui has moved from 20 byte address to 32 byte addresses. This changes all SuiAddress and ObjectID constructs.
- **Breaking Change** ValidatorMetaData changes as per Sui 0.28.0
- **Breaking Change** DelegatedStake changes as per Sui 0.28.0
- **Breaking Change** Added DryRunTxResult for new result definition as per Sui 0.28.0
- **Breaking Change** GetDynamicFieldObject now takes a mapping for name as per Sui 0.28.0
- **Breaking Change** GetTx result changes as per Sui 0.28.0
- **Breaking Change** GetObject options and result changes as per Sui 0.28.0
- **Breaking Change** ExecuteTransaction now takes a list of signatures as per Sui 0.28.0
- **Breaking Change** Result types (TxResult, TxInspectionResult and DryRunTxResult) changes as per Sui 0.28.0
- **Breaking Change** Pay and PaySui now takes a list of SuiStrings for amounts as per Sui 0.28.0
- **Breaking Change** GetEvents now take a transaction digest as parameter as per Sui 0.28.0. See Added above for QueryEvent for old behavior.
- Subscribing to events now only gets events emitted by a module as per Sui 0.28.0
- Renamed GetDelegatedStakes builder to GetStakes aligning with `sui_getStakes` as per Sui 0.28.1
- Renamed RequestAddDelegation builder to RequestAddStake aligning with `sui_requestAddStake` as per Sui 0.28.0
- Renamed RequestWithdrawDelegation builder to RequestWithdrawStake, aligning with `sui_requestWithdrawStake` as per Sui 0.28.0
- All transaction RPC API calls (Batch,Publish,MoveCall,PayXX,SplitXX,MergeXX,StakeXX) now invoke `unsafe_<NAME>` as per Sui 0.28.0 in light of the new ProgrammableTransaction.
- async_client and sync_client now take optional `additional_signers` towards support Sui multi-sign
- async_client and sync_client "execute_no_sign" now returns a PreExecutionResult data object in SuiRpcResult
- GetObject now takes flag options on what to include or not in result
- Removed `protocol_version` field from CommitteeInfo results as per Sui 0.28.0
- InspectTransaction results now include eveents as per Sui 0.28.0
- Renamed `bcs_from_rpcresult` to `bcs_struct_from_rpcresult` in

Removed

- **Breaking Change** GetTxAuthSignatures removed for `sui_getTransactionAuthSigners` removed as per Sui 0.28.0
- **Breaking Change** RequestSwitchDelegation removed for `sui_requestSwitchDelegation` removed as per Sui 0.28.0
- **Breaking Change** GetRawObject removed for `sui_getRawObject` removed as per Sui 0.28.0. Raw information is now part of GetObject
- **Breaking Change** GetSuiSystemState removed for `sui_getSuiSystemState` as per Sui 0.28.0. Use GetLatestSuiSystemState instead.
- **Breaking Change** ExecuteSerializedTransaction removed for `sui_executeTransactionSerializedSig` as per Sui 0.28.0
- **Breaking Change** GetCheckpointContentsByDigest, GetCheckpointSummary,GetCheckpointSummaryByDigest as per Sui 0.28.0
- **Breaking Change** Removed `get_address_object_descriptors` from synchronous and asynchronous SuiClients

0.14.1

Added

Fixed

Changed

- Docs:
- Updated subscription primer
- Updated builders x-ref listing

Removed

0.14.0

BREAKING Changes

Added

Fixed

Changed

- samples/async_sub.py updated to remove transaction subscriptions (see 'Removed' below)
- `name`, `description` and `image_url` changed from int list to strings in ValidatorMetadata as per Sui 0.27.0 updates
- Added `unwrappedThenDeleted` to Effects as per Sui 0.27.0 updates
- Added `gas_data` to transaction execution results as per Sui 0.27.0 updates
- Added `checkpoint` field to results of GetTx (sui_getTransaction), None otherwise, as per Sui 0.27.0 updates
- Added `executedEpoch` to Effects as per Sui 0.27.0 updates
- CheckpointContents `user_signatures` change to support multi-sig as per Sui 0.27.0 updates
- Remove redundant code for `sui_config.create_new_keypair_and_address `
- Refactor `sui_bcs.py`
- Rename `sui_bcs.tkind_from_result` to `sui_bcw.bcs_txkind_from_result`

Removed

- **BREAKING:** `sui_subscribeTransaction` removed from Sui RPC API as per Sui 0.27.0 updates as a result:
- new_txn_subscription removed from `sui_client.subscribe`
- SubscribeTransaction removed from sui_builders and respective results from sui_txresults

0.13.0

BREAKING Changes

Added

- **Experimental** `sui_bcs.py` - work in progress to enable `sui_devInspectTransaction`

- Sui 0.25.0 only supports inspection on:

- sui_transferObject
- sui_transferSui
- sui_pay
- sui_moveCall
- sui_batchTransaction

- There are a few ways to get the BCS serialized TransactionKind argument for InspectTransaction builder

- `sui_bcs.bcs_txkind_from_result` - Takes result from a `client.execute_no_sign`. However; because calling
SUI RPC requires providing a `gas` object and `gas_budget` value that may not be feasible for your use case.

python
try:
batch_params = SuiArray(
[
TransferObjectParams(
receiver=SuiAddress("0x7c7a86b564d5db0c5837191bd17980b2fb9934db"),
transfer_object=ObjectID("0x1A0535C87DE089F4417CA874A646A04914C073D6"),
),
MoveCallRequestParams(
package_object=ObjectID("0x2"),
module_str=SuiString("pay"),
function_str=SuiString("join"),
type_arguments=SuiArray([SuiString("0x2::sui::SUI")]),
arguments=SuiArray(
[
SuiString("0x0b5b6f3f2e407d1a3f6c82d716ede72b394b7ca9"),
SuiString("0x30082e169ba9f2c92b1be1763870ea9a9a7b6180"),
]
),
),
]
)
builder = BatchTransaction(
cfg.active_address,
batch_params,
ObjectID("0x0b5b6f3f2e407d1a3f6c82d716ede72b394b7ca9"),
SuiInteger(2000),
)

Call execution but do not sign and submit
rpc_result = client.execute_no_sign(builder)

iresult = sync_client.execute(
InspectTransaction(
sender_address=cfg.active_address,
tx_bytes=bcs_txkind_from_result(rpc_result),
)
)
if iresult.is_ok():
print(iresult.result_data.to_json(indent=2))
else:
print(iresult.result_string)
And so on...
except ..:



- `sui_bcs.bcs_base64_from_builder` - Takes a Builder and returns BCS encoded base64 string. Here the
`gas` object and `gas_budget` use a stock substitue value (FAKE_ADDRESS_OR_OBJECT) that are ignored.

python
transfer_params = SuiArray(
[
MoveCallRequestParams(
package_object=ObjectID("0x2"),
module_str=SuiString("pay"),
function_str=SuiString("join"),
type_arguments=SuiArray([SuiString("0x2::sui::SUI")]),
arguments=SuiArray(
[
SuiString("0x0b5b6f3f2e407d1a3f6c82d716ede72b394b7ca9"),
SuiString("0x30082e169ba9f2c92b1be1763870ea9a9a7b6180"),
]
),
),
TransferObjectParams(
receiver=SuiAddress("0x7c7a86b564d5db0c5837191bd17980b2fb9934db"),
transfer_object=ObjectID("0xd999644f6da53cc516ca6c6da76d463053fc3dc4"),
),
]
)
bt_builder = BatchTransaction(
SuiAddress(FAKE_ADDRESS_OR_OBJECT), transfer_params, ObjectID(FAKE_ADDRESS_OR_OBJECT), SuiInteger(1)
)
bcs_bt = bcs_from_builder(sync_client, bt_builder)

iresult = sync_client.execute(
InspectTransaction(
sender_address=sync_client.config.active_address,
tx_bytes=base64.b64encode(bcs_bt.serialize()).decode())
)
if iresult.is_ok():
print(iresult.result_data.to_json(indent=2))
else:
print(iresult.result_string)


- We are working on the 3rd option (low level) where you can directly code the BCS constructs and
serialize directly into the InspectTransaction `tx_bytes` field.

Fixed

- ~~secp256r1 signing~~ [workaround](https://github.com/FrankC01/pysui/issues/67)
- InspectTransaction alignment to TransactionKind [bug](https://github.com/FrankC01/pysui/issues/69)

Changed

- **BREAKING** Bumped minimal supported sui binaries from 0.19.0 to 0.25.0
- **BREAKING** TransferObjectParams (for Batch) builder now expects ObjectID as `transfer_object` parameter
- Updated CheckpointSummary as per updated result in SUI 0.26.0
- Updated CommitteeInfo as per updated result in SUI 0.26.0
- Updated SuiSystemState as per updated result in SUI 0.26.0
- Made `sui_token_lock` on `StakedSui` optional result

Removed

- **BREAKING** GetObjectsOwnedByObject (i.e. sui_getObjectsOwnedByObject) has been removed in SUI 0.26.0

Page 12 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.