Pysui

Latest version: v0.63.0

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

Scan your dependencies

Page 13 of 18

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

0.12.0

Breaking change.

Added

- A new package, `sui_move` for deserialization of move compiled modules. This is primarily used in Publish supporting `--with-unpublished-dependencies`

Fixed

Changed

- Results from `sui_executeTransaction` and `sui_executeTransactionSerializedSig` changes aligning to SUI 0.25.0
- secp256k1 transaction signing changes as per [sui](https://github.com/MystenLabs/sui/pull/7423)
- Added optional mnemonic phrase and derivation path arguments to `create_new_keypair_and_address` SuiConfig methods.
- Move build distro to pyproject.toml from setup.cfg [build](https://github.com/FrankC01/pysui/issues/61)

Removed

- setup.cfg

0.11.0

Breaking changes

Added

- Reintroduce GetRawObject builder and results

Fixed

Changed

- Added new required field for DevInspectTransaction `sender_address` as per [SUI 0.24.0](https://github.com/MystenLabs/sui/releases/tag/devnet-0.24.0)
- `package` on MoveCall transaction result type is now just a object ID string as per [SUI 0.24.0](https://github.com/MystenLabs/sui/releases/tag/devnet-0.24.0)

Removed

- DevInspectMoveCall as per [SUI 0.24.0](https://github.com/MystenLabs/sui/releases/tag/devnet-0.24.0)

0.10.0

Breaking changes

Added

- `previous_transaction` field on SuiCoinObject result as per SUI 0.23.0
- `voting_power` field on Validator result (part of SuiSystemState) as per SUI 0.23.0
- More documentation
- Support for `secp256r1` [feature](https://github.com/FrankC01/pysui/issues/59)
- Caveat: Key recovery not supported yet
- Caveat: Due to the requirement of generating a recovery ID a brute force hack was added to signing with secp256r1 keys. However; this requirement for recovery ID is going to be lifted at some point in SUI [feature](https://github.com/MystenLabs/sui/issues/5654)

Fixed

- [bug](https://github.com/FrankC01/pysui/issues/62)
- [bug](https://github.com/FrankC01/pysui/issues/63)
- [bug](https://github.com/FrankC01/pysui/issues/64)

Changed

- `pending_delegations` field structure change from TableVec to LinkedTableForObjectID
- GetCheckpointContents now takes `sequence_number` (SuiInteger) vs `digest` (SuiString) as per SUI 0.23.0
- GetCheckpointContentsBySequence renamed to _GetCheckpointContentsByDigest_ with argument `digest` as per SUI 0.23.0
- Updated SuiSystemState result definition to include `safe_mode` field as per SUI 0.22.1
- Updated CheckpointSummary result definition to include `timestamp_ms` field as per SUI 0.22.1

Removed

- `storage_gas_price` field from StateParameters result (part of SuiSystemState) as per SUI 0.23.0
- `quorum_stake_threshold` field from ValidatorSet result (part of SuiSystemState) as per SUI 0.23.0

Page 13 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.