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