diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index ca7ccae43..b5f791f49 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -439,6 +439,159 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge() + }) + if checksum != 25355 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch() + }) + if checksum != 49990 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms() + }) + if checksum != 57669 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee() + }) + if checksum != 28070 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version() + }) + if checksum != 40406 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge() + }) + if checksum != 35870 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate() + }) + if checksum != 21786 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages() + }) + if checksum != 55002 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge() + }) + if checksum != 4379 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned() + }) + if checksum != 17712 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch() + }) + if checksum != 52992 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms() + }) + if checksum != 35398 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee() + }) + if checksum != 38234 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version() + }) + if checksum != 16414 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge() + }) + if checksum != 4751 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate() + }) + if checksum != 52102 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages() + }) + if checksum != 48705 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() }) @@ -2095,6 +2248,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies() + }) + if checksum != 25411 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_systempackage_modules() + }) + if checksum != 23597 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_systempackage_modules: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_systempackage_version() + }) + if checksum != 39738 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_systempackage_version: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() }) @@ -2806,6 +2986,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new() + }) + if checksum != 48694 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new() + }) + if checksum != 52433 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58() }) @@ -3643,6 +3841,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new() + }) + if checksum != 25070 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() }) @@ -5364,14 +5571,151 @@ func (_ FfiDestroyerCancelledTransaction) Destroy(value *CancelledTransaction) { +// System transaction used to change the epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// change-epoch = u64 ; next epoch +// u64 ; protocol version +// u64 ; storage charge +// u64 ; computation charge +// u64 ; storage rebate +// u64 ; non-refundable storage fee +// u64 ; epoch start timestamp +// (vector system-package) +// ``` type ChangeEpochInterface interface { + // The total amount of gas charged for computation during the epoch. + ComputationCharge() uint64 + // The next (to become) epoch ID. + Epoch() uint64 + // Unix timestamp when epoch started + EpochStartTimestampMs() uint64 + // The non-refundable storage fee. + NonRefundableStorageFee() uint64 + // The protocol version in effect in the new epoch. + ProtocolVersion() uint64 + // The total amount of gas charged for storage during the epoch. + StorageCharge() uint64 + // The amount of storage rebate refunded to the txn senders. + StorageRebate() uint64 + // System packages (specifically framework and move stdlib) that are + // written before the new epoch starts. + SystemPackages() []*SystemPackage } +// System transaction used to change the epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// change-epoch = u64 ; next epoch +// u64 ; protocol version +// u64 ; storage charge +// u64 ; computation charge +// u64 ; storage rebate +// u64 ; non-refundable storage fee +// u64 ; epoch start timestamp +// (vector system-package) +// ``` type ChangeEpoch struct { ffiObject FfiObject } +func NewChangeEpoch(epoch uint64, protocolVersion uint64, storageCharge uint64, computationCharge uint64, storageRebate uint64, nonRefundableStorageFee uint64, epochStartTimestampMs uint64, systemPackages []*SystemPackage) *ChangeEpoch { + return FfiConverterChangeEpochINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new(FfiConverterUint64INSTANCE.Lower(epoch), FfiConverterUint64INSTANCE.Lower(protocolVersion), FfiConverterUint64INSTANCE.Lower(storageCharge), FfiConverterUint64INSTANCE.Lower(computationCharge), FfiConverterUint64INSTANCE.Lower(storageRebate), FfiConverterUint64INSTANCE.Lower(nonRefundableStorageFee), FfiConverterUint64INSTANCE.Lower(epochStartTimestampMs), FfiConverterSequenceSystemPackageINSTANCE.Lower(systemPackages),_uniffiStatus) + })) +} + +// The total amount of gas charged for computation during the epoch. +func (_self *ChangeEpoch) ComputationCharge() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge( + _pointer,_uniffiStatus) + })) +} + +// The next (to become) epoch ID. +func (_self *ChangeEpoch) Epoch() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch( + _pointer,_uniffiStatus) + })) +} + +// Unix timestamp when epoch started +func (_self *ChangeEpoch) EpochStartTimestampMs() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms( + _pointer,_uniffiStatus) + })) +} + +// The non-refundable storage fee. +func (_self *ChangeEpoch) NonRefundableStorageFee() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee( + _pointer,_uniffiStatus) + })) +} + +// The protocol version in effect in the new epoch. +func (_self *ChangeEpoch) ProtocolVersion() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version( + _pointer,_uniffiStatus) + })) +} + +// The total amount of gas charged for storage during the epoch. +func (_self *ChangeEpoch) StorageCharge() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge( + _pointer,_uniffiStatus) + })) +} + +// The amount of storage rebate refunded to the txn senders. +func (_self *ChangeEpoch) StorageRebate() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate( + _pointer,_uniffiStatus) + })) +} + +// System packages (specifically framework and move stdlib) that are +// written before the new epoch starts. +func (_self *ChangeEpoch) SystemPackages() []*SystemPackage { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpoch") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceSystemPackageINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages( + _pointer,_uniffiStatus), + } + })) +} func (object *ChangeEpoch) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() @@ -5424,14 +5768,165 @@ func (_ FfiDestroyerChangeEpoch) Destroy(value *ChangeEpoch) { +// System transaction used to change the epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// change-epoch = u64 ; next epoch +// u64 ; protocol version +// u64 ; storage charge +// u64 ; computation charge +// u64 ; computation charge burned +// u64 ; storage rebate +// u64 ; non-refundable storage fee +// u64 ; epoch start timestamp +// (vector system-package) +// ``` type ChangeEpochV2Interface interface { + // The total amount of gas charged for computation during the epoch. + ComputationCharge() uint64 + // The total amount of gas burned for computation during the epoch. + ComputationChargeBurned() uint64 + // The next (to become) epoch ID. + Epoch() uint64 + // Unix timestamp when epoch started + EpochStartTimestampMs() uint64 + // The non-refundable storage fee. + NonRefundableStorageFee() uint64 + // The protocol version in effect in the new epoch. + ProtocolVersion() uint64 + // The total amount of gas charged for storage during the epoch. + StorageCharge() uint64 + // The amount of storage rebate refunded to the txn senders. + StorageRebate() uint64 + // System packages (specifically framework and move stdlib) that are + // written before the new epoch starts. + SystemPackages() []*SystemPackage } +// System transaction used to change the epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// change-epoch = u64 ; next epoch +// u64 ; protocol version +// u64 ; storage charge +// u64 ; computation charge +// u64 ; computation charge burned +// u64 ; storage rebate +// u64 ; non-refundable storage fee +// u64 ; epoch start timestamp +// (vector system-package) +// ``` type ChangeEpochV2 struct { ffiObject FfiObject } +func NewChangeEpochV2(epoch uint64, protocolVersion uint64, storageCharge uint64, computationCharge uint64, computationChargeBurned uint64, storageRebate uint64, nonRefundableStorageFee uint64, epochStartTimestampMs uint64, systemPackages []*SystemPackage) *ChangeEpochV2 { + return FfiConverterChangeEpochV2INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new(FfiConverterUint64INSTANCE.Lower(epoch), FfiConverterUint64INSTANCE.Lower(protocolVersion), FfiConverterUint64INSTANCE.Lower(storageCharge), FfiConverterUint64INSTANCE.Lower(computationCharge), FfiConverterUint64INSTANCE.Lower(computationChargeBurned), FfiConverterUint64INSTANCE.Lower(storageRebate), FfiConverterUint64INSTANCE.Lower(nonRefundableStorageFee), FfiConverterUint64INSTANCE.Lower(epochStartTimestampMs), FfiConverterSequenceSystemPackageINSTANCE.Lower(systemPackages),_uniffiStatus) + })) +} + + + + +// The total amount of gas charged for computation during the epoch. +func (_self *ChangeEpochV2) ComputationCharge() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge( + _pointer,_uniffiStatus) + })) +} + +// The total amount of gas burned for computation during the epoch. +func (_self *ChangeEpochV2) ComputationChargeBurned() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned( + _pointer,_uniffiStatus) + })) +} + +// The next (to become) epoch ID. +func (_self *ChangeEpochV2) Epoch() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch( + _pointer,_uniffiStatus) + })) +} + +// Unix timestamp when epoch started +func (_self *ChangeEpochV2) EpochStartTimestampMs() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms( + _pointer,_uniffiStatus) + })) +} +// The non-refundable storage fee. +func (_self *ChangeEpochV2) NonRefundableStorageFee() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee( + _pointer,_uniffiStatus) + })) +} +// The protocol version in effect in the new epoch. +func (_self *ChangeEpochV2) ProtocolVersion() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version( + _pointer,_uniffiStatus) + })) +} + +// The total amount of gas charged for storage during the epoch. +func (_self *ChangeEpochV2) StorageCharge() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge( + _pointer,_uniffiStatus) + })) +} +// The amount of storage rebate refunded to the txn senders. +func (_self *ChangeEpochV2) StorageRebate() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate( + _pointer,_uniffiStatus) + })) +} + +// System packages (specifically framework and move stdlib) that are +// written before the new epoch starts. +func (_self *ChangeEpochV2) SystemPackages() []*SystemPackage { + _pointer := _self.ffiObject.incrementPointer("*ChangeEpochV2") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceSystemPackageINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages( + _pointer,_uniffiStatus), + } + })) +} func (object *ChangeEpochV2) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() @@ -13656,6 +14151,127 @@ func (_ FfiDestroyerStructTag) Destroy(value *StructTag) { +// System package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// system-package = u64 ; version +// (vector bytes) ; modules +// (vector object-id) ; dependencies +// ``` +type SystemPackageInterface interface { + Dependencies() []*ObjectId + Modules() [][]byte + Version() uint64 +} +// System package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// system-package = u64 ; version +// (vector bytes) ; modules +// (vector object-id) ; dependencies +// ``` +type SystemPackage struct { + ffiObject FfiObject +} +func NewSystemPackage(version uint64, modules [][]byte, dependencies []*ObjectId) *SystemPackage { + return FfiConverterSystemPackageINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_systempackage_new(FfiConverterUint64INSTANCE.Lower(version), FfiConverterSequenceBytesINSTANCE.Lower(modules), FfiConverterSequenceObjectIdINSTANCE.Lower(dependencies),_uniffiStatus) + })) +} + + + + +func (_self *SystemPackage) Dependencies() []*ObjectId { + _pointer := _self.ffiObject.incrementPointer("*SystemPackage") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *SystemPackage) Modules() [][]byte { + _pointer := _self.ffiObject.incrementPointer("*SystemPackage") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_systempackage_modules( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *SystemPackage) Version() uint64 { + _pointer := _self.ffiObject.incrementPointer("*SystemPackage") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_systempackage_version( + _pointer,_uniffiStatus) + })) +} +func (object *SystemPackage) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterSystemPackage struct {} + +var FfiConverterSystemPackageINSTANCE = FfiConverterSystemPackage{} + + +func (c FfiConverterSystemPackage) Lift(pointer unsafe.Pointer) *SystemPackage { + result := &SystemPackage { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_systempackage(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_systempackage(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*SystemPackage).Destroy) + return result +} + +func (c FfiConverterSystemPackage) Read(reader io.Reader) *SystemPackage { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterSystemPackage) Lower(value *SystemPackage) unsafe.Pointer { + // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, + // because the pointer will be decremented immediately after this function returns, + // and someone will be left holding onto a non-locked pointer. + pointer := value.ffiObject.incrementPointer("*SystemPackage") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterSystemPackage) Write(writer io.Writer, value *SystemPackage) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerSystemPackage struct {} + +func (_ FfiDestroyerSystemPackage) Destroy(value *SystemPackage) { + value.Destroy() +} + + + // A transaction // // # BCS @@ -24269,6 +24885,49 @@ func (FfiDestroyerSequenceObjectId) Destroy(sequence []*ObjectId) { } } +type FfiConverterSequenceSystemPackage struct{} + +var FfiConverterSequenceSystemPackageINSTANCE = FfiConverterSequenceSystemPackage{} + +func (c FfiConverterSequenceSystemPackage) Lift(rb RustBufferI) []*SystemPackage { + return LiftFromRustBuffer[[]*SystemPackage](c, rb) +} + +func (c FfiConverterSequenceSystemPackage) Read(reader io.Reader) []*SystemPackage { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*SystemPackage, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterSystemPackageINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceSystemPackage) Lower(value []*SystemPackage) C.RustBuffer { + return LowerIntoRustBuffer[[]*SystemPackage](c, value) +} + +func (c FfiConverterSequenceSystemPackage) Write(writer io.Writer, value []*SystemPackage) { + if len(value) > math.MaxInt32 { + panic("[]*SystemPackage is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterSystemPackageINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceSystemPackage struct {} + +func (FfiDestroyerSequenceSystemPackage) Destroy(sequence []*SystemPackage) { + for _, value := range sequence { + FfiDestroyerSystemPackage{}.Destroy(value) + } +} + type FfiConverterSequenceTransactionDigest struct{} var FfiConverterSequenceTransactionDigestINSTANCE = FfiConverterSequenceTransactionDigest{} diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index db8375fa0..5140abb44 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -612,6 +612,51 @@ void* uniffi_iota_sdk_ffi_fn_clone_changeepoch(void* ptr, RustCallStatus *out_st void uniffi_iota_sdk_ffi_fn_free_changeepoch(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHANGEEPOCH_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHANGEEPOCH_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new(uint64_t epoch, uint64_t protocol_version, uint64_t storage_charge, uint64_t computation_charge, uint64_t storage_rebate, uint64_t non_refundable_storage_fee, uint64_t epoch_start_timestamp_ms, RustBuffer system_packages, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_COMPUTATION_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_COMPUTATION_CHARGE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_EPOCH +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_EPOCH_START_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_EPOCH_START_TIMESTAMP_MS +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_NON_REFUNDABLE_STORAGE_FEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_NON_REFUNDABLE_STORAGE_FEE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_PROTOCOL_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_PROTOCOL_VERSION +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_STORAGE_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_STORAGE_CHARGE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_STORAGE_REBATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_STORAGE_REBATE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_SYSTEM_PACKAGES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCH_SYSTEM_PACKAGES +RustBuffer uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHANGEEPOCHV2 #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHANGEEPOCHV2 void* uniffi_iota_sdk_ffi_fn_clone_changeepochv2(void* ptr, RustCallStatus *out_status @@ -622,6 +667,56 @@ void* uniffi_iota_sdk_ffi_fn_clone_changeepochv2(void* ptr, RustCallStatus *out_ void uniffi_iota_sdk_ffi_fn_free_changeepochv2(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHANGEEPOCHV2_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHANGEEPOCHV2_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new(uint64_t epoch, uint64_t protocol_version, uint64_t storage_charge, uint64_t computation_charge, uint64_t computation_charge_burned, uint64_t storage_rebate, uint64_t non_refundable_storage_fee, uint64_t epoch_start_timestamp_ms, RustBuffer system_packages, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE_BURNED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE_BURNED +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_EPOCH +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_EPOCH_START_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_EPOCH_START_TIMESTAMP_MS +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_NON_REFUNDABLE_STORAGE_FEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_NON_REFUNDABLE_STORAGE_FEE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_PROTOCOL_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_PROTOCOL_VERSION +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_STORAGE_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_STORAGE_CHARGE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_STORAGE_REBATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_STORAGE_REBATE +uint64_t uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_SYSTEM_PACKAGES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHANGEEPOCHV2_SYSTEM_PACKAGES +RustBuffer uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTCOMMITMENT #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTCOMMITMENT void* uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(void* ptr, RustCallStatus *out_status @@ -2531,6 +2626,36 @@ void* uniffi_iota_sdk_ffi_fn_method_structtag_coin_type(void* ptr, RustCallStatu RustBuffer uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SYSTEMPACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SYSTEMPACKAGE +void* uniffi_iota_sdk_ffi_fn_clone_systempackage(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SYSTEMPACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SYSTEMPACKAGE +void uniffi_iota_sdk_ffi_fn_free_systempackage(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SYSTEMPACKAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SYSTEMPACKAGE_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_systempackage_new(uint64_t version, RustBuffer modules, RustBuffer dependencies, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_DEPENDENCIES +RustBuffer uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_MODULES +RustBuffer uniffi_iota_sdk_ffi_fn_method_systempackage_modules(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SYSTEMPACKAGE_VERSION +uint64_t uniffi_iota_sdk_ffi_fn_method_systempackage_version(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTION void* uniffi_iota_sdk_ffi_fn_clone_transaction(void* ptr, RustCallStatus *out_status @@ -3520,6 +3645,108 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_digest(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CANCELLEDTRANSACTION_VERSION_ASSIGNMENTS uint16_t uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_COMPUTATION_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_COMPUTATION_CHARGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_EPOCH +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_EPOCH_START_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_EPOCH_START_TIMESTAMP_MS +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_NON_REFUNDABLE_STORAGE_FEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_NON_REFUNDABLE_STORAGE_FEE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_PROTOCOL_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_PROTOCOL_VERSION +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_STORAGE_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_STORAGE_CHARGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_STORAGE_REBATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_STORAGE_REBATE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_SYSTEM_PACKAGES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCH_SYSTEM_PACKAGES +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE_BURNED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_COMPUTATION_CHARGE_BURNED +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_EPOCH +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_EPOCH_START_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_EPOCH_START_TIMESTAMP_MS +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_NON_REFUNDABLE_STORAGE_FEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_NON_REFUNDABLE_STORAGE_FEE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_PROTOCOL_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_PROTOCOL_VERSION +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_STORAGE_CHARGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_STORAGE_CHARGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_STORAGE_REBATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_STORAGE_REBATE +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_SYSTEM_PACKAGES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHANGEEPOCHV2_SYSTEM_PACKAGES +uint16_t uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCOMMITMENT_AS_ECMH_LIVE_OBJECT_SET_DIGEST @@ -4624,6 +4851,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE_OPT uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_DEPENDENCIES +uint16_t uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_MODULES +uint16_t uniffi_iota_sdk_ffi_checksum_method_systempackage_modules(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_VERSION +uint16_t uniffi_iota_sdk_ffi_checksum_method_systempackage_version(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION @@ -5098,6 +5343,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_rad #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CANCELLEDTRANSACTION_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHANGEEPOCH_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHANGEEPOCH_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHANGEEPOCHV2_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHANGEEPOCHV2_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BASE58 @@ -5656,6 +5913,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_structtag_new(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_STRUCTTAG_STAKED_IOTA uint16_t uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SYSTEMPACKAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SYSTEMPACKAGE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTION_NEW diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index a48e6631d..f2d269709 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -1654,6 +1654,54 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1708,6 +1756,40 @@ fun uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_digest( ): Short fun uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages( +): Short fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest( ): Short fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set( @@ -2076,6 +2158,12 @@ fun uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type( ): Short fun uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_systempackage_modules( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_systempackage_version( +): Short fun uniffi_iota_sdk_ffi_checksum_method_transaction_expiration( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment( @@ -2234,6 +2322,10 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10 ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes( @@ -2420,6 +2512,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transaction_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58( @@ -2635,10 +2729,48 @@ fun uniffi_iota_sdk_ffi_fn_clone_changeepoch(`ptr`: Pointer,uniffi_out_err: Unif ): Pointer fun uniffi_iota_sdk_ffi_fn_free_changeepoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new(`epoch`: Long,`protocolVersion`: Long,`storageCharge`: Long,`computationCharge`: Long,`storageRebate`: Long,`nonRefundableStorageFee`: Long,`epochStartTimestampMs`: Long,`systemPackages`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new(`epoch`: Long,`protocolVersion`: Long,`storageCharge`: Long,`computationCharge`: Long,`computationChargeBurned`: Long,`storageRebate`: Long,`nonRefundableStorageFee`: Long,`epochStartTimestampMs`: Long,`systemPackages`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3393,6 +3525,18 @@ fun uniffi_iota_sdk_ffi_fn_method_structtag_coin_type(`ptr`: Pointer,uniffi_out_ ): Pointer fun uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_systempackage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_systempackage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_systempackage_new(`version`: Long,`modules`: RustBuffer.ByValue,`dependencies`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_systempackage_modules(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_systempackage_version(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long fun uniffi_iota_sdk_ffi_fn_clone_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3804,6 +3948,57 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments() != 52539.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge() != 25355.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch() != 49990.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms() != 57669.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee() != 28070.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version() != 40406.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge() != 35870.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate() != 21786.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages() != 55002.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge() != 4379.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned() != 17712.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch() != 52992.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms() != 35398.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee() != 38234.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version() != 16414.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge() != 4751.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate() != 52102.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages() != 48705.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() != 41616.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4356,6 +4551,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() != 65306.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies() != 25411.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_modules() != 23597.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version() != 39738.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4593,6 +4797,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new() != 21959.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new() != 48694.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new() != 52433.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58() != 33027.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4872,6 +5082,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() != 30839.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new() != 25070.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() != 4081.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -8095,11 +8308,88 @@ public object FfiConverterTypeCancelledTransaction: FfiConverter + companion object } +/** + * System transaction used to change the epoch + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * change-epoch = u64 ; next epoch + * u64 ; protocol version + * u64 ; storage charge + * u64 ; computation charge + * u64 ; storage rebate + * u64 ; non-refundable storage fee + * u64 ; epoch start timestamp + * (vector system-package) + * ``` + */ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface { @@ -8118,6 +8408,13 @@ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`epoch`: kotlin.ULong, `protocolVersion`: kotlin.ULong, `storageCharge`: kotlin.ULong, `computationCharge`: kotlin.ULong, `storageRebate`: kotlin.ULong, `nonRefundableStorageFee`: kotlin.ULong, `epochStartTimestampMs`: kotlin.ULong, `systemPackages`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new( + FfiConverterULong.lower(`epoch`),FfiConverterULong.lower(`protocolVersion`),FfiConverterULong.lower(`storageCharge`),FfiConverterULong.lower(`computationCharge`),FfiConverterULong.lower(`storageRebate`),FfiConverterULong.lower(`nonRefundableStorageFee`),FfiConverterULong.lower(`epochStartTimestampMs`),FfiConverterSequenceTypeSystemPackage.lower(`systemPackages`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -8183,6 +8480,127 @@ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface } + /** + * The total amount of gas charged for computation during the epoch. + */override fun `computationCharge`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge( + it, _status) +} + } + ) + } + + + + /** + * The next (to become) epoch ID. + */override fun `epoch`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch( + it, _status) +} + } + ) + } + + + + /** + * Unix timestamp when epoch started + */override fun `epochStartTimestampMs`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms( + it, _status) +} + } + ) + } + + + + /** + * The non-refundable storage fee. + */override fun `nonRefundableStorageFee`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee( + it, _status) +} + } + ) + } + + + + /** + * The protocol version in effect in the new epoch. + */override fun `protocolVersion`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version( + it, _status) +} + } + ) + } + + + + /** + * The total amount of gas charged for storage during the epoch. + */override fun `storageCharge`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge( + it, _status) +} + } + ) + } + + + + /** + * The amount of storage rebate refunded to the txn senders. + */override fun `storageRebate`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate( + it, _status) +} + } + ) + } + + + + /** + * System packages (specifically framework and move stdlib) that are + * written before the new epoch starts. + */override fun `systemPackages`(): List { + return FfiConverterSequenceTypeSystemPackage.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages( + it, _status) +} + } + ) + } + + + @@ -8317,11 +8735,95 @@ public object FfiConverterTypeChangeEpoch: FfiConverter { // +/** + * System transaction used to change the epoch + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * change-epoch = u64 ; next epoch + * u64 ; protocol version + * u64 ; storage charge + * u64 ; computation charge + * u64 ; computation charge burned + * u64 ; storage rebate + * u64 ; non-refundable storage fee + * u64 ; epoch start timestamp + * (vector system-package) + * ``` + */ public interface ChangeEpochV2Interface { + /** + * The total amount of gas charged for computation during the epoch. + */ + fun `computationCharge`(): kotlin.ULong + + /** + * The total amount of gas burned for computation during the epoch. + */ + fun `computationChargeBurned`(): kotlin.ULong + + /** + * The next (to become) epoch ID. + */ + fun `epoch`(): kotlin.ULong + + /** + * Unix timestamp when epoch started + */ + fun `epochStartTimestampMs`(): kotlin.ULong + + /** + * The non-refundable storage fee. + */ + fun `nonRefundableStorageFee`(): kotlin.ULong + + /** + * The protocol version in effect in the new epoch. + */ + fun `protocolVersion`(): kotlin.ULong + + /** + * The total amount of gas charged for storage during the epoch. + */ + fun `storageCharge`(): kotlin.ULong + + /** + * The amount of storage rebate refunded to the txn senders. + */ + fun `storageRebate`(): kotlin.ULong + + /** + * System packages (specifically framework and move stdlib) that are + * written before the new epoch starts. + */ + fun `systemPackages`(): List + companion object } +/** + * System transaction used to change the epoch + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * change-epoch = u64 ; next epoch + * u64 ; protocol version + * u64 ; storage charge + * u64 ; computation charge + * u64 ; computation charge burned + * u64 ; storage rebate + * u64 ; non-refundable storage fee + * u64 ; epoch start timestamp + * (vector system-package) + * ``` + */ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface { @@ -8340,6 +8842,13 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`epoch`: kotlin.ULong, `protocolVersion`: kotlin.ULong, `storageCharge`: kotlin.ULong, `computationCharge`: kotlin.ULong, `computationChargeBurned`: kotlin.ULong, `storageRebate`: kotlin.ULong, `nonRefundableStorageFee`: kotlin.ULong, `epochStartTimestampMs`: kotlin.ULong, `systemPackages`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new( + FfiConverterULong.lower(`epoch`),FfiConverterULong.lower(`protocolVersion`),FfiConverterULong.lower(`storageCharge`),FfiConverterULong.lower(`computationCharge`),FfiConverterULong.lower(`computationChargeBurned`),FfiConverterULong.lower(`storageRebate`),FfiConverterULong.lower(`nonRefundableStorageFee`),FfiConverterULong.lower(`epochStartTimestampMs`),FfiConverterSequenceTypeSystemPackage.lower(`systemPackages`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -8405,6 +8914,142 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface } + /** + * The total amount of gas charged for computation during the epoch. + */override fun `computationCharge`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge( + it, _status) +} + } + ) + } + + + + /** + * The total amount of gas burned for computation during the epoch. + */override fun `computationChargeBurned`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned( + it, _status) +} + } + ) + } + + + + /** + * The next (to become) epoch ID. + */override fun `epoch`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch( + it, _status) +} + } + ) + } + + + + /** + * Unix timestamp when epoch started + */override fun `epochStartTimestampMs`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms( + it, _status) +} + } + ) + } + + + + /** + * The non-refundable storage fee. + */override fun `nonRefundableStorageFee`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee( + it, _status) +} + } + ) + } + + + + /** + * The protocol version in effect in the new epoch. + */override fun `protocolVersion`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version( + it, _status) +} + } + ) + } + + + + /** + * The total amount of gas charged for storage during the epoch. + */override fun `storageCharge`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge( + it, _status) +} + } + ) + } + + + + /** + * The amount of storage rebate refunded to the txn senders. + */override fun `storageRebate`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate( + it, _status) +} + } + ) + } + + + + /** + * System packages (specifically framework and move stdlib) that are + * written before the new epoch starts. + */override fun `systemPackages`(): List { + return FfiConverterSequenceTypeSystemPackage.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages( + it, _status) +} + } + ) + } + + + @@ -25566,6 +26211,303 @@ public object FfiConverterTypeStructTag: FfiConverter { // +/** + * System package + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * system-package = u64 ; version + * (vector bytes) ; modules + * (vector object-id) ; dependencies + * ``` + */ +public interface SystemPackageInterface { + + fun `dependencies`(): List + + fun `modules`(): List + + fun `version`(): kotlin.ULong + + companion object +} + +/** + * System package + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * system-package = u64 ; version + * (vector bytes) ; modules + * (vector object-id) ; dependencies + * ``` + */ +open class SystemPackage: Disposable, AutoCloseable, SystemPackageInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + constructor(`version`: kotlin.ULong, `modules`: List, `dependencies`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_systempackage_new( + FfiConverterULong.lower(`version`),FfiConverterSequenceByteArray.lower(`modules`),FfiConverterSequenceTypeObjectId.lower(`dependencies`),_status) +} + ) + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_systempackage(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_systempackage(pointer!!, status) + } + } + + override fun `dependencies`(): List { + return FfiConverterSequenceTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies( + it, _status) +} + } + ) + } + + + override fun `modules`(): List { + return FfiConverterSequenceByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_systempackage_modules( + it, _status) +} + } + ) + } + + + override fun `version`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_systempackage_version( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeSystemPackage: FfiConverter { + + override fun lower(value: SystemPackage): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): SystemPackage { + return SystemPackage(value) + } + + override fun read(buf: ByteBuffer): SystemPackage { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: SystemPackage) = 8UL + + override fun write(value: SystemPackage, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + /** * A transaction * @@ -39276,6 +40218,34 @@ public object FfiConverterSequenceTypeObjectId: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeSystemPackage.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeSystemPackage.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeSystemPackage.write(it, buf) + } + } +} + + + + /** * @suppress */ diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 8cb6c7bc2..af373fcdd 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -479,6 +479,40 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments() != 52539: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge() != 25355: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch() != 49990: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms() != 57669: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee() != 28070: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version() != 40406: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge() != 35870: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate() != 21786: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages() != 55002: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge() != 4379: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned() != 17712: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch() != 52992: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms() != 35398: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee() != 38234: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version() != 16414: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge() != 4751: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate() != 52102: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages() != 48705: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() != 41616: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set() != 22589: @@ -847,6 +881,12 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() != 65306: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies() != 25411: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_modules() != 23597: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version() != 39738: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() != 5316: @@ -1005,6 +1045,10 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new() != 21959: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new() != 48694: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new() != 52433: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58() != 33027: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes() != 37261: @@ -1191,6 +1235,8 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() != 30839: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new() != 25070: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() != 4081: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58() != 15069: @@ -1600,6 +1646,58 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_changeepoch.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_changeepochv2.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1610,6 +1708,64 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_changeepochv2.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3542,6 +3698,38 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_systempackage.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_systempackage.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_systempackage.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_systempackage.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_systempackage_new.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_systempackage_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_modules.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_modules.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_version.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_version.restype = ctypes.c_uint64 _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transaction.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -4486,6 +4674,57 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_cancelledtransaction_version_assignments.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_computation_charge.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_epoch_start_timestamp_ms.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_non_refundable_storage_fee.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_protocol_version.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_charge.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_storage_rebate.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepoch_system_packages.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_computation_charge_burned.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_epoch_start_timestamp_ms.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_non_refundable_storage_fee.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_protocol_version.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_charge.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_storage_rebate.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_changeepochv2_system_packages.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest.restype = ctypes.c_uint16 @@ -5038,6 +5277,15 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_dependencies.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_modules.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_modules.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.restype = ctypes.c_uint16 @@ -5275,6 +5523,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_cancelledtransaction_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58.restype = ctypes.c_uint16 @@ -5554,6 +5808,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_systempackage_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new.restype = ctypes.c_uint16 @@ -5976,6 +6233,8 @@ def write(value, buf): + + @@ -15585,6 +15844,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeSystemPackage(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeSystemPackage.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeSystemPackage.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeSystemPackage.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeTransactionDigest(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -17513,13 +17797,122 @@ def read(cls, buf: _UniffiRustBuffer): def write(cls, value: CancelledTransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class ChangeEpochProtocol(typing.Protocol): - pass + """ + System transaction used to change the epoch + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + change-epoch = u64 ; next epoch + u64 ; protocol version + u64 ; storage charge + u64 ; computation charge + u64 ; storage rebate + u64 ; non-refundable storage fee + u64 ; epoch start timestamp + (vector system-package) + ``` + """ + + def computation_charge(self, ): + """ + The total amount of gas charged for computation during the epoch. + """ + + raise NotImplementedError + def epoch(self, ): + """ + The next (to become) epoch ID. + """ + + raise NotImplementedError + def epoch_start_timestamp_ms(self, ): + """ + Unix timestamp when epoch started + """ + + raise NotImplementedError + def non_refundable_storage_fee(self, ): + """ + The non-refundable storage fee. + """ + + raise NotImplementedError + def protocol_version(self, ): + """ + The protocol version in effect in the new epoch. + """ + + raise NotImplementedError + def storage_charge(self, ): + """ + The total amount of gas charged for storage during the epoch. + """ + + raise NotImplementedError + def storage_rebate(self, ): + """ + The amount of storage rebate refunded to the txn senders. + """ + + raise NotImplementedError + def system_packages(self, ): + """ + System packages (specifically framework and move stdlib) that are + written before the new epoch starts. + """ + + raise NotImplementedError # ChangeEpoch is a Rust-only trait - it's a wrapper around a Rust implementation. class ChangeEpoch(): + """ + System transaction used to change the epoch + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + change-epoch = u64 ; next epoch + u64 ; protocol version + u64 ; storage charge + u64 ; computation charge + u64 ; storage rebate + u64 ; non-refundable storage fee + u64 ; epoch start timestamp + (vector system-package) + ``` + """ + _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, epoch: "int",protocol_version: "int",storage_charge: "int",computation_charge: "int",storage_rebate: "int",non_refundable_storage_fee: "int",epoch_start_timestamp_ms: "int",system_packages: "typing.List[SystemPackage]"): + _UniffiConverterUInt64.check_lower(epoch) + + _UniffiConverterUInt64.check_lower(protocol_version) + + _UniffiConverterUInt64.check_lower(storage_charge) + + _UniffiConverterUInt64.check_lower(computation_charge) + + _UniffiConverterUInt64.check_lower(storage_rebate) + + _UniffiConverterUInt64.check_lower(non_refundable_storage_fee) + + _UniffiConverterUInt64.check_lower(epoch_start_timestamp_ms) + + _UniffiConverterSequenceTypeSystemPackage.check_lower(system_packages) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepoch_new, + _UniffiConverterUInt64.lower(epoch), + _UniffiConverterUInt64.lower(protocol_version), + _UniffiConverterUInt64.lower(storage_charge), + _UniffiConverterUInt64.lower(computation_charge), + _UniffiConverterUInt64.lower(storage_rebate), + _UniffiConverterUInt64.lower(non_refundable_storage_fee), + _UniffiConverterUInt64.lower(epoch_start_timestamp_ms), + _UniffiConverterSequenceTypeSystemPackage.lower(system_packages)) def __del__(self): # In case of partial initialization of instances. @@ -17540,42 +17933,267 @@ def _make_instance_(cls, pointer): return inst + def computation_charge(self, ) -> "int": + """ + The total amount of gas charged for computation during the epoch. + """ -class _UniffiConverterTypeChangeEpoch: + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_computation_charge,self._uniffi_clone_pointer(),) + ) - @staticmethod - def lift(value: int): - return ChangeEpoch._make_instance_(value) - @staticmethod - def check_lower(value: ChangeEpoch): - if not isinstance(value, ChangeEpoch): - raise TypeError("Expected ChangeEpoch instance, {} found".format(type(value).__name__)) - @staticmethod - def lower(value: ChangeEpochProtocol): - if not isinstance(value, ChangeEpoch): - raise TypeError("Expected ChangeEpoch instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - @classmethod - def write(cls, value: ChangeEpochProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) + def epoch(self, ) -> "int": + """ + The next (to become) epoch ID. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch,self._uniffi_clone_pointer(),) + ) + + + + + + def epoch_start_timestamp_ms(self, ) -> "int": + """ + Unix timestamp when epoch started + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_epoch_start_timestamp_ms,self._uniffi_clone_pointer(),) + ) + + + + + + def non_refundable_storage_fee(self, ) -> "int": + """ + The non-refundable storage fee. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_non_refundable_storage_fee,self._uniffi_clone_pointer(),) + ) + + + + + + def protocol_version(self, ) -> "int": + """ + The protocol version in effect in the new epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_protocol_version,self._uniffi_clone_pointer(),) + ) + + + + + + def storage_charge(self, ) -> "int": + """ + The total amount of gas charged for storage during the epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_charge,self._uniffi_clone_pointer(),) + ) + + + + + + def storage_rebate(self, ) -> "int": + """ + The amount of storage rebate refunded to the txn senders. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_storage_rebate,self._uniffi_clone_pointer(),) + ) + + + + + + def system_packages(self, ) -> "typing.List[SystemPackage]": + """ + System packages (specifically framework and move stdlib) that are + written before the new epoch starts. + """ + + return _UniffiConverterSequenceTypeSystemPackage.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepoch_system_packages,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeChangeEpoch: + + @staticmethod + def lift(value: int): + return ChangeEpoch._make_instance_(value) + + @staticmethod + def check_lower(value: ChangeEpoch): + if not isinstance(value, ChangeEpoch): + raise TypeError("Expected ChangeEpoch instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: ChangeEpochProtocol): + if not isinstance(value, ChangeEpoch): + raise TypeError("Expected ChangeEpoch instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: ChangeEpochProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class ChangeEpochV2Protocol(typing.Protocol): - pass + """ + System transaction used to change the epoch + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + change-epoch = u64 ; next epoch + u64 ; protocol version + u64 ; storage charge + u64 ; computation charge + u64 ; computation charge burned + u64 ; storage rebate + u64 ; non-refundable storage fee + u64 ; epoch start timestamp + (vector system-package) + ``` + """ + + def computation_charge(self, ): + """ + The total amount of gas charged for computation during the epoch. + """ + + raise NotImplementedError + def computation_charge_burned(self, ): + """ + The total amount of gas burned for computation during the epoch. + """ + + raise NotImplementedError + def epoch(self, ): + """ + The next (to become) epoch ID. + """ + + raise NotImplementedError + def epoch_start_timestamp_ms(self, ): + """ + Unix timestamp when epoch started + """ + + raise NotImplementedError + def non_refundable_storage_fee(self, ): + """ + The non-refundable storage fee. + """ + + raise NotImplementedError + def protocol_version(self, ): + """ + The protocol version in effect in the new epoch. + """ + + raise NotImplementedError + def storage_charge(self, ): + """ + The total amount of gas charged for storage during the epoch. + """ + + raise NotImplementedError + def storage_rebate(self, ): + """ + The amount of storage rebate refunded to the txn senders. + """ + + raise NotImplementedError + def system_packages(self, ): + """ + System packages (specifically framework and move stdlib) that are + written before the new epoch starts. + """ + + raise NotImplementedError # ChangeEpochV2 is a Rust-only trait - it's a wrapper around a Rust implementation. class ChangeEpochV2(): + """ + System transaction used to change the epoch + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + change-epoch = u64 ; next epoch + u64 ; protocol version + u64 ; storage charge + u64 ; computation charge + u64 ; computation charge burned + u64 ; storage rebate + u64 ; non-refundable storage fee + u64 ; epoch start timestamp + (vector system-package) + ``` + """ + _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, epoch: "int",protocol_version: "int",storage_charge: "int",computation_charge: "int",computation_charge_burned: "int",storage_rebate: "int",non_refundable_storage_fee: "int",epoch_start_timestamp_ms: "int",system_packages: "typing.List[SystemPackage]"): + _UniffiConverterUInt64.check_lower(epoch) + + _UniffiConverterUInt64.check_lower(protocol_version) + + _UniffiConverterUInt64.check_lower(storage_charge) + + _UniffiConverterUInt64.check_lower(computation_charge) + + _UniffiConverterUInt64.check_lower(computation_charge_burned) + + _UniffiConverterUInt64.check_lower(storage_rebate) + + _UniffiConverterUInt64.check_lower(non_refundable_storage_fee) + + _UniffiConverterUInt64.check_lower(epoch_start_timestamp_ms) + + _UniffiConverterSequenceTypeSystemPackage.check_lower(system_packages) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_changeepochv2_new, + _UniffiConverterUInt64.lower(epoch), + _UniffiConverterUInt64.lower(protocol_version), + _UniffiConverterUInt64.lower(storage_charge), + _UniffiConverterUInt64.lower(computation_charge), + _UniffiConverterUInt64.lower(computation_charge_burned), + _UniffiConverterUInt64.lower(storage_rebate), + _UniffiConverterUInt64.lower(non_refundable_storage_fee), + _UniffiConverterUInt64.lower(epoch_start_timestamp_ms), + _UniffiConverterSequenceTypeSystemPackage.lower(system_packages)) def __del__(self): # In case of partial initialization of instances. @@ -17596,6 +18214,124 @@ def _make_instance_(cls, pointer): return inst + def computation_charge(self, ) -> "int": + """ + The total amount of gas charged for computation during the epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge,self._uniffi_clone_pointer(),) + ) + + + + + + def computation_charge_burned(self, ) -> "int": + """ + The total amount of gas burned for computation during the epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_computation_charge_burned,self._uniffi_clone_pointer(),) + ) + + + + + + def epoch(self, ) -> "int": + """ + The next (to become) epoch ID. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch,self._uniffi_clone_pointer(),) + ) + + + + + + def epoch_start_timestamp_ms(self, ) -> "int": + """ + Unix timestamp when epoch started + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_epoch_start_timestamp_ms,self._uniffi_clone_pointer(),) + ) + + + + + + def non_refundable_storage_fee(self, ) -> "int": + """ + The non-refundable storage fee. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_non_refundable_storage_fee,self._uniffi_clone_pointer(),) + ) + + + + + + def protocol_version(self, ) -> "int": + """ + The protocol version in effect in the new epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_protocol_version,self._uniffi_clone_pointer(),) + ) + + + + + + def storage_charge(self, ) -> "int": + """ + The total amount of gas charged for storage during the epoch. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_charge,self._uniffi_clone_pointer(),) + ) + + + + + + def storage_rebate(self, ) -> "int": + """ + The amount of storage rebate refunded to the txn senders. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_storage_rebate,self._uniffi_clone_pointer(),) + ) + + + + + + def system_packages(self, ) -> "typing.List[SystemPackage]": + """ + System packages (specifically framework and move stdlib) that are + written before the new epoch starts. + """ + + return _UniffiConverterSequenceTypeSystemPackage.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_changeepochv2_system_packages,self._uniffi_clone_pointer(),) + ) + + + + + class _UniffiConverterTypeChangeEpochV2: @@ -26148,6 +26884,130 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: StructTagProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class SystemPackageProtocol(typing.Protocol): + """ + System package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + system-package = u64 ; version + (vector bytes) ; modules + (vector object-id) ; dependencies + ``` + """ + + def dependencies(self, ): + raise NotImplementedError + def modules(self, ): + raise NotImplementedError + def version(self, ): + raise NotImplementedError +# SystemPackage is a Rust-only trait - it's a wrapper around a Rust implementation. +class SystemPackage(): + """ + System package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + system-package = u64 ; version + (vector bytes) ; modules + (vector object-id) ; dependencies + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, version: "int",modules: "typing.List[bytes]",dependencies: "typing.List[ObjectId]"): + _UniffiConverterUInt64.check_lower(version) + + _UniffiConverterSequenceBytes.check_lower(modules) + + _UniffiConverterSequenceTypeObjectId.check_lower(dependencies) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_systempackage_new, + _UniffiConverterUInt64.lower(version), + _UniffiConverterSequenceBytes.lower(modules), + _UniffiConverterSequenceTypeObjectId.lower(dependencies)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_systempackage, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_systempackage, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def dependencies(self, ) -> "typing.List[ObjectId]": + return _UniffiConverterSequenceTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_dependencies,self._uniffi_clone_pointer(),) + ) + + + + + + def modules(self, ) -> "typing.List[bytes]": + return _UniffiConverterSequenceBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_modules,self._uniffi_clone_pointer(),) + ) + + + + + + def version(self, ) -> "int": + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_systempackage_version,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeSystemPackage: + + @staticmethod + def lift(value: int): + return SystemPackage._make_instance_(value) + + @staticmethod + def check_lower(value: SystemPackage): + if not isinstance(value, SystemPackage): + raise TypeError("Expected SystemPackage instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: SystemPackageProtocol): + if not isinstance(value, SystemPackage): + raise TypeError("Expected SystemPackage instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: SystemPackageProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class TransactionProtocol(typing.Protocol): """ A transaction @@ -28682,6 +29542,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "SimpleSignature", "SplitCoins", "StructTag", + "SystemPackage", "Transaction", "TransactionDigest", "TransactionEffects", diff --git a/crates/iota-sdk-ffi/src/types/transaction/mod.rs b/crates/iota-sdk-ffi/src/types/transaction/mod.rs index f584c5fda..7c5fe2c45 100644 --- a/crates/iota-sdk-ffi/src/types/transaction/mod.rs +++ b/crates/iota-sdk-ffi/src/types/transaction/mod.rs @@ -7,7 +7,7 @@ use iota_types::{GasCostSummary, TransactionExpiration}; use crate::types::{ address::Address, - checkpoint::CheckpointTimestamp, + checkpoint::{CheckpointTimestamp, EpochId, ProtocolVersion}, digest::{CheckpointDigest, ConsensusCommitDigest, TransactionDigest, TransactionEventsDigest}, events::Event, execution_status::ExecutionStatus, @@ -844,12 +844,250 @@ impl GenesisTransaction { } } +/// System transaction used to change the epoch +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// change-epoch = u64 ; next epoch +/// u64 ; protocol version +/// u64 ; storage charge +/// u64 ; computation charge +/// u64 ; storage rebate +/// u64 ; non-refundable storage fee +/// u64 ; epoch start timestamp +/// (vector system-package) +/// ``` #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ChangeEpoch(pub iota_types::ChangeEpoch); +#[uniffi::export] +impl ChangeEpoch { + #[uniffi::constructor] + #[expect(clippy::too_many_arguments)] + pub fn new( + epoch: EpochId, + protocol_version: ProtocolVersion, + storage_charge: u64, + computation_charge: u64, + storage_rebate: u64, + non_refundable_storage_fee: u64, + epoch_start_timestamp_ms: u64, + system_packages: Vec>, + ) -> Self { + Self(iota_types::ChangeEpoch { + epoch, + protocol_version, + storage_charge, + computation_charge, + storage_rebate, + non_refundable_storage_fee, + epoch_start_timestamp_ms, + system_packages: system_packages + .into_iter() + .map(|package| package.0.clone()) + .collect(), + }) + } + + /// The next (to become) epoch ID. + pub fn epoch(&self) -> EpochId { + self.0.epoch + } + + /// The protocol version in effect in the new epoch. + pub fn protocol_version(&self) -> ProtocolVersion { + self.0.protocol_version + } + + /// The total amount of gas charged for storage during the epoch. + pub fn storage_charge(&self) -> u64 { + self.0.storage_charge + } + + /// The total amount of gas charged for computation during the epoch. + pub fn computation_charge(&self) -> u64 { + self.0.computation_charge + } + + /// The amount of storage rebate refunded to the txn senders. + pub fn storage_rebate(&self) -> u64 { + self.0.storage_rebate + } + + /// The non-refundable storage fee. + pub fn non_refundable_storage_fee(&self) -> u64 { + self.0.non_refundable_storage_fee + } + + /// Unix timestamp when epoch started + pub fn epoch_start_timestamp_ms(&self) -> u64 { + self.0.epoch_start_timestamp_ms + } + + /// System packages (specifically framework and move stdlib) that are + /// written before the new epoch starts. + pub fn system_packages(&self) -> Vec> { + self.0 + .system_packages + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// System package +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// system-package = u64 ; version +/// (vector bytes) ; modules +/// (vector object-id) ; dependencies +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct SystemPackage(pub iota_types::SystemPackage); + +#[uniffi::export] +impl SystemPackage { + #[uniffi::constructor] + pub fn new(version: Version, modules: Vec>, dependencies: Vec>) -> Self { + Self(iota_types::SystemPackage { + version, + modules, + dependencies: dependencies.into_iter().map(|dep| dep.0).collect(), + }) + } + + pub fn version(&self) -> Version { + self.0.version + } + + pub fn modules(&self) -> Vec> { + self.0.modules.clone() + } + + pub fn dependencies(&self) -> Vec> { + self.0 + .dependencies + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// System transaction used to change the epoch +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// change-epoch = u64 ; next epoch +/// u64 ; protocol version +/// u64 ; storage charge +/// u64 ; computation charge +/// u64 ; computation charge burned +/// u64 ; storage rebate +/// u64 ; non-refundable storage fee +/// u64 ; epoch start timestamp +/// (vector system-package) +/// ``` #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ChangeEpochV2(pub iota_types::ChangeEpochV2); +#[uniffi::export] +impl ChangeEpochV2 { + #[uniffi::constructor] + #[expect(clippy::too_many_arguments)] + pub fn new( + epoch: EpochId, + protocol_version: ProtocolVersion, + storage_charge: u64, + computation_charge: u64, + computation_charge_burned: u64, + storage_rebate: u64, + non_refundable_storage_fee: u64, + epoch_start_timestamp_ms: u64, + system_packages: Vec>, + ) -> Self { + Self(iota_types::ChangeEpochV2 { + epoch, + protocol_version, + storage_charge, + computation_charge, + computation_charge_burned, + storage_rebate, + non_refundable_storage_fee, + epoch_start_timestamp_ms, + system_packages: system_packages + .into_iter() + .map(|package| package.0.clone()) + .collect(), + }) + } + + /// The next (to become) epoch ID. + pub fn epoch(&self) -> EpochId { + self.0.epoch + } + + /// The protocol version in effect in the new epoch. + pub fn protocol_version(&self) -> ProtocolVersion { + self.0.protocol_version + } + + /// The total amount of gas charged for storage during the epoch. + pub fn storage_charge(&self) -> u64 { + self.0.storage_charge + } + + /// The total amount of gas charged for computation during the epoch. + pub fn computation_charge(&self) -> u64 { + self.0.computation_charge + } + + /// The total amount of gas burned for computation during the epoch. + pub fn computation_charge_burned(&self) -> u64 { + self.0.computation_charge_burned + } + + /// The amount of storage rebate refunded to the txn senders. + pub fn storage_rebate(&self) -> u64 { + self.0.storage_rebate + } + + /// The non-refundable storage fee. + pub fn non_refundable_storage_fee(&self) -> u64 { + self.0.non_refundable_storage_fee + } + + /// Unix timestamp when epoch started + pub fn epoch_start_timestamp_ms(&self) -> u64 { + self.0.epoch_start_timestamp_ms + } + + /// System packages (specifically framework and move stdlib) that are + /// written before the new epoch starts. + pub fn system_packages(&self) -> Vec> { + self.0 + .system_packages + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct AuthenticatorStateExpire(pub iota_types::AuthenticatorStateExpire); diff --git a/crates/iota-sdk-types/src/transaction/mod.rs b/crates/iota-sdk-types/src/transaction/mod.rs index ce722af18..dd20abeda 100644 --- a/crates/iota-sdk-types/src/transaction/mod.rs +++ b/crates/iota-sdk-types/src/transaction/mod.rs @@ -640,16 +640,22 @@ pub struct ChangeEpoch { pub system_packages: Vec, } -/// System package +/// System transaction used to change the epoch /// /// # BCS /// /// The BCS serialized form for this type is defined by the following ABNF: /// /// ```text -/// system-package = u64 ; version -/// (vector bytes) ; modules -/// (vector object-id) ; dependencies +/// change-epoch = u64 ; next epoch +/// u64 ; protocol version +/// u64 ; storage charge +/// u64 ; computation charge +/// u64 ; computation charge burned +/// u64 ; storage rebate +/// u64 ; non-refundable storage fee +/// u64 ; epoch start timestamp +/// (vector system-package) /// ``` #[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(